You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
28 KiB
20 lines
28 KiB
/*!
|
|
* @preserve
|
|
*
|
|
* @module iframe-resizer/child 5.5.2 (iife)
|
|
*
|
|
* @license GPL-3.0 for non-commercial use only.
|
|
* For commercial use, you must purchase a license from
|
|
* https://iframe-resizer.com/pricing
|
|
*
|
|
* @description Keep same and cross domain iFrames sized to their content
|
|
*
|
|
* @author David J. Bradshaw <info@iframe-resizer.com>
|
|
*
|
|
* @see {@link https://iframe-resizer.com}
|
|
*
|
|
* @copyright (c) 2013 - 2025, David J. Bradshaw. All rights reserved.
|
|
*/
|
|
|
|
|
|
!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",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",I="mutationObserver",x="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,t,n)=>e.removeEventListener(t,n,!1),B=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},L=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),q=["spjluzl","rlf","clyzpvu"],W=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],F=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],D=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),H=e=>L(W[e]);var V=e=>{const t=e[L(q[0])]||e[L(q[1])]||e[L(q[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=B(L(e));return n in D&&(t=D[n]),t}(n[0]);return 0===o||(e=>e[2]===B(e[0]+e[1]))(n)||(o=-2),o};const U=(e,...t)=>setTimeout(()=>e(...t),0),Z=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},J=e=>e,_=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=b;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 b(){delete h.event,y()}const v=()=>!!p.some(([e])=>e in i)||!!h.expand;function z(){if(0!==p.length){c[v()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?g:""}`,e,t,o);for(const[e,...t]of p)c.assert(e in c,`Unknown console method: ${e}`),e in c&&c[e](...t);c.groupEnd(),b()}else b()}function 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:`${b}(child)`});var oe;const re=(oe="log",(...e)=>!X||ne[oe](...e));const{assert:ie,debug:ae,endAutoGroup:se,error:ce,errorBoundary:le,event:ue,label:de,purge:fe,warn:me}=ne,pe=e=>{return ne.warn((t=J,e=>window.chrome?t(e.replaceAll("<br>","\n").replaceAll("<rb>","[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},he=pe,ge=(e=>(t,n="renamed to")=>(o,r,i="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${i}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>pe(t)),ye=ge("Method"),be=ge("Method","replaced with"),ve=ge("Option"),ze=["min-height","min-width","max-height","max-width"],we=new Set,$e=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Se=(e,t)=>{return(n=$e(e,t))&&"0px"!==n&&"auto"!==n&&"none"!==n;var n};function Oe({href:e}){we.has(e)||we.add(e)}const Ee=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Oe(n)}return{source:"cross-origin stylesheet",value:$e(e,t)}}(e,t),Me=(e,t)=>{const{source:n,value:o}=Ee(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);pe(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function je(){for(const e of[document.documentElement,document.body])for(const t of ze)Se(e,t)&&Me(e,t)}const ke=e=>t=>void 0===t?void 0:e(t),Te=ke(e=>"true"===e),Ae=ke(Number),Ie=e=>e=>{e.size},xe=((e="")=>t=>n=>{n.size>0&&ce(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Ne=e=>e=>{e.size},Ce=(t,n=!0)=>o=>{o>0&&re(`${n?"At":"De"}tached ${t}Observer ${n?"to":"from"} %c${o}%c element${1===o?"":"s"}`,h,e)},Pe=(e,t,n,o)=>{const r=Ne(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()}},Re=new Set,Be=new Set,Le=new Set,qe=[],We={attributes:!0,attributeFilter:[$,z],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let Fe,De=1,He=!1,Ve=0;const Ue=e=>{e.size},Ze=e=>{e.size},Je=e=>{e.size},_e=e=>e.nodeType!==Node.ELEMENT_NODE||C.has(e.tagName.toLowerCase());function Qe(e){const t=e.addedNodes;for(const e of t)_e(e)||Re.add(e)}function Ge(e){const t=e.removedNodes;for(const e of t)_e(e)||(Re.has(e)?(Re.delete(e),Le.add(e)):Be.add(e))}const Ye=e=>{re("Mutations:",e);for(const t of e)Qe(t),Ge(t);Ue(Re),Ze(Be),Je(Le),Le.clear()};const Xe=e=>()=>{const t=performance.now(),n=t-Ve,o=16*De+++2;if(n>o&&n<200)return ue("mutationThrottled"),re("Update delayed due to heavy workload on the callStack"),re(`EventLoop busy time: %c${_(n)}ms %c> Max wait: %c${o-2}ms`,h,g,h),setTimeout(Fe,16*De),void(Ve=t);De=1,qe.forEach(Ye),qe.length=0,He=!1,Be.size,Re.size,e({addedNodes:Re,removedNodes:Be}),Re.clear(),Be.clear()};function Ke(e){qe.push(e),He||(Ve=performance.now(),He=!0,requestAnimationFrame(Fe))}function et(e){const t=new window.MutationObserver(Ke),n=document.body||document.documentElement;return Fe=Xe(e),t.observe(n,We),re("Attached MutationObserver to body"),t}const tt="Overflow",nt=Ce(tt),ot=Ce(tt,!1),rt=Ie(tt),it=xe(tt),at=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,st=(e,t)=>{const n=t.side,o={root:t.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||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)&&!at(r);s(r,c)}r(i)},o),l=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(l.has(r)?t.add(r):(c.observe(r),l.add(r),n.add(r),o+=1));it(t),rt(n),nt(o),n.clear(),t.clear()},detachObservers:Pe(tt,c,l,ot)}},ct="--ifr-start",lt="--ifr-end",ut=[],dt=new WeakSet,ft=e=>"object"==typeof e&&dt.add(e);let mt={},pt=0;function ht(e){e.getEntries().forEach(e=>{if(e.name===lt){const{duration:t}=performance.measure("--ifr-measure",ct,lt);mt=e.detail,ut.push(t),ut.length>100&&ut.shift()}})}function gt(){re("Attached PerformanceObserver to page");new PerformanceObserver(ht).observe({entryTypes:["mark"]}),ft(document.documentElement),ft(document.body),function(){const e=setInterval(()=>{if(ut.length<10)return;if(mt.hasTags&&mt.len<25)return;ut.sort();const t=Math.min(ut.reduce((e,t)=>e+t,0)/ut.length,ut[Math.floor(ut.length/2)]),n=_(t);n>pt&&(pt=n,ue("performanceObserver")),t<=4||(clearInterval(e),pe(`<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 ${mt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3)}()}const yt="Resize",bt=Ce(yt),vt=Ce(yt,!1),zt=Ie(yt),wt=xe(yt),$t=new WeakSet;let St;function Ot(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&&($t.has(r)?t.add(r):(St.observe(r),$t.add(r),n.add(r),o+=1))}wt(t),zt(n),bt(o),n.clear(),t.clear()}const Et=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Mt=Et("function"),jt=Et("number"),kt=Et("string");"undefined"!=typeof window&&function(){const o={height:()=>(me("Custom height calculation function not defined"),rn.auto()),width:()=>(me("Custom width calculation function not defined"),an.auto())},r={},i={},a="auto",s="[iFrameSizer]",c="scroll";let l,u,d,f,m,p,B,W,D,_=!0,ee="",te=0,oe="",ie="",ae=!1,ge=!0,ze=!1,we=!0,$e=!1,Se=!1,Oe=!1,Ee=1,Me=a,ke="",Ie=!0,xe={},Ne=!1,Ce=!0,Re=!1,Be=0,Le=!1,qe=[],We="",Fe="child",De=!1,He="",Ve=[],Ue=window.parent,Ze="*",Je=0,_e=!1,Qe=1,Ge=c,Ye=window,Xe=()=>{me("onMessage function not defined")},Ke=()=>{},tt=null,nt=null;function ot(e){var t;!function(e){We=e[0]??We,te=Ae(e[1])??te,ze=Te(e[2])??ze,Re=Te(e[3])??Re,_=Te(e[6])??_,oe=e[7]??oe,Me=e[8]??Me,ee=e[9]??ee,ie=e[10]??ie,Je=Ae(e[11])??Je,xe.enable=Te(e[12])??!1,Fe=e[13]??Fe,Ge=e[14]??Ge,Le=Te(e[15])??Le,d=Ae(e[16])??d,f=Ae(e[17])??f,ge=Te(e[18])??ge,l=e[19]??l,W=e[20]??W,Be=Ae(e[21])??Be,Ce=Te(e[23])??Ce}(e),K=(t={id:We,enabled:Re,expand:Ce}).id||b,ne.label(`${K}`),ne.expand(t.expand),X=t.enabled,function(){function e(e){D=Mt(e,"onBeforeResize")??D,Xe=Mt(e,"onMessage")??Xe,Ke=Mt(e,"onReady")??Ke,"number"==typeof e?.offset&&(ve("offset","offsetSize"),ge&&(d=jt(e,"offset")??d),ze&&(f=jt(e,"offset")??f)),"number"==typeof e?.offsetSize&&(ge&&(d=jt(e,"offsetSize")??d),ze&&(f=jt(e,"offsetSize")??f)),u=kt(e,L(q[0]))??u,ke=kt(e,"ignoreSelector")??ke,He=kt(e,"sizeSelector")??He,Ze=kt(e,"targetOrigin")??Ze,Me=e?.heightCalculationMethod||Me,Ge=e?.widthCalculationMethod||Ge}function t(e,t){return"function"==typeof e&&(pe(`<rb>Deprecated Option(${t}CalculationMethod)</>\n\nThe use of <b>${t}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),o[t]=e,e="custom"),e}if(1===Be)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),Me=t(Me,"height"),Ge=t(Ge,"width"),re(`Set targetOrigin for parent: %c${Ze}`,h))}(),[ft,pt,Ct,ut,mt,xt,Nt,At,dt,it,ae?J:je,zt,qt,Lt,Bt,wt,()=>ht("background",ee),()=>ht("padding",ie),ae?J:Et,Rt,Pt,Qt].forEach(e=>{try{e()}catch(e){if(Be<0)throw e;pe("<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</>"),ce(e)}}),rt(Z(Ke)),fn(N,"Init message from host page",void 0,void 0,`${y}:${Be}`),document.title&&""!==document.title&&pn(0,0,"title",document.title)}function rt(e){"complete"===document.readyState?U(e):P(document,"readystatechange",()=>rt(e))}function it(){Ve=document.querySelectorAll(`[${z}]`),Oe=Ve.length>0}let at=0;function ut(){const n=document.querySelectorAll(`*[${$}]`);return $e=n.length>0,$e&&n.length!==at&&(function(n){const o=1===n.length?"":"s";me(`%c[${$}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),at=n.length),$e}function dt(){"BackCompat"===document.compatMode&&pe("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function ft(){W&&""!==W&&"false"!==W?W!==y&&pe(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${W} - Child page: ${y}.\n`):pe("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function mt(){try{De=1===Be||"iframeParentListener"in window.parent}catch(e){}}function pt(){ze===ge&&(ae=!0)}function ht(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),re(`Set body ${e}: %c${t}`,h))}function bt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function zt(){bt(0,z,He),bt(0,$,ke)}function wt(){var e,t;void 0===oe&&(oe=`${te}px`),ht("margin",(e="margin",(t=oe).includes("-")&&(me(`Negative CSS value ignored for ${e}`),t=""),t))}function Et(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}function Tt(e){({add(t){function n(){fn(e.eventName,e.eventType)}i[t]=n,P(window,t,n,{passive:!0})},remove(e){const t=i[e];delete i[e],R(window,e,t)}})[e.method](e.eventName)}function At(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(z,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&pe("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function It(e,t,n,o){return t!==e&&(e in n||(me(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r)&&pe(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${W?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),e}function xt(){Me=It(Me,a,rn,"height")}function Nt(){Ge=It(Ge,c,an,"width")}function Ct(){const t=Be,n=V({key:l}),o=V({key:u});if(Be=Math.max(n,o),Be<0){if(Be=Math.min(n,o),fe(),pe(`${H(Be+2)}${H(2)}`),G(W))throw H(Be+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!G(W)||t>-1&&Be>t)&&(sessionStorage.getItem("ifr")!==y&&function(t,n){console.info(`${K} %ciframe-resizer ${t}`,X||n<1?"font-weight: bold;":e)}(`v${y} (${(e=>L(F[e]))(Be)})`,Be),Be<2&&he(H(3)),sessionStorage.setItem("ifr",y))}function Pt(){!function(e){Tt({method:e,eventType:"After Print",eventName:"afterprint"}),Tt({method:e,eventType:"Before Print",eventName:"beforeprint"}),Tt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add")}function Rt(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function Bt(){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?pn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);pn(n.y,n.x,"scrollToOffset")}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}xe.enable&&(1===Be?pe("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 Lt(){function e(e){pn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){P(window.document,t,e)}!0===Le&&(t("mouseenter"),t("mouseleave"))}function qt(){1!==Be&&(Ye.parentIframe=Object.freeze({autoResize:e=>(Y(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ze&&!1===ge?(ue(E),pe("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===_?(_=!0,queueMicrotask(()=>fn(E,"Auto Resize enabled"))):!1===e&&!0===_&&(_=!1),pn(0,0,"autoResize",JSON.stringify(_)),_)),close(){pn(0,0,"close")},getId:()=>We,getOrigin:()=>(ye("getOrigin()","getParentOrigin()"),m),getParentOrigin:()=>m,getPageInfo(e){if("function"==typeof e)return tt=e,pn(0,0,"pageInfo"),void be("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");tt=null,pn(0,0,"pageInfoStop")},getParentProps:e=>(Y(e,"function","parentIframe.getParentProps(callback) callback"),nt=e,pn(0,0,"parentInfo"),()=>{nt=null,pn(0,0,"parentInfoStop")}),getParentProperties(e){ye("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){Y(e,"string","parentIframe.moveToAnchor(anchor) anchor"),xe.findTarget(e)},reset(){!function(){const e=Me;Me=a,_e||(_e=!0,requestAnimationFrame(()=>{_e=!1})),mn("reset"),Me=e}()},setOffsetSize(e){Y(e,"number","parentIframe.setOffsetSize(offset) offset"),d=e,f=e,fn(k,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){Y(e,"number","parentIframe.scrollBy(x, y) x"),Y(t,"number","parentIframe.scrollBy(x, y) y"),pn(t,e,"scrollBy")},scrollTo(e,t){Y(e,"number","parentIframe.scrollTo(x, y) x"),Y(t,"number","parentIframe.scrollTo(x, y) y"),pn(t,e,"scrollTo")},scrollToOffset(e,t){Y(e,"number","parentIframe.scrollToOffset(x, y) x"),Y(t,"number","parentIframe.scrollToOffset(x, y) y"),pn(t,e,"scrollToOffset")},sendMessage(e,t){t&&Y(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),pn(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Me=e,xt()},setWidthCalculationMethod(e){Ge=e,Nt()},setTargetOrigin(e){Y(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Ze=e},resize(e,t){e&&Y(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&Y(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),fn("manualResize",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ye("size()","resize()"),this.resize(e,t)}}),Ye.parentIFrame=Ye.parentIframe)}function Wt(){const e=document.querySelectorAll(`[${w}]`);qe=Array.from(e).filter(e=>!e.closest(`[${$}]`)),Se=qe.length>0}function Ft(e){Wt(),(Se||e)&&(qe.length>1?re("Overflowed Elements:",...qe):Se||re("No overflow detected"),fn(A,"Overflow updated"))}function Dt(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;fn(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 Ht(e){St=new ResizeObserver(Dt),St.observe(document.body),$t.add(document.body),re("Attached ResizeObserver to body"),B={attachObserverToNonStaticElements:Ot,detachObservers:Pe(yt,St,$t,vt)},B.attachObserverToNonStaticElements(e)}function Vt(e){Ne=!e,fn(x,"Visibility changed")}const Ut=e=>{const t=new Set;for(const n of e)for(const e of Kt(n))t.add(e);return re("Inspecting:\n",t),t},Zt=e=>{if(0===e.size)return;ue("addObservers");const t=Ut(e);p.attachObservers(t),B.attachObserverToNonStaticElements(t),se()},Jt=e=>{if(0===e.size)return;ue("removeObservers");const t=Ut(e);p.detachObservers(t),B.detachObservers(t),se()};function _t(e){!function({addedNodes:e,removedNodes:t}){ue("contentMutated"),zt(),it(),Wt(),se(),Jt(t),Zt(e)}(e),fn(I,"Mutation Observed")}function Qt(){const e=Kt(document.documentElement);et(_t),function(e){const t={root:document.documentElement,side:ge?S:O};p=st(Ft,t),p.attachObservers(e)}(e),gt(),Ht(e),function(e){const t=new IntersectionObserver(t=>e(t[0].isIntersecting),{threshold:0}),n=document.documentElement;t.observe(n),re("Attached VisibilityObserver to page")}(Vt)}function Gt(e){performance.mark(ct);const t=Q(e);let n=0,o=document.documentElement,r=Oe?0:document.documentElement.getBoundingClientRect().bottom;const i=Oe?Ve:Se?qe:Kt(document.documentElement);for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return re(`${t} position calculated from:`,o),performance.mark(lt,{detail:{hasTags:Oe,len:i.length,logging:Re,Side:t}}),r}const Yt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Xt=e=>`:not(${e})`,Kt=e=>[e,...e.querySelectorAll(`* ${[...C].map(Xt).join("")}`)],en={height:0,width:0},tn={height:0,width:0},nn=[h,g,h];function on(e){function t(){return tn[o]=r,en[o]=s,r}const n=e===rn,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 Oe:re("Found element with data-iframe-size attribute"),l=e.taggedElement();break;case!Se&&0===tn[o]&&0===en[o]:re(`Initial page size values: ${c}`,...nn),l=t();break;case _e&&r===tn[o]&&s===en[o]:re(`Size unchanged: ${c}`,...nn),l=Math.max(r,s);break;case 0===r:re(`Page is hidden: ${c}`,...nn),l=s;break;case!Se&&r!==tn[o]&&s<=en[o]:re(`New <html> size: ${c} `,...nn),re(`Previous <html> size: %c${tn[o]}px`,h),l=t();break;case!n:l=e.taggedElement();break;case!Se&&r<tn[o]:re(`<html> size decreased: ${c}`,...nn),l=t();break;case s===a||s===i:re(`<html> size equals page size: ${c}`,...nn),l=t();break;case r>s:re(`Page size < <html> size: ${c}`,...nn),l=t();break;case Se:re("Found element overflowing <html> "),l=e.taggedElement();break;default:re(`Using <html> size: ${c}`,...nn),l=t()}return re(`Content ${o}: %c${l}px`,h),l+=function(e){const t=e.getOffset();return 0!==t&&re(`Page offsetSize: %c${t}px`,h),t}(e),l}const rn={enabled:()=>ge,getOffset:()=>d,auto:()=>on(rn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,v)+parseInt(t.marginBottom,v)},bodyScroll:()=>document.body.scrollHeight,offset:()=>rn.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(...Yt(rn)),min:()=>Math.min(...Yt(rn)),grow:()=>rn.max(),lowestElement:()=>Gt(S),taggedElement:()=>Gt(S)},an={enabled:()=>ze,getOffset:()=>f,auto:()=>on(an),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>o.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Yt(an)),min:()=>Math.min(...Yt(an)),rightMostElement:()=>Gt(O),scroll:()=>Math.max(an.bodyScroll(),an.documentElementScroll()),taggedElement:()=>Gt(O)},sn=(e,t)=>!(Math.abs(e-t)<=Je);function cn(e,t){const n=e[t]();return e.enabled()&&void 0!==D?function(e){const t=D(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);return t}(n):n}let ln=!1;const un=Z(()=>he(H(4)));let dn=!1;const fn=le((e,t,n,o,r)=>{if(performance.now(),ue(e),!0!==ln){if(!_&&!(e in j))return re("Resizing disabled"),void se();if(Ne){if(!0===dn)return;dn=!0}else dn=!1,ln=!0,requestAnimationFrame(()=>{ln=!1}),function(e,t,n,o,r){const i=n??cn(rn,Me),a=o??cn(an,Ge);switch(ge&&sn(Ee,i)||ze&&sn(Qe,a)?M:e){case N:case E:case M:Ee=i,Qe=a;case k:pn(Ee,Qe,e,r);break;case A:case I:case T:case x:fe();break;default:fe(),re("No change in content size detected")}}(e,0,n,o,r)}});function mn(e){Ee=rn[Me](),Qe=an[Ge](),pn(Ee,Qe,e)}const pn=le(function(e,t,o,r,i){Be<0||(ue(o),void 0!==i||(i=Ze),function(){const a=`${We}:${e}:${t}:${o}${void 0===r?"":`:${r}`}`;if(De)try{window.parent.iframeParentListener(s+a)}catch(e){if(1!==Be)throw e;return void un()}else Ue.postMessage(s+a,i);re(`Sending message to parent page via ${De?"sameOrigin":"postMessage"}: %c%c${a}`,n,h)}(),se())}),hn=le(function(e){ue("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>pn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");Ue=e.source,m=e.origin,ot(t),we=!1,setTimeout(()=>{Ie=!1},128)},reset(){Ie||mn("resetPage")},resize(){fn("parentResize","Parent window requested size check")},moveToAnchor(){xe.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();tt?U(tt,n(e)):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;nt?U(nt,e):o("parentInfo")},message(){const e=a();U(Xe,n(e))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();ue(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||me(`Unexpected message (${e.data})`)}s===`${e.data}`.slice(0,13)&&function(){if(!1!==we)return c()?(de(i()),ue(N),void r.init()):void 0;l()}()});function gn(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}function yn(e){return hn(e),Ye}"iframeChildListener"in window?me("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>hn({data:e,sameOrigin:!0})),P(window,"message",hn),P(window,"readystatechange",gn),gn());try{top?.document?.getElementById("banner")&&(Ye={},window.mockMsgListener=yn,R(window,"message",hn),define([],()=>yn))}catch(e){}}()}();
|