@iframe-resizer/child 5.4.6 → 5.4.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.cjs.js +3 -2
- package/index.cjs.js.map +1 -0
- package/index.esm.js +3 -2
- package/index.esm.js.map +1 -0
- package/index.umd.js +3 -2
- package/index.umd.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.4.
|
|
4
|
+
* @module iframe-resizer/child 5.4.7-beta.1 (cjs) - 2025-06-03
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
"use strict";const e=require("auto-console-group"),t="5.4.6",n=10,o="data-iframe-size",r="data-iframe-overflowed",i="data-iframe-ignore",a="bottom",s="right",l="autoResizeEnabled",c=Symbol("sizeChanged"),u="manualResize",d="parentResize",m={[u]:1,[d]:1},f="setOffsetSize",p="resizeObserver",h="overflowObserver",y="mutationObserver",g="init",b=(e,t,n,o)=>e.addEventListener(t,n,o||!1),v=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const z=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(v[e]),w=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},$=e=>e,S=e=>Math.round(1e3*e)/1e3,O=e=>e.charAt(0).toUpperCase()+e.slice(1),I=e=>""!=`${e}`&&void 0!==e;const E=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${O(t)}`)};let j=!0;var T;const k=(T=e,T?.__esModule?T.default:T)({label:"iframeResizer(child)"});var M;const A=(M="log",(...e)=>!j||k[M](...e)),{assert:C,debug:P,endAutoGroup:x,error:N,errorBoundary:R,event:H,label:L,purge:B,warn:q}=k,G=e=>{return k.warn((t=$,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},W=G,D=(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)=>G(t))),F=D("Method"),V=D("Method","replaced with"),U=D("Option"),Z=e=>t=>void 0===t?void 0:e(t),J=Z((e=>"true"===e)),_=Z(Number),Q="--ifr-start",X="--ifr-end",Y=[],K=new WeakSet,ee=e=>"object"==typeof e&&K.add(e);let te={},ne=0;const oe=setInterval((()=>{if(Y.length<10)return;if(te.hasTags&&te.len<25)return;Y.sort();const e=Math.min(Y.reduce(((e,t)=>e+t),0)/Y.length,Y[Math.floor(Y.length/2)]),t=S(e);t>ne&&(ne=t,H("performanceObserver")),e<=4||(clearInterval(oe),G(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${S(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${te.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function re(e){e.getEntries().forEach((e=>{if(e.name===X){const{duration:t}=performance.measure("--ifr-measure",Q,X);te=e.detail,Y.push(t),Y.length>100&&Y.shift()}}))}function ie(){new PerformanceObserver(re).observe({entryTypes:["mark"]}),ee(document.documentElement),ee(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",ie):ie());const ae=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},se=ae("function"),le=ae("number"),ce=ae("string");"undefined"!=typeof window&&function(){const v={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},S={height:()=>(q("Custom height calculation function not defined"),yt.auto()),width:()=>(q("Custom width calculation function not defined"),gt.auto())},T={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},M={},P="checkVisibility"in window,N="auto",D="[iFrameSizer]",Z="scroll";let Y,K,ee,te,ne,oe=!0,re="",ie=0,ae="",ue="",de=!0,me=!1,fe=!0,pe=!1,he=!1,ye=!1,ge=1,be=N,ve="",ze=!0,we={},$e=!0,Se=!1,Oe="",Ie=0,Ee=!1,je="",Te=$,ke=[],Me="child",Ae=null,Ce=!1,Pe="",xe=[],Ne=window.parent,Re="*",He=0,Le=!1,Be=1,qe=Z,Ge=window,We=()=>{q("onMessage function not defined")},De=()=>{},Fe=null,Ve=null;function Ue(c){var d,m,p;!function(e){je=e[0]??je,ie=_(e[1])??ie,me=J(e[2])??me,Se=J(e[3])??Se,oe=J(e[6])??oe,ae=e[7]??ae,be=e[8]??be,re=e[9]??re,ue=e[10]??ue,He=_(e[11])??He,we.enable=J(e[12])??!1,Me=e[13]??Me,qe=e[14]??qe,Ee=J(e[15])??Ee,Y=_(e[16])??Y,K=_(e[17])??K,de=J(e[18])??de,Oe=e[19]??Oe,te=e[20]??te,Ie=_(e[21])??Ie,$e=J(e[23])??$e}(c),d={id:je,enabled:Se,expand:$e},k.label(`${d.id}`),k.expand(d.expand),j=d.enabled,function(){function t(e){ne=se(e,"onBeforeResize")??ne,We=se(e,"onMessage")??We,De=se(e,"onReady")??De,"number"==typeof e?.offset&&(U("offset","offsetSize"),de&&(Y=le(e,"offset")??Y),me&&(K=le(e,"offset")??K)),"number"==typeof e?.offsetSize&&(de&&(Y=le(e,"offsetSize")??Y),me&&(K=le(e,"offsetSize")??K)),ve=ce(e,"ignoreSelector")??ve,Pe=ce(e,"sizeSelector")??Pe,Re=ce(e,"targetOrigin")??Re,be=e?.heightCalculationMethod||be,qe=e?.widthCalculationMethod||qe}function n(e,t){return"function"==typeof e&&(G(`<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.`),S[t]=e,e="custom"),e}if(1===Ie)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),be=n(be,"height"),qe=n(qe,"width"),A(`Set targetOrigin for parent: %c${Re}`,e.HIGHLIGHT))}(),tt(),function(){try{Ce=1===Ie||"iframeParentListener"in window.parent}catch(e){}}(),Ie<0?W(`${z(Ie+2)}${z(2)}`):te?.codePointAt(0)>4||Ie<2&&W(z(3)),te&&""!==te&&"false"!==te?te!==t&&G(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${te} - Child page: ${t}.\n`):G("<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"),rt(),it(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(o,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&G("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),"BackCompat"===document.compatMode&&G("<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"),_e(),1!==Ie&&(Ge.parentIframe=Object.freeze({autoResize:e=>(E(e,"boolean","parentIframe.autoResize(enable) enable"),!1===me&&!1===de?(H(l),G("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===oe?(oe=!0,queueMicrotask((()=>$t(l,"Auto Resize enabled")))):!1===e&&!0===oe&&(oe=!1),Ot(0,0,"autoResize",JSON.stringify(oe)),oe)),close(){Ot(0,0,"close")},getId:()=>je,getOrigin:()=>(F("getOrigin()","getParentOrigin()"),ee),getParentOrigin:()=>ee,getPageInfo(e){if("function"==typeof e)return Fe=e,Ot(0,0,"pageInfo"),void V("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Fe=null,Ot(0,0,"pageInfoStop")},getParentProps:e=>(E(e,"function","parentIframe.getParentProps(callback) callback"),Ve=e,Ot(0,0,"parentInfo"),()=>{Ve=null,Ot(0,0,"parentInfoStop")}),getParentProperties(e){F("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){E(e,"string","parentIframe.moveToAnchor(anchor) anchor"),we.findTarget(e)},reset(){!function(){const e=be;be=N,Le||(Le=!0,requestAnimationFrame((()=>{Le=!1}))),St("reset"),be=e}()},setOffsetSize(e){E(e,"number","parentIframe.setOffsetSize(offset) offset"),Y=e,K=e,$t(f,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){E(e,"number","parentIframe.scrollBy(x, y) x"),E(t,"number","parentIframe.scrollBy(x, y) y"),Ot(t,e,"scrollBy")},scrollTo(e,t){E(e,"number","parentIframe.scrollTo(x, y) x"),E(t,"number","parentIframe.scrollTo(x, y) y"),Ot(t,e,"scrollTo")},scrollToOffset(e,t){E(e,"number","parentIframe.scrollToOffset(x, y) x"),E(t,"number","parentIframe.scrollToOffset(x, y) y"),Ot(t,e,"scrollToOffset")},sendMessage(e,t){t&&E(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Ot(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){be=e,rt()},setWidthCalculationMethod(e){qe=e,it()},setTargetOrigin(e){E(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Re=e},resize(e,t){e&&E(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&E(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),$t(u,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){F("size()","resize()"),this.resize(e,t)}}),Ge.parentIFrame=Ge.parentIframe),function(){function e(e){Ot(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){b(window.document,t,e)}!0===Ee&&(t("mouseenter"),t("mouseleave"))}(),we=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const o=t.getBoundingClientRect(),r=e();return{x:parseInt(o.left,n)+parseInt(r.x,n),y:parseInt(o.top,n)+parseInt(r.y,n)}}function o(e){function n(e){const n=t(e);Ot(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?Ot(0,0,"inPageLink",`#${o}`):n(i)}function r(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&b(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){b(window,"hashchange",r)}function s(){setTimeout(r,128)}function l(){i(),a(),s()}return we.enable&&(1===Ie?G("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):l()),{findTarget:o}}(),void 0===ae&&(ae=`${ie}px`),Ke("margin",(m="margin",(p=ae).includes("-")&&(q(`Negative CSS value ignored for ${m}`),p=""),p)),Ke("background",re),Ke("padding",ue),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){nt({method:e,eventType:"After Print",eventName:"afterprint"}),nt({method:e,eventType:"Before Print",eventName:"beforeprint"}),nt({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,r=0;const a=t=>{A("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},s=16,l=2,c=200;let u=1;function d(e){tt(),Qe(e),e.forEach(lt),e.clear()}function m(){const o=performance.now(),i=o-r;if(i>s*u+++l&&i<c)return A("Backed off due to heavy workload on callStack"),setTimeout(m,s*u),void(r=o);u=1,t.forEach(a),t.length=0,e.size>0&&d(e),_e(),Ze(),n=!1,$t(y,"Mutation Observed")}function f(e){t.push(e),n||(r=performance.now(),n=!0,requestAnimationFrame(m))}function p(){const e=new window.MutationObserver(f),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[i,o],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}p()}(),Ae=new ResizeObserver(at),Ae.observe(document.body),st.add(document.body),lt(document.body),de!==me&&(Te=(e=>{const t=e.side||a,n=e.onChange||$,o={root:e.root,rootMargin:"0px",threshold:1},i=window?.requestAnimationFrame||$,s=(e=!1)=>n(e),l=(e,n)=>0===e||e>n[t],c=(e,t)=>e.toggleAttribute(r,t),u=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,a=e[t],s=l(a,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);c(i,s)}var n;i(s)}),o),d=new WeakSet;return function(e){for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=d.has(t);!n&&e?(u.observe(t),d.add(t)):C(!n,"Node already observed",t)}}})({onChange:Je,root:document.documentElement,side:de?a:s})),Qe(dt(document)()),queueMicrotask(De),$t(g,"Init message from host page",void 0,void 0,t),document.title&&""!==document.title&&Ot(0,0,"title",document.title)}function Ze(){ke=document.querySelectorAll(`[${r}]:not([${i}]):not([${i}] *)`),he=ke.length>0}function Je(e){Ze(),(he||e)&&(he?A("Overflowed Elements:",...ke):A("Overflow removed"),$t(h,"Overflow updated"))}function _e(){xe=document.querySelectorAll(`[${o}]`),ye=xe.length>0}function Qe(e){ye||Te(e)}let Xe=0;function Ye(){const t=document.querySelectorAll(`*[${i}]`);pe=t.length>0,pe&&t.length!==Xe&&(function(t){const n=1===t.length?"":"s";q(`%c[${i}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),Xe=t.length)}function Ke(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),A(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function et(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function tt(){et(0,o,Pe),et(0,i,ve)}function nt(e){({add(t){function n(){$t(e.eventName,e.eventType)}M[t]=n,b(window,t,n,{passive:!0})},remove(e){const t=M[e];var n,o;delete M[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function ot(e,t,n,o){return t!==e&&(e in n||(q(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in T)&&G(`<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 ${te?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),e}function rt(){be=ot(be,N,yt,"height")}function it(){qe=ot(qe,Z,gt,"width")}function at(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;$t(p,`Element resized <${function(e){switch(!0){case!I(e):return"";case I(e.id):return`${e.nodeName}#${e.id}`;case I(e.name):return`${e.nodeName} (${e.name}`;case I(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const st=new WeakSet;function lt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!st.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Ae.observe(e),st.add(e))}const t=dt(e)();for(const e of t){if(st.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Ae.observe(e),st.add(e))}}function ct(e){performance.mark(Q);const t=O(e);let n=0,o=document.documentElement,r=ye?0:document.documentElement.getBoundingClientRect().bottom;const i=ye?xe:he?ke:dt(document)();let a=i.length;for(const t of i)ye||!P||t.checkVisibility(v)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t)):a-=1;return A(`${t} position calculated from:`,o),performance.mark(X,{detail:{Side:t,len:a,hasTags:ye,logging:Se}}),r}const ut=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],dt=e=>()=>{Ye();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return pe&&t.push(`not([${i}])`,`not([${i}] *)`),e.querySelectorAll(t.join(":"))},mt={height:0,width:0},ft={height:0,width:0},pt=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function ht(t){function n(){return ft[r]=i,mt[r]=l,i}const o=t===yt,r=o?"height":"width",i=t.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),c=`HTML: %c${i}px %cPage: %c${l}px`;let u=0;switch(!0){case!t.enabled():return l;case ye:A("Found element with data-iframe-size attribute"),u=t.taggedElement();break;case!he&&0===ft[r]&&0===mt[r]:A(`Initial page size values: ${c}`,...pt),u=n();break;case Le&&i===ft[r]&&l===mt[r]:A(`Size unchanged: ${c}`,...pt),u=Math.max(i,l);break;case 0===i:A(`Page is hidden: ${c}`,...pt),u=l;break;case!he&&i!==ft[r]&&l<=mt[r]:A(`New <html> size: ${c} `,...pt),A(`Previous <html> size: %c${ft[r]}px`,e.HIGHLIGHT),u=n();break;case!o:u=t.taggedElement();break;case!he&&i<ft[r]:A(`<html> size decreased: ${c}`,...pt),u=n();break;case l===s||l===a:A(`<html> size equals page size: ${c}`,...pt),u=n();break;case i>l:A(`Page size < <html> size: ${c}`,...pt),u=n();break;case he:A("Found element overflowing <html> "),u=t.taggedElement();break;default:A(`Using <html> size: ${c}`,...pt),u=n()}return A(`Content ${r}: %c${u}px`,e.HIGHLIGHT),u+=function(t){const n=t.getOffset();return 0!==n&&A(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),u}const yt={enabled:()=>de,getOffset:()=>Y,auto:()=>ht(yt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,n)+parseInt(t.marginBottom,n)},bodyScroll:()=>document.body.scrollHeight,offset:()=>yt.bodyOffset(),custom:()=>S.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...ut(yt)),min:()=>Math.min(...ut(yt)),grow:()=>yt.max(),lowestElement:()=>ct(a),taggedElement:()=>ct(a)},gt={enabled:()=>me,getOffset:()=>K,auto:()=>ht(gt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>S.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...ut(gt)),min:()=>Math.min(...ut(gt)),rightMostElement:()=>ct(s),scroll:()=>Math.max(gt.bodyScroll(),gt.documentElementScroll()),taggedElement:()=>ct(s)},bt=(e,t)=>!(Math.abs(e-t)<=He);function vt(e,t){const n=e[t]();return e.enabled()&&void 0!==ne?function(e){const t=ne(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 zt=!1;const wt=w((()=>W(z(4)))),$t=R(((e,t,n,o,r)=>{if(performance.now(),H(e),!0!==zt)return oe||e in m?void(document.hidden||(zt=!0,requestAnimationFrame((()=>{zt=!1})),function(e,t,n,o,r){const i=n??vt(yt,be),a=o??vt(gt,qe);switch(de&&bt(ge,i)||me&&bt(Be,a)?c:e){case g:case l:case c:ge=i,Be=a;case f:Ot(ge,Be,e,r);break;case p:case h:case y:B();break;default:B(),A("No change in content size detected")}}(e,0,n,o,r))):(A("Resizing disabled"),void x())}));function St(e){ge=yt[be](),Be=gt[qe](),Ot(ge,Be,e)}const Ot=R((function(t,n,o,r,i){Ie<-1||(H(o),void 0!==i||(i=Re),function(){const a=`${je}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(Ce)try{window.parent.iframeParentListener(D+a)}catch(e){if(1!==Ie)throw e;return void wt()}else Ne.postMessage(D+a,i);A(`Sending message to parent page via ${Ce?"sameOrigin":"postMessage"}: %c%c${a}`,e.ITALIC,e.HIGHLIGHT)}(),x())})),It=R((function(e){H("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Ot(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");Ne=e.source,ee=e.origin,Ue(t),fe=!1,setTimeout((()=>{ze=!1}),128)},reset(){ze||St("resetPage")},resize(){$t(d,"Parent window requested size check")},moveToAnchor(){we.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();Fe?setTimeout((()=>Fe(n(e)))):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;Ve?setTimeout((()=>Ve(e))):o("parentInfo")},message(){const e=a();setTimeout((()=>We(n(e))))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();H(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||q(`Unexpected message (${e.data})`)}D===`${e.data}`.slice(0,13)&&function(){if(!1!==fe)return s()?(L(i()),H(g),void r.init()):void 0;l()}()}));function Et(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?q("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>It({data:e,sameOrigin:!0}))),b(window,"message",It),b(window,"readystatechange",Et),Et())}();
|
|
20
|
+
"use strict";const e=require("auto-console-group"),t="5.4.7-beta.1",n=10,o="data-iframe-size",r="data-iframe-overflowed",i="data-iframe-ignore",a="bottom",s="right",l="autoResizeEnabled",c=Symbol("sizeChanged"),d="manualResize",u="parentResize",m={[d]:1,[u]:1},f="setOffsetSize",p="resizeObserver",g="overflowObserver",h="mutationObserver",y="No change in content size detected",b="init",v=(e,t,n,o)=>e.addEventListener(t,n,o||!1),z=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const w=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(z[e]),I=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},$=e=>e,H=e=>Math.round(1e3*e)/1e3,T=e=>e.charAt(0).toUpperCase()+e.slice(1),O=e=>""!=`${e}`&&void 0!==e;function S(e){switch(!0){case!O(e):return"";case O(e.id):return`${e.nodeName}#${e.id}`;case O(e.name):return`${e.nodeName} (${e.name}`;case O(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const M=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${T(t)}`)};let E=!0;var k;const j=(k=e,k?.__esModule?k.default:k)({label:"iframeResizer(child)"});const G=(A="log",(...e)=>!E||j[A](...e));var A;const R=G,{assert:L,debug:P,endAutoGroup:C,error:x,errorBoundary:N,event:q,label:B,purge:D,warn:F}=j,W=e=>{return j.warn((t=$,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},U=W,V=(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)=>W(t))),Z=V("Method"),J=V("Method","replaced with"),_=V("Option"),Q=e=>t=>void 0===t?void 0:e(t),X=Q((e=>"true"===e)),Y=Q(Number),K="--ifr-start",ee="--ifr-end",te=[],ne=new WeakSet,oe=e=>"object"==typeof e&&ne.add(e);let re={},ie=0;const ae=setInterval((()=>{if(te.length<10)return;if(re.hasTags&&re.len<25)return;te.sort();const e=Math.min(te.reduce(((e,t)=>e+t),0)/te.length,te[Math.floor(te.length/2)]),t=H(e);t>ie&&(ie=t,q("performanceObserver"),G("Mean time:",H(te[Math.floor(te.length/2)])),G("Median time:",H(te.reduce(((e,t)=>e+t),0)/te.length)),G("Average time:",t),G("Max time:",H(Math.max(...te)))),e<=4||(clearInterval(ae),W(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${H(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${re.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function se(e){e.getEntries().forEach((e=>{if(e.name===ee){const{duration:t}=performance.measure("--ifr-measure",K,ee);re=e.detail,te.push(t),te.length>100&&te.shift()}}))}function le(){new PerformanceObserver(se).observe({entryTypes:["mark"]}),oe(document.documentElement),oe(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",le):le());const ce=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},de=ce("function"),ue=ce("number"),me=ce("string");"undefined"!=typeof window&&function(){const z={height:()=>(F("Custom height calculation function not defined"),vt.auto()),width:()=>(F("Custom width calculation function not defined"),zt.auto())},O={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},k={},A="auto",x="[iFrameSizer]",D="scroll";let V,Q,te,ne,oe,re,ie,ae=!0,se="",le=0,ce="",fe="",pe=!0,ge=!1,he=!0,ye=!1,be=!1,ve=!1,ze=1,we=A,Ie="",$e=!0,He={},Te=!0,Oe=!1,Se="",Me=0,Ee=!1,ke="",je=$,Ge=[],Ae="child",Re=null,Le=!1,Pe="",Ce=[],xe=window.parent,Ne="*",qe=0,Be=!1,De=1,Fe=D,We=window,Ue=()=>{F("onMessage function not defined")},Ve=()=>{},Ze=null,Je=null;function _e(c){var u,m,p;!function(e){ke=e[0]??ke,le=Y(e[1])??le,ge=X(e[2])??ge,Oe=X(e[3])??Oe,ae=X(e[6])??ae,ce=e[7]??ce,we=e[8]??we,se=e[9]??se,fe=e[10]??fe,qe=Y(e[11])??qe,He.enable=X(e[12])??!1,Ae=e[13]??Ae,Fe=e[14]??Fe,Ee=X(e[15])??Ee,V=Y(e[16])??V,Q=Y(e[17])??Q,pe=X(e[18])??pe,Se=e[19]??Se,re=e[20]??re,Me=Y(e[21])??Me,Te=X(e[23])??Te}(c),u={id:ke,enabled:Oe,expand:Te},j.label(`${u.id}`),j.expand(u.expand),E=u.enabled,G(`Initialising iframe v${t} ${window.location.href}`),function(){function t(e){G("Reading data from page:",e),ie=de(e,"onBeforeResize")??ie,Ue=de(e,"onMessage")??Ue,Ve=de(e,"onReady")??Ve,"number"==typeof e?.offset&&(_("offset","offsetSize"),pe&&(V=ue(e,"offset")??V),ge&&(Q=ue(e,"offset")??Q)),"number"==typeof e?.offsetSize&&(pe&&(V=ue(e,"offsetSize")??V),ge&&(Q=ue(e,"offsetSize")??Q)),Ie=me(e,"ignoreSelector")??Ie,Pe=me(e,"sizeSelector")??Pe,Ne=me(e,"targetOrigin")??Ne,we=e?.heightCalculationMethod||we,Fe=e?.widthCalculationMethod||Fe}function n(e,t){return"function"==typeof e&&(W(`<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.`),z[t]=e,e="custom"),e}if(1===Me)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),we=n(we,"height"),Fe=n(Fe,"width"),R(`Set targetOrigin for parent: %c${Ne}`,e.HIGHLIGHT))}(),rt(),function(){try{Le=1===Me||"iframeParentListener"in window.parent}catch(e){G("Cross domain iframe detected")}}(),Me<0?U(`${w(Me+2)}${w(2)}`):re?.codePointAt(0)>4||Me<2&&U(w(3)),re&&""!==re&&"false"!==re?re!==t&&W(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${re} - Child page: ${t}.\n`):W("<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"),st(),lt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(o,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&W("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),"BackCompat"===document.compatMode&&W("<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"),Ye(),1!==Me&&(We.parentIframe=Object.freeze({autoResize:e=>(M(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ge&&!1===pe?(q(l),W("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===ae?(ae=!0,queueMicrotask((()=>Tt(l,"Auto Resize enabled")))):!1===e&&!0===ae&&(ae=!1),St(0,0,"autoResize",JSON.stringify(ae)),ae)),close(){St(0,0,"close")},getId:()=>ke,getOrigin:()=>(Z("getOrigin()","getParentOrigin()"),te),getParentOrigin:()=>te,getPageInfo(e){if("function"==typeof e)return Ze=e,St(0,0,"pageInfo"),void J("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ze=null,St(0,0,"pageInfoStop")},getParentProps:e=>(M(e,"function","parentIframe.getParentProps(callback) callback"),Je=e,St(0,0,"parentInfo"),()=>{Je=null,St(0,0,"parentInfoStop")}),getParentProperties(e){Z("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){M(e,"string","parentIframe.moveToAnchor(anchor) anchor"),He.findTarget(e)},reset(){!function(){const t=we;we=A,G("Reset trigger event: %cparentIframe.reset",e.HIGHLIGHT),Be?G("TriggerLock blocked calculation"):(Be=!0,P("Trigger event lock on"),requestAnimationFrame((()=>{Be=!1,P("Trigger event lock off")}))),Ot("reset"),we=t}()},setOffsetSize(e){M(e,"number","parentIframe.setOffsetSize(offset) offset"),V=e,Q=e,Tt(f,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){M(e,"number","parentIframe.scrollBy(x, y) x"),M(t,"number","parentIframe.scrollBy(x, y) y"),St(t,e,"scrollBy")},scrollTo(e,t){M(e,"number","parentIframe.scrollTo(x, y) x"),M(t,"number","parentIframe.scrollTo(x, y) y"),St(t,e,"scrollTo")},scrollToOffset(e,t){M(e,"number","parentIframe.scrollToOffset(x, y) x"),M(t,"number","parentIframe.scrollToOffset(x, y) y"),St(t,e,"scrollToOffset")},sendMessage(e,t){t&&M(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),St(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){we=e,st()},setWidthCalculationMethod(e){Fe=e,lt()},setTargetOrigin(t){M(t,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),G(`Set targetOrigin: %c${t}`,e.HIGHLIGHT),Ne=t},resize(e,t){e&&M(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&M(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Tt(d,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Z("size()","resize()"),this.resize(e,t)}}),We.parentIFrame=We.parentIframe),function(){function t(e){St(0,0,e.type,`${e.screenY}:${e.screenX}`)}function n(n,o){G(`Add event listener: %c${o}`,e.HIGHLIGHT),v(window.document,n,t)}!0===Ee&&(n("mouseenter","Mouse Enter"),n("mouseleave","Mouse Leave"))}(),He=function(){const t=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function o(e){const o=e.getBoundingClientRect(),r=t();return{x:parseInt(o.left,n)+parseInt(r.x,n),y:parseInt(o.top,n)+parseInt(r.y,n)}}function r(t){function n(t){const n=o(t);G(`Moving to in page link (%c#${r}%c) at x: %c${n.x}%c y: %c${n.y}`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),St(n.y,n.x,"scrollToOffset")}const r=t.split("#")[1]||t,i=decodeURIComponent(r),a=document.getElementById(i)||document.getElementsByName(i)[0];void 0===a?(G(`In page link (#${r}) not found in iFrame, so sending to parent`),St(0,0,"inPageLink",`#${r}`)):n(a)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&r(t)}function a(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&v(e,"click",(t=>{t.preventDefault(),r(e.getAttribute("href"))}))}function s(){v(window,"hashchange",i)}function l(){setTimeout(i,128)}function c(){G("Setting up location.hash handlers"),a(),s(),l()}return He.enable?1===Me?W("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):c():G("In page linking not enabled"),{findTarget:r}}(),void 0===ce&&(ce=`${le}px`),nt("margin",(m="margin",(p=ce).includes("-")&&(F(`Negative CSS value ignored for ${m}`),p=""),p)),nt("background",se),nt("padding",fe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const t=e=>e.style.setProperty("height","auto","important");t(document.documentElement),t(document.body),G("Set HTML & body height: %cauto !important",e.HIGHLIGHT)}(),!0!==ae&&G("Auto Resize disabled"),function(e){it({method:e,eventType:"After Print",eventName:"afterprint"}),it({method:e,eventType:"Before Print",eventName:"beforeprint"}),it({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const t=new Set,n=[];let r=!1,a=0;const s=e=>{R("Mutations observed:",e);for(const n of e){const{addedNodes:e,removedNodes:o}=n;for(const n of e)t.add(n);for(const e of o)t.delete(e)}},l=16,c=2,d=200;let u=1;function m(e){rt(),Ke(e),e.forEach(ut),e.clear()}function f(){const o=performance.now(),i=o-a,p=l*u+++c;if(i>p&&i<d)return R("Backed off due to heavy workload on callStack"),G(`Delay: %c${H(i)}ms %c> Delay limit: %c${p}ms`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),setTimeout(f,l*u),void(a=o);u=1,n.forEach(s),n.length=0,t.size>0&&m(t),Ye(),Qe(),r=!1,Tt(h,"Mutation Observed")}function p(e){n.push(e),r||(a=performance.now(),r=!0,requestAnimationFrame(f))}function g(){const e=new window.MutationObserver(p),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[i,o],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return G("Setup <body> MutationObserver"),e.observe(t,n),e}g()}(),G("Setup ResizeObserver"),Re=new ResizeObserver(ct),Re.observe(document.body),dt.add(document.body),ut(document.body),pe!==ge&&(G("Setup OverflowObserver"),je=(e=>{const t=e.side||a,n=e.onChange||$,o={root:e.root,rootMargin:"0px",threshold:1},i=window?.requestAnimationFrame||$,s=(e=!1)=>n(e),l=(e,n)=>0===e||e>n[t],c=(e,t)=>e.toggleAttribute(r,t),d=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,a=e[t],s=l(a,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);c(i,s)}var n;i(s)}),o),u=new WeakSet;return function(e){G("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=u.has(t);!n&&e?(d.observe(t),u.add(t)):L(!n,"Node already observed",t)}}})({onChange:Xe,root:document.documentElement,side:pe?a:s})),Ke(pt(document)()),queueMicrotask(Ve),G("Initialization complete"),Tt(b,"Init message from host page",void 0,void 0,t),document.title&&""!==document.title&&St(0,0,"title",document.title)}function Qe(){const e=document.querySelectorAll(`[${r}]`);Ge=Array.from(e).filter((e=>!e.closest(`[${i}]`))),be=Ge.length>0}function Xe(e){Qe(),(be||e)&&(be?R("Overflowed Elements:",...Ge):R("Overflow removed"),Tt(g,"Overflow updated"))}function Ye(){Ce=document.querySelectorAll(`[${o}]`),ve=Ce.length>0,G(`Tagged elements found: %c${ve}`,e.HIGHLIGHT)}function Ke(e){ve||je(e)}let et=0;function tt(){const t=document.querySelectorAll(`*[${i}]`);ye=t.length>0,ye&&t.length!==et&&(function(t){const n=1===t.length?"":"s";F(`%c[${i}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),et=t.length)}function nt(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),R(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function ot(t,n,o){if(""!==o){G(`${t}: %c${o}`,e.HIGHLIGHT);for(const e of document.querySelectorAll(o))G(`Applying ${n} to:`,e),e.toggleAttribute(n,!0)}}function rt(){ot("sizeSelector",o,Pe),ot("ignoreSelector",i,Ie)}function it(t){({add(e){function n(){Tt(t.eventName,t.eventType)}k[e]=n,v(window,e,n,{passive:!0})},remove(e){const t=k[e];var n,o;delete k[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[t.method](t.eventName),G(`${T(t.method)} event listener: %c${t.eventType}`,e.HIGHLIGHT)}function at(t,n,o,r){return n!==t&&(t in o||(F(`${t} is not a valid option for ${r}CalculationMethod.`),t=n),t in O)&&W(`<rb>Deprecated ${r}CalculationMethod (${t})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${r} calculation method. It is recommended that you ${re?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),G(`Set ${r} calculation method: %c${t}`,e.HIGHLIGHT),t}function st(){we=at(we,A,vt,"height")}function lt(){Fe=at(Fe,D,zt,"width")}function ct(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Tt(p,`Element resized <${S(t)}>`)}const dt=new WeakSet;function ut(t){if(t.nodeType!==Node.ELEMENT_NODE)return;if(!dt.has(t)){const n=getComputedStyle(t)?.position;""!==n&&"static"!==n&&(Re.observe(t),dt.add(t),G(`Attached resizeObserver: %c${S(t)}`,e.HIGHLIGHT))}const n=pt(t)();for(const t of n){if(dt.has(t)||t?.nodeType!==Node.ELEMENT_NODE)continue;const n=getComputedStyle(t)?.position;""!==n&&"static"!==n&&(Re.observe(t),dt.add(t),G(`Attached resizeObserver: %c${S(t)}`,e.HIGHLIGHT))}}function mt(e){performance.mark(K);const t=T(e);let n=0,o=document.documentElement,r=ve?0:document.documentElement.getBoundingClientRect().bottom;const i=ve?Ce:be?Ge:pt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return R(`${t} position calculated from:`,o),performance.mark(ee,{detail:{hasTags:ve,len:i.length,logging:Oe,Side:t}}),r}const ft=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],pt=e=>()=>{tt();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return ye&&t.push(`not([${i}])`,`not([${i}] *)`),e.querySelectorAll(t.join(":"))},gt={height:0,width:0},ht={height:0,width:0},yt=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function bt(t){function n(){return ht[r]=i,gt[r]=l,i}const o=t===vt,r=o?"height":"width",i=t.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),c=`HTML: %c${i}px %cPage: %c${l}px`;let d=0;switch(!0){case!t.enabled():return l;case ve:R("Found element with data-iframe-size attribute"),d=t.taggedElement();break;case!be&&0===ht[r]&&0===gt[r]:R(`Initial page size values: ${c}`,...yt),d=n();break;case Be&&i===ht[r]&&l===gt[r]:R(`Size unchanged: ${c}`,...yt),d=Math.max(i,l);break;case 0===i:R(`Page is hidden: ${c}`,...yt),d=l;break;case!be&&i!==ht[r]&&l<=gt[r]:R(`New <html> size: ${c} `,...yt),R(`Previous <html> size: %c${ht[r]}px`,e.HIGHLIGHT),d=n();break;case!o:d=t.taggedElement();break;case!be&&i<ht[r]:R(`<html> size decreased: ${c}`,...yt),d=n();break;case l===s||l===a:R(`<html> size equals page size: ${c}`,...yt),d=n();break;case i>l:R(`Page size < <html> size: ${c}`,...yt),d=n();break;case be:R("Found element overflowing <html> "),d=t.taggedElement();break;default:R(`Using <html> size: ${c}`,...yt),d=n()}return R(`Content ${r}: %c${d}px`,e.HIGHLIGHT),d+=function(t){const n=t.getOffset();return 0!==n&&R(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),d}const vt={enabled:()=>pe,getOffset:()=>V,auto:()=>bt(vt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,n)+parseInt(t.marginBottom,n)},bodyScroll:()=>document.body.scrollHeight,offset:()=>vt.bodyOffset(),custom:()=>z.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...ft(vt)),min:()=>Math.min(...ft(vt)),grow:()=>vt.max(),lowestElement:()=>mt(a),taggedElement:()=>mt(a)},zt={enabled:()=>ge,getOffset:()=>Q,auto:()=>bt(zt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>z.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...ft(zt)),min:()=>Math.min(...ft(zt)),rightMostElement:()=>mt(s),scroll:()=>Math.max(zt.bodyScroll(),zt.documentElementScroll()),taggedElement:()=>mt(s)},wt=(e,t)=>!(Math.abs(e-t)<=qe);function It(e,t){const n=e[t]();return e.enabled()&&void 0!==ie?function(e){const t=ie(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 $t=!1;const Ht=I((()=>U(w(4)))),Tt=N(((t,n,o,r,i)=>{if(oe=performance.now(),ne=!0,q(t),!0!==$t)return ae||t in m?void(document.hidden?G("Page hidden - Ignored resize request"):($t=!0,requestAnimationFrame((()=>{$t=!1})),function(t,n,o,r,i){const a=o??It(vt,we),s=r??It(zt,Fe),d=pe&&wt(ze,a)||ge&&wt(De,s)?c:t;switch(G(`Resize event: %c${n}`,e.HIGHLIGHT),d){case b:case l:case c:ze=a,De=s;case f:St(ze,De,t,i);break;case p:case g:case h:G(y);break;default:R(y)}ne=!1}(t,n,o,r,i))):(R("Resizing disabled"),void C())}));function Ot(e){ze=vt[we](),De=zt[Fe](),St(ze,De,e)}const St=N((function(t,n,o,r,i){Me<-1||(q(o),void 0!==i?G(`Message targetOrigin: %c${i}`,e.HIGHLIGHT):i=Ne,function(){const a=`${ke}:${t}:${n}:${o}${void 0===r?"":`:${r}`}`;if(Le)try{window.parent.iframeParentListener(x+a)}catch(e){if(1!==Me)throw e;return void Ht()}else xe.postMessage(x+a,i);ne&&G(function(){const e=H(performance.now()-oe);return o===b?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),e.HIGHLIGHT),R(`Sending message to parent page via ${Le?"sameOrigin":"postMessage"}: %c%c${a}`,e.ITALIC,e.HIGHLIGHT)}(),C())})),Mt=N((function(t){q("onMessage");const{freeze:n}=Object,{parse:o}=JSON,r=e=>n(o(e)),i=e=>St(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return void G("Page not ready, ignoring init message");const e=t.data.slice(13).split(":");xe=t.source,te=t.origin,_e(e),he=!1,setTimeout((()=>{$e=!1}),128)},reset(){$e?G("Page reset ignored by init"):(G("Page size reset by host page"),Ot("resetPage"))},resize(){G("Resize requested by host page"),Tt(u,"Parent window requested size check")},moveToAnchor(){He.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();G("PageInfo received from parent:",r(e)),Ze?setTimeout((()=>Ze(o(e)))):i("pageInfo")},parentInfo(){const e=r(l());G("ParentInfo received from parent:",e),Je?setTimeout((()=>Je(e))):i("parentInfo")},message(){const t=l();G("onMessage called from parent:%c",e.HIGHLIGHT,r(t)),setTimeout((()=>Ue(o(t))))}},s=()=>t.data.split("]")[1].split(":")[0],l=()=>t.data.slice(t.data.indexOf(":")+1),c=()=>t.data.split(":")[2]in{true:1,false:1};function d(){const e=s();q(e),e in a?a[e]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||F(`Unexpected message (${t.data})`)}x===`${t.data}`.slice(0,13)&&function(){if(!1!==he)return c()?(B(s()),q(b),void a.init()):void G(`Ignored message of type "${s()}". Received before initialization.`);d()}()}));function Et(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?F("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Mt({data:e,sameOrigin:!0}))),v(window,"message",Mt),v(window,"readystatechange",Et),Et())}();
|
|
21
|
+
//# sourceMappingURL=index.cjs.js.map
|
package/index.cjs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../packages/common/consts.js","../../packages/common/listeners.js","../../packages/common/mode.js","../../packages/common/utils.js","../../packages/child/console.js","../../packages/common/format-advise.js","../../packages/common/deprecate.js","../../packages/child/from-string.js","../../packages/child/perf.js","../../packages/child/read.js","../../packages/child/index.js","../../packages/child/overflow.js"],"sourcesContent":["export const VERSION = '[VI]{version}[/VI]'\nexport const LABEL = 'iframeResizer'\n\nexport const BASE = 10\nexport const SINGLE = 1\n\nexport const SIZE_ATTR = 'data-iframe-size'\nexport const OVERFLOW_ATTR = 'data-iframe-overflowed'\nexport const IGNORE_ATTR = 'data-iframe-ignore'\n\nexport const HEIGHT_EDGE = 'bottom'\nexport const WIDTH_EDGE = 'right'\n\nexport const ENABLE = 'autoResizeEnabled'\nexport const SIZE_CHANGE_DETECTED = Symbol('sizeChanged')\nexport const MANUAL_RESIZE_REQUEST = 'manualResize'\nexport const PARENT_RESIZE_REQUEST = 'parentResize'\nexport const IGNORE_DISABLE_RESIZE = {\n [MANUAL_RESIZE_REQUEST]: 1,\n [PARENT_RESIZE_REQUEST]: 1,\n}\n\nexport const SET_OFFSET_SIZE = 'setOffsetSize'\n\nexport const RESIZE_OBSERVER = 'resizeObserver'\nexport const OVERFLOW_OBSERVER = 'overflowObserver'\nexport const MUTATION_OBSERVER = 'mutationObserver'\n\nexport const BOLD = 'font-weight: bold;'\nexport const NORMAL = 'font-weight: normal;'\nexport const ITALIC = 'font-style: italic;'\nexport const BLUE = 'color: #135CD2;'\nexport const BLUE_LIGHT = 'color: #A9C7FB;'\nexport const BLACK = 'color: black;'\nexport const WHITE = 'color: #E3E3E3;'\n\nexport const NO_CHANGE = 'No change in content size detected'\n\nexport const msgHeader = 'message'\nexport const msgHeaderLen = msgHeader.length\nexport const msgId = '[iFrameSizer]' // Must match iframe msg ID\nexport const msgIdLen = msgId.length\nexport const resetRequiredMethods = Object.freeze({\n max: 1,\n scroll: 1,\n bodyScroll: 1,\n documentElementScroll: 1,\n})\n\nexport const ONLOAD = 'onload'\nexport const INIT = 'init'\n\nexport const INIT_EVENTS = Object.freeze({\n [ONLOAD]: 1,\n [INIT]: 1,\n})\n\nexport const EXPAND = 'expanded'\nexport const COLLAPSE = 'collapsed'\n\nexport const LOG_OPTIONS = Object.freeze({\n [EXPAND]: 1,\n [COLLAPSE]: 1,\n})\n","export const addEventListener = (el, evt, func, options) =>\n el.addEventListener(evt, func, options || false)\n\nexport const removeEventListener = (el, evt, func) =>\n el.removeEventListener(evt, func, false)\n","const l = (l) => {\n if (!l) return ''\n let p = -559038744,\n y = 1103547984\n for (let z, t = 0; t < l.length; t++)\n (z = l.codePointAt(t)),\n (p = Math.imul(p ^ z, 2246822519)),\n (y = Math.imul(y ^ z, 3266489917))\n return (\n (p ^= Math.imul(p ^ (y >>> 15), 1935289751)),\n (y ^= Math.imul(y ^ (p >>> 15), 3405138345)),\n (p ^= y >>> 16),\n (y ^= p >>> 16),\n (2097152 * (y >>> 0) + (p >>> 11)).toString(36)\n )\n },\n p = (l) =>\n l.replace(/[A-Za-z]/g, (l) =>\n String.fromCodePoint(\n (l <= 'Z' ? 90 : 122) >= (l = l.codePointAt(0) + 19) ? l : l - 26,\n ),\n ),\n y = [\n '<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>',\n '<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>',\n '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</>',\n '<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</>.',\n '<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.',\n ],\n z = ['NWSc3', 'zvsv', 'wyv', 'ibzpulzz', 'vlt'],\n t = Object.fromEntries(\n [\n '2cgs7fdf4xb',\n '1c9ctcccr4z',\n '1q2pc4eebgb',\n 'ueokt0969w',\n 'w2zxchhgqz',\n '1umuxblj2e5',\n ].map((l, p) => [l, Math.max(0, p - 1)]),\n )\nexport const getModeData = (l) => p(y[l])\nexport const getModeLabel = (l) => p(z[l])\nexport default (y) => {\n const z = y[p('spjluzl')]\n if (!z) return -1\n const u = z.split('-')\n let v = (function (y = '') {\n let z = -2\n const u = l(p(y))\n return u in t && (z = t[u]), z\n })(u[0])\n return 0 === v || ((p) => p[2] === l(p[0] + p[1]))(u) || (v = -2), v\n}\n","export const isNumber = (value) => !Number.isNaN(value)\n\nexport const once = (fn) => {\n let done = false\n\n return function () {\n return done\n ? undefined\n : ((done = true), Reflect.apply(fn, this, arguments))\n }\n}\n\nexport const isDarkModeEnabled = () =>\n window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches\n\nexport const id = (x) => x\n\nconst ROUNDING = 1000\n\nexport const round = (value) => Math.round(value * ROUNDING) / ROUNDING\n\nexport const capitalizeFirstLetter = (string) =>\n string.charAt(0).toUpperCase() + string.slice(1)\n\nconst isDef = (value) => `${value}` !== '' && value !== undefined\n\nexport function getElementName(el) {\n switch (true) {\n case !isDef(el):\n return ''\n\n case isDef(el.id):\n return `${el.nodeName}#${el.id}`\n\n case isDef(el.name):\n return `${el.nodeName} (${el.name}`\n\n case isDef(el.className):\n return `${el.nodeName}.${el.className}`\n\n default:\n return el.nodeName\n }\n}\n\nexport const esModuleInterop = (mod) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\nexport const typeAssert = (value, type, error) => {\n // eslint-disable-next-line valid-typeof\n if (typeof value !== type) {\n throw new TypeError(`${error} is not a ${capitalizeFirstLetter(type)}`)\n }\n}\n","import acg from 'auto-console-group'\n\nimport { LABEL } from '../common/consts'\nimport deprecate from '../common/deprecate'\nimport formatAdvise from '../common/format-advise'\nimport { esModuleInterop, id as identity } from '../common/utils'\n\nlet enabled = true\n\n// Deal with UMD not converting default exports to named exports\nconst createGroupConsole = esModuleInterop(acg)\n\nconst childConsole = createGroupConsole({ label: `${LABEL}(child)` })\n\nexport function setConsoleOptions(options) {\n childConsole.label(`${options.id}`)\n childConsole.expand(options.expand)\n enabled = options.enabled\n}\n\nexport const setupConsoleMethod =\n (method) =>\n (...args) =>\n enabled ? childConsole[method](...args) : true\n\nexport const log = setupConsoleMethod('log')\nexport const info = log // setupConsoleMethod('info')\n\nexport const {\n assert,\n debug,\n endAutoGroup,\n error,\n errorBoundary,\n event,\n label,\n purge,\n warn,\n} = childConsole\n\nexport const advise = (msg) => childConsole.warn(formatAdvise(identity)(msg))\n\nexport const adviser = advise\n\nconst deprecateAdvise = deprecate((id, msg) => advise(msg))\nexport const deprecateMethod = deprecateAdvise('Method')\nexport const deprecateMethodReplace = deprecateAdvise('Method', 'replaced with')\nexport const deprecateOption = deprecateAdvise('Option')\n","const encode = (s) =>\n s\n .replaceAll('<br>', '\\n')\n .replaceAll('<rb>', '\\u001B[31;1m')\n .replaceAll('</>', '\\u001B[m')\n .replaceAll('<b>', '\\u001B[1m')\n .replaceAll('<i>', '\\u001B[3m')\n .replaceAll('<u>', '\\u001B[4m')\n\nconst remove = (s) => s.replaceAll('<br>', '\\n').replaceAll(/<[/a-z]+>/gi, '')\n\nexport default (formatLogMsg) => (msg) =>\n window.chrome // Only show formatting in Chrome as not supported in other browsers\n ? formatLogMsg(encode(msg))\n : formatLogMsg(remove(msg))\n","export default (advise) =>\n (type, change = 'renamed to') =>\n (old, replacement, info = '', iframeId = '') =>\n advise(\n iframeId,\n `<rb>Deprecated ${type}(${old.replace('()', '')})</>\\n\\nThe <b>${old}</> ${type.toLowerCase()} has been ${change} <b>${replacement}</>. ${info}Use of the old ${type.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`,\n )\n","const strBool = (str) => str === 'true'\n\nconst castDefined = (cast) => (data) =>\n undefined === data ? undefined : cast(data)\n\nexport const getBoolean = castDefined(strBool)\nexport const getNumber = castDefined(Number)\n","import { round } from '../common/utils'\nimport { advise, event, log } from './console'\n\nconst SECOND = 1000\nconst PERF_CHECK_INTERVAL = 5 * SECOND\nconst THRESHOLD = 4 // ms\n\nexport const PREF_START = '--ifr-start'\nexport const PREF_END = '--ifr-end'\nconst PREF_MEASURE = '--ifr-measure'\n\nconst timings = []\nconst usedTags = new WeakSet()\n\nconst addUsedTag = (el) => typeof el === 'object' && usedTags.add(el)\n\nlet detail = {}\nlet oldAverage = 0\n\nconst timingCheck = setInterval(() => {\n if (timings.length < 10) return\n if (detail.hasTags && detail.len < 25) return\n\n timings.sort()\n\n const average = Math.min(\n timings.reduce((a, b) => a + b, 0) / timings.length,\n timings[Math.floor(timings.length / 2)],\n )\n\n const roundedAverage = round(average)\n\n if (roundedAverage > oldAverage) {\n oldAverage = roundedAverage\n event('performanceObserver')\n log('Mean time:', round(timings[Math.floor(timings.length / 2)]))\n log(\n 'Median time:',\n round(timings.reduce((a, b) => a + b, 0) / timings.length),\n )\n log('Average time:', roundedAverage)\n log('Max time:', round(Math.max(...timings)))\n // debug('Timings:', JSON.parse(JSON.stringify(timings.map(round))))\n }\n\n if (average <= THRESHOLD) return\n\n clearInterval(timingCheck)\n\n advise(\n `<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${round(average)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${detail.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`,\n )\n}, PERF_CHECK_INTERVAL)\n\nfunction perfObserver(list) {\n list.getEntries().forEach((entry) => {\n if (entry.name === PREF_END) {\n const { duration } = performance.measure(\n PREF_MEASURE,\n PREF_START,\n PREF_END,\n )\n detail = entry.detail\n timings.push(duration)\n if (timings.length > 100) timings.shift()\n }\n })\n}\n\nfunction setup() {\n // debug('Setup performanceObserver')\n const observer = new PerformanceObserver(perfObserver)\n observer.observe({ entryTypes: ['mark'] })\n\n addUsedTag(document.documentElement)\n addUsedTag(document.body)\n}\n\nif (\n // Guard against everything, as we don't control where and when we are loaded\n typeof document !== 'undefined' &&\n typeof PerformanceObserver !== 'undefined'\n) {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', setup)\n } else {\n setup()\n }\n}\n","const read = (type) => (data, key) => {\n if (!(key in data)) return\n // eslint-disable-next-line valid-typeof, consistent-return\n if (typeof data[key] === type) return data[key]\n\n throw new TypeError(`${key} is not a ${type}.`)\n}\n\nexport const readFunction = read('function')\nexport const readBoolean = read('boolean')\nexport const readNumber = read('number')\nexport const readString = read('string')\n","import { BOLD, FOREGROUND, HIGHLIGHT, ITALIC, NORMAL } from 'auto-console-group'\n\nimport {\n BASE,\n ENABLE,\n HEIGHT_EDGE,\n IGNORE_ATTR,\n IGNORE_DISABLE_RESIZE,\n INIT,\n MANUAL_RESIZE_REQUEST,\n MUTATION_OBSERVER,\n NO_CHANGE,\n OVERFLOW_ATTR,\n OVERFLOW_OBSERVER,\n PARENT_RESIZE_REQUEST,\n RESIZE_OBSERVER,\n SET_OFFSET_SIZE,\n SIZE_ATTR,\n SIZE_CHANGE_DETECTED,\n VERSION,\n WIDTH_EDGE,\n} from '../common/consts'\nimport { addEventListener, removeEventListener } from '../common/listeners'\nimport { getModeData } from '../common/mode'\nimport {\n capitalizeFirstLetter,\n getElementName,\n id,\n once,\n round,\n typeAssert,\n} from '../common/utils'\nimport {\n advise,\n adviser,\n // assert,\n debug,\n deprecateMethod,\n deprecateMethodReplace,\n deprecateOption,\n endAutoGroup,\n errorBoundary,\n event as consoleEvent,\n info,\n label,\n log,\n purge,\n setConsoleOptions,\n warn,\n} from './console'\nimport { getBoolean, getNumber } from './from-string'\nimport overflowObserver from './overflow'\nimport { PREF_END, PREF_START } from './perf'\nimport { readFunction, readNumber, readString } from './read'\n\nfunction iframeResizerChild() {\n const customCalcMethods = {\n height: () => {\n warn('Custom height calculation function not defined')\n return getHeight.auto()\n },\n width: () => {\n warn('Custom width calculation function not defined')\n return getWidth.auto()\n },\n }\n const deprecatedResizeMethods = {\n bodyOffset: 1,\n bodyScroll: 1,\n offset: 1,\n documentElementOffset: 1,\n documentElementScroll: 1,\n boundingClientRect: 1,\n max: 1,\n min: 1,\n grow: 1,\n lowestElement: 1,\n }\n const eventCancelTimer = 128\n const eventHandlersByName = {}\n const heightCalcModeDefault = 'auto'\n // const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)\n const msgID = '[iFrameSizer]' // Must match host page msg ID\n const msgIdLen = msgID.length\n const widthCalcModeDefault = 'scroll'\n\n let autoResize = true\n let bodyBackground = ''\n let bodyMargin = 0\n let bodyMarginStr = ''\n let bodyPadding = ''\n let calculateHeight = true\n let calculateWidth = false\n let firstRun = true\n let hasIgnored = false\n let hasOverflow = false\n let hasTags = false\n let height = 1\n let heightCalcMode = heightCalcModeDefault // only applies if not provided by host page (V1 compatibility)\n let ignoreSelector = ''\n let initLock = true\n let inPageLinks = {}\n let logExpand = true\n let logging = false\n let licenseKey = '' // eslint-disable-line no-unused-vars\n let mode = 0\n let mouseEvents = false\n let myID = ''\n let observeOverflow = id\n let offsetHeight\n let offsetWidth\n let origin\n let overflowedNodeList = []\n let resizeFrom = 'child'\n let resizeObserver = null\n let sameOrigin = false\n let sizeSelector = ''\n let taggedElements = []\n let target = window.parent\n let targetOriginDefault = '*'\n let timerActive\n let totalTime\n let tolerance = 0\n let triggerLocked = false\n let version\n let width = 1\n let widthCalcMode = widthCalcModeDefault\n let win = window\n\n let onBeforeResize\n let onMessage = () => {\n warn('onMessage function not defined')\n }\n let onReady = () => {}\n let onPageInfo = null\n let onParentInfo = null\n\n function init(data) {\n readDataFromParent(data)\n\n setConsoleOptions({ id: myID, enabled: logging, expand: logExpand })\n log(`Initialising iframe v${VERSION} ${window.location.href}`)\n readDataFromPage()\n\n applySelectors()\n\n checkCrossDomain()\n checkMode()\n checkVersion()\n checkHeightMode()\n checkWidthMode()\n checkDeprecatedAttrs()\n checkQuirksMode()\n checkAndSetupTags()\n\n setupPublicMethods()\n setupMouseEvents()\n inPageLinks = setupInPageLinks()\n\n setMargin()\n setBodyStyle('background', bodyBackground)\n setBodyStyle('padding', bodyPadding)\n\n injectClearFixIntoBodyElement()\n stopInfiniteResizingOfIframe()\n\n initEventListeners()\n queueMicrotask(onReady)\n\n log('Initialization complete')\n\n sendSize(INIT, 'Init message from host page', undefined, undefined, VERSION)\n\n sendTitle()\n }\n\n function checkOverflow() {\n const allOverflowedNodes = document.querySelectorAll(`[${OVERFLOW_ATTR}]`)\n\n // Filter out elements that are descendants of elements with IGNORE_ATTR\n // eslint-disable-next-line unicorn/prefer-spread\n overflowedNodeList = Array.from(allOverflowedNodes).filter(\n (node) => !node.closest(`[${IGNORE_ATTR}]`),\n )\n\n hasOverflow = overflowedNodeList.length > 0\n }\n\n function overflowObserved(mutated) {\n checkOverflow()\n\n if (!hasOverflow && !mutated) return\n\n if (hasOverflow) info('Overflowed Elements:', ...overflowedNodeList)\n else info('Overflow removed')\n sendSize(OVERFLOW_OBSERVER, 'Overflow updated')\n }\n\n function setupObserveOverflow() {\n if (calculateHeight === calculateWidth) return\n log('Setup OverflowObserver')\n observeOverflow = overflowObserver({\n onChange: overflowObserved,\n root: document.documentElement,\n side: calculateHeight ? HEIGHT_EDGE : WIDTH_EDGE,\n })\n }\n\n function checkAndSetupTags() {\n taggedElements = document.querySelectorAll(`[${SIZE_ATTR}]`)\n hasTags = taggedElements.length > 0\n log(`Tagged elements found: %c${hasTags}`, HIGHLIGHT)\n }\n\n function addOverflowObservers(nodeList) {\n if (!hasTags) observeOverflow(nodeList)\n }\n\n function sendTitle() {\n if (document.title && document.title !== '') {\n sendMsg(0, 0, 'title', document.title)\n }\n }\n\n function warnIgnored(ignoredElements) {\n const s = ignoredElements.length === 1 ? '' : 's'\n\n warn(\n `%c[${IGNORE_ATTR}]%c found on %c${ignoredElements.length}%c element${s}`,\n BOLD,\n NORMAL,\n BOLD,\n NORMAL,\n )\n }\n\n let ignoredElementsCount = 0\n function chkIgnoredElements() {\n const ignoredElements = document.querySelectorAll(`*[${IGNORE_ATTR}]`)\n hasIgnored = ignoredElements.length > 0\n if (hasIgnored && ignoredElements.length !== ignoredElementsCount) {\n warnIgnored(ignoredElements)\n ignoredElementsCount = ignoredElements.length\n }\n }\n\n function checkQuirksMode() {\n if (document.compatMode !== 'BackCompat') return\n\n advise(\n `<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`,\n )\n }\n\n function checkVersion() {\n if (!version || version === '' || version === 'false') {\n advise(\n `<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`,\n )\n return\n }\n\n if (version !== VERSION) {\n advise(\n `<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${version} - Child page: ${VERSION}.\n`,\n )\n }\n }\n\n function checkCrossDomain() {\n try {\n sameOrigin = mode === 1 || 'iframeParentListener' in window.parent\n } catch (error) {\n log('Cross domain iframe detected')\n }\n }\n\n // eslint-disable-next-line sonarjs/cognitive-complexity\n function readDataFromParent(data) {\n myID = data[0] ?? myID\n bodyMargin = getNumber(data[1]) ?? bodyMargin // For V1 compatibility\n calculateWidth = getBoolean(data[2]) ?? calculateWidth\n logging = getBoolean(data[3]) ?? logging\n // data[4] no longer used (was intervalTimer)\n autoResize = getBoolean(data[6]) ?? autoResize\n bodyMarginStr = data[7] ?? bodyMarginStr\n heightCalcMode = data[8] ?? heightCalcMode\n bodyBackground = data[9] ?? bodyBackground\n bodyPadding = data[10] ?? bodyPadding\n tolerance = getNumber(data[11]) ?? tolerance\n inPageLinks.enable = getBoolean(data[12]) ?? false\n resizeFrom = data[13] ?? resizeFrom\n widthCalcMode = data[14] ?? widthCalcMode\n mouseEvents = getBoolean(data[15]) ?? mouseEvents\n offsetHeight = getNumber(data[16]) ?? offsetHeight\n offsetWidth = getNumber(data[17]) ?? offsetWidth\n calculateHeight = getBoolean(data[18]) ?? calculateHeight\n licenseKey = data[19] ?? licenseKey\n version = data[20] ?? version\n mode = getNumber(data[21]) ?? mode\n // sizeSelector = data[22] || sizeSelector\n logExpand = getBoolean(data[23]) ?? logExpand\n }\n\n function readDataFromPage() {\n // eslint-disable-next-line sonarjs/cognitive-complexity\n function readData(data) {\n log(`Reading data from page:`, data)\n\n onBeforeResize = readFunction(data, 'onBeforeResize') ?? onBeforeResize\n onMessage = readFunction(data, 'onMessage') ?? onMessage\n onReady = readFunction(data, 'onReady') ?? onReady\n\n if (typeof data?.offset === 'number') {\n deprecateOption('offset', 'offsetSize')\n if (calculateHeight)\n offsetHeight = readNumber(data, 'offset') ?? offsetHeight\n if (calculateWidth)\n offsetWidth = readNumber(data, 'offset') ?? offsetWidth\n }\n\n if (typeof data?.offsetSize === 'number') {\n if (calculateHeight)\n offsetHeight = readNumber(data, 'offsetSize') ?? offsetHeight\n if (calculateWidth)\n offsetWidth = readNumber(data, 'offsetSize') ?? offsetWidth\n }\n\n ignoreSelector = readString(data, 'ignoreSelector') ?? ignoreSelector\n sizeSelector = readString(data, 'sizeSelector') ?? sizeSelector\n targetOriginDefault =\n readString(data, 'targetOrigin') ?? targetOriginDefault\n\n // String or Function\n heightCalcMode = data?.heightCalculationMethod || heightCalcMode\n widthCalcMode = data?.widthCalculationMethod || widthCalcMode\n }\n\n function setupCustomCalcMethods(calcMode, calcFunc) {\n if (typeof calcMode === 'function') {\n advise(\n `<rb>Deprecated Option(${calcFunc}CalculationMethod)</>\n\nThe use of <b>${calcFunc}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.`,\n )\n customCalcMethods[calcFunc] = calcMode\n calcMode = 'custom'\n }\n\n return calcMode\n }\n\n if (mode === 1) return\n\n const data = window.iframeResizer || window.iFrameResizer\n\n if (typeof data !== 'object') return\n\n readData(data)\n heightCalcMode = setupCustomCalcMethods(heightCalcMode, 'height')\n widthCalcMode = setupCustomCalcMethods(widthCalcMode, 'width')\n\n info(`Set targetOrigin for parent: %c${targetOriginDefault}`, HIGHLIGHT)\n }\n\n function chkCSS(attr, value) {\n if (value.includes('-')) {\n warn(`Negative CSS value ignored for ${attr}`)\n value = ''\n }\n\n return value\n }\n\n function setBodyStyle(attr, value) {\n if (undefined !== value && value !== '' && value !== 'null') {\n document.body.style.setProperty(attr, value)\n info(`Set body ${attr}: %c${value}`, HIGHLIGHT)\n }\n }\n\n function applySelector(name, attribute, selector) {\n if (selector === '') return\n\n log(`${name}: %c${selector}`, HIGHLIGHT)\n\n for (const el of document.querySelectorAll(selector)) {\n log(`Applying ${attribute} to:`, el)\n el.toggleAttribute(attribute, true)\n }\n }\n\n function applySelectors() {\n applySelector('sizeSelector', SIZE_ATTR, sizeSelector)\n applySelector('ignoreSelector', IGNORE_ATTR, ignoreSelector)\n }\n\n function setMargin() {\n // If called via V1 script, convert bodyMargin from int to str\n if (undefined === bodyMarginStr) {\n bodyMarginStr = `${bodyMargin}px`\n }\n\n setBodyStyle('margin', chkCSS('margin', bodyMarginStr))\n }\n\n function stopInfiniteResizingOfIframe() {\n const setAutoHeight = (el) =>\n el.style.setProperty('height', 'auto', 'important')\n\n setAutoHeight(document.documentElement)\n setAutoHeight(document.body)\n\n log('Set HTML & body height: %cauto !important', HIGHLIGHT)\n }\n\n function manageTriggerEvent(options) {\n const listener = {\n add(eventName) {\n function handleEvent() {\n sendSize(options.eventName, options.eventType)\n }\n\n eventHandlersByName[eventName] = handleEvent\n\n addEventListener(window, eventName, handleEvent, { passive: true })\n },\n remove(eventName) {\n const handleEvent = eventHandlersByName[eventName]\n delete eventHandlersByName[eventName]\n\n removeEventListener(window, eventName, handleEvent)\n },\n }\n\n listener[options.method](options.eventName)\n\n log(\n `${capitalizeFirstLetter(options.method)} event listener: %c${\n options.eventType\n }`,\n HIGHLIGHT,\n )\n }\n\n function manageEventListeners(method) {\n manageTriggerEvent({\n method,\n eventType: 'After Print',\n eventName: 'afterprint',\n })\n\n manageTriggerEvent({\n method,\n eventType: 'Before Print',\n eventName: 'beforeprint',\n })\n\n manageTriggerEvent({\n method,\n eventType: 'Ready State Change',\n eventName: 'readystatechange',\n })\n }\n\n function checkDeprecatedAttrs() {\n let found = false\n\n const checkAttrs = (attr) =>\n document.querySelectorAll(`[${attr}]`).forEach((el) => {\n found = true\n el.removeAttribute(attr)\n el.toggleAttribute(SIZE_ATTR, true)\n })\n\n checkAttrs('data-iframe-height')\n checkAttrs('data-iframe-width')\n\n if (found) {\n advise(\n `<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</>.`,\n )\n }\n }\n\n function checkCalcMode(calcMode, calcModeDefault, modes, type) {\n if (calcModeDefault !== calcMode) {\n if (!(calcMode in modes)) {\n warn(`${calcMode} is not a valid option for ${type}CalculationMethod.`)\n calcMode = calcModeDefault\n }\n\n if (calcMode in deprecatedResizeMethods) {\n const actionMsg = version\n ? 'remove this option.'\n : \"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page.\"\n\n advise(\n `<rb>Deprecated ${type}CalculationMethod (${calcMode})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${type} calculation method. It is recommended that you ${actionMsg}`,\n )\n }\n }\n\n log(`Set ${type} calculation method: %c${calcMode}`, HIGHLIGHT)\n return calcMode\n }\n\n function checkHeightMode() {\n heightCalcMode = checkCalcMode(\n heightCalcMode,\n heightCalcModeDefault,\n getHeight,\n 'height',\n )\n }\n\n function checkWidthMode() {\n widthCalcMode = checkCalcMode(\n widthCalcMode,\n widthCalcModeDefault,\n getWidth,\n 'width',\n )\n }\n\n function checkMode() {\n if (mode < 0) return adviser(`${getModeData(mode + 2)}${getModeData(2)}`)\n if (version?.codePointAt(0) > 4) return mode\n if (mode < 2) return adviser(getModeData(3))\n return mode\n }\n\n function initEventListeners() {\n if (autoResize !== true) {\n log('Auto Resize disabled')\n }\n\n manageEventListeners('add')\n setupMutationObserver()\n setupResizeObservers()\n setupObserveOverflow()\n addOverflowObservers(getAllElements(document)())\n }\n\n function injectClearFixIntoBodyElement() {\n const clearFix = document.createElement('div')\n\n clearFix.style.clear = 'both'\n // Guard against the following having been globally redefined in CSS.\n clearFix.style.display = 'block'\n clearFix.style.height = '0'\n\n document.body.append(clearFix)\n }\n\n function setupInPageLinks() {\n const getPagePosition = () => ({\n x: document.documentElement.scrollLeft,\n y: document.documentElement.scrollTop,\n })\n\n function getElementPosition(el) {\n const elPosition = el.getBoundingClientRect()\n const pagePosition = getPagePosition()\n\n return {\n x: parseInt(elPosition.left, BASE) + parseInt(pagePosition.x, BASE),\n y: parseInt(elPosition.top, BASE) + parseInt(pagePosition.y, BASE),\n }\n }\n\n function findTarget(location) {\n function jumpToTarget(target) {\n const jumpPosition = getElementPosition(target)\n\n log(\n `Moving to in page link (%c#${hash}%c) at x: %c${jumpPosition.x}%c y: %c${jumpPosition.y}`,\n HIGHLIGHT,\n FOREGROUND,\n HIGHLIGHT,\n FOREGROUND,\n HIGHLIGHT,\n )\n\n sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n }\n\n const hash = location.split('#')[1] || location // Remove # if present\n const hashData = decodeURIComponent(hash)\n const target =\n document.getElementById(hashData) ||\n document.getElementsByName(hashData)[0]\n\n if (target !== undefined) {\n jumpToTarget(target)\n return\n }\n\n log(`In page link (#${hash}) not found in iFrame, so sending to parent`)\n sendMsg(0, 0, 'inPageLink', `#${hash}`)\n }\n\n function checkLocationHash() {\n const { hash, href } = window.location\n\n if (hash !== '' && hash !== '#') {\n findTarget(href)\n }\n }\n\n function bindAnchors() {\n for (const link of document.querySelectorAll('a[href^=\"#\"]')) {\n if (link.getAttribute('href') !== '#') {\n addEventListener(link, 'click', (e) => {\n e.preventDefault()\n findTarget(link.getAttribute('href'))\n })\n }\n }\n }\n\n function bindLocationHash() {\n addEventListener(window, 'hashchange', checkLocationHash)\n }\n\n function initCheck() {\n // Check if page loaded with location hash after init resize\n setTimeout(checkLocationHash, eventCancelTimer)\n }\n\n function enableInPageLinks() {\n log('Setting up location.hash handlers')\n bindAnchors()\n bindLocationHash()\n initCheck()\n }\n\n if (inPageLinks.enable) {\n if (mode === 1) {\n advise(\n `In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details.`,\n )\n } else {\n enableInPageLinks()\n }\n } else {\n log('In page linking not enabled')\n }\n\n return {\n findTarget,\n }\n }\n\n function setupMouseEvents() {\n if (mouseEvents !== true) return\n\n function sendMouse(e) {\n sendMsg(0, 0, e.type, `${e.screenY}:${e.screenX}`)\n }\n\n function addMouseListener(evt, name) {\n log(`Add event listener: %c${name}`, HIGHLIGHT)\n addEventListener(window.document, evt, sendMouse)\n }\n\n addMouseListener('mouseenter', 'Mouse Enter')\n addMouseListener('mouseleave', 'Mouse Leave')\n }\n\n function setupPublicMethods() {\n if (mode === 1) return\n\n win.parentIframe = Object.freeze({\n autoResize: (enable) => {\n typeAssert(enable, 'boolean', 'parentIframe.autoResize(enable) enable')\n\n if (calculateWidth === false && calculateHeight === false) {\n consoleEvent(ENABLE)\n advise(\n \"Auto Resize can not be changed when <b>direction</> is set to 'none'.\",\n )\n return false\n }\n\n if (enable === true && autoResize === false) {\n autoResize = true\n queueMicrotask(() => sendSize(ENABLE, 'Auto Resize enabled'))\n } else if (enable === false && autoResize === true) {\n autoResize = false\n }\n\n sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))\n\n return autoResize\n },\n\n close() {\n sendMsg(0, 0, 'close')\n },\n\n getId: () => myID,\n\n getOrigin: () => {\n deprecateMethod('getOrigin()', 'getParentOrigin()')\n return origin\n },\n\n getParentOrigin: () => origin,\n\n getPageInfo(callback) {\n if (typeof callback === 'function') {\n onPageInfo = callback\n sendMsg(0, 0, 'pageInfo')\n deprecateMethodReplace(\n 'getPageInfo()',\n 'getParentProps()',\n 'See <u>https://iframe-resizer.com/upgrade</> for details. ',\n )\n return\n }\n\n onPageInfo = null\n sendMsg(0, 0, 'pageInfoStop')\n },\n\n getParentProps(callback) {\n typeAssert(\n callback,\n 'function',\n 'parentIframe.getParentProps(callback) callback',\n )\n\n onParentInfo = callback\n sendMsg(0, 0, 'parentInfo')\n\n return () => {\n onParentInfo = null\n sendMsg(0, 0, 'parentInfoStop')\n }\n },\n\n getParentProperties(callback) {\n deprecateMethod('getParentProperties()', 'getParentProps()')\n this.getParentProps(callback)\n },\n\n moveToAnchor(anchor) {\n typeAssert(anchor, 'string', 'parentIframe.moveToAnchor(anchor) anchor')\n inPageLinks.findTarget(anchor)\n },\n\n reset() {\n resetIframe('parentIframe.reset')\n },\n\n setOffsetSize(newOffset) {\n typeAssert(\n newOffset,\n 'number',\n 'parentIframe.setOffsetSize(offset) offset',\n )\n offsetHeight = newOffset\n offsetWidth = newOffset\n sendSize(SET_OFFSET_SIZE, `parentIframe.setOffsetSize(${newOffset})`)\n },\n\n scrollBy(x, y) {\n typeAssert(x, 'number', 'parentIframe.scrollBy(x, y) x')\n typeAssert(y, 'number', 'parentIframe.scrollBy(x, y) y')\n sendMsg(y, x, 'scrollBy') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollTo(x, y) {\n typeAssert(x, 'number', 'parentIframe.scrollTo(x, y) x')\n typeAssert(y, 'number', 'parentIframe.scrollTo(x, y) y')\n sendMsg(y, x, 'scrollTo') // X&Y reversed at sendMsg uses height/width\n },\n\n scrollToOffset(x, y) {\n typeAssert(x, 'number', 'parentIframe.scrollToOffset(x, y) x')\n typeAssert(y, 'number', 'parentIframe.scrollToOffset(x, y) y')\n sendMsg(y, x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width\n },\n\n sendMessage(msg, targetOrigin) {\n if (targetOrigin)\n typeAssert(\n targetOrigin,\n 'string',\n 'parentIframe.sendMessage(msg, targetOrigin) targetOrigin',\n )\n sendMsg(0, 0, 'message', JSON.stringify(msg), targetOrigin)\n },\n\n setHeightCalculationMethod(heightCalculationMethod) {\n heightCalcMode = heightCalculationMethod\n checkHeightMode()\n },\n\n setWidthCalculationMethod(widthCalculationMethod) {\n widthCalcMode = widthCalculationMethod\n checkWidthMode()\n },\n\n setTargetOrigin(targetOrigin) {\n typeAssert(\n targetOrigin,\n 'string',\n 'parentIframe.setTargetOrigin(targetOrigin) targetOrigin',\n )\n\n log(`Set targetOrigin: %c${targetOrigin}`, HIGHLIGHT)\n targetOriginDefault = targetOrigin\n },\n\n resize(customHeight, customWidth) {\n if (customHeight)\n typeAssert(\n customHeight,\n 'number',\n 'parentIframe.resize(customHeight, customWidth) customHeight',\n )\n\n if (customWidth)\n typeAssert(\n customWidth,\n 'number',\n 'parentIframe.resize(customHeight, customWidth) customWidth',\n )\n\n const valString = `${customHeight || ''}${customWidth ? `,${customWidth}` : ''}`\n\n sendSize(\n MANUAL_RESIZE_REQUEST,\n `parentIframe.resize(${valString})`,\n customHeight,\n customWidth,\n )\n },\n\n size(customHeight, customWidth) {\n deprecateMethod('size()', 'resize()')\n this.resize(customHeight, customWidth)\n },\n })\n\n win.parentIFrame = win.parentIframe\n }\n\n function resizeObserved(entries) {\n if (!Array.isArray(entries) || entries.length === 0) return\n\n const el = entries[0].target\n\n sendSize(RESIZE_OBSERVER, `Element resized <${getElementName(el)}>`)\n }\n\n const resizeSet = new WeakSet()\n\n // This function has to iterate over all page elements during load\n // so is optimized for performance, rather than best practices.\n function attachResizeObserverToNonStaticElements(rootElement) {\n if (rootElement.nodeType !== Node.ELEMENT_NODE) return\n\n if (!resizeSet.has(rootElement)) {\n const position = getComputedStyle(rootElement)?.position\n if (!(position === '' || position === 'static')) {\n resizeObserver.observe(rootElement)\n resizeSet.add(rootElement)\n log(\n `Attached resizeObserver: %c${getElementName(rootElement)}`,\n HIGHLIGHT,\n )\n }\n }\n\n const nodeList = getAllElements(rootElement)()\n\n for (const node of nodeList) {\n if (resizeSet.has(node) || node?.nodeType !== Node.ELEMENT_NODE) continue\n\n const position = getComputedStyle(node)?.position\n if (position === '' || position === 'static') continue\n\n resizeObserver.observe(node)\n resizeSet.add(node)\n log(`Attached resizeObserver: %c${getElementName(node)}`, HIGHLIGHT)\n }\n }\n\n function setupResizeObservers() {\n log('Setup ResizeObserver')\n resizeObserver = new ResizeObserver(resizeObserved)\n resizeObserver.observe(document.body)\n resizeSet.add(document.body)\n attachResizeObserverToNonStaticElements(document.body)\n }\n\n function setupMutationObserver() {\n const observedMutations = new Set()\n const newMutations = []\n let pending = false\n let perfMon = 0\n\n const updateMutation = (mutations) => {\n info('Mutations observed:', mutations)\n\n for (const mutation of mutations) {\n const { addedNodes, removedNodes } = mutation\n\n for (const node of addedNodes) {\n observedMutations.add(node)\n }\n\n for (const node of removedNodes) {\n observedMutations.delete(node)\n }\n }\n }\n\n const DELAY = 16 // Corresponds to 60fps\n const DELAY_MARGIN = 2\n const DELAY_MAX = 200\n\n let delayCount = 1\n\n function setupNewElements(observedMutations) {\n applySelectors()\n\n addOverflowObservers(observedMutations)\n observedMutations.forEach(attachResizeObserverToNonStaticElements)\n observedMutations.clear()\n }\n\n function processMutations() {\n const now = performance.now()\n const delay = now - perfMon\n const delayLimit = DELAY * delayCount++ + DELAY_MARGIN\n\n // Back off if the callStack is busy with other stuff\n if (delay > delayLimit && delay < DELAY_MAX) {\n info('Backed off due to heavy workload on callStack')\n log(\n `Delay: %c${round(delay)}ms %c> Delay limit: %c${delayLimit}ms`,\n HIGHLIGHT,\n FOREGROUND,\n HIGHLIGHT,\n )\n setTimeout(processMutations, DELAY * delayCount)\n perfMon = now\n return\n }\n\n delayCount = 1\n\n newMutations.forEach(updateMutation)\n newMutations.length = 0\n\n if (observedMutations.size > 0) setupNewElements(observedMutations)\n\n // Rebuild elements lists for size calculation\n checkAndSetupTags()\n checkOverflow()\n\n pending = false\n\n sendSize(MUTATION_OBSERVER, 'Mutation Observed')\n }\n\n function mutationObserved(mutations) {\n newMutations.push(mutations)\n if (pending) return\n\n perfMon = performance.now()\n pending = true\n requestAnimationFrame(processMutations)\n }\n\n function createMutationObserver() {\n const observer = new window.MutationObserver(mutationObserved)\n const target = document.querySelector('body')\n const config = {\n attributes: true,\n attributeFilter: [IGNORE_ATTR, SIZE_ATTR],\n attributeOldValue: false,\n characterData: false,\n characterDataOldValue: false,\n childList: true,\n subtree: true,\n }\n\n log('Setup <body> MutationObserver')\n observer.observe(target, config)\n\n return observer\n }\n\n const observer = createMutationObserver()\n\n return {\n disconnect() {\n log('Disconnect MutationObserver')\n observer.disconnect()\n },\n }\n }\n\n function getMaxElement(side) {\n performance.mark(PREF_START)\n\n const Side = capitalizeFirstLetter(side)\n\n let elVal = 0\n let maxEl = document.documentElement\n let maxVal = hasTags\n ? 0\n : document.documentElement.getBoundingClientRect().bottom\n\n const targetElements = hasTags\n ? taggedElements\n : hasOverflow\n ? overflowedNodeList\n : getAllElements(document)() // We should never get here, but just in case\n\n for (const element of targetElements) {\n elVal =\n element.getBoundingClientRect()[side] +\n parseFloat(getComputedStyle(element).getPropertyValue(`margin-${side}`))\n\n if (elVal > maxVal) {\n maxVal = elVal\n maxEl = element\n }\n }\n\n info(`${Side} position calculated from:`, maxEl)\n\n performance.mark(PREF_END, {\n detail: {\n hasTags,\n len: targetElements.length,\n logging,\n Side,\n },\n })\n\n return maxVal\n }\n\n const getAllMeasurements = (dimension) => [\n dimension.bodyOffset(),\n dimension.bodyScroll(),\n dimension.documentElementOffset(),\n dimension.documentElementScroll(),\n dimension.boundingClientRect(),\n ]\n\n const getAllElements = (element) => () => {\n chkIgnoredElements()\n\n const selector = [\n '* ',\n 'not(head)',\n 'not(meta)',\n 'not(base)',\n 'not(title)',\n 'not(script)',\n 'not(link)',\n 'not(style)',\n 'not(map)',\n 'not(area)',\n 'not(option)',\n 'not(optgroup)',\n 'not(template)',\n 'not(track)',\n 'not(wbr)',\n 'not(nobr)',\n ]\n\n if (hasIgnored)\n selector.push(`not([${IGNORE_ATTR}])`, `not([${IGNORE_ATTR}] *)`)\n\n return element.querySelectorAll(selector.join(':'))\n }\n\n function getOffsetSize(getDimension) {\n const offset = getDimension.getOffset()\n\n if (offset !== 0) {\n info(`Page offsetSize: %c${offset}px`, HIGHLIGHT)\n }\n\n return offset\n }\n\n const prevScrollSize = {\n height: 0,\n width: 0,\n }\n\n const prevBoundingSize = {\n height: 0,\n width: 0,\n }\n\n const getAdjustedScroll = (getDimension) =>\n getDimension.documentElementScroll() + Math.max(0, getDimension.getOffset())\n\n const BOUNDING_FORMAT = [HIGHLIGHT, FOREGROUND, HIGHLIGHT]\n\n function getAutoSize(getDimension) {\n function returnBoundingClientRect() {\n prevBoundingSize[dimension] = boundingSize\n prevScrollSize[dimension] = scrollSize\n return boundingSize\n }\n\n const isHeight = getDimension === getHeight\n const dimension = isHeight ? 'height' : 'width'\n const boundingSize = getDimension.boundingClientRect()\n const ceilBoundingSize = Math.ceil(boundingSize)\n const floorBoundingSize = Math.floor(boundingSize)\n const scrollSize = getAdjustedScroll(getDimension)\n const sizes = `HTML: %c${boundingSize}px %cPage: %c${scrollSize}px`\n\n let calculatedSize = 0\n\n switch (true) {\n case !getDimension.enabled():\n return scrollSize\n\n case hasTags:\n info(`Found element with data-iframe-size attribute`)\n calculatedSize = getDimension.taggedElement()\n break\n\n case !hasOverflow &&\n prevBoundingSize[dimension] === 0 &&\n prevScrollSize[dimension] === 0:\n info(`Initial page size values: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = returnBoundingClientRect()\n break\n\n case triggerLocked &&\n boundingSize === prevBoundingSize[dimension] &&\n scrollSize === prevScrollSize[dimension]:\n info(`Size unchanged: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = Math.max(boundingSize, scrollSize)\n break\n\n case boundingSize === 0:\n info(`Page is hidden: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = scrollSize\n break\n\n case !hasOverflow &&\n boundingSize !== prevBoundingSize[dimension] &&\n scrollSize <= prevScrollSize[dimension]:\n info(`New <html> size: ${sizes} `, ...BOUNDING_FORMAT)\n info(\n `Previous <html> size: %c${prevBoundingSize[dimension]}px`,\n HIGHLIGHT,\n )\n calculatedSize = returnBoundingClientRect()\n break\n\n case !isHeight:\n calculatedSize = getDimension.taggedElement()\n break\n\n case !hasOverflow && boundingSize < prevBoundingSize[dimension]:\n info(`<html> size decreased: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = returnBoundingClientRect()\n break\n\n case scrollSize === floorBoundingSize || scrollSize === ceilBoundingSize:\n info(`<html> size equals page size: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = returnBoundingClientRect()\n break\n\n case boundingSize > scrollSize:\n info(`Page size < <html> size: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = returnBoundingClientRect()\n break\n\n case hasOverflow:\n info(`Found element overflowing <html> `)\n calculatedSize = getDimension.taggedElement()\n break\n\n default:\n info(`Using <html> size: ${sizes}`, ...BOUNDING_FORMAT)\n calculatedSize = returnBoundingClientRect()\n }\n\n info(`Content ${dimension}: %c${calculatedSize}px`, HIGHLIGHT)\n\n calculatedSize += getOffsetSize(getDimension)\n\n return calculatedSize\n }\n\n const getBodyOffset = () => {\n const { body } = document\n const style = getComputedStyle(body)\n\n return (\n body.offsetHeight +\n parseInt(style.marginTop, BASE) +\n parseInt(style.marginBottom, BASE)\n )\n }\n\n const getHeight = {\n enabled: () => calculateHeight,\n getOffset: () => offsetHeight,\n auto: () => getAutoSize(getHeight),\n bodyOffset: getBodyOffset,\n bodyScroll: () => document.body.scrollHeight,\n offset: () => getHeight.bodyOffset(), // Backwards compatibility\n custom: () => customCalcMethods.height(),\n documentElementOffset: () => document.documentElement.offsetHeight,\n documentElementScroll: () => document.documentElement.scrollHeight,\n boundingClientRect: () =>\n Math.max(\n document.documentElement.getBoundingClientRect().bottom,\n document.body.getBoundingClientRect().bottom,\n ),\n max: () => Math.max(...getAllMeasurements(getHeight)),\n min: () => Math.min(...getAllMeasurements(getHeight)),\n grow: () => getHeight.max(),\n lowestElement: () => getMaxElement(HEIGHT_EDGE),\n taggedElement: () => getMaxElement(HEIGHT_EDGE),\n }\n\n const getWidth = {\n enabled: () => calculateWidth,\n getOffset: () => offsetWidth,\n auto: () => getAutoSize(getWidth),\n bodyScroll: () => document.body.scrollWidth,\n bodyOffset: () => document.body.offsetWidth,\n custom: () => customCalcMethods.width(),\n documentElementScroll: () => document.documentElement.scrollWidth,\n documentElementOffset: () => document.documentElement.offsetWidth,\n boundingClientRect: () =>\n Math.max(\n document.documentElement.getBoundingClientRect().right,\n document.body.getBoundingClientRect().right,\n ),\n max: () => Math.max(...getAllMeasurements(getWidth)),\n min: () => Math.min(...getAllMeasurements(getWidth)),\n rightMostElement: () => getMaxElement(WIDTH_EDGE),\n scroll: () =>\n Math.max(getWidth.bodyScroll(), getWidth.documentElementScroll()),\n taggedElement: () => getMaxElement(WIDTH_EDGE),\n }\n\n const checkTolerance = (a, b) => !(Math.abs(a - b) <= tolerance)\n\n function callOnBeforeResize(newSize) {\n const returnedSize = onBeforeResize(newSize)\n\n if (returnedSize === undefined) {\n throw new TypeError(\n 'No value returned from onBeforeResize(), expected a numeric value',\n )\n }\n\n if (Number.isNaN(returnedSize))\n throw new TypeError(\n `Invalid value returned from onBeforeResize(): ${returnedSize}, expected Number`,\n )\n\n return returnedSize\n }\n\n function getNewSize(direction, mode) {\n const newSize = direction[mode]()\n return direction.enabled() && onBeforeResize !== undefined\n ? callOnBeforeResize(newSize)\n : newSize\n }\n\n function sizeIframe(\n triggerEvent,\n triggerEventDesc,\n customHeight,\n customWidth,\n msg,\n ) {\n const isSizeChangeDetected = () =>\n (calculateHeight && checkTolerance(height, newHeight)) ||\n (calculateWidth && checkTolerance(width, newWidth))\n\n const newHeight = customHeight ?? getNewSize(getHeight, heightCalcMode)\n const newWidth = customWidth ?? getNewSize(getWidth, widthCalcMode)\n\n const updateEvent = isSizeChangeDetected()\n ? SIZE_CHANGE_DETECTED\n : triggerEvent\n\n log(`Resize event: %c${triggerEventDesc}`, HIGHLIGHT)\n\n switch (updateEvent) {\n case INIT:\n case ENABLE:\n case SIZE_CHANGE_DETECTED:\n // lockTrigger()\n height = newHeight\n width = newWidth\n // eslint-disable-next-line no-fallthrough\n case SET_OFFSET_SIZE:\n sendMsg(height, width, triggerEvent, msg)\n break\n\n // the following case needs {} to prevent a compile error\n case RESIZE_OBSERVER:\n case OVERFLOW_OBSERVER:\n case MUTATION_OBSERVER: {\n log(NO_CHANGE)\n purge()\n break\n }\n\n default:\n purge()\n info(NO_CHANGE)\n }\n\n timerActive = false // Reset time for next resize\n }\n\n let sendPending = false\n const sendFailed = once(() => adviser(getModeData(4)))\n\n const sendSize = errorBoundary(\n (triggerEvent, triggerEventDesc, customHeight, customWidth, msg) => {\n totalTime = performance.now()\n timerActive = true\n\n consoleEvent(triggerEvent)\n\n if (sendPending === true) return // only update once per frame\n\n if (!autoResize && !(triggerEvent in IGNORE_DISABLE_RESIZE)) {\n info('Resizing disabled')\n endAutoGroup()\n return\n }\n\n if (document.hidden) {\n // Currently only correctly supported in firefox\n // This is checked again on the parent page\n log('Page hidden - Ignored resize request')\n return\n }\n\n sendPending = true\n requestAnimationFrame(() => {\n sendPending = false\n })\n\n sizeIframe(triggerEvent, triggerEventDesc, customHeight, customWidth, msg)\n },\n )\n\n function lockTrigger() {\n if (triggerLocked) {\n log('TriggerLock blocked calculation')\n return\n }\n triggerLocked = true\n debug('Trigger event lock on')\n\n requestAnimationFrame(() => {\n triggerLocked = false\n debug('Trigger event lock off')\n })\n }\n\n function triggerReset(triggerEvent) {\n height = getHeight[heightCalcMode]()\n width = getWidth[widthCalcMode]()\n\n sendMsg(height, width, triggerEvent)\n }\n\n function resetIframe(triggerEventDesc) {\n const hcm = heightCalcMode\n heightCalcMode = heightCalcModeDefault\n\n log(`Reset trigger event: %c${triggerEventDesc}`, HIGHLIGHT)\n lockTrigger()\n triggerReset('reset')\n\n heightCalcMode = hcm\n }\n\n function sendMessage(height, width, triggerEvent, msg, targetOrigin) {\n if (mode < -1) return\n\n function setTargetOrigin() {\n if (undefined === targetOrigin) {\n targetOrigin = targetOriginDefault\n return\n }\n\n log(`Message targetOrigin: %c${targetOrigin}`, HIGHLIGHT)\n }\n\n function displayTimeTaken() {\n const timer = round(performance.now() - totalTime)\n return triggerEvent === INIT\n ? `Initialised iFrame in %c${timer}ms`\n : `Size calculated in %c${timer}ms`\n }\n\n function sendToParent() {\n const size = `${height}:${width}`\n const message = `${myID}:${size}:${triggerEvent}${undefined === msg ? '' : `:${msg}`}`\n\n if (sameOrigin)\n try {\n window.parent.iframeParentListener(msgID + message)\n } catch (error) {\n if (mode === 1) sendFailed()\n else throw error\n return\n }\n else target.postMessage(msgID + message, targetOrigin)\n\n if (timerActive) log(displayTimeTaken(), HIGHLIGHT)\n\n info(\n `Sending message to parent page via ${sameOrigin ? 'sameOrigin' : 'postMessage'}: %c%c${message}`,\n ITALIC,\n HIGHLIGHT,\n )\n }\n\n consoleEvent(triggerEvent)\n setTargetOrigin()\n sendToParent()\n endAutoGroup()\n }\n\n const sendMsg = errorBoundary(sendMessage)\n\n function receiver(event) {\n consoleEvent('onMessage')\n const { freeze } = Object\n const { parse } = JSON\n const parseFrozen = (data) => freeze(parse(data))\n\n const notExpected = (type) => sendMsg(0, 0, `${type}Stop`)\n\n const processRequestFromParent = {\n init: function initFromParent() {\n if (document.readyState === 'loading') {\n log('Page not ready, ignoring init message')\n return\n }\n\n const data = event.data.slice(msgIdLen).split(':')\n\n target = event.source\n origin = event.origin\n\n init(data)\n\n firstRun = false\n\n setTimeout(() => {\n initLock = false\n }, eventCancelTimer)\n },\n\n reset() {\n if (initLock) {\n log('Page reset ignored by init')\n return\n }\n\n log('Page size reset by host page')\n triggerReset('resetPage')\n },\n\n resize() {\n // This method is used by the tabVisible event on the parent page\n log('Resize requested by host page')\n sendSize(PARENT_RESIZE_REQUEST, 'Parent window requested size check')\n },\n\n moveToAnchor() {\n inPageLinks.findTarget(getData())\n },\n\n inPageLink() {\n this.moveToAnchor()\n }, // Backward compatibility\n\n pageInfo() {\n const msgBody = getData()\n log(`PageInfo received from parent:`, parseFrozen(msgBody))\n if (onPageInfo) {\n setTimeout(() => onPageInfo(parse(msgBody)))\n } else {\n notExpected('pageInfo')\n }\n },\n\n parentInfo() {\n const msgBody = parseFrozen(getData())\n log(`ParentInfo received from parent:`, msgBody)\n if (onParentInfo) {\n setTimeout(() => onParentInfo(msgBody))\n } else {\n notExpected('parentInfo')\n }\n },\n\n message() {\n const msgBody = getData()\n log(`onMessage called from parent:%c`, HIGHLIGHT, parseFrozen(msgBody))\n // eslint-disable-next-line sonarjs/no-extra-arguments\n setTimeout(() => onMessage(parse(msgBody)))\n },\n }\n\n const isMessageForUs = () => msgID === `${event.data}`.slice(0, msgIdLen)\n\n const getMessageType = () => event.data.split(']')[1].split(':')[0]\n\n const getData = () => event.data.slice(event.data.indexOf(':') + 1)\n\n const isMiddleTier = () =>\n 'iframeResize' in window ||\n (window.jQuery !== undefined && '' in window.jQuery.prototype)\n\n // Test if this message is from a child below us. This is an ugly test, however, updating\n // the message format would break backwards compatibility.\n const isInitMsg = () => event.data.split(':')[2] in { true: 1, false: 1 }\n\n function callFromParent() {\n const messageType = getMessageType()\n\n consoleEvent(messageType)\n\n if (messageType in processRequestFromParent) {\n processRequestFromParent[messageType]()\n return\n }\n\n if (!isMiddleTier() && !isInitMsg()) {\n warn(`Unexpected message (${event.data})`)\n }\n }\n\n function processMessage() {\n if (firstRun === false) {\n callFromParent()\n return\n }\n\n if (isInitMsg()) {\n label(getMessageType())\n consoleEvent(INIT)\n processRequestFromParent.init()\n return\n }\n\n log(\n `Ignored message of type \"${getMessageType()}\". Received before initialization.`,\n )\n }\n\n if (isMessageForUs()) {\n processMessage()\n }\n }\n\n const received = errorBoundary(receiver)\n\n // Normally the parent kicks things off when it detects the iFrame has loaded.\n // If this script is async-loaded, then tell parent page to retry init.\n function chkLateLoaded() {\n if (document.readyState !== 'loading') {\n window.parent.postMessage('[iFrameResizerChild]Ready', '*')\n }\n }\n\n if ('iframeChildListener' in window) {\n warn('Already setup')\n } else {\n window.iframeChildListener = (data) =>\n setTimeout(() => received({ data, sameOrigin: true }))\n\n addEventListener(window, 'message', received)\n addEventListener(window, 'readystatechange', chkLateLoaded)\n\n chkLateLoaded()\n }\n\n /* TEST CODE START */\n function mockMsgListener(msgObject) {\n received(msgObject)\n return win\n }\n\n try {\n // eslint-disable-next-line no-restricted-globals\n if (top?.document?.getElementById('banner')) {\n win = {}\n\n // Create test hooks\n window.mockMsgListener = mockMsgListener\n\n removeEventListener(window, 'message', received)\n\n define([], () => mockMsgListener)\n }\n } catch (error) {\n // do nothing\n }\n\n /* TEST CODE END */\n}\n\n// Don't run for server side render\nif (typeof window !== 'undefined') {\n iframeResizerChild()\n}\n","import { HEIGHT_EDGE, OVERFLOW_ATTR } from '../common/consts'\nimport { id } from '../common/utils'\nimport { assert, log } from './console'\n\nconst isHidden = (node) =>\n node.hidden || node.offsetParent === null || node.style.display === 'none'\n\nconst overflowObserver = (options) => {\n const side = options.side || HEIGHT_EDGE\n const onChange = options.onChange || id\n const observerOptions = {\n root: options.root,\n rootMargin: '0px',\n threshold: 1,\n }\n\n const afterReflow = window?.requestAnimationFrame || id\n const emitOverflowDetected = (mutated = false) => onChange(mutated)\n\n const isOverflowed = (edge, rootBounds) =>\n edge === 0 || edge > rootBounds[side]\n\n const setOverflow = (node, hasOverflow) =>\n node.toggleAttribute(OVERFLOW_ATTR, hasOverflow)\n\n function observation(entries) {\n for (const entry of entries) {\n const { boundingClientRect, rootBounds, target } = entry\n const edge = boundingClientRect[side]\n const hasOverflow = isOverflowed(edge, rootBounds) && !isHidden(target)\n\n setOverflow(target, hasOverflow)\n }\n\n afterReflow(emitOverflowDetected)\n }\n\n const observer = new IntersectionObserver(observation, observerOptions)\n const observedNodes = new WeakSet()\n\n return function observeOverflow(nodeList) {\n log('Attached overflowObservers')\n\n for (const node of nodeList) {\n const isObservable = node.nodeType === Node.ELEMENT_NODE\n const isObserved = observedNodes.has(node)\n\n if (isObserved || !isObservable) {\n assert(!isObserved, 'Node already observed', node)\n continue\n }\n\n observer.observe(node)\n observedNodes.add(node)\n }\n }\n}\n\nexport default overflowObserver\n"],"names":["VERSION","BASE","SIZE_ATTR","OVERFLOW_ATTR","IGNORE_ATTR","HEIGHT_EDGE","WIDTH_EDGE","ENABLE","SIZE_CHANGE_DETECTED","Symbol","MANUAL_RESIZE_REQUEST","PARENT_RESIZE_REQUEST","IGNORE_DISABLE_RESIZE","SET_OFFSET_SIZE","RESIZE_OBSERVER","OVERFLOW_OBSERVER","MUTATION_OBSERVER","NO_CHANGE","INIT","addEventListener","el","evt","func","options","y","Object","fromEntries","map","l","p","Math","max","getModeData","replace","String","fromCodePoint","codePointAt","once","fn","done","undefined","Reflect","apply","this","arguments","id","x","round","value","capitalizeFirstLetter","string","charAt","toUpperCase","slice","isDef","getElementName","nodeName","name","className","typeAssert","type","error","TypeError","enabled","mod","childConsole","acg","__esModule","default","label","log","method","args","info","assert","debug","endAutoGroup","errorBoundary","event","purge","warn","advise","msg","formatLogMsg","identity","window","chrome","replaceAll","adviser","deprecateAdvise","change","old","replacement","iframeId","toLowerCase","deprecate","deprecateMethod","deprecateMethodReplace","deprecateOption","castDefined","cast","data","getBoolean","str","getNumber","Number","PREF_START","PREF_END","timings","usedTags","WeakSet","addUsedTag","add","detail","oldAverage","timingCheck","setInterval","length","hasTags","len","sort","average","min","reduce","a","b","floor","roundedAverage","clearInterval","Side","perfObserver","list","getEntries","forEach","entry","duration","performance","measure","push","shift","setup","PerformanceObserver","observe","entryTypes","document","documentElement","body","readyState","read","key","readFunction","readNumber","readString","customCalcMethods","height","getHeight","auto","width","getWidth","deprecatedResizeMethods","bodyOffset","bodyScroll","offset","documentElementOffset","documentElementScroll","boundingClientRect","grow","lowestElement","eventHandlersByName","heightCalcModeDefault","msgID","widthCalcModeDefault","offsetHeight","offsetWidth","origin","timerActive","totalTime","version","onBeforeResize","autoResize","bodyBackground","bodyMargin","bodyMarginStr","bodyPadding","calculateHeight","calculateWidth","firstRun","hasIgnored","hasOverflow","heightCalcMode","ignoreSelector","initLock","inPageLinks","logExpand","logging","licenseKey","mode","mouseEvents","myID","observeOverflow","overflowedNodeList","resizeFrom","resizeObserver","sameOrigin","sizeSelector","taggedElements","target","parent","targetOriginDefault","tolerance","triggerLocked","widthCalcMode","win","onMessage","onReady","onPageInfo","onParentInfo","init","attr","enable","readDataFromParent","expand","location","href","readData","offsetSize","heightCalculationMethod","widthCalculationMethod","setupCustomCalcMethods","calcMode","calcFunc","iframeResizer","iFrameResizer","HIGHLIGHT","readDataFromPage","applySelectors","checkCrossDomain","checkHeightMode","checkWidthMode","found","checkAttrs","querySelectorAll","removeAttribute","toggleAttribute","checkDeprecatedAttrs","compatMode","checkAndSetupTags","parentIframe","freeze","consoleEvent","queueMicrotask","sendSize","sendMsg","JSON","stringify","close","getId","getOrigin","getParentOrigin","getPageInfo","callback","getParentProps","getParentProperties","moveToAnchor","anchor","findTarget","reset","hcm","requestAnimationFrame","triggerReset","resetIframe","setOffsetSize","newOffset","scrollBy","scrollTo","scrollToOffset","sendMessage","targetOrigin","setHeightCalculationMethod","setWidthCalculationMethod","setTargetOrigin","resize","customHeight","customWidth","size","parentIFrame","sendMouse","e","screenY","screenX","addMouseListener","setupMouseEvents","getPagePosition","scrollLeft","scrollTop","getElementPosition","elPosition","getBoundingClientRect","pagePosition","parseInt","left","top","jumpToTarget","jumpPosition","hash","FOREGROUND","split","hashData","decodeURIComponent","getElementById","getElementsByName","checkLocationHash","bindAnchors","link","getAttribute","preventDefault","bindLocationHash","initCheck","setTimeout","enableInPageLinks","setupInPageLinks","setBodyStyle","includes","clearFix","createElement","style","clear","display","append","injectClearFixIntoBodyElement","setAutoHeight","setProperty","stopInfiniteResizingOfIframe","manageTriggerEvent","eventType","eventName","manageEventListeners","observedMutations","Set","newMutations","pending","perfMon","updateMutation","mutations","mutation","addedNodes","removedNodes","node","delete","DELAY","DELAY_MARGIN","DELAY_MAX","delayCount","setupNewElements","addOverflowObservers","attachResizeObserverToNonStaticElements","processMutations","now","delay","delayLimit","checkOverflow","mutationObserved","createMutationObserver","observer","MutationObserver","querySelector","config","attributes","attributeFilter","attributeOldValue","characterData","characterDataOldValue","childList","subtree","setupMutationObserver","ResizeObserver","resizeObserved","resizeSet","side","onChange","observerOptions","root","rootMargin","threshold","afterReflow","emitOverflowDetected","mutated","isOverflowed","edge","rootBounds","setOverflow","IntersectionObserver","entries","hidden","offsetParent","observedNodes","nodeList","isObservable","nodeType","Node","ELEMENT_NODE","isObserved","has","overflowObserver","overflowObserved","getAllElements","title","allOverflowedNodes","Array","from","filter","closest","ignoredElementsCount","chkIgnoredElements","ignoredElements","s","BOLD","NORMAL","warnIgnored","applySelector","attribute","selector","handleEvent","passive","remove","removeEventListener","checkCalcMode","calcModeDefault","modes","isArray","rootElement","position","getComputedStyle","getMaxElement","mark","elVal","maxEl","maxVal","bottom","targetElements","element","parseFloat","getPropertyValue","getAllMeasurements","dimension","join","prevScrollSize","prevBoundingSize","BOUNDING_FORMAT","getAutoSize","getDimension","returnBoundingClientRect","boundingSize","scrollSize","isHeight","ceilBoundingSize","ceil","floorBoundingSize","getOffset","getAdjustedScroll","sizes","calculatedSize","taggedElement","getOffsetSize","marginTop","marginBottom","scrollHeight","custom","scrollWidth","right","rightMostElement","scroll","checkTolerance","abs","getNewSize","direction","newSize","returnedSize","isNaN","callOnBeforeResize","sendPending","sendFailed","triggerEvent","triggerEventDesc","newHeight","newWidth","updateEvent","sizeIframe","message","iframeParentListener","postMessage","timer","displayTimeTaken","ITALIC","sendToParent","received","parse","parseFrozen","notExpected","processRequestFromParent","source","getData","inPageLink","pageInfo","msgBody","parentInfo","getMessageType","indexOf","isInitMsg","true","false","callFromParent","messageType","jQuery","prototype","processMessage","chkLateLoaded","iframeChildListener","iframeResizerChild"],"mappings":";;;;;;;;;;;;;;;;;;;mDAAaA,EAAU,eAGVC,EAAO,GAGPC,EAAY,mBACZC,EAAgB,yBAChBC,EAAc,qBAEdC,EAAc,SACdC,EAAa,QAEbC,EAAS,oBACTC,EAAuBC,OAAO,eAC9BC,EAAwB,eACxBC,EAAwB,eACxBC,EAAwB,CACnCF,CAACA,GAAwB,EACzBC,CAACA,GAAwB,GAGdE,EAAkB,gBAElBC,EAAkB,iBAClBC,EAAoB,mBACpBC,EAAoB,mBAUpBC,EAAY,qCAcZC,EAAO,OClDPC,EAAmB,CAACC,EAAIC,EAAKC,EAAMC,IAC9CH,EAAGD,iBAAiBE,EAAKC,EAAMC,IAAW,GCqB1CC,EAAI,CACF,yCACA,yCACA,qnBACA,yjBACA,oPAGEC,OAAOC,YACT,CACE,cACA,cACA,cACA,aACA,aAC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1C,CA3BiCqE,IAAU,GAAG5F,EAAMuB,OAAOhD,MAAM,EA57C9CqH,KAy9Cf,WACE,IAAiB,IAAbgB,GAKJ,OAAIkU,KACFvb,EAAMqb,KACNjQ,EAAavO,QACbie,EAAyB1R,aAI3BnJ,EACE,4BAA4Bob,yCAZ5BK,GAcR,CAGMI,EAEN,IAME,SAASC,KACqB,YAAxBpX,SAASG,YACX9D,OAAO0H,OAAO2R,YAAY,4BAA6B,IAE7D,CAEM,wBAAyBrZ,OAC3BL,EAAK,kBAELK,OAAOgb,oBAAuBha,GAC5ByN,YAAW,IAAMiL,GAAS,CAAE1Y,OAAMsG,YAAY,MAEhDxL,EAAiBkE,OAAQ,UAAW0Z,IACpC5d,EAAiBkE,OAAQ,mBAAoB+a,IAE7CA,KAGJ,CAIEE"}
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/child 5.4.
|
|
4
|
+
* @module iframe-resizer/child 5.4.7-beta.1 (esm) - 2025-06-03
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
import e,{ITALIC as t,HIGHLIGHT as n,FOREGROUND as o,BOLD as r,NORMAL as i}from"auto-console-group";const a="5.4.6",s=10,l="data-iframe-size",c="data-iframe-overflowed",u="data-iframe-ignore",d="bottom",m="right",f="autoResizeEnabled",p=Symbol("sizeChanged"),h="manualResize",y="parentResize",g={[h]:1,[y]:1},b="setOffsetSize",v="resizeObserver",z="overflowObserver",w="mutationObserver",$="init",S=(e,t,n,o)=>e.addEventListener(t,n,o||!1),O=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const j=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(O[e]),E=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},k=e=>e,M=e=>Math.round(1e3*e)/1e3,T=e=>e.charAt(0).toUpperCase()+e.slice(1),P=e=>""!=`${e}`&&void 0!==e;const C=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${T(t)}`)};let I=!0;var A;const x=(A=e,A?.__esModule?A.default:A)({label:"iframeResizer(child)"});var N;const R=(N="log",(...e)=>!I||x[N](...e)),{assert:B,debug:q,endAutoGroup:L,error:W,errorBoundary:F,event:D,label:V,purge:H,warn:U}=x,Z=e=>{return x.warn((t=k,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},J=Z,_=(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)=>Z(t))),Q=_("Method"),G=_("Method","replaced with"),X=_("Option"),Y=e=>t=>void 0===t?void 0:e(t),K=Y((e=>"true"===e)),ee=Y(Number),te="--ifr-start",ne="--ifr-end",oe=[],re=new WeakSet,ie=e=>"object"==typeof e&&re.add(e);let ae={},se=0;const le=setInterval((()=>{if(oe.length<10)return;if(ae.hasTags&&ae.len<25)return;oe.sort();const e=Math.min(oe.reduce(((e,t)=>e+t),0)/oe.length,oe[Math.floor(oe.length/2)]),t=M(e);t>se&&(se=t,D("performanceObserver")),e<=4||(clearInterval(le),Z(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${M(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${ae.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function ce(e){e.getEntries().forEach((e=>{if(e.name===ne){const{duration:t}=performance.measure("--ifr-measure",te,ne);ae=e.detail,oe.push(t),oe.length>100&&oe.shift()}}))}function ue(){new PerformanceObserver(ce).observe({entryTypes:["mark"]}),ie(document.documentElement),ie(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",ue):ue());const de=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},me=de("function"),fe=de("number"),pe=de("string");"undefined"!=typeof window&&function(){const e={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},O={height:()=>(U("Custom height calculation function not defined"),zt.auto()),width:()=>(U("Custom width calculation function not defined"),wt.auto())},M={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},A={},N="checkVisibility"in window,q="auto",W="[iFrameSizer]",_="scroll";let Y,oe,re,ie,ae,se=!0,le="",ce=0,ue="",de="",he=!0,ye=!1,ge=!0,be=!1,ve=!1,ze=!1,we=1,$e=q,Se="",Oe=!0,je={},Ee=!0,ke=!1,Me="",Te=0,Pe=!1,Ce="",Ie=k,Ae=[],xe="child",Ne=null,Re=!1,Be="",qe=[],Le=window.parent,We="*",Fe=0,De=!1,Ve=1,He=_,Ue=window,Ze=()=>{U("onMessage function not defined")},Je=()=>{},_e=null,Qe=null;function Ge(e){var t,o,r;!function(e){Ce=e[0]??Ce,ce=ee(e[1])??ce,ye=K(e[2])??ye,ke=K(e[3])??ke,se=K(e[6])??se,ue=e[7]??ue,$e=e[8]??$e,le=e[9]??le,de=e[10]??de,Fe=ee(e[11])??Fe,je.enable=K(e[12])??!1,xe=e[13]??xe,He=e[14]??He,Pe=K(e[15])??Pe,Y=ee(e[16])??Y,oe=ee(e[17])??oe,he=K(e[18])??he,Me=e[19]??Me,ie=e[20]??ie,Te=ee(e[21])??Te,Ee=K(e[23])??Ee}(e),t={id:Ce,enabled:ke,expand:Ee},x.label(`${t.id}`),x.expand(t.expand),I=t.enabled,function(){function e(e){ae=me(e,"onBeforeResize")??ae,Ze=me(e,"onMessage")??Ze,Je=me(e,"onReady")??Je,"number"==typeof e?.offset&&(X("offset","offsetSize"),he&&(Y=fe(e,"offset")??Y),ye&&(oe=fe(e,"offset")??oe)),"number"==typeof e?.offsetSize&&(he&&(Y=fe(e,"offsetSize")??Y),ye&&(oe=fe(e,"offsetSize")??oe)),Se=pe(e,"ignoreSelector")??Se,Be=pe(e,"sizeSelector")??Be,We=pe(e,"targetOrigin")??We,$e=e?.heightCalculationMethod||$e,He=e?.widthCalculationMethod||He}function t(e,t){return"function"==typeof e&&(Z(`<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===Te)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(e(o),$e=t($e,"height"),He=t(He,"width"),R(`Set targetOrigin for parent: %c${We}`,n))}(),it(),function(){try{Re=1===Te||"iframeParentListener"in window.parent}catch(e){}}(),Te<0?J(`${j(Te+2)}${j(2)}`):ie?.codePointAt(0)>4||Te<2&&J(j(3)),ie&&""!==ie&&"false"!==ie?ie!==a&&Z(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ie} - Child page: ${a}.\n`):Z("<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"),lt(),ct(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(l,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&Z("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),"BackCompat"===document.compatMode&&Z("<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"),Ke(),1!==Te&&(Ue.parentIframe=Object.freeze({autoResize:e=>(C(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ye&&!1===he?(D(f),Z("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===se?(se=!0,queueMicrotask((()=>Et(f,"Auto Resize enabled")))):!1===e&&!0===se&&(se=!1),Mt(0,0,"autoResize",JSON.stringify(se)),se)),close(){Mt(0,0,"close")},getId:()=>Ce,getOrigin:()=>(Q("getOrigin()","getParentOrigin()"),re),getParentOrigin:()=>re,getPageInfo(e){if("function"==typeof e)return _e=e,Mt(0,0,"pageInfo"),void G("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");_e=null,Mt(0,0,"pageInfoStop")},getParentProps:e=>(C(e,"function","parentIframe.getParentProps(callback) callback"),Qe=e,Mt(0,0,"parentInfo"),()=>{Qe=null,Mt(0,0,"parentInfoStop")}),getParentProperties(e){Q("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){C(e,"string","parentIframe.moveToAnchor(anchor) anchor"),je.findTarget(e)},reset(){!function(){const e=$e;$e=q,De||(De=!0,requestAnimationFrame((()=>{De=!1}))),kt("reset"),$e=e}()},setOffsetSize(e){C(e,"number","parentIframe.setOffsetSize(offset) offset"),Y=e,oe=e,Et(b,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){C(e,"number","parentIframe.scrollBy(x, y) x"),C(t,"number","parentIframe.scrollBy(x, y) y"),Mt(t,e,"scrollBy")},scrollTo(e,t){C(e,"number","parentIframe.scrollTo(x, y) x"),C(t,"number","parentIframe.scrollTo(x, y) y"),Mt(t,e,"scrollTo")},scrollToOffset(e,t){C(e,"number","parentIframe.scrollToOffset(x, y) x"),C(t,"number","parentIframe.scrollToOffset(x, y) y"),Mt(t,e,"scrollToOffset")},sendMessage(e,t){t&&C(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Mt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){$e=e,lt()},setWidthCalculationMethod(e){He=e,ct()},setTargetOrigin(e){C(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),We=e},resize(e,t){e&&C(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&C(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),Et(h,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Q("size()","resize()"),this.resize(e,t)}}),Ue.parentIFrame=Ue.parentIframe),function(){function e(e){Mt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){S(window.document,t,e)}!0===Pe&&(t("mouseenter"),t("mouseleave"))}(),je=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,s)+parseInt(o.x,s),y:parseInt(n.top,s)+parseInt(o.y,s)}}function n(e){function n(e){const n=t(e);Mt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,r=decodeURIComponent(o),i=document.getElementById(r)||document.getElementsByName(r)[0];void 0===i?Mt(0,0,"inPageLink",`#${o}`):n(i)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&S(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function i(){S(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){r(),i(),a()}return je.enable&&(1===Te?Z("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):l()),{findTarget:n}}(),void 0===ue&&(ue=`${ce}px`),ot("margin",(o="margin",(r=ue).includes("-")&&(U(`Negative CSS value ignored for ${o}`),r=""),r)),ot("background",le),ot("padding",de),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),function(e){at({method:e,eventType:"After Print",eventName:"afterprint"}),at({method:e,eventType:"Before Print",eventName:"beforeprint"}),at({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const r=t=>{R("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},i=16,a=2,s=200;let c=1;function d(e){it(),et(e),e.forEach(mt),e.clear()}function m(){const l=performance.now(),u=l-o;if(u>i*c+++a&&u<s)return R("Backed off due to heavy workload on callStack"),setTimeout(m,i*c),void(o=l);c=1,t.forEach(r),t.length=0,e.size>0&&d(e),Ke(),Xe(),n=!1,Et(w,"Mutation Observed")}function f(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(m))}function p(){const e=new window.MutationObserver(f),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[u,l],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}p()}(),Ne=new ResizeObserver(ut),Ne.observe(document.body),dt.add(document.body),mt(document.body),he!==ye&&(Ie=(e=>{const t=e.side||d,n=e.onChange||k,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||k,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(c,t),l=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c)}var n;r(i)}),o),u=new WeakSet;return function(e){for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=u.has(t);!n&&e?(l.observe(t),u.add(t)):B(!n,"Node already observed",t)}}})({onChange:Ye,root:document.documentElement,side:he?d:m})),et(ht(document)()),queueMicrotask(Je),Et($,"Init message from host page",void 0,void 0,a),document.title&&""!==document.title&&Mt(0,0,"title",document.title)}function Xe(){Ae=document.querySelectorAll(`[${c}]:not([${u}]):not([${u}] *)`),ve=Ae.length>0}function Ye(e){Xe(),(ve||e)&&(ve?R("Overflowed Elements:",...Ae):R("Overflow removed"),Et(z,"Overflow updated"))}function Ke(){qe=document.querySelectorAll(`[${l}]`),ze=qe.length>0}function et(e){ze||Ie(e)}let tt=0;function nt(){const e=document.querySelectorAll(`*[${u}]`);be=e.length>0,be&&e.length!==tt&&(function(e){const t=1===e.length?"":"s";U(`%c[${u}]%c found on %c${e.length}%c element${t}`,r,i,r,i)}(e),tt=e.length)}function ot(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),R(`Set body ${e}: %c${t}`,n))}function rt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function it(){rt(0,l,Be),rt(0,u,Se)}function at(e){({add(t){function n(){Et(e.eventName,e.eventType)}A[t]=n,S(window,t,n,{passive:!0})},remove(e){const t=A[e];var n,o;delete A[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function st(e,t,n,o){return t!==e&&(e in n||(U(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in M)&&Z(`<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 ${ie?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),e}function lt(){$e=st($e,q,zt,"height")}function ct(){He=st(He,_,wt,"width")}function ut(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Et(v,`Element resized <${function(e){switch(!0){case!P(e):return"";case P(e.id):return`${e.nodeName}#${e.id}`;case P(e.name):return`${e.nodeName} (${e.name}`;case P(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const dt=new WeakSet;function mt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!dt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Ne.observe(e),dt.add(e))}const t=ht(e)();for(const e of t){if(dt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Ne.observe(e),dt.add(e))}}function ft(t){performance.mark(te);const n=T(t);let o=0,r=document.documentElement,i=ze?0:document.documentElement.getBoundingClientRect().bottom;const a=ze?qe:ve?Ae:ht(document)();let s=a.length;for(const n of a)ze||!N||n.checkVisibility(e)?(o=n.getBoundingClientRect()[t]+parseFloat(getComputedStyle(n).getPropertyValue(`margin-${t}`)),o>i&&(i=o,r=n)):s-=1;return R(`${n} position calculated from:`,r),performance.mark(ne,{detail:{Side:n,len:s,hasTags:ze,logging:ke}}),i}const pt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],ht=e=>()=>{nt();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return be&&t.push(`not([${u}])`,`not([${u}] *)`),e.querySelectorAll(t.join(":"))},yt={height:0,width:0},gt={height:0,width:0},bt=[n,o,n];function vt(e){function t(){return gt[r]=i,yt[r]=l,i}const o=e===zt,r=o?"height":"width",i=e.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${i}px %cPage: %c${l}px`;let u=0;switch(!0){case!e.enabled():return l;case ze:R("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!ve&&0===gt[r]&&0===yt[r]:R(`Initial page size values: ${c}`,...bt),u=t();break;case De&&i===gt[r]&&l===yt[r]:R(`Size unchanged: ${c}`,...bt),u=Math.max(i,l);break;case 0===i:R(`Page is hidden: ${c}`,...bt),u=l;break;case!ve&&i!==gt[r]&&l<=yt[r]:R(`New <html> size: ${c} `,...bt),R(`Previous <html> size: %c${gt[r]}px`,n),u=t();break;case!o:u=e.taggedElement();break;case!ve&&i<gt[r]:R(`<html> size decreased: ${c}`,...bt),u=t();break;case l===s||l===a:R(`<html> size equals page size: ${c}`,...bt),u=t();break;case i>l:R(`Page size < <html> size: ${c}`,...bt),u=t();break;case ve:R("Found element overflowing <html> "),u=e.taggedElement();break;default:R(`Using <html> size: ${c}`,...bt),u=t()}return R(`Content ${r}: %c${u}px`,n),u+=function(e){const t=e.getOffset();return 0!==t&&R(`Page offsetSize: %c${t}px`,n),t}(e),u}const zt={enabled:()=>he,getOffset:()=>Y,auto:()=>vt(zt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,s)+parseInt(t.marginBottom,s)},bodyScroll:()=>document.body.scrollHeight,offset:()=>zt.bodyOffset(),custom:()=>O.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...pt(zt)),min:()=>Math.min(...pt(zt)),grow:()=>zt.max(),lowestElement:()=>ft(d),taggedElement:()=>ft(d)},wt={enabled:()=>ye,getOffset:()=>oe,auto:()=>vt(wt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>O.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...pt(wt)),min:()=>Math.min(...pt(wt)),rightMostElement:()=>ft(m),scroll:()=>Math.max(wt.bodyScroll(),wt.documentElementScroll()),taggedElement:()=>ft(m)},$t=(e,t)=>!(Math.abs(e-t)<=Fe);function St(e,t){const n=e[t]();return e.enabled()&&void 0!==ae?function(e){const t=ae(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 Ot=!1;const jt=E((()=>J(j(4)))),Et=F(((e,t,n,o,r)=>{if(performance.now(),D(e),!0!==Ot)return se||e in g?void(document.hidden||(Ot=!0,requestAnimationFrame((()=>{Ot=!1})),function(e,t,n,o,r){const i=n??St(zt,$e),a=o??St(wt,He);switch(he&&$t(we,i)||ye&&$t(Ve,a)?p:e){case $:case f:case p:we=i,Ve=a;case b:Mt(we,Ve,e,r);break;case v:case z:case w:H();break;default:H(),R("No change in content size detected")}}(e,0,n,o,r))):(R("Resizing disabled"),void L())}));function kt(e){we=zt[$e](),Ve=wt[He](),Mt(we,Ve,e)}const Mt=F((function(e,o,r,i,a){Te<-1||(D(r),void 0!==a||(a=We),function(){const s=`${Ce}:${e}:${o}:${r}${void 0===i?"":`:${i}`}`;if(Re)try{window.parent.iframeParentListener(W+s)}catch(e){if(1!==Te)throw e;return void jt()}else Le.postMessage(W+s,a);R(`Sending message to parent page via ${Re?"sameOrigin":"postMessage"}: %c%c${s}`,t,n)}(),L())})),Tt=F((function(e){D("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Mt(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(":");Le=e.source,re=e.origin,Ge(t),ge=!1,setTimeout((()=>{Oe=!1}),128)},reset(){Oe||kt("resetPage")},resize(){Et(y,"Parent window requested size check")},moveToAnchor(){je.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();_e?setTimeout((()=>_e(n(e)))):o("pageInfo")},parentInfo(){const e=(r=a(),t(n(r)));var r;Qe?setTimeout((()=>Qe(e))):o("parentInfo")},message(){const e=a();setTimeout((()=>Ze(n(e))))}},i=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),s=()=>e.data.split(":")[2]in{true:1,false:1};function l(){const t=i();D(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||U(`Unexpected message (${e.data})`)}W===`${e.data}`.slice(0,13)&&function(){if(!1!==ge)return s()?(V(i()),D($),void r.init()):void 0;l()}()}));function Pt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?U("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Tt({data:e,sameOrigin:!0}))),S(window,"message",Tt),S(window,"readystatechange",Pt),Pt())}();
|
|
20
|
+
import e,{HIGHLIGHT as t,ITALIC as n,FOREGROUND as o,BOLD as r,NORMAL as i}from"auto-console-group";const a="5.4.7-beta.1",s=10,l="data-iframe-size",c="data-iframe-overflowed",d="data-iframe-ignore",u="bottom",m="right",f="autoResizeEnabled",p=Symbol("sizeChanged"),g="manualResize",h="parentResize",y={[g]:1,[h]:1},b="setOffsetSize",v="resizeObserver",z="overflowObserver",w="mutationObserver",$="No change in content size detected",S="init",O=(e,t,n,o)=>e.addEventListener(t,n,o||!1),M=["<iy><yi>Puchspk Spjluzl Rlf</><iy><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."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const k=e=>(e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(M[e]),E=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},j=e=>e,I=e=>Math.round(1e3*e)/1e3,T=e=>e.charAt(0).toUpperCase()+e.slice(1),A=e=>""!=`${e}`&&void 0!==e;function P(e){switch(!0){case!A(e):return"";case A(e.id):return`${e.nodeName}#${e.id}`;case A(e.name):return`${e.nodeName} (${e.name}`;case A(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}const C=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${T(t)}`)};let x=!0;var R;const N=(R=e,R?.__esModule?R.default:R)({label:"iframeResizer(child)"});const q=(B="log",(...e)=>!x||N[B](...e));var B;const L=q,{assert:W,debug:F,endAutoGroup:D,error:H,errorBoundary:U,event:V,label:Z,purge:J,warn:_}=N,Q=e=>{return N.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},G=Q,X=(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)=>Q(t))),Y=X("Method"),K=X("Method","replaced with"),ee=X("Option"),te=e=>t=>void 0===t?void 0:e(t),ne=te((e=>"true"===e)),oe=te(Number),re="--ifr-start",ie="--ifr-end",ae=[],se=new WeakSet,le=e=>"object"==typeof e&&se.add(e);let ce={},de=0;const ue=setInterval((()=>{if(ae.length<10)return;if(ce.hasTags&&ce.len<25)return;ae.sort();const e=Math.min(ae.reduce(((e,t)=>e+t),0)/ae.length,ae[Math.floor(ae.length/2)]),t=I(e);t>de&&(de=t,V("performanceObserver"),q("Mean time:",I(ae[Math.floor(ae.length/2)])),q("Median time:",I(ae.reduce(((e,t)=>e+t),0)/ae.length)),q("Average time:",t),q("Max time:",I(Math.max(...ae)))),e<=4||(clearInterval(ue),Q(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${I(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${ce.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function me(e){e.getEntries().forEach((e=>{if(e.name===ie){const{duration:t}=performance.measure("--ifr-measure",re,ie);ce=e.detail,ae.push(t),ae.length>100&&ae.shift()}}))}function fe(){new PerformanceObserver(me).observe({entryTypes:["mark"]}),le(document.documentElement),le(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",fe):fe());const pe=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},ge=pe("function"),he=pe("number"),ye=pe("string");"undefined"!=typeof window&&function(){const e={height:()=>(_("Custom height calculation function not defined"),St.auto()),width:()=>(_("Custom width calculation function not defined"),Ot.auto())},M={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},A={},R="auto",B="[iFrameSizer]",H="scroll";let J,X,te,ae,se,le,ce,de=!0,ue="",me=0,fe="",pe="",be=!0,ve=!1,ze=!0,we=!1,$e=!1,Se=!1,Oe=1,Me=R,ke="",Ee=!0,je={},Ie=!0,Te=!1,Ae="",Pe=0,Ce=!1,xe="",Re=j,Ne=[],qe="child",Be=null,Le=!1,We="",Fe=[],De=window.parent,He="*",Ue=0,Ve=!1,Ze=1,Je=H,_e=window,Qe=()=>{_("onMessage function not defined")},Ge=()=>{},Xe=null,Ye=null;function Ke(n){var r,i,p;!function(e){xe=e[0]??xe,me=oe(e[1])??me,ve=ne(e[2])??ve,Te=ne(e[3])??Te,de=ne(e[6])??de,fe=e[7]??fe,Me=e[8]??Me,ue=e[9]??ue,pe=e[10]??pe,Ue=oe(e[11])??Ue,je.enable=ne(e[12])??!1,qe=e[13]??qe,Je=e[14]??Je,Ce=ne(e[15])??Ce,J=oe(e[16])??J,X=oe(e[17])??X,be=ne(e[18])??be,Ae=e[19]??Ae,le=e[20]??le,Pe=oe(e[21])??Pe,Ie=ne(e[23])??Ie}(n),r={id:xe,enabled:Te,expand:Ie},N.label(`${r.id}`),N.expand(r.expand),x=r.enabled,q(`Initialising iframe v${a} ${window.location.href}`),function(){function n(e){q("Reading data from page:",e),ce=ge(e,"onBeforeResize")??ce,Qe=ge(e,"onMessage")??Qe,Ge=ge(e,"onReady")??Ge,"number"==typeof e?.offset&&(ee("offset","offsetSize"),be&&(J=he(e,"offset")??J),ve&&(X=he(e,"offset")??X)),"number"==typeof e?.offsetSize&&(be&&(J=he(e,"offsetSize")??J),ve&&(X=he(e,"offsetSize")??X)),ke=ye(e,"ignoreSelector")??ke,We=ye(e,"sizeSelector")??We,He=ye(e,"targetOrigin")??He,Me=e?.heightCalculationMethod||Me,Je=e?.widthCalculationMethod||Je}function o(t,n){return"function"==typeof t&&(Q(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===Pe)return;const r=window.iframeResizer||window.iFrameResizer;"object"==typeof r&&(n(r),Me=o(Me,"height"),Je=o(Je,"width"),L(`Set targetOrigin for parent: %c${He}`,t))}(),lt(),function(){try{Le=1===Pe||"iframeParentListener"in window.parent}catch(e){q("Cross domain iframe detected")}}(),Pe<0?G(`${k(Pe+2)}${k(2)}`):le?.codePointAt(0)>4||Pe<2&&G(k(3)),le&&""!==le&&"false"!==le?le!==a&&Q(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${le} - Child page: ${a}.\n`):Q("<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"),ut(),mt(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(l,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&Q("<rb>Deprecated Attributes</>\n \nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}(),"BackCompat"===document.compatMode&&Q("<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"),nt(),1!==Pe&&(_e.parentIframe=Object.freeze({autoResize:e=>(C(e,"boolean","parentIframe.autoResize(enable) enable"),!1===ve&&!1===be?(V(f),Q("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===de?(de=!0,queueMicrotask((()=>It(f,"Auto Resize enabled")))):!1===e&&!0===de&&(de=!1),At(0,0,"autoResize",JSON.stringify(de)),de)),close(){At(0,0,"close")},getId:()=>xe,getOrigin:()=>(Y("getOrigin()","getParentOrigin()"),te),getParentOrigin:()=>te,getPageInfo(e){if("function"==typeof e)return Xe=e,At(0,0,"pageInfo"),void K("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Xe=null,At(0,0,"pageInfoStop")},getParentProps:e=>(C(e,"function","parentIframe.getParentProps(callback) callback"),Ye=e,At(0,0,"parentInfo"),()=>{Ye=null,At(0,0,"parentInfoStop")}),getParentProperties(e){Y("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){C(e,"string","parentIframe.moveToAnchor(anchor) anchor"),je.findTarget(e)},reset(){!function(){const e=Me;Me=R,q("Reset trigger event: %cparentIframe.reset",t),Ve?q("TriggerLock blocked calculation"):(Ve=!0,F("Trigger event lock on"),requestAnimationFrame((()=>{Ve=!1,F("Trigger event lock off")}))),Tt("reset"),Me=e}()},setOffsetSize(e){C(e,"number","parentIframe.setOffsetSize(offset) offset"),J=e,X=e,It(b,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){C(e,"number","parentIframe.scrollBy(x, y) x"),C(t,"number","parentIframe.scrollBy(x, y) y"),At(t,e,"scrollBy")},scrollTo(e,t){C(e,"number","parentIframe.scrollTo(x, y) x"),C(t,"number","parentIframe.scrollTo(x, y) y"),At(t,e,"scrollTo")},scrollToOffset(e,t){C(e,"number","parentIframe.scrollToOffset(x, y) x"),C(t,"number","parentIframe.scrollToOffset(x, y) y"),At(t,e,"scrollToOffset")},sendMessage(e,t){t&&C(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),At(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){Me=e,ut()},setWidthCalculationMethod(e){Je=e,mt()},setTargetOrigin(e){C(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),q(`Set targetOrigin: %c${e}`,t),He=e},resize(e,t){e&&C(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&C(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),It(g,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){Y("size()","resize()"),this.resize(e,t)}}),_e.parentIFrame=_e.parentIframe),function(){function e(e){At(0,0,e.type,`${e.screenY}:${e.screenX}`)}function n(n,o){q(`Add event listener: %c${o}`,t),O(window.document,n,e)}!0===Ce&&(n("mouseenter","Mouse Enter"),n("mouseleave","Mouse Leave"))}(),je=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(t){const n=t.getBoundingClientRect(),o=e();return{x:parseInt(n.left,s)+parseInt(o.x,s),y:parseInt(n.top,s)+parseInt(o.y,s)}}function r(e){function r(e){const r=n(e);q(`Moving to in page link (%c#${i}%c) at x: %c${r.x}%c y: %c${r.y}`,t,o,t,o,t),At(r.y,r.x,"scrollToOffset")}const i=e.split("#")[1]||e,a=decodeURIComponent(i),s=document.getElementById(a)||document.getElementsByName(a)[0];void 0===s?(q(`In page link (#${i}) not found in iFrame, so sending to parent`),At(0,0,"inPageLink",`#${i}`)):r(s)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&r(t)}function a(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&O(e,"click",(t=>{t.preventDefault(),r(e.getAttribute("href"))}))}function l(){O(window,"hashchange",i)}function c(){setTimeout(i,128)}function d(){q("Setting up location.hash handlers"),a(),l(),c()}return je.enable?1===Pe?Q("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):d():q("In page linking not enabled"),{findTarget:r}}(),void 0===fe&&(fe=`${me}px`),at("margin",(i="margin",(p=fe).includes("-")&&(_(`Negative CSS value ignored for ${i}`),p=""),p)),at("background",ue),at("padding",pe),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body),q("Set HTML & body height: %cauto !important",t)}(),!0!==de&&q("Auto Resize disabled"),function(e){ct({method:e,eventType:"After Print",eventName:"afterprint"}),ct({method:e,eventType:"Before Print",eventName:"beforeprint"}),ct({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,n=[];let r=!1,i=0;const a=t=>{L("Mutations observed:",t);for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},s=16,c=2,u=200;let m=1;function f(e){lt(),ot(e),e.forEach(gt),e.clear()}function p(){const l=performance.now(),d=l-i,g=s*m+++c;if(d>g&&d<u)return L("Backed off due to heavy workload on callStack"),q(`Delay: %c${I(d)}ms %c> Delay limit: %c${g}ms`,t,o,t),setTimeout(p,s*m),void(i=l);m=1,n.forEach(a),n.length=0,e.size>0&&f(e),nt(),et(),r=!1,It(w,"Mutation Observed")}function g(e){n.push(e),r||(i=performance.now(),r=!0,requestAnimationFrame(p))}function h(){const e=new window.MutationObserver(g),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[d,l],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return q("Setup <body> MutationObserver"),e.observe(t,n),e}h()}(),q("Setup ResizeObserver"),Be=new ResizeObserver(ft),Be.observe(document.body),pt.add(document.body),gt(document.body),be!==ve&&(q("Setup OverflowObserver"),Re=(e=>{const t=e.side||u,n=e.onChange||j,o={root:e.root,rootMargin:"0px",threshold:1},r=window?.requestAnimationFrame||j,i=(e=!1)=>n(e),a=(e,n)=>0===e||e>n[t],s=(e,t)=>e.toggleAttribute(c,t),l=new IntersectionObserver((function(e){for(const o of e){const{boundingClientRect:e,rootBounds:r,target:i}=o,l=e[t],c=a(l,r)&&!((n=i).hidden||null===n.offsetParent||"none"===n.style.display);s(i,c)}var n;r(i)}),o),d=new WeakSet;return function(e){q("Attached overflowObservers");for(const t of e){const e=t.nodeType===Node.ELEMENT_NODE,n=d.has(t);!n&&e?(l.observe(t),d.add(t)):W(!n,"Node already observed",t)}}})({onChange:tt,root:document.documentElement,side:be?u:m})),ot(bt(document)()),queueMicrotask(Ge),q("Initialization complete"),It(S,"Init message from host page",void 0,void 0,a),document.title&&""!==document.title&&At(0,0,"title",document.title)}function et(){const e=document.querySelectorAll(`[${c}]`);Ne=Array.from(e).filter((e=>!e.closest(`[${d}]`))),$e=Ne.length>0}function tt(e){et(),($e||e)&&($e?L("Overflowed Elements:",...Ne):L("Overflow removed"),It(z,"Overflow updated"))}function nt(){Fe=document.querySelectorAll(`[${l}]`),Se=Fe.length>0,q(`Tagged elements found: %c${Se}`,t)}function ot(e){Se||Re(e)}let rt=0;function it(){const e=document.querySelectorAll(`*[${d}]`);we=e.length>0,we&&e.length!==rt&&(function(e){const t=1===e.length?"":"s";_(`%c[${d}]%c found on %c${e.length}%c element${t}`,r,i,r,i)}(e),rt=e.length)}function at(e,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(e,n),L(`Set body ${e}: %c${n}`,t))}function st(e,n,o){if(""!==o){q(`${e}: %c${o}`,t);for(const e of document.querySelectorAll(o))q(`Applying ${n} to:`,e),e.toggleAttribute(n,!0)}}function lt(){st("sizeSelector",l,We),st("ignoreSelector",d,ke)}function ct(e){({add(t){function n(){It(e.eventName,e.eventType)}A[t]=n,O(window,t,n,{passive:!0})},remove(e){const t=A[e];var n,o;delete A[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName),q(`${T(e.method)} event listener: %c${e.eventType}`,t)}function dt(e,n,o,r){return n!==e&&(e in o||(_(`${e} is not a valid option for ${r}CalculationMethod.`),e=n),e in M)&&Q(`<rb>Deprecated ${r}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${r} calculation method. It is recommended that you ${le?"remove this option.":"set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page."}`),q(`Set ${r} calculation method: %c${e}`,t),e}function ut(){Me=dt(Me,R,St,"height")}function mt(){Je=dt(Je,H,Ot,"width")}function ft(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;It(v,`Element resized <${P(t)}>`)}const pt=new WeakSet;function gt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!pt.has(e)){const n=getComputedStyle(e)?.position;""!==n&&"static"!==n&&(Be.observe(e),pt.add(e),q(`Attached resizeObserver: %c${P(e)}`,t))}const n=bt(e)();for(const e of n){if(pt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const n=getComputedStyle(e)?.position;""!==n&&"static"!==n&&(Be.observe(e),pt.add(e),q(`Attached resizeObserver: %c${P(e)}`,t))}}function ht(e){performance.mark(re);const t=T(e);let n=0,o=document.documentElement,r=Se?0:document.documentElement.getBoundingClientRect().bottom;const i=Se?Fe:$e?Ne:bt(document)();for(const t of i)n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,o=t);return L(`${t} position calculated from:`,o),performance.mark(ie,{detail:{hasTags:Se,len:i.length,logging:Te,Side:t}}),r}const yt=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],bt=e=>()=>{it();const t=["* ","not(head)","not(meta)","not(base)","not(title)","not(script)","not(link)","not(style)","not(map)","not(area)","not(option)","not(optgroup)","not(template)","not(track)","not(wbr)","not(nobr)"];return we&&t.push(`not([${d}])`,`not([${d}] *)`),e.querySelectorAll(t.join(":"))},vt={height:0,width:0},zt={height:0,width:0},wt=[t,o,t];function $t(e){function n(){return zt[r]=i,vt[r]=l,i}const o=e===St,r=o?"height":"width",i=e.boundingClientRect(),a=Math.ceil(i),s=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${i}px %cPage: %c${l}px`;let d=0;switch(!0){case!e.enabled():return l;case Se:L("Found element with data-iframe-size attribute"),d=e.taggedElement();break;case!$e&&0===zt[r]&&0===vt[r]:L(`Initial page size values: ${c}`,...wt),d=n();break;case Ve&&i===zt[r]&&l===vt[r]:L(`Size unchanged: ${c}`,...wt),d=Math.max(i,l);break;case 0===i:L(`Page is hidden: ${c}`,...wt),d=l;break;case!$e&&i!==zt[r]&&l<=vt[r]:L(`New <html> size: ${c} `,...wt),L(`Previous <html> size: %c${zt[r]}px`,t),d=n();break;case!o:d=e.taggedElement();break;case!$e&&i<zt[r]:L(`<html> size decreased: ${c}`,...wt),d=n();break;case l===s||l===a:L(`<html> size equals page size: ${c}`,...wt),d=n();break;case i>l:L(`Page size < <html> size: ${c}`,...wt),d=n();break;case $e:L("Found element overflowing <html> "),d=e.taggedElement();break;default:L(`Using <html> size: ${c}`,...wt),d=n()}return L(`Content ${r}: %c${d}px`,t),d+=function(e){const n=e.getOffset();return 0!==n&&L(`Page offsetSize: %c${n}px`,t),n}(e),d}const St={enabled:()=>be,getOffset:()=>J,auto:()=>$t(St),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,s)+parseInt(t.marginBottom,s)},bodyScroll:()=>document.body.scrollHeight,offset:()=>St.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...yt(St)),min:()=>Math.min(...yt(St)),grow:()=>St.max(),lowestElement:()=>ht(u),taggedElement:()=>ht(u)},Ot={enabled:()=>ve,getOffset:()=>X,auto:()=>$t(Ot),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...yt(Ot)),min:()=>Math.min(...yt(Ot)),rightMostElement:()=>ht(m),scroll:()=>Math.max(Ot.bodyScroll(),Ot.documentElementScroll()),taggedElement:()=>ht(m)},Mt=(e,t)=>!(Math.abs(e-t)<=Ue);function kt(e,t){const n=e[t]();return e.enabled()&&void 0!==ce?function(e){const t=ce(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 Et=!1;const jt=E((()=>G(k(4)))),It=U(((e,n,o,r,i)=>{if(se=performance.now(),ae=!0,V(e),!0!==Et)return de||e in y?void(document.hidden?q("Page hidden - Ignored resize request"):(Et=!0,requestAnimationFrame((()=>{Et=!1})),function(e,n,o,r,i){const a=o??kt(St,Me),s=r??kt(Ot,Je),l=be&&Mt(Oe,a)||ve&&Mt(Ze,s)?p:e;switch(q(`Resize event: %c${n}`,t),l){case S:case f:case p:Oe=a,Ze=s;case b:At(Oe,Ze,e,i);break;case v:case z:case w:q($);break;default:L($)}ae=!1}(e,n,o,r,i))):(L("Resizing disabled"),void D())}));function Tt(e){Oe=St[Me](),Ze=Ot[Je](),At(Oe,Ze,e)}const At=U((function(e,o,r,i,a){Pe<-1||(V(r),void 0!==a?q(`Message targetOrigin: %c${a}`,t):a=He,function(){const s=`${xe}:${e}:${o}:${r}${void 0===i?"":`:${i}`}`;if(Le)try{window.parent.iframeParentListener(B+s)}catch(e){if(1!==Pe)throw e;return void jt()}else De.postMessage(B+s,a);ae&&q(function(){const e=I(performance.now()-se);return r===S?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),t),L(`Sending message to parent page via ${Le?"sameOrigin":"postMessage"}: %c%c${s}`,n,t)}(),D())})),Pt=U((function(e){V("onMessage");const{freeze:n}=Object,{parse:o}=JSON,r=e=>n(o(e)),i=e=>At(0,0,`${e}Stop`),a={init:function(){if("loading"===document.readyState)return void q("Page not ready, ignoring init message");const t=e.data.slice(13).split(":");De=e.source,te=e.origin,Ke(t),ze=!1,setTimeout((()=>{Ee=!1}),128)},reset(){Ee?q("Page reset ignored by init"):(q("Page size reset by host page"),Tt("resetPage"))},resize(){q("Resize requested by host page"),It(h,"Parent window requested size check")},moveToAnchor(){je.findTarget(l())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=l();q("PageInfo received from parent:",r(e)),Xe?setTimeout((()=>Xe(o(e)))):i("pageInfo")},parentInfo(){const e=r(l());q("ParentInfo received from parent:",e),Ye?setTimeout((()=>Ye(e))):i("parentInfo")},message(){const e=l();q("onMessage called from parent:%c",t,r(e)),setTimeout((()=>Qe(o(e))))}},s=()=>e.data.split("]")[1].split(":")[0],l=()=>e.data.slice(e.data.indexOf(":")+1),c=()=>e.data.split(":")[2]in{true:1,false:1};function d(){const t=s();V(t),t in a?a[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||c()||_(`Unexpected message (${e.data})`)}B===`${e.data}`.slice(0,13)&&function(){if(!1!==ze)return c()?(Z(s()),V(S),void a.init()):void q(`Ignored message of type "${s()}". Received before initialization.`);d()}()}));function Ct(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?_("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Pt({data:e,sameOrigin:!0}))),O(window,"message",Pt),O(window,"readystatechange",Ct),Ct())}();
|
|
21
|
+
//# sourceMappingURL=index.esm.js.map
|