@iframe-resizer/child 5.5.8 → 5.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.cjs.js +2 -2
- package/index.esm.js +2 -2
- package/index.umd.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.5.
|
|
4
|
+
* @module iframe-resizer/child 5.5.9 (cjs) - 2026-02-06
|
|
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,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
"use strict";const e=require("auto-console-group"),t="5.5.8",n="iframeResizer",o=":",r="init",i="message",a="pageHide",s="pageInfo",c="parentInfo",l="scrollToOffset",d="title",u=10,m="data-iframe-size",f="data-iframe-overflowed",p="data-iframe-ignore",h="height",y="width",g="offset",b="offsetSize",v="string",z="number",w="object",$="function",O="auto",I="readystatechange",S="bottom",T="right",E="autoResizeEnabled",M=Symbol("sizeChanged"),H="manualResize",j="parentResize",k={[H]:1,[j]:1},N="setOffsetSize",R="resizeObserver",x="overflowObserver",A="mutationObserver",L="visibilityObserver",C="[iFrameSizer]",G=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),P=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)},D=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),B=["spjluzl","rlf","clyzpvu"],q=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],F=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],W=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),U=e=>D(q[e]),V=e=>{const t=e[D(B[0])]||e[D(B[1])]||e[D(B[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=P(D(e));return n in W&&(t=W[n]),t}(n[0]);return 0===o||(e=>e[2]===P(e[0]+e[1]))(n)||(o=-2),o},Z=(e,...t)=>setTimeout(()=>e(...t),0),J=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},_=e=>e,Q=e=>Math.round(1e3*e)/1e3,Y=e=>e.charAt(0).toUpperCase()+e.slice(1),X=e=>""!=`${e}`&&void 0!==e,K=e=>e();const ee=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Y(t)}`)},te={br:"\n",rb:"[31;1m",bb:"[34;1m",b:"[1m",i:"[3m",u:"[4m","/":"[m"},ne=Object.keys(te),oe=new RegExp(`<(${ne.join("|")})>`,"gi"),re=(e,t)=>te[t]??"";let ie=!0,ae=n;var se;const ce=(se=e,se?.__esModule?se.default:se)({label:`${n}(child)`,expand:!1});var le;const de=(le="log",(...e)=>!ie||ce[le](...e));const{assert:ue,endAutoGroup:me,error:fe,errorBoundary:pe,event:he,label:ye,purge:ge,warn:be}=ce,ve=(ze=_,e=>ze(typeof e===v?window.chrome?e.replace(oe,re):(e=>e.replaceAll("<br>","\n").replaceAll(/<\/?[^>]+>/gi,""))(e):e));var ze;const we=(...e)=>ce.warn(...e.map(ve)),$e=(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)=>we(t)),Oe=$e("Method"),Ie=$e("Method","replaced with"),Se=$e("Option"),Te=["min-height","min-width","max-height","max-width"],Ee=new Set,Me=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),He=(e,t)=>{return(n=Me(e,t))&&"0px"!==n&&n!==O&&"none"!==n;var n};function je({href:e}){Ee.has(e)||Ee.add(e)}const ke=(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){je(n)}return{source:"cross-origin stylesheet",value:Me(e,t)}}(e,t),Ne=(e,t)=>{const{source:n,value:o}=ke(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);we(`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 Re(){for(const e of[document.documentElement,document.body])for(const t of Te)He(e,t)&&Ne(e,t)}const xe=e=>t=>void 0===t?void 0:e(t),Ae=xe(e=>"true"===e),Le=xe(Number),Ce=[],Ge=(e,t,n,o)=>{e.removeEventListener(t,n,o)},Pe=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),Ce.push(()=>Ge(e,t,n,o))},De=e=>e=>{e.size},Be=((e="")=>t=>n=>{n.size>0&&fe(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),qe=e=>e=>{e.size},Fe=(t,n=!0)=>o=>{o>0&&de(`${n?"At":"De"}tached %c${t}Observer%c ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,e.HIGHLIGHT,e.NORMAL,e.HIGHLIGHT,e.NORMAL)},We=(e,t,n,o)=>{const r=qe(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()}},Ue=new Set,Ve=new Set,Ze=new Set,Je=[],_e={attributes:!0,attributeFilter:[p,m],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Qe,Ye=1,Xe=!1,Ke=0;const et=e=>{e.size},tt=e=>{e.size},nt=e=>{e.size},ot=e=>e.nodeType!==Node.ELEMENT_NODE||G.has(e.tagName.toLowerCase());function rt(e){const t=e.addedNodes;for(const e of t)ot(e)||Ue.add(e)}function it(e){const t=e.removedNodes;for(const e of t)ot(e)||(Ue.has(e)?(Ue.delete(e),Ze.add(e)):Ve.add(e))}const at=e=>{de("Mutations:",e);for(const t of e)rt(t),it(t);et(Ue),tt(Ve),nt(Ze),Ze.clear()};const st=t=>()=>{const n=performance.now(),o=n-Ke,r=16*Ye+++2;if(o>r&&o<200)return he("mutationThrottled"),de("Update delayed due to heavy workload on the callStack"),de(`EventLoop busy time: %c${Q(o)}ms %c> Max wait: %c${r-2}ms`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),setTimeout(Qe,16*Ye),void(Ke=n);Ye=1,Je.forEach(at),Je.length=0,Xe=!1,Ve.size,Ue.size,t({addedNodes:Ue,removedNodes:Ve}),Ue.clear(),Ve.clear()};function ct(e){Je.push(e),Xe||(Ke=performance.now(),Xe=!0,requestAnimationFrame(Qe))}function lt(t){const n=new window.MutationObserver(ct),o=document.body||document.documentElement;return Qe=st(t),n.observe(o,_e),de("Attached%c MutationObserver%c to body",e.HIGHLIGHT,e.FOREGROUND),{...n,disconnect:()=>{Ue.clear(),Ve.clear(),Je.length=0,n.disconnect(),de("Detached%c MutationObserver",e.HIGHLIGHT)}}}const dt="Overflow",ut=Fe(dt),mt=Fe(dt,!1),ft=De(dt),pt=Be(dt),ht=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,yt=(t,n)=>{const o=n.side,r={root:n.root,rootMargin:"0px",threshold:1},i=window?.requestAnimationFrame||_,a=(e=!1)=>t(e),s=(e,t)=>0===e||e>t[o],c=(e,t)=>e.toggleAttribute(f,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:n,target:r}=t;if(!n)continue;const i=e[o],a=s(i,n)&&!ht(r);c(r,a)}i(a)},r),d=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&&(d.has(r)?t.add(r):(l.observe(r),d.add(r),n.add(r),o+=1));pt(t),ft(n),ut(o),n.clear(),t.clear()},detachObservers:We(dt,l,d,mt),disconnect:()=>{l.disconnect(),de("Detached%c OverflowObserver",e.HIGHLIGHT)}}},gt="--ifr-start",bt="--ifr-end",vt="--ifr-measure",zt=[];let wt,$t={},Ot=0;function It(){try{performance.clearMarks(gt),performance.clearMarks(bt),performance.clearMeasures(vt)}catch{}}function St(e){e.getEntries().forEach(e=>{if(e.name===bt)try{const{duration:t}=performance.measure(vt,gt,bt);$t=e.detail,zt.push(t),zt.length>100&&zt.shift()}catch{}})}function Tt(){de("Attached%c PerformanceObserver%c to page",e.HIGHLIGHT,e.FOREGROUND);const t=new PerformanceObserver(St);return t.observe({entryTypes:["mark"]}),wt=setInterval(()=>{if(zt.length<10)return;if($t.hasTags&&$t.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=Q(e);t>Ot&&(Ot=t,he("performanceObserver")),It(),e<=4||(clearInterval(wt),we(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${Q(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${$t.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{It(),clearInterval(wt),t.disconnect(),de("Detached%c PerformanceObserver",e.HIGHLIGHT)}}}const Et="Resize",Mt=Fe(Et),Ht=Fe(Et,!1),jt=De(Et),kt=Be(Et),Nt=new WeakSet,Rt=new Set,xt=new Set;let At;function Lt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Nt.has(n)?Rt.add(n):(At.observe(n),Nt.add(n),xt.add(n),t+=1))}kt(Rt),jt(xt),Mt(t),xt.clear(),Rt.clear()}function Ct(t){const n=new IntersectionObserver(e=>t(e.at(-1).isIntersecting),{threshold:0}),o=document.documentElement;return n.observe(o),de("Attached%c VisibilityObserver%c to page",e.HIGHLIGHT,e.FOREGROUND),{disconnect:()=>{n.disconnect(),de("Detached%c VisibilityObserver",e.HIGHLIGHT)}}}const Gt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Pt=Gt($),Dt=Gt(z),Bt=Gt(v);"undefined"!=typeof window&&function(){const P={height:()=>(be("Custom height calculation function not defined"),Hn.auto()),width:()=>(be("Custom width calculation function not defined"),jn.auto())},q={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},W={},Q=O,te="scroll";let ne,oe,re,se,le,ve,ze,$e=!0,Te="",Ee=0,Me="",He="",je=!1,ke=!0,Ne=!1,xe=!0,De=!1,Be=!1,qe=!0,Fe=!1,Ue=1,Ve=Q,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=[],dt=window.parent,ut="*",mt=0,ft=!1,pt=1,ht=te,vt=window,zt=()=>{be("onMessage function not defined")},wt=()=>{},$t=null,Ot=null;function It(o){var i;!function(e){rt=e[0]??rt,Ee=Le(e[1])??Ee,Ne=Ae(e[2])??Ne,Xe=Ae(e[3])??Xe,$e=Ae(e[6])??$e,Me=e[7]??Me,Ve=e[8]??Ve,Te=e[9]??Te,He=e[10]??He,mt=Le(e[11])??mt,_e.enable=Ae(e[12])??!1,it=e[13]??it,ht=e[14]??ht,et=Ae(e[15])??et,tt=Le(e[16])??tt,nt=Le(e[17])??nt,ke=Ae(e[18])??ke,ne=e[19]??ne,ve=e[20]??ve,Ke=Le(e[21])??Ke,Ye=Ae(e[23])??Ye}(o),ae=(i={id:rt,enabled:Xe,expand:Ye}).id||n,ce.label(`${ae}`),ce.expand(i.expand),ie=i.enabled,he("initReceived"),function(){function t(e){ze=Pt(e,"onBeforeResize")??ze,zt=Pt(e,"onMessage")??zt,wt=Pt(e,"onReady")??wt,typeof e?.offset===z&&(Se(g,b),ke&&(tt=Dt(e,g)??tt),Ne&&(nt=Dt(e,g)??nt)),typeof e?.offsetSize===z&&(ke&&(tt=Dt(e,b)??tt),Ne&&(nt=Dt(e,b)??nt)),oe=Bt(e,D(B[0]))??oe,Ze=Bt(e,"ignoreSelector")??Ze,st=Bt(e,"sizeSelector")??st,ut=Bt(e,"targetOrigin")??ut,Ve=e?.heightCalculationMethod||Ve,ht=e?.widthCalculationMethod||ht}function n(e,t){return typeof e===$&&(we(`<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.`),P[t]=e,e="custom"),e}if(1===Ke)return;const o=window.iframeResizer||window.iFrameResizer;typeof o===w&&(t(o),Ve=n(Ve,h),ht=n(ht,y),de(`Set targetOrigin for parent: %c${ut}`,e.HIGHLIGHT))}(),[Ft,Ut,nn,Gt,Wt,en,tn,Xt,qt,Rt,je?_:Re,_t,()=>Vt("background",Te),()=>Vt("padding",He),je?_:Qt,rn,Jt,zn,an,on,sn,Mt,cn].forEach(e=>{try{e()}catch(e){if(Ke<0)throw e;we("<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</>"),fe(e)}}),kt(J(wt)),me(),Cn(r,"Init message from host page",void 0,void 0,`${t}:${Ke}`),document.title&&""!==document.title&&Dn(0,0,d,document.title)}function St({persisted:e}){e||Dn(0,0,"beforeUnload"),he(a),de("Page persisted:",e),e||Ce.forEach(K)}const Mt=()=>Pe(window,a.toLowerCase(),St);let jt=!1;function kt(e){"complete"===document.readyState?Z(e):jt||Pe(document,I,()=>kt(e)),jt=!0}function Rt(){ct=document.querySelectorAll(`[${m}]`),Fe=ct.length>0}let xt=0;function Gt(){const t=document.querySelectorAll(`*[${p}]`);return De=t.length>0,De&&t.length!==xt&&(function(t){const n=1===t.length?"":"s";be(`%c[${p}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),xt=t.length),De}function qt(){"BackCompat"===document.compatMode&&we("<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 Ft(){ve&&""!==ve&&"false"!==ve?ve!==t&&we(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ve} - Child page: ${t}.\n`):we("<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 Wt(){try{at=1===Ke||"iframeParentListener"in window.parent}catch(e){}}function Ut(){Ne===ke&&(je=!0)}function Vt(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),de(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function Zt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Jt(){Zt(0,m,st),Zt(0,p,Ze)}function _t(){var e,t;void 0===Me&&(Me=`${Ee}px`),Vt("margin",(e="margin",(t=Me).includes("-")&&(be(`Negative CSS value ignored for ${e}`),t=""),t))}function Qt(){const e=e=>e.style.setProperty(h,O,"important");e(document.documentElement),e(document.body)}function Yt(e){({add(t){function n(){Cn(e.eventName,e.eventType)}W[t]=n,Pe(window,t,n,{passive:!0})},remove(e){const t=W[e];delete W[e],Ge(window,e,t)}})[e.method](e.eventName)}function Xt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(m,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&we("<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 Kt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(be(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in q)&&we(`<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 ${ve?"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: '${O}',\n}\n`}\n`),e}function en(){Ve=Kt(Ve,Q,Hn)}function tn(){ht=Kt(ht,te,jn)}function nn(){const n=Ke,o=V({key:ne}),r=V({key:oe});if(Ke=Math.max(o,r),Ke<0){if(Ke=Math.min(o,r),ge(),we(`${U(Ke+2)}${U(2)}`),X(ve))throw U(Ke+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!X(ve)||n>-1&&Ke>n)&&(sessionStorage.getItem("ifr")!==t&&function(t,n){console.info(`${ae} %ciframe-resizer ${t}`,ie||n<1?"font-weight: bold;":e.NORMAL)}(`v${t} (${(e=>D(F[e]))(Ke)})`,Ke),Ke<2&&we(U(3)),sessionStorage.setItem("ifr",t))}function on(){!function(e){Yt({method:e,eventType:"After Print",eventName:"afterprint"}),Yt({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add")}function rn(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function an(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,u)+parseInt(n.x,u),y:parseInt(t.top,u)+parseInt(n.y,u)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Dn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Dn(n.y,n.x,l)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=_e;o&&(1===Ke?we(U(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&Pe(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),Pe(window,"hashchange",n),setTimeout(n,128))),_e={..._e,findTarget:t}}function sn(){function e(e){Dn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){Pe(window.document,t,e)}!0===et&&(t("mouseenter"),t("mouseleave"))}function cn(){1!==Ke&&(vt.parentIframe=Object.freeze({autoResize:e=>(ee(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ne&&!1===ke?(he(E),we("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===$e?($e=!0,queueMicrotask(()=>Cn(E,"Auto Resize enabled"))):!1===e&&!0===$e&&($e=!1),Dn(0,0,"autoResize",JSON.stringify($e)),$e)),close(){Dn(0,0,"close")},getId:()=>rt,getOrigin:()=>(he("getOrigin"),Oe("getOrigin()","getParentOrigin()"),re),getParentOrigin:()=>re,getPageInfo(e){if(typeof e===$)return $t=e,Dn(0,0,s),void Ie("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");$t=null,Dn(0,0,"pageInfoStop")},getParentProps:e=>(ee(e,$,"parentIframe.getParentProps(callback) callback"),Ot=e,Dn(0,0,c),()=>{Ot=null,Dn(0,0,"parentInfoStop")}),getParentProperties(e){Oe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ee(e,v,"parentIframe.moveToAnchor(anchor) anchor"),_e.findTarget(e)},reset(){!function(){const e=Ve;Ve=Q,ft||(ft=!0,requestAnimationFrame(()=>{ft=!1})),Gn("reset"),Ve=e}()},setOffsetSize(e){ee(e,z,"parentIframe.setOffsetSize(offset) offset"),tt=e,nt=e,Cn(N,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ee(e,z,"parentIframe.scrollBy(x, y) x"),ee(t,z,"parentIframe.scrollBy(x, y) y"),Dn(t,e,"scrollBy")},scrollTo(e,t){ee(e,z,"parentIframe.scrollTo(x, y) x"),ee(t,z,"parentIframe.scrollTo(x, y) y"),Dn(t,e,"scrollTo")},scrollToOffset(e,t){ee(e,z,"parentIframe.scrollToOffset(x, y) x"),ee(t,z,"parentIframe.scrollToOffset(x, y) y"),Dn(t,e,l)},sendMessage(e,t){t&&ee(t,v,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Dn(0,0,i,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ve=e,en()},setWidthCalculationMethod(e){ht=e,tn()},setTargetOrigin(e){ee(e,v,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ut=e},resize(e,t){void 0!==e&&ee(e,z,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ee(t,z,"parentIframe.resize(customHeight, customWidth) customWidth"),Cn(H,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Oe("size()","resize()"),this.resize(e,t)}}),vt.parentIFrame=vt.parentIframe)}let ln=new Set;function dn(){const e=document.querySelectorAll(`[${f}]`);ot=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${p}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{he("overflowIgnored"),de("Ignoring elements with [data-iframe-ignore] > *:\n",n),me()}),t}(e),Be=ot.size>0,typeof Set.prototype.symmetricDifference===$&&(qe=ot.symmetricDifference(ln).size>0),ln=ot}function un(){switch(dn(),!0){case!qe:return;case ot.size>1:de("Overflowed Elements:",ot);break;case Be:break;default:de("No overflow detected")}Cn(x,"Overflow updated")}function mn(e){const t={root:document.documentElement,side:ke?S:T};return se=yt(un,t),se.attachObservers(e),se}function fn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Cn(R,`Element resized <${function(e){switch(!0){case!X(e):return"";case X(e.id):return`${e.nodeName}#${e.id}`;case X(e.name):return`${e.nodeName} (${e.name}`;case X(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function pn(t){return At=new ResizeObserver(fn),At.observe(document.body),Nt.add(document.body),de("Attached%c ResizeObserver%c to body",e.HIGHLIGHT,e.FOREGROUND),le={attachObserverToNonStaticElements:Lt,detachObservers:We(Et,At,Nt,Ht),disconnect:()=>{At.disconnect(),de("Detached%c ResizeObserver",e.HIGHLIGHT)}},le.attachObserverToNonStaticElements(t),le}function hn(e){Qe=!e,Cn(L,"Visibility changed")}const yn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of In(n))t.add(e)}return de("Inspecting:\n",t),t},gn=e=>{if(0===e.size)return;he("addObservers");const t=yn(e);se.attachObservers(t),le.attachObserverToNonStaticElements(t),me()},bn=e=>{if(0===e.size)return;he("removeObservers");const t=yn(e);se.detachObservers(t),le.detachObservers(t),me()};function vn(e){!function({addedNodes:e,removedNodes:t}){he("contentMutated"),Jt(),Rt(),dn(),me(),bn(t),gn(e)}(e),Cn(A,"Mutation Observed")}function zn(){const e=In(document.documentElement);var t;t=[lt(vn),mn(e),Tt(),pn(e),Ct(hn)],Ce.push(...t.map(e=>e.disconnect))}function wn(t){performance.mark(gt);const n=Y(t);let o=1,r=document.documentElement,i=Fe?0:document.documentElement.getBoundingClientRect().bottom;const a=Fe?ct:Be?Array.from(ot):In(document.documentElement);for(const e of a)o=e.getBoundingClientRect()[t]+parseFloat(getComputedStyle(e).getPropertyValue(`margin-${t}`)),o>i&&(i=o,r=e);return de(`${n} position calculated from:`,r),de(`Checked %c${a.length}%c elements`,e.HIGHLIGHT,e.FOREGROUND),performance.mark(bt,{detail:{hasTags:Fe,len:a.length,logging:Xe,Side:n}}),i}const $n=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],On=`* ${Array.from(G).map(e=>`:not(${e})`).join("")}`,In=e=>e.querySelectorAll(On),Sn={height:0,width:0},Tn={height:0,width:0},En=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function Mn(t){function n(){return Tn[r]=i,Sn[r]=c,Math.max(i,1)}const o=t===Hn,r=t.label,i=t.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),l=`HTML: %c${i}px %cPage: %c${c}px`;let d=1;switch(!0){case!t.enabled():return Math.max(c,1);case Fe:de("Found element with data-iframe-size attribute"),d=t.taggedElement();break;case!Be&&xe&&0===Tn[r]&&0===Sn[r]:de(`Initial page size values: ${l}`,...En),d=n();break;case ft&&i===Tn[r]&&c===Sn[r]:de(`Size unchanged: ${l}`,...En),d=Math.max(i,c);break;case 0===i&&0!==c:de(`Page is hidden: ${l}`,...En),d=c;break;case!Be&&i!==Tn[r]&&c<=Sn[r]:de(`New <html> size: ${l} `,...En),de(`Previous <html> size: %c${Tn[r]}px`,e.HIGHLIGHT),d=n();break;case!o:d=t.taggedElement();break;case!Be&&i<Tn[r]:de(`<html> size decreased: ${l}`,...En),d=n();break;case c===s||c===a:de(`<html> size equals page size: ${l}`,...En),d=n();break;case i>c:de(`Page size < <html> size: ${l}`,...En),d=n();break;case Be:de("Found elements possibly overflowing <html> "),d=t.taggedElement();break;default:de(`Using <html> size: ${l}`,...En),d=n()}return de(`Content ${r}: %c${d}px`,e.HIGHLIGHT),d+=function(t){const n=t.getOffset();return 0!==n&&de(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),Math.max(d,1)}const Hn={label:h,enabled:()=>ke,getOffset:()=>tt,auto:()=>Mn(Hn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,u)+parseInt(t.marginBottom,u)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Hn.bodyOffset(),custom:()=>P.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...$n(Hn)),min:()=>Math.min(...$n(Hn)),grow:()=>Hn.max(),lowestElement:()=>wn(S),taggedElement:()=>wn(S)},jn={label:y,enabled:()=>Ne,getOffset:()=>nt,auto:()=>Mn(jn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>P.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...$n(jn)),min:()=>Math.min(...$n(jn)),rightMostElement:()=>wn(T),scroll:()=>Math.max(jn.bodyScroll(),jn.documentElementScroll()),taggedElement:()=>wn(T)},kn=(e,t)=>!(Math.abs(e-t)<=mt);function Nn(e,t){const n=e[t](),o=e.enabled()&&void 0!==ze?function(e){const t=ze(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 ue(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Rn=!1;const xn=J(()=>we(U(4)));let An,Ln=!1;const Cn=pe((e,t,n,o,i)=>{switch(he(e),!0){case!0===Qe:if(!0===Ln)break;Ln=!0,Rn=!1,cancelAnimationFrame(An);break;case!0===Rn&&e!==x:ge();break;case!$e&&!(e in k):de("Resizing disabled");break;default:Ln=!1,Rn=!0,performance.now(),An||(An=requestAnimationFrame(()=>{Rn=!1,An=null,he("requestAnimationFrame")})),function(e,t,n,o,i){const a=n??Nn(Hn,Ve),s=o??Nn(jn,ht);switch(ke&&kn(Ue,a)||Ne&&kn(pt,s)?M:e){case r:case E:case M:Ue=a,pt=s;case N:Pn(Ue,pt,e,i);break;case x:case A:case R:case L:ge();break;default:ge(),de("No change in content size detected")}}(e,0,n,o,i)}me()});function Gn(e){Ue=Hn[Ve](),pt=jn[ht](),Dn(Ue,pt,e)}function Pn(t,n,o,r,i){Ke<-1||(void 0!==i||(i=ut),function(){const a=`${rt}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(at)try{window.parent.iframeParentListener(C+a)}catch(e){if(1!==Ke)throw e;return void xn()}else dt.postMessage(C+a,i);de(`Sending message to parent page via ${at?"sameOrigin":"postMessage"}: %c%c${a}`,e.ITALIC,e.HIGHLIGHT)}())}const Dn=pe((e,t,n,o,r)=>{he(n),Pn(e,t,n,o,r),me()}),Bn=pe(function(e){he("onMessage");const{freeze:t}=Object,{parse:n}=JSON,i=e=>Dn(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(o);dt=e.source,re=e.origin,It(t),xe=!1,setTimeout(()=>{Je=!1},128)},reset(){Je||Gn("resetPage")},resize(){Cn(j,"Parent window requested size check")},moveToAnchor(){_e.findTarget(d())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=d();$t?Z($t,n(e)):i(s)},parentInfo(){const e=(o=d(),t(n(o)));var o;Ot?Z(Ot,e):i(c)},message(){const e=d();Z(zt,n(e))}},l=()=>e.data.split("]")[1].split(o)[0],d=()=>e.data.slice(e.data.indexOf(o)+1),u=()=>e.data.split(o)[2]in{true:1,false:1};function m(){const t=l();he(t),t in a?a[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||u()||be(`Unexpected message (${e.data})`)}C===`${e.data}`.slice(0,13)&&function(){if(!1!==xe)return u()?(ye(l()),he(r),void a.init()):void 0;m()}()});let qn=!1;const Fn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Wn(){if("loading"===document.readyState||!xe||qn)return;const{parent:e,top:t}=window;he("ready"),Fn(e),e!==t&&Fn(t),qn=!0}"iframeChildListener"in window?be("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Bn({data:e,sameOrigin:!0})),he("listen"),Pe(window,i,Bn),Pe(document,I,Wn),Wn())}();
|
|
20
|
+
"use strict";const e=require("auto-console-group"),t="5.5.9",n="iframeResizer",o=":",r="init",i="message",a="pageHide",s="pageInfo",c="parentInfo",l="scrollToOffset",d="title",u=10,m="data-iframe-size",f="data-iframe-overflowed",p="data-iframe-ignore",h="height",y="width",g="offset",b="offsetSize",v="string",z="number",w="object",$="function",O="auto",I="readystatechange",S="bottom",T="right",E="autoResizeEnabled",M=Symbol("sizeChanged"),H="manualResize",j="parentResize",k={[H]:1,[j]:1},N="setOffsetSize",R="resizeObserver",x="overflowObserver",A="mutationObserver",L="visibilityObserver",C="[iFrameSizer]",G=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),P=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)},D=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),B=["spjluzl","rlf","clyzpvu"],q=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],F=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],W=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl"].map((e,t)=>[e,Math.max(0,t-1)])),U=e=>D(q[e]),V=e=>{const t=e[D(B[0])]||e[D(B[1])]||e[D(B[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=P(D(e));return n in W&&(t=W[n]),t>4?t-4:t}(n[0]);return 0===o||(e=>e[2]===P(e[0]+e[1]))(n)||(o=-2),o},Z=(e,...t)=>setTimeout(()=>e(...t),0),J=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},_=e=>e,Q=e=>Math.round(1e3*e)/1e3,Y=e=>e.charAt(0).toUpperCase()+e.slice(1),X=e=>""!=`${e}`&&void 0!==e,K=e=>e();const ee=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Y(t)}`)},te={br:"\n",rb:"[31;1m",bb:"[34;1m",b:"[1m",i:"[3m",u:"[4m","/":"[m"},ne=Object.keys(te),oe=new RegExp(`<(${ne.join("|")})>`,"gi"),re=(e,t)=>te[t]??"";let ie=!0,ae=n;var se;const ce=(se=e,se?.__esModule?se.default:se)({label:`${n}(child)`,expand:!1});var le;const de=(le="log",(...e)=>!ie||ce[le](...e));const{assert:ue,endAutoGroup:me,error:fe,errorBoundary:pe,event:he,label:ye,purge:ge,warn:be}=ce,ve=(ze=_,e=>ze(typeof e===v?window.chrome?e.replace(oe,re):(e=>e.replaceAll("<br>","\n").replaceAll(/<\/?[^>]+>/gi,""))(e):e));var ze;const we=(...e)=>ce.warn(...e.map(ve)),$e=(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)=>we(t)),Oe=$e("Method"),Ie=$e("Method","replaced with"),Se=$e("Option"),Te=["min-height","min-width","max-height","max-width"],Ee=new Set,Me=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),He=(e,t)=>{return(n=Me(e,t))&&"0px"!==n&&n!==O&&"none"!==n;var n};function je({href:e}){Ee.has(e)||Ee.add(e)}const ke=(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){je(n)}return{source:"cross-origin stylesheet",value:Me(e,t)}}(e,t),Ne=(e,t)=>{const{source:n,value:o}=ke(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);we(`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 Re(){for(const e of[document.documentElement,document.body])for(const t of Te)He(e,t)&&Ne(e,t)}const xe=e=>t=>void 0===t?void 0:e(t),Ae=xe(e=>"true"===e),Le=xe(Number),Ce=[],Ge=(e,t,n,o)=>{e.removeEventListener(t,n,o)},Pe=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),Ce.push(()=>Ge(e,t,n,o))},De=e=>e=>{e.size},Be=((e="")=>t=>n=>{n.size>0&&fe(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),qe=e=>e=>{e.size},Fe=(t,n=!0)=>o=>{o>0&&de(`${n?"At":"De"}tached %c${t}Observer%c ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,e.HIGHLIGHT,e.NORMAL,e.HIGHLIGHT,e.NORMAL)},We=(e,t,n,o)=>{const r=qe(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()}},Ue=new Set,Ve=new Set,Ze=new Set,Je=[],_e={attributes:!0,attributeFilter:[p,m],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Qe,Ye=1,Xe=!1,Ke=0;const et=e=>{e.size},tt=e=>{e.size},nt=e=>{e.size},ot=e=>e.nodeType!==Node.ELEMENT_NODE||G.has(e.tagName.toLowerCase());function rt(e){const t=e.addedNodes;for(const e of t)ot(e)||Ue.add(e)}function it(e){const t=e.removedNodes;for(const e of t)ot(e)||(Ue.has(e)?(Ue.delete(e),Ze.add(e)):Ve.add(e))}const at=e=>{de("Mutations:",e);for(const t of e)rt(t),it(t);et(Ue),tt(Ve),nt(Ze),Ze.clear()};const st=t=>()=>{const n=performance.now(),o=n-Ke,r=16*Ye+++2;if(o>r&&o<200)return he("mutationThrottled"),de("Update delayed due to heavy workload on the callStack"),de(`EventLoop busy time: %c${Q(o)}ms %c> Max wait: %c${r-2}ms`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),setTimeout(Qe,16*Ye),void(Ke=n);Ye=1,Je.forEach(at),Je.length=0,Xe=!1,Ve.size,Ue.size,t({addedNodes:Ue,removedNodes:Ve}),Ue.clear(),Ve.clear()};function ct(e){Je.push(e),Xe||(Ke=performance.now(),Xe=!0,requestAnimationFrame(Qe))}function lt(t){const n=new window.MutationObserver(ct),o=document.body||document.documentElement;return Qe=st(t),n.observe(o,_e),de("Attached%c MutationObserver%c to body",e.HIGHLIGHT,e.FOREGROUND),{...n,disconnect:()=>{Ue.clear(),Ve.clear(),Je.length=0,n.disconnect(),de("Detached%c MutationObserver",e.HIGHLIGHT)}}}const dt="Overflow",ut=Fe(dt),mt=Fe(dt,!1),ft=De(dt),pt=Be(dt),ht=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,yt=(t,n)=>{const o=n.side,r={root:n.root,rootMargin:"0px",threshold:1},i=window?.requestAnimationFrame||_,a=(e=!1)=>t(e),s=(e,t)=>0===e||e>t[o],c=(e,t)=>e.toggleAttribute(f,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:n,target:r}=t;if(!n)continue;const i=e[o],a=s(i,n)&&!ht(r);c(r,a)}i(a)},r),d=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&&(d.has(r)?t.add(r):(l.observe(r),d.add(r),n.add(r),o+=1));pt(t),ft(n),ut(o),n.clear(),t.clear()},detachObservers:We(dt,l,d,mt),disconnect:()=>{l.disconnect(),de("Detached%c OverflowObserver",e.HIGHLIGHT)}}},gt="--ifr-start",bt="--ifr-end",vt="--ifr-measure",zt=[];let wt,$t={},Ot=0;function It(){try{performance.clearMarks(gt),performance.clearMarks(bt),performance.clearMeasures(vt)}catch{}}function St(e){e.getEntries().forEach(e=>{if(e.name===bt)try{const{duration:t}=performance.measure(vt,gt,bt);$t=e.detail,zt.push(t),zt.length>100&&zt.shift()}catch{}})}function Tt(){de("Attached%c PerformanceObserver%c to page",e.HIGHLIGHT,e.FOREGROUND);const t=new PerformanceObserver(St);return t.observe({entryTypes:["mark"]}),wt=setInterval(()=>{if(zt.length<10)return;if($t.hasTags&&$t.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=Q(e);t>Ot&&(Ot=t,he("performanceObserver")),It(),e<=4||(clearInterval(wt),we(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${Q(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${$t.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{It(),clearInterval(wt),t.disconnect(),de("Detached%c PerformanceObserver",e.HIGHLIGHT)}}}const Et="Resize",Mt=Fe(Et),Ht=Fe(Et,!1),jt=De(Et),kt=Be(Et),Nt=new WeakSet,Rt=new Set,xt=new Set;let At;function Lt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Nt.has(n)?Rt.add(n):(At.observe(n),Nt.add(n),xt.add(n),t+=1))}kt(Rt),jt(xt),Mt(t),xt.clear(),Rt.clear()}function Ct(t){const n=new IntersectionObserver(e=>t(e.at(-1).isIntersecting),{threshold:0}),o=document.documentElement;return n.observe(o),de("Attached%c VisibilityObserver%c to page",e.HIGHLIGHT,e.FOREGROUND),{disconnect:()=>{n.disconnect(),de("Detached%c VisibilityObserver",e.HIGHLIGHT)}}}const Gt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Pt=Gt($),Dt=Gt(z),Bt=Gt(v);"undefined"!=typeof window&&function(){const P={height:()=>(be("Custom height calculation function not defined"),Hn.auto()),width:()=>(be("Custom width calculation function not defined"),jn.auto())},q={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},W={},Q=O,te="scroll";let ne,oe,re,se,le,ve,ze,$e=!0,Te="",Ee=0,Me="",He="",je=!1,ke=!0,Ne=!1,xe=!0,De=!1,Be=!1,qe=!0,Fe=!1,Ue=1,Ve=Q,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=[],dt=window.parent,ut="*",mt=0,ft=!1,pt=1,ht=te,vt=window,zt=()=>{be("onMessage function not defined")},wt=()=>{},$t=null,Ot=null;function It(o){var i;!function(e){rt=e[0]??rt,Ee=Le(e[1])??Ee,Ne=Ae(e[2])??Ne,Xe=Ae(e[3])??Xe,$e=Ae(e[6])??$e,Me=e[7]??Me,Ve=e[8]??Ve,Te=e[9]??Te,He=e[10]??He,mt=Le(e[11])??mt,_e.enable=Ae(e[12])??!1,it=e[13]??it,ht=e[14]??ht,et=Ae(e[15])??et,tt=Le(e[16])??tt,nt=Le(e[17])??nt,ke=Ae(e[18])??ke,ne=e[19]??ne,ve=e[20]??ve,Ke=Le(e[21])??Ke,Ye=Ae(e[23])??Ye}(o),ae=(i={id:rt,enabled:Xe,expand:Ye}).id||n,ce.label(`${ae}`),ce.expand(i.expand),ie=i.enabled,he("initReceived"),function(){function t(e){ze=Pt(e,"onBeforeResize")??ze,zt=Pt(e,"onMessage")??zt,wt=Pt(e,"onReady")??wt,typeof e?.offset===z&&(Se(g,b),ke&&(tt=Dt(e,g)??tt),Ne&&(nt=Dt(e,g)??nt)),typeof e?.offsetSize===z&&(ke&&(tt=Dt(e,b)??tt),Ne&&(nt=Dt(e,b)??nt)),oe=Bt(e,D(B[0]))??oe,Ze=Bt(e,"ignoreSelector")??Ze,st=Bt(e,"sizeSelector")??st,ut=Bt(e,"targetOrigin")??ut,Ve=e?.heightCalculationMethod||Ve,ht=e?.widthCalculationMethod||ht}function n(e,t){return typeof e===$&&(we(`<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.`),P[t]=e,e="custom"),e}if(1===Ke)return;const o=window.iframeResizer||window.iFrameResizer;typeof o===w&&(t(o),Ve=n(Ve,h),ht=n(ht,y),de(`Set targetOrigin for parent: %c${ut}`,e.HIGHLIGHT))}(),[Ft,Ut,nn,Gt,Wt,en,tn,Xt,qt,Rt,je?_:Re,_t,()=>Vt("background",Te),()=>Vt("padding",He),je?_:Qt,rn,Jt,zn,an,on,sn,Mt,cn].forEach(e=>{try{e()}catch(e){if(Ke<0)throw e;we("<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</>"),fe(e)}}),kt(J(wt)),me(),Cn(r,"Init message from host page",void 0,void 0,`${t}:${Ke}`),document.title&&""!==document.title&&Dn(0,0,d,document.title)}function St({persisted:e}){e||Dn(0,0,"beforeUnload"),he(a),de("Page persisted:",e),e||Ce.forEach(K)}const Mt=()=>Pe(window,a.toLowerCase(),St);let jt=!1;function kt(e){"complete"===document.readyState?Z(e):jt||Pe(document,I,()=>kt(e)),jt=!0}function Rt(){ct=document.querySelectorAll(`[${m}]`),Fe=ct.length>0}let xt=0;function Gt(){const t=document.querySelectorAll(`*[${p}]`);return De=t.length>0,De&&t.length!==xt&&(function(t){const n=1===t.length?"":"s";be(`%c[${p}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),xt=t.length),De}function qt(){"BackCompat"===document.compatMode&&we("<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 Ft(){ve&&""!==ve&&"false"!==ve?ve!==t&&we(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ve} - Child page: ${t}.\n`):we("<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 Wt(){try{at=1===Ke||"iframeParentListener"in window.parent}catch(e){}}function Ut(){Ne===ke&&(je=!0)}function Vt(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),de(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function Zt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Jt(){Zt(0,m,st),Zt(0,p,Ze)}function _t(){var e,t;void 0===Me&&(Me=`${Ee}px`),Vt("margin",(e="margin",(t=Me).includes("-")&&(be(`Negative CSS value ignored for ${e}`),t=""),t))}function Qt(){const e=e=>e.style.setProperty(h,O,"important");e(document.documentElement),e(document.body)}function Yt(e){({add(t){function n(){Cn(e.eventName,e.eventType)}W[t]=n,Pe(window,t,n,{passive:!0})},remove(e){const t=W[e];delete W[e],Ge(window,e,t)}})[e.method](e.eventName)}function Xt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(m,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&we("<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 Kt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(be(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in q)&&we(`<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 ${ve?"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: '${O}',\n}\n`}\n`),e}function en(){Ve=Kt(Ve,Q,Hn)}function tn(){ht=Kt(ht,te,jn)}function nn(){const n=Ke,o=V({key:ne}),r=V({key:oe});if(Ke=Math.max(o,r),Ke<0){if(Ke=Math.min(o,r),ge(),we(`${U(Ke+2)}${U(2)}`),X(ve))throw U(Ke+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!X(ve)||n>-1&&Ke>n)&&(sessionStorage.getItem("ifr")!==t&&function(t,n){console.info(`${ae} %ciframe-resizer ${t}`,ie||n<1?"font-weight: bold;":e.NORMAL)}(`v${t} (${(e=>D(F[e]))(Ke)})`,Ke),Ke<2&&we(U(3)),sessionStorage.setItem("ifr",t))}function on(){!function(e){Yt({method:e,eventType:"After Print",eventName:"afterprint"}),Yt({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add")}function rn(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function an(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,u)+parseInt(n.x,u),y:parseInt(t.top,u)+parseInt(n.y,u)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Dn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Dn(n.y,n.x,l)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=_e;o&&(1===Ke?we(U(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&Pe(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),Pe(window,"hashchange",n),setTimeout(n,128))),_e={..._e,findTarget:t}}function sn(){function e(e){Dn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){Pe(window.document,t,e)}!0===et&&(t("mouseenter"),t("mouseleave"))}function cn(){1!==Ke&&(vt.parentIframe=Object.freeze({autoResize:e=>(ee(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Ne&&!1===ke?(he(E),we("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===$e?($e=!0,queueMicrotask(()=>Cn(E,"Auto Resize enabled"))):!1===e&&!0===$e&&($e=!1),Dn(0,0,"autoResize",JSON.stringify($e)),$e)),close(){Dn(0,0,"close")},getId:()=>rt,getOrigin:()=>(he("getOrigin"),Oe("getOrigin()","getParentOrigin()"),re),getParentOrigin:()=>re,getPageInfo(e){if(typeof e===$)return $t=e,Dn(0,0,s),void Ie("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");$t=null,Dn(0,0,"pageInfoStop")},getParentProps:e=>(ee(e,$,"parentIframe.getParentProps(callback) callback"),Ot=e,Dn(0,0,c),()=>{Ot=null,Dn(0,0,"parentInfoStop")}),getParentProperties(e){Oe("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ee(e,v,"parentIframe.moveToAnchor(anchor) anchor"),_e.findTarget(e)},reset(){!function(){const e=Ve;Ve=Q,ft||(ft=!0,requestAnimationFrame(()=>{ft=!1})),Gn("reset"),Ve=e}()},setOffsetSize(e){ee(e,z,"parentIframe.setOffsetSize(offset) offset"),tt=e,nt=e,Cn(N,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ee(e,z,"parentIframe.scrollBy(x, y) x"),ee(t,z,"parentIframe.scrollBy(x, y) y"),Dn(t,e,"scrollBy")},scrollTo(e,t){ee(e,z,"parentIframe.scrollTo(x, y) x"),ee(t,z,"parentIframe.scrollTo(x, y) y"),Dn(t,e,"scrollTo")},scrollToOffset(e,t){ee(e,z,"parentIframe.scrollToOffset(x, y) x"),ee(t,z,"parentIframe.scrollToOffset(x, y) y"),Dn(t,e,l)},sendMessage(e,t){t&&ee(t,v,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Dn(0,0,i,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ve=e,en()},setWidthCalculationMethod(e){ht=e,tn()},setTargetOrigin(e){ee(e,v,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ut=e},resize(e,t){void 0!==e&&ee(e,z,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ee(t,z,"parentIframe.resize(customHeight, customWidth) customWidth"),Cn(H,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Oe("size()","resize()"),this.resize(e,t)}}),vt.parentIFrame=vt.parentIframe)}let ln=new Set;function dn(){const e=document.querySelectorAll(`[${f}]`);ot=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${p}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{he("overflowIgnored"),de("Ignoring elements with [data-iframe-ignore] > *:\n",n),me()}),t}(e),Be=ot.size>0,typeof Set.prototype.symmetricDifference===$&&(qe=ot.symmetricDifference(ln).size>0),ln=ot}function un(){switch(dn(),!0){case!qe:return;case ot.size>1:de("Overflowed Elements:",ot);break;case Be:break;default:de("No overflow detected")}Cn(x,"Overflow updated")}function mn(e){const t={root:document.documentElement,side:ke?S:T};return se=yt(un,t),se.attachObservers(e),se}function fn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Cn(R,`Element resized <${function(e){switch(!0){case!X(e):return"";case X(e.id):return`${e.nodeName}#${e.id}`;case X(e.name):return`${e.nodeName} (${e.name}`;case X(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function pn(t){return At=new ResizeObserver(fn),At.observe(document.body),Nt.add(document.body),de("Attached%c ResizeObserver%c to body",e.HIGHLIGHT,e.FOREGROUND),le={attachObserverToNonStaticElements:Lt,detachObservers:We(Et,At,Nt,Ht),disconnect:()=>{At.disconnect(),de("Detached%c ResizeObserver",e.HIGHLIGHT)}},le.attachObserverToNonStaticElements(t),le}function hn(e){Qe=!e,Cn(L,"Visibility changed")}const yn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of In(n))t.add(e)}return de("Inspecting:\n",t),t},gn=e=>{if(0===e.size)return;he("addObservers");const t=yn(e);se.attachObservers(t),le.attachObserverToNonStaticElements(t),me()},bn=e=>{if(0===e.size)return;he("removeObservers");const t=yn(e);se.detachObservers(t),le.detachObservers(t),me()};function vn(e){!function({addedNodes:e,removedNodes:t}){he("contentMutated"),Jt(),Rt(),dn(),me(),bn(t),gn(e)}(e),Cn(A,"Mutation Observed")}function zn(){const e=In(document.documentElement);var t;t=[lt(vn),mn(e),Tt(),pn(e),Ct(hn)],Ce.push(...t.map(e=>e.disconnect))}function wn(t){performance.mark(gt);const n=Y(t);let o=1,r=document.documentElement,i=Fe?0:document.documentElement.getBoundingClientRect().bottom;const a=Fe?ct:Be?Array.from(ot):In(document.documentElement);for(const e of a)o=e.getBoundingClientRect()[t]+parseFloat(getComputedStyle(e).getPropertyValue(`margin-${t}`)),o>i&&(i=o,r=e);return de(`${n} position calculated from:`,r),de(`Checked %c${a.length}%c elements`,e.HIGHLIGHT,e.FOREGROUND),performance.mark(bt,{detail:{hasTags:Fe,len:a.length,logging:Xe,Side:n}}),i}const $n=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],On=`* ${Array.from(G).map(e=>`:not(${e})`).join("")}`,In=e=>e.querySelectorAll(On),Sn={height:0,width:0},Tn={height:0,width:0},En=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function Mn(t){function n(){return Tn[r]=i,Sn[r]=c,Math.max(i,1)}const o=t===Hn,r=t.label,i=t.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),l=`HTML: %c${i}px %cPage: %c${c}px`;let d=1;switch(!0){case!t.enabled():return Math.max(c,1);case Fe:de("Found element with data-iframe-size attribute"),d=t.taggedElement();break;case!Be&&xe&&0===Tn[r]&&0===Sn[r]:de(`Initial page size values: ${l}`,...En),d=n();break;case ft&&i===Tn[r]&&c===Sn[r]:de(`Size unchanged: ${l}`,...En),d=Math.max(i,c);break;case 0===i&&0!==c:de(`Page is hidden: ${l}`,...En),d=c;break;case!Be&&i!==Tn[r]&&c<=Sn[r]:de(`New <html> size: ${l} `,...En),de(`Previous <html> size: %c${Tn[r]}px`,e.HIGHLIGHT),d=n();break;case!o:d=t.taggedElement();break;case!Be&&i<Tn[r]:de(`<html> size decreased: ${l}`,...En),d=n();break;case c===s||c===a:de(`<html> size equals page size: ${l}`,...En),d=n();break;case i>c:de(`Page size < <html> size: ${l}`,...En),d=n();break;case Be:de("Found elements possibly overflowing <html> "),d=t.taggedElement();break;default:de(`Using <html> size: ${l}`,...En),d=n()}return de(`Content ${r}: %c${d}px`,e.HIGHLIGHT),d+=function(t){const n=t.getOffset();return 0!==n&&de(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),Math.max(d,1)}const Hn={label:h,enabled:()=>ke,getOffset:()=>tt,auto:()=>Mn(Hn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,u)+parseInt(t.marginBottom,u)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Hn.bodyOffset(),custom:()=>P.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...$n(Hn)),min:()=>Math.min(...$n(Hn)),grow:()=>Hn.max(),lowestElement:()=>wn(S),taggedElement:()=>wn(S)},jn={label:y,enabled:()=>Ne,getOffset:()=>nt,auto:()=>Mn(jn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>P.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...$n(jn)),min:()=>Math.min(...$n(jn)),rightMostElement:()=>wn(T),scroll:()=>Math.max(jn.bodyScroll(),jn.documentElementScroll()),taggedElement:()=>wn(T)},kn=(e,t)=>!(Math.abs(e-t)<=mt);function Nn(e,t){const n=e[t](),o=e.enabled()&&void 0!==ze?function(e){const t=ze(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 ue(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Rn=!1;const xn=J(()=>we(U(4)));let An,Ln=!1;const Cn=pe((e,t,n,o,i)=>{switch(he(e),!0){case!0===Qe:if(!0===Ln)break;Ln=!0,Rn=!1,cancelAnimationFrame(An),An=null;break;case!0===Rn&&e!==x:ge();break;case!$e&&!(e in k):de("Resizing disabled");break;default:Ln=!1,Rn=!0,performance.now(),An||(An=requestAnimationFrame(()=>{Rn=!1,An=null,he("requestAnimationFrame")})),function(e,t,n,o,i){const a=n??Nn(Hn,Ve),s=o??Nn(jn,ht);switch(ke&&kn(Ue,a)||Ne&&kn(pt,s)?M:e){case r:case E:case M:Ue=a,pt=s;case N:Pn(Ue,pt,e,i);break;case x:case A:case R:case L:ge();break;default:ge(),de("No change in content size detected")}}(e,0,n,o,i)}me()});function Gn(e){Ue=Hn[Ve](),pt=jn[ht](),Dn(Ue,pt,e)}function Pn(t,n,o,r,i){Ke<-1||(void 0!==i||(i=ut),function(){const a=`${rt}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(at)try{window.parent.iframeParentListener(C+a)}catch(e){if(1!==Ke)throw e;return void xn()}else dt.postMessage(C+a,i);de(`Sending message to parent page via ${at?"sameOrigin":"postMessage"}: %c%c${a}`,e.ITALIC,e.HIGHLIGHT)}())}const Dn=pe((e,t,n,o,r)=>{he(n),Pn(e,t,n,o,r),me()}),Bn=pe(function(e){he("onMessage");const{freeze:t}=Object,{parse:n}=JSON,i=e=>Dn(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(o);dt=e.source,re=e.origin,It(t),xe=!1,setTimeout(()=>{Je=!1},128)},reset(){Je||Gn("resetPage")},resize(){Cn(j,"Parent window requested size check")},moveToAnchor(){_e.findTarget(d())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=d();$t?Z($t,n(e)):i(s)},parentInfo(){const e=(o=d(),t(n(o)));var o;Ot?Z(Ot,e):i(c)},message(){const e=d();Z(zt,n(e))}},l=()=>e.data.split("]")[1].split(o)[0],d=()=>e.data.slice(e.data.indexOf(o)+1),u=()=>e.data.split(o)[2]in{true:1,false:1};function m(){const t=l();he(t),t in a?a[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||u()||be(`Unexpected message (${e.data})`)}C===`${e.data}`.slice(0,13)&&function(){if(!1!==xe)return u()?(ye(l()),he(r),void a.init()):void 0;m()}()});let qn=!1;const Fn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function Wn(){if("loading"===document.readyState||!xe||qn)return;const{parent:e,top:t}=window;he("ready"),Fn(e),e!==t&&Fn(t),qn=!0}"iframeChildListener"in window?be("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Bn({data:e,sameOrigin:!0})),he("listen"),Pe(window,i,Bn),Pe(document,I,Wn),Wn())}();
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.5.
|
|
4
|
+
* @module iframe-resizer/child 5.5.9 (esm) - 2026-02-06
|
|
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,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
import e,{NORMAL as t,HIGHLIGHT as n,FOREGROUND as o,ITALIC as r,BOLD as a}from"auto-console-group";const i="5.5.8",s="iframeResizer",c=":",l="init",d="message",u="pageHide",m="pageInfo",f="parentInfo",p="scrollToOffset",h="title",y=10,g="data-iframe-size",b="data-iframe-overflowed",v="data-iframe-ignore",z="height",w="width",$="offset",S="offsetSize",O="string",E="number",M="object",j="function",k="auto",x="readystatechange",T="bottom",I="right",N="autoResizeEnabled",C=Symbol("sizeChanged"),P="manualResize",A="parentResize",R={[P]:1,[A]:1},B="setOffsetSize",L="resizeObserver",q="overflowObserver",D="mutationObserver",W="visibilityObserver",F="[iFrameSizer]",V=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),H=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)},U=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),Z=["spjluzl","rlf","clyzpvu"],J=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],_=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],Q=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),Y=e=>U(J[e]),G=e=>{const t=e[U(Z[0])]||e[U(Z[1])]||e[U(Z[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=H(U(e));return n in Q&&(t=Q[n]),t}(n[0]);return 0===o||(e=>e[2]===H(e[0]+e[1]))(n)||(o=-2),o},X=(e,...t)=>setTimeout(()=>e(...t),0),K=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},ee=e=>e,te=e=>Math.round(1e3*e)/1e3,ne=e=>e.charAt(0).toUpperCase()+e.slice(1),oe=e=>""!=`${e}`&&void 0!==e,re=e=>e();const ae=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${ne(t)}`)},ie={br:"\n",rb:"[31;1m",bb:"[34;1m",b:"[1m",i:"[3m",u:"[4m","/":"[m"},se=Object.keys(ie),ce=new RegExp(`<(${se.join("|")})>`,"gi"),le=(e,t)=>ie[t]??"";let de=!0,ue=s;var me;const fe=(me=e,me?.__esModule?me.default:me)({label:`${s}(child)`,expand:!1});var pe;const he=(pe="log",(...e)=>!de||fe[pe](...e));const{assert:ye,endAutoGroup:ge,error:be,errorBoundary:ve,event:ze,label:we,purge:$e,warn:Se}=fe,Oe=(Ee=ee,e=>Ee(typeof e===O?window.chrome?e.replace(ce,le):(e=>e.replaceAll("<br>","\n").replaceAll(/<\/?[^>]+>/gi,""))(e):e));var Ee;const Me=(...e)=>fe.warn(...e.map(Oe)),je=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>Me(t)),ke=je("Method"),xe=je("Method","replaced with"),Te=je("Option"),Ie=["min-height","min-width","max-height","max-width"],Ne=new Set,Ce=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Pe=(e,t)=>{return(n=Ce(e,t))&&"0px"!==n&&n!==k&&"none"!==n;var n};function Ae({href:e}){Ne.has(e)||Ne.add(e)}const Re=(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){Ae(n)}return{source:"cross-origin stylesheet",value:Ce(e,t)}}(e,t),Be=(e,t)=>{const{source:n,value:o}=Re(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Me(`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 Le(){for(const e of[document.documentElement,document.body])for(const t of Ie)Pe(e,t)&&Be(e,t)}const qe=e=>t=>void 0===t?void 0:e(t),De=qe(e=>"true"===e),We=qe(Number),Fe=[],Ve=(e,t,n,o)=>{e.removeEventListener(t,n,o)},He=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),Fe.push(()=>Ve(e,t,n,o))},Ue=e=>e=>{e.size},Ze=((e="")=>t=>n=>{n.size>0&&be(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Je=e=>e=>{e.size},_e=(e,o=!0)=>r=>{r>0&&he(`${o?"At":"De"}tached %c${e}Observer%c ${o?"to":"from"} %c${r}%c element${1===r?"":"s"}`,n,t,n,t)},Qe=(e,t,n,o)=>{const r=Je(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},Ye=new Set,Ge=new Set,Xe=new Set,Ke=[],et={attributes:!0,attributeFilter:[v,g],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let tt,nt=1,ot=!1,rt=0;const at=e=>{e.size},it=e=>{e.size},st=e=>{e.size},ct=e=>e.nodeType!==Node.ELEMENT_NODE||V.has(e.tagName.toLowerCase());function lt(e){const t=e.addedNodes;for(const e of t)ct(e)||Ye.add(e)}function dt(e){const t=e.removedNodes;for(const e of t)ct(e)||(Ye.has(e)?(Ye.delete(e),Xe.add(e)):Ge.add(e))}const ut=e=>{he("Mutations:",e);for(const t of e)lt(t),dt(t);at(Ye),it(Ge),st(Xe),Xe.clear()};const mt=e=>()=>{const t=performance.now(),r=t-rt,a=16*nt+++2;if(r>a&&r<200)return ze("mutationThrottled"),he("Update delayed due to heavy workload on the callStack"),he(`EventLoop busy time: %c${te(r)}ms %c> Max wait: %c${a-2}ms`,n,o,n),setTimeout(tt,16*nt),void(rt=t);nt=1,Ke.forEach(ut),Ke.length=0,ot=!1,Ge.size,Ye.size,e({addedNodes:Ye,removedNodes:Ge}),Ye.clear(),Ge.clear()};function ft(e){Ke.push(e),ot||(rt=performance.now(),ot=!0,requestAnimationFrame(tt))}function pt(e){const t=new window.MutationObserver(ft),r=document.body||document.documentElement;return tt=mt(e),t.observe(r,et),he("Attached%c MutationObserver%c to body",n,o),{...t,disconnect:()=>{Ye.clear(),Ge.clear(),Ke.length=0,t.disconnect(),he("Detached%c MutationObserver",n)}}}const ht="Overflow",yt=_e(ht),gt=_e(ht,!1),bt=Ue(ht),vt=Ze(ht),zt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,wt=(e,t)=>{const o=t.side,r={root:t.root,rootMargin:"0px",threshold:1},a=window?.requestAnimationFrame||ee,i=(t=!1)=>e(t),s=(e,t)=>0===e||e>t[o],c=(e,t)=>e.toggleAttribute(b,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:n,target:r}=t;if(!n)continue;const a=e[o],i=s(a,n)&&!zt(r);c(r,i)}a(i)},r),d=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&&(d.has(r)?t.add(r):(l.observe(r),d.add(r),n.add(r),o+=1));vt(t),bt(n),yt(o),n.clear(),t.clear()},detachObservers:Qe(ht,l,d,gt),disconnect:()=>{l.disconnect(),he("Detached%c OverflowObserver",n)}}},$t="--ifr-start",St="--ifr-end",Ot="--ifr-measure",Et=[];let Mt,jt={},kt=0;function xt(){try{performance.clearMarks($t),performance.clearMarks(St),performance.clearMeasures(Ot)}catch{}}function Tt(e){e.getEntries().forEach(e=>{if(e.name===St)try{const{duration:t}=performance.measure(Ot,$t,St);jt=e.detail,Et.push(t),Et.length>100&&Et.shift()}catch{}})}function It(){he("Attached%c PerformanceObserver%c to page",n,o);const e=new PerformanceObserver(Tt);return e.observe({entryTypes:["mark"]}),Mt=setInterval(()=>{if(Et.length<10)return;if(jt.hasTags&&jt.len<25)return;Et.sort();const e=Math.min(Et.reduce((e,t)=>e+t,0)/Et.length,Et[Math.floor(Et.length/2)]),t=te(e);t>kt&&(kt=t,ze("performanceObserver")),xt(),e<=4||(clearInterval(Mt),Me(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${te(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${jt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{xt(),clearInterval(Mt),e.disconnect(),he("Detached%c PerformanceObserver",n)}}}const Nt="Resize",Ct=_e(Nt),Pt=_e(Nt,!1),At=Ue(Nt),Rt=Ze(Nt),Bt=new WeakSet,Lt=new Set,qt=new Set;let Dt;function Wt(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)?Lt.add(n):(Dt.observe(n),Bt.add(n),qt.add(n),t+=1))}Rt(Lt),At(qt),Ct(t),qt.clear(),Lt.clear()}function Ft(e){const t=new IntersectionObserver(t=>e(t.at(-1).isIntersecting),{threshold:0}),r=document.documentElement;return t.observe(r),he("Attached%c VisibilityObserver%c to page",n,o),{disconnect:()=>{t.disconnect(),he("Detached%c VisibilityObserver",n)}}}const Vt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ht=Vt(j),Ut=Vt(E),Zt=Vt(O);"undefined"!=typeof window&&function(){const e={height:()=>(Se("Custom height calculation function not defined"),Cn.auto()),width:()=>(Se("Custom width calculation function not defined"),Pn.auto())},H={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},J={},Q=k,te="scroll";let ie,se,ce,le,me,pe,Oe,Ee=!0,je="",Ie=0,Ne="",Ce="",Pe=!1,Ae=!0,Re=!1,Be=!0,qe=!1,Ue=!1,Ze=!0,Je=!1,_e=1,Ye=Q,Ge="",Xe=!0,Ke={},et=!1,tt=!1,nt=!1,ot=0,rt=!1,at=0,it=0,st=new Set,ct="",lt="child",dt=!1,ut="",mt=[],ft=window.parent,ht="*",yt=0,gt=!1,bt=1,vt=te,zt=window,Ot=()=>{Se("onMessage function not defined")},Et=()=>{},Mt=null,jt=null;function kt(t){var o;!function(e){ct=e[0]??ct,Ie=We(e[1])??Ie,Re=De(e[2])??Re,nt=De(e[3])??nt,Ee=De(e[6])??Ee,Ne=e[7]??Ne,Ye=e[8]??Ye,je=e[9]??je,Ce=e[10]??Ce,yt=We(e[11])??yt,Ke.enable=De(e[12])??!1,lt=e[13]??lt,vt=e[14]??vt,rt=De(e[15])??rt,at=We(e[16])??at,it=We(e[17])??it,Ae=De(e[18])??Ae,ie=e[19]??ie,pe=e[20]??pe,ot=We(e[21])??ot,tt=De(e[23])??tt}(t),ue=(o={id:ct,enabled:nt,expand:tt}).id||s,fe.label(`${ue}`),fe.expand(o.expand),de=o.enabled,ze("initReceived"),function(){function t(e){Oe=Ht(e,"onBeforeResize")??Oe,Ot=Ht(e,"onMessage")??Ot,Et=Ht(e,"onReady")??Et,typeof e?.offset===E&&(Te($,S),Ae&&(at=Ut(e,$)??at),Re&&(it=Ut(e,$)??it)),typeof e?.offsetSize===E&&(Ae&&(at=Ut(e,S)??at),Re&&(it=Ut(e,S)??it)),se=Zt(e,U(Z[0]))??se,Ge=Zt(e,"ignoreSelector")??Ge,ut=Zt(e,"sizeSelector")??ut,ht=Zt(e,"targetOrigin")??ht,Ye=e?.heightCalculationMethod||Ye,vt=e?.widthCalculationMethod||vt}function o(t,n){return typeof t===j&&(Me(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===ot)return;const r=window.iframeResizer||window.iFrameResizer;typeof r===M&&(t(r),Ye=o(Ye,z),vt=o(vt,w),he(`Set targetOrigin for parent: %c${ht}`,n))}(),[Jt,Qt,sn,qt,_t,rn,an,nn,Vt,Rt,Pe?ee:Le,Kt,()=>Yt("background",je),()=>Yt("padding",Ce),Pe?ee:en,ln,Xt,On,dn,cn,un,Tt,mn].forEach(e=>{try{e()}catch(e){if(ot<0)throw e;Me("<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)}}),At(K(Et)),ge(),Wn(l,"Init message from host page",void 0,void 0,`${i}:${ot}`),document.title&&""!==document.title&&Hn(0,0,h,document.title)}function xt({persisted:e}){e||Hn(0,0,"beforeUnload"),ze(u),he("Page persisted:",e),e||Fe.forEach(re)}const Tt=()=>He(window,u.toLowerCase(),xt);let Ct=!1;function At(e){"complete"===document.readyState?X(e):Ct||He(document,x,()=>At(e)),Ct=!0}function Rt(){mt=document.querySelectorAll(`[${g}]`),Je=mt.length>0}let Lt=0;function qt(){const e=document.querySelectorAll(`*[${v}]`);return qe=e.length>0,qe&&e.length!==Lt&&(function(e){const n=1===e.length?"":"s";Se(`%c[${v}]%c found on %c${e.length}%c element${n}`,a,t,a,t)}(e),Lt=e.length),qe}function Vt(){"BackCompat"===document.compatMode&&Me("<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(){pe&&""!==pe&&"false"!==pe?pe!==i&&Me(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${pe} - Child page: ${i}.\n`):Me("<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 _t(){try{dt=1===ot||"iframeParentListener"in window.parent}catch(e){}}function Qt(){Re===Ae&&(Pe=!0)}function Yt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),he(`Set body ${e}: %c${t}`,n))}function Gt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Xt(){Gt(0,g,ut),Gt(0,v,Ge)}function Kt(){var e,t;void 0===Ne&&(Ne=`${Ie}px`),Yt("margin",(e="margin",(t=Ne).includes("-")&&(Se(`Negative CSS value ignored for ${e}`),t=""),t))}function en(){const e=e=>e.style.setProperty(z,k,"important");e(document.documentElement),e(document.body)}function tn(e){({add(t){function n(){Wn(e.eventName,e.eventType)}J[t]=n,He(window,t,n,{passive:!0})},remove(e){const t=J[e];delete J[e],Ve(window,e,t)}})[e.method](e.eventName)}function nn(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Me("<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 on(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 H)&&Me(`<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 ${pe?"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: '${k}',\n}\n`}\n`),e}function rn(){Ye=on(Ye,Q,Cn)}function an(){vt=on(vt,te,Pn)}function sn(){const e=ot,n=G({key:ie}),o=G({key:se});if(ot=Math.max(n,o),ot<0){if(ot=Math.min(n,o),$e(),Me(`${Y(ot+2)}${Y(2)}`),oe(pe))throw Y(ot+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!oe(pe)||e>-1&&ot>e)&&(sessionStorage.getItem("ifr")!==i&&function(e,n){console.info(`${ue} %ciframe-resizer ${e}`,de||n<1?"font-weight: bold;":t)}(`v${i} (${(e=>U(_[e]))(ot)})`,ot),ot<2&&Me(Y(3)),sessionStorage.setItem("ifr",i))}function cn(){!function(e){tn({method:e,eventType:"After Print",eventName:"afterprint"}),tn({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add")}function ln(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function dn(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,y)+parseInt(n.x,y),y:parseInt(t.top,y)+parseInt(n.y,y)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Hn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Hn(n.y,n.x,p)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ke;o&&(1===ot?Me(Y(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&He(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),He(window,"hashchange",n),setTimeout(n,128))),Ke={...Ke,findTarget:t}}function un(){function e(e){Hn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){He(window.document,t,e)}!0===rt&&(t("mouseenter"),t("mouseleave"))}function mn(){1!==ot&&(zt.parentIframe=Object.freeze({autoResize:e=>(ae(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Re&&!1===Ae?(ze(N),Me("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Ee?(Ee=!0,queueMicrotask(()=>Wn(N,"Auto Resize enabled"))):!1===e&&!0===Ee&&(Ee=!1),Hn(0,0,"autoResize",JSON.stringify(Ee)),Ee)),close(){Hn(0,0,"close")},getId:()=>ct,getOrigin:()=>(ze("getOrigin"),ke("getOrigin()","getParentOrigin()"),ce),getParentOrigin:()=>ce,getPageInfo(e){if(typeof e===j)return Mt=e,Hn(0,0,m),void xe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Mt=null,Hn(0,0,"pageInfoStop")},getParentProps:e=>(ae(e,j,"parentIframe.getParentProps(callback) callback"),jt=e,Hn(0,0,f),()=>{jt=null,Hn(0,0,"parentInfoStop")}),getParentProperties(e){ke("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ae(e,O,"parentIframe.moveToAnchor(anchor) anchor"),Ke.findTarget(e)},reset(){!function(){const e=Ye;Ye=Q,gt||(gt=!0,requestAnimationFrame(()=>{gt=!1})),Fn("reset"),Ye=e}()},setOffsetSize(e){ae(e,E,"parentIframe.setOffsetSize(offset) offset"),at=e,it=e,Wn(B,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ae(e,E,"parentIframe.scrollBy(x, y) x"),ae(t,E,"parentIframe.scrollBy(x, y) y"),Hn(t,e,"scrollBy")},scrollTo(e,t){ae(e,E,"parentIframe.scrollTo(x, y) x"),ae(t,E,"parentIframe.scrollTo(x, y) y"),Hn(t,e,"scrollTo")},scrollToOffset(e,t){ae(e,E,"parentIframe.scrollToOffset(x, y) x"),ae(t,E,"parentIframe.scrollToOffset(x, y) y"),Hn(t,e,p)},sendMessage(e,t){t&&ae(t,O,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Hn(0,0,d,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ye=e,rn()},setWidthCalculationMethod(e){vt=e,an()},setTargetOrigin(e){ae(e,O,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ht=e},resize(e,t){void 0!==e&&ae(e,E,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ae(t,E,"parentIframe.resize(customHeight, customWidth) customWidth"),Wn(P,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ke("size()","resize()"),this.resize(e,t)}}),zt.parentIFrame=zt.parentIframe)}let fn=new Set;function pn(){const e=document.querySelectorAll(`[${b}]`);st=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${v}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{ze("overflowIgnored"),he("Ignoring elements with [data-iframe-ignore] > *:\n",n),ge()}),t}(e),Ue=st.size>0,typeof Set.prototype.symmetricDifference===j&&(Ze=st.symmetricDifference(fn).size>0),fn=st}function hn(){switch(pn(),!0){case!Ze:return;case st.size>1:he("Overflowed Elements:",st);break;case Ue:break;default:he("No overflow detected")}Wn(q,"Overflow updated")}function yn(e){const t={root:document.documentElement,side:Ae?T:I};return le=wt(hn,t),le.attachObservers(e),le}function gn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Wn(L,`Element resized <${function(e){switch(!0){case!oe(e):return"";case oe(e.id):return`${e.nodeName}#${e.id}`;case oe(e.name):return`${e.nodeName} (${e.name}`;case oe(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function bn(e){return Dt=new ResizeObserver(gn),Dt.observe(document.body),Bt.add(document.body),he("Attached%c ResizeObserver%c to body",n,o),me={attachObserverToNonStaticElements:Wt,detachObservers:Qe(Nt,Dt,Bt,Pt),disconnect:()=>{Dt.disconnect(),he("Detached%c ResizeObserver",n)}},me.attachObserverToNonStaticElements(e),me}function vn(e){et=!e,Wn(W,"Visibility changed")}const zn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of kn(n))t.add(e)}return he("Inspecting:\n",t),t},wn=e=>{if(0===e.size)return;ze("addObservers");const t=zn(e);le.attachObservers(t),me.attachObserverToNonStaticElements(t),ge()},$n=e=>{if(0===e.size)return;ze("removeObservers");const t=zn(e);le.detachObservers(t),me.detachObservers(t),ge()};function Sn(e){!function({addedNodes:e,removedNodes:t}){ze("contentMutated"),Xt(),Rt(),pn(),ge(),$n(t),wn(e)}(e),Wn(D,"Mutation Observed")}function On(){const e=kn(document.documentElement);var t;t=[pt(Sn),yn(e),It(),bn(e),Ft(vn)],Fe.push(...t.map(e=>e.disconnect))}function En(e){performance.mark($t);const t=ne(e);let r=1,a=document.documentElement,i=Je?0:document.documentElement.getBoundingClientRect().bottom;const s=Je?mt:Ue?Array.from(st):kn(document.documentElement);for(const t of s)r=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),r>i&&(i=r,a=t);return he(`${t} position calculated from:`,a),he(`Checked %c${s.length}%c elements`,n,o),performance.mark(St,{detail:{hasTags:Je,len:s.length,logging:nt,Side:t}}),i}const Mn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],jn=`* ${Array.from(V).map(e=>`:not(${e})`).join("")}`,kn=e=>e.querySelectorAll(jn),xn={height:0,width:0},Tn={height:0,width:0},In=[n,o,n];function Nn(e){function t(){return Tn[r]=a,xn[r]=c,Math.max(a,1)}const o=e===Cn,r=e.label,a=e.boundingClientRect(),i=Math.ceil(a),s=Math.floor(a),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),l=`HTML: %c${a}px %cPage: %c${c}px`;let d=1;switch(!0){case!e.enabled():return Math.max(c,1);case Je:he("Found element with data-iframe-size attribute"),d=e.taggedElement();break;case!Ue&&Be&&0===Tn[r]&&0===xn[r]:he(`Initial page size values: ${l}`,...In),d=t();break;case gt&&a===Tn[r]&&c===xn[r]:he(`Size unchanged: ${l}`,...In),d=Math.max(a,c);break;case 0===a&&0!==c:he(`Page is hidden: ${l}`,...In),d=c;break;case!Ue&&a!==Tn[r]&&c<=xn[r]:he(`New <html> size: ${l} `,...In),he(`Previous <html> size: %c${Tn[r]}px`,n),d=t();break;case!o:d=e.taggedElement();break;case!Ue&&a<Tn[r]:he(`<html> size decreased: ${l}`,...In),d=t();break;case c===s||c===i:he(`<html> size equals page size: ${l}`,...In),d=t();break;case a>c:he(`Page size < <html> size: ${l}`,...In),d=t();break;case Ue:he("Found elements possibly overflowing <html> "),d=e.taggedElement();break;default:he(`Using <html> size: ${l}`,...In),d=t()}return he(`Content ${r}: %c${d}px`,n),d+=function(e){const t=e.getOffset();return 0!==t&&he(`Page offsetSize: %c${t}px`,n),t}(e),Math.max(d,1)}const Cn={label:z,enabled:()=>Ae,getOffset:()=>at,auto:()=>Nn(Cn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Cn.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Mn(Cn)),min:()=>Math.min(...Mn(Cn)),grow:()=>Cn.max(),lowestElement:()=>En(T),taggedElement:()=>En(T)},Pn={label:w,enabled:()=>Re,getOffset:()=>it,auto:()=>Nn(Pn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Mn(Pn)),min:()=>Math.min(...Mn(Pn)),rightMostElement:()=>En(I),scroll:()=>Math.max(Pn.bodyScroll(),Pn.documentElementScroll()),taggedElement:()=>En(I)},An=(e,t)=>!(Math.abs(e-t)<=yt);function Rn(e,t){const n=e[t](),o=e.enabled()&&void 0!==Oe?function(e){const t=Oe(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 ye(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Bn=!1;const Ln=K(()=>Me(Y(4)));let qn,Dn=!1;const Wn=ve((e,t,n,o,r)=>{switch(ze(e),!0){case!0===et:if(!0===Dn)break;Dn=!0,Bn=!1,cancelAnimationFrame(qn);break;case!0===Bn&&e!==q:$e();break;case!Ee&&!(e in R):he("Resizing disabled");break;default:Dn=!1,Bn=!0,performance.now(),qn||(qn=requestAnimationFrame(()=>{Bn=!1,qn=null,ze("requestAnimationFrame")})),function(e,t,n,o,r){const a=n??Rn(Cn,Ye),i=o??Rn(Pn,vt);switch(Ae&&An(_e,a)||Re&&An(bt,i)?C:e){case l:case N:case C:_e=a,bt=i;case B:Vn(_e,bt,e,r);break;case q:case D:case L:case W:$e();break;default:$e(),he("No change in content size detected")}}(e,0,n,o,r)}ge()});function Fn(e){_e=Cn[Ye](),bt=Pn[vt](),Hn(_e,bt,e)}function Vn(e,t,o,a,i){ot<-1||(void 0!==i||(i=ht),function(){const s=`${ct}:${e}:${t}:${o}${void 0===a?"":`:${a}`}`;if(dt)try{window.parent.iframeParentListener(F+s)}catch(e){if(1!==ot)throw e;return void Ln()}else ft.postMessage(F+s,i);he(`Sending message to parent page via ${dt?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}())}const Hn=ve((e,t,n,o,r)=>{ze(n),Vn(e,t,n,o,r),ge()}),Un=ve(function(e){ze("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Hn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(c);ft=e.source,ce=e.origin,kt(t),Be=!1,setTimeout(()=>{Xe=!1},128)},reset(){Xe||Fn("resetPage")},resize(){Wn(A,"Parent window requested size check")},moveToAnchor(){Ke.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();Mt?X(Mt,n(e)):o(m)},parentInfo(){const e=(r=i(),t(n(r)));var r;jt?X(jt,e):o(f)},message(){const e=i();X(Ot,n(e))}},a=()=>e.data.split("]")[1].split(c)[0],i=()=>e.data.slice(e.data.indexOf(c)+1),s=()=>e.data.split(c)[2]in{true:1,false:1};function d(){const t=a();ze(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Se(`Unexpected message (${e.data})`)}F===`${e.data}`.slice(0,13)&&function(){if(!1!==Be)return s()?(we(a()),ze(l),void r.init()):void 0;d()}()});let Zn=!1;const Jn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function _n(){if("loading"===document.readyState||!Be||Zn)return;const{parent:e,top:t}=window;ze("ready"),Jn(e),e!==t&&Jn(t),Zn=!0}"iframeChildListener"in window?Se("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Un({data:e,sameOrigin:!0})),ze("listen"),He(window,d,Un),He(document,x,_n),_n())}();
|
|
20
|
+
import e,{NORMAL as t,HIGHLIGHT as n,FOREGROUND as o,ITALIC as r,BOLD as a}from"auto-console-group";const i="5.5.9",s="iframeResizer",c=":",l="init",d="message",u="pageHide",m="pageInfo",f="parentInfo",p="scrollToOffset",h="title",y=10,g="data-iframe-size",b="data-iframe-overflowed",v="data-iframe-ignore",z="height",w="width",$="offset",S="offsetSize",O="string",E="number",M="object",j="function",k="auto",x="readystatechange",T="bottom",I="right",N="autoResizeEnabled",C=Symbol("sizeChanged"),P="manualResize",A="parentResize",R={[P]:1,[A]:1},B="setOffsetSize",L="resizeObserver",q="overflowObserver",D="mutationObserver",W="visibilityObserver",F="[iFrameSizer]",V=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),H=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)},U=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),Z=["spjluzl","rlf","clyzpvu"],J=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],_=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],Q=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl"].map((e,t)=>[e,Math.max(0,t-1)])),Y=e=>U(J[e]),G=e=>{const t=e[U(Z[0])]||e[U(Z[1])]||e[U(Z[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=H(U(e));return n in Q&&(t=Q[n]),t>4?t-4:t}(n[0]);return 0===o||(e=>e[2]===H(e[0]+e[1]))(n)||(o=-2),o},X=(e,...t)=>setTimeout(()=>e(...t),0),K=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},ee=e=>e,te=e=>Math.round(1e3*e)/1e3,ne=e=>e.charAt(0).toUpperCase()+e.slice(1),oe=e=>""!=`${e}`&&void 0!==e,re=e=>e();const ae=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${ne(t)}`)},ie={br:"\n",rb:"[31;1m",bb:"[34;1m",b:"[1m",i:"[3m",u:"[4m","/":"[m"},se=Object.keys(ie),ce=new RegExp(`<(${se.join("|")})>`,"gi"),le=(e,t)=>ie[t]??"";let de=!0,ue=s;var me;const fe=(me=e,me?.__esModule?me.default:me)({label:`${s}(child)`,expand:!1});var pe;const he=(pe="log",(...e)=>!de||fe[pe](...e));const{assert:ye,endAutoGroup:ge,error:be,errorBoundary:ve,event:ze,label:we,purge:$e,warn:Se}=fe,Oe=(Ee=ee,e=>Ee(typeof e===O?window.chrome?e.replace(ce,le):(e=>e.replaceAll("<br>","\n").replaceAll(/<\/?[^>]+>/gi,""))(e):e));var Ee;const Me=(...e)=>fe.warn(...e.map(Oe)),je=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>Me(t)),ke=je("Method"),xe=je("Method","replaced with"),Te=je("Option"),Ie=["min-height","min-width","max-height","max-width"],Ne=new Set,Ce=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Pe=(e,t)=>{return(n=Ce(e,t))&&"0px"!==n&&n!==k&&"none"!==n;var n};function Ae({href:e}){Ne.has(e)||Ne.add(e)}const Re=(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){Ae(n)}return{source:"cross-origin stylesheet",value:Ce(e,t)}}(e,t),Be=(e,t)=>{const{source:n,value:o}=Re(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Me(`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 Le(){for(const e of[document.documentElement,document.body])for(const t of Ie)Pe(e,t)&&Be(e,t)}const qe=e=>t=>void 0===t?void 0:e(t),De=qe(e=>"true"===e),We=qe(Number),Fe=[],Ve=(e,t,n,o)=>{e.removeEventListener(t,n,o)},He=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),Fe.push(()=>Ve(e,t,n,o))},Ue=e=>e=>{e.size},Ze=((e="")=>t=>n=>{n.size>0&&be(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Je=e=>e=>{e.size},_e=(e,o=!0)=>r=>{r>0&&he(`${o?"At":"De"}tached %c${e}Observer%c ${o?"to":"from"} %c${r}%c element${1===r?"":"s"}`,n,t,n,t)},Qe=(e,t,n,o)=>{const r=Je(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},Ye=new Set,Ge=new Set,Xe=new Set,Ke=[],et={attributes:!0,attributeFilter:[v,g],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let tt,nt=1,ot=!1,rt=0;const at=e=>{e.size},it=e=>{e.size},st=e=>{e.size},ct=e=>e.nodeType!==Node.ELEMENT_NODE||V.has(e.tagName.toLowerCase());function lt(e){const t=e.addedNodes;for(const e of t)ct(e)||Ye.add(e)}function dt(e){const t=e.removedNodes;for(const e of t)ct(e)||(Ye.has(e)?(Ye.delete(e),Xe.add(e)):Ge.add(e))}const ut=e=>{he("Mutations:",e);for(const t of e)lt(t),dt(t);at(Ye),it(Ge),st(Xe),Xe.clear()};const mt=e=>()=>{const t=performance.now(),r=t-rt,a=16*nt+++2;if(r>a&&r<200)return ze("mutationThrottled"),he("Update delayed due to heavy workload on the callStack"),he(`EventLoop busy time: %c${te(r)}ms %c> Max wait: %c${a-2}ms`,n,o,n),setTimeout(tt,16*nt),void(rt=t);nt=1,Ke.forEach(ut),Ke.length=0,ot=!1,Ge.size,Ye.size,e({addedNodes:Ye,removedNodes:Ge}),Ye.clear(),Ge.clear()};function ft(e){Ke.push(e),ot||(rt=performance.now(),ot=!0,requestAnimationFrame(tt))}function pt(e){const t=new window.MutationObserver(ft),r=document.body||document.documentElement;return tt=mt(e),t.observe(r,et),he("Attached%c MutationObserver%c to body",n,o),{...t,disconnect:()=>{Ye.clear(),Ge.clear(),Ke.length=0,t.disconnect(),he("Detached%c MutationObserver",n)}}}const ht="Overflow",yt=_e(ht),gt=_e(ht,!1),bt=Ue(ht),vt=Ze(ht),zt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,wt=(e,t)=>{const o=t.side,r={root:t.root,rootMargin:"0px",threshold:1},a=window?.requestAnimationFrame||ee,i=(t=!1)=>e(t),s=(e,t)=>0===e||e>t[o],c=(e,t)=>e.toggleAttribute(b,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:n,target:r}=t;if(!n)continue;const a=e[o],i=s(a,n)&&!zt(r);c(r,i)}a(i)},r),d=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&&(d.has(r)?t.add(r):(l.observe(r),d.add(r),n.add(r),o+=1));vt(t),bt(n),yt(o),n.clear(),t.clear()},detachObservers:Qe(ht,l,d,gt),disconnect:()=>{l.disconnect(),he("Detached%c OverflowObserver",n)}}},$t="--ifr-start",St="--ifr-end",Ot="--ifr-measure",Et=[];let Mt,jt={},kt=0;function xt(){try{performance.clearMarks($t),performance.clearMarks(St),performance.clearMeasures(Ot)}catch{}}function Tt(e){e.getEntries().forEach(e=>{if(e.name===St)try{const{duration:t}=performance.measure(Ot,$t,St);jt=e.detail,Et.push(t),Et.length>100&&Et.shift()}catch{}})}function It(){he("Attached%c PerformanceObserver%c to page",n,o);const e=new PerformanceObserver(Tt);return e.observe({entryTypes:["mark"]}),Mt=setInterval(()=>{if(Et.length<10)return;if(jt.hasTags&&jt.len<25)return;Et.sort();const e=Math.min(Et.reduce((e,t)=>e+t,0)/Et.length,Et[Math.floor(Et.length/2)]),t=te(e);t>kt&&(kt=t,ze("performanceObserver")),xt(),e<=4||(clearInterval(Mt),Me(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${te(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${jt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{xt(),clearInterval(Mt),e.disconnect(),he("Detached%c PerformanceObserver",n)}}}const Nt="Resize",Ct=_e(Nt),Pt=_e(Nt,!1),At=Ue(Nt),Rt=Ze(Nt),Bt=new WeakSet,Lt=new Set,qt=new Set;let Dt;function Wt(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)?Lt.add(n):(Dt.observe(n),Bt.add(n),qt.add(n),t+=1))}Rt(Lt),At(qt),Ct(t),qt.clear(),Lt.clear()}function Ft(e){const t=new IntersectionObserver(t=>e(t.at(-1).isIntersecting),{threshold:0}),r=document.documentElement;return t.observe(r),he("Attached%c VisibilityObserver%c to page",n,o),{disconnect:()=>{t.disconnect(),he("Detached%c VisibilityObserver",n)}}}const Vt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ht=Vt(j),Ut=Vt(E),Zt=Vt(O);"undefined"!=typeof window&&function(){const e={height:()=>(Se("Custom height calculation function not defined"),Cn.auto()),width:()=>(Se("Custom width calculation function not defined"),Pn.auto())},H={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},J={},Q=k,te="scroll";let ie,se,ce,le,me,pe,Oe,Ee=!0,je="",Ie=0,Ne="",Ce="",Pe=!1,Ae=!0,Re=!1,Be=!0,qe=!1,Ue=!1,Ze=!0,Je=!1,_e=1,Ye=Q,Ge="",Xe=!0,Ke={},et=!1,tt=!1,nt=!1,ot=0,rt=!1,at=0,it=0,st=new Set,ct="",lt="child",dt=!1,ut="",mt=[],ft=window.parent,ht="*",yt=0,gt=!1,bt=1,vt=te,zt=window,Ot=()=>{Se("onMessage function not defined")},Et=()=>{},Mt=null,jt=null;function kt(t){var o;!function(e){ct=e[0]??ct,Ie=We(e[1])??Ie,Re=De(e[2])??Re,nt=De(e[3])??nt,Ee=De(e[6])??Ee,Ne=e[7]??Ne,Ye=e[8]??Ye,je=e[9]??je,Ce=e[10]??Ce,yt=We(e[11])??yt,Ke.enable=De(e[12])??!1,lt=e[13]??lt,vt=e[14]??vt,rt=De(e[15])??rt,at=We(e[16])??at,it=We(e[17])??it,Ae=De(e[18])??Ae,ie=e[19]??ie,pe=e[20]??pe,ot=We(e[21])??ot,tt=De(e[23])??tt}(t),ue=(o={id:ct,enabled:nt,expand:tt}).id||s,fe.label(`${ue}`),fe.expand(o.expand),de=o.enabled,ze("initReceived"),function(){function t(e){Oe=Ht(e,"onBeforeResize")??Oe,Ot=Ht(e,"onMessage")??Ot,Et=Ht(e,"onReady")??Et,typeof e?.offset===E&&(Te($,S),Ae&&(at=Ut(e,$)??at),Re&&(it=Ut(e,$)??it)),typeof e?.offsetSize===E&&(Ae&&(at=Ut(e,S)??at),Re&&(it=Ut(e,S)??it)),se=Zt(e,U(Z[0]))??se,Ge=Zt(e,"ignoreSelector")??Ge,ut=Zt(e,"sizeSelector")??ut,ht=Zt(e,"targetOrigin")??ht,Ye=e?.heightCalculationMethod||Ye,vt=e?.widthCalculationMethod||vt}function o(t,n){return typeof t===j&&(Me(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===ot)return;const r=window.iframeResizer||window.iFrameResizer;typeof r===M&&(t(r),Ye=o(Ye,z),vt=o(vt,w),he(`Set targetOrigin for parent: %c${ht}`,n))}(),[Jt,Qt,sn,qt,_t,rn,an,nn,Vt,Rt,Pe?ee:Le,Kt,()=>Yt("background",je),()=>Yt("padding",Ce),Pe?ee:en,ln,Xt,On,dn,cn,un,Tt,mn].forEach(e=>{try{e()}catch(e){if(ot<0)throw e;Me("<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)}}),At(K(Et)),ge(),Wn(l,"Init message from host page",void 0,void 0,`${i}:${ot}`),document.title&&""!==document.title&&Hn(0,0,h,document.title)}function xt({persisted:e}){e||Hn(0,0,"beforeUnload"),ze(u),he("Page persisted:",e),e||Fe.forEach(re)}const Tt=()=>He(window,u.toLowerCase(),xt);let Ct=!1;function At(e){"complete"===document.readyState?X(e):Ct||He(document,x,()=>At(e)),Ct=!0}function Rt(){mt=document.querySelectorAll(`[${g}]`),Je=mt.length>0}let Lt=0;function qt(){const e=document.querySelectorAll(`*[${v}]`);return qe=e.length>0,qe&&e.length!==Lt&&(function(e){const n=1===e.length?"":"s";Se(`%c[${v}]%c found on %c${e.length}%c element${n}`,a,t,a,t)}(e),Lt=e.length),qe}function Vt(){"BackCompat"===document.compatMode&&Me("<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(){pe&&""!==pe&&"false"!==pe?pe!==i&&Me(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${pe} - Child page: ${i}.\n`):Me("<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 _t(){try{dt=1===ot||"iframeParentListener"in window.parent}catch(e){}}function Qt(){Re===Ae&&(Pe=!0)}function Yt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),he(`Set body ${e}: %c${t}`,n))}function Gt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Xt(){Gt(0,g,ut),Gt(0,v,Ge)}function Kt(){var e,t;void 0===Ne&&(Ne=`${Ie}px`),Yt("margin",(e="margin",(t=Ne).includes("-")&&(Se(`Negative CSS value ignored for ${e}`),t=""),t))}function en(){const e=e=>e.style.setProperty(z,k,"important");e(document.documentElement),e(document.body)}function tn(e){({add(t){function n(){Wn(e.eventName,e.eventType)}J[t]=n,He(window,t,n,{passive:!0})},remove(e){const t=J[e];delete J[e],Ve(window,e,t)}})[e.method](e.eventName)}function nn(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Me("<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 on(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 H)&&Me(`<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 ${pe?"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: '${k}',\n}\n`}\n`),e}function rn(){Ye=on(Ye,Q,Cn)}function an(){vt=on(vt,te,Pn)}function sn(){const e=ot,n=G({key:ie}),o=G({key:se});if(ot=Math.max(n,o),ot<0){if(ot=Math.min(n,o),$e(),Me(`${Y(ot+2)}${Y(2)}`),oe(pe))throw Y(ot+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!oe(pe)||e>-1&&ot>e)&&(sessionStorage.getItem("ifr")!==i&&function(e,n){console.info(`${ue} %ciframe-resizer ${e}`,de||n<1?"font-weight: bold;":t)}(`v${i} (${(e=>U(_[e]))(ot)})`,ot),ot<2&&Me(Y(3)),sessionStorage.setItem("ifr",i))}function cn(){!function(e){tn({method:e,eventType:"After Print",eventName:"afterprint"}),tn({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add")}function ln(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function dn(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,y)+parseInt(n.x,y),y:parseInt(t.top,y)+parseInt(n.y,y)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Hn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Hn(n.y,n.x,p)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ke;o&&(1===ot?Me(Y(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&He(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),He(window,"hashchange",n),setTimeout(n,128))),Ke={...Ke,findTarget:t}}function un(){function e(e){Hn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){He(window.document,t,e)}!0===rt&&(t("mouseenter"),t("mouseleave"))}function mn(){1!==ot&&(zt.parentIframe=Object.freeze({autoResize:e=>(ae(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Re&&!1===Ae?(ze(N),Me("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Ee?(Ee=!0,queueMicrotask(()=>Wn(N,"Auto Resize enabled"))):!1===e&&!0===Ee&&(Ee=!1),Hn(0,0,"autoResize",JSON.stringify(Ee)),Ee)),close(){Hn(0,0,"close")},getId:()=>ct,getOrigin:()=>(ze("getOrigin"),ke("getOrigin()","getParentOrigin()"),ce),getParentOrigin:()=>ce,getPageInfo(e){if(typeof e===j)return Mt=e,Hn(0,0,m),void xe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Mt=null,Hn(0,0,"pageInfoStop")},getParentProps:e=>(ae(e,j,"parentIframe.getParentProps(callback) callback"),jt=e,Hn(0,0,f),()=>{jt=null,Hn(0,0,"parentInfoStop")}),getParentProperties(e){ke("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ae(e,O,"parentIframe.moveToAnchor(anchor) anchor"),Ke.findTarget(e)},reset(){!function(){const e=Ye;Ye=Q,gt||(gt=!0,requestAnimationFrame(()=>{gt=!1})),Fn("reset"),Ye=e}()},setOffsetSize(e){ae(e,E,"parentIframe.setOffsetSize(offset) offset"),at=e,it=e,Wn(B,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ae(e,E,"parentIframe.scrollBy(x, y) x"),ae(t,E,"parentIframe.scrollBy(x, y) y"),Hn(t,e,"scrollBy")},scrollTo(e,t){ae(e,E,"parentIframe.scrollTo(x, y) x"),ae(t,E,"parentIframe.scrollTo(x, y) y"),Hn(t,e,"scrollTo")},scrollToOffset(e,t){ae(e,E,"parentIframe.scrollToOffset(x, y) x"),ae(t,E,"parentIframe.scrollToOffset(x, y) y"),Hn(t,e,p)},sendMessage(e,t){t&&ae(t,O,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Hn(0,0,d,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ye=e,rn()},setWidthCalculationMethod(e){vt=e,an()},setTargetOrigin(e){ae(e,O,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ht=e},resize(e,t){void 0!==e&&ae(e,E,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ae(t,E,"parentIframe.resize(customHeight, customWidth) customWidth"),Wn(P,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ke("size()","resize()"),this.resize(e,t)}}),zt.parentIFrame=zt.parentIframe)}let fn=new Set;function pn(){const e=document.querySelectorAll(`[${b}]`);st=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${v}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{ze("overflowIgnored"),he("Ignoring elements with [data-iframe-ignore] > *:\n",n),ge()}),t}(e),Ue=st.size>0,typeof Set.prototype.symmetricDifference===j&&(Ze=st.symmetricDifference(fn).size>0),fn=st}function hn(){switch(pn(),!0){case!Ze:return;case st.size>1:he("Overflowed Elements:",st);break;case Ue:break;default:he("No overflow detected")}Wn(q,"Overflow updated")}function yn(e){const t={root:document.documentElement,side:Ae?T:I};return le=wt(hn,t),le.attachObservers(e),le}function gn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Wn(L,`Element resized <${function(e){switch(!0){case!oe(e):return"";case oe(e.id):return`${e.nodeName}#${e.id}`;case oe(e.name):return`${e.nodeName} (${e.name}`;case oe(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function bn(e){return Dt=new ResizeObserver(gn),Dt.observe(document.body),Bt.add(document.body),he("Attached%c ResizeObserver%c to body",n,o),me={attachObserverToNonStaticElements:Wt,detachObservers:Qe(Nt,Dt,Bt,Pt),disconnect:()=>{Dt.disconnect(),he("Detached%c ResizeObserver",n)}},me.attachObserverToNonStaticElements(e),me}function vn(e){et=!e,Wn(W,"Visibility changed")}const zn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of kn(n))t.add(e)}return he("Inspecting:\n",t),t},wn=e=>{if(0===e.size)return;ze("addObservers");const t=zn(e);le.attachObservers(t),me.attachObserverToNonStaticElements(t),ge()},$n=e=>{if(0===e.size)return;ze("removeObservers");const t=zn(e);le.detachObservers(t),me.detachObservers(t),ge()};function Sn(e){!function({addedNodes:e,removedNodes:t}){ze("contentMutated"),Xt(),Rt(),pn(),ge(),$n(t),wn(e)}(e),Wn(D,"Mutation Observed")}function On(){const e=kn(document.documentElement);var t;t=[pt(Sn),yn(e),It(),bn(e),Ft(vn)],Fe.push(...t.map(e=>e.disconnect))}function En(e){performance.mark($t);const t=ne(e);let r=1,a=document.documentElement,i=Je?0:document.documentElement.getBoundingClientRect().bottom;const s=Je?mt:Ue?Array.from(st):kn(document.documentElement);for(const t of s)r=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),r>i&&(i=r,a=t);return he(`${t} position calculated from:`,a),he(`Checked %c${s.length}%c elements`,n,o),performance.mark(St,{detail:{hasTags:Je,len:s.length,logging:nt,Side:t}}),i}const Mn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],jn=`* ${Array.from(V).map(e=>`:not(${e})`).join("")}`,kn=e=>e.querySelectorAll(jn),xn={height:0,width:0},Tn={height:0,width:0},In=[n,o,n];function Nn(e){function t(){return Tn[r]=a,xn[r]=c,Math.max(a,1)}const o=e===Cn,r=e.label,a=e.boundingClientRect(),i=Math.ceil(a),s=Math.floor(a),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),l=`HTML: %c${a}px %cPage: %c${c}px`;let d=1;switch(!0){case!e.enabled():return Math.max(c,1);case Je:he("Found element with data-iframe-size attribute"),d=e.taggedElement();break;case!Ue&&Be&&0===Tn[r]&&0===xn[r]:he(`Initial page size values: ${l}`,...In),d=t();break;case gt&&a===Tn[r]&&c===xn[r]:he(`Size unchanged: ${l}`,...In),d=Math.max(a,c);break;case 0===a&&0!==c:he(`Page is hidden: ${l}`,...In),d=c;break;case!Ue&&a!==Tn[r]&&c<=xn[r]:he(`New <html> size: ${l} `,...In),he(`Previous <html> size: %c${Tn[r]}px`,n),d=t();break;case!o:d=e.taggedElement();break;case!Ue&&a<Tn[r]:he(`<html> size decreased: ${l}`,...In),d=t();break;case c===s||c===i:he(`<html> size equals page size: ${l}`,...In),d=t();break;case a>c:he(`Page size < <html> size: ${l}`,...In),d=t();break;case Ue:he("Found elements possibly overflowing <html> "),d=e.taggedElement();break;default:he(`Using <html> size: ${l}`,...In),d=t()}return he(`Content ${r}: %c${d}px`,n),d+=function(e){const t=e.getOffset();return 0!==t&&he(`Page offsetSize: %c${t}px`,n),t}(e),Math.max(d,1)}const Cn={label:z,enabled:()=>Ae,getOffset:()=>at,auto:()=>Nn(Cn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Cn.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Mn(Cn)),min:()=>Math.min(...Mn(Cn)),grow:()=>Cn.max(),lowestElement:()=>En(T),taggedElement:()=>En(T)},Pn={label:w,enabled:()=>Re,getOffset:()=>it,auto:()=>Nn(Pn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Mn(Pn)),min:()=>Math.min(...Mn(Pn)),rightMostElement:()=>En(I),scroll:()=>Math.max(Pn.bodyScroll(),Pn.documentElementScroll()),taggedElement:()=>En(I)},An=(e,t)=>!(Math.abs(e-t)<=yt);function Rn(e,t){const n=e[t](),o=e.enabled()&&void 0!==Oe?function(e){const t=Oe(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 ye(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Bn=!1;const Ln=K(()=>Me(Y(4)));let qn,Dn=!1;const Wn=ve((e,t,n,o,r)=>{switch(ze(e),!0){case!0===et:if(!0===Dn)break;Dn=!0,Bn=!1,cancelAnimationFrame(qn),qn=null;break;case!0===Bn&&e!==q:$e();break;case!Ee&&!(e in R):he("Resizing disabled");break;default:Dn=!1,Bn=!0,performance.now(),qn||(qn=requestAnimationFrame(()=>{Bn=!1,qn=null,ze("requestAnimationFrame")})),function(e,t,n,o,r){const a=n??Rn(Cn,Ye),i=o??Rn(Pn,vt);switch(Ae&&An(_e,a)||Re&&An(bt,i)?C:e){case l:case N:case C:_e=a,bt=i;case B:Vn(_e,bt,e,r);break;case q:case D:case L:case W:$e();break;default:$e(),he("No change in content size detected")}}(e,0,n,o,r)}ge()});function Fn(e){_e=Cn[Ye](),bt=Pn[vt](),Hn(_e,bt,e)}function Vn(e,t,o,a,i){ot<-1||(void 0!==i||(i=ht),function(){const s=`${ct}:${e}:${t}:${o}${void 0===a?"":`:${a}`}`;if(dt)try{window.parent.iframeParentListener(F+s)}catch(e){if(1!==ot)throw e;return void Ln()}else ft.postMessage(F+s,i);he(`Sending message to parent page via ${dt?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}())}const Hn=ve((e,t,n,o,r)=>{ze(n),Vn(e,t,n,o,r),ge()}),Un=ve(function(e){ze("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Hn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(c);ft=e.source,ce=e.origin,kt(t),Be=!1,setTimeout(()=>{Xe=!1},128)},reset(){Xe||Fn("resetPage")},resize(){Wn(A,"Parent window requested size check")},moveToAnchor(){Ke.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();Mt?X(Mt,n(e)):o(m)},parentInfo(){const e=(r=i(),t(n(r)));var r;jt?X(jt,e):o(f)},message(){const e=i();X(Ot,n(e))}},a=()=>e.data.split("]")[1].split(c)[0],i=()=>e.data.slice(e.data.indexOf(c)+1),s=()=>e.data.split(c)[2]in{true:1,false:1};function d(){const t=a();ze(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Se(`Unexpected message (${e.data})`)}F===`${e.data}`.slice(0,13)&&function(){if(!1!==Be)return s()?(we(a()),ze(l),void r.init()):void 0;d()}()});let Zn=!1;const Jn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function _n(){if("loading"===document.readyState||!Be||Zn)return;const{parent:e,top:t}=window;ze("ready"),Jn(e),e!==t&&Jn(t),Zn=!0}"iframeChildListener"in window?Se("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Un({data:e,sameOrigin:!0})),ze("listen"),He(window,d,Un),He(document,x,_n),_n())}();
|
package/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.5.
|
|
4
|
+
* @module iframe-resizer/child 5.5.9 (umd) - 2026-02-06
|
|
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,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!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;",y=p?"color: #E3E3E3;":"color: #1F1F1F;",g="5.5.8",b="iframeResizer",v=":",w="init",z="message",$="pageHide",S="pageInfo",O="parentInfo",E="scrollToOffset",M="title",k=10,j="data-iframe-size",x="data-iframe-overflowed",T="data-iframe-ignore",I="height",C="width",N="offset",A="offsetSize",P="string",R="number",B="object",q="function",L="auto",D="readystatechange",F="bottom",W="right",H="autoResizeEnabled",V=Symbol("sizeChanged"),U="manualResize",Z="parentResize",J={[U]:1,[Z]:1},_="setOffsetSize",Q="resizeObserver",G="overflowObserver",Y="mutationObserver",X="visibilityObserver",K="[iFrameSizer]",ee=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),te=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)},ne=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),oe=["spjluzl","rlf","clyzpvu"],re=["<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.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],ie=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ae=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),se=e=>ne(re[e]),ce=e=>{const t=e[ne(oe[0])]||e[ne(oe[1])]||e[ne(oe[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=te(ne(e));return n in ae&&(t=ae[n]),t}(n[0]);return 0===o||(e=>e[2]===te(e[0]+e[1]))(n)||(o=-2),o},le=(e,...t)=>setTimeout(()=>e(...t),0),ue=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},de=e=>e,fe=e=>Math.round(1e3*e)/1e3,me=e=>e.charAt(0).toUpperCase()+e.slice(1),pe=e=>""!=`${e}`&&void 0!==e,he=e=>e();const ye=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${me(t)}`)},ge={br:"\n",rb:"[31;1m",bb:"[34;1m",b:"[1m",i:"[3m",u:"[4m","/":"[m"},be=Object.keys(ge),ve=new RegExp(`<(${be.join("|")})>`,"gi"),we=(e,t)=>ge[t]??"";let ze=!0,$e=b;const Se=(Oe=function(n={}){const l={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let y="";function g(){p.length=0,y=""}function b(){delete h.event,g()}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?y:""}`,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(){""===y&&(y=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}(),queueMicrotask(()=>queueMicrotask(w)))}function $(e,...t){0===p.length&&z(),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:g,time:function(e=r){z(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:z}},Oe?.__esModule?Oe.default:Oe);var Oe;const Ee=Se({label:`${b}(child)`,expand:!1});var Me;const ke=(Me="log",(...e)=>!ze||Ee[Me](...e));const{assert:je,endAutoGroup:xe,error:Te,errorBoundary:Ie,event:Ce,label:Ne,purge:Ae,warn:Pe}=Ee,Re=(Be=de,e=>Be(typeof e===P?window.chrome?e.replace(ve,we):(e=>e.replaceAll("<br>","\n").replaceAll(/<\/?[^>]+>/gi,""))(e):e));var Be;const qe=(...e)=>Ee.warn(...e.map(Re)),Le=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>qe(t)),De=Le("Method"),Fe=Le("Method","replaced with"),We=Le("Option"),He=["min-height","min-width","max-height","max-width"],Ve=new Set,Ue=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Ze=(e,t)=>{return(n=Ue(e,t))&&"0px"!==n&&n!==L&&"none"!==n;var n};function Je({href:e}){Ve.has(e)||Ve.add(e)}const _e=(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){Je(n)}return{source:"cross-origin stylesheet",value:Ue(e,t)}}(e,t),Qe=(e,t)=>{const{source:n,value:o}=_e(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);qe(`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 Ge(){for(const e of[document.documentElement,document.body])for(const t of He)Ze(e,t)&&Qe(e,t)}const Ye=e=>t=>void 0===t?void 0:e(t),Xe=Ye(e=>"true"===e),Ke=Ye(Number),et=[],tt=(e,t,n,o)=>{e.removeEventListener(t,n,o)},nt=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),et.push(()=>tt(e,t,n,o))},ot=e=>e=>{e.size},rt=((e="")=>t=>n=>{n.size>0&&Te(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),it=e=>e=>{e.size},at=(t,n=!0)=>o=>{o>0&&ke(`${n?"At":"De"}tached %c${t}Observer%c ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e,h,e)},st=(e,t,n,o)=>{const r=it(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()}},ct=new Set,lt=new Set,ut=new Set,dt=[],ft={attributes:!0,attributeFilter:[T,j],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let mt,pt=1,ht=!1,yt=0;const gt=e=>{e.size},bt=e=>{e.size},vt=e=>{e.size},wt=e=>e.nodeType!==Node.ELEMENT_NODE||ee.has(e.tagName.toLowerCase());function zt(e){const t=e.addedNodes;for(const e of t)wt(e)||ct.add(e)}function $t(e){const t=e.removedNodes;for(const e of t)wt(e)||(ct.has(e)?(ct.delete(e),ut.add(e)):lt.add(e))}const St=e=>{ke("Mutations:",e);for(const t of e)zt(t),$t(t);gt(ct),bt(lt),vt(ut),ut.clear()};const Ot=e=>()=>{const t=performance.now(),n=t-yt,o=16*pt+++2;if(n>o&&n<200)return Ce("mutationThrottled"),ke("Update delayed due to heavy workload on the callStack"),ke(`EventLoop busy time: %c${fe(n)}ms %c> Max wait: %c${o-2}ms`,h,y,h),setTimeout(mt,16*pt),void(yt=t);pt=1,dt.forEach(St),dt.length=0,ht=!1,lt.size,ct.size,e({addedNodes:ct,removedNodes:lt}),ct.clear(),lt.clear()};function Et(e){dt.push(e),ht||(yt=performance.now(),ht=!0,requestAnimationFrame(mt))}function Mt(e){const t=new window.MutationObserver(Et),n=document.body||document.documentElement;return mt=Ot(e),t.observe(n,ft),ke("Attached%c MutationObserver%c to body",h,y),{...t,disconnect:()=>{ct.clear(),lt.clear(),dt.length=0,t.disconnect(),ke("Detached%c MutationObserver",h)}}}const kt="Overflow",jt=at(kt),xt=at(kt,!1),Tt=ot(kt),It=rt(kt),Ct=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Nt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||de,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)&&!Ct(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));It(t),Tt(n),jt(o),n.clear(),t.clear()},detachObservers:st(kt,c,l,xt),disconnect:()=>{c.disconnect(),ke("Detached%c OverflowObserver",h)}}},At="--ifr-start",Pt="--ifr-end",Rt="--ifr-measure",Bt=[];let qt,Lt={},Dt=0;function Ft(){try{performance.clearMarks(At),performance.clearMarks(Pt),performance.clearMeasures(Rt)}catch{}}function Wt(e){e.getEntries().forEach(e=>{if(e.name===Pt)try{const{duration:t}=performance.measure(Rt,At,Pt);Lt=e.detail,Bt.push(t),Bt.length>100&&Bt.shift()}catch{}})}function Ht(){ke("Attached%c PerformanceObserver%c to page",h,y);const e=new PerformanceObserver(Wt);return e.observe({entryTypes:["mark"]}),qt=setInterval(()=>{if(Bt.length<10)return;if(Lt.hasTags&&Lt.len<25)return;Bt.sort();const e=Math.min(Bt.reduce((e,t)=>e+t,0)/Bt.length,Bt[Math.floor(Bt.length/2)]),t=fe(e);t>Dt&&(Dt=t,Ce("performanceObserver")),Ft(),e<=4||(clearInterval(qt),qe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${fe(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Lt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{Ft(),clearInterval(qt),e.disconnect(),ke("Detached%c PerformanceObserver",h)}}}const Vt="Resize",Ut=at(Vt),Zt=at(Vt,!1),Jt=ot(Vt),_t=rt(Vt),Qt=new WeakSet,Gt=new Set,Yt=new Set;let Xt;function Kt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Qt.has(n)?Gt.add(n):(Xt.observe(n),Qt.add(n),Yt.add(n),t+=1))}_t(Gt),Jt(Yt),Ut(t),Yt.clear(),Gt.clear()}function en(e){const t=new IntersectionObserver(t=>e(t.at(-1).isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),ke("Attached%c VisibilityObserver%c to page",h,y),{disconnect:()=>{t.disconnect(),ke("Detached%c VisibilityObserver",h)}}}const tn=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},nn=tn(q),on=tn(R),rn=tn(P);"undefined"!=typeof window&&function(){const o={height:()=>(Pe("Custom height calculation function not defined"),Nn.auto()),width:()=>(Pe("Custom width calculation function not defined"),An.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a=L,s="scroll";let c,l,u,d,f,m,p,te=!0,re="",ae=0,fe="",ge="",be=!1,ve=!0,we=!1,Se=!0,Oe=!1,Me=!1,Re=!0,Be=!1,Le=1,He=a,Ve="",Ue=!0,Ze={},Je=!1,_e=!1,Qe=!1,Ye=0,ot=!1,rt=0,it=0,at=new Set,ct="",lt="child",ut=!1,dt="",ft=[],mt=window.parent,pt="*",ht=0,yt=!1,gt=1,bt=s,vt=window,wt=()=>{Pe("onMessage function not defined")},zt=()=>{},$t=null,St=null;function Ot(e){var t;!function(e){ct=e[0]??ct,ae=Ke(e[1])??ae,we=Xe(e[2])??we,Qe=Xe(e[3])??Qe,te=Xe(e[6])??te,fe=e[7]??fe,He=e[8]??He,re=e[9]??re,ge=e[10]??ge,ht=Ke(e[11])??ht,Ze.enable=Xe(e[12])??!1,lt=e[13]??lt,bt=e[14]??bt,ot=Xe(e[15])??ot,rt=Ke(e[16])??rt,it=Ke(e[17])??it,ve=Xe(e[18])??ve,c=e[19]??c,m=e[20]??m,Ye=Ke(e[21])??Ye,_e=Xe(e[23])??_e}(e),$e=(t={id:ct,enabled:Qe,expand:_e}).id||b,Ee.label(`${$e}`),Ee.expand(t.expand),ze=t.enabled,Ce("initReceived"),function(){function e(e){p=nn(e,"onBeforeResize")??p,wt=nn(e,"onMessage")??wt,zt=nn(e,"onReady")??zt,typeof e?.offset===R&&(We(N,A),ve&&(rt=on(e,N)??rt),we&&(it=on(e,N)??it)),typeof e?.offsetSize===R&&(ve&&(rt=on(e,A)??rt),we&&(it=on(e,A)??it)),l=rn(e,ne(oe[0]))??l,Ve=rn(e,"ignoreSelector")??Ve,dt=rn(e,"sizeSelector")??dt,pt=rn(e,"targetOrigin")??pt,He=e?.heightCalculationMethod||He,bt=e?.widthCalculationMethod||bt}function t(e,t){return typeof e===q&&(qe(`<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===Ye)return;const n=window.iframeResizer||window.iFrameResizer;typeof n===B&&(e(n),He=t(He,I),bt=t(bt,C),ke(`Set targetOrigin for parent: %c${pt}`,h))}(),[Bt,Lt,sn,Ct,qt,tn,an,Gt,Rt,Tt,be?de:Ge,Ut,()=>Dt("background",re),()=>Dt("padding",ge),be?de:Jt,ln,Wt,On,un,cn,dn,kt,fn].forEach(e=>{try{e()}catch(e){if(Ye<0)throw e;qe("<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</>"),Te(e)}}),xt(ue(zt)),xe(),Fn(w,"Init message from host page",void 0,void 0,`${g}:${Ye}`),document.title&&""!==document.title&&Vn(0,0,M,document.title)}function Et({persisted:e}){e||Vn(0,0,"beforeUnload"),Ce($),ke("Page persisted:",e),e||et.forEach(he)}const kt=()=>nt(window,$.toLowerCase(),Et);let jt=!1;function xt(e){"complete"===document.readyState?le(e):jt||nt(document,D,()=>xt(e)),jt=!0}function Tt(){ft=document.querySelectorAll(`[${j}]`),Be=ft.length>0}let It=0;function Ct(){const n=document.querySelectorAll(`*[${T}]`);return Oe=n.length>0,Oe&&n.length!==It&&(function(n){const o=1===n.length?"":"s";Pe(`%c[${T}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),It=n.length),Oe}function Rt(){"BackCompat"===document.compatMode&&qe("<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 Bt(){m&&""!==m&&"false"!==m?m!==g&&qe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${m} - Child page: ${g}.\n`):qe("<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 qt(){try{ut=1===Ye||"iframeParentListener"in window.parent}catch(e){}}function Lt(){we===ve&&(be=!0)}function Dt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ke(`Set body ${e}: %c${t}`,h))}function Ft(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Wt(){Ft(0,j,dt),Ft(0,T,Ve)}function Ut(){var e,t;void 0===fe&&(fe=`${ae}px`),Dt("margin",(e="margin",(t=fe).includes("-")&&(Pe(`Negative CSS value ignored for ${e}`),t=""),t))}function Jt(){const e=e=>e.style.setProperty(I,L,"important");e(document.documentElement),e(document.body)}function _t(e){({add(t){function n(){Fn(e.eventName,e.eventType)}i[t]=n,nt(window,t,n,{passive:!0})},remove(e){const t=i[e];delete i[e],tt(window,e,t)}})[e.method](e.eventName)}function Gt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(j,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&qe("<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 Yt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Pe(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&qe(`<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 ${m?"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: '${L}',\n}\n`}\n`),e}function tn(){He=Yt(He,a,Nn)}function an(){bt=Yt(bt,s,An)}function sn(){const t=Ye,n=ce({key:c}),o=ce({key:l});if(Ye=Math.max(n,o),Ye<0){if(Ye=Math.min(n,o),Ae(),qe(`${se(Ye+2)}${se(2)}`),pe(m))throw se(Ye+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!pe(m)||t>-1&&Ye>t)&&(sessionStorage.getItem("ifr")!==g&&function(t,n){console.info(`${$e} %ciframe-resizer ${t}`,ze||n<1?"font-weight: bold;":e)}(`v${g} (${(e=>ne(ie[e]))(Ye)})`,Ye),Ye<2&&qe(se(3)),sessionStorage.setItem("ifr",g))}function cn(){!function(e){_t({method:e,eventType:"After Print",eventName:"afterprint"}),_t({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add")}function ln(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function un(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,k)+parseInt(n.x,k),y:parseInt(t.top,k)+parseInt(n.y,k)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Vn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Vn(n.y,n.x,E)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ze;o&&(1===Ye?qe(se(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&nt(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),nt(window,"hashchange",n),setTimeout(n,128))),Ze={...Ze,findTarget:t}}function dn(){function e(e){Vn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){nt(window.document,t,e)}!0===ot&&(t("mouseenter"),t("mouseleave"))}function fn(){1!==Ye&&(vt.parentIframe=Object.freeze({autoResize:e=>(ye(e,"boolean","parentIframe.autoResize(enable) enable"),!1===we&&!1===ve?(Ce(H),qe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===te?(te=!0,queueMicrotask(()=>Fn(H,"Auto Resize enabled"))):!1===e&&!0===te&&(te=!1),Vn(0,0,"autoResize",JSON.stringify(te)),te)),close(){Vn(0,0,"close")},getId:()=>ct,getOrigin:()=>(Ce("getOrigin"),De("getOrigin()","getParentOrigin()"),u),getParentOrigin:()=>u,getPageInfo(e){if(typeof e===q)return $t=e,Vn(0,0,S),void Fe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");$t=null,Vn(0,0,"pageInfoStop")},getParentProps:e=>(ye(e,q,"parentIframe.getParentProps(callback) callback"),St=e,Vn(0,0,O),()=>{St=null,Vn(0,0,"parentInfoStop")}),getParentProperties(e){De("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ye(e,P,"parentIframe.moveToAnchor(anchor) anchor"),Ze.findTarget(e)},reset(){!function(){const e=He;He=a,yt||(yt=!0,requestAnimationFrame(()=>{yt=!1})),Wn("reset"),He=e}()},setOffsetSize(e){ye(e,R,"parentIframe.setOffsetSize(offset) offset"),rt=e,it=e,Fn(_,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ye(e,R,"parentIframe.scrollBy(x, y) x"),ye(t,R,"parentIframe.scrollBy(x, y) y"),Vn(t,e,"scrollBy")},scrollTo(e,t){ye(e,R,"parentIframe.scrollTo(x, y) x"),ye(t,R,"parentIframe.scrollTo(x, y) y"),Vn(t,e,"scrollTo")},scrollToOffset(e,t){ye(e,R,"parentIframe.scrollToOffset(x, y) x"),ye(t,R,"parentIframe.scrollToOffset(x, y) y"),Vn(t,e,E)},sendMessage(e,t){t&&ye(t,P,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Vn(0,0,z,JSON.stringify(e),t)},setHeightCalculationMethod(e){He=e,tn()},setWidthCalculationMethod(e){bt=e,an()},setTargetOrigin(e){ye(e,P,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),pt=e},resize(e,t){void 0!==e&&ye(e,R,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ye(t,R,"parentIframe.resize(customHeight, customWidth) customWidth"),Fn(U,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){De("size()","resize()"),this.resize(e,t)}}),vt.parentIFrame=vt.parentIframe)}let mn=new Set;function pn(){const e=document.querySelectorAll(`[${x}]`);at=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(()=>{Ce("overflowIgnored"),ke("Ignoring elements with [data-iframe-ignore] > *:\n",n),xe()}),t}(e),Me=at.size>0,typeof Set.prototype.symmetricDifference===q&&(Re=at.symmetricDifference(mn).size>0),mn=at}function hn(){switch(pn(),!0){case!Re:return;case at.size>1:ke("Overflowed Elements:",at);break;case Me:break;default:ke("No overflow detected")}Fn(G,"Overflow updated")}function yn(e){const t={root:document.documentElement,side:ve?F:W};return d=Nt(hn,t),d.attachObservers(e),d}function gn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Fn(Q,`Element resized <${function(e){switch(!0){case!pe(e):return"";case pe(e.id):return`${e.nodeName}#${e.id}`;case pe(e.name):return`${e.nodeName} (${e.name}`;case pe(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function bn(e){return Xt=new ResizeObserver(gn),Xt.observe(document.body),Qt.add(document.body),ke("Attached%c ResizeObserver%c to body",h,y),f={attachObserverToNonStaticElements:Kt,detachObservers:st(Vt,Xt,Qt,Zt),disconnect:()=>{Xt.disconnect(),ke("Detached%c ResizeObserver",h)}},f.attachObserverToNonStaticElements(e),f}function vn(e){Je=!e,Fn(X,"Visibility changed")}const wn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of jn(n))t.add(e)}return ke("Inspecting:\n",t),t},zn=e=>{if(0===e.size)return;Ce("addObservers");const t=wn(e);d.attachObservers(t),f.attachObserverToNonStaticElements(t),xe()},$n=e=>{if(0===e.size)return;Ce("removeObservers");const t=wn(e);d.detachObservers(t),f.detachObservers(t),xe()};function Sn(e){!function({addedNodes:e,removedNodes:t}){Ce("contentMutated"),Wt(),Tt(),pn(),xe(),$n(t),zn(e)}(e),Fn(Y,"Mutation Observed")}function On(){const e=jn(document.documentElement);var t;t=[Mt(Sn),yn(e),Ht(),bn(e),en(vn)],et.push(...t.map(e=>e.disconnect))}function En(e){performance.mark(At);const t=me(e);let n=1,o=document.documentElement,r=Be?0:document.documentElement.getBoundingClientRect().bottom;const i=Be?ft:Me?Array.from(at):jn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return ke(`${t} position calculated from:`,o),ke(`Checked %c${i.length}%c elements`,h,y),performance.mark(Pt,{detail:{hasTags:Be,len:i.length,logging:Qe,Side:t}}),r}const Mn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],kn=`* ${Array.from(ee).map(e=>`:not(${e})`).join("")}`,jn=e=>e.querySelectorAll(kn),xn={height:0,width:0},Tn={height:0,width:0},In=[h,y,h];function Cn(e){function t(){return Tn[o]=r,xn[o]=s,Math.max(r,1)}const n=e===Nn,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 Be:ke("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Me&&Se&&0===Tn[o]&&0===xn[o]:ke(`Initial page size values: ${c}`,...In),l=t();break;case yt&&r===Tn[o]&&s===xn[o]:ke(`Size unchanged: ${c}`,...In),l=Math.max(r,s);break;case 0===r&&0!==s:ke(`Page is hidden: ${c}`,...In),l=s;break;case!Me&&r!==Tn[o]&&s<=xn[o]:ke(`New <html> size: ${c} `,...In),ke(`Previous <html> size: %c${Tn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Me&&r<Tn[o]:ke(`<html> size decreased: ${c}`,...In),l=t();break;case s===a||s===i:ke(`<html> size equals page size: ${c}`,...In),l=t();break;case r>s:ke(`Page size < <html> size: ${c}`,...In),l=t();break;case Me:ke("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:ke(`Using <html> size: ${c}`,...In),l=t()}return ke(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&ke(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Nn={label:I,enabled:()=>ve,getOffset:()=>rt,auto:()=>Cn(Nn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,k)+parseInt(t.marginBottom,k)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Nn.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(...Mn(Nn)),min:()=>Math.min(...Mn(Nn)),grow:()=>Nn.max(),lowestElement:()=>En(F),taggedElement:()=>En(F)},An={label:C,enabled:()=>we,getOffset:()=>it,auto:()=>Cn(An),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(...Mn(An)),min:()=>Math.min(...Mn(An)),rightMostElement:()=>En(W),scroll:()=>Math.max(An.bodyScroll(),An.documentElementScroll()),taggedElement:()=>En(W)},Pn=(e,t)=>!(Math.abs(e-t)<=ht);function Rn(e,t){const n=e[t](),o=e.enabled()&&void 0!==p?function(e){const t=p(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 je(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Bn=!1;const qn=ue(()=>qe(se(4)));let Ln,Dn=!1;const Fn=Ie((e,t,n,o,r)=>{switch(Ce(e),!0){case!0===Je:if(!0===Dn)break;Dn=!0,Bn=!1,cancelAnimationFrame(Ln);break;case!0===Bn&&e!==G:Ae();break;case!te&&!(e in J):ke("Resizing disabled");break;default:Dn=!1,Bn=!0,performance.now(),Ln||(Ln=requestAnimationFrame(()=>{Bn=!1,Ln=null,Ce("requestAnimationFrame")})),function(e,t,n,o,r){const i=n??Rn(Nn,He),a=o??Rn(An,bt);switch(ve&&Pn(Le,i)||we&&Pn(gt,a)?V:e){case w:case H:case V:Le=i,gt=a;case _:Hn(Le,gt,e,r);break;case G:case Y:case Q:case X:Ae();break;default:Ae(),ke("No change in content size detected")}}(e,0,n,o,r)}xe()});function Wn(e){Le=Nn[He](),gt=An[bt](),Vn(Le,gt,e)}function Hn(e,t,o,r,i){Ye<-1||(void 0!==i||(i=pt),function(){const a=`${ct}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(ut)try{window.parent.iframeParentListener(K+a)}catch(e){if(1!==Ye)throw e;return void qn()}else mt.postMessage(K+a,i);ke(`Sending message to parent page via ${ut?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const Vn=Ie((e,t,n,o,r)=>{Ce(n),Hn(e,t,n,o,r),xe()}),Un=Ie(function(e){Ce("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Vn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(v);mt=e.source,u=e.origin,Ot(t),Se=!1,setTimeout(()=>{Ue=!1},128)},reset(){Ue||Wn("resetPage")},resize(){Fn(Z,"Parent window requested size check")},moveToAnchor(){Ze.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();$t?le($t,n(e)):o(S)},parentInfo(){const e=(r=a(),t(n(r)));var r;St?le(St,e):o(O)},message(){const e=a();le(wt,n(e))}},i=()=>e.data.split("]")[1].split(v)[0],a=()=>e.data.slice(e.data.indexOf(v)+1),s=()=>e.data.split(v)[2]in{true:1,false:1};function c(){const t=i();Ce(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Pe(`Unexpected message (${e.data})`)}K===`${e.data}`.slice(0,13)&&function(){if(!1!==Se)return s()?(Ne(i()),Ce(w),void r.init()):void 0;c()}()});let Zn=!1;const Jn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function _n(){if("loading"===document.readyState||!Se||Zn)return;const{parent:e,top:t}=window;Ce("ready"),Jn(e),e!==t&&Jn(t),Zn=!0}"iframeChildListener"in window?Pe("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Un({data:e,sameOrigin:!0})),Ce("listen"),nt(window,z,Un),nt(document,D,_n),_n())}()});
|
|
20
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,r="default",i=Object.freeze({assert:!0,error:!0,warn:!0}),a={expand:!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;",y=p?"color: #E3E3E3;":"color: #1F1F1F;",g="5.5.9",b="iframeResizer",v=":",z="init",w="message",$="pageHide",S="pageInfo",O="parentInfo",E="scrollToOffset",M="title",k=10,j="data-iframe-size",x="data-iframe-overflowed",T="data-iframe-ignore",I="height",C="width",N="offset",A="offsetSize",P="string",R="number",B="object",q="function",L="auto",D="readystatechange",F="bottom",W="right",H="autoResizeEnabled",V=Symbol("sizeChanged"),U="manualResize",Z="parentResize",J={[U]:1,[Z]:1},_="setOffsetSize",Q="resizeObserver",G="overflowObserver",Y="mutationObserver",X="visibilityObserver",K="[iFrameSizer]",ee=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),te=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)},ne=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),oe=["spjluzl","rlf","clyzpvu"],re=["<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.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],ie=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ae=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl"].map((e,t)=>[e,Math.max(0,t-1)])),se=e=>ne(re[e]),ce=e=>{const t=e[ne(oe[0])]||e[ne(oe[1])]||e[ne(oe[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=te(ne(e));return n in ae&&(t=ae[n]),t>4?t-4:t}(n[0]);return 0===o||(e=>e[2]===te(e[0]+e[1]))(n)||(o=-2),o},le=(e,...t)=>setTimeout(()=>e(...t),0),ue=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},de=e=>e,fe=e=>Math.round(1e3*e)/1e3,me=e=>e.charAt(0).toUpperCase()+e.slice(1),pe=e=>""!=`${e}`&&void 0!==e,he=e=>e();const ye=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${me(t)}`)},ge={br:"\n",rb:"[31;1m",bb:"[34;1m",b:"[1m",i:"[3m",u:"[4m","/":"[m"},be=Object.keys(ge),ve=new RegExp(`<(${be.join("|")})>`,"gi"),ze=(e,t)=>ge[t]??"";let we=!0,$e=b;const Se=(Oe=function(n={}){const l={},u={},p=[],h={...a,expand:!n.collapsed||a.expanded,...n};let y="";function g(){p.length=0,y=""}function b(){delete h.event,g()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){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?y:""}`,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 w(){""===y&&(y=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}(),queueMicrotask(()=>queueMicrotask(z)))}function $(e,...t){0===p.length&&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:z,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;$("error",e),z()}return n},event:function(e){w(),h.event=e},purge:g,time:function(e=r){w(),l[e]=performance.now()},timeEnd:function(e=r){S(e),delete l[e]},timeLog:S,touch:w}},Oe?.__esModule?Oe.default:Oe);var Oe;const Ee=Se({label:`${b}(child)`,expand:!1});var Me;const ke=(Me="log",(...e)=>!we||Ee[Me](...e));const{assert:je,endAutoGroup:xe,error:Te,errorBoundary:Ie,event:Ce,label:Ne,purge:Ae,warn:Pe}=Ee,Re=(Be=de,e=>Be(typeof e===P?window.chrome?e.replace(ve,ze):(e=>e.replaceAll("<br>","\n").replaceAll(/<\/?[^>]+>/gi,""))(e):e));var Be;const qe=(...e)=>Ee.warn(...e.map(Re)),Le=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>qe(t)),De=Le("Method"),Fe=Le("Method","replaced with"),We=Le("Option"),He=["min-height","min-width","max-height","max-width"],Ve=new Set,Ue=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Ze=(e,t)=>{return(n=Ue(e,t))&&"0px"!==n&&n!==L&&"none"!==n;var n};function Je({href:e}){Ve.has(e)||Ve.add(e)}const _e=(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){Je(n)}return{source:"cross-origin stylesheet",value:Ue(e,t)}}(e,t),Qe=(e,t)=>{const{source:n,value:o}=_e(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);qe(`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 Ge(){for(const e of[document.documentElement,document.body])for(const t of He)Ze(e,t)&&Qe(e,t)}const Ye=e=>t=>void 0===t?void 0:e(t),Xe=Ye(e=>"true"===e),Ke=Ye(Number),et=[],tt=(e,t,n,o)=>{e.removeEventListener(t,n,o)},nt=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),et.push(()=>tt(e,t,n,o))},ot=e=>e=>{e.size},rt=((e="")=>t=>n=>{n.size>0&&Te(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),it=e=>e=>{e.size},at=(t,n=!0)=>o=>{o>0&&ke(`${n?"At":"De"}tached %c${t}Observer%c ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e,h,e)},st=(e,t,n,o)=>{const r=it(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()}},ct=new Set,lt=new Set,ut=new Set,dt=[],ft={attributes:!0,attributeFilter:[T,j],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let mt,pt=1,ht=!1,yt=0;const gt=e=>{e.size},bt=e=>{e.size},vt=e=>{e.size},zt=e=>e.nodeType!==Node.ELEMENT_NODE||ee.has(e.tagName.toLowerCase());function wt(e){const t=e.addedNodes;for(const e of t)zt(e)||ct.add(e)}function $t(e){const t=e.removedNodes;for(const e of t)zt(e)||(ct.has(e)?(ct.delete(e),ut.add(e)):lt.add(e))}const St=e=>{ke("Mutations:",e);for(const t of e)wt(t),$t(t);gt(ct),bt(lt),vt(ut),ut.clear()};const Ot=e=>()=>{const t=performance.now(),n=t-yt,o=16*pt+++2;if(n>o&&n<200)return Ce("mutationThrottled"),ke("Update delayed due to heavy workload on the callStack"),ke(`EventLoop busy time: %c${fe(n)}ms %c> Max wait: %c${o-2}ms`,h,y,h),setTimeout(mt,16*pt),void(yt=t);pt=1,dt.forEach(St),dt.length=0,ht=!1,lt.size,ct.size,e({addedNodes:ct,removedNodes:lt}),ct.clear(),lt.clear()};function Et(e){dt.push(e),ht||(yt=performance.now(),ht=!0,requestAnimationFrame(mt))}function Mt(e){const t=new window.MutationObserver(Et),n=document.body||document.documentElement;return mt=Ot(e),t.observe(n,ft),ke("Attached%c MutationObserver%c to body",h,y),{...t,disconnect:()=>{ct.clear(),lt.clear(),dt.length=0,t.disconnect(),ke("Detached%c MutationObserver",h)}}}const kt="Overflow",jt=at(kt),xt=at(kt,!1),Tt=ot(kt),It=rt(kt),Ct=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,Nt=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||de,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)&&!Ct(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));It(t),Tt(n),jt(o),n.clear(),t.clear()},detachObservers:st(kt,c,l,xt),disconnect:()=>{c.disconnect(),ke("Detached%c OverflowObserver",h)}}},At="--ifr-start",Pt="--ifr-end",Rt="--ifr-measure",Bt=[];let qt,Lt={},Dt=0;function Ft(){try{performance.clearMarks(At),performance.clearMarks(Pt),performance.clearMeasures(Rt)}catch{}}function Wt(e){e.getEntries().forEach(e=>{if(e.name===Pt)try{const{duration:t}=performance.measure(Rt,At,Pt);Lt=e.detail,Bt.push(t),Bt.length>100&&Bt.shift()}catch{}})}function Ht(){ke("Attached%c PerformanceObserver%c to page",h,y);const e=new PerformanceObserver(Wt);return e.observe({entryTypes:["mark"]}),qt=setInterval(()=>{if(Bt.length<10)return;if(Lt.hasTags&&Lt.len<25)return;Bt.sort();const e=Math.min(Bt.reduce((e,t)=>e+t,0)/Bt.length,Bt[Math.floor(Bt.length/2)]),t=fe(e);t>Dt&&(Dt=t,Ce("performanceObserver")),Ft(),e<=4||(clearInterval(qt),qe(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${fe(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${Lt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{Ft(),clearInterval(qt),e.disconnect(),ke("Detached%c PerformanceObserver",h)}}}const Vt="Resize",Ut=at(Vt),Zt=at(Vt,!1),Jt=ot(Vt),_t=rt(Vt),Qt=new WeakSet,Gt=new Set,Yt=new Set;let Xt;function Kt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Qt.has(n)?Gt.add(n):(Xt.observe(n),Qt.add(n),Yt.add(n),t+=1))}_t(Gt),Jt(Yt),Ut(t),Yt.clear(),Gt.clear()}function en(e){const t=new IntersectionObserver(t=>e(t.at(-1).isIntersecting),{threshold:0}),n=document.documentElement;return t.observe(n),ke("Attached%c VisibilityObserver%c to page",h,y),{disconnect:()=>{t.disconnect(),ke("Detached%c VisibilityObserver",h)}}}const tn=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},nn=tn(q),on=tn(R),rn=tn(P);"undefined"!=typeof window&&function(){const o={height:()=>(Pe("Custom height calculation function not defined"),Nn.auto()),width:()=>(Pe("Custom width calculation function not defined"),An.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},i={},a=L,s="scroll";let c,l,u,d,f,m,p,te=!0,re="",ae=0,fe="",ge="",be=!1,ve=!0,ze=!1,Se=!0,Oe=!1,Me=!1,Re=!0,Be=!1,Le=1,He=a,Ve="",Ue=!0,Ze={},Je=!1,_e=!1,Qe=!1,Ye=0,ot=!1,rt=0,it=0,at=new Set,ct="",lt="child",ut=!1,dt="",ft=[],mt=window.parent,pt="*",ht=0,yt=!1,gt=1,bt=s,vt=window,zt=()=>{Pe("onMessage function not defined")},wt=()=>{},$t=null,St=null;function Ot(e){var t;!function(e){ct=e[0]??ct,ae=Ke(e[1])??ae,ze=Xe(e[2])??ze,Qe=Xe(e[3])??Qe,te=Xe(e[6])??te,fe=e[7]??fe,He=e[8]??He,re=e[9]??re,ge=e[10]??ge,ht=Ke(e[11])??ht,Ze.enable=Xe(e[12])??!1,lt=e[13]??lt,bt=e[14]??bt,ot=Xe(e[15])??ot,rt=Ke(e[16])??rt,it=Ke(e[17])??it,ve=Xe(e[18])??ve,c=e[19]??c,m=e[20]??m,Ye=Ke(e[21])??Ye,_e=Xe(e[23])??_e}(e),$e=(t={id:ct,enabled:Qe,expand:_e}).id||b,Ee.label(`${$e}`),Ee.expand(t.expand),we=t.enabled,Ce("initReceived"),function(){function e(e){p=nn(e,"onBeforeResize")??p,zt=nn(e,"onMessage")??zt,wt=nn(e,"onReady")??wt,typeof e?.offset===R&&(We(N,A),ve&&(rt=on(e,N)??rt),ze&&(it=on(e,N)??it)),typeof e?.offsetSize===R&&(ve&&(rt=on(e,A)??rt),ze&&(it=on(e,A)??it)),l=rn(e,ne(oe[0]))??l,Ve=rn(e,"ignoreSelector")??Ve,dt=rn(e,"sizeSelector")??dt,pt=rn(e,"targetOrigin")??pt,He=e?.heightCalculationMethod||He,bt=e?.widthCalculationMethod||bt}function t(e,t){return typeof e===q&&(qe(`<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===Ye)return;const n=window.iframeResizer||window.iFrameResizer;typeof n===B&&(e(n),He=t(He,I),bt=t(bt,C),ke(`Set targetOrigin for parent: %c${pt}`,h))}(),[Bt,Lt,sn,Ct,qt,tn,an,Gt,Rt,Tt,be?de:Ge,Ut,()=>Dt("background",re),()=>Dt("padding",ge),be?de:Jt,ln,Wt,On,un,cn,dn,kt,fn].forEach(e=>{try{e()}catch(e){if(Ye<0)throw e;qe("<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</>"),Te(e)}}),xt(ue(wt)),xe(),Fn(z,"Init message from host page",void 0,void 0,`${g}:${Ye}`),document.title&&""!==document.title&&Vn(0,0,M,document.title)}function Et({persisted:e}){e||Vn(0,0,"beforeUnload"),Ce($),ke("Page persisted:",e),e||et.forEach(he)}const kt=()=>nt(window,$.toLowerCase(),Et);let jt=!1;function xt(e){"complete"===document.readyState?le(e):jt||nt(document,D,()=>xt(e)),jt=!0}function Tt(){ft=document.querySelectorAll(`[${j}]`),Be=ft.length>0}let It=0;function Ct(){const n=document.querySelectorAll(`*[${T}]`);return Oe=n.length>0,Oe&&n.length!==It&&(function(n){const o=1===n.length?"":"s";Pe(`%c[${T}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),It=n.length),Oe}function Rt(){"BackCompat"===document.compatMode&&qe("<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 Bt(){m&&""!==m&&"false"!==m?m!==g&&qe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${m} - Child page: ${g}.\n`):qe("<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 qt(){try{ut=1===Ye||"iframeParentListener"in window.parent}catch(e){}}function Lt(){ze===ve&&(be=!0)}function Dt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),ke(`Set body ${e}: %c${t}`,h))}function Ft(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Wt(){Ft(0,j,dt),Ft(0,T,Ve)}function Ut(){var e,t;void 0===fe&&(fe=`${ae}px`),Dt("margin",(e="margin",(t=fe).includes("-")&&(Pe(`Negative CSS value ignored for ${e}`),t=""),t))}function Jt(){const e=e=>e.style.setProperty(I,L,"important");e(document.documentElement),e(document.body)}function _t(e){({add(t){function n(){Fn(e.eventName,e.eventType)}i[t]=n,nt(window,t,n,{passive:!0})},remove(e){const t=i[e];delete i[e],tt(window,e,t)}})[e.method](e.eventName)}function Gt(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(j,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&qe("<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 Yt(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Pe(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&qe(`<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 ${m?"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: '${L}',\n}\n`}\n`),e}function tn(){He=Yt(He,a,Nn)}function an(){bt=Yt(bt,s,An)}function sn(){const t=Ye,n=ce({key:c}),o=ce({key:l});if(Ye=Math.max(n,o),Ye<0){if(Ye=Math.min(n,o),Ae(),qe(`${se(Ye+2)}${se(2)}`),pe(m))throw se(Ye+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!pe(m)||t>-1&&Ye>t)&&(sessionStorage.getItem("ifr")!==g&&function(t,n){console.info(`${$e} %ciframe-resizer ${t}`,we||n<1?"font-weight: bold;":e)}(`v${g} (${(e=>ne(ie[e]))(Ye)})`,Ye),Ye<2&&qe(se(3)),sessionStorage.setItem("ifr",g))}function cn(){!function(e){_t({method:e,eventType:"After Print",eventName:"afterprint"}),_t({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add")}function ln(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function un(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,k)+parseInt(n.x,k),y:parseInt(t.top,k)+parseInt(n.y,k)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Vn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Vn(n.y,n.x,E)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ze;o&&(1===Ye?qe(se(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&nt(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),nt(window,"hashchange",n),setTimeout(n,128))),Ze={...Ze,findTarget:t}}function dn(){function e(e){Vn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){nt(window.document,t,e)}!0===ot&&(t("mouseenter"),t("mouseleave"))}function fn(){1!==Ye&&(vt.parentIframe=Object.freeze({autoResize:e=>(ye(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ze&&!1===ve?(Ce(H),qe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===te?(te=!0,queueMicrotask(()=>Fn(H,"Auto Resize enabled"))):!1===e&&!0===te&&(te=!1),Vn(0,0,"autoResize",JSON.stringify(te)),te)),close(){Vn(0,0,"close")},getId:()=>ct,getOrigin:()=>(Ce("getOrigin"),De("getOrigin()","getParentOrigin()"),u),getParentOrigin:()=>u,getPageInfo(e){if(typeof e===q)return $t=e,Vn(0,0,S),void Fe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");$t=null,Vn(0,0,"pageInfoStop")},getParentProps:e=>(ye(e,q,"parentIframe.getParentProps(callback) callback"),St=e,Vn(0,0,O),()=>{St=null,Vn(0,0,"parentInfoStop")}),getParentProperties(e){De("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ye(e,P,"parentIframe.moveToAnchor(anchor) anchor"),Ze.findTarget(e)},reset(){!function(){const e=He;He=a,yt||(yt=!0,requestAnimationFrame(()=>{yt=!1})),Wn("reset"),He=e}()},setOffsetSize(e){ye(e,R,"parentIframe.setOffsetSize(offset) offset"),rt=e,it=e,Fn(_,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ye(e,R,"parentIframe.scrollBy(x, y) x"),ye(t,R,"parentIframe.scrollBy(x, y) y"),Vn(t,e,"scrollBy")},scrollTo(e,t){ye(e,R,"parentIframe.scrollTo(x, y) x"),ye(t,R,"parentIframe.scrollTo(x, y) y"),Vn(t,e,"scrollTo")},scrollToOffset(e,t){ye(e,R,"parentIframe.scrollToOffset(x, y) x"),ye(t,R,"parentIframe.scrollToOffset(x, y) y"),Vn(t,e,E)},sendMessage(e,t){t&&ye(t,P,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Vn(0,0,w,JSON.stringify(e),t)},setHeightCalculationMethod(e){He=e,tn()},setWidthCalculationMethod(e){bt=e,an()},setTargetOrigin(e){ye(e,P,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),pt=e},resize(e,t){void 0!==e&&ye(e,R,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ye(t,R,"parentIframe.resize(customHeight, customWidth) customWidth"),Fn(U,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){De("size()","resize()"),this.resize(e,t)}}),vt.parentIFrame=vt.parentIframe)}let mn=new Set;function pn(){const e=document.querySelectorAll(`[${x}]`);at=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(()=>{Ce("overflowIgnored"),ke("Ignoring elements with [data-iframe-ignore] > *:\n",n),xe()}),t}(e),Me=at.size>0,typeof Set.prototype.symmetricDifference===q&&(Re=at.symmetricDifference(mn).size>0),mn=at}function hn(){switch(pn(),!0){case!Re:return;case at.size>1:ke("Overflowed Elements:",at);break;case Me:break;default:ke("No overflow detected")}Fn(G,"Overflow updated")}function yn(e){const t={root:document.documentElement,side:ve?F:W};return d=Nt(hn,t),d.attachObservers(e),d}function gn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Fn(Q,`Element resized <${function(e){switch(!0){case!pe(e):return"";case pe(e.id):return`${e.nodeName}#${e.id}`;case pe(e.name):return`${e.nodeName} (${e.name}`;case pe(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function bn(e){return Xt=new ResizeObserver(gn),Xt.observe(document.body),Qt.add(document.body),ke("Attached%c ResizeObserver%c to body",h,y),f={attachObserverToNonStaticElements:Kt,detachObservers:st(Vt,Xt,Qt,Zt),disconnect:()=>{Xt.disconnect(),ke("Detached%c ResizeObserver",h)}},f.attachObserverToNonStaticElements(e),f}function vn(e){Je=!e,Fn(X,"Visibility changed")}const zn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of jn(n))t.add(e)}return ke("Inspecting:\n",t),t},wn=e=>{if(0===e.size)return;Ce("addObservers");const t=zn(e);d.attachObservers(t),f.attachObserverToNonStaticElements(t),xe()},$n=e=>{if(0===e.size)return;Ce("removeObservers");const t=zn(e);d.detachObservers(t),f.detachObservers(t),xe()};function Sn(e){!function({addedNodes:e,removedNodes:t}){Ce("contentMutated"),Wt(),Tt(),pn(),xe(),$n(t),wn(e)}(e),Fn(Y,"Mutation Observed")}function On(){const e=jn(document.documentElement);var t;t=[Mt(Sn),yn(e),Ht(),bn(e),en(vn)],et.push(...t.map(e=>e.disconnect))}function En(e){performance.mark(At);const t=me(e);let n=1,o=document.documentElement,r=Be?0:document.documentElement.getBoundingClientRect().bottom;const i=Be?ft:Me?Array.from(at):jn(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return ke(`${t} position calculated from:`,o),ke(`Checked %c${i.length}%c elements`,h,y),performance.mark(Pt,{detail:{hasTags:Be,len:i.length,logging:Qe,Side:t}}),r}const Mn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],kn=`* ${Array.from(ee).map(e=>`:not(${e})`).join("")}`,jn=e=>e.querySelectorAll(kn),xn={height:0,width:0},Tn={height:0,width:0},In=[h,y,h];function Cn(e){function t(){return Tn[o]=r,xn[o]=s,Math.max(r,1)}const n=e===Nn,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 Be:ke("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Me&&Se&&0===Tn[o]&&0===xn[o]:ke(`Initial page size values: ${c}`,...In),l=t();break;case yt&&r===Tn[o]&&s===xn[o]:ke(`Size unchanged: ${c}`,...In),l=Math.max(r,s);break;case 0===r&&0!==s:ke(`Page is hidden: ${c}`,...In),l=s;break;case!Me&&r!==Tn[o]&&s<=xn[o]:ke(`New <html> size: ${c} `,...In),ke(`Previous <html> size: %c${Tn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Me&&r<Tn[o]:ke(`<html> size decreased: ${c}`,...In),l=t();break;case s===a||s===i:ke(`<html> size equals page size: ${c}`,...In),l=t();break;case r>s:ke(`Page size < <html> size: ${c}`,...In),l=t();break;case Me:ke("Found elements possibly overflowing <html> "),l=e.taggedElement();break;default:ke(`Using <html> size: ${c}`,...In),l=t()}return ke(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&ke(`Page offsetSize: %c${t}px`,h),t}(e),Math.max(l,1)}const Nn={label:I,enabled:()=>ve,getOffset:()=>rt,auto:()=>Cn(Nn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,k)+parseInt(t.marginBottom,k)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Nn.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(...Mn(Nn)),min:()=>Math.min(...Mn(Nn)),grow:()=>Nn.max(),lowestElement:()=>En(F),taggedElement:()=>En(F)},An={label:C,enabled:()=>ze,getOffset:()=>it,auto:()=>Cn(An),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(...Mn(An)),min:()=>Math.min(...Mn(An)),rightMostElement:()=>En(W),scroll:()=>Math.max(An.bodyScroll(),An.documentElementScroll()),taggedElement:()=>En(W)},Pn=(e,t)=>!(Math.abs(e-t)<=ht);function Rn(e,t){const n=e[t](),o=e.enabled()&&void 0!==p?function(e){const t=p(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 je(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Bn=!1;const qn=ue(()=>qe(se(4)));let Ln,Dn=!1;const Fn=Ie((e,t,n,o,r)=>{switch(Ce(e),!0){case!0===Je:if(!0===Dn)break;Dn=!0,Bn=!1,cancelAnimationFrame(Ln),Ln=null;break;case!0===Bn&&e!==G:Ae();break;case!te&&!(e in J):ke("Resizing disabled");break;default:Dn=!1,Bn=!0,performance.now(),Ln||(Ln=requestAnimationFrame(()=>{Bn=!1,Ln=null,Ce("requestAnimationFrame")})),function(e,t,n,o,r){const i=n??Rn(Nn,He),a=o??Rn(An,bt);switch(ve&&Pn(Le,i)||ze&&Pn(gt,a)?V:e){case z:case H:case V:Le=i,gt=a;case _:Hn(Le,gt,e,r);break;case G:case Y:case Q:case X:Ae();break;default:Ae(),ke("No change in content size detected")}}(e,0,n,o,r)}xe()});function Wn(e){Le=Nn[He](),gt=An[bt](),Vn(Le,gt,e)}function Hn(e,t,o,r,i){Ye<-1||(void 0!==i||(i=pt),function(){const a=`${ct}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(ut)try{window.parent.iframeParentListener(K+a)}catch(e){if(1!==Ye)throw e;return void qn()}else mt.postMessage(K+a,i);ke(`Sending message to parent page via ${ut?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}())}const Vn=Ie((e,t,n,o,r)=>{Ce(n),Hn(e,t,n,o,r),xe()}),Un=Ie(function(e){Ce("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Vn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(v);mt=e.source,u=e.origin,Ot(t),Se=!1,setTimeout(()=>{Ue=!1},128)},reset(){Ue||Wn("resetPage")},resize(){Fn(Z,"Parent window requested size check")},moveToAnchor(){Ze.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();$t?le($t,n(e)):o(S)},parentInfo(){const e=(r=a(),t(n(r)));var r;St?le(St,e):o(O)},message(){const e=a();le(zt,n(e))}},i=()=>e.data.split("]")[1].split(v)[0],a=()=>e.data.slice(e.data.indexOf(v)+1),s=()=>e.data.split(v)[2]in{true:1,false:1};function c(){const t=i();Ce(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Pe(`Unexpected message (${e.data})`)}K===`${e.data}`.slice(0,13)&&function(){if(!1!==Se)return s()?(Ne(i()),Ce(z),void r.init()):void 0;c()}()});let Zn=!1;const Jn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function _n(){if("loading"===document.readyState||!Se||Zn)return;const{parent:e,top:t}=window;Ce("ready"),Jn(e),e!==t&&Jn(t),Zn=!0}"iframeChildListener"in window?Pe("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Un({data:e,sameOrigin:!0})),Ce("listen"),nt(window,w,Un),nt(document,D,_n),_n())}()});
|