@iframe-resizer/child 5.4.2 → 5.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.cjs.js +2 -2
- package/index.esm.js +2 -2
- package/index.umd.js +2 -2
- package/package.json +2 -2
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.3 (cjs) - 2025-04-02
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
"use strict";const e=require("auto-console-group"),t="5.4.2",n=10,o="data-iframe-size",i="data-iframe-overflowed",r="data-iframe-ignore",a="bottom",l="right",s="resizeParent",c="setOffsetSize",u="resizeObserver",d="overflowObserver",m="mutationObserver",f=(e,t,n,o)=>e.addEventListener(t,n,o||!1),p=["<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 h=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(p[e]),y=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},g=e=>e,b=e=>Math.round(1e3*e)/1e3,v=e=>""!=`${e}`&&void 0!==e;let z=!0;var w;const $=(w=e,w?.__esModule?w.default:w)({label:"iframeResizer(child)"});const S=(j="info",(...e)=>!z||$[j](...e));var j;const{assert:O,debug:E,endAutoGroup:k,error:I,errorBoundary:M,event:T,purge:P,warn:A}=$,C=e=>{return $.warn((t=g,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},N=C,R=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>C(t))),L=R("Method"),x=R("Method","replaced with"),H=R("Option"),q=requestAnimationFrame,B="--ifr-start",D="--ifr-end",G=[],F=new WeakSet,W=e=>"object"==typeof e&&F.add(e);let V={},U=0;const Z=setInterval((()=>{if(G.length<10)return;if(V.hasTags&&V.len<25)return;G.sort();const e=Math.min(G.reduce(((e,t)=>e+t),0)/G.length,G[Math.floor(G.length/2)]),t=b(e);t>U&&(U=t,T("performanceObserver")),e<=4||(clearInterval(Z),C(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${b(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${V.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function J(e){e.getEntries().forEach((e=>{if(e.name===D){const{duration:t}=performance.measure("--ifr-measure",B,D);V=e.detail,G.push(t),G.length>100&&G.shift()}}))}function _(){new PerformanceObserver(J).observe({entryTypes:["mark"]}),W(document.documentElement),W(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",_):_()),"undefined"!=typeof window&&function(){const p={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},w={height:()=>(A("Custom height calculation function not defined"),rt.auto()),width:()=>(A("Custom width calculation function not defined"),at.auto())},j={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},O={},E="checkVisibility"in window,I="auto",R="[iFrameSizer]",G={max:1,min:1,bodyScroll:1,documentElementScroll:1},F="scroll";let W,V,U,Z,J,_=!0,Q="",X=0,Y="",K="",ee=!0,te=!1,ne=!0,oe=!1,ie=!1,re=!1,ae=1,le=I,se="",ce=!0,ue="",de={},me=!1,fe=0,pe=!1,he="",ye=g,ge=[],be="child",ve=null,ze=!1,we="",$e=[],Se=window.parent,je="*",Oe=0,Ee=!1,ke="",Ie=1,Me=F,Te=window,Pe=()=>{A("onMessage function not defined")},Ae=()=>{},Ce=null,Ne=null;function Re(){var s,u,d;!function(){const e=e=>"true"===e,t=ue.slice(13).split(":");he=t[0],X=void 0===t[1]?X:Number(t[1]),te=void 0===t[2]?te:e(t[2]),me=void 0===t[3]?me:e(t[3]),_=void 0===t[6]?_:e(t[6]),Y=t[7],le=void 0===t[8]?le:t[8],Q=t[9],K=t[10],Oe=void 0===t[11]?Oe:Number(t[11]),de.enable=void 0!==t[12]&&e(t[12]),be=void 0===t[13]?be:t[13],Me=void 0===t[14]?Me:t[14],pe=void 0===t[15]?pe:e(t[15]),W=void 0===t[16]?W:Number(t[16]),V=void 0===t[17]?V:Number(t[17]),ee=void 0===t[18]?ee:e(t[18]),t[19],ke=t[20]||ke,fe=void 0===t[21]?fe:Number(t[21])}(),s={id:he,enabled:me},$.label(`${s.id}`),z=s.enabled,function(){function t(e){Pe=e?.onMessage||Pe,Ae=e?.onReady||Ae,"number"==typeof e?.offset&&(H("offset","offsetSize"),ee&&(W=e?.offset),te&&(V=e?.offset)),"number"==typeof e?.offsetSize&&(ee&&(W=e?.offsetSize),te&&(V=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(we=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(se=e.ignoreSelector),je=e?.targetOrigin||je,le=e?.heightCalculationMethod||le,Me=e?.widthCalculationMethod||Me}function n(e,t){return"function"==typeof e&&(w[t]=e,e="custom"),e}if(1===fe)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),le=n(le,"height"),Me=n(Me,"width"),S(`Set TargetOrigin for parent: %c${je}`,e.HIGHLIGHT))}(),We(),function(){try{ze=1===fe||"iframeParentListener"in window.parent}catch(e){}}(),fe<0?N(`${h(fe+2)}${h(2)}`):ke.codePointAt(0)>4||fe<2&&N(h(3)),ke&&""!==ke&&"false"!==ke?ke!==t&&C(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ke} - Child page: ${t}.\n`):C("<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"),Ze(),Je(),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&&C("<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&&C("<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"),He(),1!==fe&&(Te.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===_?(_=!0,dt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===_&&(_=!1),pt(0,0,"autoResize",JSON.stringify(_)),_),close(){pt(0,0,"close")},getId:()=>he,getOrigin:()=>(L("getOrigin()","getParentOrigin()"),U),getParentOrigin:()=>U,getPageInfo(e){if("function"==typeof e)return Ce=e,pt(0,0,"pageInfo"),void x("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ce=null,pt(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return Ne=e,pt(0,0,"parentInfo"),()=>{Ne=null,pt(0,0,"parentInfoStop")}},getParentProperties(e){L("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){de.findTarget(e)},reset(){ft()},setOffsetSize(e){W=e,V=e,dt(c,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){pt(t,e,"scrollBy")},scrollTo(e,t){pt(t,e,"scrollTo")},scrollToOffset(e,t){pt(t,e,"scrollToOffset")},sendMessage(e,t){pt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){le=e,Ze()},setWidthCalculationMethod(e){Me=e,Je()},setTargetOrigin(e){je=e},resize(e,t){dt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){L("size()","resize()"),this.resize(e,t)}}),Te.parentIFrame=Te.parentIframe),function(){function e(e){pt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){f(window.document,t,e)}!0===pe&&(t("mouseenter"),t("mouseleave"))}(),de=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const o=t.getBoundingClientRect(),i=e();return{x:parseInt(o.left,n)+parseInt(i.x,n),y:parseInt(o.top,n)+parseInt(i.y,n)}}function o(e){function n(e){const n=t(e);pt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?pt(0,0,"inPageLink",`#${o}`):n(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&f(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){f(window,"hashchange",i)}function l(){setTimeout(i,128)}function s(){r(),a(),l()}return de.enable&&(1===fe?C("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s()),{findTarget:o}}(),void 0===Y&&(Y=`${X}px`),Ge("margin",(u="margin",(d=Y).includes("-")&&(A(`Negative CSS value ignored for ${u}`),d=""),d)),Ge("background",Q),Ge("padding",K),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){Ve({method:e,eventType:"After Print",eventName:"afterprint"}),Ve({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ve({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const i=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)}},r=16,a=2,l=200;let s=1;function c(e){We(),qe(e),e.forEach(Xe),e.clear()}function u(){T("mutationObserver");const d=performance.now(),f=d-o;if(f>r*s+++a&&f<l)return setTimeout(u,r*s),void(o=d);s=1,t.forEach(i),t.length=0,e.size>0&&c(e),He(),Le(),n=!1,dt(m,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function f(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}f()}(),ve=new ResizeObserver(_e),ve.observe(document.body),Qe.add(document.body),Xe(document.body),ee!==te&&(ye=(e=>{const t=e.side||a,n=e.onChange||g,o=(e,n)=>0===e||e>n[t],l={root:e.root,rootMargin:"0px",threshold:1},s=(e=!1)=>n(e),c=(e,t)=>e.toggleAttribute(i,t),u=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:a}=i,l=e[t],s=!((n=a).hidden||null===n.offsetParent||"none"===n.style.display)&&o(l,r);c(a,s)}var n;q(s)}),l),d=new WeakSet;return function(){const e=new window.MutationObserver((()=>{S("Detected changes in element attributes"),s(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[r],subtree:!0};e.observe(t,n)}(),function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||d.has(t)||(u.observe(t),d.add(t))}})({onChange:xe,root:document.documentElement,side:ee?a:l})),qe(et(document)()),queueMicrotask(Ae),dt("init","Init message from host page",void 0,void 0,t),document.title&&""!==document.title&&pt(0,0,"title",document.title)}function Le(){ge=document.querySelectorAll(`[${i}]:not([${r}]):not([${r}] *)`),ie=ge.length>0}function xe(e){Le(),(ie||e)&&dt(d,"Overflow updated")}function He(){$e=document.querySelectorAll(`[${o}]`),re=$e.length>0}function qe(e){re||ye(e)}let Be=0;function De(){const t=document.querySelectorAll(`*[${r}]`);oe=t.length>0,oe&&t.length!==Be&&(function(t){const n=1===t.length?"":"s";A(`%c[${r}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),Be=t.length)}function Ge(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),S(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function Fe(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function We(){Fe(0,o,we),Fe(0,r,se)}function Ve(e){({add(t){function n(){dt(e.eventName,e.eventType)}O[t]=n,f(window,t,n,{passive:!0})},remove(e){const t=O[e];var n,o;delete O[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ue(e,t,n,o){return t!==e&&(e in n||(A(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in j&&C(`<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 remove this option.`)),e}function Ze(){le=Ue(le,I,rt,"height")}function Je(){Me=Ue(Me,F,at,"width")}function _e(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;dt(u,`Element resized <${function(e){switch(!0){case!v(e):return"";case v(e.id):return`${e.nodeName}#${e.id}`;case v(e.name):return`${e.nodeName} (${e.name}`;case v(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const Qe=new WeakSet;function Xe(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Qe.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ve.observe(e),Qe.add(e))}const t=et(e)();for(const e of t){if(Qe.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ve.observe(e),Qe.add(e))}}function Ye(e){performance.mark(B);const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let o=0,i=document.documentElement,r=re?0:document.documentElement.getBoundingClientRect().bottom;const a=re?$e:ie?ge:et(document)();let l=a.length;for(const t of a)re||!E||t.checkVisibility(p)?(o=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),o>r&&(r=o,i=t)):l-=1;return S(`${t} position calculated from:`,i),performance.mark(D,{detail:{Side:t,len:l,hasTags:re,logging:me}}),r}const Ke=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],et=e=>()=>{De();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 oe&&t.push(`not([${r}])`,`not([${r}] *)`),e.querySelectorAll(t.join(":"))},tt={height:0,width:0},nt={height:0,width:0},ot=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function it(t){function n(){return nt[i]=r,tt[i]=s,r}const o=t===rt,i=o?"height":"width",r=t.boundingClientRect(),a=Math.ceil(r),l=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),c=`HTML: %c${r}px %cPage: %c${s}px`;let u=0;switch(!0){case!t.enabled():return s;case re:S("Found element with data-iframe-size attribute"),u=t.taggedElement();break;case!ie&&0===nt[i]&&0===tt[i]:S(`Initial page size values: ${c}`,...ot),u=n();break;case Ee&&r===nt[i]&&s===tt[i]:S(`Size unchanged: ${c}`,...ot),u=Math.max(r,s);break;case 0===r:S(`Page is hidden: ${c}`,...ot),u=s;break;case!ie&&r!==nt[i]&&s<=tt[i]:S(`New <html> size: ${c} `,...ot),S(`Previous <html> size: %c${nt[i]}px`,e.HIGHLIGHT),u=n();break;case!o:u=t.taggedElement();break;case!ie&&r<nt[i]:S(`<html> size decreased: ${c}`,...ot),u=n();break;case s===l||s===a:S(`<html> size equals page size: ${c}`,...ot),u=n();break;case r>s:S(`Page size < <html> size: ${c}`,...ot),u=n();break;case ie:S("Found element overflowing <html> "),u=t.taggedElement();break;default:S(`Using <html> size: ${c}`,...ot),u=n()}return S(`Content ${i}: %c${u}px`,e.HIGHLIGHT),u+=function(t){const n=t.getOffset();return 0!==n&&S(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),u}const rt={enabled:()=>ee,getOffset:()=>W,auto:()=>it(rt),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,n)+parseInt(t.marginBottom,n)},bodyScroll:()=>document.body.scrollHeight,offset:()=>rt.bodyOffset(),custom:()=>w.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Ke(rt)),min:()=>Math.min(...Ke(rt)),grow:()=>rt.max(),lowestElement:()=>Ye(a),taggedElement:()=>Ye(a)},at={enabled:()=>te,getOffset:()=>V,auto:()=>it(at),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>w.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Ke(at)),min:()=>Math.min(...Ke(at)),rightMostElement:()=>Ye(l),scroll:()=>Math.max(at.bodyScroll(),at.documentElementScroll()),taggedElement:()=>Ye(l)},lt=(e,t)=>!(Math.abs(e-t)<=Oe);function st(e,t,n,o,i){const r=void 0===n?rt[le]():n,a=void 0===o?at[Me]():o;switch(!0){case ee&<(ae,r)||te&<(Ie,a)||"init"===e:ae=r,Ie=a;case e===c:pt(ae,Ie,e,i);break;case!e!==s&&(ee&&le in G||te&&Me in G):ft();break;case e===u:case e===d:case e===m:P();break;default:P(),S("No change in content size detected")}Z=!1}let ct=!1;const ut=y((()=>N(h(4)))),dt=M(((e,t,n,o,i)=>{J=performance.now(),T(e),_||e===s?document.hidden||(ct||(Z=!0,st(e,0,n,o,i),requestAnimationFrame((()=>{ct=!1}))),ct=!0):S("Resizing disabled")}));function mt(e){ae=rt[le](),Ie=at[Me](),pt(ae,Ie,e)}function ft(e){const t=le;le=I,Ee||(Ee=!0,requestAnimationFrame((()=>{Ee=!1}))),mt("reset"),le=t}const pt=M((function(t,n,o,i,r){fe<-1||(T(o),void 0!==r||(r=je),function(){const a=`${he}:${t}:${n}:${o}${void 0===i?"":`:${i}`}`;if(ze)try{window.parent.iframeParentListener(R+a)}catch(e){if(1!==fe)throw e;return void ut()}else Se.postMessage(R+a,r);Z&&S(function(){const e=b(performance.now()-J);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),e.HIGHLIGHT),S("Sending message to host page via "+(ze?"sameDomain":"postMessage")),S(`%c${a}`,e.ITALIC)}(),k())})),ht=M((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>pt(0,0,`${e}Stop`),i={init:function(){ue=e.data,Se=e.source,U=e.origin,Re(),ne=!1,setTimeout((()=>{ce=!1}),128)},reset(){ce||mt("resetPage")},resize(){dt(s,"Parent window requested size check")},moveToAnchor(){de.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();Ce?setTimeout((()=>Ce(n(e)))):o("pageInfo")},parentInfo(){const e=a();Ne?setTimeout((()=>Ne(t(n(e))))):o("parentInfo")},message(){const e=a();setTimeout((()=>Pe(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||A(`Unexpected message (${e.data})`)}R===`${e.data}`.slice(0,13)&&(T(r()),!1!==ne?l()&&i.init():c())}));function yt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?A("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>ht({data:e,sameDomain:!0}))),f(window,"message",ht),f(window,"readystatechange",yt),yt())}();
|
|
20
|
+
"use strict";const e=require("auto-console-group"),t="5.4.3",n=10,o="data-iframe-size",i="data-iframe-overflowed",r="data-iframe-ignore",a="bottom",l="right",s="resizeParent",c="setOffsetSize",u="resizeObserver",d="overflowObserver",m="mutationObserver",f=(e,t,n,o)=>e.addEventListener(t,n,o||!1),p=["<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 h=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(p[e]),y=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},g=e=>e,b=e=>Math.round(1e3*e)/1e3,v=e=>e.charAt(0).toUpperCase()+e.slice(1),z=e=>""!=`${e}`&&void 0!==e;const w=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${v(t)}`)};let $=!0;var S;const O=(S=e,S?.__esModule?S.default:S)({label:"iframeResizer(child)"});const I=(j="info",(...e)=>!$||O[j](...e));var j;const{assert:E,debug:T,endAutoGroup:k,error:M,errorBoundary:P,event:A,purge:C,warn:N}=O,x=e=>{return O.warn((t=g,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},R=x,H=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>x(t))),L=H("Method"),q=H("Method","replaced with"),B=H("Option"),D="--ifr-start",G="--ifr-end",W=[],F=new WeakSet,V=e=>"object"==typeof e&&F.add(e);let U={},Z=0;const J=setInterval((()=>{if(W.length<10)return;if(U.hasTags&&U.len<25)return;W.sort();const e=Math.min(W.reduce(((e,t)=>e+t),0)/W.length,W[Math.floor(W.length/2)]),t=b(e);t>Z&&(Z=t,A("performanceObserver")),e<=4||(clearInterval(J),x(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${b(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${U.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function _(e){e.getEntries().forEach((e=>{if(e.name===G){const{duration:t}=performance.measure("--ifr-measure",D,G);U=e.detail,W.push(t),W.length>100&&W.shift()}}))}function Q(){new PerformanceObserver(_).observe({entryTypes:["mark"]}),V(document.documentElement),V(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",Q):Q()),"undefined"!=typeof window&&function(){const p={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},S={height:()=>(N("Custom height calculation function not defined"),at.auto()),width:()=>(N("Custom width calculation function not defined"),lt.auto())},j={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},E={},T="checkVisibility"in window,M="auto",H="[iFrameSizer]",W={max:1,min:1,bodyScroll:1,documentElementScroll:1},F="scroll";let V,U,Z,J,_,Q=!0,X="",Y=0,K="",ee="",te=!0,ne=!1,oe=!0,ie=!1,re=!1,ae=!1,le=1,se=M,ce="",ue=!0,de="",me={},fe=!1,pe=0,he=!1,ye="",ge=g,be=[],ve="child",ze=null,we=!1,$e="",Se=[],Oe=window.parent,Ie="*",je=0,Ee=!1,Te="",ke=1,Me=F,Pe=window,Ae=()=>{N("onMessage function not defined")},Ce=()=>{},Ne=null,xe=null;function Re(){var s,u,d;!function(){const e=e=>"true"===e,t=de.slice(13).split(":");ye=t[0],Y=void 0===t[1]?Y:Number(t[1]),ne=void 0===t[2]?ne:e(t[2]),fe=void 0===t[3]?fe:e(t[3]),Q=void 0===t[6]?Q:e(t[6]),K=t[7],se=void 0===t[8]?se:t[8],X=t[9],ee=t[10],je=void 0===t[11]?je:Number(t[11]),me.enable=void 0!==t[12]&&e(t[12]),ve=void 0===t[13]?ve:t[13],Me=void 0===t[14]?Me:t[14],he=void 0===t[15]?he:e(t[15]),V=void 0===t[16]?V:Number(t[16]),U=void 0===t[17]?U:Number(t[17]),te=void 0===t[18]?te:e(t[18]),t[19],Te=t[20]||Te,pe=void 0===t[21]?pe:Number(t[21])}(),s={id:ye,enabled:fe},O.label(`${s.id}`),$=s.enabled,function(){function t(e){Ae=e?.onMessage||Ae,Ce=e?.onReady||Ce,"number"==typeof e?.offset&&(B("offset","offsetSize"),te&&(V=e?.offset),ne&&(U=e?.offset)),"number"==typeof e?.offsetSize&&(te&&(V=e?.offsetSize),ne&&(U=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&($e=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(ce=e.ignoreSelector),Ie=e?.targetOrigin||Ie,se=e?.heightCalculationMethod||se,Me=e?.widthCalculationMethod||Me}function n(e,t){return"function"==typeof e&&(S[t]=e,e="custom"),e}if(1===pe)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(t(o),se=n(se,"height"),Me=n(Me,"width"),I(`Set TargetOrigin for parent: %c${Ie}`,e.HIGHLIGHT))}(),Ve(),function(){try{we=1===pe||"iframeParentListener"in window.parent}catch(e){}}(),pe<0?R(`${h(pe+2)}${h(2)}`):Te.codePointAt(0)>4||pe<2&&R(h(3)),Te&&""!==Te&&"false"!==Te?Te!==t&&x(`<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`):x("<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"),Je(),_e(),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&&x("<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&&x("<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"),qe(),1!==pe&&(Pe.parentIframe=Object.freeze({autoResize:e=>(w(e,"bool","parentIframe.autoResize(enable) enable"),!0===e&&!1===Q?(Q=!0,mt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===Q&&(Q=!1),ht(0,0,"autoResize",JSON.stringify(Q)),Q),close(){ht(0,0,"close")},getId:()=>ye,getOrigin:()=>(L("getOrigin()","getParentOrigin()"),Z),getParentOrigin:()=>Z,getPageInfo(e){if("function"==typeof e)return Ne=e,ht(0,0,"pageInfo"),void q("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Ne=null,ht(0,0,"pageInfoStop")},getParentProps:e=>(w(e,"function","parentIframe.getParentProps(callback) callback"),xe=e,ht(0,0,"parentInfo"),()=>{xe=null,ht(0,0,"parentInfoStop")}),getParentProperties(e){L("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){w(e,"string","parentIframe.moveToAnchor(anchor) anchor"),me.findTarget(e)},reset(){pt()},setOffsetSize(e){w(e,"number","parentIframe.setOffsetSize(offset) offset"),V=e,U=e,mt(c,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){w(e,"number","parentIframe.scrollBy(x, y) x"),w(t,"number","parentIframe.scrollBy(x, y) y"),ht(t,e,"scrollBy")},scrollTo(e,t){w(e,"number","parentIframe.scrollTo(x, y) x"),w(t,"number","parentIframe.scrollTo(x, y) y"),ht(t,e,"scrollTo")},scrollToOffset(e,t){w(e,"number","parentIframe.scrollToOffset(x, y) x"),w(t,"number","parentIframe.scrollToOffset(x, y) y"),ht(t,e,"scrollToOffset")},sendMessage(e,t){t&&w(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),ht(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){se=e,Je()},setWidthCalculationMethod(e){Me=e,_e()},setTargetOrigin(e){w(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Ie=e},resize(e,t){e&&w(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&w(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),mt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){L("size()","resize()"),this.resize(e,t)}}),Pe.parentIFrame=Pe.parentIframe),function(){function e(e){ht(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){f(window.document,t,e)}!0===he&&(t("mouseenter"),t("mouseleave"))}(),me=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function t(t){const o=t.getBoundingClientRect(),i=e();return{x:parseInt(o.left,n)+parseInt(i.x,n),y:parseInt(o.top,n)+parseInt(i.y,n)}}function o(e){function n(e){const n=t(e);ht(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?ht(0,0,"inPageLink",`#${o}`):n(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&f(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){f(window,"hashchange",i)}function l(){setTimeout(i,128)}function s(){r(),a(),l()}return me.enable&&(1===pe?x("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s()),{findTarget:o}}(),void 0===K&&(K=`${Y}px`),We("margin",(u="margin",(d=K).includes("-")&&(N(`Negative CSS value ignored for ${u}`),d=""),d)),We("background",X),We("padding",ee),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){Ue({method:e,eventType:"After Print",eventName:"afterprint"}),Ue({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ue({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const i=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)}},r=16,a=2,l=200;let s=1;function c(e){Ve(),Be(e),e.forEach(Ye),e.clear()}function u(){A("mutationObserver");const d=performance.now(),f=d-o;if(f>r*s+++a&&f<l)return setTimeout(u,r*s),void(o=d);s=1,t.forEach(i),t.length=0,e.size>0&&c(e),qe(),He(),n=!1,mt(m,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function f(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}f()}(),ze=new ResizeObserver(Qe),ze.observe(document.body),Xe.add(document.body),Ye(document.body),te!==ne&&(ge=(e=>{const t=e.side||a,n=e.onChange||g,o=(e,n)=>0===e||e>n[t],l={root:e.root,rootMargin:"0px",threshold:1},s=window.requestAnimationFrame,c=(e=!1)=>n(e),u=(e,t)=>e.toggleAttribute(i,t),d=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:a}=i,l=e[t],s=!((n=a).hidden||null===n.offsetParent||"none"===n.style.display)&&o(l,r);u(a,s)}var n;s(c)}),l),m=new WeakSet;return function(){const e=new window.MutationObserver((()=>{I("Detected changes in element attributes"),c(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[r],subtree:!0};e.observe(t,n)}(),function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||m.has(t)||(d.observe(t),m.add(t))}})({onChange:Le,root:document.documentElement,side:te?a:l})),Be(tt(document)()),queueMicrotask(Ce),mt("init","Init message from host page",void 0,void 0,t),document.title&&""!==document.title&&ht(0,0,"title",document.title)}function He(){be=document.querySelectorAll(`[${i}]:not([${r}]):not([${r}] *)`),re=be.length>0}function Le(e){He(),(re||e)&&mt(d,"Overflow updated")}function qe(){Se=document.querySelectorAll(`[${o}]`),ae=Se.length>0}function Be(e){ae||ge(e)}let De=0;function Ge(){const t=document.querySelectorAll(`*[${r}]`);ie=t.length>0,ie&&t.length!==De&&(function(t){const n=1===t.length?"":"s";N(`%c[${r}]%c found on %c${t.length}%c element${n}`,e.BOLD,e.NORMAL,e.BOLD,e.NORMAL)}(t),De=t.length)}function We(t,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(t,n),I(`Set body ${t}: %c${n}`,e.HIGHLIGHT))}function Fe(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Ve(){Fe(0,o,$e),Fe(0,r,ce)}function Ue(e){({add(t){function n(){mt(e.eventName,e.eventType)}E[t]=n,f(window,t,n,{passive:!0})},remove(e){const t=E[e];var n,o;delete E[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ze(e,t,n,o){return t!==e&&(e in n||(N(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in j&&x(`<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 remove this option.`)),e}function Je(){se=Ze(se,M,at,"height")}function _e(){Me=Ze(Me,F,lt,"width")}function Qe(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;mt(u,`Element resized <${function(e){switch(!0){case!z(e):return"";case z(e.id):return`${e.nodeName}#${e.id}`;case z(e.name):return`${e.nodeName} (${e.name}`;case z(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const Xe=new WeakSet;function Ye(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Xe.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ze.observe(e),Xe.add(e))}const t=tt(e)();for(const e of t){if(Xe.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ze.observe(e),Xe.add(e))}}function Ke(e){performance.mark(D);const t=v(e);let n=0,o=document.documentElement,i=ae?0:document.documentElement.getBoundingClientRect().bottom;const r=ae?Se:re?be:tt(document)();let a=r.length;for(const t of r)ae||!T||t.checkVisibility(p)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>i&&(i=n,o=t)):a-=1;return I(`${t} position calculated from:`,o),performance.mark(G,{detail:{Side:t,len:a,hasTags:ae,logging:fe}}),i}const et=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],tt=e=>()=>{Ge();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 ie&&t.push(`not([${r}])`,`not([${r}] *)`),e.querySelectorAll(t.join(":"))},nt={height:0,width:0},ot={height:0,width:0},it=[e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT];function rt(t){function n(){return ot[i]=r,nt[i]=s,r}const o=t===at,i=o?"height":"width",r=t.boundingClientRect(),a=Math.ceil(r),l=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(t),c=`HTML: %c${r}px %cPage: %c${s}px`;let u=0;switch(!0){case!t.enabled():return s;case ae:I("Found element with data-iframe-size attribute"),u=t.taggedElement();break;case!re&&0===ot[i]&&0===nt[i]:I(`Initial page size values: ${c}`,...it),u=n();break;case Ee&&r===ot[i]&&s===nt[i]:I(`Size unchanged: ${c}`,...it),u=Math.max(r,s);break;case 0===r:I(`Page is hidden: ${c}`,...it),u=s;break;case!re&&r!==ot[i]&&s<=nt[i]:I(`New <html> size: ${c} `,...it),I(`Previous <html> size: %c${ot[i]}px`,e.HIGHLIGHT),u=n();break;case!o:u=t.taggedElement();break;case!re&&r<ot[i]:I(`<html> size decreased: ${c}`,...it),u=n();break;case s===l||s===a:I(`<html> size equals page size: ${c}`,...it),u=n();break;case r>s:I(`Page size < <html> size: ${c}`,...it),u=n();break;case re:I("Found element overflowing <html> "),u=t.taggedElement();break;default:I(`Using <html> size: ${c}`,...it),u=n()}return I(`Content ${i}: %c${u}px`,e.HIGHLIGHT),u+=function(t){const n=t.getOffset();return 0!==n&&I(`Page offsetSize: %c${n}px`,e.HIGHLIGHT),n}(t),u}const at={enabled:()=>te,getOffset:()=>V,auto:()=>rt(at),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,n)+parseInt(t.marginBottom,n)},bodyScroll:()=>document.body.scrollHeight,offset:()=>at.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(...et(at)),min:()=>Math.min(...et(at)),grow:()=>at.max(),lowestElement:()=>Ke(a),taggedElement:()=>Ke(a)},lt={enabled:()=>ne,getOffset:()=>U,auto:()=>rt(lt),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(...et(lt)),min:()=>Math.min(...et(lt)),rightMostElement:()=>Ke(l),scroll:()=>Math.max(lt.bodyScroll(),lt.documentElementScroll()),taggedElement:()=>Ke(l)},st=(e,t)=>!(Math.abs(e-t)<=je);function ct(e,t,n,o,i){const r=void 0===n?at[se]():n,a=void 0===o?lt[Me]():o;switch(!0){case te&&st(le,r)||ne&&st(ke,a)||"init"===e:le=r,ke=a;case e===c:ht(le,ke,e,i);break;case!e!==s&&(te&&se in W||ne&&Me in W):pt();break;case e===u:case e===d:case e===m:C();break;default:C(),I("No change in content size detected")}J=!1}let ut=!1;const dt=y((()=>R(h(4)))),mt=P(((e,t,n,o,i)=>{_=performance.now(),A(e),Q||e===s?document.hidden||(ut||(J=!0,ct(e,0,n,o,i),requestAnimationFrame((()=>{ut=!1}))),ut=!0):I("Resizing disabled")}));function ft(e){le=at[se](),ke=lt[Me](),ht(le,ke,e)}function pt(e){const t=se;se=M,Ee||(Ee=!0,requestAnimationFrame((()=>{Ee=!1}))),ft("reset"),se=t}const ht=P((function(t,n,o,i,r){pe<-1||(A(o),void 0!==r||(r=Ie),function(){const a=`${ye}:${t}:${n}:${o}${void 0===i?"":`:${i}`}`;if(we)try{window.parent.iframeParentListener(H+a)}catch(e){if(1!==pe)throw e;return void dt()}else Oe.postMessage(H+a,r);J&&I(function(){const e=b(performance.now()-_);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),e.HIGHLIGHT),I("Sending message to host page via "+(we?"sameDomain":"postMessage")),I(`%c${a}`,e.ITALIC)}(),k())})),yt=P((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>ht(0,0,`${e}Stop`),i={init:function(){de=e.data,Oe=e.source,Z=e.origin,Re(),oe=!1,setTimeout((()=>{ue=!1}),128)},reset(){ue||ft("resetPage")},resize(){mt(s,"Parent window requested size check")},moveToAnchor(){me.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();Ne?setTimeout((()=>Ne(n(e)))):o("pageInfo")},parentInfo(){const e=a();xe?setTimeout((()=>xe(t(n(e))))):o("parentInfo")},message(){const e=a();setTimeout((()=>Ae(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function c(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||N(`Unexpected message (${e.data})`)}H===`${e.data}`.slice(0,13)&&(A(r()),!1!==oe?l()&&i.init():c())}));function gt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?N("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>yt({data:e,sameDomain:!0}))),f(window,"message",yt),f(window,"readystatechange",gt),gt())}();
|
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.3 (esm) - 2025-04-02
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
import e,{HIGHLIGHT as t,FOREGROUND as n,ITALIC as o,BOLD as i,NORMAL as r}from"auto-console-group";const a="5.4.2",l=10,s="data-iframe-size",c="data-iframe-overflowed",u="data-iframe-ignore",d="bottom",m="right",f="resizeParent",p="setOffsetSize",h="resizeObserver",y="overflowObserver",g="mutationObserver",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.replaceAll(/[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,j=e=>""!=`${e}`&&void 0!==e;let E=!0;var O;const k=(O=e,O?.__esModule?O.default:O)({label:"iframeResizer(child)"});const P=(M="info",(...e)=>!E||k[M](...e));var M;const{assert:A,debug:C,endAutoGroup:T,error:N,errorBoundary:I,event:x,purge:R,warn:q}=k,L=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},B=L,D=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>L(t))),F=D("Method"),W=D("Method","replaced with"),V=D("Option"),U=requestAnimationFrame,H="--ifr-start",Z="--ifr-end",J=[],_=new WeakSet,Q=e=>"object"==typeof e&&_.add(e);let G={},X=0;const Y=setInterval((()=>{if(J.length<10)return;if(G.hasTags&&G.len<25)return;J.sort();const e=Math.min(J.reduce(((e,t)=>e+t),0)/J.length,J[Math.floor(J.length/2)]),t=S(e);t>X&&(X=t,x("performanceObserver")),e<=4||(clearInterval(Y),L(`<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 ${G.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function K(e){e.getEntries().forEach((e=>{if(e.name===Z){const{duration:t}=performance.measure("--ifr-measure",H,Z);G=e.detail,J.push(t),J.length>100&&J.shift()}}))}function ee(){new PerformanceObserver(K).observe({entryTypes:["mark"]}),Q(document.documentElement),Q(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",ee):ee()),"undefined"!=typeof window&&function(){const e={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},v={height:()=>(q("Custom height calculation function not defined"),ct.auto()),width:()=>(q("Custom width calculation function not defined"),ut.auto())},O={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},M={},A="checkVisibility"in window,C="auto",N="[iFrameSizer]",D={max:1,min:1,bodyScroll:1,documentElementScroll:1},J="scroll";let _,Q,G,X,Y,K=!0,ee="",te=0,ne="",oe="",ie=!0,re=!1,ae=!0,le=!1,se=!1,ce=!1,ue=1,de=C,me="",fe=!0,pe="",he={},ye=!1,ge=0,be=!1,ve="",ze=$,we=[],$e="child",Se=null,je=!1,Ee="",Oe=[],ke=window.parent,Pe="*",Me=0,Ae=!1,Ce="",Te=1,Ne=J,Ie=window,xe=()=>{q("onMessage function not defined")},Re=()=>{},qe=null,Le=null;function Be(){var e,n,o;!function(){const e=e=>"true"===e,t=pe.slice(13).split(":");ve=t[0],te=void 0===t[1]?te:Number(t[1]),re=void 0===t[2]?re:e(t[2]),ye=void 0===t[3]?ye:e(t[3]),K=void 0===t[6]?K:e(t[6]),ne=t[7],de=void 0===t[8]?de:t[8],ee=t[9],oe=t[10],Me=void 0===t[11]?Me:Number(t[11]),he.enable=void 0!==t[12]&&e(t[12]),$e=void 0===t[13]?$e:t[13],Ne=void 0===t[14]?Ne:t[14],be=void 0===t[15]?be:e(t[15]),_=void 0===t[16]?_:Number(t[16]),Q=void 0===t[17]?Q:Number(t[17]),ie=void 0===t[18]?ie:e(t[18]),t[19],Ce=t[20]||Ce,ge=void 0===t[21]?ge:Number(t[21])}(),e={id:ve,enabled:ye},k.label(`${e.id}`),E=e.enabled,function(){function e(e){xe=e?.onMessage||xe,Re=e?.onReady||Re,"number"==typeof e?.offset&&(V("offset","offsetSize"),ie&&(_=e?.offset),re&&(Q=e?.offset)),"number"==typeof e?.offsetSize&&(ie&&(_=e?.offsetSize),re&&(Q=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Ee=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(me=e.ignoreSelector),Pe=e?.targetOrigin||Pe,de=e?.heightCalculationMethod||de,Ne=e?.widthCalculationMethod||Ne}function n(e,t){return"function"==typeof e&&(v[t]=e,e="custom"),e}if(1===ge)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(e(o),de=n(de,"height"),Ne=n(Ne,"width"),P(`Set TargetOrigin for parent: %c${Pe}`,t))}(),_e(),function(){try{je=1===ge||"iframeParentListener"in window.parent}catch(e){}}(),ge<0?B(`${z(ge+2)}${z(2)}`):Ce.codePointAt(0)>4||ge<2&&B(z(3)),Ce&&""!==Ce&&"false"!==Ce?Ce!==a&&L(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ce} - Child page: ${a}.\n`):L("<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"),Xe(),Ye(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(s,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&L("<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&&L("<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"),We(),1!==ge&&(Ie.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===K?(K=!0,ht("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===K&&(K=!1),bt(0,0,"autoResize",JSON.stringify(K)),K),close(){bt(0,0,"close")},getId:()=>ve,getOrigin:()=>(F("getOrigin()","getParentOrigin()"),G),getParentOrigin:()=>G,getPageInfo(e){if("function"==typeof e)return qe=e,bt(0,0,"pageInfo"),void W("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");qe=null,bt(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return Le=e,bt(0,0,"parentInfo"),()=>{Le=null,bt(0,0,"parentInfoStop")}},getParentProperties(e){F("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){he.findTarget(e)},reset(){gt()},setOffsetSize(e){_=e,Q=e,ht(p,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){bt(t,e,"scrollBy")},scrollTo(e,t){bt(t,e,"scrollTo")},scrollToOffset(e,t){bt(t,e,"scrollToOffset")},sendMessage(e,t){bt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){de=e,Xe()},setWidthCalculationMethod(e){Ne=e,Ye()},setTargetOrigin(e){Pe=e},resize(e,t){ht("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){F("size()","resize()"),this.resize(e,t)}}),Ie.parentIFrame=Ie.parentIframe),function(){function e(e){bt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){b(window.document,t,e)}!0===be&&(t("mouseenter"),t("mouseleave"))}(),he=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,l)+parseInt(o.x,l),y:parseInt(n.top,l)+parseInt(o.y,l)}}function n(e){function n(e){const n=t(e);bt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?bt(0,0,"inPageLink",`#${o}`):n(r)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&b(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function r(){b(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){i(),r(),a()}return he.enable&&(1===ge?L("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s()),{findTarget:n}}(),void 0===ne&&(ne=`${te}px`),Ze("margin",(n="margin",(o=ne).includes("-")&&(q(`Negative CSS value ignored for ${n}`),o=""),o)),Ze("background",ee),Ze("padding",oe),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){Qe({method:e,eventType:"After Print",eventName:"afterprint"}),Qe({method:e,eventType:"Before Print",eventName:"beforeprint"}),Qe({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const i=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)}},r=16,a=2,l=200;let s=1;function c(e){_e(),Ve(e),e.forEach(tt),e.clear()}function u(){x("mutationObserver");const d=performance.now(),m=d-o;if(m>r*s+++a&&m<l)return setTimeout(u,r*s),void(o=d);s=1,t.forEach(i),t.length=0,e.size>0&&c(e),We(),De(),n=!1,ht(g,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function m(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}m()}(),Se=new ResizeObserver(Ke),Se.observe(document.body),et.add(document.body),tt(document.body),ie!==re&&(ze=(e=>{const t=e.side||d,n=e.onChange||$,o=(e,n)=>0===e||e>n[t],i={root:e.root,rootMargin:"0px",threshold:1},r=(e=!1)=>n(e),a=(e,t)=>e.toggleAttribute(c,t),l=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:l}=i,s=e[t],c=!((n=l).hidden||null===n.offsetParent||"none"===n.style.display)&&o(s,r);a(l,c)}var n;U(r)}),i),s=new WeakSet;return function(){const e=new window.MutationObserver((()=>{P("Detected changes in element attributes"),r(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[u],subtree:!0};e.observe(t,n)}(),function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}})({onChange:Fe,root:document.documentElement,side:ie?d:m})),Ve(it(document)()),queueMicrotask(Re),ht("init","Init message from host page",void 0,void 0,a),document.title&&""!==document.title&&bt(0,0,"title",document.title)}function De(){we=document.querySelectorAll(`[${c}]:not([${u}]):not([${u}] *)`),se=we.length>0}function Fe(e){De(),(se||e)&&ht(y,"Overflow updated")}function We(){Oe=document.querySelectorAll(`[${s}]`),ce=Oe.length>0}function Ve(e){ce||ze(e)}let Ue=0;function He(){const e=document.querySelectorAll(`*[${u}]`);le=e.length>0,le&&e.length!==Ue&&(function(e){const t=1===e.length?"":"s";q(`%c[${u}]%c found on %c${e.length}%c element${t}`,i,r,i,r)}(e),Ue=e.length)}function Ze(e,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(e,n),P(`Set body ${e}: %c${n}`,t))}function Je(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function _e(){Je(0,s,Ee),Je(0,u,me)}function Qe(e){({add(t){function n(){ht(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 Ge(e,t,n,o){return t!==e&&(e in n||(q(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in O&&L(`<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 remove this option.`)),e}function Xe(){de=Ge(de,C,ct,"height")}function Ye(){Ne=Ge(Ne,J,ut,"width")}function Ke(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;ht(h,`Element resized <${function(e){switch(!0){case!j(e):return"";case j(e.id):return`${e.nodeName}#${e.id}`;case j(e.name):return`${e.nodeName} (${e.name}`;case j(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const et=new WeakSet;function tt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!et.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}const t=it(e)();for(const e of t){if(et.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}}function nt(t){performance.mark(H);const n=(o=t).charAt(0).toUpperCase()+o.slice(1);var o;let i=0,r=document.documentElement,a=ce?0:document.documentElement.getBoundingClientRect().bottom;const l=ce?Oe:se?we:it(document)();let s=l.length;for(const n of l)ce||!A||n.checkVisibility(e)?(i=n.getBoundingClientRect()[t]+parseFloat(getComputedStyle(n).getPropertyValue(`margin-${t}`)),i>a&&(a=i,r=n)):s-=1;return P(`${n} position calculated from:`,r),performance.mark(Z,{detail:{Side:n,len:s,hasTags:ce,logging:ye}}),a}const ot=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],it=e=>()=>{He();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 le&&t.push(`not([${u}])`,`not([${u}] *)`),e.querySelectorAll(t.join(":"))},rt={height:0,width:0},at={height:0,width:0},lt=[t,n,t];function st(e){function n(){return at[i]=r,rt[i]=s,r}const o=e===ct,i=o?"height":"width",r=e.boundingClientRect(),a=Math.ceil(r),l=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let u=0;switch(!0){case!e.enabled():return s;case ce:P("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!se&&0===at[i]&&0===rt[i]:P(`Initial page size values: ${c}`,...lt),u=n();break;case Ae&&r===at[i]&&s===rt[i]:P(`Size unchanged: ${c}`,...lt),u=Math.max(r,s);break;case 0===r:P(`Page is hidden: ${c}`,...lt),u=s;break;case!se&&r!==at[i]&&s<=rt[i]:P(`New <html> size: ${c} `,...lt),P(`Previous <html> size: %c${at[i]}px`,t),u=n();break;case!o:u=e.taggedElement();break;case!se&&r<at[i]:P(`<html> size decreased: ${c}`,...lt),u=n();break;case s===l||s===a:P(`<html> size equals page size: ${c}`,...lt),u=n();break;case r>s:P(`Page size < <html> size: ${c}`,...lt),u=n();break;case se:P("Found element overflowing <html> "),u=e.taggedElement();break;default:P(`Using <html> size: ${c}`,...lt),u=n()}return P(`Content ${i}: %c${u}px`,t),u+=function(e){const n=e.getOffset();return 0!==n&&P(`Page offsetSize: %c${n}px`,t),n}(e),u}const ct={enabled:()=>ie,getOffset:()=>_,auto:()=>st(ct),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,l)+parseInt(t.marginBottom,l)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ct.bodyOffset(),custom:()=>v.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...ot(ct)),min:()=>Math.min(...ot(ct)),grow:()=>ct.max(),lowestElement:()=>nt(d),taggedElement:()=>nt(d)},ut={enabled:()=>re,getOffset:()=>Q,auto:()=>st(ut),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>v.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...ot(ut)),min:()=>Math.min(...ot(ut)),rightMostElement:()=>nt(m),scroll:()=>Math.max(ut.bodyScroll(),ut.documentElementScroll()),taggedElement:()=>nt(m)},dt=(e,t)=>!(Math.abs(e-t)<=Me);function mt(e,t,n,o,i){const r=void 0===n?ct[de]():n,a=void 0===o?ut[Ne]():o;switch(!0){case ie&&dt(ue,r)||re&&dt(Te,a)||"init"===e:ue=r,Te=a;case e===p:bt(ue,Te,e,i);break;case!e!==f&&(ie&&de in D||re&&Ne in D):gt();break;case e===h:case e===y:case e===g:R();break;default:R(),P("No change in content size detected")}X=!1}let ft=!1;const pt=w((()=>B(z(4)))),ht=I(((e,t,n,o,i)=>{Y=performance.now(),x(e),K||e===f?document.hidden||(ft||(X=!0,mt(e,0,n,o,i),requestAnimationFrame((()=>{ft=!1}))),ft=!0):P("Resizing disabled")}));function yt(e){ue=ct[de](),Te=ut[Ne](),bt(ue,Te,e)}function gt(e){const t=de;de=C,Ae||(Ae=!0,requestAnimationFrame((()=>{Ae=!1}))),yt("reset"),de=t}const bt=I((function(e,n,i,r,a){ge<-1||(x(i),void 0!==a||(a=Pe),function(){const l=`${ve}:${e}:${n}:${i}${void 0===r?"":`:${r}`}`;if(je)try{window.parent.iframeParentListener(N+l)}catch(e){if(1!==ge)throw e;return void pt()}else ke.postMessage(N+l,a);X&&P(function(){const e=S(performance.now()-Y);return"init"===i?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),t),P("Sending message to host page via "+(je?"sameDomain":"postMessage")),P(`%c${l}`,o)}(),T())})),vt=I((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>bt(0,0,`${e}Stop`),i={init:function(){pe=e.data,ke=e.source,G=e.origin,Be(),ae=!1,setTimeout((()=>{fe=!1}),128)},reset(){fe||yt("resetPage")},resize(){ht(f,"Parent window requested size check")},moveToAnchor(){he.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();qe?setTimeout((()=>qe(n(e)))):o("pageInfo")},parentInfo(){const e=a();Le?setTimeout((()=>Le(t(n(e))))):o("parentInfo")},message(){const e=a();setTimeout((()=>xe(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function s(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||q(`Unexpected message (${e.data})`)}N===`${e.data}`.slice(0,13)&&(x(r()),!1!==ae?l()&&i.init():s())}));function zt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?q("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>vt({data:e,sameDomain:!0}))),b(window,"message",vt),b(window,"readystatechange",zt),zt())}();
|
|
20
|
+
import e,{HIGHLIGHT as t,FOREGROUND as n,ITALIC as o,BOLD as i,NORMAL as r}from"auto-console-group";const a="5.4.3",l=10,s="data-iframe-size",c="data-iframe-overflowed",u="data-iframe-ignore",d="bottom",m="right",f="resizeParent",p="setOffsetSize",h="resizeObserver",y="overflowObserver",g="mutationObserver",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.replaceAll(/[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),j=e=>""!=`${e}`&&void 0!==e;const E=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${O(t)}`)};let k=!0;var M;const P=(M=e,M?.__esModule?M.default:M)({label:"iframeResizer(child)"});const I=(T="info",(...e)=>!k||P[T](...e));var T;const{assert:A,debug:C,endAutoGroup:x,error:N,errorBoundary:R,event:q,purge:B,warn:L}=P,W=e=>{return P.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},D=W,F=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>W(t))),V=F("Method"),H=F("Method","replaced with"),U=F("Option"),Z="--ifr-start",J="--ifr-end",_=[],Q=new WeakSet,G=e=>"object"==typeof e&&Q.add(e);let X={},Y=0;const K=setInterval((()=>{if(_.length<10)return;if(X.hasTags&&X.len<25)return;_.sort();const e=Math.min(_.reduce(((e,t)=>e+t),0)/_.length,_[Math.floor(_.length/2)]),t=S(e);t>Y&&(Y=t,q("performanceObserver")),e<=4||(clearInterval(K),W(`<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 ${X.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function ee(e){e.getEntries().forEach((e=>{if(e.name===J){const{duration:t}=performance.measure("--ifr-measure",Z,J);X=e.detail,_.push(t),_.length>100&&_.shift()}}))}function te(){new PerformanceObserver(ee).observe({entryTypes:["mark"]}),G(document.documentElement),G(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",te):te()),"undefined"!=typeof window&&function(){const e={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},v={height:()=>(L("Custom height calculation function not defined"),ut.auto()),width:()=>(L("Custom width calculation function not defined"),dt.auto())},M={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},T={},A="checkVisibility"in window,C="auto",N="[iFrameSizer]",F={max:1,min:1,bodyScroll:1,documentElementScroll:1},_="scroll";let Q,G,X,Y,K,ee=!0,te="",ne=0,oe="",ie="",re=!0,ae=!1,le=!0,se=!1,ce=!1,ue=!1,de=1,me=C,fe="",pe=!0,he="",ye={},ge=!1,be=0,ve=!1,ze="",we=$,$e=[],Se="child",Oe=null,je=!1,Ee="",ke=[],Me=window.parent,Pe="*",Ie=0,Te=!1,Ae="",Ce=1,xe=_,Ne=window,Re=()=>{L("onMessage function not defined")},qe=()=>{},Be=null,Le=null;function We(){var e,n,o;!function(){const e=e=>"true"===e,t=he.slice(13).split(":");ze=t[0],ne=void 0===t[1]?ne:Number(t[1]),ae=void 0===t[2]?ae:e(t[2]),ge=void 0===t[3]?ge:e(t[3]),ee=void 0===t[6]?ee:e(t[6]),oe=t[7],me=void 0===t[8]?me:t[8],te=t[9],ie=t[10],Ie=void 0===t[11]?Ie:Number(t[11]),ye.enable=void 0!==t[12]&&e(t[12]),Se=void 0===t[13]?Se:t[13],xe=void 0===t[14]?xe:t[14],ve=void 0===t[15]?ve:e(t[15]),Q=void 0===t[16]?Q:Number(t[16]),G=void 0===t[17]?G:Number(t[17]),re=void 0===t[18]?re:e(t[18]),t[19],Ae=t[20]||Ae,be=void 0===t[21]?be:Number(t[21])}(),e={id:ze,enabled:ge},P.label(`${e.id}`),k=e.enabled,function(){function e(e){Re=e?.onMessage||Re,qe=e?.onReady||qe,"number"==typeof e?.offset&&(U("offset","offsetSize"),re&&(Q=e?.offset),ae&&(G=e?.offset)),"number"==typeof e?.offsetSize&&(re&&(Q=e?.offsetSize),ae&&(G=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(Ee=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(fe=e.ignoreSelector),Pe=e?.targetOrigin||Pe,me=e?.heightCalculationMethod||me,xe=e?.widthCalculationMethod||xe}function n(e,t){return"function"==typeof e&&(v[t]=e,e="custom"),e}if(1===be)return;const o=window.iframeResizer||window.iFrameResizer;"object"==typeof o&&(e(o),me=n(me,"height"),xe=n(xe,"width"),I(`Set TargetOrigin for parent: %c${Pe}`,t))}(),Qe(),function(){try{je=1===be||"iframeParentListener"in window.parent}catch(e){}}(),be<0?D(`${z(be+2)}${z(2)}`):Ae.codePointAt(0)>4||be<2&&D(z(3)),Ae&&""!==Ae&&"false"!==Ae?Ae!==a&&W(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ae} - Child page: ${a}.\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"),Ye(),Ke(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(s,!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"),Ve(),1!==be&&(Ne.parentIframe=Object.freeze({autoResize:e=>(E(e,"bool","parentIframe.autoResize(enable) enable"),!0===e&&!1===ee?(ee=!0,yt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===ee&&(ee=!1),vt(0,0,"autoResize",JSON.stringify(ee)),ee),close(){vt(0,0,"close")},getId:()=>ze,getOrigin:()=>(V("getOrigin()","getParentOrigin()"),X),getParentOrigin:()=>X,getPageInfo(e){if("function"==typeof e)return Be=e,vt(0,0,"pageInfo"),void H("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Be=null,vt(0,0,"pageInfoStop")},getParentProps:e=>(E(e,"function","parentIframe.getParentProps(callback) callback"),Le=e,vt(0,0,"parentInfo"),()=>{Le=null,vt(0,0,"parentInfoStop")}),getParentProperties(e){V("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){E(e,"string","parentIframe.moveToAnchor(anchor) anchor"),ye.findTarget(e)},reset(){bt()},setOffsetSize(e){E(e,"number","parentIframe.setOffsetSize(offset) offset"),Q=e,G=e,yt(p,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){E(e,"number","parentIframe.scrollBy(x, y) x"),E(t,"number","parentIframe.scrollBy(x, y) y"),vt(t,e,"scrollBy")},scrollTo(e,t){E(e,"number","parentIframe.scrollTo(x, y) x"),E(t,"number","parentIframe.scrollTo(x, y) y"),vt(t,e,"scrollTo")},scrollToOffset(e,t){E(e,"number","parentIframe.scrollToOffset(x, y) x"),E(t,"number","parentIframe.scrollToOffset(x, y) y"),vt(t,e,"scrollToOffset")},sendMessage(e,t){t&&E(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),vt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){me=e,Ye()},setWidthCalculationMethod(e){xe=e,Ke()},setTargetOrigin(e){E(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Pe=e},resize(e,t){e&&E(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&E(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),yt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){V("size()","resize()"),this.resize(e,t)}}),Ne.parentIFrame=Ne.parentIframe),function(){function e(e){vt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){b(window.document,t,e)}!0===ve&&(t("mouseenter"),t("mouseleave"))}(),ye=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,l)+parseInt(o.x,l),y:parseInt(n.top,l)+parseInt(o.y,l)}}function n(e){function n(e){const n=t(e);vt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?vt(0,0,"inPageLink",`#${o}`):n(r)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&b(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function r(){b(window,"hashchange",o)}function a(){setTimeout(o,128)}function s(){i(),r(),a()}return ye.enable&&(1===be?W("In page linking requires a Professional or Business license. Please see <u>https://iframe-resizer.com/pricing</> for more details."):s()),{findTarget:n}}(),void 0===oe&&(oe=`${ne}px`),Je("margin",(n="margin",(o=oe).includes("-")&&(L(`Negative CSS value ignored for ${n}`),o=""),o)),Je("background",te),Je("padding",ie),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){Ge({method:e,eventType:"After Print",eventName:"afterprint"}),Ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const i=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)}},r=16,a=2,l=200;let s=1;function c(e){Qe(),He(e),e.forEach(nt),e.clear()}function u(){q("mutationObserver");const d=performance.now(),m=d-o;if(m>r*s+++a&&m<l)return setTimeout(u,r*s),void(o=d);s=1,t.forEach(i),t.length=0,e.size>0&&c(e),Ve(),De(),n=!1,yt(g,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function m(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}m()}(),Oe=new ResizeObserver(et),Oe.observe(document.body),tt.add(document.body),nt(document.body),re!==ae&&(we=(e=>{const t=e.side||d,n=e.onChange||$,o=(e,n)=>0===e||e>n[t],i={root:e.root,rootMargin:"0px",threshold:1},r=window.requestAnimationFrame,a=(e=!1)=>n(e),l=(e,t)=>e.toggleAttribute(c,t),s=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:a}=i,s=e[t],c=!((n=a).hidden||null===n.offsetParent||"none"===n.style.display)&&o(s,r);l(a,c)}var n;r(a)}),i),m=new WeakSet;return function(){const e=new window.MutationObserver((()=>{I("Detected changes in element attributes"),a(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[u],subtree:!0};e.observe(t,n)}(),function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||m.has(t)||(s.observe(t),m.add(t))}})({onChange:Fe,root:document.documentElement,side:re?d:m})),He(rt(document)()),queueMicrotask(qe),yt("init","Init message from host page",void 0,void 0,a),document.title&&""!==document.title&&vt(0,0,"title",document.title)}function De(){$e=document.querySelectorAll(`[${c}]:not([${u}]):not([${u}] *)`),ce=$e.length>0}function Fe(e){De(),(ce||e)&&yt(y,"Overflow updated")}function Ve(){ke=document.querySelectorAll(`[${s}]`),ue=ke.length>0}function He(e){ue||we(e)}let Ue=0;function Ze(){const e=document.querySelectorAll(`*[${u}]`);se=e.length>0,se&&e.length!==Ue&&(function(e){const t=1===e.length?"":"s";L(`%c[${u}]%c found on %c${e.length}%c element${t}`,i,r,i,r)}(e),Ue=e.length)}function Je(e,n){void 0!==n&&""!==n&&"null"!==n&&(document.body.style.setProperty(e,n),I(`Set body ${e}: %c${n}`,t))}function _e(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Qe(){_e(0,s,Ee),_e(0,u,fe)}function Ge(e){({add(t){function n(){yt(e.eventName,e.eventType)}T[t]=n,b(window,t,n,{passive:!0})},remove(e){const t=T[e];var n,o;delete T[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Xe(e,t,n,o){return t!==e&&(e in n||(L(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in M&&W(`<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 remove this option.`)),e}function Ye(){me=Xe(me,C,ut,"height")}function Ke(){xe=Xe(xe,_,dt,"width")}function et(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;yt(h,`Element resized <${function(e){switch(!0){case!j(e):return"";case j(e.id):return`${e.nodeName}#${e.id}`;case j(e.name):return`${e.nodeName} (${e.name}`;case j(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const tt=new WeakSet;function nt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!tt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Oe.observe(e),tt.add(e))}const t=rt(e)();for(const e of t){if(tt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Oe.observe(e),tt.add(e))}}function ot(t){performance.mark(Z);const n=O(t);let o=0,i=document.documentElement,r=ue?0:document.documentElement.getBoundingClientRect().bottom;const a=ue?ke:ce?$e:rt(document)();let l=a.length;for(const n of a)ue||!A||n.checkVisibility(e)?(o=n.getBoundingClientRect()[t]+parseFloat(getComputedStyle(n).getPropertyValue(`margin-${t}`)),o>r&&(r=o,i=n)):l-=1;return I(`${n} position calculated from:`,i),performance.mark(J,{detail:{Side:n,len:l,hasTags:ue,logging:ge}}),r}const it=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],rt=e=>()=>{Ze();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 se&&t.push(`not([${u}])`,`not([${u}] *)`),e.querySelectorAll(t.join(":"))},at={height:0,width:0},lt={height:0,width:0},st=[t,n,t];function ct(e){function n(){return lt[i]=r,at[i]=s,r}const o=e===ut,i=o?"height":"width",r=e.boundingClientRect(),a=Math.ceil(r),l=Math.floor(r),s=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),c=`HTML: %c${r}px %cPage: %c${s}px`;let u=0;switch(!0){case!e.enabled():return s;case ue:I("Found element with data-iframe-size attribute"),u=e.taggedElement();break;case!ce&&0===lt[i]&&0===at[i]:I(`Initial page size values: ${c}`,...st),u=n();break;case Te&&r===lt[i]&&s===at[i]:I(`Size unchanged: ${c}`,...st),u=Math.max(r,s);break;case 0===r:I(`Page is hidden: ${c}`,...st),u=s;break;case!ce&&r!==lt[i]&&s<=at[i]:I(`New <html> size: ${c} `,...st),I(`Previous <html> size: %c${lt[i]}px`,t),u=n();break;case!o:u=e.taggedElement();break;case!ce&&r<lt[i]:I(`<html> size decreased: ${c}`,...st),u=n();break;case s===l||s===a:I(`<html> size equals page size: ${c}`,...st),u=n();break;case r>s:I(`Page size < <html> size: ${c}`,...st),u=n();break;case ce:I("Found element overflowing <html> "),u=e.taggedElement();break;default:I(`Using <html> size: ${c}`,...st),u=n()}return I(`Content ${i}: %c${u}px`,t),u+=function(e){const n=e.getOffset();return 0!==n&&I(`Page offsetSize: %c${n}px`,t),n}(e),u}const ut={enabled:()=>re,getOffset:()=>Q,auto:()=>ct(ut),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,l)+parseInt(t.marginBottom,l)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ut.bodyOffset(),custom:()=>v.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...it(ut)),min:()=>Math.min(...it(ut)),grow:()=>ut.max(),lowestElement:()=>ot(d),taggedElement:()=>ot(d)},dt={enabled:()=>ae,getOffset:()=>G,auto:()=>ct(dt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>v.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...it(dt)),min:()=>Math.min(...it(dt)),rightMostElement:()=>ot(m),scroll:()=>Math.max(dt.bodyScroll(),dt.documentElementScroll()),taggedElement:()=>ot(m)},mt=(e,t)=>!(Math.abs(e-t)<=Ie);function ft(e,t,n,o,i){const r=void 0===n?ut[me]():n,a=void 0===o?dt[xe]():o;switch(!0){case re&&mt(de,r)||ae&&mt(Ce,a)||"init"===e:de=r,Ce=a;case e===p:vt(de,Ce,e,i);break;case!e!==f&&(re&&me in F||ae&&xe in F):bt();break;case e===h:case e===y:case e===g:B();break;default:B(),I("No change in content size detected")}Y=!1}let pt=!1;const ht=w((()=>D(z(4)))),yt=R(((e,t,n,o,i)=>{K=performance.now(),q(e),ee||e===f?document.hidden||(pt||(Y=!0,ft(e,0,n,o,i),requestAnimationFrame((()=>{pt=!1}))),pt=!0):I("Resizing disabled")}));function gt(e){de=ut[me](),Ce=dt[xe](),vt(de,Ce,e)}function bt(e){const t=me;me=C,Te||(Te=!0,requestAnimationFrame((()=>{Te=!1}))),gt("reset"),me=t}const vt=R((function(e,n,i,r,a){be<-1||(q(i),void 0!==a||(a=Pe),function(){const l=`${ze}:${e}:${n}:${i}${void 0===r?"":`:${r}`}`;if(je)try{window.parent.iframeParentListener(N+l)}catch(e){if(1!==be)throw e;return void ht()}else Me.postMessage(N+l,a);Y&&I(function(){const e=S(performance.now()-K);return"init"===i?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),t),I("Sending message to host page via "+(je?"sameDomain":"postMessage")),I(`%c${l}`,o)}(),x())})),zt=R((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>vt(0,0,`${e}Stop`),i={init:function(){he=e.data,Me=e.source,X=e.origin,We(),le=!1,setTimeout((()=>{pe=!1}),128)},reset(){pe||gt("resetPage")},resize(){yt(f,"Parent window requested size check")},moveToAnchor(){ye.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();Be?setTimeout((()=>Be(n(e)))):o("pageInfo")},parentInfo(){const e=a();Le?setTimeout((()=>Le(t(n(e))))):o("parentInfo")},message(){const e=a();setTimeout((()=>Re(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function s(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||L(`Unexpected message (${e.data})`)}N===`${e.data}`.slice(0,13)&&(q(r()),!1!==le?l()&&i.init():s())}));function wt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?L("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>zt({data:e,sameDomain:!0}))),b(window,"message",zt),b(window,"readystatechange",wt),wt())}();
|
package/index.umd.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.3 (umd) - 2025-04-02
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,i="default",r={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:l,keys:s}=Object,c=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>l(s(e).map(t));const m=()=>!(typeof window>"u")&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),f=m()?"color: #A9C7FB;":"color: #135CD2;",p=m()?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.2",y=10,g="data-iframe-size",v="data-iframe-overflowed",b="data-iframe-ignore",z="bottom",w="right",$="resizeParent",S="setOffsetSize",E="resizeObserver",j="overflowObserver",k="mutationObserver",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 P=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(M[e]),C=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},A=e=>e,T=e=>Math.round(1e3*e)/1e3,N=e=>""!=`${e}`&&void 0!==e;let I=!0;var x;const R=(x=function(n={}){const l={},s={},m=[],f={...r,...n};let p;function h(){m.length=0}function y(){delete f.event,h()}const g=()=>!m.some((([e])=>"error"===e||"warn"===e))&&!!f.collapsed;function v(){if(0!==m.length){console[g()?"groupCollapsed":"group"](`%c${f.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(f)} %c${f.showTime?p:""}`,e,t,o);for(const[e,...t]of m)console[e](...t);console.groupEnd(),y()}else y()}function b(){p=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(v)))}function z(e,...t){0===m.length&&b(),m.push([e,...t])}function w(e=i,...t){z("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...d(f,u(f)),...d(console,(e=>[e,(...t)=>z(e,...t)])),...d(a,c),count:function(e=i){s[e]?s[e]+=1:s[e]=1,z("log",`${e}: ${s[e]}`)},countReset:function(e=i){delete s[e]},endAutoGroup:v,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){z("error",e)}return n},purge:h,time:function(e=i){l[e]=performance.now()},timeEnd:function(e=i){w(e),delete l[e]},timeLog:w}},x?.__esModule?x.default:x)({label:"iframeResizer(child)"});const q=(L="info",(...e)=>!I||R[L](...e));var L;const{assert:B,debug:F,endAutoGroup:D,error:W,errorBoundary:V,event:H,purge:U,warn:Z}=R,J=e=>{return R.warn((t=A,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,Q=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>J(t))),G=Q("Method"),X=Q("Method","replaced with"),Y=Q("Option"),K=requestAnimationFrame,ee="--ifr-start",te="--ifr-end",ne=[],oe=new WeakSet,ie=e=>"object"==typeof e&&oe.add(e);let re={},ae=0;const le=setInterval((()=>{if(ne.length<10)return;if(re.hasTags&&re.len<25)return;ne.sort();const e=Math.min(ne.reduce(((e,t)=>e+t),0)/ne.length,ne[Math.floor(ne.length/2)]),t=T(e);t>ae&&(ae=t,H("performanceObserver")),e<=4||(clearInterval(le),J(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${T(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===te){const{duration:t}=performance.measure("--ifr-measure",ee,te);re=e.detail,ne.push(t),ne.length>100&&ne.shift()}}))}function ce(){new PerformanceObserver(se).observe({entryTypes:["mark"]}),ie(document.documentElement),ie(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",ce):ce()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},i={height:()=>(Z("Custom height calculation function not defined"),ct.auto()),width:()=>(Z("Custom width calculation function not defined"),ut.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},l="checkVisibility"in window,s="auto",c="[iFrameSizer]",u={max:1,min:1,bodyScroll:1,documentElementScroll:1},d="scroll";let m,M,x,L,B,F=!0,W="",Q=0,ne="",oe="",ie=!0,re=!1,ae=!0,le=!1,se=!1,ce=!1,ue=1,de=s,me="",fe=!0,pe="",he={},ye=!1,ge=0,ve=!1,be="",ze=A,we=[],$e="child",Se=null,Ee=!1,je="",ke=[],Oe=window.parent,Me="*",Pe=0,Ce=!1,Ae="",Te=1,Ne=d,Ie=window,xe=()=>{Z("onMessage function not defined")},Re=()=>{},qe=null,Le=null;function Be(){var e,t,n;!function(){const e=e=>"true"===e,t=pe.slice(13).split(":");be=t[0],Q=void 0===t[1]?Q:Number(t[1]),re=void 0===t[2]?re:e(t[2]),ye=void 0===t[3]?ye:e(t[3]),F=void 0===t[6]?F:e(t[6]),ne=t[7],de=void 0===t[8]?de:t[8],W=t[9],oe=t[10],Pe=void 0===t[11]?Pe:Number(t[11]),he.enable=void 0!==t[12]&&e(t[12]),$e=void 0===t[13]?$e:t[13],Ne=void 0===t[14]?Ne:t[14],ve=void 0===t[15]?ve:e(t[15]),m=void 0===t[16]?m:Number(t[16]),M=void 0===t[17]?M:Number(t[17]),ie=void 0===t[18]?ie:e(t[18]),t[19],Ae=t[20]||Ae,ge=void 0===t[21]?ge:Number(t[21])}(),e={id:be,enabled:ye},R.label(`${e.id}`),I=e.enabled,function(){function e(e){xe=e?.onMessage||xe,Re=e?.onReady||Re,"number"==typeof e?.offset&&(Y("offset","offsetSize"),ie&&(m=e?.offset),re&&(M=e?.offset)),"number"==typeof e?.offsetSize&&(ie&&(m=e?.offsetSize),re&&(M=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(je=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(me=e.ignoreSelector),Me=e?.targetOrigin||Me,de=e?.heightCalculationMethod||de,Ne=e?.widthCalculationMethod||Ne}function t(e,t){return"function"==typeof e&&(i[t]=e,e="custom"),e}if(1===ge)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),de=t(de,"height"),Ne=t(Ne,"width"),q(`Set TargetOrigin for parent: %c${Me}`,f))}(),_e(),function(){try{Ee=1===ge||"iframeParentListener"in window.parent}catch(e){}}(),ge<0?_(`${P(ge+2)}${P(2)}`):Ae.codePointAt(0)>4||ge<2&&_(P(3)),Ae&&""!==Ae&&"false"!==Ae?Ae!==h&&J(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ae} - Child page: ${h}.\n`):J("<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"),Xe(),Ye(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&J("<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&&J("<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"),We(),1!==ge&&(Ie.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===F?(F=!0,ht("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===F&&(F=!1),vt(0,0,"autoResize",JSON.stringify(F)),F),close(){vt(0,0,"close")},getId:()=>be,getOrigin:()=>(G("getOrigin()","getParentOrigin()"),x),getParentOrigin:()=>x,getPageInfo(e){if("function"==typeof e)return qe=e,vt(0,0,"pageInfo"),void X("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");qe=null,vt(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return Le=e,vt(0,0,"parentInfo"),()=>{Le=null,vt(0,0,"parentInfoStop")}},getParentProperties(e){G("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){he.findTarget(e)},reset(){gt()},setOffsetSize(e){m=e,M=e,ht(S,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){vt(t,e,"scrollBy")},scrollTo(e,t){vt(t,e,"scrollTo")},scrollToOffset(e,t){vt(t,e,"scrollToOffset")},sendMessage(e,t){vt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){de=e,Xe()},setWidthCalculationMethod(e){Ne=e,Ye()},setTargetOrigin(e){Me=e},resize(e,t){ht("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){G("size()","resize()"),this.resize(e,t)}}),Ie.parentIFrame=Ie.parentIframe),function(){function e(e){vt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){O(window.document,t,e)}!0===ve&&(t("mouseenter"),t("mouseleave"))}(),he=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,y)+parseInt(o.x,y),y:parseInt(n.top,y)+parseInt(o.y,y)}}function n(e){function n(e){const n=t(e);vt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?vt(0,0,"inPageLink",`#${o}`):n(r)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&O(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function r(){O(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){i(),r(),a()}return he.enable&&(1===ge?J("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===ne&&(ne=`${Q}px`),Ze("margin",(t="margin",(n=ne).includes("-")&&(Z(`Negative CSS value ignored for ${t}`),n=""),n)),Ze("background",W),Ze("padding",oe),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){Qe({method:e,eventType:"After Print",eventName:"afterprint"}),Qe({method:e,eventType:"Before Print",eventName:"beforeprint"}),Qe({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const i=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)}},r=16,a=2,l=200;let s=1;function c(e){_e(),Ve(e),e.forEach(tt),e.clear()}function u(){H("mutationObserver");const d=performance.now(),m=d-o;if(m>r*s+++a&&m<l)return setTimeout(u,r*s),void(o=d);s=1,t.forEach(i),t.length=0,e.size>0&&c(e),We(),Fe(),n=!1,ht(k,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function m(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}m()}(),Se=new ResizeObserver(Ke),Se.observe(document.body),et.add(document.body),tt(document.body),ie!==re&&(ze=(e=>{const t=e.side||z,n=e.onChange||A,o=(e,n)=>0===e||e>n[t],i={root:e.root,rootMargin:"0px",threshold:1},r=(e=!1)=>n(e),a=(e,t)=>e.toggleAttribute(v,t),l=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:l}=i,s=e[t],c=!((n=l).hidden||null===n.offsetParent||"none"===n.style.display)&&o(s,r);a(l,c)}var n;K(r)}),i),s=new WeakSet;return function(){const e=new window.MutationObserver((()=>{q("Detected changes in element attributes"),r(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[b],subtree:!0};e.observe(t,n)}(),function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}})({onChange:De,root:document.documentElement,side:ie?z:w})),Ve(it(document)()),queueMicrotask(Re),ht("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&vt(0,0,"title",document.title)}function Fe(){we=document.querySelectorAll(`[${v}]:not([${b}]):not([${b}] *)`),se=we.length>0}function De(e){Fe(),(se||e)&&ht(j,"Overflow updated")}function We(){ke=document.querySelectorAll(`[${g}]`),ce=ke.length>0}function Ve(e){ce||ze(e)}let He=0;function Ue(){const n=document.querySelectorAll(`*[${b}]`);le=n.length>0,le&&n.length!==He&&(function(n){const o=1===n.length?"":"s";Z(`%c[${b}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),He=n.length)}function Ze(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),q(`Set body ${e}: %c${t}`,f))}function Je(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function _e(){Je(0,g,je),Je(0,b,me)}function Qe(e){({add(t){function n(){ht(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)}function Ge(e,t,n,o){return t!==e&&(e in n||(Z(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r&&J(`<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 remove this option.`)),e}function Xe(){de=Ge(de,s,ct,"height")}function Ye(){Ne=Ge(Ne,d,ut,"width")}function Ke(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;ht(E,`Element resized <${function(e){switch(!0){case!N(e):return"";case N(e.id):return`${e.nodeName}#${e.id}`;case N(e.name):return`${e.nodeName} (${e.name}`;case N(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const et=new WeakSet;function tt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!et.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}const t=it(e)();for(const e of t){if(et.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Se.observe(e),et.add(e))}}function nt(e){performance.mark(ee);const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let i=0,r=document.documentElement,a=ce?0:document.documentElement.getBoundingClientRect().bottom;const s=ce?ke:se?we:it(document)();let c=s.length;for(const t of s)ce||!l||t.checkVisibility(o)?(i=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),i>a&&(a=i,r=t)):c-=1;return q(`${t} position calculated from:`,r),performance.mark(te,{detail:{Side:t,len:c,hasTags:ce,logging:ye}}),a}const ot=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],it=e=>()=>{Ue();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 le&&t.push(`not([${b}])`,`not([${b}] *)`),e.querySelectorAll(t.join(":"))},rt={height:0,width:0},at={height:0,width:0},lt=[f,p,f];function st(e){function t(){return at[o]=i,rt[o]=l,i}const n=e===ct,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: %c${i}px %cPage: %c${l}px`;let c=0;switch(!0){case!e.enabled():return l;case ce:q("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!se&&0===at[o]&&0===rt[o]:q(`Initial page size values: ${s}`,...lt),c=t();break;case Ce&&i===at[o]&&l===rt[o]:q(`Size unchanged: ${s}`,...lt),c=Math.max(i,l);break;case 0===i:q(`Page is hidden: ${s}`,...lt),c=l;break;case!se&&i!==at[o]&&l<=rt[o]:q(`New <html> size: ${s} `,...lt),q(`Previous <html> size: %c${at[o]}px`,f),c=t();break;case!n:c=e.taggedElement();break;case!se&&i<at[o]:q(`<html> size decreased: ${s}`,...lt),c=t();break;case l===a||l===r:q(`<html> size equals page size: ${s}`,...lt),c=t();break;case i>l:q(`Page size < <html> size: ${s}`,...lt),c=t();break;case se:q("Found element overflowing <html> "),c=e.taggedElement();break;default:q(`Using <html> size: ${s}`,...lt),c=t()}return q(`Content ${o}: %c${c}px`,f),c+=function(e){const t=e.getOffset();return 0!==t&&q(`Page offsetSize: %c${t}px`,f),t}(e),c}const ct={enabled:()=>ie,getOffset:()=>m,auto:()=>st(ct),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ct.bodyOffset(),custom:()=>i.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...ot(ct)),min:()=>Math.min(...ot(ct)),grow:()=>ct.max(),lowestElement:()=>nt(z),taggedElement:()=>nt(z)},ut={enabled:()=>re,getOffset:()=>M,auto:()=>st(ut),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>i.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...ot(ut)),min:()=>Math.min(...ot(ut)),rightMostElement:()=>nt(w),scroll:()=>Math.max(ut.bodyScroll(),ut.documentElementScroll()),taggedElement:()=>nt(w)},dt=(e,t)=>!(Math.abs(e-t)<=Pe);function mt(e,t,n,o,i){const r=void 0===n?ct[de]():n,a=void 0===o?ut[Ne]():o;switch(!0){case ie&&dt(ue,r)||re&&dt(Te,a)||"init"===e:ue=r,Te=a;case e===S:vt(ue,Te,e,i);break;case!e!==$&&(ie&&de in u||re&&Ne in u):gt();break;case e===E:case e===j:case e===k:U();break;default:U(),q("No change in content size detected")}L=!1}let ft=!1;const pt=C((()=>_(P(4)))),ht=V(((e,t,n,o,i)=>{B=performance.now(),H(e),F||e===$?document.hidden||(ft||(L=!0,mt(e,0,n,o,i),requestAnimationFrame((()=>{ft=!1}))),ft=!0):q("Resizing disabled")}));function yt(e){ue=ct[de](),Te=ut[Ne](),vt(ue,Te,e)}function gt(e){const t=de;de=s,Ce||(Ce=!0,requestAnimationFrame((()=>{Ce=!1}))),yt("reset"),de=t}const vt=V((function(e,t,o,i,r){ge<-1||(H(o),void 0!==r||(r=Me),function(){const a=`${be}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(Ee)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==ge)throw e;return void pt()}else Oe.postMessage(c+a,r);L&&q(function(){const e=T(performance.now()-B);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),f),q("Sending message to host page via "+(Ee?"sameDomain":"postMessage")),q(`%c${a}`,n)}(),D())})),bt=V((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>vt(0,0,`${e}Stop`),i={init:function(){pe=e.data,Oe=e.source,x=e.origin,Be(),ae=!1,setTimeout((()=>{fe=!1}),128)},reset(){fe||yt("resetPage")},resize(){ht($,"Parent window requested size check")},moveToAnchor(){he.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();qe?setTimeout((()=>qe(n(e)))):o("pageInfo")},parentInfo(){const e=a();Le?setTimeout((()=>Le(t(n(e))))):o("parentInfo")},message(){const e=a();setTimeout((()=>xe(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function s(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||Z(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(H(r()),!1!==ae?l()&&i.init():s())}));function zt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Z("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>bt({data:e,sameDomain:!0}))),O(window,"message",bt),O(window,"readystatechange",zt),zt())}()}));
|
|
20
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e="font-weight: normal;",t="font-weight: bold;",n="font-style: italic;",o=e+n,i="default",r={collapsed:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},a={profile:0,profileEnd:0,timeStamp:0,trace:0};const{fromEntries:l,keys:s}=Object,c=e=>[e,console[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>l(s(e).map(t));const m=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,f=m?"color: #A9C7FB;":"color: #135CD2;",p=m?"color: #E3E3E3;":"color: #1F1F1F;",h="5.4.3",y=10,g="data-iframe-size",b="data-iframe-overflowed",v="data-iframe-ignore",z="bottom",w="right",$="resizeParent",S="setOffsetSize",E="resizeObserver",O="overflowObserver",j="mutationObserver",k=(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 P=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(M[e]),T=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},A=e=>e,C=e=>Math.round(1e3*e)/1e3,I=e=>e.charAt(0).toUpperCase()+e.slice(1),x=e=>""!=`${e}`&&void 0!==e;const N=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${I(t)}`)};let R=!0;const q=(B=function(n={}){const l={},s={},m=[],f={...r,...n};let p;function h(){m.length=0}function y(){delete f.event,h()}const g=()=>!m.some((([e])=>"error"===e||"warn"===e))&&!!f.collapsed;function b(){if(0!==m.length){console[g()?"groupCollapsed":"group"](`%c${f.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(f)} %c${f.showTime?p:""}`,e,t,o);for(const[e,...t]of m)console[e](...t);console.groupEnd(),y()}else y()}function v(){p=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}(),queueMicrotask((()=>queueMicrotask(b)))}function z(e,...t){0===m.length&&v(),m.push([e,...t])}function w(e=i,...t){z("log",`${e}: ${performance.now()-l[e]} ms`,...t)}return{...d(f,u(f)),...d(console,(e=>[e,(...t)=>z(e,...t)])),...d(a,c),count:function(e=i){s[e]?s[e]+=1:s[e]=1,z("log",`${e}: ${s[e]}`)},countReset:function(e=i){delete s[e]},endAutoGroup:b,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e)}return n},purge:h,time:function(e=i){l[e]=performance.now()},timeEnd:function(e=i){w(e),delete l[e]},timeLog:w}},B?.__esModule?B.default:B);var B;const L=q({label:"iframeResizer(child)"});const F=(W="info",(...e)=>!R||L[W](...e));var W;const{assert:D,debug:H,endAutoGroup:V,error:U,errorBoundary:Z,event:J,purge:_,warn:Q}=L,G=e=>{return L.warn((t=A,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},X=G,Y=(e=>(t,n="renamed to")=>(o,i,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${i}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(((e,t)=>G(t))),K=Y("Method"),ee=Y("Method","replaced with"),te=Y("Option"),ne="--ifr-start",oe="--ifr-end",ie=[],re=new WeakSet,ae=e=>"object"==typeof e&&re.add(e);let le={},se=0;const ce=setInterval((()=>{if(ie.length<10)return;if(le.hasTags&&le.len<25)return;ie.sort();const e=Math.min(ie.reduce(((e,t)=>e+t),0)/ie.length,ie[Math.floor(ie.length/2)]),t=C(e);t>se&&(se=t,J("performanceObserver")),e<=4||(clearInterval(ce),G(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${C(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${le.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function ue(e){e.getEntries().forEach((e=>{if(e.name===oe){const{duration:t}=performance.measure("--ifr-measure",ne,oe);le=e.detail,ie.push(t),ie.length>100&&ie.shift()}}))}function de(){new PerformanceObserver(ue).observe({entryTypes:["mark"]}),ae(document.documentElement),ae(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",de):de()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},i={height:()=>(Q("Custom height calculation function not defined"),ut.auto()),width:()=>(Q("Custom width calculation function not defined"),dt.auto())},r={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},a={},l="checkVisibility"in window,s="auto",c="[iFrameSizer]",u={max:1,min:1,bodyScroll:1,documentElementScroll:1},d="scroll";let m,M,q,B,W,D=!0,H="",U=0,Y="",ie="",re=!0,ae=!1,le=!0,se=!1,ce=!1,ue=!1,de=1,me=s,fe="",pe=!0,he="",ye={},ge=!1,be=0,ve=!1,ze="",we=A,$e=[],Se="child",Ee=null,Oe=!1,je="",ke=[],Me=window.parent,Pe="*",Te=0,Ae=!1,Ce="",Ie=1,xe=d,Ne=window,Re=()=>{Q("onMessage function not defined")},qe=()=>{},Be=null,Le=null;function Fe(){var e,t,n;!function(){const e=e=>"true"===e,t=he.slice(13).split(":");ze=t[0],U=void 0===t[1]?U:Number(t[1]),ae=void 0===t[2]?ae:e(t[2]),ge=void 0===t[3]?ge:e(t[3]),D=void 0===t[6]?D:e(t[6]),Y=t[7],me=void 0===t[8]?me:t[8],H=t[9],ie=t[10],Te=void 0===t[11]?Te:Number(t[11]),ye.enable=void 0!==t[12]&&e(t[12]),Se=void 0===t[13]?Se:t[13],xe=void 0===t[14]?xe:t[14],ve=void 0===t[15]?ve:e(t[15]),m=void 0===t[16]?m:Number(t[16]),M=void 0===t[17]?M:Number(t[17]),re=void 0===t[18]?re:e(t[18]),t[19],Ce=t[20]||Ce,be=void 0===t[21]?be:Number(t[21])}(),e={id:ze,enabled:ge},L.label(`${e.id}`),R=e.enabled,function(){function e(e){Re=e?.onMessage||Re,qe=e?.onReady||qe,"number"==typeof e?.offset&&(te("offset","offsetSize"),re&&(m=e?.offset),ae&&(M=e?.offset)),"number"==typeof e?.offsetSize&&(re&&(m=e?.offsetSize),ae&&(M=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(je=e.sizeSelector),Object.prototype.hasOwnProperty.call(e,"ignoreSelector")&&(fe=e.ignoreSelector),Pe=e?.targetOrigin||Pe,me=e?.heightCalculationMethod||me,xe=e?.widthCalculationMethod||xe}function t(e,t){return"function"==typeof e&&(i[t]=e,e="custom"),e}if(1===be)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),me=t(me,"height"),xe=t(xe,"width"),F(`Set TargetOrigin for parent: %c${Pe}`,f))}(),Qe(),function(){try{Oe=1===be||"iframeParentListener"in window.parent}catch(e){}}(),be<0?X(`${P(be+2)}${P(2)}`):Ce.codePointAt(0)>4||be<2&&X(P(3)),Ce&&""!==Ce&&"false"!==Ce?Ce!==h&&G(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${Ce} - Child page: ${h}.\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"),Ye(),Ke(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&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"),He(),1!==be&&(Ne.parentIframe=Object.freeze({autoResize:e=>(N(e,"bool","parentIframe.autoResize(enable) enable"),!0===e&&!1===D?(D=!0,yt("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===D&&(D=!1),vt(0,0,"autoResize",JSON.stringify(D)),D),close(){vt(0,0,"close")},getId:()=>ze,getOrigin:()=>(K("getOrigin()","getParentOrigin()"),q),getParentOrigin:()=>q,getPageInfo(e){if("function"==typeof e)return Be=e,vt(0,0,"pageInfo"),void ee("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Be=null,vt(0,0,"pageInfoStop")},getParentProps:e=>(N(e,"function","parentIframe.getParentProps(callback) callback"),Le=e,vt(0,0,"parentInfo"),()=>{Le=null,vt(0,0,"parentInfoStop")}),getParentProperties(e){K("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){N(e,"string","parentIframe.moveToAnchor(anchor) anchor"),ye.findTarget(e)},reset(){bt()},setOffsetSize(e){N(e,"number","parentIframe.setOffsetSize(offset) offset"),m=e,M=e,yt(S,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){N(e,"number","parentIframe.scrollBy(x, y) x"),N(t,"number","parentIframe.scrollBy(x, y) y"),vt(t,e,"scrollBy")},scrollTo(e,t){N(e,"number","parentIframe.scrollTo(x, y) x"),N(t,"number","parentIframe.scrollTo(x, y) y"),vt(t,e,"scrollTo")},scrollToOffset(e,t){N(e,"number","parentIframe.scrollToOffset(x, y) x"),N(t,"number","parentIframe.scrollToOffset(x, y) y"),vt(t,e,"scrollToOffset")},sendMessage(e,t){t&&N(t,"string","parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),vt(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){me=e,Ye()},setWidthCalculationMethod(e){xe=e,Ke()},setTargetOrigin(e){N(e,"string","parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),Pe=e},resize(e,t){e&&N(e,"number","parentIframe.resize(customHeight, customWidth) customHeight"),t&&N(t,"number","parentIframe.resize(customHeight, customWidth) customWidth"),yt("parentIframe.resize()",`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){K("size()","resize()"),this.resize(e,t)}}),Ne.parentIFrame=Ne.parentIframe),function(){function e(e){vt(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){k(window.document,t,e)}!0===ve&&(t("mouseenter"),t("mouseleave"))}(),ye=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,y)+parseInt(o.x,y),y:parseInt(n.top,y)+parseInt(o.y,y)}}function n(e){function n(e){const n=t(e);vt(n.y,n.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?vt(0,0,"inPageLink",`#${o}`):n(r)}function o(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&n(t)}function i(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&k(e,"click",(t=>{t.preventDefault(),n(e.getAttribute("href"))}))}function r(){k(window,"hashchange",o)}function a(){setTimeout(o,128)}function l(){i(),r(),a()}return ye.enable&&(1===be?G("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===Y&&(Y=`${U}px`),Je("margin",(t="margin",(n=Y).includes("-")&&(Q(`Negative CSS value ignored for ${t}`),n=""),n)),Je("background",H),Je("padding",ie),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){Ge({method:e,eventType:"After Print",eventName:"afterprint"}),Ge({method:e,eventType:"Before Print",eventName:"beforeprint"}),Ge({method:e,eventType:"Ready State Change",eventName:"readystatechange"})}("add"),function(){const e=new Set,t=[];let n=!1,o=0;const i=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)}},r=16,a=2,l=200;let s=1;function c(e){Qe(),Ve(e),e.forEach(nt),e.clear()}function u(){J("mutationObserver");const d=performance.now(),m=d-o;if(m>r*s+++a&&m<l)return setTimeout(u,r*s),void(o=d);s=1,t.forEach(i),t.length=0,e.size>0&&c(e),He(),We(),n=!1,yt(j,"Mutation Observed")}function d(e){t.push(e),n||(o=performance.now(),n=!0,requestAnimationFrame(u))}function m(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}m()}(),Ee=new ResizeObserver(et),Ee.observe(document.body),tt.add(document.body),nt(document.body),re!==ae&&(we=(e=>{const t=e.side||z,n=e.onChange||A,o=(e,n)=>0===e||e>n[t],i={root:e.root,rootMargin:"0px",threshold:1},r=window.requestAnimationFrame,a=(e=!1)=>n(e),l=(e,t)=>e.toggleAttribute(b,t),s=new IntersectionObserver((function(e){for(const i of e){const{boundingClientRect:e,rootBounds:r,target:a}=i,s=e[t],c=!((n=a).hidden||null===n.offsetParent||"none"===n.style.display)&&o(s,r);l(a,c)}var n;r(a)}),i),c=new WeakSet;return function(){const e=new window.MutationObserver((()=>{F("Detected changes in element attributes"),a(!0)})),t=document.querySelector("body"),n={attributes:!0,attributeFilter:[v],subtree:!0};e.observe(t,n)}(),function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||c.has(t)||(s.observe(t),c.add(t))}})({onChange:De,root:document.documentElement,side:re?z:w})),Ve(rt(document)()),queueMicrotask(qe),yt("init","Init message from host page",void 0,void 0,h),document.title&&""!==document.title&&vt(0,0,"title",document.title)}function We(){$e=document.querySelectorAll(`[${b}]:not([${v}]):not([${v}] *)`),ce=$e.length>0}function De(e){We(),(ce||e)&&yt(O,"Overflow updated")}function He(){ke=document.querySelectorAll(`[${g}]`),ue=ke.length>0}function Ve(e){ue||we(e)}let Ue=0;function Ze(){const n=document.querySelectorAll(`*[${v}]`);se=n.length>0,se&&n.length!==Ue&&(function(n){const o=1===n.length?"":"s";Q(`%c[${v}]%c found on %c${n.length}%c element${o}`,t,e,t,e)}(n),Ue=n.length)}function Je(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),F(`Set body ${e}: %c${t}`,f))}function _e(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Qe(){_e(0,g,je),_e(0,v,fe)}function Ge(e){({add(t){function n(){yt(e.eventName,e.eventType)}a[t]=n,k(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 Xe(e,t,n,o){return t!==e&&(e in n||(Q(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in r&&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 remove this option.`)),e}function Ye(){me=Xe(me,s,ut,"height")}function Ke(){xe=Xe(xe,d,dt,"width")}function et(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;yt(E,`Element resized <${function(e){switch(!0){case!x(e):return"";case x(e.id):return`${e.nodeName}#${e.id}`;case x(e.name):return`${e.nodeName} (${e.name}`;case x(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}const tt=new WeakSet;function nt(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!tt.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Ee.observe(e),tt.add(e))}const t=rt(e)();for(const e of t){if(tt.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(Ee.observe(e),tt.add(e))}}function ot(e){performance.mark(ne);const t=I(e);let n=0,i=document.documentElement,r=ue?0:document.documentElement.getBoundingClientRect().bottom;const a=ue?ke:ce?$e:rt(document)();let s=a.length;for(const t of a)ue||!l||t.checkVisibility(o)?(n=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),n>r&&(r=n,i=t)):s-=1;return F(`${t} position calculated from:`,i),performance.mark(oe,{detail:{Side:t,len:s,hasTags:ue,logging:ge}}),r}const it=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],rt=e=>()=>{Ze();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 se&&t.push(`not([${v}])`,`not([${v}] *)`),e.querySelectorAll(t.join(":"))},at={height:0,width:0},lt={height:0,width:0},st=[f,p,f];function ct(e){function t(){return lt[o]=i,at[o]=l,i}const n=e===ut,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),s=`HTML: %c${i}px %cPage: %c${l}px`;let c=0;switch(!0){case!e.enabled():return l;case ue:F("Found element with data-iframe-size attribute"),c=e.taggedElement();break;case!ce&&0===lt[o]&&0===at[o]:F(`Initial page size values: ${s}`,...st),c=t();break;case Ae&&i===lt[o]&&l===at[o]:F(`Size unchanged: ${s}`,...st),c=Math.max(i,l);break;case 0===i:F(`Page is hidden: ${s}`,...st),c=l;break;case!ce&&i!==lt[o]&&l<=at[o]:F(`New <html> size: ${s} `,...st),F(`Previous <html> size: %c${lt[o]}px`,f),c=t();break;case!n:c=e.taggedElement();break;case!ce&&i<lt[o]:F(`<html> size decreased: ${s}`,...st),c=t();break;case l===a||l===r:F(`<html> size equals page size: ${s}`,...st),c=t();break;case i>l:F(`Page size < <html> size: ${s}`,...st),c=t();break;case ce:F("Found element overflowing <html> "),c=e.taggedElement();break;default:F(`Using <html> size: ${s}`,...st),c=t()}return F(`Content ${o}: %c${c}px`,f),c+=function(e){const t=e.getOffset();return 0!==t&&F(`Page offsetSize: %c${t}px`,f),t}(e),c}const ut={enabled:()=>re,getOffset:()=>m,auto:()=>ct(ut),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>ut.bodyOffset(),custom:()=>i.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...it(ut)),min:()=>Math.min(...it(ut)),grow:()=>ut.max(),lowestElement:()=>ot(z),taggedElement:()=>ot(z)},dt={enabled:()=>ae,getOffset:()=>M,auto:()=>ct(dt),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>i.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...it(dt)),min:()=>Math.min(...it(dt)),rightMostElement:()=>ot(w),scroll:()=>Math.max(dt.bodyScroll(),dt.documentElementScroll()),taggedElement:()=>ot(w)},mt=(e,t)=>!(Math.abs(e-t)<=Te);function ft(e,t,n,o,i){const r=void 0===n?ut[me]():n,a=void 0===o?dt[xe]():o;switch(!0){case re&&mt(de,r)||ae&&mt(Ie,a)||"init"===e:de=r,Ie=a;case e===S:vt(de,Ie,e,i);break;case!e!==$&&(re&&me in u||ae&&xe in u):bt();break;case e===E:case e===O:case e===j:_();break;default:_(),F("No change in content size detected")}B=!1}let pt=!1;const ht=T((()=>X(P(4)))),yt=Z(((e,t,n,o,i)=>{W=performance.now(),J(e),D||e===$?document.hidden||(pt||(B=!0,ft(e,0,n,o,i),requestAnimationFrame((()=>{pt=!1}))),pt=!0):F("Resizing disabled")}));function gt(e){de=ut[me](),Ie=dt[xe](),vt(de,Ie,e)}function bt(e){const t=me;me=s,Ae||(Ae=!0,requestAnimationFrame((()=>{Ae=!1}))),gt("reset"),me=t}const vt=Z((function(e,t,o,i,r){be<-1||(J(o),void 0!==r||(r=Pe),function(){const a=`${ze}:${e}:${t}:${o}${void 0===i?"":`:${i}`}`;if(Oe)try{window.parent.iframeParentListener(c+a)}catch(e){if(1!==be)throw e;return void ht()}else Me.postMessage(c+a,r);B&&F(function(){const e=C(performance.now()-W);return"init"===o?`Initialised iFrame in %c${e}ms`:`Size calculated in %c${e}ms`}(),f),F("Sending message to host page via "+(Oe?"sameDomain":"postMessage")),F(`%c${a}`,n)}(),V())})),zt=Z((function(e){const{freeze:t}=Object,{parse:n}=JSON,o=e=>vt(0,0,`${e}Stop`),i={init:function(){he=e.data,Me=e.source,q=e.origin,Fe(),le=!1,setTimeout((()=>{pe=!1}),128)},reset(){pe||gt("resetPage")},resize(){yt($,"Parent window requested size check")},moveToAnchor(){ye.findTarget(a())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=a();Be?setTimeout((()=>Be(n(e)))):o("pageInfo")},parentInfo(){const e=a();Le?setTimeout((()=>Le(t(n(e))))):o("parentInfo")},message(){const e=a();setTimeout((()=>Re(n(e))))}},r=()=>e.data.split("]")[1].split(":")[0],a=()=>e.data.slice(e.data.indexOf(":")+1),l=()=>e.data.split(":")[2]in{true:1,false:1};function s(){const t=r();t in i?i[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||l()||Q(`Unexpected message (${e.data})`)}c===`${e.data}`.slice(0,13)&&(J(r()),!1!==le?l()&&i.init():s())}));function wt(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?Q("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>zt({data:e,sameDomain:!0}))),k(window,"message",zt),k(window,"readystatechange",wt),wt())}()}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iframe-resizer/child",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.3",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
5
|
"homepage": "https://iframe-resizer.com",
|
|
6
6
|
"author": {
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"child"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"auto-console-group": "1.2.
|
|
43
|
+
"auto-console-group": "1.2.1"
|
|
44
44
|
}
|
|
45
45
|
}
|