@iframe-resizer/jquery 5.5.8-beta.1 → 5.5.8-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,4 +25,4 @@ yarn add @iframe-resizer/jquery
25
25
 
26
26
  ---
27
27
 
28
- _iframe-resizer version 5.5.8-beta.1 2026-01-22 - 11:48:53.539Z_
28
+ _iframe-resizer version 5.5.8-beta.2 2026-01-23 - 11:49:46.192Z_
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.8-beta.1 (cjs) - 2026-01-22
4
+ * @module iframe-resizer/jquery 5.5.8-beta.2 (cjs) - 2026-01-23
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.8-beta.1 (esm) - 2026-01-22
4
+ * @module iframe-resizer/jquery 5.5.8-beta.2 (esm) - 2026-01-23
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.8-beta.1 (umd) - 2026-01-22
4
+ * @module iframe-resizer/jquery 5.5.8-beta.2 (umd) - 2026-01-23
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,5 +17,5 @@
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=e+"font-style: italic;",i="default",n=Object.freeze({assert:!0,error:!0,warn:!0}),o={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},s=Object.assign(console);const{fromEntries:a,keys:l}=Object,c=e=>[e,s[e]],u=e=>t=>[t,function(i){e[t]=i}],d=(e,t)=>a(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",m=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.5.8-beta.1",g="iframeResizer",y=":",b="autoResize",w="init",v="iframeReady",z="load",$="message",j="onload",k="pageInfo",T="parentInfo",x="reset",M="resize",R="scroll",S="\n",O="child",I="parent",E="string",C="object",W="function",A="auto",L="none",F="both",N="vertical",P="horizontal",B="[iFrameSizer]",H=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),q=Object.freeze({[j]:1,[w]:1,[v]:1}),D="expanded",U="collapsed",Q=Object.freeze({[D]:1,[U]:1}),J="Use of the old name will be removed in a future version of <i>iframe-resizer</>.",V=(e,t,i,n)=>e.addEventListener(t,i,n||!1),Z=(e,t,i)=>e.removeEventListener(t,i,!1),G=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},X=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),Y=["spjluzl","rlf","clyzpvu"],_=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],K=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ee=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),te=e=>X(_[e]),ie=e=>{const t=e[X(Y[0])]||e[X(Y[1])]||e[X(Y[2])];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=G(X(e));return i in ee&&(t=ee[i]),t}(i[0]);return 0===n||(e=>e[2]===G(e[0]+e[1]))(i)||(n=-2),n},ne=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),oe={br:"\n",rb:"",bb:"",b:"",i:"",u:"","/":""},re=Object.keys(oe),se=new RegExp(`<(${re.join("|")})>`,"gi"),ae=(e,t)=>oe[t]??"",le=e=>t=>e(typeof t===E?window.chrome?t.replace(se,ae):(e=>e.replaceAll("<br>",S).replaceAll(/<\/?[^>]+>/gi,""))(t):t),ce={},ue=(de=function(a={}){const l={},f={},p=[],m={...o,expand:!a.collapsed||o.expanded,...a};let h="";function g(){p.length=0,h=""}function y(){delete m.event,g()}const b=()=>!!p.some(([e])=>e in n)||!!m.expand;function w(){if(0!==p.length){s[b()?"group":"groupCollapsed"](`%c${m.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(m)} %c${m.showTime?h:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)s.assert(e in s,`Unknown console method: ${e}`),e in s&&s[e](...t);s.groupEnd(),y()}else y()}function v(){""===h&&(h=function(){const e=new Date,t=(t,i)=>e[t]().toString().padStart(i,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function $(e=i,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(m,u(m)),...d(console,e=>[e,(...t)=>z(e,...t)]),...d(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=i){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=i){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let i;try{i=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return i},event:function(e){v(),m.event=e},purge:g,time:function(e=i){v(),l[e]=performance.now()},timeEnd:function(e=i){$(e),delete l[e]},timeLog:$,touch:v}},de?.__esModule?de.default:de);var de;let fe=!0;const pe=ue({expand:!1,label:I}),me=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const he=e=>(t,...i)=>ce[t]?ce[t].console[e](...i):pe[e](...i),ge=e=>(t,...i)=>!0===(e=>ce[e]?ce[e].log:fe)(t)?he(e)(t,...i):null,ye=ge("log"),be=ye,we=ge("debug"),ve=he("warn"),ze=he("error"),$e=he("event"),je=he("purge"),ke=he("endAutoGroup"),Te=he("errorBoundary");const xe=le(e=>e),Me=(e,...t)=>ce[e]?ce[e].console.warn(...t.map(xe)):queueMicrotask(()=>{const i=le((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e));console?.warn(...t.map(i))}),Re=(e=>(t,i="renamed to")=>(n,o,r="",s="")=>e(s,`<rb>Deprecated ${t}(${n.replace("()","")})</>\n\nThe <b>${n}</> ${t.toLowerCase()} has been ${i} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(Me),Se=Re("Method"),Oe=Re("Option");function Ie(e,t){const{checkOrigin:i,iframe:{src:n,sandbox:o},initialisedFirstPage:r,waitForLoad:s}=t[e],a=(e=>{try{return new URL(e).origin}catch(e){return null}})(n);$e(e,"noResponse"),Me(e,`<rb>No response from iframe</>\n\nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${i&&a?`\nThe <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${a}</>, then the connection to the iframe may be blocked by the browser. To disable this option, set <b>checkOrigin</> to <bb>false</> or an array of allowed origins. See <u>https://iframe-resizer.com/checkorigin</> for more information.\n`:""}${s&&!r?"\nThe <b>waitForLoad</> option is currently set to <bb>true</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <bb>false</>.\n":""}${(e=>typeof e===C&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin")))(o)?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}const Ee={};const Ce=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:N,firstRun:!0,inPageLinks:!1,heightCalculationMethod:A,id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:A,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof ce[e.id].onInit===W&&(Oe("init()","onReady()","",e.id),ce[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),We={position:null,version:h};function Ae(e){function t(){De(N),He(q),C("onResized",N)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const o=e=>L.slice(L.indexOf(y)+7+e);const r=(e,t)=>(i,n)=>{const o={};var r,s;r=function(){Qe(`${i} (${e})`,`${e}:${t()}`,n)},o[s=n]||(r(),o[s]=requestAnimationFrame(()=>{o[s]=null}))},s=(e,t)=>()=>{let i=!1;const n=t=>()=>{ce[l]?i&&i!==t||(e(t,l),i=t,requestAnimationFrame(()=>{i=!1})):a()},o=n(R),r=n("resize window");function s(e,i){ye(l,`${e}listeners for send${t}`),i(window,R,o),i(window,M,r)}function a(){$e(l,`stop${t}`),s("Remove ",Z),c.disconnect(),u.disconnect(),Z(ce[l].iframe,z,a)}const l=q,c=new ResizeObserver(n("pageObserver")),u=new ResizeObserver(n("iframeObserver"));ce[l]&&(ce[l][`stop${t}`]=a,V(ce[l].iframe,z,a),s("Add ",V),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(ce[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},a=e=>()=>{e in ce[q]&&(ce[q][e](),delete ce[q][e])},l=r(k,function(){const e=document.body.getBoundingClientRect(),t=N.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:s,clientWidth:a}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(s,o||0),clientWidth:Math.max(a,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:s,documentWidth:a,windowHeight:o,windowWidth:r})}),c=r(T,function(){const{iframe:e}=N,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})}),u=s(l,"PageInfo"),d=s(c,"ParentInfo"),f=a("stopPageInfo"),g=a("stopParentInfo");function v(e){const t=e.getBoundingClientRect();return Pe(q),{x:Number(t.left)+Number(We.position.x),y:Number(t.top)+Number(We.position.y)}}function j(e){const t=e?v(N.iframe):{x:0,y:0};be(q,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,m,p);const i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(N,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](i.x,i.y))}(n,i):function(e){We.position=e,S(q)}(i)}function S(e){const{x:t,y:i}=We.position,n=ce[e]?.iframe;!1!==C("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?He(e):Be()}function O(e){let t={};if(0===N.width&&0===N.height){const e=o(9).split(y);t={x:e[1],y:e[0]}}else t={x:N.width,y:N.height};C(e,{iframe:N.iframe,screenX:Number(t.x),screenY:Number(t.y),type:N.type})}const C=(e,t)=>Le(q,e,t);function W(){const{height:e,iframe:i,msg:n,type:r,width:s}=N;switch(ce[q]?.firstRun&&function(){if(!ce[q])return;ye(q,`First run for ${q}`),Ge(q,N.mode),ce[q].firstRun=!1}(),r){case"close":Ne(i);break;case $:l=o(6),ye(q,`onMessage passed: {iframe: %c${N.iframe.id}%c, message: %c${l}%c}`,p,m,p,m),C("onMessage",{iframe:N.iframe,message:JSON.parse(l)});break;case"mouseenter":O("onMouseEnter");break;case"mouseleave":O("onMouseLeave");break;case"beforeUnload":be(q,"Ready state reset"),ce[q].initialised=!1;break;case b:ce[q].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=N.width,t=N.height,i=window.parentIframe||window.parentIFrame||window;be(q,`scrollBy: x: %c${e}%c y: %c${t}`,p,m,p),i.scrollBy(e,t)}();break;case"scrollTo":j(!1);break;case"scrollToOffset":j(!0);break;case k:u();break;case T:d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=v(n);be(q,`Moving to in page link: %c#${t}`,p),We.position={x:e.x,y:e.y},S(q),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):ye(q,`In page link #${t} not found`)}():ye(q,`In page link #${t} not found`)}(o(9));break;case"title":!function(e,t){ce[t]?.syncTitle&&(ce[t].iframe.title=e,be(t,`Set iframe title attribute: %c${e}`,p))}(n,q);break;case x:qe(N);break;case w:t(),function(e){try{ce[e].sameOrigin=!!ce[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ce[e].sameOrigin=!1}ye(e,`sameOrigin: %c${ce[e].sameOrigin}`,p)}(q),(a=n)!==h&&(void 0!==a?ye(q,`Version mismatch (Child: %c${a}%c !== Parent: %c${h})`,p,m,p):Me(q,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ce[q].initialised=!0,C("onReady",i);break;default:if(0===s&&0===e)return void ve(q,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===s||0===e)return void ye(q,"Ignoring message with 0 height or width");if(document.hidden)return void ye(q,"Page hidden - ignored resize request");t()}var a,l}function A(e){if(!ce[e])throw new Error(`${N.type} No settings for ${e}. Message was: ${L}`)}let L=e.data;if("[iFrameResizerChild]Ready"===L)return F=e.source,void Object.values(ce).forEach((e=>({initChild:t,postMessageTarget:i})=>{e===i&&t()})(F));var F;if(!(e=>B===`${e}`.slice(0,13)&&e.slice(13).split(y)[0]in ce)(L)){if(typeof L!==E)return;return $e(I,"ignoredMessage"),void we(I,L)}const N=function(e){const t=e.slice(13).split(y),o=t[1]?Number(t[1]):0,r=ce[t[0]]?.iframe,s=getComputedStyle(r),a={iframe:r,id:t[0],height:o+i(s)+n(s),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(a.mode=t[5]),a}(L),{id:P,type:H}=N,q=P;q?($e(q,H),Te(q,function(t){A(q),function(){const e=N.type in{true:1,false:1,undefined:1};return e&&ye(q,"Ignoring init message from meta parent page"),e}()||(ye(q,`Received: %c${t}`,p),(null!==N.iframe||(ve(q,`The iframe (${N.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:i}=e;if(i)return!0;let n=ce[q]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(ye(q,`Checking connection is from allowed list of origins: %c${n}`,p);e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=ce[q]?.remoteHost;return ye(q,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${N.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&W())})(L)):ve("","iframeResizer received messageData without id, message was: ",L)}function Le(e,t,i){let n=null,o=null;if(ce[e]){if(n=ce[e][t],typeof n!==W)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{o=n(i)}catch(i){console.error(i),ve(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(n,i)}return o}function Fe(e){const{id:t}=e;ye(t,"Disconnected from iframe"),delete ce[t],delete e.iframeResizer}function Ne(e){const{id:t}=e;if(!1!==Le(t,"onBeforeClose",t)){ye(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){ve(t,e)}Le(t,"onAfterClose",t),Fe(e)}else ye(t,"Close iframe cancelled by onBeforeClose")}function Pe(e){null===We.position&&(We.position={x:window.scrollX,y:window.scrollY},ye(e,`Get page position: %c${We.position.x}%c, %c${We.position.y}`,p,m,p))}function Be(){We.position=null}function He(e){null!==We.position&&(window.scrollTo(We.position.x,We.position.y),be(e,`Set page position: %c${We.position.x}%c, %c${We.position.y}`,p,m,p),Be())}function qe(e){ye(e.id,"Size reset requested by "+(e.type===w?"parent page":"child page")),Pe(e.id),De(e),Qe(x,x,e.id)}function De(e){function t(t){const n=`${e[t]}px`;e.iframe.style[t]=n,be(i,`Set ${t}: %c${n}`,p)}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=ce[i];n&&t("height"),o&&t("width")}const Ue=e=>e.split(y).filter((e,t)=>19!==t).join(y);function Qe(e,t,i){function n(n){const o=e in q?Ue(t):t;be(i,n,p,m,p),be(i,`Message data: %c${o}`,p)}$e(i,e),ce[i]&&(ce[i]?.postMessageTarget?function(){const{iframe:o,postMessageTarget:r,sameOrigin:s,targetOrigin:a}=ce[i];if(s)try{return o.contentWindow.iframeChildListener(B+t),void n(`Sending message to iframe %c${i}%c via same origin%c`)}catch(t){e in q?(ce[i].sameOrigin=!1,ye(i,"New iframe does not support same origin")):ve(i,"Same origin messaging failed, falling back to postMessage")}n(`Sending message to iframe: %c${i}%c targetOrigin: %c${a}`),r.postMessage(B+t,a)}():ve(i,`Iframe(${i}) not found`))}let Je=0,Ve=!1,Ze=!1;function Ge(t,i=-3){if(Ve)return;const n=Math.max(ce[t].mode,i);if(n>ce[t].mode&&(ce[t].mode=n),n<0)throw je(t),ce[t].vAdvised||Me(t||"Parent",`${te(n+2)}${te(2)}`),ce[t].vAdvised=!0,te(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");n>0&&Ze||function(t,i){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,fe||i<1?"font-weight: bold;":e))}(`v${h} (${(e=>X(K[e]))(n)})`,n),n<1&&Me("Parent",te(3)),Ve=!0}const Xe=e=>t=>{function i(){ce[d]?.heightCalculationMethod in H&&qe({iframe:t,height:1,width:1,type:w})}function n(){if(ce[d]){const{iframe:e}=ce[d],t={close:Ne.bind(null,e),disconnect:Fe.bind(null,e),removeListeners(){Me(d,`<rb>Deprecated Method Name</>\n\nThe <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${J}\n`),this.disconnect()},resize(){Me(d,"<rb>Deprecated Method</>\n\nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),Qe.bind(null,"Window resize",M,d)},moveToAnchor(e){((e,t,i)=>{if(typeof e!==t)throw new TypeError(`${i} is not a ${n=t,n.charAt(0).toUpperCase()+n.slice(1)}`);var n})(e,E,"moveToAnchor(anchor) anchor"),Qe("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){e=JSON.stringify(e),Qe($,`${$}:${e}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e,t){const n=n=>()=>{if(!ce[e])return;const{firstRun:o,iframe:r}=ce[e];Qe(n,t,e),(e=>e===w)(n)&&(e=>"lazy"===e.loading)(r)||function(e,t){const{msgTimeout:i,warningTimeout:n}=t[e];n&&(i&&clearTimeout(i),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:i,loadErrorShown:n}=t[e];t[e].msgTimeout=void 0,i?t[e].initialisedFirstPage=!0:n||(t[e].loadErrorShown=!0,Ie(e,t))},n))}(e,ce),o||i()},{iframe:o}=ce[e];ce[e].initChild=n(v),function(e,t){V(e,z,()=>setTimeout(t,1))}(o,n(j)),function(e,t){const{iframe:i,waitForLoad:n}=ce[e];!0!==n&&((e=>{const{src:t,srcdoc:i}=e;return!i&&(null==t||""===t||"about:blank"===t)})(i)?setTimeout(()=>{$e(e,"noContent"),be(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(t))}(e,n(w))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||b in e)&&Me(d,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${N}</>, <bb>${P}</>, <bb>${F}</> or <bb>${L}</>.\n`),e):{}}function s(e){const t=ce[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){ne(ce[d],e)&&(Me(d,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. ${J}`),ce[d][t]=ce[d][e],delete ce[d][e])}const l=e=>ne(e,"onMouseEnter")||ne(e,"onMouseLeave");function c(e){var i,n;ce[d]={...ce[d],iframe:t,remoteHost:t?.src.split("/").slice(0,3).join("/"),...Ce,...r(e),mouseEvents:l(e),mode:ie(e),syncTitle:s(d)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),$e(d,"setup"),function(){const{direction:e}=ce[d];switch(e){case N:break;case P:ce[d].sizeHeight=!1;case F:ce[d].sizeWidth=!0;break;case L:ce[d].sizeWidth=!1,ce[d].sizeHeight=!1,ce[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}ye(d,`direction: %c${e}`,p)}(),(i=e?.offsetSize||e?.offset)&&(ce[d].direction===N?(ce[d].offsetHeight=i,ye(d,`Offset height: %c${i}`,p)):(ce[d].offsetWidth=i,ye(d,`Offset width: %c${i}`,p))),ce[d].warningTimeout||be(d,"warningTimeout:%c disabled",p),null===ce[d].postMessageTarget&&(ce[d].postMessageTarget=t.contentWindow),ce[d].targetOrigin=!0===ce[d].checkOrigin?""===(n=ce[d].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}const u=()=>g in t,d=function(i){if(i&&typeof i!==E)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(i=function(){let t=e?.id||Ce.id+Je++;return null!==document.getElementById(t)&&(t+=Je++),t}(),t.id=i,$e(i,"assignId"),ye(i,`Added missing iframe ID: ${i} (${t.src})`)),i}(t.id);if(typeof e!==C)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=U,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const i=ne(t,"log"),n=typeof t.log===E,o=i?!!n||t.log:Ce.log;ne(t,"logExpand")||(t.logExpand=i&&n?t.log===D:Ce.logExpand),function(e){-1===e?.log&&(e.log=!1,Ze=!0)}(t),function({enabled:e,expand:t,iframeId:i}){const n=ue({expand:t,label:me(i)});fe=e,ce[i]||(ce[i]={console:n})}({enabled:o,expand:t.logExpand,iframeId:e}),n&&!(t.log in Q)&&ze(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(d,e),Te(d,function(e){u()?ve(d,`Ignored iframe (${d}), already setup.`):(c(e),function(e){if(!0===Ee[e])return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;Ee[e]=!0;const i=Array.from(t).flatMap(e=>[S,e,S]);Me(e,`<rb>Duplicate ID attributes detected</>\n\nThe <b>${e}</> ID is not unique. Having multiple iframes on the same page with the same ID causes problems with communication between the iframe and parent page. Please ensure that the ID of each iframe has a unique value.\n\nFound <bb>${t.length}</> iframes with the <b>${e}</> ID:`,...i,S)}(d),ye(d,`src: %c${t.srcdoc||t.src}`,p),function(){if(Ve)return;const{mode:e}=ce[d];-1!==e&&Ge(d,e)}(),_e(),function(){switch(ye(d,`Iframe scrolling ${ce[d]?.scrolling?"enabled":"disabled"} for ${d}`),t.style.overflow=!1===ce[d]?.scrolling?"hidden":A,ce[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=ce[d]?ce[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=ce[d];"number"!=typeof e&&"0"!==e||(ce[d].bodyMargin=`${e}px`)}(),o(d,function(e){const{autoResize:t,bodyBackground:i,bodyMargin:n,bodyPadding:o,heightCalculationMethod:r,inPageLinks:s,license:a,log:l,logExpand:c,mouseEvents:u,offsetHeight:d,offsetWidth:f,mode:p,sizeHeight:m,sizeWidth:h,tolerance:g,widthCalculationMethod:b}=ce[e];return[e,"8",h,l,"32",!0,t,n,r,i,o,g,s,O,b,u,d,f,m,a,We.version,p,"",c].join(y)}(d)),n(),ye(d,"Setup complete"),ke(d))})(e),t?.iframeResizer};function Ye(){!0!==document.hidden&&((e,t)=>{Object.values(ce).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:i})=>Qe(e,t,i.id))})("tabVisible",M)}const _e=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{V(window,$,Ae),V(document,"visibilitychange",Ye),window.iframeParentListener=e=>setTimeout(()=>Ae({data:e,sameOrigin:!0}))});switch(!0){case void 0===window.jQuery:ve("","Unable to bind to jQuery, it is not available.");break;case!window.jQuery.fn:ve("","Unable to bind to jQuery, it is not fully loaded.");break;case window.jQuery.fn.iframeResize:ve("","iframeResize is already assigned to jQuery.fn.");break;default:window.jQuery.fn.iframeResize=function(e){const t=Xe(e);return this.filter("iframe").each((e,i)=>t(i)).end()},window.jQuery.fn.iFrameResize=function(e){return Se("iFrameResize()","iframeResize()","","jQuery"),this.iframeResize(e)}}});
20
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";const e="font-weight: normal;",t=e+"font-style: italic;",i="default",n=Object.freeze({assert:!0,error:!0,warn:!0}),o={expand:!1,defaultEvent:void 0,event:void 0,label:"AutoConsoleGroup",showTime:!0},r={profile:0,profileEnd:0,timeStamp:0,trace:0},s=Object.assign(console);const{fromEntries:a,keys:l}=Object,c=e=>[e,s[e]],u=e=>t=>[t,function(i){e[t]=i}],d=(e,t)=>a(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",m=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.5.8-beta.2",g="iframeResizer",y=":",b="autoResize",w="init",v="iframeReady",z="load",$="message",j="onload",k="pageInfo",T="parentInfo",x="reset",M="resize",R="scroll",S="\n",O="child",I="parent",E="string",C="object",W="function",A="auto",L="none",F="both",N="vertical",P="horizontal",B="[iFrameSizer]",H=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),q=Object.freeze({[j]:1,[w]:1,[v]:1}),D="expanded",U="collapsed",Q=Object.freeze({[D]:1,[U]:1}),J="Use of the old name will be removed in a future version of <i>iframe-resizer</>.",V=(e,t,i,n)=>e.addEventListener(t,i,n||!1),Z=(e,t,i)=>e.removeEventListener(t,i,!1),G=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},X=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),Y=["spjluzl","rlf","clyzpvu"],_=["<yi>Puchspk Spjluzl Rlf</><iy><iy>","<yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt.","Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz."],K=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],ee=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map((e,t)=>[e,Math.max(0,t-1)])),te=e=>X(_[e]),ie=e=>{const t=e[X(Y[0])]||e[X(Y[1])]||e[X(Y[2])];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=G(X(e));return i in ee&&(t=ee[i]),t}(i[0]);return 0===n||(e=>e[2]===G(e[0]+e[1]))(i)||(n=-2),n},ne=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),oe={br:"\n",rb:"",bb:"",b:"",i:"",u:"","/":""},re=Object.keys(oe),se=new RegExp(`<(${re.join("|")})>`,"gi"),ae=(e,t)=>oe[t]??"",le=e=>t=>e(typeof t===E?window.chrome?t.replace(se,ae):(e=>e.replaceAll("<br>",S).replaceAll(/<\/?[^>]+>/gi,""))(t):t),ce={},ue=(de=function(a={}){const l={},f={},p=[],m={...o,expand:!a.collapsed||o.expanded,...a};let h="";function g(){p.length=0,h=""}function y(){delete m.event,g()}const b=()=>!!p.some(([e])=>e in n)||!!m.expand;function w(){if(0!==p.length){s[b()?"group":"groupCollapsed"](`%c${m.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(m)} %c${m.showTime?h:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)s.assert(e in s,`Unknown console method: ${e}`),e in s&&s[e](...t);s.groupEnd(),y()}else y()}function v(){""===h&&(h=function(){const e=new Date,t=(t,i)=>e[t]().toString().padStart(i,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}())}function z(e,...t){0===p.length&&(v(),queueMicrotask(()=>queueMicrotask(w))),p.push([e,...t])}function $(e=i,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(m,u(m)),...d(console,e=>[e,(...t)=>z(e,...t)]),...d(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=i){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=i){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let i;try{i=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return i},event:function(e){v(),m.event=e},purge:g,time:function(e=i){v(),l[e]=performance.now()},timeEnd:function(e=i){$(e),delete l[e]},timeLog:$,touch:v}},de?.__esModule?de.default:de);var de;let fe=!0;const pe=ue({expand:!1,label:I}),me=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const he=e=>(t,...i)=>ce[t]?ce[t].console[e](...i):pe[e](...i),ge=e=>(t,...i)=>!0===(e=>ce[e]?ce[e].log:fe)(t)?he(e)(t,...i):null,ye=ge("log"),be=ye,we=ge("debug"),ve=he("warn"),ze=he("error"),$e=he("event"),je=he("purge"),ke=he("endAutoGroup"),Te=he("errorBoundary");const xe=le(e=>e),Me=(e,...t)=>ce[e]?ce[e].console.warn(...t.map(xe)):queueMicrotask(()=>{const i=le((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e));console?.warn(...t.map(i))}),Re=(e=>(t,i="renamed to")=>(n,o,r="",s="")=>e(s,`<rb>Deprecated ${t}(${n.replace("()","")})</>\n\nThe <b>${n}</> ${t.toLowerCase()} has been ${i} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(Me),Se=Re("Method"),Oe=Re("Option");function Ie(e,t){const{checkOrigin:i,iframe:{src:n,sandbox:o},initialisedFirstPage:r,waitForLoad:s}=t[e],a=(e=>{try{return new URL(e).origin}catch(e){return null}})(n);$e(e,"noResponse"),Me(e,`<rb>No response from iframe</>\n\nThe iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${i&&a?`\nThe <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${a}</>, then the connection to the iframe may be blocked by the browser. To disable this option, set <b>checkOrigin</> to <bb>false</> or an array of allowed origins. See <u>https://iframe-resizer.com/checkorigin</> for more information.\n`:""}${s&&!r?"\nThe <b>waitForLoad</> option is currently set to <bb>true</>. If the iframe loads before <i>iframe-resizer</> runs, this option will prevent <i>iframe-resizer</> initialising. To disable this option, set <b>waitForLoad</> to <bb>false</>.\n":""}${(e=>typeof e===C&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin")))(o)?"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.\n":""}\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`)}const Ee={};const Ce=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:N,firstRun:!0,inPageLinks:!1,heightCalculationMethod:A,id:"iFrameResizer",log:!1,logExpand:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,waitForLoad:!1,warningTimeout:5e3,widthCalculationMethod:A,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof ce[e.id].onInit===W&&(Oe("init()","onReady()","",e.id),ce[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),We={position:null,version:h};function Ae(e){function t(){De(N),He(q),C("onResized",N)}function i(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const o=e=>L.slice(L.indexOf(y)+7+e);const r=(e,t)=>(i,n)=>{const o={};var r,s;r=function(){Qe(`${i} (${e})`,`${e}:${t()}`,n)},o[s=n]||(r(),o[s]=requestAnimationFrame(()=>{o[s]=null}))},s=(e,t)=>()=>{let i=!1;const n=t=>()=>{ce[l]?i&&i!==t||(e(t,l),i=t,requestAnimationFrame(()=>{i=!1})):a()},o=n(R),r=n("resize window");function s(e,i){ye(l,`${e}listeners for send${t}`),i(window,R,o),i(window,M,r)}function a(){$e(l,`stop${t}`),s("Remove ",Z),c.disconnect(),u.disconnect(),Z(ce[l].iframe,z,a)}const l=q,c=new ResizeObserver(n("pageObserver")),u=new ResizeObserver(n("iframeObserver"));ce[l]&&(ce[l][`stop${t}`]=a,V(ce[l].iframe,z,a),s("Add ",V),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(ce[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},a=e=>()=>{e in ce[q]&&(ce[q][e](),delete ce[q][e])},l=r(k,function(){const e=document.body.getBoundingClientRect(),t=N.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:s,clientWidth:a}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(s,o||0),clientWidth:Math.max(a,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:s,documentWidth:a,windowHeight:o,windowWidth:r})}),c=r(T,function(){const{iframe:e}=N,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:n,height:o,offsetLeft:r,offsetTop:s,pageLeft:a,pageTop:l,scale:c}})}),u=s(l,"PageInfo"),d=s(c,"ParentInfo"),f=a("stopPageInfo"),g=a("stopParentInfo");function v(e){const t=e.getBoundingClientRect();return Pe(q),{x:Number(t.left)+Number(We.position.x),y:Number(t.top)+Number(We.position.y)}}function j(e){const t=e?v(N.iframe):{x:0,y:0};be(q,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,m,p);const i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(N,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](i.x,i.y))}(n,i):function(e){We.position=e,S(q)}(i)}function S(e){const{x:t,y:i}=We.position,n=ce[e]?.iframe;!1!==C("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?He(e):Be()}function O(e){let t={};if(0===N.width&&0===N.height){const e=o(9).split(y);t={x:e[1],y:e[0]}}else t={x:N.width,y:N.height};C(e,{iframe:N.iframe,screenX:Number(t.x),screenY:Number(t.y),type:N.type})}const C=(e,t)=>Le(q,e,t);function W(){const{height:e,iframe:i,msg:n,type:r,width:s}=N;switch(ce[q]?.firstRun&&function(){if(!ce[q])return;ye(q,`First run for ${q}`),Ge(q,N.mode),ce[q].firstRun=!1}(),r){case"close":Ne(i);break;case $:l=o(6),ye(q,`onMessage passed: {iframe: %c${N.iframe.id}%c, message: %c${l}%c}`,p,m,p,m),C("onMessage",{iframe:N.iframe,message:JSON.parse(l)});break;case"mouseenter":O("onMouseEnter");break;case"mouseleave":O("onMouseLeave");break;case"beforeUnload":be(q,"Ready state reset"),ce[q].initialised=!1;break;case b:ce[q].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=N.width,t=N.height,i=window.parentIframe||window.parentIFrame||window;be(q,`scrollBy: x: %c${e}%c y: %c${t}`,p,m,p),i.scrollBy(e,t)}();break;case"scrollTo":j(!1);break;case"scrollToOffset":j(!0);break;case k:u();break;case T:d();break;case"pageInfoStop":f();break;case"parentInfoStop":g();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=v(n);be(q,`Moving to in page link: %c#${t}`,p),We.position={x:e.x,y:e.y},S(q),window.location.hash=t}():window.top!==window.self?function(){const e=window.parentIframe||window.parentIFrame;e?e.moveToAnchor(t):ye(q,`In page link #${t} not found`)}():ye(q,`In page link #${t} not found`)}(o(9));break;case"title":!function(e,t){ce[t]?.syncTitle&&(ce[t].iframe.title=e,be(t,`Set iframe title attribute: %c${e}`,p))}(n,q);break;case x:qe(N);break;case w:t(),function(e){try{ce[e].sameOrigin=!!ce[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ce[e].sameOrigin=!1}ye(e,`sameOrigin: %c${ce[e].sameOrigin}`,p)}(q),(a=n)!==h&&(void 0!==a?ye(q,`Version mismatch (Child: %c${a}%c !== Parent: %c${h})`,p,m,p):Me(q,"<rb>Legacy version detected in iframe</>\n\nDetected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.\n\nSee <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.\n")),ce[q].initialised=!0,C("onReady",i);break;default:if(0===s&&0===e)return void ve(q,`Unsupported message received (${r}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===s||0===e)return void ye(q,"Ignoring message with 0 height or width");if(document.hidden)return void ye(q,"Page hidden - ignored resize request");t()}var a,l}function A(e){if(!ce[e])throw new Error(`${N.type} No settings for ${e}. Message was: ${L}`)}let L=e.data;if("[iFrameResizerChild]Ready"===L)return F=e.source,void Object.values(ce).forEach((e=>({initChild:t,postMessageTarget:i})=>{e===i&&t()})(F));var F;if(!(e=>B===`${e}`.slice(0,13)&&e.slice(13).split(y)[0]in ce)(L)){if(typeof L!==E)return;return $e(I,"ignoredMessage"),void we(I,L)}const N=function(e){const t=e.slice(13).split(y),o=t[1]?Number(t[1]):0,r=ce[t[0]]?.iframe,s=getComputedStyle(r),a={iframe:r,id:t[0],height:o+i(s)+n(s),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(a.mode=t[5]),a}(L),{id:P,type:H}=N,q=P;q?($e(q,H),Te(q,function(t){A(q),function(){const e=N.type in{true:1,false:1,undefined:1};return e&&ye(q,"Ignoring init message from meta parent page"),e}()||(ye(q,`Received: %c${t}`,p),(null!==N.iframe||(ve(q,`The iframe (${N.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:i}=e;if(i)return!0;let n=ce[q]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(ye(q,`Checking connection is from allowed list of origins: %c${n}`,p);e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=ce[q]?.remoteHost;return ye(q,`Checking connection is from: %c${e}`,p),t===e}()))throw new Error(`Unexpected message received from: ${t} for ${N.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&W())})(L)):ve("","iframeResizer received messageData without id, message was: ",L)}function Le(e,t,i){let n=null,o=null;if(ce[e]){if(n=ce[e][t],typeof n!==W)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{o=n(i)}catch(i){console.error(i),ve(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(n,i)}return o}function Fe(e){const{id:t}=e;ye(t,"Disconnected from iframe"),delete ce[t],delete e.iframeResizer}function Ne(e){const{id:t}=e;if(!1!==Le(t,"onBeforeClose",t)){ye(t,`Removing iFrame: %c${t}`,p);try{e.parentNode&&e.remove()}catch(e){ve(t,e)}Le(t,"onAfterClose",t),Fe(e)}else ye(t,"Close iframe cancelled by onBeforeClose")}function Pe(e){null===We.position&&(We.position={x:window.scrollX,y:window.scrollY},ye(e,`Get page position: %c${We.position.x}%c, %c${We.position.y}`,p,m,p))}function Be(){We.position=null}function He(e){null!==We.position&&(window.scrollTo(We.position.x,We.position.y),be(e,`Set page position: %c${We.position.x}%c, %c${We.position.y}`,p,m,p),Be())}function qe(e){ye(e.id,"Size reset requested by "+(e.type===w?"parent page":"child page")),Pe(e.id),De(e),Qe(x,x,e.id)}function De(e){function t(t){const n=`${e[t]}px`;e.iframe.style[t]=n,be(i,`Set ${t}: %c${n}`,p)}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=ce[i];n&&t("height"),o&&t("width")}const Ue=e=>e.split(y).filter((e,t)=>19!==t).join(y);function Qe(e,t,i){function n(n){const o=e in q?Ue(t):t;be(i,n,p,m,p),be(i,`Message data: %c${o}`,p)}$e(i,e),ce[i]&&(ce[i]?.postMessageTarget?function(){const{iframe:o,postMessageTarget:r,sameOrigin:s,targetOrigin:a}=ce[i];if(s)try{return o.contentWindow.iframeChildListener(B+t),void n(`Sending message to iframe %c${i}%c via same origin%c`)}catch(t){e in q?(ce[i].sameOrigin=!1,ye(i,"New iframe does not support same origin")):ve(i,"Same origin messaging failed, falling back to postMessage")}n(`Sending message to iframe: %c${i}%c targetOrigin: %c${a}`),r.postMessage(B+t,a)}():ve(i,`Iframe(${i}) not found`))}let Je=0,Ve=!1,Ze=!1;function Ge(t,i=-3){if(Ve)return;const n=Math.max(ce[t].mode,i);if(n>ce[t].mode&&(ce[t].mode=n),n<0)throw je(t),ce[t].vAdvised||Me(t||"Parent",`${te(n+2)}${te(2)}`),ce[t].vAdvised=!0,te(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");n>0&&Ze||function(t,i){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,fe||i<1?"font-weight: bold;":e))}(`v${h} (${(e=>X(K[e]))(n)})`,n),n<1&&Me("Parent",te(3)),Ve=!0}const Xe=e=>t=>{function i(){ce[d]?.heightCalculationMethod in H&&qe({iframe:t,height:1,width:1,type:w})}function n(){if(ce[d]){const{iframe:e}=ce[d],t={close:Ne.bind(null,e),disconnect:Fe.bind(null,e),removeListeners(){Me(d,`<rb>Deprecated Method Name</>\n\nThe <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${J}\n`),this.disconnect()},resize(){Me(d,"<rb>Deprecated Method</>\n\nUse of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As their are no longer any edge cases that require triggering a resize from the parent page, it is recommended to remove this method from your code."),Qe.bind(null,"Window resize",M,d)},moveToAnchor(e){((e,t,i)=>{if(typeof e!==t)throw new TypeError(`${i} is not a ${n=t,n.charAt(0).toUpperCase()+n.slice(1)}`);var n})(e,E,"moveToAnchor(anchor) anchor"),Qe("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){e=JSON.stringify(e),Qe($,`${$}:${e}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e,t){const n=n=>()=>{if(!ce[e])return;const{firstRun:o,iframe:r}=ce[e];Qe(n,t,e),(e=>e===w)(n)&&(e=>"lazy"===e.loading)(r)||function(e,t){const{msgTimeout:i,warningTimeout:n}=t[e];n&&(i&&clearTimeout(i),t[e].msgTimeout=setTimeout(function(){if(void 0===t[e])return;const{initialised:i,loadErrorShown:n}=t[e];t[e].msgTimeout=void 0,i?t[e].initialisedFirstPage=!0:n||(t[e].loadErrorShown=!0,Ie(e,t))},n))}(e,ce),o||i()},{iframe:o}=ce[e];ce[e].initChild=n(v),function(e,t){V(e,z,()=>setTimeout(t,1))}(o,n(j)),function(e,t){const{iframe:i,waitForLoad:n}=ce[e];!0!==n&&((e=>{const{src:t,srcdoc:i}=e;return!i&&(null==t||""===t||"about:blank"===t)})(i)?setTimeout(()=>{$e(e,"noContent"),be(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(t))}(e,n(w))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||b in e)&&Me(d,`<rb>Deprecated Option</>\n\nThe <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${N}</>, <bb>${P}</>, <bb>${F}</> or <bb>${L}</>.\n`),e):{}}function s(e){const t=ce[e]?.iframe?.title;return""===t||void 0===t}function a(e,t){ne(ce[d],e)&&(Me(d,`<rb>Deprecated option</>\n\nThe <b>${e}</> option has been renamed to <b>${t}</>. ${J}`),ce[d][t]=ce[d][e],delete ce[d][e])}const l=e=>ne(e,"onMouseEnter")||ne(e,"onMouseLeave");function c(e){var i,n;ce[d]={...ce[d],iframe:t,remoteHost:t?.src.split("/").slice(0,3).join("/"),...Ce,...r(e),mouseEvents:l(e),mode:ie(e),syncTitle:s(d)},a("offset","offsetSize"),a("onClose","onBeforeClose"),a("onClosed","onAfterClose"),$e(d,"setup"),function(){const{direction:e}=ce[d];switch(e){case N:break;case P:ce[d].sizeHeight=!1;case F:ce[d].sizeWidth=!0;break;case L:ce[d].sizeWidth=!1,ce[d].sizeHeight=!1,ce[d].autoResize=!1;break;default:throw new TypeError(d,`Direction value of "${e}" is not valid`)}ye(d,`direction: %c${e}`,p)}(),(i=e?.offsetSize||e?.offset)&&(ce[d].direction===N?(ce[d].offsetHeight=i,ye(d,`Offset height: %c${i}`,p)):(ce[d].offsetWidth=i,ye(d,`Offset width: %c${i}`,p))),ce[d].warningTimeout||be(d,"warningTimeout:%c disabled",p),null===ce[d].postMessageTarget&&(ce[d].postMessageTarget=t.contentWindow),ce[d].targetOrigin=!0===ce[d].checkOrigin?""===(n=ce[d].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*"}const u=()=>g in t,d=function(i){if(i&&typeof i!==E)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(i=function(){let t=e?.id||Ce.id+Je++;return null!==document.getElementById(t)&&(t+=Je++),t}(),t.id=i,$e(i,"assignId"),ye(i,`Added missing iframe ID: ${i} (${t.src})`)),i}(t.id);if(typeof e!==C)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=U,e.logExpand=t.includes("ifrlog=expanded"))}(e),function(e,t){const i=ne(t,"log"),n=typeof t.log===E,o=i?!!n||t.log:Ce.log;ne(t,"logExpand")||(t.logExpand=i&&n?t.log===D:Ce.logExpand),function(e){-1===e?.log&&(e.log=!1,Ze=!0)}(t),function({enabled:e,expand:t,iframeId:i}){const n=ue({expand:t,label:me(i)});fe=e,ce[i]||(ce[i]={console:n})}({enabled:o,expand:t.logExpand,iframeId:e}),n&&!(t.log in Q)&&ze(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(d,e),Te(d,function(e){u()?ve(d,`Ignored iframe (${d}), already setup.`):(c(e),function(e){if(!0===Ee[e])return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;Ee[e]=!0;const i=Array.from(t).flatMap(e=>[S,e,S]);Me(e,`<rb>Duplicate ID attributes detected</>\n\nThe <b>${e}</> ID is not unique. Having multiple iframes on the same page with the same ID causes problems with communication between the iframe and parent page. Please ensure that the ID of each iframe has a unique value.\n\nFound <bb>${t.length}</> iframes with the <b>${e}</> ID:`,...i,S)}(d),ye(d,`src: %c${t.srcdoc||t.src}`,p),function(){if(Ve)return;const{mode:e}=ce[d];-1!==e&&Ge(d,e)}(),_e(),function(){switch(ye(d,`Iframe scrolling ${ce[d]?.scrolling?"enabled":"disabled"} for ${d}`),t.style.overflow=!1===ce[d]?.scrolling?"hidden":A,ce[d]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=ce[d]?ce[d].scrolling:"no"}}(),function(){const{bodyMargin:e}=ce[d];"number"!=typeof e&&"0"!==e||(ce[d].bodyMargin=`${e}px`)}(),o(d,function(e){const{autoResize:t,bodyBackground:i,bodyMargin:n,bodyPadding:o,heightCalculationMethod:r,inPageLinks:s,license:a,log:l,logExpand:c,mouseEvents:u,offsetHeight:d,offsetWidth:f,mode:p,sizeHeight:m,sizeWidth:h,tolerance:g,widthCalculationMethod:b}=ce[e];return[e,"8",h,l,"32",!0,t,n,r,i,o,g,s,O,b,u,d,f,m,a,We.version,p,"",c].join(y)}(d)),n(),ye(d,"Setup complete"),ke(d))})(e),t?.iframeResizer};function Ye(){!0!==document.hidden&&((e,t)=>{Object.values(ce).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:i})=>Qe(e,t,i.id))})("tabVisible",M)}const _e=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{V(window,$,Ae),V(document,"visibilitychange",Ye),window.iframeParentListener=e=>setTimeout(()=>Ae({data:e,sameOrigin:!0}))});switch(!0){case void 0===window.jQuery:ve("","Unable to bind to jQuery, it is not available.");break;case!window.jQuery.fn:ve("","Unable to bind to jQuery, it is not fully loaded.");break;case window.jQuery.fn.iframeResize:ve("","iframeResize is already assigned to jQuery.fn.");break;default:window.jQuery.fn.iframeResize=function(e){const t=Xe(e);return this.filter("iframe").each((e,i)=>t(i)).end()},window.jQuery.fn.iFrameResize=function(e){return Se("iFrameResize()","iframeResize()","","jQuery"),this.iframeResize(e)}}});
21
21
  //# sourceMappingURL=index.umd.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/jquery",
3
- "version": "5.5.8-beta.1",
3
+ "version": "5.5.8-beta.2",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -34,6 +34,6 @@
34
34
  "jquery"
35
35
  ],
36
36
  "dependencies": {
37
- "@iframe-resizer/core": "5.5.8-beta.1"
37
+ "@iframe-resizer/core": "5.5.8-beta.2"
38
38
  }
39
39
  }