@iframe-resizer/child 5.5.9 → 6.0.0-beta.1
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/LICENSE +2 -2
- package/README.md +1 -1
- package/iframe-resizer.child.d.ts +5 -1
- package/index.cjs.js +43 -20
- package/index.cjs.js.map +1 -0
- package/index.esm.js +1424 -20
- package/index.esm.js.map +1 -0
- package/index.umd.js +45 -20
- package/index.umd.js.map +1 -0
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1,20 +1,1424 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import e,{NORMAL as t,HIGHLIGHT as n,FOREGROUND as o,ITALIC as r,BOLD as a}from"auto-console-group";const i="5.5.9",s="iframeResizer",c=":",l="init",d="message",u="pageHide",m="pageInfo",f="parentInfo",p="scrollToOffset",h="title",y=10,g="data-iframe-size",b="data-iframe-overflowed",v="data-iframe-ignore",z="height",w="width",$="offset",S="offsetSize",O="string",E="number",M="object",j="function",k="auto",x="readystatechange",T="bottom",I="right",N="autoResizeEnabled",C=Symbol("sizeChanged"),P="manualResize",A="parentResize",R={[P]:1,[A]:1},B="setOffsetSize",L="resizeObserver",q="overflowObserver",D="mutationObserver",W="visibilityObserver",F="[iFrameSizer]",V=new Set(["head","body","meta","base","title","script","link","style","map","area","option","optgroup","template","track","wbr","nobr"]),H=e=>{if(!e)return"";let t=-559038744,n=1103547984;for(let o,r=0;r<e.length;r++)o=e.codePointAt(r),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)},U=e=>e.replace(/[A-Za-z]/g,e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26)),Z=["spjluzl","rlf","clyzpvu"],J=["<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."],_=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],Q=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5","2b5sdlfhbev","zo4ui3arjo","oclbb4thgl"].map((e,t)=>[e,Math.max(0,t-1)])),Y=e=>U(J[e]),G=e=>{const t=e[U(Z[0])]||e[U(Z[1])]||e[U(Z[2])];if(!t)return-1;const n=t.split("-");let o=function(e=""){let t=-2;const n=H(U(e));return n in Q&&(t=Q[n]),t>4?t-4:t}(n[0]);return 0===o||(e=>e[2]===H(e[0]+e[1]))(n)||(o=-2),o},X=(e,...t)=>setTimeout(()=>e(...t),0),K=e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}},ee=e=>e,te=e=>Math.round(1e3*e)/1e3,ne=e=>e.charAt(0).toUpperCase()+e.slice(1),oe=e=>""!=`${e}`&&void 0!==e,re=e=>e();const ae=(e,t,n)=>{if(typeof e!==t)throw new TypeError(`${n} is not a ${ne(t)}`)},ie={br:"\n",rb:"[31;1m",bb:"[34;1m",b:"[1m",i:"[3m",u:"[4m","/":"[m"},se=Object.keys(ie),ce=new RegExp(`<(${se.join("|")})>`,"gi"),le=(e,t)=>ie[t]??"";let de=!0,ue=s;var me;const fe=(me=e,me?.__esModule?me.default:me)({label:`${s}(child)`,expand:!1});var pe;const he=(pe="log",(...e)=>!de||fe[pe](...e));const{assert:ye,endAutoGroup:ge,error:be,errorBoundary:ve,event:ze,label:we,purge:$e,warn:Se}=fe,Oe=(Ee=ee,e=>Ee(typeof e===O?window.chrome?e.replace(ce,le):(e=>e.replaceAll("<br>","\n").replaceAll(/<\/?[^>]+>/gi,""))(e):e));var Ee;const Me=(...e)=>fe.warn(...e.map(Oe)),je=(e=>(t,n="renamed to")=>(o,r,a="",i="")=>e(i,`<rb>Deprecated ${t}(${o.replace("()","")})</>\n\nThe <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${r}</>. ${a}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`))((e,t)=>Me(t)),ke=je("Method"),xe=je("Method","replaced with"),Te=je("Option"),Ie=["min-height","min-width","max-height","max-width"],Ne=new Set,Ce=(e,t)=>window.getComputedStyle(e).getPropertyValue(t),Pe=(e,t)=>{return(n=Ce(e,t))&&"0px"!==n&&n!==k&&"none"!==n;var n};function Ae({href:e}){Ne.has(e)||Ne.add(e)}const Re=(e,t)=>function(e,t){const n=e.style[t];return n?{source:"an inline style attribute",value:n}:null}(e,t)||function(e,t){for(const n of document.styleSheets)try{for(const o of n.cssRules||[])if(o.selectorText&&e.matches(o.selectorText)){const e=o.style[t];if(e)return{source:"STYLE"===n.ownerNode.tagName?"an inline <style> block":`stylesheet (${n.href})`,value:e}}}catch(e){Ae(n)}return{source:"cross-origin stylesheet",value:Ce(e,t)}}(e,t),Be=(e,t)=>{const{source:n,value:o}=Re(e,t),r=(e=>e.tagName?e.tagName.toLowerCase():"unknown")(e);Me(`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${r}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.\n\nIf you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`)};function Le(){for(const e of[document.documentElement,document.body])for(const t of Ie)Pe(e,t)&&Be(e,t)}const qe=e=>t=>void 0===t?void 0:e(t),De=qe(e=>"true"===e),We=qe(Number),Fe=[],Ve=(e,t,n,o)=>{e.removeEventListener(t,n,o)},He=(e,t,n,o=!1)=>{e.addEventListener(t,n,o),Fe.push(()=>Ve(e,t,n,o))},Ue=e=>e=>{e.size},Ze=((e="")=>t=>n=>{n.size>0&&be(`${t}Observer ${e}:`,...Array.from(n).flatMap(e=>["\n",e]))})("already attached"),Je=e=>e=>{e.size},_e=(e,o=!0)=>r=>{r>0&&he(`${o?"At":"De"}tached %c${e}Observer%c ${o?"to":"from"} %c${r}%c element${1===r?"":"s"}`,n,t,n,t)},Qe=(e,t,n,o)=>{const r=Je(e);return e=>{const a=new Set;let i=0;for(const o of e)n.has(o)&&(t.unobserve(o),n.delete(o),a.add(o),i+=1);r(a),o(i),a.clear()}},Ye=new Set,Ge=new Set,Xe=new Set,Ke=[],et={attributes:!0,attributeFilter:[v,g],attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};let tt,nt=1,ot=!1,rt=0;const at=e=>{e.size},it=e=>{e.size},st=e=>{e.size},ct=e=>e.nodeType!==Node.ELEMENT_NODE||V.has(e.tagName.toLowerCase());function lt(e){const t=e.addedNodes;for(const e of t)ct(e)||Ye.add(e)}function dt(e){const t=e.removedNodes;for(const e of t)ct(e)||(Ye.has(e)?(Ye.delete(e),Xe.add(e)):Ge.add(e))}const ut=e=>{he("Mutations:",e);for(const t of e)lt(t),dt(t);at(Ye),it(Ge),st(Xe),Xe.clear()};const mt=e=>()=>{const t=performance.now(),r=t-rt,a=16*nt+++2;if(r>a&&r<200)return ze("mutationThrottled"),he("Update delayed due to heavy workload on the callStack"),he(`EventLoop busy time: %c${te(r)}ms %c> Max wait: %c${a-2}ms`,n,o,n),setTimeout(tt,16*nt),void(rt=t);nt=1,Ke.forEach(ut),Ke.length=0,ot=!1,Ge.size,Ye.size,e({addedNodes:Ye,removedNodes:Ge}),Ye.clear(),Ge.clear()};function ft(e){Ke.push(e),ot||(rt=performance.now(),ot=!0,requestAnimationFrame(tt))}function pt(e){const t=new window.MutationObserver(ft),r=document.body||document.documentElement;return tt=mt(e),t.observe(r,et),he("Attached%c MutationObserver%c to body",n,o),{...t,disconnect:()=>{Ye.clear(),Ge.clear(),Ke.length=0,t.disconnect(),he("Detached%c MutationObserver",n)}}}const ht="Overflow",yt=_e(ht),gt=_e(ht,!1),bt=Ue(ht),vt=Ze(ht),zt=e=>e.hidden||null===e.offsetParent||"none"===e.style.display,wt=(e,t)=>{const o=t.side,r={root:t.root,rootMargin:"0px",threshold:1},a=window?.requestAnimationFrame||ee,i=(t=!1)=>e(t),s=(e,t)=>0===e||e>t[o],c=(e,t)=>e.toggleAttribute(b,t);const l=new IntersectionObserver(function(e){for(const t of e){const{boundingClientRect:e,rootBounds:n,target:r}=t;if(!n)continue;const a=e[o],i=s(a,n)&&!zt(r);c(r,i)}a(i)},r),d=new WeakSet;return{attachObservers:function(e){const t=new Set,n=new Set;let o=0;for(const r of e)r.nodeType===Node.ELEMENT_NODE&&(d.has(r)?t.add(r):(l.observe(r),d.add(r),n.add(r),o+=1));vt(t),bt(n),yt(o),n.clear(),t.clear()},detachObservers:Qe(ht,l,d,gt),disconnect:()=>{l.disconnect(),he("Detached%c OverflowObserver",n)}}},$t="--ifr-start",St="--ifr-end",Ot="--ifr-measure",Et=[];let Mt,jt={},kt=0;function xt(){try{performance.clearMarks($t),performance.clearMarks(St),performance.clearMeasures(Ot)}catch{}}function Tt(e){e.getEntries().forEach(e=>{if(e.name===St)try{const{duration:t}=performance.measure(Ot,$t,St);jt=e.detail,Et.push(t),Et.length>100&&Et.shift()}catch{}})}function It(){he("Attached%c PerformanceObserver%c to page",n,o);const e=new PerformanceObserver(Tt);return e.observe({entryTypes:["mark"]}),Mt=setInterval(()=>{if(Et.length<10)return;if(jt.hasTags&&jt.len<25)return;Et.sort();const e=Math.min(Et.reduce((e,t)=>e+t,0)/Et.length,Et[Math.floor(Et.length/2)]),t=te(e);t>kt&&(kt=t,ze("performanceObserver")),xt(),e<=4||(clearInterval(Mt),Me(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${te(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${jt.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))},5e3),{disconnect:()=>{xt(),clearInterval(Mt),e.disconnect(),he("Detached%c PerformanceObserver",n)}}}const Nt="Resize",Ct=_e(Nt),Pt=_e(Nt,!1),At=Ue(Nt),Rt=Ze(Nt),Bt=new WeakSet,Lt=new Set,qt=new Set;let Dt;function Wt(e){let t=0;for(const n of e){if(n.nodeType!==Node.ELEMENT_NODE)continue;const e=getComputedStyle(n)?.position;""!==e&&"static"!==e&&(Bt.has(n)?Lt.add(n):(Dt.observe(n),Bt.add(n),qt.add(n),t+=1))}Rt(Lt),At(qt),Ct(t),qt.clear(),Lt.clear()}function Ft(e){const t=new IntersectionObserver(t=>e(t.at(-1).isIntersecting),{threshold:0}),r=document.documentElement;return t.observe(r),he("Attached%c VisibilityObserver%c to page",n,o),{disconnect:()=>{t.disconnect(),he("Detached%c VisibilityObserver",n)}}}const Vt=e=>(t,n)=>{if(n in t){if(typeof t[n]===e)return t[n];throw new TypeError(`${n} is not a ${e}.`)}},Ht=Vt(j),Ut=Vt(E),Zt=Vt(O);"undefined"!=typeof window&&function(){const e={height:()=>(Se("Custom height calculation function not defined"),Cn.auto()),width:()=>(Se("Custom width calculation function not defined"),Pn.auto())},H={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},J={},Q=k,te="scroll";let ie,se,ce,le,me,pe,Oe,Ee=!0,je="",Ie=0,Ne="",Ce="",Pe=!1,Ae=!0,Re=!1,Be=!0,qe=!1,Ue=!1,Ze=!0,Je=!1,_e=1,Ye=Q,Ge="",Xe=!0,Ke={},et=!1,tt=!1,nt=!1,ot=0,rt=!1,at=0,it=0,st=new Set,ct="",lt="child",dt=!1,ut="",mt=[],ft=window.parent,ht="*",yt=0,gt=!1,bt=1,vt=te,zt=window,Ot=()=>{Se("onMessage function not defined")},Et=()=>{},Mt=null,jt=null;function kt(t){var o;!function(e){ct=e[0]??ct,Ie=We(e[1])??Ie,Re=De(e[2])??Re,nt=De(e[3])??nt,Ee=De(e[6])??Ee,Ne=e[7]??Ne,Ye=e[8]??Ye,je=e[9]??je,Ce=e[10]??Ce,yt=We(e[11])??yt,Ke.enable=De(e[12])??!1,lt=e[13]??lt,vt=e[14]??vt,rt=De(e[15])??rt,at=We(e[16])??at,it=We(e[17])??it,Ae=De(e[18])??Ae,ie=e[19]??ie,pe=e[20]??pe,ot=We(e[21])??ot,tt=De(e[23])??tt}(t),ue=(o={id:ct,enabled:nt,expand:tt}).id||s,fe.label(`${ue}`),fe.expand(o.expand),de=o.enabled,ze("initReceived"),function(){function t(e){Oe=Ht(e,"onBeforeResize")??Oe,Ot=Ht(e,"onMessage")??Ot,Et=Ht(e,"onReady")??Et,typeof e?.offset===E&&(Te($,S),Ae&&(at=Ut(e,$)??at),Re&&(it=Ut(e,$)??it)),typeof e?.offsetSize===E&&(Ae&&(at=Ut(e,S)??at),Re&&(it=Ut(e,S)??it)),se=Zt(e,U(Z[0]))??se,Ge=Zt(e,"ignoreSelector")??Ge,ut=Zt(e,"sizeSelector")??ut,ht=Zt(e,"targetOrigin")??ht,Ye=e?.heightCalculationMethod||Ye,vt=e?.widthCalculationMethod||vt}function o(t,n){return typeof t===j&&(Me(`<rb>Deprecated Option(${n}CalculationMethod)</>\n\nThe use of <b>${n}CalculationMethod</> as a function is deprecated and will be removed in a future version of <i>iframe-resizer</>. Please use the new <b>onBeforeResize</> event handler instead.\n\nSee <u>https://iframe-resizer.com/api/child</> for more details.`),e[n]=t,t="custom"),t}if(1===ot)return;const r=window.iframeResizer||window.iFrameResizer;typeof r===M&&(t(r),Ye=o(Ye,z),vt=o(vt,w),he(`Set targetOrigin for parent: %c${ht}`,n))}(),[Jt,Qt,sn,qt,_t,rn,an,nn,Vt,Rt,Pe?ee:Le,Kt,()=>Yt("background",je),()=>Yt("padding",Ce),Pe?ee:en,ln,Xt,On,dn,cn,un,Tt,mn].forEach(e=>{try{e()}catch(e){if(ot<0)throw e;Me("<rb>Error in setup function</>\n<i>iframe-resizer</> detected an error during setup.\n\nPlease report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>"),be(e)}}),At(K(Et)),ge(),Wn(l,"Init message from host page",void 0,void 0,`${i}:${ot}`),document.title&&""!==document.title&&Hn(0,0,h,document.title)}function xt({persisted:e}){e||Hn(0,0,"beforeUnload"),ze(u),he("Page persisted:",e),e||Fe.forEach(re)}const Tt=()=>He(window,u.toLowerCase(),xt);let Ct=!1;function At(e){"complete"===document.readyState?X(e):Ct||He(document,x,()=>At(e)),Ct=!0}function Rt(){mt=document.querySelectorAll(`[${g}]`),Je=mt.length>0}let Lt=0;function qt(){const e=document.querySelectorAll(`*[${v}]`);return qe=e.length>0,qe&&e.length!==Lt&&(function(e){const n=1===e.length?"":"s";Se(`%c[${v}]%c found on %c${e.length}%c element${n}`,a,t,a,t)}(e),Lt=e.length),qe}function Vt(){"BackCompat"===document.compatMode&&Me("<rb>Quirks Mode Detected</>\n\nThis iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.\n\nFor more information see <u>https://iframe-resizer.com/quirks-mode</>.\n")}function Jt(){pe&&""!==pe&&"false"!==pe?pe!==i&&Me(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${pe} - Child page: ${i}.\n`):Me("<rb>Legacy version detected on parent page</>\n\nDetected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.\n\nSee <u>https://iframe-resizer.com/setup/</> for more details.\n")}function _t(){try{dt=1===ot||"iframeParentListener"in window.parent}catch(e){}}function Qt(){Re===Ae&&(Pe=!0)}function Yt(e,t){void 0!==t&&""!==t&&"null"!==t&&(document.body.style.setProperty(e,t),he(`Set body ${e}: %c${t}`,n))}function Gt(e,t,n){if(""!==n)for(const e of document.querySelectorAll(n))e.toggleAttribute(t,!0)}function Xt(){Gt(0,g,ut),Gt(0,v,Ge)}function Kt(){var e,t;void 0===Ne&&(Ne=`${Ie}px`),Yt("margin",(e="margin",(t=Ne).includes("-")&&(Se(`Negative CSS value ignored for ${e}`),t=""),t))}function en(){const e=e=>e.style.setProperty(z,k,"important");e(document.documentElement),e(document.body)}function tn(e){({add(t){function n(){Wn(e.eventName,e.eventType)}J[t]=n,He(window,t,n,{passive:!0})},remove(e){const t=J[e];delete J[e],Ve(window,e,t)}})[e.method](e.eventName)}function nn(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach(n=>{e=!0,n.removeAttribute(t),n.toggleAttribute(g,!0)});t("data-iframe-height"),t("data-iframe-width"),e&&Me("<rb>Deprecated Attributes</>\n\nThe <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.")}function on(e,t,n){const{label:o}=n;return t!==e&&(e in n||(Se(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in H)&&Me(`<rb>Deprecated ${o}CalculationMethod (${e})</>\n\nThis version of <i>iframe-resizer</> can auto detect the most suitable ${o} calculation method. It is recommended that you ${pe?"remove this option.":`set this option to <b>'auto'</> when using an older version of <i>iframe-resizer</> on the parent page. This can be done on the child page by adding the following code:\n\nwindow.iframeResizer = {\n license: 'xxxx',\n ${o}CalculationMethod: '${k}',\n}\n`}\n`),e}function rn(){Ye=on(Ye,Q,Cn)}function an(){vt=on(vt,te,Pn)}function sn(){const e=ot,n=G({key:ie}),o=G({key:se});if(ot=Math.max(n,o),ot<0){if(ot=Math.min(n,o),$e(),Me(`${Y(ot+2)}${Y(2)}`),oe(pe))throw Y(ot+2).replace(/<\/?[a-z][^>]*>|<\/>/gi,"")}else(!oe(pe)||e>-1&&ot>e)&&(sessionStorage.getItem("ifr")!==i&&function(e,n){console.info(`${ue} %ciframe-resizer ${e}`,de||n<1?"font-weight: bold;":t)}(`v${i} (${(e=>U(_[e]))(ot)})`,ot),ot<2&&Me(Y(3)),sessionStorage.setItem("ifr",i))}function cn(){!function(e){tn({method:e,eventType:"After Print",eventName:"afterprint"}),tn({method:e,eventType:"Before Print",eventName:"beforeprint"})}("add")}function ln(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}function dn(){function e(e){const t=e.getBoundingClientRect(),n={x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop};return{x:parseInt(t.left,y)+parseInt(n.x,y),y:parseInt(t.top,y)+parseInt(n.y,y)}}function t(t){const n=t.split("#")[1]||t,o=decodeURIComponent(n),r=document.getElementById(o)||document.getElementsByName(o)[0];void 0===r?Hn(0,0,"inPageLink",`#${n}`):function(t){const n=e(t);Hn(n.y,n.x,p)}(r)}function n(){const{hash:e,href:n}=window.location;""!==e&&"#"!==e&&t(n)}const{enable:o}=Ke;o&&(1===ot?Me(Y(5)):(function(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&He(e,"click",n=>{n.preventDefault(),t(e.getAttribute("href"))})}(),He(window,"hashchange",n),setTimeout(n,128))),Ke={...Ke,findTarget:t}}function un(){function e(e){Hn(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){He(window.document,t,e)}!0===rt&&(t("mouseenter"),t("mouseleave"))}function mn(){1!==ot&&(zt.parentIframe=Object.freeze({autoResize:e=>(ae(e,"boolean","parentIframe.autoResize(enable) enable"),!1===Re&&!1===Ae?(ze(N),Me("Auto Resize can not be changed when <b>direction</> is set to 'none'."),!1):(!0===e&&!1===Ee?(Ee=!0,queueMicrotask(()=>Wn(N,"Auto Resize enabled"))):!1===e&&!0===Ee&&(Ee=!1),Hn(0,0,"autoResize",JSON.stringify(Ee)),Ee)),close(){Hn(0,0,"close")},getId:()=>ct,getOrigin:()=>(ze("getOrigin"),ke("getOrigin()","getParentOrigin()"),ce),getParentOrigin:()=>ce,getPageInfo(e){if(typeof e===j)return Mt=e,Hn(0,0,m),void xe("getPageInfo()","getParentProps()","See <u>https://iframe-resizer.com/upgrade</> for details. ");Mt=null,Hn(0,0,"pageInfoStop")},getParentProps:e=>(ae(e,j,"parentIframe.getParentProps(callback) callback"),jt=e,Hn(0,0,f),()=>{jt=null,Hn(0,0,"parentInfoStop")}),getParentProperties(e){ke("getParentProperties()","getParentProps()"),this.getParentProps(e)},moveToAnchor(e){ae(e,O,"parentIframe.moveToAnchor(anchor) anchor"),Ke.findTarget(e)},reset(){!function(){const e=Ye;Ye=Q,gt||(gt=!0,requestAnimationFrame(()=>{gt=!1})),Fn("reset"),Ye=e}()},setOffsetSize(e){ae(e,E,"parentIframe.setOffsetSize(offset) offset"),at=e,it=e,Wn(B,`parentIframe.setOffsetSize(${e})`)},scrollBy(e,t){ae(e,E,"parentIframe.scrollBy(x, y) x"),ae(t,E,"parentIframe.scrollBy(x, y) y"),Hn(t,e,"scrollBy")},scrollTo(e,t){ae(e,E,"parentIframe.scrollTo(x, y) x"),ae(t,E,"parentIframe.scrollTo(x, y) y"),Hn(t,e,"scrollTo")},scrollToOffset(e,t){ae(e,E,"parentIframe.scrollToOffset(x, y) x"),ae(t,E,"parentIframe.scrollToOffset(x, y) y"),Hn(t,e,p)},sendMessage(e,t){t&&ae(t,O,"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"),Hn(0,0,d,JSON.stringify(e),t)},setHeightCalculationMethod(e){Ye=e,rn()},setWidthCalculationMethod(e){vt=e,an()},setTargetOrigin(e){ae(e,O,"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"),ht=e},resize(e,t){void 0!==e&&ae(e,E,"parentIframe.resize(customHeight, customWidth) customHeight"),void 0!==t&&ae(t,E,"parentIframe.resize(customHeight, customWidth) customWidth"),Wn(P,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){ke("size()","resize()"),this.resize(e,t)}}),zt.parentIFrame=zt.parentIframe)}let fn=new Set;function pn(){const e=document.querySelectorAll(`[${b}]`);st=function(e){const t=new Set,n=new Set;for(const o of e)o.closest(`[${v}]`)?n.add(o):t.add(o);return n.size>0&&queueMicrotask(()=>{ze("overflowIgnored"),he("Ignoring elements with [data-iframe-ignore] > *:\n",n),ge()}),t}(e),Ue=st.size>0,typeof Set.prototype.symmetricDifference===j&&(Ze=st.symmetricDifference(fn).size>0),fn=st}function hn(){switch(pn(),!0){case!Ze:return;case st.size>1:he("Overflowed Elements:",st);break;case Ue:break;default:he("No overflow detected")}Wn(q,"Overflow updated")}function yn(e){const t={root:document.documentElement,side:Ae?T:I};return le=wt(hn,t),le.attachObservers(e),le}function gn(e){if(!Array.isArray(e)||0===e.length)return;const t=e[0].target;Wn(L,`Element resized <${function(e){switch(!0){case!oe(e):return"";case oe(e.id):return`${e.nodeName}#${e.id}`;case oe(e.name):return`${e.nodeName} (${e.name}`;case oe(e.className):return`${e.nodeName}.${e.className}`;default:return e.nodeName}}(t)}>`)}function bn(e){return Dt=new ResizeObserver(gn),Dt.observe(document.body),Bt.add(document.body),he("Attached%c ResizeObserver%c to body",n,o),me={attachObserverToNonStaticElements:Wt,detachObservers:Qe(Nt,Dt,Bt,Pt),disconnect:()=>{Dt.disconnect(),he("Detached%c ResizeObserver",n)}},me.attachObserverToNonStaticElements(e),me}function vn(e){et=!e,Wn(W,"Visibility changed")}const zn=e=>{const t=new Set;for(const n of e){t.add(n);for(const e of kn(n))t.add(e)}return he("Inspecting:\n",t),t},wn=e=>{if(0===e.size)return;ze("addObservers");const t=zn(e);le.attachObservers(t),me.attachObserverToNonStaticElements(t),ge()},$n=e=>{if(0===e.size)return;ze("removeObservers");const t=zn(e);le.detachObservers(t),me.detachObservers(t),ge()};function Sn(e){!function({addedNodes:e,removedNodes:t}){ze("contentMutated"),Xt(),Rt(),pn(),ge(),$n(t),wn(e)}(e),Wn(D,"Mutation Observed")}function On(){const e=kn(document.documentElement);var t;t=[pt(Sn),yn(e),It(),bn(e),Ft(vn)],Fe.push(...t.map(e=>e.disconnect))}function En(e){performance.mark($t);const t=ne(e);let r=1,a=document.documentElement,i=Je?0:document.documentElement.getBoundingClientRect().bottom;const s=Je?mt:Ue?Array.from(st):kn(document.documentElement);for(const t of s)r=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),r>i&&(i=r,a=t);return he(`${t} position calculated from:`,a),he(`Checked %c${s.length}%c elements`,n,o),performance.mark(St,{detail:{hasTags:Je,len:s.length,logging:nt,Side:t}}),i}const Mn=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],jn=`* ${Array.from(V).map(e=>`:not(${e})`).join("")}`,kn=e=>e.querySelectorAll(jn),xn={height:0,width:0},Tn={height:0,width:0},In=[n,o,n];function Nn(e){function t(){return Tn[r]=a,xn[r]=c,Math.max(a,1)}const o=e===Cn,r=e.label,a=e.boundingClientRect(),i=Math.ceil(a),s=Math.floor(a),c=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e),l=`HTML: %c${a}px %cPage: %c${c}px`;let d=1;switch(!0){case!e.enabled():return Math.max(c,1);case Je:he("Found element with data-iframe-size attribute"),d=e.taggedElement();break;case!Ue&&Be&&0===Tn[r]&&0===xn[r]:he(`Initial page size values: ${l}`,...In),d=t();break;case gt&&a===Tn[r]&&c===xn[r]:he(`Size unchanged: ${l}`,...In),d=Math.max(a,c);break;case 0===a&&0!==c:he(`Page is hidden: ${l}`,...In),d=c;break;case!Ue&&a!==Tn[r]&&c<=xn[r]:he(`New <html> size: ${l} `,...In),he(`Previous <html> size: %c${Tn[r]}px`,n),d=t();break;case!o:d=e.taggedElement();break;case!Ue&&a<Tn[r]:he(`<html> size decreased: ${l}`,...In),d=t();break;case c===s||c===i:he(`<html> size equals page size: ${l}`,...In),d=t();break;case a>c:he(`Page size < <html> size: ${l}`,...In),d=t();break;case Ue:he("Found elements possibly overflowing <html> "),d=e.taggedElement();break;default:he(`Using <html> size: ${l}`,...In),d=t()}return he(`Content ${r}: %c${d}px`,n),d+=function(e){const t=e.getOffset();return 0!==t&&he(`Page offsetSize: %c${t}px`,n),t}(e),Math.max(d,1)}const Cn={label:z,enabled:()=>Ae,getOffset:()=>at,auto:()=>Nn(Cn),bodyOffset:()=>{const{body:e}=document,t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,y)+parseInt(t.marginBottom,y)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Cn.bodyOffset(),custom:()=>e.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Mn(Cn)),min:()=>Math.min(...Mn(Cn)),grow:()=>Cn.max(),lowestElement:()=>En(T),taggedElement:()=>En(T)},Pn={label:w,enabled:()=>Re,getOffset:()=>it,auto:()=>Nn(Pn),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>e.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Mn(Pn)),min:()=>Math.min(...Mn(Pn)),rightMostElement:()=>En(I),scroll:()=>Math.max(Pn.bodyScroll(),Pn.documentElementScroll()),taggedElement:()=>En(I)},An=(e,t)=>!(Math.abs(e-t)<=yt);function Rn(e,t){const n=e[t](),o=e.enabled()&&void 0!==Oe?function(e){const t=Oe(e);if(void 0===t)throw new TypeError("No value returned from onBeforeResize(), expected a numeric value");if(Number.isNaN(t))throw new TypeError(`Invalid value returned from onBeforeResize(): ${t}, expected Number`);if(t<1)throw new RangeError(`Out of range value returned from onBeforeResize(): ${t}, must be at least 1`);return t}(n):n;return ye(o>=1,`New iframe ${e.label} is too small: ${o}, must be at least 1`),o}let Bn=!1;const Ln=K(()=>Me(Y(4)));let qn,Dn=!1;const Wn=ve((e,t,n,o,r)=>{switch(ze(e),!0){case!0===et:if(!0===Dn)break;Dn=!0,Bn=!1,cancelAnimationFrame(qn),qn=null;break;case!0===Bn&&e!==q:$e();break;case!Ee&&!(e in R):he("Resizing disabled");break;default:Dn=!1,Bn=!0,performance.now(),qn||(qn=requestAnimationFrame(()=>{Bn=!1,qn=null,ze("requestAnimationFrame")})),function(e,t,n,o,r){const a=n??Rn(Cn,Ye),i=o??Rn(Pn,vt);switch(Ae&&An(_e,a)||Re&&An(bt,i)?C:e){case l:case N:case C:_e=a,bt=i;case B:Vn(_e,bt,e,r);break;case q:case D:case L:case W:$e();break;default:$e(),he("No change in content size detected")}}(e,0,n,o,r)}ge()});function Fn(e){_e=Cn[Ye](),bt=Pn[vt](),Hn(_e,bt,e)}function Vn(e,t,o,a,i){ot<-1||(void 0!==i||(i=ht),function(){const s=`${ct}:${e}:${t}:${o}${void 0===a?"":`:${a}`}`;if(dt)try{window.parent.iframeParentListener(F+s)}catch(e){if(1!==ot)throw e;return void Ln()}else ft.postMessage(F+s,i);he(`Sending message to parent page via ${dt?"sameOrigin":"postMessage"}: %c%c${s}`,r,n)}())}const Hn=ve((e,t,n,o,r)=>{ze(n),Vn(e,t,n,o,r),ge()}),Un=ve(function(e){ze("onMessage");const{freeze:t}=Object,{parse:n}=JSON,o=e=>Hn(0,0,`${e}Stop`),r={init:function(){if("loading"===document.readyState)return;const t=e.data.slice(13).split(c);ft=e.source,ce=e.origin,kt(t),Be=!1,setTimeout(()=>{Xe=!1},128)},reset(){Xe||Fn("resetPage")},resize(){Wn(A,"Parent window requested size check")},moveToAnchor(){Ke.findTarget(i())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=i();Mt?X(Mt,n(e)):o(m)},parentInfo(){const e=(r=i(),t(n(r)));var r;jt?X(jt,e):o(f)},message(){const e=i();X(Ot,n(e))}},a=()=>e.data.split("]")[1].split(c)[0],i=()=>e.data.slice(e.data.indexOf(c)+1),s=()=>e.data.split(c)[2]in{true:1,false:1};function d(){const t=a();ze(t),t in r?r[t]():"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype||s()||Se(`Unexpected message (${e.data})`)}F===`${e.data}`.slice(0,13)&&function(){if(!1!==Be)return s()?(we(a()),ze(l),void r.init()):void 0;d()}()});let Zn=!1;const Jn=e=>e.postMessage("[iFrameResizerChild]Ready",window?.iframeResizer?.targetOrigin||"*");function _n(){if("loading"===document.readyState||!Be||Zn)return;const{parent:e,top:t}=window;ze("ready"),Jn(e),e!==t&&Jn(t),Zn=!0}"iframeChildListener"in window?Se("Already setup"):(window.iframeChildListener=e=>setTimeout(()=>Un({data:e,sameOrigin:!0})),ze("listen"),He(window,d,Un),He(document,x,_n),_n())}();
|
|
1
|
+
import Cn, { NORMAL as Y, HIGHLIGHT as c, FOREGROUND as z, BOLD as dt, ITALIC as Pn } from "auto-console-group";
|
|
2
|
+
const _ = "6.0.0-beta.1", Ve = "iframeResizer", ve = ":", Ln = "[iFrameResizerChild]Ready", jn = "autoResize", _n = "beforeUnload", xn = "close", Dn = "inPageLink", be = "init", je = "message", Bn = "mouseenter", Fn = "mouseleave", jt = "pageHide", _t = "pageInfo", xt = "parentInfo", Hn = "pageInfoStop", Wn = "parentInfoStop", Vn = "scrollBy", Un = "scrollTo", Dt = "scrollToOffset", Gn = "title", se = 10, J = 1, ze = "data-iframe-size", Bt = "data-iframe-overflowed", X = "data-iframe-ignore", we = "height", Ft = "width", Ie = "offset", Te = "offsetSize", Ue = `
|
|
3
|
+
`, ee = "string", C = "number", qn = "boolean", Zn = "object", Se = "function", Qn = "undefined", Yn = "false", Jn = "null", k = "auto", Ht = "readystatechange", Wt = "bottom", Vt = "right", _e = "autoResizeEnabled", ut = /* @__PURE__ */ Symbol("sizeChanged"), Ge = "manualResize", qe = "parentResize", Ae = {
|
|
4
|
+
[Ge]: 1,
|
|
5
|
+
[qe]: 1
|
|
6
|
+
}, Ut = "setOffsetSize", Gt = "resizeObserver", Ze = "overflowObserver", qt = "mutationObserver", Zt = "visibilityObserver", Kn = "font-weight: bold;", Qe = "none", ft = "No change in content size detected", ue = "[iFrameSizer]", Qt = ue.length, Xn = k, Yt = 128, Jt = /* @__PURE__ */ new Set([
|
|
7
|
+
"head",
|
|
8
|
+
"body",
|
|
9
|
+
"meta",
|
|
10
|
+
"base",
|
|
11
|
+
"title",
|
|
12
|
+
"script",
|
|
13
|
+
"link",
|
|
14
|
+
"style",
|
|
15
|
+
"map",
|
|
16
|
+
"area",
|
|
17
|
+
"option",
|
|
18
|
+
"optgroup",
|
|
19
|
+
"template",
|
|
20
|
+
"track",
|
|
21
|
+
"wbr",
|
|
22
|
+
"nobr"
|
|
23
|
+
]), eo = (e) => (t, n = "renamed to") => (o, s, u = "", l = "") => e(
|
|
24
|
+
l,
|
|
25
|
+
`<rb>Deprecated ${t}(${o.replace("()", "")})</>
|
|
26
|
+
|
|
27
|
+
The <b>${o}</> ${t.toLowerCase()} has been ${n} <b>${s}</>. ${u}Use of the old ${t.toLowerCase()} will be removed in a future version of <i>iframe-resizer</>.`
|
|
28
|
+
), to = (e) => typeof e === ee, Ee = (e, ...t) => setTimeout(() => e(...t), 0), Kt = (e) => {
|
|
29
|
+
let t = !1;
|
|
30
|
+
return function(...n) {
|
|
31
|
+
return t ? void 0 : (t = !0, e.apply(this, n));
|
|
32
|
+
};
|
|
33
|
+
}, fe = (e) => e, mt = 1e3, j = (e) => Math.round(e * mt) / mt, Xt = (e) => e.charAt(0).toUpperCase() + e.slice(1), H = (e) => `${e}` != "" && e !== void 0, no = (e) => e(), oo = (e) => e.toLowerCase();
|
|
34
|
+
function so(e) {
|
|
35
|
+
switch (!0) {
|
|
36
|
+
case !H(e):
|
|
37
|
+
return "";
|
|
38
|
+
case H(e.id):
|
|
39
|
+
return `${e.nodeName}#${e.id}`;
|
|
40
|
+
case H(e.name):
|
|
41
|
+
return `${e.nodeName} (${e.name}`;
|
|
42
|
+
case H(e.className):
|
|
43
|
+
return `${e.nodeName}.${e.className}`;
|
|
44
|
+
default:
|
|
45
|
+
return e.nodeName;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const ro = (e) => (
|
|
49
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
50
|
+
e?.__esModule ? e.default : e
|
|
51
|
+
), $ = (e, t, n) => {
|
|
52
|
+
if (typeof e !== t)
|
|
53
|
+
throw new TypeError(`${n} is not a ${Xt(t)}`);
|
|
54
|
+
}, en = {
|
|
55
|
+
br: `
|
|
56
|
+
`,
|
|
57
|
+
rb: "\x1B[31;1m",
|
|
58
|
+
// red bold
|
|
59
|
+
bb: "\x1B[34;1m",
|
|
60
|
+
// blue bold
|
|
61
|
+
b: "\x1B[1m",
|
|
62
|
+
// bold
|
|
63
|
+
i: "\x1B[3m",
|
|
64
|
+
// italic
|
|
65
|
+
u: "\x1B[4m",
|
|
66
|
+
// underline
|
|
67
|
+
"/": "\x1B[m"
|
|
68
|
+
// reset
|
|
69
|
+
}, io = Object.keys(en), co = new RegExp(`<(${io.join("|")})>`, "gi"), ao = (e, t) => en[t] ?? "", lo = (e) => e.replace(co, ao), uo = (e) => e.replaceAll("<br>", Ue).replaceAll(/<\/?[^>]+>/gi, ""), fo = (e) => (t) => e(
|
|
70
|
+
to(t) ? window.chrome ? lo(t) : uo(t) : t
|
|
71
|
+
);
|
|
72
|
+
let Ye = !0, xe = Ve;
|
|
73
|
+
const mo = ro(Cn), K = mo({
|
|
74
|
+
label: `${Ve}(child)`,
|
|
75
|
+
expand: !1
|
|
76
|
+
});
|
|
77
|
+
function ho(e) {
|
|
78
|
+
xe = e.id || Ve, K.label(`${xe}`), K.expand(e.expand), Ye = e.enabled;
|
|
79
|
+
}
|
|
80
|
+
const tn = (e) => (...t) => Ye ? K[e](...t) : !0, a = tn("log"), d = a, me = tn("debug");
|
|
81
|
+
function go(e, t) {
|
|
82
|
+
console.info(
|
|
83
|
+
`${xe} %ciframe-resizer ${e}`,
|
|
84
|
+
Ye || t < 1 ? Kn : Y
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
const {
|
|
88
|
+
assert: Ri,
|
|
89
|
+
endAutoGroup: D,
|
|
90
|
+
error: nn,
|
|
91
|
+
errorBoundary: Je,
|
|
92
|
+
event: h,
|
|
93
|
+
label: Ii,
|
|
94
|
+
purge: Ti,
|
|
95
|
+
warn: x
|
|
96
|
+
} = K, po = fo(fe), p = (...e) => K.warn(...e.map(po)), Ke = eo((e, t) => p(t)), on = Ke("Method"), yo = Ke("Method", "replaced with"), vo = Ke("Option"), Xe = [];
|
|
97
|
+
function sn(e, t) {
|
|
98
|
+
a(`${e} event listener: %c${t}`, c);
|
|
99
|
+
}
|
|
100
|
+
const rn = (e, t, n, o) => {
|
|
101
|
+
e.removeEventListener(t, n, o), sn("Removed", t);
|
|
102
|
+
}, P = (e, t, n, o = !1) => {
|
|
103
|
+
e.addEventListener(t, n, o), Xe.push(() => rn(e, t, n, o)), sn("Added", t);
|
|
104
|
+
}, r = {
|
|
105
|
+
applySelectors: null,
|
|
106
|
+
firstRun: !0,
|
|
107
|
+
hasTags: !1,
|
|
108
|
+
hasOverflow: !1,
|
|
109
|
+
height: 0,
|
|
110
|
+
isHidden: !1,
|
|
111
|
+
initLock: !0,
|
|
112
|
+
inPageLinks: {},
|
|
113
|
+
origin: void 0,
|
|
114
|
+
hasOverflowUpdated: !0,
|
|
115
|
+
overflowedNodeSet: /* @__PURE__ */ new Set(),
|
|
116
|
+
sameOrigin: !1,
|
|
117
|
+
taggedElements: [],
|
|
118
|
+
target: window?.parent,
|
|
119
|
+
timerActive: !1,
|
|
120
|
+
totalTime: 0,
|
|
121
|
+
triggerLocked: !1,
|
|
122
|
+
width: 0,
|
|
123
|
+
win: window,
|
|
124
|
+
onPageInfo: null,
|
|
125
|
+
onParentInfo: null
|
|
126
|
+
};
|
|
127
|
+
let ht = !1;
|
|
128
|
+
const gt = (e) => e.postMessage(
|
|
129
|
+
Ln,
|
|
130
|
+
window?.iframeResizer?.targetOrigin || "*"
|
|
131
|
+
);
|
|
132
|
+
function pt() {
|
|
133
|
+
if (document.readyState === "loading" || !r.firstRun || ht) return;
|
|
134
|
+
const { parent: e, top: t } = window;
|
|
135
|
+
h("ready"), a(
|
|
136
|
+
"Sending%c ready%c to parent from",
|
|
137
|
+
c,
|
|
138
|
+
z,
|
|
139
|
+
window.location.href
|
|
140
|
+
), gt(e), e !== t && gt(t), ht = !0;
|
|
141
|
+
}
|
|
142
|
+
const yt = "iframeResize", bo = (e) => ue === `${e.data}`.slice(0, Qt), zo = () => yt in window || // @ts-ignore
|
|
143
|
+
window.jQuery !== void 0 && yt in window.jQuery.prototype, wo = (e) => e.data.split(ve)[2] in { true: 1, false: 1 }, So = () => [document.documentElement, document.body], Eo = ["min-height", "min-width", "max-height", "max-width"], vt = /* @__PURE__ */ new Set(), Oo = (e) => !!e && e !== "0px" && e !== k && e !== Qe, cn = (e) => e.tagName ? e.tagName.toLowerCase() : "unknown", an = (e, t) => window.getComputedStyle(e).getPropertyValue(t), $o = (e, t) => Oo(an(e, t));
|
|
144
|
+
function Mo(e, t) {
|
|
145
|
+
const n = e.style[t];
|
|
146
|
+
return n ? { source: "an inline style attribute", value: n } : null;
|
|
147
|
+
}
|
|
148
|
+
function Ro({ href: e }) {
|
|
149
|
+
vt.has(e) || (a("Unable to access stylesheet:", e), vt.add(e));
|
|
150
|
+
}
|
|
151
|
+
function Io(e, t) {
|
|
152
|
+
for (const n of document.styleSheets)
|
|
153
|
+
try {
|
|
154
|
+
for (const o of n.cssRules || [])
|
|
155
|
+
if (o.selectorText && e.matches(o.selectorText)) {
|
|
156
|
+
const s = o.style[t];
|
|
157
|
+
if (s)
|
|
158
|
+
return {
|
|
159
|
+
source: n.ownerNode.tagName === "STYLE" ? "an inline <style> block" : `stylesheet (${n.href})`,
|
|
160
|
+
value: s
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
} catch {
|
|
164
|
+
Ro(n);
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
source: "cross-origin stylesheet",
|
|
168
|
+
value: an(e, t)
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
const To = (e, t) => Mo(e, t) || Io(e, t), Ao = (e, t) => {
|
|
172
|
+
const { source: n, value: o } = To(e, t), s = cn(e);
|
|
173
|
+
p(
|
|
174
|
+
`The <b>${t}</> CSS property is set to <b>${o}</> on the <b><${s}></> element via ${n}. This may cause issues with the correct operation of <i>iframe-resizer</>.
|
|
175
|
+
|
|
176
|
+
If you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.`
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
function ko() {
|
|
180
|
+
for (const e of So())
|
|
181
|
+
for (const t of Eo)
|
|
182
|
+
a(`Checking <${cn(e)}> for blocking CSS: ${t}`), $o(e, t) && Ao(e, t);
|
|
183
|
+
}
|
|
184
|
+
const No = ({
|
|
185
|
+
calculateWidth: e,
|
|
186
|
+
calculateHeight: t
|
|
187
|
+
}) => e === t, i = {
|
|
188
|
+
autoResize: !0,
|
|
189
|
+
bodyBackground: "",
|
|
190
|
+
bodyMargin: 0,
|
|
191
|
+
// For V1 compatibility
|
|
192
|
+
bodyMarginStr: "",
|
|
193
|
+
bodyPadding: "",
|
|
194
|
+
calculateHeight: !0,
|
|
195
|
+
calculateWidth: !1,
|
|
196
|
+
heightCalcMode: k,
|
|
197
|
+
ignoreSelector: "",
|
|
198
|
+
inPageLinks: !1,
|
|
199
|
+
logging: !1,
|
|
200
|
+
logExpand: !1,
|
|
201
|
+
mode: 0,
|
|
202
|
+
mouseEvents: !1,
|
|
203
|
+
offsetHeight: 0,
|
|
204
|
+
offsetWidth: 0,
|
|
205
|
+
parentId: void 0,
|
|
206
|
+
sizeSelector: "",
|
|
207
|
+
targetOrigin: "*",
|
|
208
|
+
tolerance: 0,
|
|
209
|
+
widthCalcMode: k,
|
|
210
|
+
onBeforeResize: void 0,
|
|
211
|
+
onMessage: () => {
|
|
212
|
+
x("onMessage function not defined");
|
|
213
|
+
},
|
|
214
|
+
onReady: () => {
|
|
215
|
+
}
|
|
216
|
+
}, A = [c, z, c], le = {
|
|
217
|
+
height: 0,
|
|
218
|
+
width: 0
|
|
219
|
+
}, F = {
|
|
220
|
+
height: 0,
|
|
221
|
+
width: 0
|
|
222
|
+
};
|
|
223
|
+
function B(e, t, n) {
|
|
224
|
+
return F[e] = t, le[e] = n, t;
|
|
225
|
+
}
|
|
226
|
+
function Co(e) {
|
|
227
|
+
const t = e.getOffset();
|
|
228
|
+
return t !== 0 && d(`Page offsetSize: %c${t}px`, c), t;
|
|
229
|
+
}
|
|
230
|
+
const Po = (e) => e.documentElementScroll() + Math.max(0, e.getOffset());
|
|
231
|
+
function ln(e) {
|
|
232
|
+
const { hasOverflow: t, hasTags: n, triggerLocked: o } = r, s = e.label, u = s === we, l = e.boundingClientRect(), m = Math.ceil(l), b = Math.floor(l), f = Po(e), w = `HTML: %c${l}px %cPage: %c${f}px`;
|
|
233
|
+
let g;
|
|
234
|
+
switch (!0) {
|
|
235
|
+
case !e.enabled():
|
|
236
|
+
return Math.max(f, J);
|
|
237
|
+
case n:
|
|
238
|
+
d("Found element with data-iframe-size attribute"), g = e.taggedElement();
|
|
239
|
+
break;
|
|
240
|
+
case (!t && r.firstRun && F[s] === 0 && le[s] === 0):
|
|
241
|
+
d(`Initial page size values: ${w}`, ...A), g = B(
|
|
242
|
+
s,
|
|
243
|
+
l,
|
|
244
|
+
f
|
|
245
|
+
);
|
|
246
|
+
break;
|
|
247
|
+
case (o && l === F[s] && f === le[s]):
|
|
248
|
+
d(`Size unchanged: ${w}`, ...A), g = Math.max(l, f);
|
|
249
|
+
break;
|
|
250
|
+
case (l === 0 && f !== 0):
|
|
251
|
+
d(`Page is hidden: ${w}`, ...A), g = f;
|
|
252
|
+
break;
|
|
253
|
+
case (!t && l !== F[s] && f <= le[s]):
|
|
254
|
+
d(`New <html> size: ${w} `, ...A), d(
|
|
255
|
+
`Previous <html> size: %c${F[s]}px`,
|
|
256
|
+
c
|
|
257
|
+
), g = B(
|
|
258
|
+
s,
|
|
259
|
+
l,
|
|
260
|
+
f
|
|
261
|
+
);
|
|
262
|
+
break;
|
|
263
|
+
case !u:
|
|
264
|
+
g = e.taggedElement();
|
|
265
|
+
break;
|
|
266
|
+
case (!t && l < F[s]):
|
|
267
|
+
d(`<html> size decreased: ${w}`, ...A), g = B(
|
|
268
|
+
s,
|
|
269
|
+
l,
|
|
270
|
+
f
|
|
271
|
+
);
|
|
272
|
+
break;
|
|
273
|
+
case (f === b || f === m):
|
|
274
|
+
d(`<html> size equals page size: ${w}`, ...A), g = B(
|
|
275
|
+
s,
|
|
276
|
+
l,
|
|
277
|
+
f
|
|
278
|
+
);
|
|
279
|
+
break;
|
|
280
|
+
case l > f:
|
|
281
|
+
d(`Page size < <html> size: ${w}`, ...A), g = B(
|
|
282
|
+
s,
|
|
283
|
+
l,
|
|
284
|
+
f
|
|
285
|
+
);
|
|
286
|
+
break;
|
|
287
|
+
case t:
|
|
288
|
+
d("Found elements possibly overflowing <html> "), g = e.taggedElement();
|
|
289
|
+
break;
|
|
290
|
+
default:
|
|
291
|
+
d(`Using <html> size: ${w}`, ...A), g = B(
|
|
292
|
+
s,
|
|
293
|
+
l,
|
|
294
|
+
f
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
return d(`Content ${s}: %c${g}px`, c), g += Co(e), Math.max(g, J);
|
|
298
|
+
}
|
|
299
|
+
const Lo = 1e3, jo = 5 * Lo, _o = 4, xo = 10, Do = 100, et = "--ifr-start", he = "--ifr-end", dn = "--ifr-measure", v = [];
|
|
300
|
+
let de = {}, bt = 0, De;
|
|
301
|
+
function un() {
|
|
302
|
+
try {
|
|
303
|
+
performance.clearMarks(et), performance.clearMarks(he), performance.clearMeasures(dn);
|
|
304
|
+
} catch {
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function Bo() {
|
|
308
|
+
De = setInterval(() => {
|
|
309
|
+
if (v.length < xo || de.hasTags && de.len < 25) return;
|
|
310
|
+
v.sort();
|
|
311
|
+
const e = Math.min(
|
|
312
|
+
v.reduce((n, o) => n + o, 0) / v.length,
|
|
313
|
+
v[Math.floor(v.length / 2)]
|
|
314
|
+
), t = j(e);
|
|
315
|
+
t > bt && (bt = t, h("performanceObserver"), a("Mean time:", j(v[Math.floor(v.length / 2)])), a(
|
|
316
|
+
"Median time:",
|
|
317
|
+
j(v.reduce((n, o) => n + o, 0) / v.length)
|
|
318
|
+
), a("Average time:", t), a("Max time:", j(Math.max(...v)))), un(), !(e <= _o) && (clearInterval(De), p(
|
|
319
|
+
`<rb>Performance Warning</>
|
|
320
|
+
|
|
321
|
+
Calculating the page size is taking an excessive amount of time (${j(e)}ms).
|
|
322
|
+
|
|
323
|
+
To improve performance add the <b>data-iframe-size</> attribute to the ${de.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`
|
|
324
|
+
));
|
|
325
|
+
}, jo);
|
|
326
|
+
}
|
|
327
|
+
function Fo(e) {
|
|
328
|
+
e.getEntries().forEach((t) => {
|
|
329
|
+
if (t.name === he)
|
|
330
|
+
try {
|
|
331
|
+
const { duration: n } = performance.measure(
|
|
332
|
+
dn,
|
|
333
|
+
et,
|
|
334
|
+
he
|
|
335
|
+
);
|
|
336
|
+
de = t.detail, v.push(n), v.length > Do && v.shift();
|
|
337
|
+
} catch {
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
function Ho() {
|
|
342
|
+
d("Attached%c PerformanceObserver%c to page", c, z);
|
|
343
|
+
const e = new PerformanceObserver(Fo);
|
|
344
|
+
return e.observe({ entryTypes: ["mark"] }), Bo(), {
|
|
345
|
+
disconnect: () => {
|
|
346
|
+
un(), clearInterval(De), e.disconnect(), d("Detached%c PerformanceObserver", c);
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
const Wo = (e) => `:not(${e})`, Vo = `* ${Array.from(Jt).map(Wo).join("")}`, tt = (e) => e.querySelectorAll(Vo);
|
|
351
|
+
function Uo() {
|
|
352
|
+
const { hasOverflow: e, hasTags: t, overflowedNodeSet: n, taggedElements: o } = r;
|
|
353
|
+
return t ? o : e ? Array.from(n) : tt(document.documentElement);
|
|
354
|
+
}
|
|
355
|
+
function Go(e, t) {
|
|
356
|
+
const n = `margin-${t}`;
|
|
357
|
+
let o, s = document.documentElement, u = r.hasTags ? J : document.documentElement.getBoundingClientRect().bottom;
|
|
358
|
+
for (const l of e)
|
|
359
|
+
o = l.getBoundingClientRect()[t] + parseFloat(getComputedStyle(l).getPropertyValue(n)), o > u && (u = o, s = l);
|
|
360
|
+
return { maxEl: s, maxVal: u };
|
|
361
|
+
}
|
|
362
|
+
function fn(e) {
|
|
363
|
+
performance.mark(et);
|
|
364
|
+
const t = Xt(e), { logging: n } = i, { hasTags: o } = r, s = Uo(), { maxEl: u, maxVal: l } = Go(s, e);
|
|
365
|
+
return d(`${t} position calculated from:`, u), d(`Checked %c${s.length}%c elements`, c, z), performance.mark(he, {
|
|
366
|
+
detail: {
|
|
367
|
+
hasTags: o,
|
|
368
|
+
len: s.length,
|
|
369
|
+
logging: n,
|
|
370
|
+
Side: t
|
|
371
|
+
}
|
|
372
|
+
}), l;
|
|
373
|
+
}
|
|
374
|
+
const Oe = {
|
|
375
|
+
label: we,
|
|
376
|
+
enabled: () => i.calculateHeight,
|
|
377
|
+
getOffset: () => i.offsetHeight,
|
|
378
|
+
auto: () => ln(Oe),
|
|
379
|
+
boundingClientRect: () => Math.max(
|
|
380
|
+
document.documentElement.getBoundingClientRect().bottom,
|
|
381
|
+
document.body.getBoundingClientRect().bottom
|
|
382
|
+
),
|
|
383
|
+
documentElementScroll: () => document.documentElement.scrollHeight,
|
|
384
|
+
taggedElement: () => fn(Wt)
|
|
385
|
+
}, $e = {
|
|
386
|
+
label: Ft,
|
|
387
|
+
enabled: () => i.calculateWidth,
|
|
388
|
+
getOffset: () => i.offsetWidth,
|
|
389
|
+
auto: () => ln($e),
|
|
390
|
+
boundingClientRect: () => Math.max(
|
|
391
|
+
document.documentElement.getBoundingClientRect().right,
|
|
392
|
+
document.body.getBoundingClientRect().right
|
|
393
|
+
),
|
|
394
|
+
documentElementScroll: () => document.documentElement.scrollWidth,
|
|
395
|
+
taggedElement: () => fn(Vt)
|
|
396
|
+
};
|
|
397
|
+
function mn(e, t) {
|
|
398
|
+
const { label: n } = t;
|
|
399
|
+
return e && e !== k && p(
|
|
400
|
+
`<rb>Ignored ${n}CalculationMethod (${e})</>
|
|
401
|
+
|
|
402
|
+
This version of <i>iframe-resizer</> auto detects the most suitable ${n} calculation method. The <b>${n}CalculationMethod</> option is no longer supported and has been ignored.
|
|
403
|
+
|
|
404
|
+
To remove this warning, delete the <b>${n}CalculationMethod</> option from your parent page config and/or the <i>window.iframeResizer</> config on the child page.
|
|
405
|
+
`
|
|
406
|
+
), a(`Set ${n} calculation method: %c${k}`, c), k;
|
|
407
|
+
}
|
|
408
|
+
function qo() {
|
|
409
|
+
i.heightCalcMode = mn(i.heightCalcMode, Oe);
|
|
410
|
+
}
|
|
411
|
+
function Zo() {
|
|
412
|
+
i.widthCalcMode = mn(i.widthCalcMode, $e);
|
|
413
|
+
}
|
|
414
|
+
function Qo() {
|
|
415
|
+
try {
|
|
416
|
+
r.sameOrigin = i.mode === 1 || "iframeParentListener" in window.parent;
|
|
417
|
+
} catch {
|
|
418
|
+
a("Cross domain iframe detected");
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
const Yo = `<rb>Deprecated Attributes</>
|
|
422
|
+
|
|
423
|
+
The <b>data-iframe-height</> and <b>data-iframe-width</> attributes have been deprecated and replaced with the single <b>data-iframe-size</> attribute. Use of the old attributes will be removed in a future version of <i>iframe-resizer</>.`;
|
|
424
|
+
function Jo() {
|
|
425
|
+
let e = !1;
|
|
426
|
+
const t = (n) => document.querySelectorAll(`[${n}]`).forEach((o) => {
|
|
427
|
+
o.toggleAttribute(ze, !0), o.removeAttribute(n), e = !0;
|
|
428
|
+
});
|
|
429
|
+
t("data-iframe-height"), t("data-iframe-width"), e && p(Yo);
|
|
430
|
+
}
|
|
431
|
+
let zt = 0;
|
|
432
|
+
function Ko(e) {
|
|
433
|
+
const t = e.length === 1 ? "" : "s";
|
|
434
|
+
x(
|
|
435
|
+
`%c[${X}]%c found on %c${e.length}%c element${t}`,
|
|
436
|
+
dt,
|
|
437
|
+
Y,
|
|
438
|
+
dt,
|
|
439
|
+
Y
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
function Xo() {
|
|
443
|
+
const e = document.querySelectorAll(`*[${X}]`), t = e.length > 0;
|
|
444
|
+
return t && e.length !== zt && (Ko(e), zt = e.length), t;
|
|
445
|
+
}
|
|
446
|
+
const ge = (e) => {
|
|
447
|
+
if (!e) return "";
|
|
448
|
+
let t = -559038744, n = 1103547984;
|
|
449
|
+
for (let o, s = 0; s < e.length; s++)
|
|
450
|
+
o = e.codePointAt(s), t = Math.imul(t ^ o, 2246822519), n = Math.imul(n ^ o, 3266489917);
|
|
451
|
+
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);
|
|
452
|
+
}, T = (e) => e.replace(
|
|
453
|
+
/[A-Za-z]/g,
|
|
454
|
+
(t) => String.fromCodePoint(
|
|
455
|
+
(t <= "Z" ? 90 : 122) >= (t = t.codePointAt(0) + 19) ? t : t - 26
|
|
456
|
+
)
|
|
457
|
+
), es = /* @__PURE__ */ new Date(), hn = (e) => new Set(Array.from({ length: 9 }, e)), ts = (e) => [
|
|
458
|
+
e[0],
|
|
459
|
+
...e.slice(1).map((t) => `${t} - lewpylk`),
|
|
460
|
+
`${e[4]} - lewpylk`,
|
|
461
|
+
...e.slice(1)
|
|
462
|
+
], W = ["spjluzl", "rlf", "clyzpvu", "rlf2", "nlaMbssFlhy"], ns = [
|
|
463
|
+
"<yi>Puchspk Spjluzl Rlf</><iy><iy>",
|
|
464
|
+
"<yi>Tpzzpun Spjluzl Rlf</><iy><iy>",
|
|
465
|
+
"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</>",
|
|
466
|
+
"<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</>.",
|
|
467
|
+
"<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.",
|
|
468
|
+
"Pu whnl spurpun ylxbpylz h Wyvmlzzpvuhs vy Ibzpulzz spjluzl. Wslhzl zll <b>oaawz://pmyhtl-ylzpgly.jvt/wypjpun</> mvy tvyl klahpsz.",
|
|
469
|
+
"<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</>.",
|
|
470
|
+
// Upgrade
|
|
471
|
+
"<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.",
|
|
472
|
+
// Upgrade OEM
|
|
473
|
+
"<yi>VLT rlf lewpylk</><iy><iy>Wslhzl kvdusvhk aol shalza rlf myvt sltvu-zxbllgf.jvt."
|
|
474
|
+
// key expired
|
|
475
|
+
], os = ts(["NWSc3", "zvsv", "wyv", "ibzpulzz", "VLT"]), wt = Object.fromEntries(
|
|
476
|
+
[
|
|
477
|
+
"2cgs7fdf4xb",
|
|
478
|
+
"1c9ctcccr4z",
|
|
479
|
+
"1q2pc4eebgb",
|
|
480
|
+
"ueokt0969w",
|
|
481
|
+
"w2zxchhgqz",
|
|
482
|
+
"1umuxblj2e5",
|
|
483
|
+
"1foobarqaz",
|
|
484
|
+
"2b5sdlfhbev",
|
|
485
|
+
"zo4ui3arjo",
|
|
486
|
+
"oclbb4thgl",
|
|
487
|
+
"igb1wzrjqr"
|
|
488
|
+
].map((e, t) => [e, Math.max(0, t - 1)])
|
|
489
|
+
), ss = /* @__PURE__ */ new Set([1, 6]), gn = es[T(W[4])](), rs = hn((e, t) => ge(`${gn + t}`)), is = hn((e, t) => ge(`${gn - ++t}`)), cs = (e) => rs.has(e) ? 9 : is.has(e) ? 5 : -2, nt = (e) => ss.has(e), V = (e) => T(ns[e]), as = (e) => T(os[e]), St = (e) => T(W[e]), Et = (e) => {
|
|
490
|
+
const t = e[T(W[0])] || e[T(W[1])] || e[T(W[2])] || e[T(W[3])];
|
|
491
|
+
if (!t) return -1;
|
|
492
|
+
const n = t.split("-");
|
|
493
|
+
let o = (function(s = "", u = "") {
|
|
494
|
+
let l = -2;
|
|
495
|
+
const m = ge(T(s));
|
|
496
|
+
return m in wt && (l = wt[m]), l === 9 ? cs(u) : l;
|
|
497
|
+
})(...n);
|
|
498
|
+
return o === 0 || ((s) => s[2] === ge(s[0] + s[1]))(n) || (o = -2), o;
|
|
499
|
+
};
|
|
500
|
+
function ls({
|
|
501
|
+
key: e,
|
|
502
|
+
key2: t,
|
|
503
|
+
mode: n,
|
|
504
|
+
version: o
|
|
505
|
+
}) {
|
|
506
|
+
const s = n, u = Et({ key: e }), l = Et({ key2: t });
|
|
507
|
+
if (i.mode = n = Math.max(u, l), n < 0) {
|
|
508
|
+
if (n = Math.min(u, l), p(`${V(n + 2)}${V(2)}`), H(o))
|
|
509
|
+
throw r.firstRun = !1, V(n + 2).replace(/<\/?[a-z][^>]*>|<\/>/gi, "");
|
|
510
|
+
} else (!H(o) || s > -1 && n > s) && (sessionStorage.getItem("ifr") !== _ && go(`v${_} (${as(n)})`, n), n < 2 && p(V(3)), sessionStorage.setItem("ifr", _));
|
|
511
|
+
}
|
|
512
|
+
const ds = "BackCompat", us = `<rb>Quirks Mode Detected</>
|
|
513
|
+
|
|
514
|
+
This iframe is running in the browser's legacy <b>Quirks Mode</>, this may cause issues with the correct operation of <i>iframe-resizer</>. It is recommended that you switch to the modern <b>Standards Mode</>.
|
|
515
|
+
|
|
516
|
+
For more information see <u>https://iframe-resizer.com/quirks-mode</>.
|
|
517
|
+
`;
|
|
518
|
+
function fs() {
|
|
519
|
+
document.compatMode === ds && p(us);
|
|
520
|
+
}
|
|
521
|
+
const ms = "complete";
|
|
522
|
+
let Ot = !1;
|
|
523
|
+
function pn(e) {
|
|
524
|
+
document.readyState === ms ? Ee(e) : Ot || P(
|
|
525
|
+
document,
|
|
526
|
+
Ht,
|
|
527
|
+
() => pn(e)
|
|
528
|
+
), Ot = !0;
|
|
529
|
+
}
|
|
530
|
+
const hs = () => {
|
|
531
|
+
d(`Set targetOrigin for parent: %c${i.targetOrigin}`, c), i.autoResize !== !0 && a("Auto Resize disabled");
|
|
532
|
+
};
|
|
533
|
+
function yn() {
|
|
534
|
+
r.taggedElements = document.querySelectorAll(`[${ze}]`), r.hasTags = r.taggedElements.length > 0, a(`Tagged elements found: %c${r.hasTags}`, c);
|
|
535
|
+
}
|
|
536
|
+
const gs = `<rb>Legacy version detected on parent page</>
|
|
537
|
+
|
|
538
|
+
Detected legacy version of parent page script. It is recommended to update the parent page to use <b>@iframe-resizer/parent</>.
|
|
539
|
+
|
|
540
|
+
See <u>https://iframe-resizer.com/setup/</> for more details.
|
|
541
|
+
`, ps = (e) => `<b>Version mismatch</>
|
|
542
|
+
|
|
543
|
+
The parent and child pages are running different versions of <i>iframe resizer</>.
|
|
544
|
+
|
|
545
|
+
Parent page: ${e} - Child page: ${_}.
|
|
546
|
+
`;
|
|
547
|
+
function ys({ version: e }) {
|
|
548
|
+
!e || e === "" || e === Yn ? p(gs) : e !== _ && p(ps(e));
|
|
549
|
+
}
|
|
550
|
+
const vs = Kt(() => p(V(4)));
|
|
551
|
+
function bs(e) {
|
|
552
|
+
if (!r.timerActive) return;
|
|
553
|
+
const t = j(performance.now() - r.totalTime), n = e === be ? `Initialised iframe in %c${t}ms` : `Size calculated in %c${t}ms`;
|
|
554
|
+
a(n, c);
|
|
555
|
+
}
|
|
556
|
+
function zs(e) {
|
|
557
|
+
return e === void 0 ? e = i.targetOrigin : a(`Message targetOrigin: %c${e}`, c), e;
|
|
558
|
+
}
|
|
559
|
+
function ws(e, t) {
|
|
560
|
+
const { mode: n } = i, { sameOrigin: o, target: s } = r;
|
|
561
|
+
if (o)
|
|
562
|
+
try {
|
|
563
|
+
window.parent.iframeParentListener(ue + e);
|
|
564
|
+
} catch (u) {
|
|
565
|
+
if (nt(n)) vs();
|
|
566
|
+
else throw u;
|
|
567
|
+
return !1;
|
|
568
|
+
}
|
|
569
|
+
else s.postMessage(ue + e, zs(t));
|
|
570
|
+
return !0;
|
|
571
|
+
}
|
|
572
|
+
function vn(e, t, n, o, s) {
|
|
573
|
+
const { parentId: u } = i, { sameOrigin: l } = r, m = `${e}:${t}`, b = `${u}:${m}:${n}${o === void 0 ? "" : `:${o}`}`;
|
|
574
|
+
i.mode < -1 || !ws(b, s) || (bs(n), d(
|
|
575
|
+
`Sending message to parent page via ${l ? "sameOrigin" : "postMessage"}: %c%c${b}`,
|
|
576
|
+
Pn,
|
|
577
|
+
c
|
|
578
|
+
));
|
|
579
|
+
}
|
|
580
|
+
const y = Je(
|
|
581
|
+
(e, t, n, o, s) => {
|
|
582
|
+
h(n), vn(e, t, n, o, s), D();
|
|
583
|
+
}
|
|
584
|
+
), Ss = (e) => y(0, 0, e.type, `${e.screenY}:${e.screenX}`);
|
|
585
|
+
function $t(e, t) {
|
|
586
|
+
a(`Add event listener: %c${t}`, c), P(window.document, e, Ss);
|
|
587
|
+
}
|
|
588
|
+
function Es({
|
|
589
|
+
mouseEvents: e
|
|
590
|
+
}) {
|
|
591
|
+
e === !0 && ($t(Bn, "Mouse Enter"), $t(Fn, "Mouse Leave"));
|
|
592
|
+
}
|
|
593
|
+
const Os = () => y(0, 0, _n);
|
|
594
|
+
function $s({ persisted: e }) {
|
|
595
|
+
e || Os(), h(jt), d("Page persisted:", e), !e && Xe.forEach(no);
|
|
596
|
+
}
|
|
597
|
+
const Ms = () => P(window, oo(jt), $s), Mt = (e, t) => !(Math.abs(e - t) <= i.tolerance);
|
|
598
|
+
function Rs(e, t) {
|
|
599
|
+
const { calculateHeight: n, calculateWidth: o } = i, { height: s, width: u } = r;
|
|
600
|
+
return n && Mt(s, e) || o && Mt(u, t);
|
|
601
|
+
}
|
|
602
|
+
function Is(e, t, n) {
|
|
603
|
+
const o = i.onBeforeResize(e, t, n);
|
|
604
|
+
if (o === void 0)
|
|
605
|
+
throw new TypeError(
|
|
606
|
+
"No value returned from onBeforeResize(), expected a numeric value"
|
|
607
|
+
);
|
|
608
|
+
if (Number.isNaN(o))
|
|
609
|
+
throw new TypeError(
|
|
610
|
+
`Invalid value returned from onBeforeResize(): ${o}, expected Number`
|
|
611
|
+
);
|
|
612
|
+
if (o < J)
|
|
613
|
+
throw new RangeError(
|
|
614
|
+
`Out of range value returned from onBeforeResize(): ${o}, must be at least ${J}`
|
|
615
|
+
);
|
|
616
|
+
return o;
|
|
617
|
+
}
|
|
618
|
+
const bn = (e, t) => (n, o) => {
|
|
619
|
+
const s = e[n]();
|
|
620
|
+
return e.enabled() && i.onBeforeResize !== void 0 ? Is(s, o, t) : s;
|
|
621
|
+
}, Ts = bn(Oe, we), As = bn($e, Ft);
|
|
622
|
+
function ks(e, t, n, o) {
|
|
623
|
+
const { heightCalcMode: s, widthCalcMode: u } = i, l = n ?? Ts(s, e), m = o ?? As(u, e), b = Rs(l, m) ? ut : e;
|
|
624
|
+
switch (a(`Resize event: %c${t}`, c), b) {
|
|
625
|
+
case be:
|
|
626
|
+
case _e:
|
|
627
|
+
case ut:
|
|
628
|
+
case Ge:
|
|
629
|
+
case qe:
|
|
630
|
+
r.height = l, r.width = m;
|
|
631
|
+
// eslint-disable-next-line no-fallthrough
|
|
632
|
+
case Ut:
|
|
633
|
+
return r;
|
|
634
|
+
// the following case needs {} to prevent a compile error on Next.js
|
|
635
|
+
case Ze:
|
|
636
|
+
case qt:
|
|
637
|
+
case Gt:
|
|
638
|
+
case Zt: {
|
|
639
|
+
a(ft);
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
default:
|
|
643
|
+
d(ft);
|
|
644
|
+
}
|
|
645
|
+
return null;
|
|
646
|
+
}
|
|
647
|
+
let re = !1, ke = !1, q = null;
|
|
648
|
+
function Ns(e, t, n, o, s) {
|
|
649
|
+
const { autoResize: u } = i, { isHidden: l } = r;
|
|
650
|
+
switch (h(e), !0) {
|
|
651
|
+
// Allow manual and parent resize requests to bypass the hidden check
|
|
652
|
+
case (l === !0 && !(e in Ae)): {
|
|
653
|
+
if (ke === !0) break;
|
|
654
|
+
a("Iframe hidden - Ignored resize request"), ke = !0, re = !1, cancelAnimationFrame(q), q = null;
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
// Ignore overflowObserver here, as more efficient than using
|
|
658
|
+
// mutationObserver to detect OVERFLOW_ATTR changes
|
|
659
|
+
// Also allow manual and parent resize requests to bypass the pending check
|
|
660
|
+
case (re === !0 && e !== Ze && !(e in Ae)): {
|
|
661
|
+
a("Resize already pending - Ignored resize request");
|
|
662
|
+
break;
|
|
663
|
+
}
|
|
664
|
+
case (!u && !(e in Ae)): {
|
|
665
|
+
d("Resizing disabled");
|
|
666
|
+
break;
|
|
667
|
+
}
|
|
668
|
+
default: {
|
|
669
|
+
ke = !1, re = !0, r.totalTime = performance.now(), r.timerActive = !0;
|
|
670
|
+
const m = ks(
|
|
671
|
+
e,
|
|
672
|
+
t,
|
|
673
|
+
n,
|
|
674
|
+
o
|
|
675
|
+
);
|
|
676
|
+
m && vn(m.height, m.width, e, s), q || (q = requestAnimationFrame(() => {
|
|
677
|
+
re = !1, q = null, h("requestAnimationFrame"), me(`Reset sendPending: %c${e}`, c);
|
|
678
|
+
})), r.timerActive = !1;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
D();
|
|
682
|
+
}
|
|
683
|
+
const M = Je(Ns);
|
|
684
|
+
function Rt({
|
|
685
|
+
eventType: e,
|
|
686
|
+
eventName: t
|
|
687
|
+
}) {
|
|
688
|
+
P(window, t, () => M(t, e), { passive: !0 });
|
|
689
|
+
}
|
|
690
|
+
function Cs() {
|
|
691
|
+
Rt({
|
|
692
|
+
eventType: "After Print",
|
|
693
|
+
eventName: "afterprint"
|
|
694
|
+
}), Rt({
|
|
695
|
+
eventType: "Before Print",
|
|
696
|
+
eventName: "beforeprint"
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
function Ps() {
|
|
700
|
+
if (r.triggerLocked) {
|
|
701
|
+
a("TriggerLock blocked calculation");
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
r.triggerLocked = !0, me("Trigger event lock on"), requestAnimationFrame(() => {
|
|
705
|
+
r.triggerLocked = !1, me("Trigger event lock off");
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
function zn(e) {
|
|
709
|
+
const { heightCalcMode: t, widthCalcMode: n } = i, o = Oe[t](), s = $e[n]();
|
|
710
|
+
a(`Reset trigger event: %c${e}`, c), y(o, s, e);
|
|
711
|
+
}
|
|
712
|
+
function Ls(e) {
|
|
713
|
+
const t = i.heightCalcMode;
|
|
714
|
+
a(`Reset trigger event: %c${e}`, c), i.heightCalcMode = Xn, Ps(), zn("reset"), i.heightCalcMode = t;
|
|
715
|
+
}
|
|
716
|
+
const js = `Auto Resize can not be changed when <b>direction</> is set to '${Qe}'.`;
|
|
717
|
+
function _s(e) {
|
|
718
|
+
$(e, qn, "parentIframe.autoResize(enable) enable");
|
|
719
|
+
const {
|
|
720
|
+
autoResize: t,
|
|
721
|
+
calculateHeight: n,
|
|
722
|
+
calculateWidth: o
|
|
723
|
+
} = i;
|
|
724
|
+
return o === !1 && n === !1 ? (h(_e), p(js), !1) : (e === !0 && t === !1 ? (i.autoResize = !0, queueMicrotask(() => M(_e, "Auto Resize enabled"))) : e === !1 && t === !0 && (i.autoResize = !1), y(0, 0, jn, JSON.stringify(i.autoResize)), i.autoResize);
|
|
725
|
+
}
|
|
726
|
+
function xs(e) {
|
|
727
|
+
$(e, ee, "parentIframe.moveToAnchor(anchor) anchor"), r.inPageLinks.findTarget(e);
|
|
728
|
+
}
|
|
729
|
+
function Ds(e) {
|
|
730
|
+
$(e, C, "parentIframe.setOffsetSize(offset) offset"), i.offsetHeight = e, i.offsetWidth = e, M(Ut, `parentIframe.setOffsetSize(${e})`);
|
|
731
|
+
}
|
|
732
|
+
function Bs() {
|
|
733
|
+
return h("getOrigin"), on("getOrigin()", "getParentOrigin()"), r.origin;
|
|
734
|
+
}
|
|
735
|
+
const Fs = () => r.origin;
|
|
736
|
+
function Hs(e) {
|
|
737
|
+
$(
|
|
738
|
+
e,
|
|
739
|
+
ee,
|
|
740
|
+
"parentIframe.setTargetOrigin(targetOrigin) targetOrigin"
|
|
741
|
+
), a(`Set targetOrigin: %c${e}`, c), i.targetOrigin = e;
|
|
742
|
+
}
|
|
743
|
+
function Ws(e) {
|
|
744
|
+
if (typeof e === Se) {
|
|
745
|
+
r.onPageInfo = e, y(0, 0, _t), yo(
|
|
746
|
+
"getPageInfo()",
|
|
747
|
+
"getParentProps()",
|
|
748
|
+
"See <u>https://iframe-resizer.com/upgrade</> for details. "
|
|
749
|
+
);
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
r.onPageInfo = null, y(0, 0, Hn);
|
|
753
|
+
}
|
|
754
|
+
function wn(e) {
|
|
755
|
+
return $(
|
|
756
|
+
e,
|
|
757
|
+
Se,
|
|
758
|
+
"parentIframe.getParentProps(callback) callback"
|
|
759
|
+
), r.onParentInfo = e, y(0, 0, xt), () => {
|
|
760
|
+
r.onParentInfo = null, y(0, 0, Wn);
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
function Vs(e) {
|
|
764
|
+
on("getParentProperties()", "getParentProps()"), wn(e);
|
|
765
|
+
}
|
|
766
|
+
const Us = (e) => `<rb>Deprecated API object name</>
|
|
767
|
+
The <b>window.parentIFrame</> object has been renamed to <b>window.parentIframe</>. Please update your code as the old object will be removed in a future version.
|
|
768
|
+
|
|
769
|
+
Called property: '${String(e)}'
|
|
770
|
+
`;
|
|
771
|
+
function Gs(e) {
|
|
772
|
+
const t = /* @__PURE__ */ new Set();
|
|
773
|
+
return new Proxy(e, {
|
|
774
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
775
|
+
get(n, o) {
|
|
776
|
+
t.has(o) || (p(Us(o)), t.add(o));
|
|
777
|
+
const s = n[o], u = Object.getOwnPropertyDescriptor(n, o);
|
|
778
|
+
return u && !u.configurable && !u.writable ? s : typeof s == "function" ? s.bind(n) : s;
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
function qs(e, t) {
|
|
783
|
+
e !== void 0 && $(
|
|
784
|
+
e,
|
|
785
|
+
C,
|
|
786
|
+
"parentIframe.resize(customHeight, customWidth) customHeight"
|
|
787
|
+
), t !== void 0 && $(
|
|
788
|
+
t,
|
|
789
|
+
C,
|
|
790
|
+
"parentIframe.resize(customHeight, customWidth) customWidth"
|
|
791
|
+
);
|
|
792
|
+
const n = `${e || ""}${t ? `,${t}` : ""}`;
|
|
793
|
+
M(
|
|
794
|
+
Ge,
|
|
795
|
+
`parentIframe.resize(${n})`,
|
|
796
|
+
e,
|
|
797
|
+
t
|
|
798
|
+
);
|
|
799
|
+
}
|
|
800
|
+
const ot = (e) => (t, n) => {
|
|
801
|
+
$(t, C, `parentIframe.${e}(x, y) x`), $(n, C, `parentIframe.${e}(x, y) y`), y(n, t, e);
|
|
802
|
+
}, Zs = ot(Vn), Qs = ot(Un), Ys = ot(Dt);
|
|
803
|
+
function Js(e, t) {
|
|
804
|
+
t && $(
|
|
805
|
+
t,
|
|
806
|
+
ee,
|
|
807
|
+
"parentIframe.sendMessage(msg, targetOrigin) targetOrigin"
|
|
808
|
+
), y(0, 0, je, JSON.stringify(e), t);
|
|
809
|
+
}
|
|
810
|
+
const Ks = () => y(0, 0, xn), Xs = () => i.parentId, er = () => Ls("parentIframe.reset"), tr = () => x("parentIframe.size() has been renamed parentIframe.resize()");
|
|
811
|
+
function nr() {
|
|
812
|
+
const { win: e } = r;
|
|
813
|
+
i.mode !== 1 && (e.parentIframe = Object.freeze({
|
|
814
|
+
autoResize: _s,
|
|
815
|
+
close: Ks,
|
|
816
|
+
getId: Xs,
|
|
817
|
+
getOrigin: Bs,
|
|
818
|
+
// TODO Remove in V6
|
|
819
|
+
getParentOrigin: Fs,
|
|
820
|
+
getPageInfo: Ws,
|
|
821
|
+
// TODO Remove in V6
|
|
822
|
+
getParentProps: wn,
|
|
823
|
+
getParentProperties: Vs,
|
|
824
|
+
// TODO Remove in V6
|
|
825
|
+
moveToAnchor: xs,
|
|
826
|
+
reset: er,
|
|
827
|
+
setOffsetSize: Ds,
|
|
828
|
+
scrollBy: Zs,
|
|
829
|
+
scrollTo: Qs,
|
|
830
|
+
scrollToOffset: Ys,
|
|
831
|
+
sendMessage: Js,
|
|
832
|
+
setTargetOrigin: Hs,
|
|
833
|
+
resize: qs,
|
|
834
|
+
size: tr
|
|
835
|
+
// TODO Remove in V6
|
|
836
|
+
}), e.parentIFrame = Gs(e.parentIframe));
|
|
837
|
+
}
|
|
838
|
+
const te = (e = "") => (t) => (n) => {
|
|
839
|
+
n.size > 0 && me(
|
|
840
|
+
`${t}Observer ${e}:`,
|
|
841
|
+
...Array.from(n).flatMap((o) => [Ue, o])
|
|
842
|
+
);
|
|
843
|
+
}, or = (e = "") => (t) => (n) => {
|
|
844
|
+
n.size > 0 && nn(
|
|
845
|
+
`${t}Observer ${e}:`,
|
|
846
|
+
...Array.from(n).flatMap((o) => [Ue, o])
|
|
847
|
+
);
|
|
848
|
+
}, Sn = te("attached to"), En = or("already attached"), sr = te("detached from"), Me = (e, t = !0) => (n) => {
|
|
849
|
+
n > 0 && d(
|
|
850
|
+
`${t ? "At" : "De"}tached %c${e}Observer%c ${t ? "to" : "from"} %c${n}%c element${n === 1 ? "" : "s"}`,
|
|
851
|
+
c,
|
|
852
|
+
Y,
|
|
853
|
+
c,
|
|
854
|
+
Y
|
|
855
|
+
);
|
|
856
|
+
}, On = (e, t, n, o) => {
|
|
857
|
+
const s = sr(e);
|
|
858
|
+
return (u) => {
|
|
859
|
+
const l = /* @__PURE__ */ new Set();
|
|
860
|
+
let m = 0;
|
|
861
|
+
for (const b of u)
|
|
862
|
+
n.has(b) && (t.unobserve(b), n.delete(b), l.add(b), m += 1);
|
|
863
|
+
s(l), o(m), l.clear();
|
|
864
|
+
};
|
|
865
|
+
}, It = 16, Tt = 2, rr = 200, st = "Mutation", E = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ new Set(), Be = /* @__PURE__ */ new Set(), pe = [], ir = {
|
|
866
|
+
attributes: !0,
|
|
867
|
+
attributeFilter: [X, ze],
|
|
868
|
+
attributeOldValue: !1,
|
|
869
|
+
characterData: !1,
|
|
870
|
+
characterDataOldValue: !1,
|
|
871
|
+
childList: !0,
|
|
872
|
+
subtree: !0
|
|
873
|
+
};
|
|
874
|
+
let Ne = 1, rt, Fe = !1, He = 0;
|
|
875
|
+
const cr = te("added")(st), ar = te("removed (page)")(st), lr = te("removed (added)")(st), $n = (e) => e.nodeType !== Node.ELEMENT_NODE || Jt.has(e.tagName.toLowerCase());
|
|
876
|
+
function dr(e) {
|
|
877
|
+
const t = e.addedNodes;
|
|
878
|
+
for (const n of t)
|
|
879
|
+
$n(n) || E.add(n);
|
|
880
|
+
}
|
|
881
|
+
function ur(e) {
|
|
882
|
+
const t = e.removedNodes;
|
|
883
|
+
for (const n of t)
|
|
884
|
+
$n(n) || (E.has(n) ? (E.delete(n), Be.add(n)) : N.add(n));
|
|
885
|
+
}
|
|
886
|
+
const fr = (e) => {
|
|
887
|
+
d("Mutations:", e);
|
|
888
|
+
for (const t of e)
|
|
889
|
+
dr(t), ur(t);
|
|
890
|
+
cr(E), ar(N), lr(Be), Be.clear();
|
|
891
|
+
};
|
|
892
|
+
function mr() {
|
|
893
|
+
N.size > 0 && a(
|
|
894
|
+
`Detected %c${N.size} %cremoved element${N.size > 1 ? "s" : ""}`,
|
|
895
|
+
c,
|
|
896
|
+
z
|
|
897
|
+
), E.size > 0 && a(
|
|
898
|
+
`Found %c${E.size} %cnew element${E.size > 1 ? "s" : ""}`,
|
|
899
|
+
c,
|
|
900
|
+
z
|
|
901
|
+
);
|
|
902
|
+
}
|
|
903
|
+
const hr = (e) => () => {
|
|
904
|
+
const t = performance.now(), n = t - He, o = It * Ne++ + Tt;
|
|
905
|
+
if (n > o && n < rr) {
|
|
906
|
+
h("mutationThrottled"), d("Update delayed due to heavy workload on the callStack"), d(
|
|
907
|
+
`EventLoop busy time: %c${j(n)}ms %c> Max wait: %c${o - Tt}ms`,
|
|
908
|
+
c,
|
|
909
|
+
z,
|
|
910
|
+
c
|
|
911
|
+
), setTimeout(rt, It * Ne), He = t;
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
Ne = 1, pe.forEach(fr), pe.length = 0, Fe = !1, mr(), e({ addedNodes: E, removedNodes: N }), E.clear(), N.clear();
|
|
915
|
+
};
|
|
916
|
+
function gr(e) {
|
|
917
|
+
pe.push(e), !Fe && (He = performance.now(), Fe = !0, requestAnimationFrame(rt));
|
|
918
|
+
}
|
|
919
|
+
function pr(e) {
|
|
920
|
+
const t = new window.MutationObserver(gr), n = document.body || document.documentElement;
|
|
921
|
+
return rt = hr(e), t.observe(n, ir), d("Attached%c MutationObserver%c to body", c, z), {
|
|
922
|
+
...t,
|
|
923
|
+
disconnect: () => {
|
|
924
|
+
E.clear(), N.clear(), pe.length = 0, t.disconnect(), d("Detached%c MutationObserver", c);
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
const yr = {
|
|
929
|
+
characterData: !0,
|
|
930
|
+
childList: !0,
|
|
931
|
+
subtree: !0
|
|
932
|
+
};
|
|
933
|
+
function vr(e) {
|
|
934
|
+
const t = document.querySelector("title") ?? document.head ?? document.documentElement, n = new MutationObserver(e);
|
|
935
|
+
return n.observe(t, yr), d("Attached%c TitleObserver%c to head", c, z), setTimeout(e), {
|
|
936
|
+
disconnect: () => {
|
|
937
|
+
n.disconnect(), d("Detached%c TitleObserver", c);
|
|
938
|
+
}
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
function br(e) {
|
|
942
|
+
const t = new IntersectionObserver(
|
|
943
|
+
(o) => e(o.at(-1)?.isIntersecting ?? !1),
|
|
944
|
+
{
|
|
945
|
+
threshold: 0
|
|
946
|
+
}
|
|
947
|
+
), n = document.documentElement;
|
|
948
|
+
return t.observe(n), d("Attached%c VisibilityObserver%c to page", c, z), {
|
|
949
|
+
disconnect: () => {
|
|
950
|
+
t.disconnect(), d("Detached%c VisibilityObserver", c);
|
|
951
|
+
}
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
let At = /* @__PURE__ */ new Set();
|
|
955
|
+
function zr(e) {
|
|
956
|
+
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
957
|
+
for (const o of e)
|
|
958
|
+
o.closest(`[${X}]`) ? n.add(o) : t.add(o);
|
|
959
|
+
return n.size > 0 && queueMicrotask(() => {
|
|
960
|
+
h("overflowIgnored"), d(`Ignoring elements with [data-iframe-ignore] > *:
|
|
961
|
+
`, n), D();
|
|
962
|
+
}), t;
|
|
963
|
+
}
|
|
964
|
+
function Mn() {
|
|
965
|
+
const e = document.querySelectorAll(`[${Bt}]`), t = zr(e);
|
|
966
|
+
let n = !1;
|
|
967
|
+
return typeof Set.prototype.symmetricDifference === Se && (n = t.symmetricDifference(At).size > 0), At = t, r.overflowedNodeSet = t, r.hasOverflow = t.size > 0, { hasOverflowUpdated: n, overflowedNodeSet: t };
|
|
968
|
+
}
|
|
969
|
+
const O = {}, Rn = (e) => {
|
|
970
|
+
const t = /* @__PURE__ */ new Set();
|
|
971
|
+
for (const n of e) {
|
|
972
|
+
t.add(n);
|
|
973
|
+
for (const o of tt(n)) t.add(o);
|
|
974
|
+
}
|
|
975
|
+
return d(`Inspecting:
|
|
976
|
+
`, t), t;
|
|
977
|
+
}, wr = (e) => {
|
|
978
|
+
if (e.size === 0) return;
|
|
979
|
+
h("addObservers");
|
|
980
|
+
const t = Rn(e);
|
|
981
|
+
O.overflow.attachObservers(t), O.resize.attachObserverToNonStaticElements(t), D();
|
|
982
|
+
}, Sr = (e) => {
|
|
983
|
+
if (e.size === 0) return;
|
|
984
|
+
h("removeObservers");
|
|
985
|
+
const t = Rn(e);
|
|
986
|
+
O.overflow.detachObservers(t), O.resize.detachObservers(t), D();
|
|
987
|
+
};
|
|
988
|
+
function Er({
|
|
989
|
+
addedNodes: e,
|
|
990
|
+
removedNodes: t
|
|
991
|
+
}) {
|
|
992
|
+
h("contentMutated"), r.applySelectors(), yn(), Mn(), D(), Sr(t), wr(e);
|
|
993
|
+
}
|
|
994
|
+
function Or(e) {
|
|
995
|
+
Er(e), M(qt, "Mutation Observed");
|
|
996
|
+
}
|
|
997
|
+
const ne = "Overflow", $r = Me(ne), Mr = Me(ne, !1), Rr = Sn(ne), Ir = En(ne), Tr = (e) => e.hidden || e.offsetParent === null || e.style.display === Qe, Ar = (e, t) => {
|
|
998
|
+
const n = t.side, o = {
|
|
999
|
+
root: t.root,
|
|
1000
|
+
rootMargin: "0px",
|
|
1001
|
+
threshold: 1
|
|
1002
|
+
}, s = window?.requestAnimationFrame || fe, u = (S = !1) => e(S), l = (S, R) => S === 0 || S > R[n], m = (S, R) => S.toggleAttribute(Bt, R);
|
|
1003
|
+
function b(S) {
|
|
1004
|
+
for (const R of S) {
|
|
1005
|
+
const { boundingClientRect: U, rootBounds: G, target: I } = R;
|
|
1006
|
+
if (!G) continue;
|
|
1007
|
+
const kn = U[n], Nn = l(kn, G) && !Tr(I);
|
|
1008
|
+
m(I, Nn);
|
|
1009
|
+
}
|
|
1010
|
+
s(u);
|
|
1011
|
+
}
|
|
1012
|
+
const f = new IntersectionObserver(b, o), w = /* @__PURE__ */ new WeakSet();
|
|
1013
|
+
function g(S) {
|
|
1014
|
+
const R = /* @__PURE__ */ new Set(), U = /* @__PURE__ */ new Set();
|
|
1015
|
+
let G = 0;
|
|
1016
|
+
for (const I of S)
|
|
1017
|
+
if (I.nodeType === Node.ELEMENT_NODE) {
|
|
1018
|
+
if (w.has(I)) {
|
|
1019
|
+
R.add(I);
|
|
1020
|
+
continue;
|
|
1021
|
+
}
|
|
1022
|
+
f.observe(I), w.add(I), U.add(I), G += 1;
|
|
1023
|
+
}
|
|
1024
|
+
Ir(R), Rr(U), $r(G), U.clear(), R.clear();
|
|
1025
|
+
}
|
|
1026
|
+
return {
|
|
1027
|
+
attachObservers: g,
|
|
1028
|
+
detachObservers: On(
|
|
1029
|
+
ne,
|
|
1030
|
+
f,
|
|
1031
|
+
w,
|
|
1032
|
+
Mr
|
|
1033
|
+
),
|
|
1034
|
+
disconnect: () => {
|
|
1035
|
+
f.disconnect(), d("Detached%c OverflowObserver", c);
|
|
1036
|
+
}
|
|
1037
|
+
};
|
|
1038
|
+
};
|
|
1039
|
+
function kr() {
|
|
1040
|
+
const { hasOverflow: e } = r, { hasOverflowUpdated: t, overflowedNodeSet: n } = Mn();
|
|
1041
|
+
switch (!0) {
|
|
1042
|
+
case !t:
|
|
1043
|
+
return;
|
|
1044
|
+
case n.size > 1:
|
|
1045
|
+
d("Overflowed Elements:", n);
|
|
1046
|
+
break;
|
|
1047
|
+
case e:
|
|
1048
|
+
break;
|
|
1049
|
+
default:
|
|
1050
|
+
d("No overflow detected");
|
|
1051
|
+
}
|
|
1052
|
+
M(Ze, "Overflow updated");
|
|
1053
|
+
}
|
|
1054
|
+
function Nr(e) {
|
|
1055
|
+
const t = {
|
|
1056
|
+
root: document.documentElement,
|
|
1057
|
+
side: i.calculateHeight ? Wt : Vt
|
|
1058
|
+
};
|
|
1059
|
+
return O.overflow = Ar(kr, t), O.overflow.attachObservers(e), O.overflow;
|
|
1060
|
+
}
|
|
1061
|
+
const oe = "Resize", Cr = Me(oe), Pr = Me(oe, !1), Lr = Sn(oe), jr = En(oe), ye = /* @__PURE__ */ new WeakSet(), Ce = /* @__PURE__ */ new Set(), Pe = /* @__PURE__ */ new Set();
|
|
1062
|
+
let Q;
|
|
1063
|
+
function _r(e) {
|
|
1064
|
+
let t = 0;
|
|
1065
|
+
for (const n of e) {
|
|
1066
|
+
if (n.nodeType !== Node.ELEMENT_NODE) continue;
|
|
1067
|
+
const o = getComputedStyle(n)?.position;
|
|
1068
|
+
if (!(o === "" || o === "static")) {
|
|
1069
|
+
if (ye.has(n)) {
|
|
1070
|
+
Ce.add(n);
|
|
1071
|
+
continue;
|
|
1072
|
+
}
|
|
1073
|
+
Q.observe(n), ye.add(n), Pe.add(n), t += 1;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
jr(Ce), Lr(Pe), Cr(t), Pe.clear(), Ce.clear();
|
|
1077
|
+
}
|
|
1078
|
+
const xr = (e) => (Q = new ResizeObserver(e), Q.observe(document.body), ye.add(document.body), d("Attached%c ResizeObserver%c to body", c, z), {
|
|
1079
|
+
attachObserverToNonStaticElements: _r,
|
|
1080
|
+
detachObservers: On(
|
|
1081
|
+
oe,
|
|
1082
|
+
Q,
|
|
1083
|
+
ye,
|
|
1084
|
+
Pr
|
|
1085
|
+
),
|
|
1086
|
+
disconnect: () => {
|
|
1087
|
+
Q.disconnect(), d("Detached%c ResizeObserver", c);
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
function Dr(e) {
|
|
1091
|
+
if (!Array.isArray(e) || e.length === 0) return;
|
|
1092
|
+
const t = e[0].target;
|
|
1093
|
+
M(Gt, `Element resized <${so(t)}>`);
|
|
1094
|
+
}
|
|
1095
|
+
function Br(e) {
|
|
1096
|
+
return O.resize = xr(Dr), O.resize.attachObserverToNonStaticElements(e), O.resize;
|
|
1097
|
+
}
|
|
1098
|
+
let kt;
|
|
1099
|
+
function Fr() {
|
|
1100
|
+
const e = document.title;
|
|
1101
|
+
e !== kt && (kt = e, a(`Title: %c${e}`, c), e && y(0, 0, Gn, e));
|
|
1102
|
+
}
|
|
1103
|
+
function Hr(e) {
|
|
1104
|
+
a(`Visible: %c${e}`, c), r.isHidden = !e, M(Zt, "Visibility changed");
|
|
1105
|
+
}
|
|
1106
|
+
function Wr(e) {
|
|
1107
|
+
Xe.push(...e.map((t) => t.disconnect));
|
|
1108
|
+
}
|
|
1109
|
+
function Vr() {
|
|
1110
|
+
h("attachObservers");
|
|
1111
|
+
const e = tt(document.documentElement), t = [
|
|
1112
|
+
pr(Or),
|
|
1113
|
+
Nr(e),
|
|
1114
|
+
Ho(),
|
|
1115
|
+
Br(e),
|
|
1116
|
+
vr(Fr),
|
|
1117
|
+
br(Hr)
|
|
1118
|
+
];
|
|
1119
|
+
Wr(t);
|
|
1120
|
+
}
|
|
1121
|
+
const Nt = (e, t, n) => {
|
|
1122
|
+
if (n !== "") {
|
|
1123
|
+
a(`${e}: %c${n}`, c);
|
|
1124
|
+
for (const o of document.querySelectorAll(n))
|
|
1125
|
+
a(`Applying ${t} to:`, o), o.toggleAttribute(t, !0);
|
|
1126
|
+
}
|
|
1127
|
+
};
|
|
1128
|
+
function Ur({
|
|
1129
|
+
sizeSelector: e,
|
|
1130
|
+
ignoreSelector: t
|
|
1131
|
+
}) {
|
|
1132
|
+
return () => {
|
|
1133
|
+
Nt("sizeSelector", ze, e), Nt("ignoreSelector", X, t);
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
function Gr() {
|
|
1137
|
+
const e = document.createElement("div");
|
|
1138
|
+
e.style.clear = "both", e.style.display = "block", e.style.height = "0", document.body.append(e);
|
|
1139
|
+
}
|
|
1140
|
+
function qr(e, t) {
|
|
1141
|
+
return t.includes("-") && (x(`Negative CSS value ignored for ${e}`), t = ""), t;
|
|
1142
|
+
}
|
|
1143
|
+
function We(e, t) {
|
|
1144
|
+
t === void 0 || t === "" || t === Jn || (document.body.style.setProperty(e, t), d(`Set body ${e}: %c${t}`, c));
|
|
1145
|
+
}
|
|
1146
|
+
function Zr({
|
|
1147
|
+
bodyMarginStr: e,
|
|
1148
|
+
bodyMargin: t
|
|
1149
|
+
}) {
|
|
1150
|
+
e === void 0 && (e = `${t}px`), We("margin", qr("margin", e));
|
|
1151
|
+
}
|
|
1152
|
+
const Qr = () => ({
|
|
1153
|
+
x: document.documentElement.scrollLeft,
|
|
1154
|
+
y: document.documentElement.scrollTop
|
|
1155
|
+
});
|
|
1156
|
+
function Yr(e) {
|
|
1157
|
+
const t = e.getBoundingClientRect(), n = Qr();
|
|
1158
|
+
return {
|
|
1159
|
+
x: parseInt(t.left, se) + parseInt(n.x, se),
|
|
1160
|
+
y: parseInt(t.top, se) + parseInt(n.y, se)
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
function Jr(e, t) {
|
|
1164
|
+
const n = Yr(t);
|
|
1165
|
+
a(
|
|
1166
|
+
`Moving to in page link (%c#${e}%c) at x: %c${n.x}%c y: %c${n.y}`,
|
|
1167
|
+
c,
|
|
1168
|
+
z,
|
|
1169
|
+
c,
|
|
1170
|
+
z,
|
|
1171
|
+
c
|
|
1172
|
+
), y(n.y, n.x, Dt);
|
|
1173
|
+
}
|
|
1174
|
+
function it(e) {
|
|
1175
|
+
const t = e.split("#")[1] || e, n = decodeURIComponent(t), o = document.getElementById(n) || document.getElementsByName(n)[0];
|
|
1176
|
+
if (o !== void 0) {
|
|
1177
|
+
Jr(t, o);
|
|
1178
|
+
return;
|
|
1179
|
+
}
|
|
1180
|
+
a(`In page link (#${t}) not found in iframe, so sending to parent`), y(0, 0, Dn, `#${t}`);
|
|
1181
|
+
}
|
|
1182
|
+
function In() {
|
|
1183
|
+
const { hash: e, href: t } = window.location;
|
|
1184
|
+
e !== "" && e !== "#" && it(t);
|
|
1185
|
+
}
|
|
1186
|
+
function Kr() {
|
|
1187
|
+
for (const e of document.querySelectorAll('a[href^="#"]'))
|
|
1188
|
+
e.getAttribute("href") !== "#" && P(e, "click", (t) => {
|
|
1189
|
+
t.preventDefault(), it(e.getAttribute("href"));
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
function Xr() {
|
|
1193
|
+
P(window, "hashchange", In);
|
|
1194
|
+
}
|
|
1195
|
+
function ei() {
|
|
1196
|
+
setTimeout(In, Yt);
|
|
1197
|
+
}
|
|
1198
|
+
function ti() {
|
|
1199
|
+
a("Setting up location.hash handlers"), Kr(), Xr(), ei(), r.inPageLinks = {
|
|
1200
|
+
findTarget: it
|
|
1201
|
+
};
|
|
1202
|
+
}
|
|
1203
|
+
function ni(e) {
|
|
1204
|
+
const { mode: t } = i;
|
|
1205
|
+
e ? nt(t) ? p(V(5)) : ti() : a("In page linking not enabled");
|
|
1206
|
+
}
|
|
1207
|
+
const oi = "important";
|
|
1208
|
+
function si() {
|
|
1209
|
+
const e = (t) => t.style.setProperty(we, k, oi);
|
|
1210
|
+
e(document.documentElement), e(document.body), a("Set HTML & body height: %cauto !important", c);
|
|
1211
|
+
}
|
|
1212
|
+
const ct = (e) => (t, n) => {
|
|
1213
|
+
if (n in t) {
|
|
1214
|
+
if (typeof t[n] === e) return t[n];
|
|
1215
|
+
throw new TypeError(`${n} is not a ${e}.`);
|
|
1216
|
+
}
|
|
1217
|
+
}, Le = ct(Se), ie = ct(C), ce = ct(ee), ri = (e) => e !== null && typeof e === Zn && !Array.isArray(e);
|
|
1218
|
+
function ii(e) {
|
|
1219
|
+
const { calculateHeight: t, calculateWidth: n } = i;
|
|
1220
|
+
let o, s;
|
|
1221
|
+
return typeof e?.offset === C && (vo(Ie, Te), t && (o = ie(e, Ie)), n && (s = ie(e, Ie))), typeof e?.offsetSize === C && (t && (o = ie(e, Te)), n && (s = ie(e, Te))), { offsetHeight: o, offsetWidth: s };
|
|
1222
|
+
}
|
|
1223
|
+
function ci(e) {
|
|
1224
|
+
a("Reading data from page:", Object.keys(e));
|
|
1225
|
+
const { offsetHeight: t, offsetWidth: n } = ii(e);
|
|
1226
|
+
return {
|
|
1227
|
+
offsetHeight: t,
|
|
1228
|
+
offsetWidth: n,
|
|
1229
|
+
ignoreSelector: ce(e, "ignoreSelector"),
|
|
1230
|
+
[St(3)]: ce(e, St(0)),
|
|
1231
|
+
sizeSelector: ce(e, "sizeSelector"),
|
|
1232
|
+
targetOrigin: ce(e, "targetOrigin"),
|
|
1233
|
+
onBeforeResize: Le(e, "onBeforeResize"),
|
|
1234
|
+
onMessage: Le(e, "onMessage"),
|
|
1235
|
+
onReady: Le(e, "onReady")
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
function ai() {
|
|
1239
|
+
const { mode: e } = i;
|
|
1240
|
+
if (nt(e)) return {};
|
|
1241
|
+
const t = window.iframeResizer || window.iFrameResizer;
|
|
1242
|
+
return ri(t) ? ci(t) : {};
|
|
1243
|
+
}
|
|
1244
|
+
const li = (e) => e === "true", Tn = (e) => (t) => t === void 0 ? void 0 : e(t), L = Tn(li), Z = Tn(Number), di = (e) => ({
|
|
1245
|
+
parentId: e[0],
|
|
1246
|
+
bodyMargin: Z(e[1]),
|
|
1247
|
+
calculateWidth: L(e[2]),
|
|
1248
|
+
logging: L(e[3]),
|
|
1249
|
+
// data[4] no longer used (was intervalTimer)
|
|
1250
|
+
autoResize: L(e[6]),
|
|
1251
|
+
bodyMarginStr: e[7],
|
|
1252
|
+
heightCalcMode: e[8],
|
|
1253
|
+
bodyBackground: e[9],
|
|
1254
|
+
bodyPadding: e[10],
|
|
1255
|
+
tolerance: Z(e[11]),
|
|
1256
|
+
inPageLinks: L(e[12]),
|
|
1257
|
+
// data[13] no longer used (was resizeFrom)
|
|
1258
|
+
widthCalcMode: e[14],
|
|
1259
|
+
mouseEvents: L(e[15]),
|
|
1260
|
+
offsetHeight: Z(e[16]),
|
|
1261
|
+
offsetWidth: Z(e[17]),
|
|
1262
|
+
calculateHeight: L(e[18]),
|
|
1263
|
+
key: e[19],
|
|
1264
|
+
version: e[20],
|
|
1265
|
+
mode: Z(e[21]),
|
|
1266
|
+
// sizeSelector: data[22] // Now only available via page settings
|
|
1267
|
+
logExpand: L(e[23])
|
|
1268
|
+
});
|
|
1269
|
+
function ui(e) {
|
|
1270
|
+
const { mode: t } = i;
|
|
1271
|
+
e.forEach((n) => {
|
|
1272
|
+
try {
|
|
1273
|
+
n();
|
|
1274
|
+
} catch (o) {
|
|
1275
|
+
if (t < 0) throw o;
|
|
1276
|
+
p(
|
|
1277
|
+
`<rb>Error in setup function</>
|
|
1278
|
+
<i>iframe-resizer</> detected an error during setup.
|
|
1279
|
+
|
|
1280
|
+
Please report the following error message at <u>https://github.com/davidjbradshaw/iframe-resizer/issues</>`
|
|
1281
|
+
), nn(o);
|
|
1282
|
+
}
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1285
|
+
function Ct(e) {
|
|
1286
|
+
for (const [t, n] of Object.entries(e))
|
|
1287
|
+
n !== void 0 && (i[t] = n);
|
|
1288
|
+
}
|
|
1289
|
+
function fi({
|
|
1290
|
+
logExpand: e,
|
|
1291
|
+
logging: t,
|
|
1292
|
+
parentId: n
|
|
1293
|
+
}) {
|
|
1294
|
+
ho({ id: n, enabled: t, expand: e }), h("initReceived"), a(`Initialising iframe v${_} ${window.location.href}`);
|
|
1295
|
+
}
|
|
1296
|
+
function mi(e) {
|
|
1297
|
+
h("ready"), pn(Kt(e)), a("Initialization complete", (({ key: t, key2: n, ...o }) => o)(i));
|
|
1298
|
+
}
|
|
1299
|
+
function hi({
|
|
1300
|
+
bodyBackground: e,
|
|
1301
|
+
bodyPadding: t,
|
|
1302
|
+
inPageLinks: n,
|
|
1303
|
+
onReady: o
|
|
1304
|
+
}) {
|
|
1305
|
+
const s = No(i), u = [
|
|
1306
|
+
// @ts-ignore
|
|
1307
|
+
() => ys(i),
|
|
1308
|
+
// @ts-ignore
|
|
1309
|
+
() => ls(i),
|
|
1310
|
+
Xo,
|
|
1311
|
+
Qo,
|
|
1312
|
+
qo,
|
|
1313
|
+
Zo,
|
|
1314
|
+
Jo,
|
|
1315
|
+
fs,
|
|
1316
|
+
yn,
|
|
1317
|
+
hs,
|
|
1318
|
+
s ? fe : ko,
|
|
1319
|
+
() => Zr(i),
|
|
1320
|
+
() => We("background", e),
|
|
1321
|
+
() => We("padding", t),
|
|
1322
|
+
s ? fe : si,
|
|
1323
|
+
Gr,
|
|
1324
|
+
r.applySelectors,
|
|
1325
|
+
() => ni(n),
|
|
1326
|
+
Cs,
|
|
1327
|
+
() => Es(i),
|
|
1328
|
+
Ms,
|
|
1329
|
+
() => nr(),
|
|
1330
|
+
() => M(
|
|
1331
|
+
be,
|
|
1332
|
+
"Init message from host page",
|
|
1333
|
+
void 0,
|
|
1334
|
+
void 0,
|
|
1335
|
+
`${_}:${i.mode}`
|
|
1336
|
+
),
|
|
1337
|
+
Vr,
|
|
1338
|
+
D
|
|
1339
|
+
];
|
|
1340
|
+
ui(u), mi(o);
|
|
1341
|
+
}
|
|
1342
|
+
function gi(e) {
|
|
1343
|
+
r.firstRun && (Ct(di(e)), fi(i), Ct(ai()), r.applySelectors = Ur(i), hi(i));
|
|
1344
|
+
}
|
|
1345
|
+
function pi(e) {
|
|
1346
|
+
if (document.readyState === "loading") {
|
|
1347
|
+
a("Page not ready, ignoring init message");
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
const t = e.data.slice(Qt).split(ve);
|
|
1351
|
+
r.target = e.source, r.origin = e.origin, gi(t), r.firstRun = !1, setTimeout(() => {
|
|
1352
|
+
r.initLock = !1;
|
|
1353
|
+
}, Yt);
|
|
1354
|
+
}
|
|
1355
|
+
const { freeze: yi } = Object, { parse: at } = JSON, lt = (e) => yi(at(e)), An = (e) => y(0, 0, `${e}Stop`), Re = (e) => e.data.slice(e.data.indexOf(ve) + 1), vi = (e) => wo(e) ? be : e.data.split("]")[1].split(ve)[0];
|
|
1356
|
+
function bi(e) {
|
|
1357
|
+
const t = Re(e);
|
|
1358
|
+
a("onMessage called from parent:%c", c, lt(t)), Ee(i.onMessage, at(t));
|
|
1359
|
+
}
|
|
1360
|
+
function zi(e) {
|
|
1361
|
+
const { onPageInfo: t } = r, n = Re(e);
|
|
1362
|
+
a("PageInfo received from parent:", lt(n)), t ? Ee(t, at(n)) : An(_t);
|
|
1363
|
+
}
|
|
1364
|
+
function wi(e) {
|
|
1365
|
+
const { onParentInfo: t } = r, n = lt(Re(e));
|
|
1366
|
+
a("ParentInfo received from parent:", n), t ? Ee(t, n) : An(xt);
|
|
1367
|
+
}
|
|
1368
|
+
function Si() {
|
|
1369
|
+
if (r.initLock) {
|
|
1370
|
+
a("Page reset ignored by init");
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1373
|
+
a("Page size reset by host page"), zn("resetPage");
|
|
1374
|
+
}
|
|
1375
|
+
function Ei() {
|
|
1376
|
+
a("Resize requested by host page"), M(qe, "Parent window requested size check");
|
|
1377
|
+
}
|
|
1378
|
+
const Pt = (e) => r.inPageLinks.findTarget(Re(e)), Lt = {
|
|
1379
|
+
init: pi,
|
|
1380
|
+
reset: Si,
|
|
1381
|
+
resize: Ei,
|
|
1382
|
+
moveToAnchor: Pt,
|
|
1383
|
+
inPageLink: Pt,
|
|
1384
|
+
// Backward compatibility
|
|
1385
|
+
pageInfo: zi,
|
|
1386
|
+
parentInfo: wi,
|
|
1387
|
+
message: bi
|
|
1388
|
+
};
|
|
1389
|
+
function Oi(e) {
|
|
1390
|
+
const { firstRun: t } = r, n = vi(e);
|
|
1391
|
+
switch (h(n), !0) {
|
|
1392
|
+
case n in Lt:
|
|
1393
|
+
Lt[n](e);
|
|
1394
|
+
break;
|
|
1395
|
+
case (t && zo()):
|
|
1396
|
+
x(
|
|
1397
|
+
`Ignored message of type "${n}". Received before initialization.`
|
|
1398
|
+
);
|
|
1399
|
+
break;
|
|
1400
|
+
default:
|
|
1401
|
+
x(
|
|
1402
|
+
`Unexpected message (${e.data}), this is likely due to a newer version of iframe-resizer running on the parent page.`
|
|
1403
|
+
);
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
const ae = Je((e) => {
|
|
1407
|
+
bo(e) && Oi(e);
|
|
1408
|
+
});
|
|
1409
|
+
function $i() {
|
|
1410
|
+
if ("iframeChildListener" in window) {
|
|
1411
|
+
x("Already setup");
|
|
1412
|
+
return;
|
|
1413
|
+
}
|
|
1414
|
+
window.iframeChildListener = (t) => setTimeout(() => ae({ data: t, sameOrigin: !0 })), h("listen"), P(window, je, ae), P(document, Ht, pt), pt();
|
|
1415
|
+
function e(t) {
|
|
1416
|
+
return ae(t), r.win;
|
|
1417
|
+
}
|
|
1418
|
+
try {
|
|
1419
|
+
top?.document?.getElementById("banner") && (r.win = {}, window.mockMsgListener = e, rn(window, je, ae), typeof window.define == "function" && window.define([], () => e));
|
|
1420
|
+
} catch {
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
typeof window !== Qn && $i();
|
|
1424
|
+
//# sourceMappingURL=index.esm.js.map
|