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