@iframe-resizer/jquery 5.5.8 → 5.5.9

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 2026-01-26 - 16:51:16.179Z_
28
+ _iframe-resizer version 5.5.9 2026-02-06 - 10:22:50.790Z_
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.8 (cjs) - 2026-01-26
4
+ * @module iframe-resizer/jquery 5.5.9 (cjs) - 2026-02-06
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.8 (esm) - 2026-01-26
4
+ * @module iframe-resizer/jquery 5.5.9 (esm) - 2026-02-06
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
package/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/jquery 5.5.8 (umd) - 2026-01-26
4
+ * @module iframe-resizer/jquery 5.5.9 (umd) - 2026-02-06
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -17,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=e+"font-style: italic;",n="default",i=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},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",m=f?"color: #E3E3E3;":"color: #1F1F1F;",h="5.5.8",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",E="parent",I="string",C="object",W="function",L="auto",A="none",N="both",F="vertical",B="horizontal",P="[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</>.",Z=(e,t,n,i)=>e.addEventListener(t,n,i||!1),V=(e,t,n)=>e.removeEventListener(t,n,!1),G=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},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]),ne=e=>{const t=e[X(Y[0])]||e[X(Y[1])]||e[X(Y[2])];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=G(X(e));return n in ee&&(t=ee[n]),t}(n[0]);return 0===i||(e=>e[2]===G(e[0]+e[1]))(n)||(i=-2),i},ie=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),oe={br:"\n",rb:"",bb:"",b:"",i:"",u:"","/":""},re=Object.keys(oe),ae=new RegExp(`<(${re.join("|")})>`,"gi"),se=(e,t)=>oe[t]??"",le=e=>t=>e(typeof t===I?window.chrome?t.replace(ae,se):(e=>e.replaceAll("<br>",S).replaceAll(/<\/?[^>]+>/gi,""))(t):t),ce={},ue=(de=function(s={}){const l={},f={},p=[],m={...o,expand:!s.collapsed||o.expanded,...s};let h="";function g(){p.length=0,h=""}function y(){delete m.event,g()}const b=()=>!!p.some(([e])=>e in i)||!!m.expand;function w(){if(0!==p.length){a[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)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===h&&(h=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(w)))}function z(e,...t){0===p.length&&v(),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(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=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),m.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},de?.__esModule?de.default:de);var de;let fe=!0;const pe=ue({expand:!1,label:E}),me=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const he=e=>(t,...n)=>ce[t]?ce[t].console[e](...n):pe[e](...n);var ge;const ye=(ge="log",(e,...t)=>!0===(e=>ce[e]?ce[e].log:fe)(e)?he(ge)(e,...t):null),be=he("warn"),we=he("error"),ve=he("event"),ze=he("purge"),$e=he("endAutoGroup"),je=he("errorBoundary");const ke=le(e=>e),Te=(e,...t)=>ce[e]?ce[e].console.warn(...t.map(ke)):queueMicrotask(()=>{const n=le((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e));console?.warn(...t.map(n))}),xe=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(Te),Me=xe("Method"),Re=xe("Option");function Se(e){const{checkOrigin:t,iframe:{id:n,src:i,sandbox:o},initialisedFirstPage:r,waitForLoad:a,warningTimeout:s}=e,l=(e=>{try{return new URL(e).origin}catch(e){return null}})(i);ve(n,"noResponse"),Te(n,`<rb>No response from iframe</>\n\nThe iframe (<i>${n}</>) has not responded within ${s/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${t&&l?`\nThe <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${l}</>, 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`:""}${a&&!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 Oe={};const Ee=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:F,firstRun:!0,inPageLinks:!1,heightCalculationMethod:L,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:L,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof ce[e.id].onInit===W&&(Re("init()","onReady()","",e.id),ce[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),Ie={position:null,version:h};function Ce(e){function t(){He(F),Be(q),C("onResized",F)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function i(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=>A.slice(A.indexOf(y)+7+e);const r=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){De(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame(()=>{o[a]=null}))},a=(e,t)=>()=>{let n=!1;const i=t=>()=>{ce[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):s()},o=i(R),r=i("resize window");function a(e,t){t(window,R,o),t(window,M,r)}function s(){ve(l,`stop${t}`),a(0,V),c.disconnect(),u.disconnect(),V(ce[l].iframe,z,s)}const l=q,c=new ResizeObserver(i("pageObserver")),u=new ResizeObserver(i("iframeObserver"));ce[l]&&(ce[l][`stop${t}`]=s,Z(ce[l].iframe,z,s),a(0,Z),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(ce[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ce[q]&&(ce[q][e](),delete ce[q][e])},l=r(k,function(){const e=document.body.getBoundingClientRect(),t=F.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})}),c=r(T,function(){const{iframe:e}=F,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),u=a(l,"PageInfo"),d=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function v(e){const t=e.getBoundingClientRect();return Ne(),{x:Number(t.left)+Number(Ie.position.x),y:Number(t.top)+Number(Ie.position.y)}}function j(e){const t=e?v(F.iframe):{x:0,y:0};ye(q,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,m,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(F,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](n.x,n.y))}(i,n):function(e){Ie.position=e,S(q)}(n)}function S(e){const{x:t,y:n}=Ie.position,i=ce[e]?.iframe;!1!==C("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?Be(e):Fe()}function O(e){let t={};if(0===F.width&&0===F.height){const e=o(9).split(y);t={x:e[1],y:e[0]}}else t={x:F.width,y:F.height};C(e,{iframe:F.iframe,screenX:Number(t.x),screenY:Number(t.y),type:F.type})}const C=(e,t)=>We(q,e,t);function W(){const{height:e,iframe:n,msg:i,type:r,width:a}=F;switch(ce[q]?.firstRun&&function(){if(!ce[q])return;Ze(q,F.mode),ce[q].firstRun=!1}(),r){case"close":Ae(n);break;case $:l=o(6),C("onMessage",{iframe:F.iframe,message:JSON.parse(l)});break;case"mouseenter":O("onMouseEnter");break;case"mouseleave":O("onMouseLeave");break;case"beforeUnload":ye(q,"Ready state reset"),ce[q].initialised=!1;break;case b:ce[q].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=F.width,t=F.height,n=window.parentIframe||window.parentIFrame||window;ye(q,`scrollBy: x: %c${e}%c y: %c${t}`,p,m,p),n.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]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=v(i);ye(q,`Moving to in page link: %c#${t}`,p),Ie.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)}()}(o(9));break;case"title":!function(e,t){ce[t]?.syncTitle&&(ce[t].iframe.title=e,ye(t,`Set iframe title attribute: %c${e}`,p))}(i,q);break;case x:Pe(F);break;case w:t(),function(e){try{ce[e].sameOrigin=!!ce[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ce[e].sameOrigin=!1}}(q),(s=i)!==h&&(void 0!==s||Te(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",n);break;default:if(0===a&&0===e)return void be(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===a||0===e)return;if(document.hidden)return;t()}var s,l}function L(e){if(!ce[e])throw new Error(`${F.type} No settings for ${e}. Message was: ${A}`)}let A=e.data;if("[iFrameResizerChild]Ready"===A)return N=e.source,void Object.values(ce).forEach((e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()})(N));var N;if(!(e=>P===`${e}`.slice(0,13)&&e.slice(13).split(y)[0]in ce)(A)){if(typeof A!==I)return;return void ve(E,"ignoredMessage")}const F=function(e){const t=e.slice(13).split(y),o=t[1]?Number(t[1]):0,r=ce[t[0]]?.iframe,a=getComputedStyle(r),s={iframe:r,id:t[0],height:o+n(a)+i(a),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(s.mode=t[5]),s}(A),{id:B,type:H}=F,q=B;q?(ve(q,H),je(q,function(t){L(q),F.type in{true:1,false:1,undefined:1}||(null!==F.iframe||(be(q,`The iframe (${F.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=ce[q]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(;e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=ce[q]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${F.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()})(A)):be("","iframeResizer received messageData without id, message was: ",A)}function We(e,t,n){let i=null,o=null;if(ce[e]){if(i=ce[e][t],typeof i!==W)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),be(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(i,n)}return o}function Le(e){const{id:t}=e;delete ce[t],delete e.iframeResizer}function Ae(e){const{id:t}=e;if(!1!==We(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){be(t,e)}We(t,"onAfterClose",t),Le(e)}}function Ne(e){null===Ie.position&&(Ie.position={x:window.scrollX,y:window.scrollY})}function Fe(){Ie.position=null}function Be(e){null!==Ie.position&&(window.scrollTo(Ie.position.x,Ie.position.y),ye(e,`Set page position: %c${Ie.position.x}%c, %c${Ie.position.y}`,p,m,p),Fe())}function Pe(e){Ne(e.id),He(e),De(x,x,e.id)}function He(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,ye(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=ce[n];i&&t("height"),o&&t("width")}const qe=e=>e.split(y).filter((e,t)=>19!==t).join(y);function De(e,t,n){function i(i){const o=e in q?qe(t):t;ye(n,i,p,m,p),ye(n,`Message data: %c${o}`,p)}ve(n,e),ce[n]&&(ce[n]?.postMessageTarget?function(){const{iframe:o,postMessageTarget:r,sameOrigin:a,targetOrigin:s}=ce[n];if(a)try{return o.contentWindow.iframeChildListener(P+t),void i(`Sending message to iframe %c${n}%c via same origin%c`)}catch(t){e in q?ce[n].sameOrigin=!1:be(n,"Same origin messaging failed, falling back to postMessage")}i(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),r.postMessage(P+t,s)}():be(n,`Iframe(${n}) not found`))}let Ue=0,Qe=!1,Je=!1;function Ze(t,n=-3){if(Qe)return;const i=Math.max(ce[t].mode,n);if(i>ce[t].mode&&(ce[t].mode=i),i<0)throw ze(t),ce[t].vAdvised||Te(t||"Parent",`${te(i+2)}${te(2)}`),ce[t].vAdvised=!0,te(i+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");i>0&&Je||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,fe||n<1?"font-weight: bold;":e))}(`v${h} (${(e=>X(K[e]))(i)})`,i),i<1&&Te("Parent",te(3)),Qe=!0}const Ve=e=>t=>{function n(){ce[d]?.heightCalculationMethod in H&&Pe({iframe:t,height:1,width:1,type:w})}function i(){if(ce[d]){const{iframe:e}=ce[d],t={close:Ae.bind(null,e),disconnect:Le.bind(null,e),removeListeners(){Te(d,`<rb>Deprecated Method Name</>\n\nThe <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${J}\n`),this.disconnect()},resize(){Te(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."),De.bind(null,"Window resize",M,d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,I,"moveToAnchor(anchor) anchor"),De("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){e=JSON.stringify(e),De($,`${$}:${e}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e,t){const i=i=>()=>{if(!ce[e])return;const{firstRun:o,iframe:r}=ce[e];De(i,t,e),(e=>e===w)(i)&&(e=>"lazy"===e.loading)(r)||function(e,t){const n=t[e],{msgTimeout:i,warningTimeout:o}=n;o&&(i&&clearTimeout(i),n.msgTimeout=setTimeout(function(){const n=t[e];void 0!==n&&((e=>{e.msgTimeout=void 0})(n),function(e){const{initialised:t}=e;return t&&(e.initialisedFirstPage=!0),t}(n)||Se(n))},o))}(e,ce),o||n()},{iframe:o}=ce[e];ce[e].initChild=i(v),function(e,t){Z(e,z,()=>setTimeout(t,1))}(o,i(j)),function(e,t){const{iframe:n,waitForLoad:i}=ce[e];!0!==i&&((e=>{const{src:t,srcdoc:n}=e;return!n&&(null==t||""===t||"about:blank"===t)})(n)?setTimeout(()=>{ve(e,"noContent"),ye(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(t))}(e,i(w))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||b in e)&&Te(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>${F}</>, <bb>${B}</>, <bb>${N}</> or <bb>${A}</>.\n`),e):{}}function a(e){const t=ce[e]?.iframe?.title;return""===t||void 0===t}function s(e,t){ie(ce[d],e)&&(Te(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=>ie(e,"onMouseEnter")||ie(e,"onMouseLeave");function c(e){var n,i;ce[d]={...ce[d],iframe:t,remoteHost:t?.src.split("/").slice(0,3).join("/"),...Ee,...r(e),mouseEvents:l(e),mode:ne(e),syncTitle:a(d)},s("offset","offsetSize"),s("onClose","onBeforeClose"),s("onClosed","onAfterClose"),ve(d,"setup"),function(){const{direction:e}=ce[d];switch(e){case F:break;case B:ce[d].sizeHeight=!1;case N:ce[d].sizeWidth=!0;break;case A: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`)}}(),(n=e?.offsetSize||e?.offset)&&(ce[d].direction===F?ce[d].offsetHeight=n:ce[d].offsetWidth=n),ce[d].warningTimeout||ye(d,"warningTimeout:%c disabled",p),null===ce[d].postMessageTarget&&(ce[d].postMessageTarget=t.contentWindow),ce[d].targetOrigin=!0===ce[d].checkOrigin?""===(i=ce[d].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const u=()=>g in t,d=function(n){if(n&&typeof n!==I)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||Ee.id+Ue++;return null!==document.getElementById(t)&&(t+=Ue++),t}(),t.id=n,ve(n,"assignId")),n}(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 n=ie(t,"log"),i=typeof t.log===I,o=n?!!i||t.log:Ee.log;ie(t,"logExpand")||(t.logExpand=n&&i?t.log===D:Ee.logExpand),function(e){-1===e?.log&&(e.log=!1,Je=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=ue({expand:t,label:me(n)});fe=e,ce[n]||(ce[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in Q)&&we(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(d,e),je(d,function(e){u()?be(d,`Ignored iframe (${d}), already setup.`):(c(e),function(e){if(!0===Oe[e])return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;Oe[e]=!0;const n=Array.from(t).flatMap(e=>[S,e,S]);Te(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:`,...n,S)}(d),function(){if(Qe)return;const{mode:e}=ce[d];-1!==e&&Ze(d,e)}(),Xe(),function(){switch(t.style.overflow=!1===ce[d]?.scrolling?"hidden":L,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:n,bodyMargin:i,bodyPadding:o,heightCalculationMethod:r,inPageLinks:a,license:s,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,i,r,n,o,g,a,O,b,u,d,f,m,s,Ie.version,p,"",c].join(y)}(d)),i(),$e(d))})(e),t?.iframeResizer};function Ge(){!0!==document.hidden&&((e,t)=>{Object.values(ce).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:n})=>De(e,t,n.id))})("tabVisible",M)}const Xe=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{Z(window,$,Ce),Z(document,"visibilitychange",Ge),window.iframeParentListener=e=>setTimeout(()=>Ce({data:e,sameOrigin:!0}))});switch(!0){case void 0===window.jQuery:be("","Unable to bind to jQuery, it is not available.");break;case!window.jQuery.fn:be("","Unable to bind to jQuery, it is not fully loaded.");break;case window.jQuery.fn.iframeResize:be("","iframeResize is already assigned to jQuery.fn.");break;default:window.jQuery.fn.iframeResize=function(e){const t=Ve(e);return this.filter("iframe").each((e,n)=>t(n)).end()},window.jQuery.fn.iFrameResize=function(e){return Me("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;",n="default",i=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},a=Object.assign(console);const{fromEntries:s,keys:l}=Object,c=e=>[e,a[e]],u=e=>t=>[t,function(n){e[t]=n}],d=(e,t)=>s(l(e).map(t));const f=!(typeof window>"u"||"function"!=typeof window.matchMedia)&&window.matchMedia("(prefers-color-scheme: dark)").matches,p=f?"color: #A9C7FB;":"color: #135CD2;",h=f?"color: #E3E3E3;":"color: #1F1F1F;",m="5.5.9",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",E="parent",I="string",C="object",W="function",L="auto",A="none",N="both",F="vertical",B="horizontal",P="[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</>.",Z=(e,t,n,i)=>e.addEventListener(t,n,i||!1),V=(e,t,n)=>e.removeEventListener(t,n,!1),G=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let i,o=0;o<e.length;o++)i=e.codePointAt(o),t=Math.imul(t^i,2246822519),n=Math.imul(n^i,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},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","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl"].map((e,t)=>[e,Math.max(0,t-1)])),te=e=>X(_[e]),ne=e=>{const t=e[X(Y[0])]||e[X(Y[1])]||e[X(Y[2])];if(!t)return-1;const n=t.split("-");let i=function(e=""){let t=-2;const n=G(X(e));return n in ee&&(t=ee[n]),t>4?t-4:t}(n[0]);return 0===i||(e=>e[2]===G(e[0]+e[1]))(n)||(i=-2),i},ie=Object.hasOwn||((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),oe={br:"\n",rb:"",bb:"",b:"",i:"",u:"","/":""},re=Object.keys(oe),ae=new RegExp(`<(${re.join("|")})>`,"gi"),se=(e,t)=>oe[t]??"",le=e=>t=>e(typeof t===I?window.chrome?t.replace(ae,se):(e=>e.replaceAll("<br>",S).replaceAll(/<\/?[^>]+>/gi,""))(t):t),ce={},ue=(de=function(s={}){const l={},f={},p=[],h={...o,expand:!s.collapsed||o.expanded,...s};let m="";function g(){p.length=0,m=""}function y(){delete h.event,g()}const b=()=>!!p.some(([e])=>e in i)||!!h.expand;function w(){if(0!==p.length){a[b()?"group":"groupCollapsed"](`%c${h.label}%c ${(e=>{const t=e.event||e.defaultEvent;return t?`${t}`:""})(h)} %c${h.showTime?m:""}`,e,"font-weight: bold;",t);for(const[e,...t]of p)a.assert(e in a,`Unknown console method: ${e}`),e in a&&a[e](...t);a.groupEnd(),y()}else y()}function v(){""===m&&(m=function(){const e=new Date,t=(t,n)=>e[t]().toString().padStart(n,"0");return`@ ${t("getHours",2)}:${t("getMinutes",2)}:${t("getSeconds",2)}.${t("getMilliseconds",3)}`}(),queueMicrotask(()=>queueMicrotask(w)))}function z(e,...t){0===p.length&&v(),p.push([e,...t])}function $(e=n,...t){l[e]?z("log",`${e}: ${performance.now()-l[e]} ms`,...t):z("timeLog",e,...t)}return{...d(h,u(h)),...d(console,e=>[e,(...t)=>z(e,...t)]),...d(r,c),assert:function(e,...t){!0!==e&&z("assert",e,...t)},count:function(e=n){f[e]?f[e]+=1:f[e]=1,z("log",`${e}: ${f[e]}`)},countReset:function(e=n){delete f[e]},endAutoGroup:w,errorBoundary:e=>(...t)=>{let n;try{n=e(...t)}catch(e){if(!Error.prototype.isPrototypeOf(e))throw e;z("error",e),w()}return n},event:function(e){v(),h.event=e},purge:g,time:function(e=n){v(),l[e]=performance.now()},timeEnd:function(e=n){$(e),delete l[e]},timeLog:$,touch:v}},de?.__esModule?de.default:de);var de;let fe=!0;const pe=ue({expand:!1,label:E}),he=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const me=e=>(t,...n)=>ce[t]?ce[t].console[e](...n):pe[e](...n);var ge;const ye=(ge="log",(e,...t)=>!0===(e=>ce[e]?ce[e].log:fe)(e)?me(ge)(e,...t):null),be=me("warn"),we=me("error"),ve=me("event"),ze=me("purge"),$e=me("endAutoGroup"),je=me("errorBoundary");const ke=le(e=>e),Te=(e,...t)=>ce[e]?ce[e].console.warn(...t.map(ke)):queueMicrotask(()=>{const n=le((e=>(...t)=>[`${g}(${e})`,...t].join(" "))(e));console?.warn(...t.map(n))}),xe=(e=>(t,n="renamed to")=>(i,o,r="",a="")=>e(a,`<rb>Deprecated ${t}(${i.replace("()","")})</>\n\nThe <b>${i}</> ${t.toLowerCase()} has been ${n} <b>${o}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(Te),Me=xe("Method"),Re=xe("Option");function Se(e){const{checkOrigin:t,iframe:{id:n,src:i,sandbox:o},initialisedFirstPage:r,waitForLoad:a,warningTimeout:s}=e,l=(e=>{try{return new URL(e).origin}catch(e){return null}})(i);ve(n,"noResponse"),Te(n,`<rb>No response from iframe</>\n\nThe iframe (<i>${n}</>) has not responded within ${s/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${t&&l?`\nThe <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${l}</>, 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`:""}${a&&!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 Oe={};const Ee=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:F,firstRun:!0,inPageLinks:!1,heightCalculationMethod:L,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:L,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof ce[e.id].onInit===W&&(Re("init()","onReady()","",e.id),ce[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),Ie={position:null,version:m};function Ce(e){function t(){He(F),Be(q),C("onResized",F)}function n(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function i(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=>A.slice(A.indexOf(y)+7+e);const r=(e,t)=>(n,i)=>{const o={};var r,a;r=function(){De(`${n} (${e})`,`${e}:${t()}`,i)},o[a=i]||(r(),o[a]=requestAnimationFrame(()=>{o[a]=null}))},a=(e,t)=>()=>{let n=!1;const i=t=>()=>{ce[l]?n&&n!==t||(e(t,l),n=t,requestAnimationFrame(()=>{n=!1})):s()},o=i(R),r=i("resize window");function a(e,t){t(window,R,o),t(window,M,r)}function s(){ve(l,`stop${t}`),a(0,V),c.disconnect(),u.disconnect(),V(ce[l].iframe,z,s)}const l=q,c=new ResizeObserver(i("pageObserver")),u=new ResizeObserver(i("iframeObserver"));ce[l]&&(ce[l][`stop${t}`]=s,Z(ce[l].iframe,z,s),a(0,Z),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),u.observe(ce[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},s=e=>()=>{e in ce[q]&&(ce[q][e](),delete ce[q][e])},l=r(k,function(){const e=document.body.getBoundingClientRect(),t=F.iframe.getBoundingClientRect(),{scrollY:n,scrollX:i,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:n,scrollLeft:i,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})}),c=r(T,function(){const{iframe:e}=F,{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:i,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})}),u=a(l,"PageInfo"),d=a(c,"ParentInfo"),f=s("stopPageInfo"),g=s("stopParentInfo");function v(e){const t=e.getBoundingClientRect();return Ne(),{x:Number(t.left)+Number(Ie.position.x),y:Number(t.top)+Number(Ie.position.y)}}function j(e){const t=e?v(F.iframe):{x:0,y:0};ye(q,`Reposition requested (offset x:%c${t.x}%c y:%c${t.y})`,p,h,p);const n=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(F,t),i=window.parentIframe||window.parentIFrame;i?function(t,n){setTimeout(()=>t["scrollTo"+(e?"Offset":"")](n.x,n.y))}(i,n):function(e){Ie.position=e,S(q)}(n)}function S(e){const{x:t,y:n}=Ie.position,i=ce[e]?.iframe;!1!==C("onScroll",{iframe:i,top:n,left:t,x:t,y:n})?Be(e):Fe()}function O(e){let t={};if(0===F.width&&0===F.height){const e=o(9).split(y);t={x:e[1],y:e[0]}}else t={x:F.width,y:F.height};C(e,{iframe:F.iframe,screenX:Number(t.x),screenY:Number(t.y),type:F.type})}const C=(e,t)=>We(q,e,t);function W(){const{height:e,iframe:n,msg:i,type:r,width:a}=F;switch(ce[q]?.firstRun&&function(){if(!ce[q])return;Ze(q,F.mode),ce[q].firstRun=!1}(),r){case"close":Ae(n);break;case $:l=o(6),C("onMessage",{iframe:F.iframe,message:JSON.parse(l)});break;case"mouseenter":O("onMouseEnter");break;case"mouseleave":O("onMouseLeave");break;case"beforeUnload":ye(q,"Ready state reset"),ce[q].initialised=!1;break;case b:ce[q].autoResize=JSON.parse(o(9));break;case"scrollBy":!function(){const e=F.width,t=F.height,n=window.parentIframe||window.parentIFrame||window;ye(q,`scrollBy: x: %c${e}%c y: %c${t}`,p,h,p),n.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]||"",n=decodeURIComponent(t);let i=document.getElementById(n)||document.getElementsByName(n)[0];i?function(){const e=v(i);ye(q,`Moving to in page link: %c#${t}`,p),Ie.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)}()}(o(9));break;case"title":!function(e,t){ce[t]?.syncTitle&&(ce[t].iframe.title=e,ye(t,`Set iframe title attribute: %c${e}`,p))}(i,q);break;case x:Pe(F);break;case w:t(),function(e){try{ce[e].sameOrigin=!!ce[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){ce[e].sameOrigin=!1}}(q),(s=i)!==m&&(void 0!==s||Te(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",n);break;default:if(0===a&&0===e)return void be(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===a||0===e)return;if(document.hidden)return;t()}var s,l}function L(e){if(!ce[e])throw new Error(`${F.type} No settings for ${e}. Message was: ${A}`)}let A=e.data;if("[iFrameResizerChild]Ready"===A)return N=e.source,void Object.values(ce).forEach((e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()})(N));var N;if(!(e=>P===`${e}`.slice(0,13)&&e.slice(13).split(y)[0]in ce)(A)){if(typeof A!==I)return;return void ve(E,"ignoredMessage")}const F=function(e){const t=e.slice(13).split(y),o=t[1]?Number(t[1]):0,r=ce[t[0]]?.iframe,a=getComputedStyle(r),s={iframe:r,id:t[0],height:o+n(a)+i(a),width:Number(t[2]),type:t[3],msg:t[4]};return t[5]&&(s.mode=t[5]),s}(A),{id:B,type:H}=F,q=B;q?(ve(q,H),je(q,function(t){L(q),F.type in{true:1,false:1,undefined:1}||(null!==F.iframe||(be(q,`The iframe (${F.id}) was not found.`),0))&&function(){const{origin:t,sameOrigin:n}=e;if(n)return!0;let i=ce[q]?.checkOrigin;if(i&&"null"!=`${t}`&&!(i.constructor===Array?function(){let e=0,n=!1;for(;e<i.length;e++)if(i[e]===t){n=!0;break}return n}():function(){const e=ce[q]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${F.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()})(A)):be("","iframeResizer received messageData without id, message was: ",A)}function We(e,t,n){let i=null,o=null;if(ce[e]){if(i=ce[e][t],typeof i!==W)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onBeforeClose"===t||"onScroll"===t)try{o=i(n)}catch(n){console.error(n),be(e,`Error in ${t} callback`)}else((e,...t)=>{setTimeout(()=>e(...t),0)})(i,n)}return o}function Le(e){const{id:t}=e;delete ce[t],delete e.iframeResizer}function Ae(e){const{id:t}=e;if(!1!==We(t,"onBeforeClose",t)){try{e.parentNode&&e.remove()}catch(e){be(t,e)}We(t,"onAfterClose",t),Le(e)}}function Ne(e){null===Ie.position&&(Ie.position={x:window.scrollX,y:window.scrollY})}function Fe(){Ie.position=null}function Be(e){null!==Ie.position&&(window.scrollTo(Ie.position.x,Ie.position.y),ye(e,`Set page position: %c${Ie.position.x}%c, %c${Ie.position.y}`,p,h,p),Fe())}function Pe(e){Ne(e.id),He(e),De(x,x,e.id)}function He(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i,ye(n,`Set ${t}: %c${i}`,p)}const{id:n}=e,{sizeHeight:i,sizeWidth:o}=ce[n];i&&t("height"),o&&t("width")}const qe=e=>e.split(y).filter((e,t)=>19!==t).join(y);function De(e,t,n){function i(i){const o=e in q?qe(t):t;ye(n,i,p,h,p),ye(n,`Message data: %c${o}`,p)}ve(n,e),ce[n]&&(ce[n]?.postMessageTarget?function(){const{iframe:o,postMessageTarget:r,sameOrigin:a,targetOrigin:s}=ce[n];if(a)try{return o.contentWindow.iframeChildListener(P+t),void i(`Sending message to iframe %c${n}%c via same origin%c`)}catch(t){e in q?ce[n].sameOrigin=!1:be(n,"Same origin messaging failed, falling back to postMessage")}i(`Sending message to iframe: %c${n}%c targetOrigin: %c${s}`),r.postMessage(P+t,s)}():be(n,`Iframe(${n}) not found`))}let Ue=0,Qe=!1,Je=!1;function Ze(t,n=-3){if(Qe)return;const i=Math.max(ce[t].mode,n);if(i>ce[t].mode&&(ce[t].mode=i),i<0)throw ze(t),ce[t].vAdvised||Te(t||"Parent",`${te(i+2)}${te(2)}`),ce[t].vAdvised=!0,te(i+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");i>0&&Je||function(t,n){queueMicrotask(()=>console.info(`%ciframe-resizer ${t}`,fe||n<1?"font-weight: bold;":e))}(`v${m} (${(e=>X(K[e]))(i)})`,i),i<1&&Te("Parent",te(3)),Qe=!0}const Ve=e=>t=>{function n(){ce[d]?.heightCalculationMethod in H&&Pe({iframe:t,height:1,width:1,type:w})}function i(){if(ce[d]){const{iframe:e}=ce[d],t={close:Ae.bind(null,e),disconnect:Le.bind(null,e),removeListeners(){Te(d,`<rb>Deprecated Method Name</>\n\nThe <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${J}\n`),this.disconnect()},resize(){Te(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."),De.bind(null,"Window resize",M,d)},moveToAnchor(e){((e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${i=t,i.charAt(0).toUpperCase()+i.slice(1)}`);var i})(e,I,"moveToAnchor(anchor) anchor"),De("Move to anchor",`moveToAnchor:${e}`,d)},sendMessage(e){e=JSON.stringify(e),De($,`${$}:${e}`,d)}};e.iframeResizer=t,e.iFrameResizer=t}}function o(e,t){const i=i=>()=>{if(!ce[e])return;const{firstRun:o,iframe:r}=ce[e];De(i,t,e),(e=>e===w)(i)&&(e=>"lazy"===e.loading)(r)||function(e,t){const n=t[e],{msgTimeout:i,warningTimeout:o}=n;o&&(i&&clearTimeout(i),n.msgTimeout=setTimeout(function(){const n=t[e];void 0!==n&&((e=>{e.msgTimeout=void 0})(n),function(e){const{initialised:t}=e;return t&&(e.initialisedFirstPage=!0),t}(n)||Se(n))},o))}(e,ce),o||n()},{iframe:o}=ce[e];ce[e].initChild=i(v),function(e,t){Z(e,z,()=>setTimeout(t,1))}(o,i(j)),function(e,t){const{iframe:n,waitForLoad:i}=ce[e];!0!==i&&((e=>{const{src:t,srcdoc:n}=e;return!n&&(null==t||""===t||"about:blank"===t)})(n)?setTimeout(()=>{ve(e,"noContent"),ye(e,"No content detected in the iframe, delaying initialisation")}):setTimeout(t))}(e,i(w))}function r(e){return e?(("sizeWidth"in e||"sizeHeight"in e||b in e)&&Te(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>${F}</>, <bb>${B}</>, <bb>${N}</> or <bb>${A}</>.\n`),e):{}}function a(e){const t=ce[e]?.iframe?.title;return""===t||void 0===t}function s(e,t){ie(ce[d],e)&&(Te(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=>ie(e,"onMouseEnter")||ie(e,"onMouseLeave");function c(e){var n,i;ce[d]={...ce[d],iframe:t,remoteHost:t?.src.split("/").slice(0,3).join("/"),...Ee,...r(e),mouseEvents:l(e),mode:ne(e),syncTitle:a(d)},s("offset","offsetSize"),s("onClose","onBeforeClose"),s("onClosed","onAfterClose"),ve(d,"setup"),function(){const{direction:e}=ce[d];switch(e){case F:break;case B:ce[d].sizeHeight=!1;case N:ce[d].sizeWidth=!0;break;case A: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`)}}(),(n=e?.offsetSize||e?.offset)&&(ce[d].direction===F?ce[d].offsetHeight=n:ce[d].offsetWidth=n),ce[d].warningTimeout||ye(d,"warningTimeout:%c disabled",p),null===ce[d].postMessageTarget&&(ce[d].postMessageTarget=t.contentWindow),ce[d].targetOrigin=!0===ce[d].checkOrigin?""===(i=ce[d].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const u=()=>g in t,d=function(n){if(n&&typeof n!==I)throw new TypeError("Invalid id for iFrame. Expected String");return""!==n&&n||(n=function(){let t=e?.id||Ee.id+Ue++;return null!==document.getElementById(t)&&(t+=Ue++),t}(),t.id=n,ve(n,"assignId")),n}(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 n=ie(t,"log"),i=typeof t.log===I,o=n?!!i||t.log:Ee.log;ie(t,"logExpand")||(t.logExpand=n&&i?t.log===D:Ee.logExpand),function(e){-1===e?.log&&(e.log=!1,Je=!0)}(t),function({enabled:e,expand:t,iframeId:n}){const i=ue({expand:t,label:he(n)});fe=e,ce[n]||(ce[n]={console:i})}({enabled:o,expand:t.logExpand,iframeId:e}),i&&!(t.log in Q)&&we(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=o}(d,e),je(d,function(e){u()?be(d,`Ignored iframe (${d}), already setup.`):(c(e),function(e){if(!0===Oe[e])return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;Oe[e]=!0;const n=Array.from(t).flatMap(e=>[S,e,S]);Te(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:`,...n,S)}(d),function(){if(Qe)return;const{mode:e}=ce[d];-1!==e&&Ze(d,e)}(),Xe(),function(){switch(t.style.overflow=!1===ce[d]?.scrolling?"hidden":L,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:n,bodyMargin:i,bodyPadding:o,heightCalculationMethod:r,inPageLinks:a,license:s,log:l,logExpand:c,mouseEvents:u,offsetHeight:d,offsetWidth:f,mode:p,sizeHeight:h,sizeWidth:m,tolerance:g,widthCalculationMethod:b}=ce[e];return[e,"8",m,l,"32",!0,t,i,r,n,o,g,a,O,b,u,d,f,h,s,Ie.version,p,"",c].join(y)}(d)),i(),$e(d))})(e),t?.iframeResizer};function Ge(){!0!==document.hidden&&((e,t)=>{Object.values(ce).filter(({autoResize:e,firstRun:t})=>e&&!t).forEach(({iframe:n})=>De(e,t,n.id))})("tabVisible",M)}const Xe=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})(()=>{Z(window,$,Ce),Z(document,"visibilitychange",Ge),window.iframeParentListener=e=>setTimeout(()=>Ce({data:e,sameOrigin:!0}))});switch(!0){case void 0===window.jQuery:be("","Unable to bind to jQuery, it is not available.");break;case!window.jQuery.fn:be("","Unable to bind to jQuery, it is not fully loaded.");break;case window.jQuery.fn.iframeResize:be("","iframeResize is already assigned to jQuery.fn.");break;default:window.jQuery.fn.iframeResize=function(e){const t=Ve(e);return this.filter("iframe").each((e,n)=>t(n)).end()},window.jQuery.fn.iFrameResize=function(e){return Me("iFrameResize()","iframeResize()","","jQuery"),this.iframeResize(e)}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/jquery",
3
- "version": "5.5.8",
3
+ "version": "5.5.9",
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"
37
+ "@iframe-resizer/core": "5.5.9"
38
38
  }
39
39
  }