UNPKG

@iframe-resizer/core

Version:

Keep iframes sized to their content.

21 lines (18 loc) 19 kB
/*! * @preserve * * @module iframe-resizer/core 5.4.6 (cjs) - 2025-04-24 * * @license GPL-3.0 for non-commercial use only. * For commercial use, you must purchase a license from * https://iframe-resizer.com/pricing * * @description Keep same and cross domain iFrames sized to their content * * @author David J. Bradshaw <info@iframe-resizer.com> * * @see {@link https://iframe-resizer.com} * * @copyright (c) 2013 - 2025, David J. Bradshaw. All rights reserved. */ "use strict";const e=require("auto-console-group"),t="5.4.6",i="[iFrameSizer]",o=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),n="onload",r="init",a=Object.freeze({[n]:1,[r]:1}),s="expanded",l="collapsed",c=Object.freeze({[s]:1,[l]:1}),u=(e,t,i,o)=>e.addEventListener(t,i,o||!1),d=(e,t,i)=>e.removeEventListener(t,i,!1),p=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let o,n=0;n<e.length;n++)o=e.codePointAt(n),t=Math.imul(t^o,2246822519),i=Math.imul(i^o,3266489917);return t^=Math.imul(t^i>>>15,1935289751),i^=Math.imul(i^t>>>15,3405138345),t^=i>>>16,i^=t>>>16,(2097152*(i>>>0)+(t>>>11)).toString(36)},f=e=>e.replace(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),h=["<iy><yi>Puchspk Spjluzl Rlf</><iy><iy>","<iy><yi>Tpzzpun Spjluzl Rlf</><iy><iy>","Aopz spiyhyf pz hchpshisl dpao ivao Jvttlyjphs huk Vwlu-Zvbyjl spjluzlz.<iy><iy><i>Jvttlyjphs Spjluzl</><iy>Mvy jvttlyjphs bzl, <p>pmyhtl-ylzpgly</> ylxbpylz h svd jvza vul aptl spjluzl mll. Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.<iy><iy><i>Vwlu Zvbyjl Spjluzl</><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-jvttlyjphs vwlu zvbyjl wyvqlja aolu fvb jhu bzl pa mvy myll bukly aol alytz vm aol NWS C3 Spjluzl. Av jvumpyt fvb hjjlwa aolzl alytz, wslhzl zla aol <i>spjluzl</> rlf pu <p>pmyhtl-ylzpgly</> vwapvuz av <i>NWSc3</>.<iy><iy>Mvy tvyl pumvythapvu wslhzl zll: <b>oaawz://pmyhtl-ylzpgly.jvt/nws</>","<i>NWSc3 Spjluzl Clyzpvu</><iy><iy>Aopz clyzpvu vm <p>pmyhtl-ylzpgly</> pz ilpun bzlk bukly aol alytz vm aol <i>NWS C3</> spjluzl. Aopz spjluzl hssvdz fvb av bzl <p>pmyhtl-ylzpgly</> pu Vwlu Zvbyjl wyvqljaz, iba pa ylxbpylz fvby wyvqlja av il wbispj, wyvcpkl haaypibapvu huk il spjluzlk bukly clyzpvu 3 vy shaly vm aol NUB Nlulyhs Wbispj Spjluzl.<iy><iy>Pm fvb hyl bzpun aopz spiyhyf pu h uvu-vwlu zvbyjl wyvqlja vy dlizpal, fvb dpss ullk av wbyjohzl h svd jvza vul aptl jvttlyjphs spjluzl.<iy><iy>Mvy tvyl pumvythapvu cpzpa <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</>.","<iy><yi>Zvsv spjluzl kvlz uva zbwwvya jyvzz-kvthpu</><iy><iy>Av bzl <p>pmyhtl-ylzpgly</> dpao jyvzz kvthpu pmyhtlz fvb ullk lpaoly aol Wyvmlzzpvuhs vy Ibzpulzz spjluzlz. Mvy klahpsz vu bwnyhkl wypjpun wslhzl jvuahja pumv@pmyhtl-ylzpgly.jvt."],m=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],g=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),y=e=>f(h[e]),b=e=>{const t=e[f("spjluzl")];if(!t)return-1;const i=t.split("-");let o=function(e=""){let t=-2;const i=p(f(e));return i in g&&(t=g[i]),t}(i[0]);return 0===o||(e=>e[2]===p(e[0]+e[1]))(i)||(o=-2),o},v=e=>e,w=e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","").replaceAll("</>","").replaceAll("<b>","").replaceAll("<i>","").replaceAll("<u>","")):e((e=>e.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,""))(t)),z=(j=e,j?.__esModule?j.default:j);var j;let $={},T=!1;const I=e=>window.top===window.self?`parent(${e})`:`nested parent(${e})`;const k=e=>(t,...i)=>$[t]?.console[e](...i);var H;const x=(H="log",(e,...t)=>!0===(e=>$[e]?$[e].log:T)(e)?k(H)(e,...t):null),O=k("warn"),R=k("error"),M=k("event"),L=k("purge"),S=k("errorBoundary");const E=(e,...t)=>$[e]?$[e].console.warn(w(v)(...t)):queueMicrotask((()=>console?.warn(w((e=>(...t)=>[`iframeResizer(${e})`,...t].join(" "))(e))(...t)))),W=(e=>(t,i="renamed to")=>(o,n,r="",a="")=>e(a,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${i} <b>${n}</>. ${r}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))(E),N=W("Option"),G={},A=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"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:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof G[e.id].onInit&&(N("init()","onReady()","",e.id),G[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),C={position:null,version:t};function F(o){function n(){V(k),J(H),$("onResized",k)}function r(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function a(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const s=e=>I.slice(I.indexOf(":")+7+e);const l=(e,t)=>(i,o)=>{const n={};var r,a;r=function(){Y(`${i} (${e})`,`${e}:${t()}`,o)},n[a=o]||(r(),n[a]=requestAnimationFrame((()=>{n[a]=null})))},c=(e,t)=>()=>{let i=!1;const o=t=>()=>{G[l]?i&&i!==t||(e(t,l),i=t,requestAnimationFrame((()=>{i=!1}))):s()},n=o("scroll"),r=o("resize window");function a(e,t){t(window,"scroll",n),t(window,"resize",r)}function s(){M(l,`stop${t}`),a(0,d),c.disconnect(),p.disconnect(),d(G[l].iframe,"load",s)}const l=H,c=new ResizeObserver(o("pageObserver")),p=new ResizeObserver(o("iframeObserver"));G[l]&&(G[l][`stop${t}`]=s,u(G[l].iframe,"load",s),a(0,u),c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),p.observe(G[l].iframe,{attributes:!0,childList:!1,subtree:!1}))},p=e=>()=>{e in G[H]&&(G[H][e](),delete G[H][e])},f=l("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=k.iframe.getBoundingClientRect(),{scrollY:i,scrollX:o,innerHeight:n,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,n||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:o,documentHeight:a,documentWidth:s,windowHeight:n,windowWidth:r})})),h=l("parentInfo",(function(){const{iframe:e}=k,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:o,height:n,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}=window.visualViewport;return JSON.stringify({iframe:e.getBoundingClientRect(),document:{scrollWidth:t,scrollHeight:i},viewport:{width:o,height:n,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),m=c(f,"PageInfo"),g=c(h,"ParentInfo"),y=p("stopPageInfo"),b=p("stopParentInfo");function v(e){const t=e.getBoundingClientRect();return q(),{x:Number(t.left)+Number(C.position.x),y:Number(t.top)+Number(C.position.y)}}function w(t){const i=t?v(k.iframe):{x:0,y:0};x(H,`Reposition requested (offset x:%c${i.x}%c y:%c${i.y})`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT);const o=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(k,i),n=window.parentIframe||window.parentIFrame;n?function(e,i){e["scrollTo"+(t?"Offset":"")](i.x,i.y)}(n,o):function(e){C.position=e,z(H)}(o)}function z(e){const{x:t,y:i}=C.position,o=G[e]?.iframe;!1!==$("onScroll",{iframe:o,top:i,left:t,x:t,y:i})?J(e):U()}function j(e){let t={};if(0===k.width&&0===k.height){const e=s(9).split(":");t={x:e[1],y:e[0]}}else t={x:k.width,y:k.height};$(e,{iframe:k.iframe,screenX:Number(t.x),screenY:Number(t.y),type:k.type})}const $=(e,t)=>B(H,e,t);function T(){const{height:i,iframe:o,msg:r,type:a,width:l}=k;switch(G[H]?.firstRun&&G[H]&&(G[H].firstRun=!1),a){case"close":D(o);break;case"message":u=s(6),$("onMessage",{iframe:k.iframe,message:JSON.parse(u)});break;case"mouseenter":j("onMouseEnter");break;case"mouseleave":j("onMouseLeave");break;case"autoResize":G[H].autoResize=JSON.parse(s(9));break;case"scrollBy":!function(){const t=k.width,i=k.height,o=window.parentIframe||window.parentIFrame||window;x(H,`scrollBy: x: %c${t}%c y: %c${i}`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),o.scrollBy(t,i)}();break;case"scrollTo":w(!1);break;case"scrollToOffset":w(!0);break;case"pageInfo":m();break;case"parentInfo":g();break;case"pageInfoStop":y();break;case"parentInfoStop":b();break;case"inPageLink":!function(t){const i=t.split("#")[1]||"",o=decodeURIComponent(i);let n=document.getElementById(o)||document.getElementsByName(o)[0];n?function(){const t=v(n);x(H,`Moving to in page link: %c#${i}`,e.HIGHLIGHT),C.position={x:t.x,y:t.y},z(H),window.location.hash=i}():window.top!==window.self&&function(){const e=window.parentIframe||window.parentIFrame;e&&e.moveToAnchor(i)}()}(s(9));break;case"title":!function(t,i){G[i]?.syncTitle&&(G[i].iframe.title=t,x(i,`Set iframe title attribute: %c${t}`,e.HIGHLIGHT))}(r,H);break;case"reset":Z(k);break;case"init":n(),function(e){try{G[e].sameOrigin=!!G[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){G[e].sameOrigin=!1}}(H),(c=r)!==t&&(void 0!==c||E(H,"<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")),Q=!0,$("onReady",o);break;default:if(0===l&&0===i)return void O(H,`Unsupported message received (${a}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===l||0===i)return;if(document.hidden)return;n()}var c,u}let I=o.data,k={},H=null;"[iFrameResizerChild]Ready"!==I?i===`${I}`.slice(0,13)&&I.slice(13).split(":")[0]in G&&(k=function(){const e=I.slice(13).split(":"),t=e[1]?Number(e[1]):0,i=G[e[0]]?.iframe,o=getComputedStyle(i);return{iframe:i,id:e[0],height:t+r(o)+a(o),width:Number(e[2]),type:e[3],msg:e[4]}}(),H=k.id,H?(M(H,k.type),S(H,(function(){!function(e){if(!G[e])throw new Error(`${k.type} No settings for ${e}. Message was: ${I}`)}(H),k.type in{true:1,false:1,undefined:1}||(G[H].loaded=!0,(null!==k.iframe||(O(H,`The iframe (${k.id}) was not found.`),0))&&function(){const{origin:e,sameOrigin:t}=o;if(t)return!0;let i=G[H]?.checkOrigin;if(i&&"null"!=`${e}`&&!(i.constructor===Array?function(){let t=0,o=!1;for(;t<i.length;t++)if(i[t]===e){o=!0;break}return o}():function(){const t=G[H]?.remoteHost;return e===t}()))throw new Error(`Unexpected message received from: ${e} for ${k.iframe.id}. Message was: ${o.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&T())}))()):O("","iframeResizer received messageData without id, message was: ",I)):Object.keys(G).forEach((e=>{G[e].mode>=0&&Y("iFrame requested init",_(e),e)}))}function B(e,t,i){let o=null,n=null;if(G[e]){if(o=G[e][t],"function"!=typeof o)throw new TypeError(`${t} on iFrame[${e}] is not a function`);if("onClose"===t||"onScroll"===t)try{n=o(i)}catch(i){console.error(i),O(e,`Error in ${t} callback`)}else setTimeout((()=>o(i)))}return n}function P(e){const{id:t}=e;delete G[t],delete e.iframeResizer}function D(e){const{id:t}=e;if(!1!==B(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){O(t,e)}B(t,"onClosed",t),P(e)}}function q(e){null===C.position&&(C.position={x:window.scrollX,y:window.scrollY})}function U(){C.position=null}function J(t){null!==C.position&&(window.scrollTo(C.position.x,C.position.y),x(t,`Set page position: %c${C.position.x}%c, %c${C.position.y}`,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),U())}function Z(e){q(e.id),V(e),Y("reset","reset",e.id)}function V(t){function i(i){const n=`${t[i]}px`;t.iframe.style[i]=n,x(o,`Set ${i}: %c${n}`,e.HIGHLIGHT)}const{id:o}=t,{sizeHeight:n,sizeWidth:r}=G[o];n&&i("height"),r&&i("width")}$=G;const X=e=>e.split(":").filter(((e,t)=>19!==t)).join(":");function Y(t,o,n,r){function s(i){const r=t in a?X(o):o;x(n,i,e.HIGHLIGHT,e.FOREGROUND,e.HIGHLIGHT),x(n,`Message data: %c${r}`,e.HIGHLIGHT)}M(n,t),G[n]&&(G[n]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:t,sameOrigin:r,targetOrigin:a}=G[n];if(r)try{return e.contentWindow.iframeChildListener(i+o),void s(`Sending message to iframe %c${n}%c via sameOrigin`)}catch(e){}s(`Sending message to iframe: %c${n}%c targetOrigin: %c${a}`),t.postMessage(i+o,a)}():O(n,`Iframe(${n}) not found`),r&&G[n]?.warningTimeout&&(G[n].msgTimeout=setTimeout((function(){if(void 0===G[n])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:o}=G[n],{sandbox:r}=e,a="object"==typeof r&&r.length>0;t||i||(G[n].loadErrorShown=!0,E(n,`<rb>No response from iFrame</>\n \nThe iframe (<i>${n}</>) has not responded within ${G[n].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${o?"\nThe <b>waitForLoad</> option is currently set to <i>'true'</>. If the iframe loads before the JavaScript runs, this option will prevent <i>iframe-resizer</> from initialising. To disable this, set the <b>waitForLoad</> option to <i>'false'</>. \n":""}${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"\nThe iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"} \n${!a||r.contains("allow-scripts")&&r.contains("allow-same-origin")?"":"The iframe has the <b>sandbox</> attribute, please ensure it contains both the <i>'allow-same-origin'</> and <i>'allow-scripts'</> values.\n"}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.\n`))}),G[n].warningTimeout)))}function _(e){const t=G[e];return[e,"8",t.sizeWidth,t.log,"32",!0,t.autoResize,t.bodyMargin,t.heightCalculationMethod,t.bodyBackground,t.bodyPadding,t.tolerance,t.inPageLinks,"child",t.widthCalculationMethod,t.mouseEvents,t.offsetHeight,t.offsetWidth,t.sizeHeight,t.license,C.version,t.mode,"",t.logExpand].join(":")}let K=0,Q=!1,ee=!1;function te(){!1===document.hidden&&function(e,t){const i=e=>G[e]?.autoResize&&!G[e]?.firstRun;Object.keys(G).forEach((function(o){i(o)&&Y(e,t,o)}))}("Tab Visible","resize")}const ie=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{u(window,"message",F),u(document,"visibilitychange",te),window.iframeParentListener=e=>setTimeout((()=>F({data:e,sameOrigin:!0})))}));module.exports=i=>a=>{function l(){if(G[k]){const{iframe:e}=G[k],t={close:D.bind(null,e),disconnect:P.bind(null,e),removeListeners(){E(k,"<rb>Deprecated Method Name</>\n\nThe emoveListeners()</> method has been renamed to isconnect()</>.\n"),this.disconnect()},resize(){E(k,"<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."),Y.bind(null,"Window resize","resize",k)},moveToAnchor(e){((e,t,i)=>{if(typeof e!==t)throw new TypeError(`${i} is not a ${o=t,o.charAt(0).toUpperCase()+o.slice(1)}`);var o})(e,"string","moveToAnchor(anchor) anchor"),Y("Move to anchor",`moveToAnchor:${e}`,k)},sendMessage(e){Y("message",`message:${e=JSON.stringify(e)}`,k)}};e.iframeResizer=t,e.iFrameResizer=t}}function d(e){const{id:t}=a,{mode:i,waitForLoad:s}=G[t];-1!==i&&-2!==i&&(u(a,"load",(function(){Y(n,`${e}:${Q}`,t,!0),function(){const e=G[k]?.firstRun,t=G[k]?.heightCalculationMethod in o;!e&&t&&Z({iframe:a,height:0,width:0,type:"init"})}()})),!1===s&&Y(r,`${e}:${Q}`,t,!0))}function p(e){return e?(("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&E(k,'<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 <i>"vertical"</>, <i>"horizontal"</> or <i>"horizontal"</>.\n'),e):{}}function h(){const{mode:o}=G[k];if(o<0)throw E("Parent",`${y(o+2)}${y(2)}`),L(k),y(o+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"");ee||o>0&&i.vInfoDisable||function(t,i){queueMicrotask((()=>console.info(`%ciframe-resizer ${t}`,T||i<1?"font-weight: bold;":e.NORMAL)))}(`v${t} (${(e=>f(m[e]))(o)})`,o),!ee&&o<1&&E("Parent",y(3)),ee=!0}function g(e){const t=G[e]?.iframe?.title;return""===t||void 0===t}const v=e=>Object.hasOwn(e,"onMouseEnter")||Object.hasOwn(e,"onMouseLeave");function w(e){var t,i;G[k]={...G[k],iframe:a,firstRun:!0,remoteHost:a?.src.split("/").slice(0,3).join("/"),...A,...p(e),mouseEvents:v(e),mode:b(e),syncTitle:g(k)},M(k,"setup"),function(){const{direction:e}=G[k];if("horizontal"===e)return G[k].sizeWidth=!0,void(G[k].sizeHeight=!1);if("none"===e)return G[k].sizeWidth=!1,G[k].sizeHeight=!1,void(G[k].autoResize=!1);if("vertical"!==e)throw new TypeError(k,`Direction value of "${e}" is not valid`)}(),(t=e?.offsetSize||e?.offset)&&("vertical"===G[k].direction?G[k].offsetHeight=t:G[k].offsetWidth=t),e?.offset&&E(k,"<rb>Deprecated option</>\n\n The <b>offset</> option has been renamed to <b>offsetSize</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>."),null===G[k].postMessageTarget&&(G[k].postMessageTarget=a.contentWindow),G[k].targetOrigin=!0===G[k].checkOrigin?""===(i=G[k].remoteHost)||null!==i.match(/^(about:blank|javascript:|file:\/\/)/)?"*":i:"*"}const j=()=>"iframeResizer"in a,k=function(e){if(e&&"string"!=typeof e)throw new TypeError("Invalid id for iFrame. Expected String");return""!==e&&e||(e=function(){let e=i?.id||A.id+K++;return null!==document.getElementById(e)&&(e+=K++),e}(),a.id=e),e}(a.id);if("object"!=typeof i)throw new TypeError("Options is not an object");return function(e){const{search:t}=window.location;t.includes("ifrlog")&&(e.log=s,e.logExpand=!t.includes("ifrlog=collapsed"))}(i),function(e,t){const i=Object.hasOwn(t,"log"),o="string"==typeof t.log,n=i?!!o||t.log:A.log;Object.hasOwn(t,"logExpand")||(t.logExpand=i&&o?t.log===s:A.logExpand),function(e){-1===e?.log&&(e.log=!1,e.vInfoDisable=!0)}(t),function({enabled:e,expand:t,iframeId:i}){const o=z({expand:t,label:I(i)});T=e,$[i]||($[i]={console:o})}({enabled:n,expand:t.logExpand,iframeId:e}),o&&!(t.log in c)&&R(e,'Invalid value for options.log: Accepted values are "expanded" and "collapsed"'),t.log=n}(k,i),S(k,(function(e){j()?O(k,`Ignored iframe (${k}), already setup.`):(w(e),h(),ie(),function(){switch(a.style.overflow=!1===G[k]?.scrolling?"hidden":"auto",G[k]?.scrolling){case"omit":break;case!0:a.scrolling="yes";break;case!1:a.scrolling="no";break;default:a.scrolling=G[k]?G[k].scrolling:"no"}}(),function(){const{bodyMargin:e}=G[k];"number"!=typeof e&&"0"!==e||(G[k].bodyMargin=`${e}px`)}(),d(_(k)),l())}))(i),a?.iFrameResizer};