@iframe-resizer/core 6.0.0-beta.3 → 6.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.cjs.js +11 -13
- package/index.cjs.js.map +1 -1
- package/index.esm.js +545 -641
- package/index.esm.js.map +1 -1
- package/index.umd.js +11 -16
- package/index.umd.js.map +1 -1
- package/package.json +2 -1
package/index.umd.js
CHANGED
|
@@ -1,32 +1,27 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`,rb:"\x1B[31;1m",bb:"\x1B[34;1m",b:"\x1B[1m",i:"\x1B[3m",u:"\x1B[4m","/":"\x1B[m"},kt=Object.keys(de),St=new RegExp(`<(${kt.join("|")})>`,"gi"),jt=(e,t)=>de[t]??"",Rt=e=>e.replace(St,jt),Mt=e=>e.replaceAll("<br>",`
|
|
3
|
-
`).replaceAll(/<\/?[^>]+>/gi,""),ye=e=>t=>e(Y(t)?window.chrome?Rt(t):Mt(t):t),i={},ge=Ht(r);let X=!0;const $t=ge({expand:!1,label:B}),At=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`,Gt=e=>i[e]?i[e].log:X;function Pt({enabled:e,expand:t,iframeId:n}){const o=ge({expand:t,label:At(n)});X=e,i[n]||(i[n]={console:o})}const I=e=>(t,...n)=>i[t]?i[t].console[e](...n):$t[e](...n),me=e=>(t,...n)=>Gt(t)===!0?I(e)(t,...n):null,u=me("log"),g=u,Nt=me("debug"),z=I("warn"),Ct=I("error"),v=I("event"),_t=I("purge"),xt=I("endAutoGroup"),be=I("errorBoundary");function Ft(e,t){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,X||t<1?dt:r.NORMAL))}const Dt=e=>(...t)=>[`${ee}(${e})`,...t].join(" "),Bt=ye(Tt),b=(e,...t)=>i[e]?i[e].console.warn(...t.map(Bt)):queueMicrotask(()=>{const n=ye(Dt(e));console?.warn(...t.map(n))}),C=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:P,firstRun:!0,inPageLinks:!1,heightCalculationMethod:U,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:U,onBeforeClose:()=>!0,onAfterClose(){},onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady(){},onResized(){},onScroll:()=>!0});let ve=0;function Wt(e){const t=e?.id||C.id+ve++;return document.getElementById(t)===null?t:`${t}${ve++}`}function Ut(e,t){let{id:n}=e;if(n&&!Y(n))throw new TypeError("Invalid id for iframe. Expected String");return(!n||n==="")&&(n=Wt(t),e.id=n,v(n,"assignId"),u(n,`Added missing iframe ID: ${n} (${e.src})`)),n}function Vt(e){const{search:t}=window.location;if(t.includes("ifrlog"))switch(new URLSearchParams(t).get("ifrlog")){case String(q):{e.log=!1;break}case L:case String(J):{e.log=L;break}case k:case String(Z):{e.log=k;break}default:e.log=k}}const $=(e,t,n,o)=>e.addEventListener(t,n,o||!1),ze=(e,t,n)=>e.removeEventListener(t,n,!1),qt=e=>e.split(":").filter((t,n)=>n!==19).join(":");function Zt(e,t,n){function o(f){const p=e in pe?qt(t):t;g(n,f,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),g(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 pe?(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 S(e,t,n){if(v(n,e),!i[n]?.postMessageTarget){z(n,"Iframe not found");return}Zt(e,t,n)}const Jt=(e,t)=>Object.values(i).filter(({autoResize:n,firstRun:o})=>n&&!o).forEach(({iframe:n})=>S(e,t,n.id));function Yt(){document.hidden!==!0&&Jt("tabVisible",re)}function Xt(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 Kt(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 Qt(e){const t=e.slice(V).split(":"),n=t[1]?Number(t[1]):0,o=i[t[0]]?.iframe,s=o?getComputedStyle(o):null,c=s?Xt(s)+Kt(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 en={true:1,false:1,undefined:1};function tn(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 nn(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 on=e=>N===`${e}`.slice(0,V)&&e.slice(V).split(":")[0]in i;function sn(e){const{id:t,type:n}=e,o=n in en;return o&&u(t,"Ignoring init message from meta parent page"),o}function rn(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){b(e,`<rb>Legacy version detected in iframe</>
|
|
1
|
+
(function(p,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@iframe-resizer/common"),require("auto-console-group")):typeof define=="function"&&define.amd?define(["exports","@iframe-resizer/common","auto-console-group"],i):(p=typeof globalThis<"u"?globalThis:p||self,i(p.connectResizer={},p.common,p.acg))})(this,(function(p,i,a){"use strict";const r={},v=i.esModuleInterop(a);let y=!0;const se=v({expand:!1,label:i.PARENT}),oe=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`,ae=e=>r[e]?r[e].log:y;function ce({enabled:e,expand:t,iframeId:n}){const s=v({expand:t,label:oe(n)});y=e,r[n]||(r[n]={console:s})}const L=e=>(t,...n)=>r[t]?r[t].console[e](...n):se[e](...n),k=e=>(t,...n)=>ae(t)===!0?L(e)(t,...n):null,l=k("log"),O=l,fe=k("debug"),w=L("warn"),le=L("error"),T=L("event"),ue=L("purge"),de=L("endAutoGroup"),D=L("errorBoundary");function ge(e,t){queueMicrotask(()=>console.info(`%ciframe-resizer ${e}`,y||t<1?i.BOLD:a.NORMAL))}const he=e=>(...t)=>[`${i.LABEL}(${e})`,...t].join(" "),Ee=i.createFormatAdvise(i.id),b=(e,...t)=>r[e]?r[e].console.warn(...t.map(Ee)):queueMicrotask(()=>{const n=i.createFormatAdvise(he(e));console?.warn(...t.map(n))}),N=i.deprecate(b);N("Function"),N("Method"),N("Option");const G=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:i.VERTICAL,firstRun:!0,inPageLinks:!1,heightCalculationMethod:i.AUTO,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:i.AUTO,onBeforeClose:()=>!0,onAfterClose(){},onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady(){},onResized(){},onScroll:()=>!0});let _=0;function Ie(e){const t=e?.id||G.id+_++;return document.getElementById(t)===null?t:`${t}${_++}`}function pe(e,t){let{id:n}=e;if(n&&!i.isString(n))throw new TypeError("Invalid id for iframe. Expected String");return(!n||n==="")&&(n=Ie(t),e.id=n,T(n,"assignId"),l(n,`Added missing iframe ID: ${n} (${e.src})`)),n}function Oe(e){const{search:t}=window.location;if(t.includes("ifrlog"))switch(new URLSearchParams(t).get("ifrlog")){case String(i.LOG_DISABLED):{e.log=!1;break}case i.EXPAND:case String(i.LOG_EXPANDED):{e.log=i.EXPAND;break}case i.COLLAPSE:case String(i.LOG_COLLAPSED):{e.log=i.COLLAPSE;break}default:e.log=i.COLLAPSE}}const be=e=>e.split(i.SEPARATOR).filter((t,n)=>n!==19).join(i.SEPARATOR);function Te(e,t,n){function s(d){const g=e in i.INIT_EVENTS?be(t):t;O(n,d,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT),O(n,`Message data: %c${g}`,a.HIGHLIGHT)}const{iframe:o,postMessageTarget:u,sameOrigin:c,targetOrigin:f}=r[n];if(c)try{o.contentWindow.iframeChildListener(i.MESSAGE_ID+t),s(`Sending message to iframe %c${n}%c via same origin%c`);return}catch{e in i.INIT_EVENTS?(r[n].sameOrigin=!1,l(n,"New iframe does not support same origin")):w(n,"Same origin messaging failed, falling back to postMessage")}s(`Sending message to iframe: %c${n}%c targetOrigin: %c${f.join(", ")}`);for(const d of f)u.postMessage(i.MESSAGE_ID+t,d)}function A(e,t,n){if(T(n,e),!r[n]?.postMessageTarget){w(n,"Iframe not found");return}Te(e,t,n)}const we=(e,t)=>Object.values(r).filter(({autoResize:n,firstRun:s})=>n&&!s).forEach(({iframe:n})=>A(e,t,n.id));function Le(){document.hidden!==!0&&we("tabVisible",i.RESIZE)}function He(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 Se(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 Ae(e){const t=e.slice(i.MESSAGE_ID_LENGTH).split(":"),n=t[1]?Number(t[1]):0,s=r[t[0]]?.iframe,o=s?getComputedStyle(s):null,u=o?He(o)+Se(o):0,c={iframe:s,id:t[0],height:n+u,width:Number(t[2]),type:t[3],msg:t[4],message:t[4]};return t[5]&&(c.mode=t[5]),c}const Re={true:1,false:1,undefined:1};function Ge(e){const{id:t,msg:n,iframe:s}=e,o=i.isIframe(s);return o||(l(t,`Received: %c${n}`,a.HIGHLIGHT),w(t,"The target iframe was not found.")),o}function Me(e,t){const{id:n}=e,{data:s,origin:o}=t;if("sameOrigin"in t&&t.sameOrigin)return!0;const c=r[n]?.checkOrigin;function f(){function d(){l(n,`Checking connection is from allowed list of origins: %c${c}`,a.HIGHLIGHT);for(const h of c)if(h===o)return!0;return!1}function g(){const h=r[n]?.remoteHost;return l(n,`Checking connection is from: %c${h}`,a.HIGHLIGHT),o===h}return c.constructor===Array?d():g()}if(c&&`${o}`!="null"&&!f())throw new Error(`Unexpected message received from: ${o} for ${n}. Message was: ${s}. This error can be disabled by setting the checkOrigin: false option or by providing an array of trusted domains.`);return!0}const ye=e=>i.MESSAGE_ID===`${e}`.slice(0,i.MESSAGE_ID_LENGTH)&&e.slice(i.MESSAGE_ID_LENGTH).split(":")[0]in r;function Ne(e){const{id:t,type:n}=e,s=n in Re;return s&&l(t,"Ignoring init message from meta parent page"),s}function Pe(e){try{r[e].sameOrigin=!!r[e]?.iframe?.contentWindow?.iframeChildListener}catch{r[e].sameOrigin=!1}l(e,`sameOrigin: %c${r[e].sameOrigin}`,a.HIGHLIGHT)}function $e(e,t){if(t!==i.VERSION){if(t===void 0){b(e,`<rb>Legacy version detected in iframe</>
|
|
4
2
|
|
|
5
3
|
Detected legacy version of child page script. It is recommended to update the page in the iframe to use <b>@iframe-resizer/child</>.
|
|
6
4
|
|
|
7
5
|
See <u>https://iframe-resizer.com/setup/#child-page-setup</> for more details.
|
|
8
|
-
`);return}u(e,`Version mismatch (Child: %c${t}%c !== Parent: %c${G})`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT)}}function E(e,t,n){if(!i[e])return null;const o=i[e][t];if(typeof o!==ht)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 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),E(n,"onMessage",{iframe:o,message:JSON.parse(t)})}function _(e,t){const{lastMessage:n}=i[e];return n.slice(n.indexOf(":")+gt+t)}function we(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};E(n,e,{iframe:o,screenX:Number(a.x),screenY:Number(a.y),type:c})}const d={position:null,version:G};function Ie(){d.position=null}const cn=()=>d.position;function un(e){d.position=e}function Ee(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 Te(e){d.position!==null&&(window.scrollTo(d.position.x,d.position.y),g(e,`Set page position: %c${d.position.x}%c, %c${d.position.y}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),Ie())}function Oe(e,t){const{id:n}=t,o=`${t[e]}px`;i[n].iframe.style[e]=o,g(n,`Set ${e}: %c${o}`,r.HIGHLIGHT)}function He(e){const{id:t}=e,{sizeHeight:n,sizeWidth:o}=i[t];n&&Oe(rt,e),o&&Oe(lt,e)}function Le(e){const{id:t}=e;He(e),Te(t),E(t,"onResized",e)}function ke(e){const{id:t}=e;u(t,"Disconnected from iframe"),delete i[t],delete e.iframeResizer}function Se(e){const{id:t}=e;if(E(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)}E(t,"onAfterClose",t),ke(e)}function je(e){const{id:t,type:n}=e;u(t,`Size reset requested by ${n===H?"parent page":"child page"}`),Ee(t),He(e),S(D,D,t)}const Re=(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(){S(`${o} (${e})`,`${e}:${t(c)}`,s)}l(a,s)}},Me=e=>t=>{e in i[t]&&(i[t][e](),delete i[t][e])},$e=((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,O){u(n,`${y}listeners for send${t}`),O(window,le,c),O(window,re,l)}function h(){v(n,`stop${t}`),p("Remove ",ze),a.disconnect(),f.disconnect(),i[n]&&ze(i[n].iframe,F,h)}function j(){p("Add ",$),a.observe(document.body),f.observe(i[n].iframe)}i[n]&&(i[n][`stop${t}`]=h,$(i[n].iframe,F,h),j())});function fn(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 pn=Re(ie,fn),hn=$e(pn,"PageInfo"),dn=Me("stopPageInfo");function yn(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 gn=Re(se,yn),mn=$e(gn,"ParentInfo"),bn=Me("stopParentInfo");function Ae(e){const t=e.getBoundingClientRect(),n=Ee(e.id);return{x:Number(t.left)+Number(n.x),y:Number(t.top)+Number(n.y)}}function Ge(e){const{x:t,y:n}=cn(),o=i[e]?.iframe;if(E(e,"onScroll",{iframe:o,top:n,left:t,x:t,y:n})===!1){Ie();return}Te(e)}function vn(e){const{id:t,height:n,width:o}=e,s=window.parentIframe||window.parentIFrame||window;g(t,`scrollBy: x: %c${o}%c y: %c${n}`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),s.scrollBy(o,n)}const Pe=e=>t=>{const{id:n,iframe:o,height:s,width:c}=t;function l(y){un(y),Ge(n)}function a(y,O){y[`scrollTo${e?"Offset":""}`](O.x,O.y)}const f=y=>({x:c+y.x,y:s+y.y}),p=e?Ae(o):{x:0,y:0},h=f(p),j=window.parentIframe||window.parentIFrame;g(n,`Reposition requested (offset x:%c${p.x}%c y:%c${p.y})`,r.HIGHLIGHT,r.FOREGROUND,r.HIGHLIGHT),j?a(j,h):l(h)},zn=Pe(!1),wn=Pe(!0);function In(e,t,n){const{x:o,y:s}=Ae(n);g(e,`Moving to in page link: %c#${t}`,r.HIGHLIGHT),d.position={x:o,y:s},Ge(e),window.location.hash=t}function En(e,t){const n=window.parentIframe||window.parentIFrame;if(!n){u(e,`In page link #${t} not found`);return}n.moveToAnchor(t)}function Tn(e,t){const n=t.split("#")[1]||"",o=decodeURIComponent(n),s=document.getElementById(o)||document.getElementsByName(o)[0];if(s){In(e,n,s);return}if(window.top===window.self){u(e,`In page link #${n} not found`);return}En(e,n)}function On(e){const t=i[e]?.iframe?.title;return t===""||t===void 0}function Hn(e,t){i[e]?.syncTitle&&(i[e].iframe.title=t,g(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)),Ln=new Date,Ne=e=>new Set(Array.from({length:9},e)),Ce=" - lewpylk",A=["spjluzl","rlf","clyzpvu","rlf2","nlaMbssFlhy"],kn=["<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</>. 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.","<yi>Bzl dpao slnhjf jspluaz</><iy><iy>Dolu bzpun <p>pmyhtl-ylzpgly</> jopsk whjrhnl dpao hu vskly clyzpvu vm aol whylua, fvb jhu zla aol spjluzl rlf pu aol pmyhtl. Mvy klahpsz vu ovd av zla aopz bw, wslhzl zll aol kvjbtluahapvu ha:<iy><iy>oaawz://pmyhtl-ylzpgly.jvt/zlabw/jopsk/#spjluzl"],Sn=e=>[e[0],...e.slice(1).map(t=>`${t}${Ce}`),`${e[4]}${Ce}`,...e.slice(1)],jn=Sn(["NWSc3","zvsv","wyv","ibzpulzz","VLT"]),_e=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","1foobarqaz","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl","igb1wzrjqr"].map((e,t)=>[e,Math.max(0,t-1)])),xe=Ln[w(A[4])](),Rn=Ne((e,t)=>x(`${xe+t}`)),Mn=Ne((e,t)=>x(`${xe-++t}`)),$n=e=>Rn.has(e)?9:Mn.has(e)?5:-2,T=e=>w(kn[e]),An=e=>w(jn[e]),Gn=e=>{const t=e[w(A[0])]||e[w(A[1])]||e[w(A[2])]||e[w(A[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 _e&&(l=_e[a]),l===9?$n(c):l})(...n);return o===0||(s=>s[2]===x(s[0]+s[1]))(n)||(o=-2),o};let K=!1,Fe=!1;function De(e,t=-3){if(K)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||b(e||"Parent",`${T(n+2)}${T(2)}`),i[e].vAdvised=!0,T(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");switch(n>5&&Fe||Ft(`v${G} (${An(n)})`,n),n){case 1:case 2:case 3:b("Parent",T(6));break;case 4:b("Parent",T(7));break;case 5:b("Parent",T(8));break;default:n<1&&b("Parent",T(3))}K=!0}function Pn(e){if(K)return;const{mode:t}=i[e];t>5&&De(e,t)}function Nn(e){e?.log===-1&&(e.log=!1,Fe=!0)}function Cn(e,t){i[e]&&(u(e,`First run for ${e}`),De(e,t===void 0?void 0:Number(t)),i[e].firstRun=!1)}function _n(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&&Cn(n,s),u(n,`Received: %c${f}`,r.HIGHLIGHT),l){case te:i[n].autoResize=JSON.parse(_(n,9));break;case Ze:g(n,"Ready state reset"),i[n].initialised=!1;break;case Je:Se(o);break;case Ye:Tn(n,_(n,9));break;case H:Le(e),rn(n),ln(n,c),i[n].initialised=!0,E(n,"onReady",o);break;case R:an(e,_(n,6));break;case Ke:we("onMouseEnter",e);break;case Qe:we("onMouseLeave",e);break;case ie:hn(n);break;case se:mn(n);break;case et:dn(n);break;case tt:bn(n);break;case D:je(e);break;case nt:vn(e);break;case ot:zn(e);break;case it:wn(e);break;case st:Hn(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}Le(e)}}const xn=e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()},Fn=e=>Object.values(i).forEach(xn(e));function Be(e){const t=e.data;if(t===qe){Fn(e.source);return}if(!on(t)){if(typeof t!==W)return;v(B,"ignoredMessage"),Nt(B,t);return}const n=Qt(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!tn(n):case sn(n):case!nn(n,e):return;default:i[o].lastMessage=e.data,be(o,_n)(n)}}const Dn=It(()=>{$(window,R,Be),$(document,"visibilitychange",Yt),window.iframeParentListener=e=>setTimeout(()=>Be({data:e,sameOrigin:!0}))}),We={};function Bn(e){if(We[e]===!0)return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;We[e]=!0;const n=Array.from(t).flatMap(o=>[`
|
|
9
|
-
`,o,`
|
|
10
|
-
`]);return b(e,`<rb>Duplicate ID attributes detected</>
|
|
6
|
+
`);return}l(e,`Version mismatch (Child: %c${t}%c !== Parent: %c${i.VERSION})`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT)}}function H(e,t,n){if(!r[e])return null;const s=r[e][t];if(typeof s!==i.FUNCTION)throw new TypeError(`${t} on iframe[${e}] is not a function`);if(t!=="onBeforeClose"&&t!=="onScroll")return i.isolateUserCode(s,n);try{return s(n)}catch(o){return console.error(o),w(e,`Error in ${t} callback`),null}}function ve(e,t){const{id:n,iframe:s}=e;l(n,`onMessage passed: {iframe: %c${n}%c, message: %c${t}%c}`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT,a.FOREGROUND),H(n,"onMessage",{iframe:s,message:JSON.parse(t)})}function M(e,t){const{lastMessage:n}=r[e];return n.slice(n.indexOf(i.SEPARATOR)+i.MESSAGE_HEADER_LENGTH+t)}function C(e,t){const{id:n,iframe:s,height:o,type:u,width:c}=t;let f={x:0,y:0};if(c===0&&o===0){const d=M(n,9).split(i.SEPARATOR);f={x:d[1],y:d[0]}}else f={x:c,y:o};H(n,e,{iframe:s,screenX:Number(f.x),screenY:Number(f.y),type:u})}const E={position:null,version:i.VERSION};function z(){E.position=null}const ke=()=>E.position;function De(e){E.position=e}function F(e){return E.position===null&&(E.position={x:window.scrollX,y:window.scrollY}),l(e,`Get page position: %c${E.position.x}%c, %c${E.position.y}`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT),E.position}function B(e){E.position!==null&&(window.scrollTo(E.position.x,E.position.y),O(e,`Set page position: %c${E.position.x}%c, %c${E.position.y}`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT),z())}function x(e,t){const{id:n}=t,s=`${t[e]}px`;r[n].iframe.style[e]=s,O(n,`Set ${e}: %c${s}`,a.HIGHLIGHT)}function W(e){const{id:t}=e,{sizeHeight:n,sizeWidth:s}=r[t];n&&x(i.HEIGHT,e),s&&x(i.WIDTH,e)}function U(e){const{id:t}=e;W(e),B(t),H(t,"onResized",e)}function V(e){const{id:t}=e;l(t,"Disconnected from iframe"),delete r[t],delete e.iframeResizer}function j(e){const{id:t}=e;if(H(t,"onBeforeClose",t)===!1){l(t,"Close iframe cancelled by onBeforeClose");return}l(t,`Removing iframe: %c${t}`,a.HIGHLIGHT);try{e.parentNode&&e.remove()}catch(n){w(t,n)}H(t,"onAfterClose",t),V(e)}function X(e){const{id:t,type:n}=e;l(t,`Size reset requested by ${n===i.INIT?"parent page":"child page"}`),F(t),W(e),A(i.RESET,i.RESET,t)}const q=(e,t)=>{const n={};return(s,o)=>{const{iframe:u}=r[o];function c(d,g){n[g]||(d(),n[g]=requestAnimationFrame(()=>{n[g]=null}))}function f(){A(`${s} (${e})`,`${e}:${t(u)}`,o)}c(f,o)}},Z=e=>t=>{e in r[t]&&(r[t][e](),delete r[t][e])},Y=((e,t)=>n=>{let s=!1;const o=I=>()=>{r[n]?(!s||s===I)&&(e(I,n),s=I,requestAnimationFrame(()=>{s=!1})):h()},u=o(i.SCROLL),c=o("resize window"),f=new ResizeObserver(o("pageObserver")),d=new ResizeObserver(o("iframeObserver"));function g(I,S){l(n,`${I}listeners for send${t}`),S(window,i.SCROLL,u),S(window,i.RESIZE,c)}function h(){T(n,`stop${t}`),g("Remove ",i.removeEventListener),f.disconnect(),d.disconnect(),r[n]&&i.removeEventListener(r[n].iframe,i.LOAD,h)}function R(){g("Add ",i.addEventListener),f.observe(document.body),d.observe(r[n].iframe)}r[n]&&(r[n][`stop${t}`]=h,i.addEventListener(r[n].iframe,i.LOAD,h),R())});function _e(e){const t=document.body.getBoundingClientRect(),n=e.getBoundingClientRect(),{scrollY:s,scrollX:o,innerHeight:u,innerWidth:c}=window,{clientHeight:f,clientWidth:d}=document.documentElement;return JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(f,u||0),clientWidth:Math.max(d,c||0),offsetTop:Math.trunc(n.top-t.top),offsetLeft:Math.trunc(n.left-t.left),scrollTop:s,scrollLeft:o,documentHeight:f,documentWidth:d,windowHeight:u,windowWidth:c})}const Ce=q(i.PAGE_INFO,_e),ze=Y(Ce,"PageInfo"),Fe=Z("stopPageInfo");function Be(e){const{scrollWidth:t,scrollHeight:n}=document.documentElement,s=typeof window<"u"&&window.visualViewport?window.visualViewport:{},{width:o=0,height:u=0,offsetLeft:c=0,offsetTop:f=0,pageLeft:d=0,pageTop:g=0,scale:h=1}=s;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:n},viewport:{width:o,height:u,offsetLeft:c,offsetTop:f,pageLeft:d,pageTop:g,scale:h}})}const xe=q(i.PARENT_INFO,Be),We=Y(xe,"ParentInfo"),Ue=Z("stopParentInfo");function J(e){const t=e.getBoundingClientRect(),n=F(e.id);return{x:Number(t.left)+Number(n.x),y:Number(t.top)+Number(n.y)}}function K(e){const{x:t,y:n}=ke(),s=r[e]?.iframe;if(H(e,"onScroll",{iframe:s,top:n,left:t,x:t,y:n})===!1){z();return}B(e)}function Ve(e){const{id:t,height:n,width:s}=e,o=window.parentIframe||window.parentIFrame||window;O(t,`scrollBy: x: %c${s}%c y: %c${n}`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT),o.scrollBy(s,n)}const Q=e=>t=>{const{id:n,iframe:s,height:o,width:u}=t;function c(I){De(I),K(n)}function f(I,S){I[`scrollTo${e?"Offset":""}`](S.x,S.y)}const d=I=>({x:u+I.x,y:o+I.y}),g=e?J(s):{x:0,y:0},h=d(g),R=window.parentIframe||window.parentIFrame;O(n,`Reposition requested (offset x:%c${g.x}%c y:%c${g.y})`,a.HIGHLIGHT,a.FOREGROUND,a.HIGHLIGHT),R?f(R,h):c(h)},je=Q(!1),Xe=Q(!0);function qe(e,t,n){const{x:s,y:o}=J(n);O(e,`Moving to in page link: %c#${t}`,a.HIGHLIGHT),E.position={x:s,y:o},K(e),window.location.hash=t}function Ze(e,t){const n=window.parentIframe||window.parentIFrame;if(!n){l(e,`In page link #${t} not found`);return}n.moveToAnchor(t)}function Ye(e,t){const n=t.split("#")[1]||"",s=decodeURIComponent(n),o=document.getElementById(s)||document.getElementsByName(s)[0];if(o){qe(e,n,o);return}if(window.top===window.self){l(e,`In page link #${n} not found`);return}Ze(e,n)}function Je(e){const t=r[e]?.iframe?.title;return t===""||t===void 0}function Ke(e,t){r[e]?.syncTitle&&(r[e].iframe.title=t,O(e,`Set iframe title attribute: %c${t}`,a.HIGHLIGHT))}let P=!1,m=!1;function ee(e,t=-3){if(P)return;const n=Math.max(r[e].mode,t);if(n>r[e].mode&&(r[e].mode=n),n<0)throw ue(e),r[e].vAdvised||b(e||"Parent",`${i.getModeData(n+2)}${i.getModeData(2)}`),r[e].vAdvised=!0,i.getModeData(n+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");switch(n>5&&m||ge(`v${i.VERSION} (${i.getModeLabel(n)})`,n),n){case 1:case 2:case 3:b("Parent",i.getModeData(6));break;case 4:b("Parent",i.getModeData(7));break;case 5:b("Parent",i.getModeData(8));break;default:n<1&&b("Parent",i.getModeData(3))}P=!0}function Qe(e){if(P)return;const{mode:t}=r[e];t>5&&ee(e,t)}function me(e){e?.log===-1&&(e.log=!1,m=!0)}function et(e,t){r[e]&&(l(e,`First run for ${e}`),ee(e,t===void 0?void 0:Number(t)),r[e].firstRun=!1)}function tt(e){const{height:t,id:n,iframe:s,mode:o,message:u,type:c,width:f}=e,{lastMessage:d}=r[n];switch(r[n]?.firstRun&&et(n,o),l(n,`Received: %c${d}`,a.HIGHLIGHT),c){case i.AUTO_RESIZE:r[n].autoResize=JSON.parse(M(n,9));break;case i.BEFORE_UNLOAD:O(n,"Ready state reset"),r[n].initialised=!1;break;case i.CLOSE:j(s);break;case i.IN_PAGE_LINK:Ye(n,M(n,9));break;case i.INIT:U(e),Pe(n),$e(n,u),r[n].initialised=!0,H(n,"onReady",s);break;case i.MESSAGE:ve(e,M(n,6));break;case i.MOUSE_ENTER:C("onMouseEnter",e);break;case i.MOUSE_LEAVE:C("onMouseLeave",e);break;case i.PAGE_INFO:ze(n);break;case i.PARENT_INFO:We(n);break;case i.PAGE_INFO_STOP:Fe(n);break;case i.PARENT_INFO_STOP:Ue(n);break;case i.RESET:X(e);break;case i.SCROLL_BY:Ve(e);break;case i.SCROLL_TO:je(e);break;case i.SCROLL_TO_OFFSET:Xe(e);break;case i.TITLE:Ke(n,u);break;default:if(f===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(f===0||t===0){l(n,"Ignoring message with 0 height or width");return}if(document.hidden){l(n,"Page hidden - ignored resize request");return}U(e)}}const nt=e=>({initChild:t,postMessageTarget:n})=>{e===n&&t()},it=e=>Object.values(r).forEach(nt(e));function te(e){const t=e.data;if(t===i.CHILD_READY_MESSAGE){it(e.source);return}if(!ye(t)){if(typeof t!==i.STRING)return;T(i.PARENT,"ignoredMessage"),fe(i.PARENT,t);return}const n=Ae(t),{id:s,type:o}=n;switch(T(s,o),!0){case!r[s]:throw new Error(`${o} No settings for ${s}. Message was: ${t}`);case!Ge(n):case Ne(n):case!Me(n,e):return;default:r[s].lastMessage=e.data,D(s,tt)(n)}}const rt=i.once(()=>{i.addEventListener(window,i.MESSAGE,te),i.addEventListener(document,"visibilitychange",Le),window.iframeParentListener=e=>setTimeout(()=>te({data:e,sameOrigin:!0}))}),ne={};function st(e){if(ne[e]===!0)return!1;const t=document.querySelectorAll(`iframe#${CSS.escape(e)}`);if(t.length<=1)return!0;ne[e]=!0;const n=Array.from(t).flatMap(s=>[i.NEW_LINE,s,i.NEW_LINE]);return b(e,`<rb>Duplicate ID attributes detected</>
|
|
11
7
|
|
|
12
8
|
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.
|
|
13
9
|
|
|
14
|
-
Found <bb>${t.length}</> iframes with the <b>${e}</> ID:`,...n,`
|
|
15
|
-
`),!1}function Wn(e){if(i[e]){const{iframe:t}=i[e];t.iframeResizer={close:Se.bind(null,t),disconnect:ke.bind(null,t),moveToAnchor(n){Lt(n,W,"moveToAnchor(anchor) anchor"),S("Move to anchor",`moveToAnchor:${n}`,e)},sendMessage(n){n=JSON.stringify(n),S(R,`${R}:${n}`,e)}}}}const Un="8",Vn="32",qn=ft,Zn=!0;function Jn(e){const{autoResize:t,bodyBackground:n,bodyMargin:o,bodyPadding:s,heightCalculationMethod:c,inPageLinks:l,license:a,log:f,logExpand:p,mouseEvents:h,offsetHeight:j,offsetWidth:y,mode:O,sizeHeight:Ho,sizeWidth:Lo,tolerance:ko,widthCalculationMethod:So}=i[e];return[e,Un,Lo,f,Vn,Zn,t,o,c,n,s,ko,l,qn,So,h,j,y,Ho,a,d.version,O,"",p].join(":")}const Yn="0";function Xn(e){const{bodyMargin:t}=i[e];(typeof t===pt||t===Yn)&&(i[e].bodyMargin=`${t}px`)}const Kn=e=>{try{return new URL(e).origin}catch{return null}},Qn=e=>typeof e===ae&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin"));function eo(e,t){const{checkOrigin:n,iframe:{src:o,sandbox:s},initialisedFirstPage:c,waitForLoad:l}=t[e],a=Kn(o);v(e,"noResponse"),b(e,`<rb>No response from iframe</>
|
|
10
|
+
Found <bb>${t.length}</> iframes with the <b>${e}</> ID:`,...n,i.NEW_LINE),!1}function ot(e){if(r[e]){const{iframe:t}=r[e];t.iframeResizer={close:j.bind(null,t),disconnect:V.bind(null,t),moveToAnchor(n){i.typeAssert(n,i.STRING,"moveToAnchor(anchor) anchor"),A("Move to anchor",`moveToAnchor:${n}`,e)},sendMessage(n){n=JSON.stringify(n),A(i.MESSAGE,`${i.MESSAGE}:${n}`,e)}}}}const at="8",ct="32",ft=i.CHILD,lt=!0;function ut(e){const{autoResize:t,bodyBackground:n,bodyMargin:s,bodyPadding:o,heightCalculationMethod:u,inPageLinks:c,license:f,log:d,logExpand:g,mouseEvents:h,offsetHeight:R,offsetWidth:I,mode:S,sizeHeight:xt,sizeWidth:Wt,tolerance:Ut,widthCalculationMethod:Vt}=r[e];return[e,at,Wt,d,ct,lt,t,s,u,n,o,Ut,c,ft,Vt,h,R,I,xt,f,E.version,S,"",g].join(i.SEPARATOR)}const dt="0";function gt(e){const{bodyMargin:t}=r[e];(typeof t===i.NUMBER||t===dt)&&(r[e].bodyMargin=`${t}px`)}const ht=e=>{try{return new URL(e).origin}catch{return null}},Et=e=>typeof e===i.OBJECT&&e.length>0&&!(e.contains("allow-scripts")&&e.contains("allow-same-origin"));function It(e,t){const{checkOrigin:n,iframe:{src:s,sandbox:o},initialisedFirstPage:u,waitForLoad:c}=t[e],f=ht(s);T(e,"noResponse"),b(e,`<rb>No response from iframe</>
|
|
16
11
|
|
|
17
12
|
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.
|
|
18
|
-
${n&&
|
|
19
|
-
The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${
|
|
20
|
-
`:""}${
|
|
13
|
+
${n&&f?`
|
|
14
|
+
The <b>checkOrigin</> option is currently enabled. If the iframe redirects away from <i>${f}</>, 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.
|
|
15
|
+
`:""}${c&&!u?`
|
|
21
16
|
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</>.
|
|
22
|
-
`:""}${
|
|
17
|
+
`:""}${Et(o)?`
|
|
23
18
|
The iframe has the <b>sandbox</> attribute, please ensure it contains both the <bb>allow-same-origin</> and <bb>allow-scripts</> values.
|
|
24
19
|
`:""}
|
|
25
20
|
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.
|
|
26
|
-
`)}function
|
|
21
|
+
`)}function pt(e,t){function n(){if(t[e]===void 0)return;const{initialised:u,loadErrorShown:c}=t[e];if(t[e].msgTimeout=void 0,u){t[e].initialisedFirstPage=!0;return}c||(t[e].loadErrorShown=!0,It(e,t))}const{msgTimeout:s,warningTimeout:o}=t[e];o&&(s&&clearTimeout(s),t[e].msgTimeout=setTimeout(n,o))}const Ot=1,bt=e=>e.loading===i.LAZY,Tt=e=>e===i.INIT;function wt(e){r[e]?.heightCalculationMethod in i.RESET_REQUIRED_METHODS&&X({id:e,iframe:r[e].iframe,height:i.MIN_SIZE,width:i.MIN_SIZE,type:i.INIT})}function Lt(e,t){const n=()=>setTimeout(t,Ot);i.addEventListener(e,i.LOAD,n)}const Ht=e=>{const{src:t,srcdoc:n}=e;return!n&&(t==null||t===""||t==="about:blank")};function St(e,t){const{iframe:n,waitForLoad:s}=r[e];if(s!==!0){if(Ht(n)){setTimeout(()=>{T(e,"noContent"),O(e,"No content detected in the iframe, delaying initialisation")});return}setTimeout(t)}}function At(e,t){const n=o=>()=>{if(!r[e])return;const{firstRun:u,iframe:c}=r[e];A(o,t,e),Tt(o)&&bt(c)||pt(e,r),u||wt(e)},{iframe:s}=r[e];r[e].initChild=n(i.INIT_FROM_IFRAME),Lt(s,n(i.ONLOAD)),St(e,n(i.INIT))}function Rt(e,t){return t?(("sizeWidth"in t||"sizeHeight"in t||i.AUTO_RESIZE in t)&&b(e,`<rb>Deprecated Option</>
|
|
27
22
|
|
|
28
|
-
The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${
|
|
29
|
-
`),t):{}}function
|
|
23
|
+
The <b>sizeWidth</>, <b>sizeHeight</> and <b>autoResize</> options have been replaced with new <b>direction</> option which expects values of <bb>${i.VERTICAL}</>, <bb>${i.HORIZONTAL}</>, <bb>${i.BOTH}</> or <bb>${i.NONE}</>.
|
|
24
|
+
`),t):{}}function Gt(e){r[e].warningTimeout||O(e,"warningTimeout:%c disabled",a.HIGHLIGHT)}function Mt(e,{offset:t,offsetSize:n}){const s=n||t;s&&(r[e].direction===i.VERTICAL?(r[e].offsetHeight=s,l(e,`Offset height: %c${s}`,a.HIGHLIGHT)):(r[e].offsetWidth=s,l(e,`Offset width: %c${s}`,a.HIGHLIGHT)))}function yt(e){const{direction:t}=r[e];switch(t){case i.VERTICAL:break;case i.HORIZONTAL:r[e].sizeHeight=!1;case i.BOTH:r[e].sizeWidth=!0;break;case i.NONE:r[e].sizeWidth=!1,r[e].sizeHeight=!1,r[e].autoResize=!1;break;default:throw new TypeError(`Direction value of "${t}" is not valid`)}l(e,`direction: %c${t}`,a.HIGHLIGHT)}const ie=e=>e===""||e.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":e;function Nt(e){const{checkOrigin:t,remoteHost:n}=r[e];Array.isArray(t)&&t.length===0&&w(e,"checkOrigin is an empty array — no messages will be sent to the iframe"),r[e].targetOrigin=Array.isArray(t)?t.map(ie):[t===!1?"*":ie(n)]}function Pt(e){const{id:t}=e;r[t].postMessageTarget===null&&(r[t].postMessageTarget=e.contentWindow)}function $(e,t,n){i.hasOwn(r[e],t)&&(b(e,`<rb>Deprecated option</>
|
|
30
25
|
|
|
31
|
-
The <b>${t}</> option has been renamed to <b>${n}</>. ${
|
|
26
|
+
The <b>${t}</> option has been renamed to <b>${n}</>. ${i.REMOVED_NEXT_VERSION}`),r[e][n]=r[e][t],delete r[e][t])}function $t(e){$(e,i.OFFSET,i.OFFSET_SIZE),$(e,"onClose","onBeforeClose"),$(e,"onClosed","onAfterClose")}const vt=e=>i.hasOwn(e,"onMouseEnter")||i.hasOwn(e,"onMouseLeave");function kt(e,t){const{id:n}=e;r[n]={...r[n],iframe:e,remoteHost:e?.src.split("/").slice(0,3).join("/"),...G,...Rt(n,t),mouseEvents:vt(t),mode:i.setMode(t),syncTitle:Je(n)},$t(n),yt(n),Mt(n,t),Gt(n),Pt(e),Nt(n)}const Dt="yes",re="no";function _t(e){const{id:t}=e;switch(l(t,`Iframe scrolling ${r[t]?.scrolling?"enabled":"disabled"} for ${t}`),e.style.overflow=r[t]?.scrolling===!1?i.HIDDEN:i.AUTO,r[t]?.scrolling){case i.OMIT:break;case!0:e.scrolling=Dt;break;case!1:e.scrolling=re;break;default:e.scrolling=r[t]?.scrolling||re}}function Ct(e,t,n){kt(t,n),l(e,`src: %c${t.srcdoc||t.src}`,a.HIGHLIGHT),Qe(e),_t(t),gt(e),At(e,ut(e)),ot(e),l(e,"Setup complete")}function zt(e,t){const{id:n}=e;T(n,"setup"),st(n)&&Ct(n,e,t),de(n)}function Ft(e,t){t.log===i.LOG_DISABLED?t.log=!1:t.log===i.LOG_COLLAPSED?t.log=i.COLLAPSE:t.log===i.LOG_EXPANDED&&(t.log=i.EXPAND);const n=i.hasOwn(t,"log"),s=i.isString(t.log),o=n?s?!0:t.log:G.log;i.hasOwn(t,"logExpand")||(t.logExpand=n&&s?t.log===i.EXPAND:G.logExpand),me(t),ce({enabled:o,expand:t.logExpand,iframeId:e}),s&&!(t.log in i.LOG_OPTIONS)&&le(e,`Invalid value for options.log: Accepted values are "${i.EXPAND}" and "${i.COLLAPSE}"`),t.log=o}function Bt(e){if(!i.isObject(e))throw new TypeError("Options is not an object");return rt(),Oe(e),t=>{const n=pe(t,e);return i.LABEL in t?(T(n,"alreadySetup"),w(n,`Ignored iframe (${n}), already setup.`)):(Ft(n,e),D(n,zt)(t,e)),t?.iframeResizer}}Object.defineProperty(p,"LOG_COLLAPSED",{enumerable:!0,get:()=>i.LOG_COLLAPSED}),Object.defineProperty(p,"LOG_DISABLED",{enumerable:!0,get:()=>i.LOG_DISABLED}),Object.defineProperty(p,"LOG_EXPANDED",{enumerable:!0,get:()=>i.LOG_EXPANDED}),p.default=Bt,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
32
27
|
//# sourceMappingURL=index.umd.js.map
|