@iframe-resizer/core 6.0.0-beta.1 → 6.0.0-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/index.umd.js CHANGED
@@ -1,38 +1,38 @@
1
- (function(b,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("auto-console-group")):typeof define=="function"&&define.amd?define(["exports","auto-console-group"],r):(b=typeof globalThis<"u"?globalThis:b||self,r(b.connectResizer={},b.acg))})(this,(function(b,r){"use strict";const G="6.0.0-beta.1",te="iframeResizer",Ze="[iFrameResizerChild]Ready",ne="autoResize",Je="beforeUnload",Ye="close",Xe="inPageLink",H="init",oe="iframeReady",Ke="lazy",F="load",k="message",Qe="mouseenter",et="mouseleave",ie="onload",se="pageInfo",re="parentInfo",tt="pageInfoStop",nt="parentInfoStop",D="reset",B="resize",ot="scrollBy",it="scrollTo",st="scrollToOffset",rt="title",ct="height",lt="width",at="offset",ut="offsetSize",ce="scroll",ft="hidden",pt="child",W="parent",U="string",dt="number",le="object",ae="function",V="auto",ht="font-weight: bold;",ue="none",fe="both",P="vertical",pe="horizontal",gt="omit",mt=k.length,N="[iFrameSizer]",q=N.length,yt=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),de=Object.freeze({[ie]:1,[H]:1,[oe]:1}),R="expanded",S="collapsed",Z=0,J=1,Y=2,bt=Object.freeze({[R]:1,[S]:1}),he="Use of the old name will be removed in a future version of <i>iframe-resizer</>.",ge=e=>typeof e===le&&e!==null,X=e=>typeof e===U;function vt(e){if(!ge(e))return!1;try{return e.tagName==="IFRAME"||e instanceof HTMLIFrameElement}catch{return!1}}const wt=(e,...t)=>setTimeout(()=>e(...t),0),zt=e=>{let t=!1;return function(...n){return t?void 0:(t=!0,e.apply(this,n))}},It=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),$=(e,t)=>Object.hasOwn?Object.hasOwn(e,t):It(e,t),Et=e=>e,Tt=e=>e.charAt(0).toUpperCase()+e.slice(1),Ot=e=>e?.__esModule?e.default:e,Lt=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Tt(t)}`)},Ht=e=>(t,n="renamed to")=>(o,s,l="",c="")=>e(c,`<rb>Deprecated ${t}(${o.replace("()","")})</>
1
+ (function(b,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("auto-console-group")):typeof define=="function"&&define.amd?define(["exports","auto-console-group"],r):(b=typeof globalThis<"u"?globalThis:b||self,r(b.connectResizer={},b.acg))})(this,(function(b,r){"use strict";const G="6.0.0-beta.2",te="iframeResizer",Je="[iFrameResizerChild]Ready",ne="autoResize",Ye="beforeUnload",Xe="close",Ke="inPageLink",H="init",oe="iframeReady",Qe="lazy",F="load",M="message",et="mouseenter",tt="mouseleave",ie="onload",se="pageInfo",re="parentInfo",nt="pageInfoStop",ot="parentInfoStop",D="reset",B="resize",it="scrollBy",st="scrollTo",rt="scrollToOffset",lt="title",ct="height",at="width",ut="offset",ft="offsetSize",le="scroll",pt="hidden",ht="child",W="parent",U="string",dt="number",ce="object",ae="function",V="auto",yt="font-weight: bold;",ue="none",fe="both",P="vertical",pe="horizontal",gt="omit",mt=M.length,N="[iFrameSizer]",q=N.length,bt=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),he=Object.freeze({[ie]:1,[H]:1,[oe]:1}),R="expanded",k="collapsed",Z=0,J=1,Y=2,vt=Object.freeze({[R]:1,[k]:1}),de="Use of the old name will be removed in a future version of <i>iframe-resizer</>.",ye=e=>typeof e===ce&&e!==null,X=e=>typeof e===U;function zt(e){if(!ye(e))return!1;try{return e.tagName==="IFRAME"||e instanceof HTMLIFrameElement}catch{return!1}}const wt=(e,...t)=>setTimeout(()=>e(...t),0),It=e=>{let t=!1;return function(...n){return t?void 0:(t=!0,e.apply(this,n))}},Et=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),$=(e,t)=>Object.hasOwn?Object.hasOwn(e,t):Et(e,t),Tt=e=>e,Ot=e=>e.charAt(0).toUpperCase()+e.slice(1),Lt=e=>e?.__esModule?e.default:e,Ht=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${Ot(t)}`)},Rt=e=>(t,n="renamed to")=>(o,s,c="",l="")=>e(l,`<rb>Deprecated ${t}(${o.replace("()","")})</>
2
2
 
3
- The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${l}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`),me={br:`
4
- `,rb:"\x1B[31;1m",bb:"\x1B[34;1m",b:"\x1B[1m",i:"\x1B[3m",u:"\x1B[4m","/":"\x1B[m"},Rt=Object.keys(me),St=new RegExp(`<(${Rt.join("|")})>`,"gi"),Mt=(e,t)=>me[t]??"",kt=e=>e.replace(St,Mt),$t=e=>e.replaceAll("<br>",`
5
- `).replaceAll(/<\/?[^>]+>/gi,""),ye=e=>t=>e(X(t)?window.chrome?kt(t):$t(t):t),i={},be=Ot(r);let K=!0;const At=be({expand:!1,label:W}),jt=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`,Gt=e=>i[e]?i[e].log:K;function Pt({enabled:e,expand:t,iframeId:n}){const o=be({expand:t,label:jt(n)});K=e,i[n]||(i[n]={console:o})}const I=e=>(t,...n)=>i[t]?i[t].console[e](...n):At[e](...n),ve=e=>(t,...n)=>Gt(t)===!0?I(e)(t,...n):null,u=ve("log"),y=u,Nt=ve("debug"),w=I("warn"),Ct=I("error"),v=I("event"),_t=I("purge"),xt=I("endAutoGroup"),we=I("errorBoundary");function Ft(e,t){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,K||t<1?ht:r.NORMAL))}const Dt=e=>(...t)=>[`${te}(${e})`,...t].join(" "),Bt=ye(Et),m=(e,...t)=>i[e]?i[e].console.warn(...t.map(Bt)):queueMicrotask(()=>{const n=ye(Dt(e));console?.warn(...t.map(n))}),Wt=Ht(m)("Option"),C=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:P,firstRun:!0,inPageLinks:!1,heightCalculationMethod:V,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:V,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof i[e.id].onInit===ae&&(Wt("init()","onReady()","",e.id),i[e.id].onInit(e))},onResized(){},onScroll:()=>!0});let ze=0;function Ut(e){const t=e?.id||C.id+ze++;return document.getElementById(t)===null?t:`${t}${ze++}`}function Vt(e,t){let{id:n}=e;if(n&&!X(n))throw new TypeError("Invalid id for iFrame. Expected String");return(!n||n==="")&&(n=Ut(t),e.id=n,v(n,"assignId"),u(n,`Added missing iframe ID: ${n} (${e.src})`)),n}function qt(e){const{search:t}=window.location;if(t.includes("ifrlog"))switch(new URLSearchParams(t).get("ifrlog")){case String(Z):{e.log=!1;break}case R:case String(Y):{e.log=R;break}case S:case String(J):{e.log=S;break}default:e.log=S}}const A=(e,t,n,o)=>e.addEventListener(t,n,o||!1),Ie=(e,t,n)=>e.removeEventListener(t,n,!1),Zt=e=>e.split(":").filter((t,n)=>n!==19).join(":");function Jt(e,t,n){function o(f){const p=e in de?Zt(t):t;y(n,f,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),y(n,`Message data: %c${p}`,r.HIGHLIGHT)}const{iframe:s,postMessageTarget:l,sameOrigin:c,targetOrigin:a}=i[n];if(c)try{s.contentWindow.iframeChildListener(N+t),o(`Sending message to iframe %c${n}%c via same origin%c`);return}catch{e in de?(i[n].sameOrigin=!1,u(n,"New iframe does not support same origin")):w(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a.join(", ")}`);for(const f of a)l.postMessage(N+t,f)}function E(e,t,n){if(v(n,e),!i[n]?.postMessageTarget){w(n,"Iframe not found");return}Jt(e,t,n)}const Yt=(e,t)=>Object.values(i).filter(({autoResize:n,firstRun:o})=>n&&!o).forEach(({iframe:n})=>E(e,t,n.id));function Xt(){document.hidden!==!0&&Yt("tabVisible",B)}function Kt(e){if(e.boxSizing!=="border-box")return 0;const t=e.paddingTop?parseInt(e.paddingTop,10):0,n=e.paddingBottom?parseInt(e.paddingBottom,10):0;return t+n}function Qt(e){if(e.boxSizing!=="border-box")return 0;const t=e.borderTopWidth?parseInt(e.borderTopWidth,10):0,n=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return t+n}function en(e){const t=e.slice(q).split(":"),n=t[1]?Number(t[1]):0,o=i[t[0]]?.iframe,s=getComputedStyle(o),l={iframe:o,id:t[0],height:n+Kt(s)+Qt(s),width:Number(t[2]),type:t[3],msg:t[4],message:t[4]};return t[5]&&(l.mode=t[5]),l}const tn={true:1,false:1,undefined:1};function nn(e){const{id:t,msg:n,iframe:o}=e,s=vt(o);return s||(u(t,`Received: %c${n}`,r.HIGHLIGHT),w(t,"The target iframe was not found.")),s}function on(e,t){const{id:n}=e,{data:o,origin:s}=t;if("sameOrigin"in t&&t.sameOrigin)return!0;const c=i[n]?.checkOrigin;function a(){function f(){u(n,`Checking connection is from allowed list of origins: %c${c}`,r.HIGHLIGHT);for(const h of c)if(h===s)return!0;return!1}function p(){const h=i[n]?.remoteHost;return u(n,`Checking connection is from: %c${h}`,r.HIGHLIGHT),s===h}return c.constructor===Array?f():p()}if(c&&`${s}`!="null"&&!a())throw new Error(`Unexpected message received from: ${s} for ${n}. Message was: ${o}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`);return!0}const sn=e=>N===`${e}`.slice(0,q)&&e.slice(q).split(":")[0]in i;function rn(e){const{id:t,type:n}=e,o=n in tn;return o&&u(t,"Ignoring init message from meta parent page"),o}function cn(e){try{i[e].sameOrigin=!!i[e]?.iframe?.contentWindow?.iframeChildListener}catch{i[e].sameOrigin=!1}u(e,`sameOrigin: %c${i[e].sameOrigin}`,r.HIGHLIGHT)}function ln(e,t){if(t!==G){if(t===void 0){m(e,`<rb>Legacy version detected in iframe</>
3
+ The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${c}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`),ge={br:`
4
+ `,rb:"\x1B[31;1m",bb:"\x1B[34;1m",b:"\x1B[1m",i:"\x1B[3m",u:"\x1B[4m","/":"\x1B[m"},kt=Object.keys(ge),St=new RegExp(`<(${kt.join("|")})>`,"gi"),Mt=(e,t)=>ge[t]??"",$t=e=>e.replace(St,Mt),At=e=>e.replaceAll("<br>",`
5
+ `).replaceAll(/<\/?[^>]+>/gi,""),me=e=>t=>e(X(t)?window.chrome?$t(t):At(t):t),i={},be=Lt(r);let K=!0;const jt=be({expand:!1,label:W}),Gt=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`,Pt=e=>i[e]?i[e].log:K;function Nt({enabled:e,expand:t,iframeId:n}){const o=be({expand:t,label:Gt(n)});K=e,i[n]||(i[n]={console:o})}const I=e=>(t,...n)=>i[t]?i[t].console[e](...n):jt[e](...n),ve=e=>(t,...n)=>Pt(t)===!0?I(e)(t,...n):null,u=ve("log"),m=u,Ct=ve("debug"),z=I("warn"),_t=I("error"),v=I("event"),xt=I("purge"),Ft=I("endAutoGroup"),ze=I("errorBoundary");function Dt(e,t){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,K||t<1?yt:r.NORMAL))}const Bt=e=>(...t)=>[`${te}(${e})`,...t].join(" "),Wt=me(Tt),g=(e,...t)=>i[e]?i[e].console.warn(...t.map(Wt)):queueMicrotask(()=>{const n=me(Bt(e));console?.warn(...t.map(n))}),Ut=Rt(g)("Option"),C=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:P,firstRun:!0,inPageLinks:!1,heightCalculationMethod:V,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:V,onBeforeClose:()=>!0,onAfterClose(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{typeof i[e.id].onInit===ae&&(Ut("init()","onReady()","",e.id),i[e.id].onInit(e))},onResized(){},onScroll:()=>!0});let we=0;function Vt(e){const t=e?.id||C.id+we++;return document.getElementById(t)===null?t:`${t}${we++}`}function qt(e,t){let{id:n}=e;if(n&&!X(n))throw new TypeError("Invalid id for iFrame. Expected String");return(!n||n==="")&&(n=Vt(t),e.id=n,v(n,"assignId"),u(n,`Added missing iframe ID: ${n} (${e.src})`)),n}function Zt(e){const{search:t}=window.location;if(t.includes("ifrlog"))switch(new URLSearchParams(t).get("ifrlog")){case String(Z):{e.log=!1;break}case R:case String(Y):{e.log=R;break}case k:case String(J):{e.log=k;break}default:e.log=k}}const A=(e,t,n,o)=>e.addEventListener(t,n,o||!1),Ie=(e,t,n)=>e.removeEventListener(t,n,!1),Jt=e=>e.split(":").filter((t,n)=>n!==19).join(":");function Yt(e,t,n){function o(f){const p=e in he?Jt(t):t;m(n,f,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),m(n,`Message data: %c${p}`,r.HIGHLIGHT)}const{iframe:s,postMessageTarget:c,sameOrigin:l,targetOrigin:a}=i[n];if(l)try{s.contentWindow.iframeChildListener(N+t),o(`Sending message to iframe %c${n}%c via same origin%c`);return}catch{e in he?(i[n].sameOrigin=!1,u(n,"New iframe does not support same origin")):z(n,"Same origin messaging failed, falling back to postMessage")}o(`Sending message to iframe: %c${n}%c targetOrigin: %c${a.join(", ")}`);for(const f of a)c.postMessage(N+t,f)}function E(e,t,n){if(v(n,e),!i[n]?.postMessageTarget){z(n,"Iframe not found");return}Yt(e,t,n)}const Xt=(e,t)=>Object.values(i).filter(({autoResize:n,firstRun:o})=>n&&!o).forEach(({iframe:n})=>E(e,t,n.id));function Kt(){document.hidden!==!0&&Xt("tabVisible",B)}function Qt(e){if(e.boxSizing!=="border-box")return 0;const t=e.paddingTop?parseInt(e.paddingTop,10):0,n=e.paddingBottom?parseInt(e.paddingBottom,10):0;return t+n}function en(e){if(e.boxSizing!=="border-box")return 0;const t=e.borderTopWidth?parseInt(e.borderTopWidth,10):0,n=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return t+n}function tn(e){const t=e.slice(q).split(":"),n=t[1]?Number(t[1]):0,o=i[t[0]]?.iframe,s=o?getComputedStyle(o):null,c=s?Qt(s)+en(s):0,l={iframe:o,id:t[0],height:n+c,width:Number(t[2]),type:t[3],msg:t[4],message:t[4]};return t[5]&&(l.mode=t[5]),l}const nn={true:1,false:1,undefined:1};function on(e){const{id:t,msg:n,iframe:o}=e,s=zt(o);return s||(u(t,`Received: %c${n}`,r.HIGHLIGHT),z(t,"The target iframe was not found.")),s}function sn(e,t){const{id:n}=e,{data:o,origin:s}=t;if("sameOrigin"in t&&t.sameOrigin)return!0;const l=i[n]?.checkOrigin;function a(){function f(){u(n,`Checking connection is from allowed list of origins: %c${l}`,r.HIGHLIGHT);for(const h of l)if(h===s)return!0;return!1}function p(){const h=i[n]?.remoteHost;return u(n,`Checking connection is from: %c${h}`,r.HIGHLIGHT),s===h}return l.constructor===Array?f():p()}if(l&&`${s}`!="null"&&!a())throw new Error(`Unexpected message received from: ${s} for ${n}. Message was: ${o}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`);return!0}const rn=e=>N===`${e}`.slice(0,q)&&e.slice(q).split(":")[0]in i;function ln(e){const{id:t,type:n}=e,o=n in nn;return o&&u(t,"Ignoring init message from meta parent page"),o}function cn(e){try{i[e].sameOrigin=!!i[e]?.iframe?.contentWindow?.iframeChildListener}catch{i[e].sameOrigin=!1}u(e,`sameOrigin: %c${i[e].sameOrigin}`,r.HIGHLIGHT)}function an(e,t){if(t!==G){if(t===void 0){g(e,`<rb>Legacy version detected in iframe</>
6
6
 
7
7
  Detected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.
8
8
 
9
9
  See <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.
10
- `);return}u(e,`Version mismatch (Child: %c${t}%c !== Parent: %c${G})`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT)}}function T(e,t,n){if(!i[e])return null;const o=i[e][t];if(typeof o!==ae)throw new TypeError(`${t} on iframe[${e}] is not a function`);if(t!=="onBeforeClose"&&t!=="onScroll")return wt(o,n);try{return o(n)}catch(s){return console.error(s),w(e,`Error in ${t} callback`),null}}function an(e,t){const{id:n,iframe:o}=e;u(n,`onMessage passed: {iframe: %c${n}%c, message: %c${t}%c}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT,r.FOREGROUND),T(n,"onMessage",{iframe:o,message:JSON.parse(t)})}function _(e,t){const{lastMessage:n}=i[e];return n.slice(n.indexOf(":")+mt+t)}function Ee(e,t){const{id:n,iframe:o,height:s,type:l,width:c}=t;let a={x:0,y:0};if(c===0&&s===0){const f=_(n,9).split(":");a={x:f[1],y:f[0]}}else a={x:c,y:s};T(n,e,{iframe:o,screenX:Number(a.x),screenY:Number(a.y),type:l})}const d={position:null,version:G};function Te(){d.position=null}const un=()=>d.position;function fn(e){d.position=e}function Oe(e){return d.position===null&&(d.position={x:window.scrollX,y:window.scrollY}),u(e,`Get page position: %c${d.position.x}%c, %c${d.position.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),d.position}function Le(e){d.position!==null&&(window.scrollTo(d.position.x,d.position.y),y(e,`Set page position: %c${d.position.x}%c, %c${d.position.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),Te())}function He(e,t){const{id:n}=t,o=`${t[e]}px`;i[n].iframe.style[e]=o,y(n,`Set ${e}: %c${o}`,r.HIGHLIGHT)}function Re(e){const{id:t}=e,{sizeHeight:n,sizeWidth:o}=i[t];n&&He(ct,e),o&&He(lt,e)}function Se(e){const{id:t}=e;Re(e),Le(t),T(t,"onResized",e)}function Me(e){const{id:t}=e;u(t,"Disconnected from iframe"),delete i[t],delete e.iframeResizer}function ke(e){const{id:t}=e;if(T(t,"onBeforeClose",t)===!1){u(t,"Close iframe cancelled by onBeforeClose");return}u(t,`Removing iFrame: %c${t}`,r.HIGHLIGHT);try{e.parentNode&&e.remove()}catch(n){w(t,n)}T(t,"onAfterClose",t),Me(e)}function $e(e){const{id:t,type:n}=e;u(t,`Size reset requested by ${n===H?"parent page":"child page"}`),Oe(t),Re(e),E(D,D,t)}const Ae=(e,t)=>{const n={};return(o,s)=>{const{iframe:l}=i[s];function c(f,p){n[p]||(f(),n[p]=requestAnimationFrame(()=>{n[p]=null}))}function a(){E(`${o} (${e})`,`${e}:${t(l)}`,s)}c(a,s)}},je=e=>t=>{e in i[t]&&(i[t][e](),delete i[t][e])},Ge=((e,t)=>n=>{let o=!1;const s=g=>()=>{i[n]?(!o||o===g)&&(e(g,n),o=g,requestAnimationFrame(()=>{o=!1})):h()},l=s(ce),c=s("resize window"),a=new ResizeObserver(s("pageObserver")),f=new ResizeObserver(s("iframeObserver"));function p(g,L){u(n,`${g}listeners for send${t}`),L(window,ce,l),L(window,B,c)}function h(){v(n,`stop${t}`),p("Remove ",Ie),a.disconnect(),f.disconnect(),i[n]&&Ie(i[n].iframe,F,h)}function M(){p("Add ",A),a.observe(document.body),f.observe(i[n].iframe)}i[n]&&(i[n][`stop${t}`]=h,A(i[n].iframe,F,h),M())});function pn(e){const t=document.body.getBoundingClientRect(),n=e.getBoundingClientRect(),{scrollY:o,scrollX:s,innerHeight:l,innerWidth:c}=window,{clientHeight:a,clientWidth:f}=document.documentElement;return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(a,l||0),clientWidth:Math.max(f,c||0),offsetTop:Math.trunc(n.top-t.top),offsetLeft:Math.trunc(n.left-t.left),scrollTop:o,scrollLeft:s,documentHeight:a,documentWidth:f,windowHeight:l,windowWidth:c})}const dn=Ae(se,pn),hn=Ge(dn,"PageInfo"),gn=je("stopPageInfo");function mn(e){const{scrollWidth:t,scrollHeight:n}=document.documentElement,{width:o,height:s,offsetLeft:l,offsetTop:c,pageLeft:a,pageTop:f,scale:p}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:s,offsetLeft:l,offsetTop:c,pageLeft:a,pageTop:f,scale:p}})}const yn=Ae(re,mn),bn=Ge(yn,"ParentInfo"),vn=je("stopParentInfo");function Pe(e){const t=e.getBoundingClientRect(),n=Oe(e.id);return{x:Number(t.left)+Number(n.x),y:Number(t.top)+Number(n.y)}}function Ne(e){const{x:t,y:n}=un(),o=i[e]?.iframe;if(T(e,"onScroll",{iframe:o,top:n,left:t,x:t,y:n})===!1){Te();return}Le(e)}function wn(e){const{id:t,height:n,width:o}=e,s=window.parentIframe||window.parentIFrame||window;y(t,`scrollBy: x: %c${o}%c y: %c${n}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),s.scrollBy(o,n)}const Ce=e=>t=>{const{id:n,iframe:o,height:s,width:l}=t;function c(g){fn(g),Ne(n)}function a(g,L){g[`scrollTo${e?"Offset":""}`](L.x,L.y)}const f=g=>({x:l+g.x,y:s+g.y}),p=e?Pe(o):{x:0,y:0},h=f(p),M=window.parentIframe||window.parentIFrame;y(n,`Reposition requested (offset x:%c${p.x}%c y:%c${p.y})`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),M?a(M,h):c(h)},zn=Ce(!1),In=Ce(!0);function En(e,t,n){const{x:o,y:s}=Pe(n);y(e,`Moving to in page link: %c#${t}`,r.HIGHLIGHT),d.position={x:o,y:s},Ne(e),window.location.hash=t}function Tn(e,t){const n=window.parentIframe||window.parentIFrame;if(!n){u(e,`In page link #${t} not found`);return}n.moveToAnchor(t)}function On(e,t){const n=t.split("#")[1]||"",o=decodeURIComponent(n),s=document.getElementById(o)||document.getElementsByName(o)[0];if(s){En(e,n,s);return}if(window.top===window.self){u(e,`In page link #${n} not found`);return}Tn(e,n)}function Ln(e){const t=i[e]?.iframe?.title;return t===""||t===void 0}function Hn(e,t){i[e]?.syncTitle&&(i[e].iframe.title=t,y(e,`Set iframe title attribute: %c${t}`,r.HIGHLIGHT))}const x=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,s=0;s<e.length;s++)o=e.codePointAt(s),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},z=e=>e.replace(/[A-Za-z]/g,t=>String.fromCodePoint((t<="Z"?90:122)>=(t=t.codePointAt(0)+19)?t:t-26)),Rn=new Date,_e=e=>new Set(Array.from({length:9},e)),Sn=e=>[e[0],...e.slice(1).map(t=>`${t} - lewpylk`),`${e[4]} - lewpylk`,...e.slice(1)],j=["spjluzl","rlf","clyzpvu","rlf2","nlaMbssFlhy"],Mn=["<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.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> fvb jhu bzl aol mpyza 11 johyhjalyz vm fvb spjlujl rlf av nla h 60% kpzjvbua ha <ii>oaaw://pmyhtl-ylzpgly.jvt</>.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Av bwnyhkl av clyzpvu 6 vm<p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt sltvu-zxbllgf.jvt.","<yi>VLT rlf lewpylk</><iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt sltvu-zxbllgf.jvt."],kn=Sn(["NWSc3","zvsv","wyv","ibzpulzz","VLT"]),xe=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","1foobarqaz","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl","igb1wzrjqr"].map((e,t)=>[e,Math.max(0,t-1)])),Fe=Rn[z(j[4])](),$n=_e((e,t)=>x(`${Fe+t}`)),An=_e((e,t)=>x(`${Fe-++t}`)),jn=e=>$n.has(e)?9:An.has(e)?5:-2,O=e=>z(Mn[e]),Gn=e=>z(kn[e]),Pn=e=>{const t=e[z(j[0])]||e[z(j[1])]||e[z(j[2])]||e[z(j[3])];if(!t)return-1;const n=t.split("-");let o=(function(s="",l=""){let c=-2;const a=x(z(s));return a in xe&&(c=xe[a]),c===9?jn(l):c})(...n);return o===0||(s=>s[2]===x(s[0]+s[1]))(n)||(o=-2),o};let Q=!1,De=!1;function Be(e,t=-3){if(Q)return;const n=Math.max(i[e].mode,t);if(n>i[e].mode&&(i[e].mode=n),n<0)throw _t(e),i[e].vAdvised||m(e||"Parent",`${O(n+2)}${O(2)}`),i[e].vAdvised=!0,O(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");switch(n>5&&De||Ft(`v${G} (${Gn(n)})`,n),n){case 1:case 2:case 3:m(e,O(6));break;case 4:m(e,O(7));break;case 5:m(e,O(8));break;default:n<1&&m("Parent",O(3))}Q=!0}function Nn(e){if(Q)return;const{mode:t}=i[e];t>5&&Be(e,t)}function Cn(e){e?.log===-1&&(e.log=!1,De=!0)}function _n(e,t){i[e]&&(u(e,`First run for ${e}`),Be(e,t===void 0?void 0:Number(t)),i[e].firstRun=!1)}function xn(e){const{height:t,id:n,iframe:o,mode:s,message:l,type:c,width:a}=e,{lastMessage:f}=i[n];switch(i[n]?.firstRun&&_n(n,s),u(n,`Received: %c${f}`,r.HIGHLIGHT),c){case ne:i[n].autoResize=JSON.parse(_(n,9));break;case Je:y(n,"Ready state reset"),i[n].initialised=!1;break;case Ye:ke(o);break;case Xe:On(n,_(n,9));break;case H:Se(e),cn(n),ln(n,l),i[n].initialised=!0,T(n,"onReady",o);break;case k:an(e,_(n,6));break;case Qe:Ee("onMouseEnter",e);break;case et:Ee("onMouseLeave",e);break;case se:hn(n);break;case re:bn(n);break;case tt:gn(n);break;case nt:vn(n);break;case D:$e(e);break;case ot:wn(e);break;case it:zn(e);break;case st:In(e);break;case rt:Hn(n,l);break;default:if(a===0&&t===0){w(n,`Unsupported message received (${c}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);return}if(a===0||t===0){u(n,"Ignoring message with 0 height or width");return}if(document.hidden){u(n,"Page hidden - ignored resize request");return}Se(e)}}const Fn=e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()},Dn=e=>Object.values(i).forEach(Fn(e));function We(e){const t=e.data;if(t===Ze){Dn(e.source);return}if(!sn(t)){if(typeof t!==U)return;v(W,"ignoredMessage"),Nt(W,t);return}const n=en(t),{id:o,type:s}=n;switch(v(o,s),!0){case!i[o]:throw new Error(`${s} No settings for ${o}. Message was: ${t}`);case!nn(n):case rn(n):case!on(n,e):return;default:i[o].lastMessage=e.data,we(o,xn)(n)}}const Bn=zt(()=>{A(window,k,We),A(document,"visibilitychange",Xt),window.iframeParentListener=e=>setTimeout(()=>We({data:e,sameOrigin:!0}))}),Ue={};function Wn(e){if(Ue[e]===!0)return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;Ue[e]=!0;const n=Array.from(t).flatMap(o=>[`
10
+ `);return}u(e,`Version mismatch (Child: %c${t}%c !== Parent: %c${G})`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT)}}function T(e,t,n){if(!i[e])return null;const o=i[e][t];if(typeof o!==ae)throw new TypeError(`${t} on iframe[${e}] is not a function`);if(t!=="onBeforeClose"&&t!=="onScroll")return wt(o,n);try{return o(n)}catch(s){return console.error(s),z(e,`Error in ${t} callback`),null}}function un(e,t){const{id:n,iframe:o}=e;u(n,`onMessage passed: {iframe: %c${n}%c, message: %c${t}%c}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT,r.FOREGROUND),T(n,"onMessage",{iframe:o,message:JSON.parse(t)})}function _(e,t){const{lastMessage:n}=i[e];return n.slice(n.indexOf(":")+mt+t)}function Ee(e,t){const{id:n,iframe:o,height:s,type:c,width:l}=t;let a={x:0,y:0};if(l===0&&s===0){const f=_(n,9).split(":");a={x:f[1],y:f[0]}}else a={x:l,y:s};T(n,e,{iframe:o,screenX:Number(a.x),screenY:Number(a.y),type:c})}const d={position:null,version:G};function Te(){d.position=null}const fn=()=>d.position;function pn(e){d.position=e}function Oe(e){return d.position===null&&(d.position={x:window.scrollX,y:window.scrollY}),u(e,`Get page position: %c${d.position.x}%c, %c${d.position.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),d.position}function Le(e){d.position!==null&&(window.scrollTo(d.position.x,d.position.y),m(e,`Set page position: %c${d.position.x}%c, %c${d.position.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),Te())}function He(e,t){const{id:n}=t,o=`${t[e]}px`;i[n].iframe.style[e]=o,m(n,`Set ${e}: %c${o}`,r.HIGHLIGHT)}function Re(e){const{id:t}=e,{sizeHeight:n,sizeWidth:o}=i[t];n&&He(ct,e),o&&He(at,e)}function ke(e){const{id:t}=e;Re(e),Le(t),T(t,"onResized",e)}function Se(e){const{id:t}=e;u(t,"Disconnected from iframe"),delete i[t],delete e.iframeResizer}function Me(e){const{id:t}=e;if(T(t,"onBeforeClose",t)===!1){u(t,"Close iframe cancelled by onBeforeClose");return}u(t,`Removing iFrame: %c${t}`,r.HIGHLIGHT);try{e.parentNode&&e.remove()}catch(n){z(t,n)}T(t,"onAfterClose",t),Se(e)}function $e(e){const{id:t,type:n}=e;u(t,`Size reset requested by ${n===H?"parent page":"child page"}`),Oe(t),Re(e),E(D,D,t)}const Ae=(e,t)=>{const n={};return(o,s)=>{const{iframe:c}=i[s];function l(f,p){n[p]||(f(),n[p]=requestAnimationFrame(()=>{n[p]=null}))}function a(){E(`${o} (${e})`,`${e}:${t(c)}`,s)}l(a,s)}},je=e=>t=>{e in i[t]&&(i[t][e](),delete i[t][e])},Ge=((e,t)=>n=>{let o=!1;const s=y=>()=>{i[n]?(!o||o===y)&&(e(y,n),o=y,requestAnimationFrame(()=>{o=!1})):h()},c=s(le),l=s("resize window"),a=new ResizeObserver(s("pageObserver")),f=new ResizeObserver(s("iframeObserver"));function p(y,L){u(n,`${y}listeners for send${t}`),L(window,le,c),L(window,B,l)}function h(){v(n,`stop${t}`),p("Remove ",Ie),a.disconnect(),f.disconnect(),i[n]&&Ie(i[n].iframe,F,h)}function S(){p("Add ",A),a.observe(document.body),f.observe(i[n].iframe)}i[n]&&(i[n][`stop${t}`]=h,A(i[n].iframe,F,h),S())});function hn(e){const t=document.body.getBoundingClientRect(),n=e.getBoundingClientRect(),{scrollY:o,scrollX:s,innerHeight:c,innerWidth:l}=window,{clientHeight:a,clientWidth:f}=document.documentElement;return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(a,c||0),clientWidth:Math.max(f,l||0),offsetTop:Math.trunc(n.top-t.top),offsetLeft:Math.trunc(n.left-t.left),scrollTop:o,scrollLeft:s,documentHeight:a,documentWidth:f,windowHeight:c,windowWidth:l})}const dn=Ae(se,hn),yn=Ge(dn,"PageInfo"),gn=je("stopPageInfo");function mn(e){const{scrollWidth:t,scrollHeight:n}=document.documentElement,o=typeof window<"u"&&window.visualViewport?window.visualViewport:{},{width:s=0,height:c=0,offsetLeft:l=0,offsetTop:a=0,pageLeft:f=0,pageTop:p=0,scale:h=1}=o;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:s,height:c,offsetLeft:l,offsetTop:a,pageLeft:f,pageTop:p,scale:h}})}const bn=Ae(re,mn),vn=Ge(bn,"ParentInfo"),zn=je("stopParentInfo");function Pe(e){const t=e.getBoundingClientRect(),n=Oe(e.id);return{x:Number(t.left)+Number(n.x),y:Number(t.top)+Number(n.y)}}function Ne(e){const{x:t,y:n}=fn(),o=i[e]?.iframe;if(T(e,"onScroll",{iframe:o,top:n,left:t,x:t,y:n})===!1){Te();return}Le(e)}function wn(e){const{id:t,height:n,width:o}=e,s=window.parentIframe||window.parentIFrame||window;m(t,`scrollBy: x: %c${o}%c y: %c${n}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),s.scrollBy(o,n)}const Ce=e=>t=>{const{id:n,iframe:o,height:s,width:c}=t;function l(y){pn(y),Ne(n)}function a(y,L){y[`scrollTo${e?"Offset":""}`](L.x,L.y)}const f=y=>({x:c+y.x,y:s+y.y}),p=e?Pe(o):{x:0,y:0},h=f(p),S=window.parentIframe||window.parentIFrame;m(n,`Reposition requested (offset x:%c${p.x}%c y:%c${p.y})`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),S?a(S,h):l(h)},In=Ce(!1),En=Ce(!0);function Tn(e,t,n){const{x:o,y:s}=Pe(n);m(e,`Moving to in page link: %c#${t}`,r.HIGHLIGHT),d.position={x:o,y:s},Ne(e),window.location.hash=t}function On(e,t){const n=window.parentIframe||window.parentIFrame;if(!n){u(e,`In page link #${t} not found`);return}n.moveToAnchor(t)}function Ln(e,t){const n=t.split("#")[1]||"",o=decodeURIComponent(n),s=document.getElementById(o)||document.getElementsByName(o)[0];if(s){Tn(e,n,s);return}if(window.top===window.self){u(e,`In page link #${n} not found`);return}On(e,n)}function Hn(e){const t=i[e]?.iframe?.title;return t===""||t===void 0}function Rn(e,t){i[e]?.syncTitle&&(i[e].iframe.title=t,m(e,`Set iframe title attribute: %c${t}`,r.HIGHLIGHT))}const x=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,s=0;s<e.length;s++)o=e.codePointAt(s),t=Math.imul(t^o,2246822519),n=Math.imul(n^o,3266489917);return t^=Math.imul(t^n>>>15,1935289751),n^=Math.imul(n^t>>>15,3405138345),t^=n>>>16,n^=t>>>16,(2097152*(n>>>0)+(t>>>11)).toString(36)},w=e=>e.replace(/[A-Za-z]/g,t=>String.fromCodePoint((t<="Z"?90:122)>=(t=t.codePointAt(0)+19)?t:t-26)),kn=new Date,_e=e=>new Set(Array.from({length:9},e)),xe=" - lewpylk",j=["spjluzl","rlf","clyzpvu","rlf2","nlaMbssFlhy"],Sn=["<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.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.</><iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> fvb jhu bzl aol <i>mpyza 11 johyhjalyz vm fvb spjluzl rlf</> av nla h 60% kpzjvbua ha oaawz://pmyhtl-ylzpgly.jvt/wypjpun.","<yi>Clyzpvu 5 rlf klaljalk</><iy><iy>Fvb hyl jbyyluasf bzpun h spjluzl rlf mvy aol wylcpvbz clyzpvu vm <p>pmyhtl-ylzpgly</>.<iy><iy>Av bwnyhkl av <i>Clyzpvu 6</> vm <p>pmyhtl-ylzpgly</> wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz.","<yi> VLT rlf lewpylk</><iy><iy>Aol spjluzl rlf fvb hyl bzpun mvy <p>pmyhtl-ylzpgly</> pz myvt h wypvy flhy huk ohz lewpylk. Hu bwkhalk rlf pz ylslhzlk vu aol mpyza vm Uvcltily lhjo flhy.<iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt oaawz://pmyhtl-ylzpgly.jvt/tf-vyklyz."],Mn=e=>[e[0],...e.slice(1).map(t=>`${t}${xe}`),`${e[4]}${xe}`,...e.slice(1)],$n=Mn(["NWSc3","zvsv","wyv","ibzpulzz","VLT"]),Fe=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","1foobarqaz","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl","igb1wzrjqr"].map((e,t)=>[e,Math.max(0,t-1)])),De=kn[w(j[4])](),An=_e((e,t)=>x(`${De+t}`)),jn=_e((e,t)=>x(`${De-++t}`)),Gn=e=>An.has(e)?9:jn.has(e)?5:-2,O=e=>w(Sn[e]),Pn=e=>w($n[e]),Nn=e=>{const t=e[w(j[0])]||e[w(j[1])]||e[w(j[2])]||e[w(j[3])];if(!t)return-1;const n=t.split("-");let o=(function(s="",c=""){let l=-2;const a=x(w(s));return a in Fe&&(l=Fe[a]),l===9?Gn(c):l})(...n);return o===0||(s=>s[2]===x(s[0]+s[1]))(n)||(o=-2),o};let Q=!1,Be=!1;function We(e,t=-3){if(Q)return;const n=Math.max(i[e].mode,t);if(n>i[e].mode&&(i[e].mode=n),n<0)throw xt(e),i[e].vAdvised||g(e||"Parent",`${O(n+2)}${O(2)}`),i[e].vAdvised=!0,O(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");switch(n>5&&Be||Dt(`v${G} (${Pn(n)})`,n),n){case 1:case 2:case 3:g("Parent",O(6));break;case 4:g("Parent",O(7));break;case 5:g("Parent",O(8));break;default:n<1&&g("Parent",O(3))}Q=!0}function Cn(e){if(Q)return;const{mode:t}=i[e];t>5&&We(e,t)}function _n(e){e?.log===-1&&(e.log=!1,Be=!0)}function xn(e,t){i[e]&&(u(e,`First run for ${e}`),We(e,t===void 0?void 0:Number(t)),i[e].firstRun=!1)}function Fn(e){const{height:t,id:n,iframe:o,mode:s,message:c,type:l,width:a}=e,{lastMessage:f}=i[n];switch(i[n]?.firstRun&&xn(n,s),u(n,`Received: %c${f}`,r.HIGHLIGHT),l){case ne:i[n].autoResize=JSON.parse(_(n,9));break;case Ye:m(n,"Ready state reset"),i[n].initialised=!1;break;case Xe:Me(o);break;case Ke:Ln(n,_(n,9));break;case H:ke(e),cn(n),an(n,c),i[n].initialised=!0,T(n,"onReady",o);break;case M:un(e,_(n,6));break;case et:Ee("onMouseEnter",e);break;case tt:Ee("onMouseLeave",e);break;case se:yn(n);break;case re:vn(n);break;case nt:gn(n);break;case ot:zn(n);break;case D:$e(e);break;case it:wn(e);break;case st:In(e);break;case rt:En(e);break;case lt:Rn(n,c);break;default:if(a===0&&t===0){z(n,`Unsupported message received (${l}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);return}if(a===0||t===0){u(n,"Ignoring message with 0 height or width");return}if(document.hidden){u(n,"Page hidden - ignored resize request");return}ke(e)}}const Dn=e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()},Bn=e=>Object.values(i).forEach(Dn(e));function Ue(e){const t=e.data;if(t===Je){Bn(e.source);return}if(!rn(t)){if(typeof t!==U)return;v(W,"ignoredMessage"),Ct(W,t);return}const n=tn(t),{id:o,type:s}=n;switch(v(o,s),!0){case!i[o]:throw new Error(`${s} No settings for ${o}. Message was: ${t}`);case!on(n):case ln(n):case!sn(n,e):return;default:i[o].lastMessage=e.data,ze(o,Fn)(n)}}const Wn=It(()=>{A(window,M,Ue),A(document,"visibilitychange",Kt),window.iframeParentListener=e=>setTimeout(()=>Ue({data:e,sameOrigin:!0}))}),Ve={};function Un(e){if(Ve[e]===!0)return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;Ve[e]=!0;const n=Array.from(t).flatMap(o=>[`
11
11
  `,o,`
12
- `]);return m(e,`<rb>Duplicate ID attributes detected</>
12
+ `]);return g(e,`<rb>Duplicate ID attributes detected</>
13
13
 
14
14
  The <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.
15
15
 
16
16
  Found <bb>${t.length}</> iframes with the <b>${e}</> ID:`,...n,`
17
- `),!1}const Un=`<rb>Deprecated Method Name</>
17
+ `),!1}const Vn=`<rb>Deprecated Method Name</>
18
18
 
19
- The <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${he}`,Vn=`<rb>Deprecated Method</>
19
+ The <b>removeListeners()</> method has been renamed to <b>disconnect()</>. ${de}`,qn=`<rb>Deprecated Method</>
20
20
 
21
- Use of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As there 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.`;function qn(e){if(i[e]){const{iframe:t}=i[e],n={close:ke.bind(null,t),disconnect:Me.bind(null,t),moveToAnchor(o){Lt(o,U,"moveToAnchor(anchor) anchor"),E("Move to anchor",`moveToAnchor:${o}`,e)},removeListeners(){m(e,Un),this.disconnect()},resize(){m(e,Vn),E("Window resize",B,e)},sendMessage(o){o=JSON.stringify(o),E(k,`${k}:${o}`,e)}};t.iframeResizer=n,t.iFrameResizer=n}}const Zn="8",Jn="32",Yn=pt,Xn=!0;function Kn(e){const{autoResize:t,bodyBackground:n,bodyMargin:o,bodyPadding:s,heightCalculationMethod:l,inPageLinks:c,license:a,log:f,logExpand:p,mouseEvents:h,offsetHeight:M,offsetWidth:g,mode:L,sizeHeight:So,sizeWidth:Mo,tolerance:ko,widthCalculationMethod:$o}=i[e];return[e,Zn,Mo,f,Jn,Xn,t,o,l,n,s,ko,c,Yn,$o,h,M,g,So,a,d.version,L,"",p].join(":")}const Qn="0";function eo(e){const{bodyMargin:t}=i[e];(typeof t===dt||t===Qn)&&(i[e].bodyMargin=`${t}px`)}const to=e=>{try{return new URL(e).origin}catch{return null}},no=e=>typeof e===le&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin"));function oo(e,t){const{checkOrigin:n,iframe:{src:o,sandbox:s},initialisedFirstPage:l,waitForLoad:c}=t[e],a=to(o);v(e,"noResponse"),m(e,`<rb>No response from iframe</>
21
+ Use of the <b>resize()</> method from the parent page is deprecated and will be removed in a future version of <i>iframe-resizer</>. As there 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.`;function Zn(e){if(i[e]){const{iframe:t}=i[e],n={close:Me.bind(null,t),disconnect:Se.bind(null,t),moveToAnchor(o){Ht(o,U,"moveToAnchor(anchor) anchor"),E("Move to anchor",`moveToAnchor:${o}`,e)},removeListeners(){g(e,Vn),this.disconnect()},resize(){g(e,qn),E("Window resize",B,e)},sendMessage(o){o=JSON.stringify(o),E(M,`${M}:${o}`,e)}};t.iframeResizer=n,t.iFrameResizer=n}}const Jn="8",Yn="32",Xn=ht,Kn=!0;function Qn(e){const{autoResize:t,bodyBackground:n,bodyMargin:o,bodyPadding:s,heightCalculationMethod:c,inPageLinks:l,license:a,log:f,logExpand:p,mouseEvents:h,offsetHeight:S,offsetWidth:y,mode:L,sizeHeight:So,sizeWidth:Mo,tolerance:$o,widthCalculationMethod:Ao}=i[e];return[e,Jn,Mo,f,Yn,Kn,t,o,c,n,s,$o,l,Xn,Ao,h,S,y,So,a,d.version,L,"",p].join(":")}const eo="0";function to(e){const{bodyMargin:t}=i[e];(typeof t===dt||t===eo)&&(i[e].bodyMargin=`${t}px`)}const no=e=>{try{return new URL(e).origin}catch{return null}},oo=e=>typeof e===ce&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin"));function io(e,t){const{checkOrigin:n,iframe:{src:o,sandbox:s},initialisedFirstPage:c,waitForLoad:l}=t[e],a=no(o);v(e,"noResponse"),g(e,`<rb>No response from iframe</>
22
22
 
23
23
  The iframe (<i>${e}</>) has not responded within ${t[e].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.
24
24
  ${n&&a?`
25
25
  The <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.
26
- `:""}${c&&!l?`
26
+ `:""}${l&&!c?`
27
27
  The <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</>.
28
- `:""}${no(s)?`
28
+ `:""}${oo(s)?`
29
29
  The iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.
30
30
  `:""}
31
31
  This 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.
32
- `)}function io(e,t){function n(){if(t[e]===void 0)return;const{initialised:l,loadErrorShown:c}=t[e];if(t[e].msgTimeout=void 0,l){t[e].initialisedFirstPage=!0;return}c||(t[e].loadErrorShown=!0,oo(e,t))}const{msgTimeout:o,warningTimeout:s}=t[e];s&&(o&&clearTimeout(o),t[e].msgTimeout=setTimeout(n,s))}const so=1,ro=e=>e.loading===Ke,co=e=>e===H;function lo(e){i[e]?.heightCalculationMethod in yt&&$e({id:e,iframe:i[e].iframe,height:1,width:1,type:H})}function ao(e,t){A(e,F,()=>setTimeout(t,so))}const uo=e=>{const{src:t,srcdoc:n}=e;return!n&&(t==null||t===""||t==="about:blank")};function fo(e,t){const{iframe:n,waitForLoad:o}=i[e];if(o!==!0){if(uo(n)){setTimeout(()=>{v(e,"noContent"),y(e,"No content detected in the iframe, delaying initialisation")});return}setTimeout(t)}}function po(e,t){const n=s=>()=>{if(!i[e])return;const{firstRun:l,iframe:c}=i[e];E(s,t,e),co(s)&&ro(c)||io(e,i),l||lo(e)},{iframe:o}=i[e];i[e].initChild=n(oe),ao(o,n(ie)),fo(e,n(H))}function ho(e,t){return t?(("sizeWidth"in t||"sizeHeight"in t||ne in t)&&m(e,`<rb>Deprecated Option</>
32
+ `)}function so(e,t){function n(){if(t[e]===void 0)return;const{initialised:c,loadErrorShown:l}=t[e];if(t[e].msgTimeout=void 0,c){t[e].initialisedFirstPage=!0;return}l||(t[e].loadErrorShown=!0,io(e,t))}const{msgTimeout:o,warningTimeout:s}=t[e];s&&(o&&clearTimeout(o),t[e].msgTimeout=setTimeout(n,s))}const ro=1,lo=e=>e.loading===Qe,co=e=>e===H;function ao(e){i[e]?.heightCalculationMethod in bt&&$e({id:e,iframe:i[e].iframe,height:1,width:1,type:H})}function uo(e,t){A(e,F,()=>setTimeout(t,ro))}const fo=e=>{const{src:t,srcdoc:n}=e;return!n&&(t==null||t===""||t==="about:blank")};function po(e,t){const{iframe:n,waitForLoad:o}=i[e];if(o!==!0){if(fo(n)){setTimeout(()=>{v(e,"noContent"),m(e,"No content detected in the iframe, delaying initialisation")});return}setTimeout(t)}}function ho(e,t){const n=s=>()=>{if(!i[e])return;const{firstRun:c,iframe:l}=i[e];E(s,t,e),co(s)&&lo(l)||so(e,i),c||ao(e)},{iframe:o}=i[e];i[e].initChild=n(oe),uo(o,n(ie)),po(e,n(H))}function yo(e,t){return t?(("sizeWidth"in t||"sizeHeight"in t||ne in t)&&g(e,`<rb>Deprecated Option</>
33
33
 
34
34
  The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${P}</>, <bb>${pe}</>, <bb>${fe}</> or <bb>${ue}</>.
35
- `),t):{}}function go(e){i[e].warningTimeout||y(e,"warningTimeout:%c disabled",r.HIGHLIGHT)}function mo(e,{offset:t,offsetSize:n}){const o=n||t;o&&(i[e].direction===P?(i[e].offsetHeight=o,u(e,`Offset height: %c${o}`,r.HIGHLIGHT)):(i[e].offsetWidth=o,u(e,`Offset width: %c${o}`,r.HIGHLIGHT)))}function yo(e){const{direction:t}=i[e];switch(t){case P:break;case pe:i[e].sizeHeight=!1;case fe:i[e].sizeWidth=!0;break;case ue:i[e].sizeWidth=!1,i[e].sizeHeight=!1,i[e].autoResize=!1;break;default:throw new TypeError(`Direction value of "${t}" is not valid`)}u(e,`direction: %c${t}`,r.HIGHLIGHT)}const Ve=e=>e===""||e.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":e;function bo(e){const{checkOrigin:t,remoteHost:n}=i[e];Array.isArray(t)&&t.length===0&&w(e,"checkOrigin is an empty array — no messages will be sent to the iframe"),i[e].targetOrigin=Array.isArray(t)?t.map(Ve):[t===!1?"*":Ve(n)]}function vo(e){const{id:t}=e;i[t].postMessageTarget===null&&(i[t].postMessageTarget=e.contentWindow)}function ee(e,t,n){$(i[e],t)&&(m(e,`<rb>Deprecated option</>
35
+ `),t):{}}function go(e){i[e].warningTimeout||m(e,"warningTimeout:%c disabled",r.HIGHLIGHT)}function mo(e,{offset:t,offsetSize:n}){const o=n||t;o&&(i[e].direction===P?(i[e].offsetHeight=o,u(e,`Offset height: %c${o}`,r.HIGHLIGHT)):(i[e].offsetWidth=o,u(e,`Offset width: %c${o}`,r.HIGHLIGHT)))}function bo(e){const{direction:t}=i[e];switch(t){case P:break;case pe:i[e].sizeHeight=!1;case fe:i[e].sizeWidth=!0;break;case ue:i[e].sizeWidth=!1,i[e].sizeHeight=!1,i[e].autoResize=!1;break;default:throw new TypeError(`Direction value of "${t}" is not valid`)}u(e,`direction: %c${t}`,r.HIGHLIGHT)}const qe=e=>e===""||e.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":e;function vo(e){const{checkOrigin:t,remoteHost:n}=i[e];Array.isArray(t)&&t.length===0&&z(e,"checkOrigin is an empty array — no messages will be sent to the iframe"),i[e].targetOrigin=Array.isArray(t)?t.map(qe):[t===!1?"*":qe(n)]}function zo(e){const{id:t}=e;i[t].postMessageTarget===null&&(i[t].postMessageTarget=e.contentWindow)}function ee(e,t,n){$(i[e],t)&&(g(e,`<rb>Deprecated option</>
36
36
 
37
- The <b>${t}</> option has been renamed to <b>${n}</>. ${he}`),i[e][n]=i[e][t],delete i[e][t])}function wo(e){ee(e,at,ut),ee(e,"onClose","onBeforeClose"),ee(e,"onClosed","onAfterClose")}const zo=e=>$(e,"onMouseEnter")||$(e,"onMouseLeave");function Io(e,t){const{id:n}=e;i[n]={...i[n],iframe:e,remoteHost:e?.src.split("/").slice(0,3).join("/"),...C,...ho(n,t),mouseEvents:zo(t),mode:Pn(t),syncTitle:Ln(n)},wo(n),yo(n),mo(n,t),go(n),vo(e),bo(n)}const Eo="yes",qe="no";function To(e){const{id:t}=e;switch(u(t,`Iframe scrolling ${i[t]?.scrolling?"enabled":"disabled"} for ${t}`),e.style.overflow=i[t]?.scrolling===!1?ft:V,i[t]?.scrolling){case gt:break;case!0:e.scrolling=Eo;break;case!1:e.scrolling=qe;break;default:e.scrolling=i[t]?.scrolling||qe}}function Oo(e,t,n){Io(t,n),u(e,`src: %c${t.srcdoc||t.src}`,r.HIGHLIGHT),Nn(e),To(t),eo(e),po(e,Kn(e)),qn(e),u(e,"Setup complete")}function Lo(e,t){const{id:n}=e;v(n,"setup"),Wn(n)&&Oo(n,e,t),xt(n)}function Ho(e,t){t.log===Z?t.log=!1:t.log===J?t.log=S:t.log===Y&&(t.log=R);const n=$(t,"log"),o=X(t.log),s=n?o?!0:t.log:C.log;$(t,"logExpand")||(t.logExpand=n&&o?t.log===R:C.logExpand),Cn(t),Pt({enabled:s,expand:t.logExpand,iframeId:e}),o&&!(t.log in bt)&&Ct(e,`Invalid value for options.log: Accepted values are "${R}" and "${S}"`),t.log=s}function Ro(e){if(!ge(e))throw new TypeError("Options is not an object");return Bn(),qt(e),t=>{const n=Vt(t,e);return te in t?(v(n,"alreadySetup"),w(n,`Ignored iframe (${n}), already setup.`)):(Ho(n,e),we(n,Lo)(t,e)),t?.iframeResizer}}b.LOG_COLLAPSED=J,b.LOG_DISABLED=Z,b.LOG_EXPANDED=Y,b.default=Ro,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
37
+ The <b>${t}</> option has been renamed to <b>${n}</>. ${de}`),i[e][n]=i[e][t],delete i[e][t])}function wo(e){ee(e,ut,ft),ee(e,"onClose","onBeforeClose"),ee(e,"onClosed","onAfterClose")}const Io=e=>$(e,"onMouseEnter")||$(e,"onMouseLeave");function Eo(e,t){const{id:n}=e;i[n]={...i[n],iframe:e,remoteHost:e?.src.split("/").slice(0,3).join("/"),...C,...yo(n,t),mouseEvents:Io(t),mode:Nn(t),syncTitle:Hn(n)},wo(n),bo(n),mo(n,t),go(n),zo(e),vo(n)}const To="yes",Ze="no";function Oo(e){const{id:t}=e;switch(u(t,`Iframe scrolling ${i[t]?.scrolling?"enabled":"disabled"} for ${t}`),e.style.overflow=i[t]?.scrolling===!1?pt:V,i[t]?.scrolling){case gt:break;case!0:e.scrolling=To;break;case!1:e.scrolling=Ze;break;default:e.scrolling=i[t]?.scrolling||Ze}}function Lo(e,t,n){Eo(t,n),u(e,`src: %c${t.srcdoc||t.src}`,r.HIGHLIGHT),Cn(e),Oo(t),to(e),ho(e,Qn(e)),Zn(e),u(e,"Setup complete")}function Ho(e,t){const{id:n}=e;v(n,"setup"),Un(n)&&Lo(n,e,t),Ft(n)}function Ro(e,t){t.log===Z?t.log=!1:t.log===J?t.log=k:t.log===Y&&(t.log=R);const n=$(t,"log"),o=X(t.log),s=n?o?!0:t.log:C.log;$(t,"logExpand")||(t.logExpand=n&&o?t.log===R:C.logExpand),_n(t),Nt({enabled:s,expand:t.logExpand,iframeId:e}),o&&!(t.log in vt)&&_t(e,`Invalid value for options.log: Accepted values are "${R}" and "${k}"`),t.log=s}function ko(e){if(!ye(e))throw new TypeError("Options is not an object");return Wn(),Zt(e),t=>{const n=qt(t,e);return te in t?(v(n,"alreadySetup"),z(n,`Ignored iframe (${n}), already setup.`)):(Ro(n,e),ze(n,Ho)(t,e)),t?.iframeResizer}}b.LOG_COLLAPSED=J,b.LOG_DISABLED=Z,b.LOG_EXPANDED=Y,b.default=ko,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
38
38
  //# sourceMappingURL=index.umd.js.map