iframe-resizer 5.3.1 → 5.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js
CHANGED
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (child) 5.3.
|
|
4
|
+
* @module iframe-resizer/legacy (child) 5.3.2 (iife)
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(){"use strict";const e="5.3.1",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<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</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>e,u=1e5,m=e=>Math.round(e*u)/u;let f="",p=!1;const h=e=>{f=e.id,p=e.logging},y=e=>""!=`${e}`&&void 0!==e;const g=(...e)=>[`[iframe-resizer][${f||"child"}]`,...e].join(" "),b=(...e)=>p&&console?.info(`%c[iframe-resizer][${f}]%c`,"font-weight: bold;","font-weight: normal;",...e),v=(...e)=>console?.warn(g(...e)),w=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(g)(...e)),z=e=>w(e),S=e=>{const t=e.side||i,n=e.onChange||d,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},E="--ifr-start",j="--ifr-end",$="--ifr-measure",C=[],T=new WeakSet,M=e=>"object"==typeof e&&T.add(e);let P=null,A={};const O=setInterval((()=>{if(C.length<10)return;if(A.hasTags&&A.len<25)return;C.sort();const e=Math.min(C.reduce(((e,t)=>e+t),0)/C.length,C[Math.floor(C.length/2)]);e<=4||(clearInterval(O),w(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${A.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function N(e){e.getEntries().forEach((e=>{if(e.name===j){const{duration:t}=performance.measure($,E,j);!function(e,t){const{Side:n,len:o,hasTags:i,logging:r}=e;A=e,T.has(P)||i&&o<=1||(r||M(P),b(`\n ${n} position calculated from:`,P,`\n Parsed ${o} ${i?"tagged":"potentially overflowing"} elements in ${m(t)}ms`))}(e.detail,t),C.push(t),C.length>100&&C.shift()}}))}function I(){new PerformanceObserver(N).observe({entryTypes:["mark"]}),M(document.documentElement),M(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",I):I()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>(v("Custom height calculation function not defined"),qe.auto()),width:()=>(v("Custom width calculation function not defined"),Le.auto())},u={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},f=128,p={},g="checkVisibility"in window,b="auto",$="[iFrameSizer]",C=$.length,T={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="scroll";let A,O,N,I,k=!0,R="",x=0,q="",L="",B=!0,D=!1,W=!0,U=!1,F=!1,V=1,J=b,H=!0,Z="",_={},Q=!1,X=0,Y=!1,G="",K=d,ee=[],te="child",ne=null,oe=!1,ie="",re=[],ae=window.parent,le="*",se=0,ce=!1,de="",ue=1,me=M,fe=window,pe=()=>{v("onMessage function not defined")},he=()=>{},ye=null,ge=null;function be(){var o,d,u;!function(){const e=e=>"true"===e,t=Z.slice(C).split(":");G=t[0],x=void 0===t[1]?x:Number(t[1]),D=void 0===t[2]?D:e(t[2]),Q=void 0===t[3]?Q:e(t[3]),k=void 0===t[6]?k:e(t[6]),q=t[7],J=void 0===t[8]?J:t[8],R=t[9],L=t[10],se=void 0===t[11]?se:Number(t[11]),_.enable=void 0!==t[12]&&e(t[12]),te=void 0===t[13]?te:t[13],me=void 0===t[14]?me:t[14],Y=void 0===t[15]?Y:e(t[15]),A=void 0===t[16]?A:Number(t[16]),O=void 0===t[17]?O:Number(t[17]),B=void 0===t[18]?B:e(t[18]),t[19],de=t[20]||de,X=void 0===t[21]?X:Number(t[21])}(),h({id:G,logging:Q}),function(){function e(e){pe=e?.onMessage||pe,he=e?.onReady||he,"number"==typeof e?.offset&&(w("<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</>."),B&&(A=e?.offset),D&&(O=e?.offset)),"number"==typeof e?.offsetSize&&(B&&(A=e?.offsetSize),D&&(O=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(ie=e.sizeSelector),le=e?.targetOrigin||le,J=e?.heightCalculationMethod||J,me=e?.widthCalculationMethod||me}function t(e,t){return"function"==typeof e&&(s[t]=e,e="custom"),e}if(1===X)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),J=t(J,"height"),me=t(me,"width"))}(),function(){try{oe="iframeParentListener"in window.parent}catch(e){}}(),X<0?z(`${c(X+2)}${c(2)}`):de.codePointAt(0)>4||X<2&&z(c(3)),de&&""!==de&&"false"!==de?de!==e&&w(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${de} - Child page: ${e}.\n`):w("<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"),Ce(),Te(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&w("<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</>.")}(),we(),B!==D&&(K=S({onChange:ve,root:document.documentElement,side:B?i:r})),1!==X&&(fe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===k?(k=!0,We("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===k&&(k=!1),Je(0,0,"autoResize",JSON.stringify(k)),k),close(){Je(0,0,"close")},getId:()=>G,getPageInfo(e){if("function"==typeof e)return ye=e,Je(0,0,"pageInfo"),void w("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ye=null,Je(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return ge=e,Je(0,0,"parentInfo"),()=>{ge=null,Je(0,0,"parentInfoStop")}},getParentProperties(e){w("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){_.findTarget(e)},reset(){Ve()},scrollBy(e,t){Je(t,e,"scrollBy")},scrollTo(e,t){Je(t,e,"scrollTo")},scrollToOffset(e,t){Je(t,e,"scrollToOffset")},sendMessage(e,t){Je(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){J=e,Ce()},setWidthCalculationMethod(e){me=e,Te()},setTargetOrigin(e){le=e},resize(e,t){We(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){w("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),fe.parentIFrame=fe.parentIframe),function(){function e(e){Je(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){l(window.document,t,e)}!0===Y&&(t("mouseenter"),t("mouseleave"))}(),_=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);Je(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Je(0,0,"inPageLink",`#${o}`):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,f)}function c(){r(),a(),s()}return _.enable&&(1===X?w("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):c()),{findTarget:o}}(),ze(Ie(document)()),void 0===q&&(q=`${x}px`),Se("margin",(d="margin",(u=q).includes("-")&&(v(`Negative CSS value ignored for ${d}`),u=""),u)),Se("background",R),Se("padding",L),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),Ee(),We("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Je(0,0,"title",document.title),je({method:o="add",eventType:"After Print",eventName:"afterprint"}),je({method:o,eventType:"Before Print",eventName:"beforeprint"}),je({method:o,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function c(){const d=performance.now(),u=d-n;if(u>r*s+++a&&u<l)return setTimeout(c,r*s),void(n=d);s=1,o.forEach(i),o=[],0!==e.size?(Ee(),we(),ze(e),e.forEach(Ae),e.clear(),t=!1):t=!1}function d(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(c))}function u(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}u()}(),ne=new ResizeObserver(Me),ne.observe(document.body),Pe.add(document.body),Ae(document.body),setTimeout(he)}function ve(e){ee=e,U=ee.length>0,We("overflowChanged","Overflow updated")}function we(){re=document.querySelectorAll(`[${n}]`),F=re.length>0}function ze(e){F||K(e)}function Se(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function Ee(){if(""!==ie)for(const e of document.querySelectorAll(ie))e.dataset.iframeSize=!0}function je(e){({add(t){function n(){We(e.eventName,e.eventType)}p[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=p[e];var n,o;delete p[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function $e(e,t,n,o){return t!==e&&(e in n||(v(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in u&&w(`<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 remove this option.`)),e}function Ce(){J=$e(J,b,qe,"height")}function Te(){me=$e(me,M,Le,"width")}function Me(e){Array.isArray(e)&&0!==e.length&&We("resizeObserver",`Resize Observed: ${function(e){switch(!0){case!y(e):return"";case y(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case y(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(y(e.className)?`.${e.className}`:"")}}(e[0].target)}`)}const Pe=new WeakSet;function Ae(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Pe.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ne.observe(e),Pe.add(e))}const t=Ie(e)();for(const e of t){if(Pe.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ne.observe(e),Pe.add(e))}}function Oe(e){performance.mark(E);const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let i=0,r=document.documentElement,a=F?0:document.documentElement.getBoundingClientRect().bottom;performance.mark(E);const l=F?re:U?ee:Ie(document)();let s=l.length;for(const t of l)F||!g||t.checkVisibility(o)?(i=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),i>a&&(a=i,r=t)):s-=1;return P=r,performance.mark(j,{detail:{Side:t,len:s,hasTags:F,logging:Q}}),a}const Ne=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Ie=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),ke={height:0,width:0},Re={height:0,width:0};function xe(e){function t(){return Re[o]=i,ke[o]=l,i}const n=e===qe,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return l;case F:return e.taggedElement();case!U&&0===Re[o]&&0===ke[o]:return t();case ce&&i===Re[o]&&l===ke[o]:return Math.max(i,l);case 0===i:return l;case!U&&i!==Re[o]&&l<=ke[o]:return t();case!n:return e.taggedElement();case!U&&i<Re[o]:case l===a||l===r:case i>l:return t()}return Math.max(e.taggedElement(),t())}const qe={enabled:()=>B,getOffset:()=>A,auto:()=>xe(qe),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>qe.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Ne(qe)),min:()=>Math.min(...Ne(qe)),grow:()=>qe.max(),lowestElement:()=>Oe(i),taggedElement:()=>Oe(i)},Le={enabled:()=>D,getOffset:()=>O,auto:()=>xe(Le),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Ne(Le)),min:()=>Math.min(...Ne(Le)),rightMostElement:()=>Oe(r),scroll:()=>Math.max(Le.bodyScroll(),Le.documentElementScroll()),taggedElement:()=>Oe(r)},Be=(e,t)=>!(Math.abs(e-t)<=se);let De=!1;function We(e,t,n,o,i){I=performance.now(),(k||e===a)&&(document.hidden||(De||(N=!0,function(e,t,n,o,i){const r=void 0===n?qe[J]():n,l=void 0===o?Le[me]():o;B&&Be(V,r)||D&&Be(ue,l)||"init"===e?(Ue(),V=r,ue=l,Je(V,ue,e,i)):!e!==a&&(B&&J in T||D&&me in T)?Ve():N=!1}(e,0,n,o,i),requestAnimationFrame((()=>{De=!1}))),De=!0))}function Ue(){ce||(ce=!0,requestAnimationFrame((()=>{ce=!1})))}function Fe(e){V=qe[J](),ue=Le[me](),Je(V,ue,e)}function Ve(e){const t=J;J=b,Ue(),Fe("reset"),J=t}function Je(e,t,n,o,i){X<-1||(void 0!==i||(i=le),function(){const r=`${G}:${e+(A||0)}:${t+(O||0)}:${n}${void 0===o?"":`:${o}`}`;Q&&(console.group(`[iframe-resizer][${G}]`),console.info("Sending message to host page via "+(oe?"sameDomain":"postMessage")),console.info(`%c${r}`,"font-style: italic"),N&&console.info(function(){const e=m(performance.now()-I);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),console.groupEnd()),N=!1,oe?window.parent.iframeParentListener($+r):ae.postMessage($+r,i)}())}function He(e){const t={init:function(){Z=e.data,ae=e.source,be(),W=!1,setTimeout((()=>{H=!1}),f)},reset(){H||Fe("resetPage")},resize(){We(a)},moveToAnchor(){_.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ye?setTimeout((()=>ye(JSON.parse(e)))):Je(0,0,"pageInfoStop")},parentInfo(){const e=o();ge?setTimeout(ge(Object.freeze(JSON.parse(e)))):Je(0,0,"parentInfoStop")},message(){const e=o();pe(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};$===`${e.data}`.slice(0,C)&&(!1!==W?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||v(`Unexpected message (${e.data})`)}())}function Ze(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?v("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>He({data:e,sameDomain:!0}))),l(window,"message",He),l(window,"readystatechange",Ze),Ze())}()}();
|
|
20
|
+
!function(){"use strict";const e="5.3.2",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<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</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>e,u=1e5,m=e=>Math.round(e*u)/u;let f="",p=!1;const h=e=>{f=e.id,p=e.logging},y=e=>""!=`${e}`&&void 0!==e;const g=(...e)=>[`[iframe-resizer][${f||"child"}]`,...e].join(" "),b=(...e)=>p&&console?.info(`%c[iframe-resizer][${f}]%c`,"font-weight: bold;","font-weight: normal;",...e),v=(...e)=>console?.warn(g(...e)),w=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(g)(...e)),z=e=>w(e),S=e=>{const t=e.side||i,n=e.onChange||d,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},E="--ifr-start",j="--ifr-end",$="--ifr-measure",C=[],T=new WeakSet,M=e=>"object"==typeof e&&T.add(e);let O=null,P={};const A=setInterval((()=>{if(C.length<10)return;if(P.hasTags&&P.len<25)return;C.sort();const e=Math.min(C.reduce(((e,t)=>e+t),0)/C.length,C[Math.floor(C.length/2)]);e<=4||(clearInterval(A),w(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${P.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function N(e){e.getEntries().forEach((e=>{if(e.name===j){const{duration:t}=performance.measure($,E,j);!function(e,t){const{Side:n,len:o,hasTags:i,logging:r}=e;P=e,T.has(O)||i&&o<=1||(r||M(O),b(`\n ${n} position calculated from:`,O,`\n Parsed ${o} ${i?"tagged":"potentially overflowing"} elements in ${m(t)}ms`))}(e.detail,t),C.push(t),C.length>100&&C.shift()}}))}function I(){new PerformanceObserver(N).observe({entryTypes:["mark"]}),M(document.documentElement),M(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",I):I()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>(v("Custom height calculation function not defined"),Le.auto()),width:()=>(v("Custom width calculation function not defined"),Be.auto())},u={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},f=128,p={},g="checkVisibility"in window,b="auto",$="[iFrameSizer]",C=$.length,T={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="scroll";let P,A,N,I,k,R=!0,x="",q=0,L="",B="",D=!0,W=!1,U=!0,F=!1,V=!1,J=1,H=b,Z=!0,_="",Q={},X=!1,Y=0,G=!1,K="",ee=d,te=[],ne="child",oe=null,ie=!1,re="",ae=[],le=window.parent,se="*",ce=0,de=!1,ue="",me=1,fe=M,pe=window,he=()=>{v("onMessage function not defined")},ye=()=>{},ge=null,be=null;function ve(){var o,d,u;!function(){const e=e=>"true"===e,t=_.slice(C).split(":");K=t[0],q=void 0===t[1]?q:Number(t[1]),W=void 0===t[2]?W:e(t[2]),X=void 0===t[3]?X:e(t[3]),R=void 0===t[6]?R:e(t[6]),L=t[7],H=void 0===t[8]?H:t[8],x=t[9],B=t[10],ce=void 0===t[11]?ce:Number(t[11]),Q.enable=void 0!==t[12]&&e(t[12]),ne=void 0===t[13]?ne:t[13],fe=void 0===t[14]?fe:t[14],G=void 0===t[15]?G:e(t[15]),P=void 0===t[16]?P:Number(t[16]),A=void 0===t[17]?A:Number(t[17]),D=void 0===t[18]?D:e(t[18]),t[19],ue=t[20]||ue,Y=void 0===t[21]?Y:Number(t[21])}(),h({id:K,logging:X}),function(){function e(e){he=e?.onMessage||he,ye=e?.onReady||ye,"number"==typeof e?.offset&&(w("<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</>."),D&&(P=e?.offset),W&&(A=e?.offset)),"number"==typeof e?.offsetSize&&(D&&(P=e?.offsetSize),W&&(A=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(re=e.sizeSelector),se=e?.targetOrigin||se,H=e?.heightCalculationMethod||H,fe=e?.widthCalculationMethod||fe}function t(e,t){return"function"==typeof e&&(s[t]=e,e="custom"),e}if(1===Y)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),H=t(H,"height"),fe=t(fe,"width"))}(),function(){try{ie="iframeParentListener"in window.parent}catch(e){}}(),Y<0?z(`${c(Y+2)}${c(2)}`):ue.codePointAt(0)>4||Y<2&&z(c(3)),ue&&""!==ue&&"false"!==ue?ue!==e&&w(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ue} - Child page: ${e}.\n`):w("<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"),Te(),Me(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&w("<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</>.")}(),ze(),D!==W&&(ee=S({onChange:we,root:document.documentElement,side:D?i:r})),1!==Y&&(pe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===R?(R=!0,Ue("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===R&&(R=!1),He(0,0,"autoResize",JSON.stringify(R)),R),close(){He(0,0,"close")},getId:()=>K,getOrigin:()=>N,getPageInfo(e){if("function"==typeof e)return ge=e,He(0,0,"pageInfo"),void w("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ge=null,He(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return be=e,He(0,0,"parentInfo"),()=>{be=null,He(0,0,"parentInfoStop")}},getParentProperties(e){w("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){Q.findTarget(e)},reset(){Je()},scrollBy(e,t){He(t,e,"scrollBy")},scrollTo(e,t){He(t,e,"scrollTo")},scrollToOffset(e,t){He(t,e,"scrollToOffset")},sendMessage(e,t){He(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){H=e,Te()},setWidthCalculationMethod(e){fe=e,Me()},setTargetOrigin(e){se=e},resize(e,t){Ue(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){w("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),pe.parentIFrame=pe.parentIframe),function(){function e(e){He(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){l(window.document,t,e)}!0===G&&(t("mouseenter"),t("mouseleave"))}(),Q=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);He(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?He(0,0,"inPageLink",`#${o}`):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,f)}function c(){r(),a(),s()}return Q.enable&&(1===Y?w("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):c()),{findTarget:o}}(),Se(ke(document)()),void 0===L&&(L=`${q}px`),Ee("margin",(d="margin",(u=L).includes("-")&&(v(`Negative CSS value ignored for ${d}`),u=""),u)),Ee("background",x),Ee("padding",B),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),je(),Ue("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&He(0,0,"title",document.title),$e({method:o="add",eventType:"After Print",eventName:"afterprint"}),$e({method:o,eventType:"Before Print",eventName:"beforeprint"}),$e({method:o,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function c(){const d=performance.now(),u=d-n;if(u>r*s+++a&&u<l)return setTimeout(c,r*s),void(n=d);s=1,o.forEach(i),o=[],0!==e.size?(je(),ze(),Se(e),e.forEach(Ae),e.clear(),t=!1):t=!1}function d(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(c))}function u(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}u()}(),oe=new ResizeObserver(Oe),oe.observe(document.body),Pe.add(document.body),Ae(document.body),setTimeout(ye)}function we(e){te=e,F=te.length>0,Ue("overflowChanged","Overflow updated")}function ze(){ae=document.querySelectorAll(`[${n}]`),V=ae.length>0}function Se(e){V||ee(e)}function Ee(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function je(){if(""!==re)for(const e of document.querySelectorAll(re))e.dataset.iframeSize=!0}function $e(e){({add(t){function n(){Ue(e.eventName,e.eventType)}p[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=p[e];var n,o;delete p[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ce(e,t,n,o){return t!==e&&(e in n||(v(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in u&&w(`<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 remove this option.`)),e}function Te(){H=Ce(H,b,Le,"height")}function Me(){fe=Ce(fe,M,Be,"width")}function Oe(e){Array.isArray(e)&&0!==e.length&&Ue("resizeObserver",`Resize Observed: ${function(e){switch(!0){case!y(e):return"";case y(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case y(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(y(e.className)?`.${e.className}`:"")}}(e[0].target)}`)}const Pe=new WeakSet;function Ae(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Pe.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(oe.observe(e),Pe.add(e))}const t=ke(e)();for(const e of t){if(Pe.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(oe.observe(e),Pe.add(e))}}function Ne(e){performance.mark(E);const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let i=0,r=document.documentElement,a=V?0:document.documentElement.getBoundingClientRect().bottom;performance.mark(E);const l=V?ae:F?te:ke(document)();let s=l.length;for(const t of l)V||!g||t.checkVisibility(o)?(i=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),i>a&&(a=i,r=t)):s-=1;return O=r,performance.mark(j,{detail:{Side:t,len:s,hasTags:V,logging:X}}),a}const Ie=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],ke=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Re={height:0,width:0},xe={height:0,width:0};function qe(e){function t(){return xe[o]=i,Re[o]=l,i}const n=e===Le,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return l;case V:return e.taggedElement();case!F&&0===xe[o]&&0===Re[o]:return t();case de&&i===xe[o]&&l===Re[o]:return Math.max(i,l);case 0===i:return l;case!F&&i!==xe[o]&&l<=Re[o]:return t();case!n:return e.taggedElement();case!F&&i<xe[o]:case l===a||l===r:case i>l:return t()}return Math.max(e.taggedElement(),t())}const Le={enabled:()=>D,getOffset:()=>P,auto:()=>qe(Le),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Le.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Ie(Le)),min:()=>Math.min(...Ie(Le)),grow:()=>Le.max(),lowestElement:()=>Ne(i),taggedElement:()=>Ne(i)},Be={enabled:()=>W,getOffset:()=>A,auto:()=>qe(Be),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Ie(Be)),min:()=>Math.min(...Ie(Be)),rightMostElement:()=>Ne(r),scroll:()=>Math.max(Be.bodyScroll(),Be.documentElementScroll()),taggedElement:()=>Ne(r)},De=(e,t)=>!(Math.abs(e-t)<=ce);let We=!1;function Ue(e,t,n,o,i){k=performance.now(),(R||e===a)&&(document.hidden||(We||(I=!0,function(e,t,n,o,i){const r=void 0===n?Le[H]():n,l=void 0===o?Be[fe]():o;D&&De(J,r)||W&&De(me,l)||"init"===e?(Fe(),J=r,me=l,He(J,me,e,i)):!e!==a&&(D&&H in T||W&&fe in T)?Je():I=!1}(e,0,n,o,i),requestAnimationFrame((()=>{We=!1}))),We=!0))}function Fe(){de||(de=!0,requestAnimationFrame((()=>{de=!1})))}function Ve(e){J=Le[H](),me=Be[fe](),He(J,me,e)}function Je(e){const t=H;H=b,Fe(),Ve("reset"),H=t}function He(e,t,n,o,i){Y<-1||(void 0!==i||(i=se),function(){const r=`${K}:${e+(P||0)}:${t+(A||0)}:${n}${void 0===o?"":`:${o}`}`;X&&(console.group(`[iframe-resizer][${K}]`),console.info("Sending message to host page via "+(ie?"sameDomain":"postMessage")),console.info(`%c${r}`,"font-style: italic"),I&&console.info(function(){const e=m(performance.now()-k);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),console.groupEnd()),I=!1,ie?window.parent.iframeParentListener($+r):le.postMessage($+r,i)}())}function Ze(e){const t={init:function(){_=e.data,le=e.source,N=e.origin,ve(),U=!1,setTimeout((()=>{Z=!1}),f)},reset(){Z||Ve("resetPage")},resize(){Ue(a)},moveToAnchor(){Q.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ge?setTimeout((()=>ge(JSON.parse(e)))):He(0,0,"pageInfoStop")},parentInfo(){const e=o();be?setTimeout(be(Object.freeze(JSON.parse(e)))):He(0,0,"parentInfoStop")},message(){const e=o();he(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};$===`${e.data}`.slice(0,C)&&(!1!==U?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||v(`Unexpected message (${e.data})`)}())}function _e(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?v("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Ze({data:e,sameDomain:!0}))),l(window,"message",Ze),l(window,"readystatechange",_e),_e())}()}();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (child) 5.3.
|
|
4
|
+
* @module iframe-resizer/legacy (child) 5.3.2 (iife)
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(){"use strict";const e="5.3.1",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<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</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>e,u=1e5,m=e=>Math.round(e*u)/u;let f="",p=!1;const h=e=>{f=e.id,p=e.logging},y=e=>""!=`${e}`&&void 0!==e;const g=(...e)=>[`[iframe-resizer][${f||"child"}]`,...e].join(" "),b=(...e)=>p&&console?.info(`%c[iframe-resizer][${f}]%c`,"font-weight: bold;","font-weight: normal;",...e),v=(...e)=>console?.warn(g(...e)),w=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(g)(...e)),z=e=>w(e),S=e=>{const t=e.side||i,n=e.onChange||d,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},E="--ifr-start",j="--ifr-end",$="--ifr-measure",C=[],T=new WeakSet,M=e=>"object"==typeof e&&T.add(e);let P=null,A={};const O=setInterval((()=>{if(C.length<10)return;if(A.hasTags&&A.len<25)return;C.sort();const e=Math.min(C.reduce(((e,t)=>e+t),0)/C.length,C[Math.floor(C.length/2)]);e<=4||(clearInterval(O),w(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${A.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function N(e){e.getEntries().forEach((e=>{if(e.name===j){const{duration:t}=performance.measure($,E,j);!function(e,t){const{Side:n,len:o,hasTags:i,logging:r}=e;A=e,T.has(P)||i&&o<=1||(r||M(P),b(`\n ${n} position calculated from:`,P,`\n Parsed ${o} ${i?"tagged":"potentially overflowing"} elements in ${m(t)}ms`))}(e.detail,t),C.push(t),C.length>100&&C.shift()}}))}function I(){new PerformanceObserver(N).observe({entryTypes:["mark"]}),M(document.documentElement),M(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",I):I()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>(v("Custom height calculation function not defined"),qe.auto()),width:()=>(v("Custom width calculation function not defined"),Le.auto())},u={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},f=128,p={},g="checkVisibility"in window,b="auto",$="[iFrameSizer]",C=$.length,T={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="scroll";let A,O,N,I,k=!0,R="",x=0,q="",L="",B=!0,D=!1,W=!0,U=!1,F=!1,V=1,J=b,H=!0,Z="",_={},Q=!1,X=0,Y=!1,G="",K=d,ee=[],te="child",ne=null,oe=!1,ie="",re=[],ae=window.parent,le="*",se=0,ce=!1,de="",ue=1,me=M,fe=window,pe=()=>{v("onMessage function not defined")},he=()=>{},ye=null,ge=null;function be(){var o,d,u;!function(){const e=e=>"true"===e,t=Z.slice(C).split(":");G=t[0],x=void 0===t[1]?x:Number(t[1]),D=void 0===t[2]?D:e(t[2]),Q=void 0===t[3]?Q:e(t[3]),k=void 0===t[6]?k:e(t[6]),q=t[7],J=void 0===t[8]?J:t[8],R=t[9],L=t[10],se=void 0===t[11]?se:Number(t[11]),_.enable=void 0!==t[12]&&e(t[12]),te=void 0===t[13]?te:t[13],me=void 0===t[14]?me:t[14],Y=void 0===t[15]?Y:e(t[15]),A=void 0===t[16]?A:Number(t[16]),O=void 0===t[17]?O:Number(t[17]),B=void 0===t[18]?B:e(t[18]),t[19],de=t[20]||de,X=void 0===t[21]?X:Number(t[21])}(),h({id:G,logging:Q}),function(){function e(e){pe=e?.onMessage||pe,he=e?.onReady||he,"number"==typeof e?.offset&&(w("<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</>."),B&&(A=e?.offset),D&&(O=e?.offset)),"number"==typeof e?.offsetSize&&(B&&(A=e?.offsetSize),D&&(O=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(ie=e.sizeSelector),le=e?.targetOrigin||le,J=e?.heightCalculationMethod||J,me=e?.widthCalculationMethod||me}function t(e,t){return"function"==typeof e&&(s[t]=e,e="custom"),e}if(1===X)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),J=t(J,"height"),me=t(me,"width"))}(),function(){try{oe="iframeParentListener"in window.parent}catch(e){}}(),X<0?z(`${c(X+2)}${c(2)}`):de.codePointAt(0)>4||X<2&&z(c(3)),de&&""!==de&&"false"!==de?de!==e&&w(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${de} - Child page: ${e}.\n`):w("<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"),Ce(),Te(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&w("<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</>.")}(),we(),B!==D&&(K=S({onChange:ve,root:document.documentElement,side:B?i:r})),1!==X&&(fe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===k?(k=!0,We("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===k&&(k=!1),Je(0,0,"autoResize",JSON.stringify(k)),k),close(){Je(0,0,"close")},getId:()=>G,getPageInfo(e){if("function"==typeof e)return ye=e,Je(0,0,"pageInfo"),void w("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ye=null,Je(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return ge=e,Je(0,0,"parentInfo"),()=>{ge=null,Je(0,0,"parentInfoStop")}},getParentProperties(e){w("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){_.findTarget(e)},reset(){Ve()},scrollBy(e,t){Je(t,e,"scrollBy")},scrollTo(e,t){Je(t,e,"scrollTo")},scrollToOffset(e,t){Je(t,e,"scrollToOffset")},sendMessage(e,t){Je(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){J=e,Ce()},setWidthCalculationMethod(e){me=e,Te()},setTargetOrigin(e){le=e},resize(e,t){We(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){w("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),fe.parentIFrame=fe.parentIframe),function(){function e(e){Je(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){l(window.document,t,e)}!0===Y&&(t("mouseenter"),t("mouseleave"))}(),_=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);Je(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?Je(0,0,"inPageLink",`#${o}`):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,f)}function c(){r(),a(),s()}return _.enable&&(1===X?w("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):c()),{findTarget:o}}(),ze(Ie(document)()),void 0===q&&(q=`${x}px`),Se("margin",(d="margin",(u=q).includes("-")&&(v(`Negative CSS value ignored for ${d}`),u=""),u)),Se("background",R),Se("padding",L),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),Ee(),We("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&Je(0,0,"title",document.title),je({method:o="add",eventType:"After Print",eventName:"afterprint"}),je({method:o,eventType:"Before Print",eventName:"beforeprint"}),je({method:o,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function c(){const d=performance.now(),u=d-n;if(u>r*s+++a&&u<l)return setTimeout(c,r*s),void(n=d);s=1,o.forEach(i),o=[],0!==e.size?(Ee(),we(),ze(e),e.forEach(Ae),e.clear(),t=!1):t=!1}function d(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(c))}function u(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}u()}(),ne=new ResizeObserver(Me),ne.observe(document.body),Pe.add(document.body),Ae(document.body),setTimeout(he)}function ve(e){ee=e,U=ee.length>0,We("overflowChanged","Overflow updated")}function we(){re=document.querySelectorAll(`[${n}]`),F=re.length>0}function ze(e){F||K(e)}function Se(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function Ee(){if(""!==ie)for(const e of document.querySelectorAll(ie))e.dataset.iframeSize=!0}function je(e){({add(t){function n(){We(e.eventName,e.eventType)}p[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=p[e];var n,o;delete p[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function $e(e,t,n,o){return t!==e&&(e in n||(v(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in u&&w(`<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 remove this option.`)),e}function Ce(){J=$e(J,b,qe,"height")}function Te(){me=$e(me,M,Le,"width")}function Me(e){Array.isArray(e)&&0!==e.length&&We("resizeObserver",`Resize Observed: ${function(e){switch(!0){case!y(e):return"";case y(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case y(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(y(e.className)?`.${e.className}`:"")}}(e[0].target)}`)}const Pe=new WeakSet;function Ae(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Pe.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ne.observe(e),Pe.add(e))}const t=Ie(e)();for(const e of t){if(Pe.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(ne.observe(e),Pe.add(e))}}function Oe(e){performance.mark(E);const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let i=0,r=document.documentElement,a=F?0:document.documentElement.getBoundingClientRect().bottom;performance.mark(E);const l=F?re:U?ee:Ie(document)();let s=l.length;for(const t of l)F||!g||t.checkVisibility(o)?(i=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),i>a&&(a=i,r=t)):s-=1;return P=r,performance.mark(j,{detail:{Side:t,len:s,hasTags:F,logging:Q}}),a}const Ne=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],Ie=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),ke={height:0,width:0},Re={height:0,width:0};function xe(e){function t(){return Re[o]=i,ke[o]=l,i}const n=e===qe,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return l;case F:return e.taggedElement();case!U&&0===Re[o]&&0===ke[o]:return t();case ce&&i===Re[o]&&l===ke[o]:return Math.max(i,l);case 0===i:return l;case!U&&i!==Re[o]&&l<=ke[o]:return t();case!n:return e.taggedElement();case!U&&i<Re[o]:case l===a||l===r:case i>l:return t()}return Math.max(e.taggedElement(),t())}const qe={enabled:()=>B,getOffset:()=>A,auto:()=>xe(qe),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>qe.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Ne(qe)),min:()=>Math.min(...Ne(qe)),grow:()=>qe.max(),lowestElement:()=>Oe(i),taggedElement:()=>Oe(i)},Le={enabled:()=>D,getOffset:()=>O,auto:()=>xe(Le),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Ne(Le)),min:()=>Math.min(...Ne(Le)),rightMostElement:()=>Oe(r),scroll:()=>Math.max(Le.bodyScroll(),Le.documentElementScroll()),taggedElement:()=>Oe(r)},Be=(e,t)=>!(Math.abs(e-t)<=se);let De=!1;function We(e,t,n,o,i){I=performance.now(),(k||e===a)&&(document.hidden||(De||(N=!0,function(e,t,n,o,i){const r=void 0===n?qe[J]():n,l=void 0===o?Le[me]():o;B&&Be(V,r)||D&&Be(ue,l)||"init"===e?(Ue(),V=r,ue=l,Je(V,ue,e,i)):!e!==a&&(B&&J in T||D&&me in T)?Ve():N=!1}(e,0,n,o,i),requestAnimationFrame((()=>{De=!1}))),De=!0))}function Ue(){ce||(ce=!0,requestAnimationFrame((()=>{ce=!1})))}function Fe(e){V=qe[J](),ue=Le[me](),Je(V,ue,e)}function Ve(e){const t=J;J=b,Ue(),Fe("reset"),J=t}function Je(e,t,n,o,i){X<-1||(void 0!==i||(i=le),function(){const r=`${G}:${e+(A||0)}:${t+(O||0)}:${n}${void 0===o?"":`:${o}`}`;Q&&(console.group(`[iframe-resizer][${G}]`),console.info("Sending message to host page via "+(oe?"sameDomain":"postMessage")),console.info(`%c${r}`,"font-style: italic"),N&&console.info(function(){const e=m(performance.now()-I);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),console.groupEnd()),N=!1,oe?window.parent.iframeParentListener($+r):ae.postMessage($+r,i)}())}function He(e){const t={init:function(){Z=e.data,ae=e.source,be(),W=!1,setTimeout((()=>{H=!1}),f)},reset(){H||Fe("resetPage")},resize(){We(a)},moveToAnchor(){_.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ye?setTimeout((()=>ye(JSON.parse(e)))):Je(0,0,"pageInfoStop")},parentInfo(){const e=o();ge?setTimeout(ge(Object.freeze(JSON.parse(e)))):Je(0,0,"parentInfoStop")},message(){const e=o();pe(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};$===`${e.data}`.slice(0,C)&&(!1!==W?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||v(`Unexpected message (${e.data})`)}())}function Ze(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?v("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>He({data:e,sameDomain:!0}))),l(window,"message",He),l(window,"readystatechange",Ze),Ze())}()}();
|
|
20
|
+
!function(){"use strict";const e="5.3.2",t=10,n="data-iframe-size",o="data-overflowed",i="bottom",r="right",a="resizeParent",l=(e,t,n,o)=>e.addEventListener(t,n,o||!1),s=["<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</>."];Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)])));const c=e=>(e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))))(s[e]),d=e=>e,u=1e5,m=e=>Math.round(e*u)/u;let f="",p=!1;const h=e=>{f=e.id,p=e.logging},y=e=>""!=`${e}`&&void 0!==e;const g=(...e)=>[`[iframe-resizer][${f||"child"}]`,...e].join(" "),b=(...e)=>p&&console?.info(`%c[iframe-resizer][${f}]%c`,"font-weight: bold;","font-weight: normal;",...e),v=(...e)=>console?.warn(g(...e)),w=(...e)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))(g)(...e)),z=e=>w(e),S=e=>{const t=e.side||i,n=e.onChange||d,r={root:e.root,rootMargin:"0px",threshold:1};function a(){const e=document.querySelectorAll(`[${o}]`);n(e)}const l=new IntersectionObserver((function(e){for(const n of e){const{boundingClientRect:e,rootBounds:i,target:r}=n,a=e[t],l=0===a||a>i[t];r.toggleAttribute(o,l)}requestAnimationFrame(a)}),r),s=new WeakSet;return function(e){for(const t of e)t.nodeType!==Node.ELEMENT_NODE||s.has(t)||(l.observe(t),s.add(t))}},E="--ifr-start",j="--ifr-end",$="--ifr-measure",C=[],T=new WeakSet,M=e=>"object"==typeof e&&T.add(e);let O=null,P={};const A=setInterval((()=>{if(C.length<10)return;if(P.hasTags&&P.len<25)return;C.sort();const e=Math.min(C.reduce(((e,t)=>e+t),0)/C.length,C[Math.floor(C.length/2)]);e<=4||(clearInterval(A),w(`<rb>Performance Warning</>\n\nCalculating the page size is taking an excessive amount of time (${m(e)}ms).\n\nTo improve performance add the <b>data-iframe-size</> attribute to the ${P.Side.toLowerCase()} most element on the page. For more details see: <u>https://iframe-resizer.com/perf</>.`))}),5e3);function N(e){e.getEntries().forEach((e=>{if(e.name===j){const{duration:t}=performance.measure($,E,j);!function(e,t){const{Side:n,len:o,hasTags:i,logging:r}=e;P=e,T.has(O)||i&&o<=1||(r||M(O),b(`\n ${n} position calculated from:`,O,`\n Parsed ${o} ${i?"tagged":"potentially overflowing"} elements in ${m(t)}ms`))}(e.detail,t),C.push(t),C.length>100&&C.shift()}}))}function I(){new PerformanceObserver(N).observe({entryTypes:["mark"]}),M(document.documentElement),M(document.body)}"undefined"!=typeof document&&"undefined"!=typeof PerformanceObserver&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",I):I()),"undefined"!=typeof window&&function(){const o={contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0},s={height:()=>(v("Custom height calculation function not defined"),Le.auto()),width:()=>(v("Custom width calculation function not defined"),Be.auto())},u={bodyOffset:1,bodyScroll:1,offset:1,documentElementOffset:1,documentElementScroll:1,boundingClientRect:1,max:1,min:1,grow:1,lowestElement:1},f=128,p={},g="checkVisibility"in window,b="auto",$="[iFrameSizer]",C=$.length,T={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="scroll";let P,A,N,I,k,R=!0,x="",q=0,L="",B="",D=!0,W=!1,U=!0,F=!1,V=!1,J=1,H=b,Z=!0,_="",Q={},X=!1,Y=0,G=!1,K="",ee=d,te=[],ne="child",oe=null,ie=!1,re="",ae=[],le=window.parent,se="*",ce=0,de=!1,ue="",me=1,fe=M,pe=window,he=()=>{v("onMessage function not defined")},ye=()=>{},ge=null,be=null;function ve(){var o,d,u;!function(){const e=e=>"true"===e,t=_.slice(C).split(":");K=t[0],q=void 0===t[1]?q:Number(t[1]),W=void 0===t[2]?W:e(t[2]),X=void 0===t[3]?X:e(t[3]),R=void 0===t[6]?R:e(t[6]),L=t[7],H=void 0===t[8]?H:t[8],x=t[9],B=t[10],ce=void 0===t[11]?ce:Number(t[11]),Q.enable=void 0!==t[12]&&e(t[12]),ne=void 0===t[13]?ne:t[13],fe=void 0===t[14]?fe:t[14],G=void 0===t[15]?G:e(t[15]),P=void 0===t[16]?P:Number(t[16]),A=void 0===t[17]?A:Number(t[17]),D=void 0===t[18]?D:e(t[18]),t[19],ue=t[20]||ue,Y=void 0===t[21]?Y:Number(t[21])}(),h({id:K,logging:X}),function(){function e(e){he=e?.onMessage||he,ye=e?.onReady||ye,"number"==typeof e?.offset&&(w("<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</>."),D&&(P=e?.offset),W&&(A=e?.offset)),"number"==typeof e?.offsetSize&&(D&&(P=e?.offsetSize),W&&(A=e?.offsetSize)),Object.prototype.hasOwnProperty.call(e,"sizeSelector")&&(re=e.sizeSelector),se=e?.targetOrigin||se,H=e?.heightCalculationMethod||H,fe=e?.widthCalculationMethod||fe}function t(e,t){return"function"==typeof e&&(s[t]=e,e="custom"),e}if(1===Y)return;const n=window.iframeResizer||window.iFrameResizer;"object"==typeof n&&(e(n),H=t(H,"height"),fe=t(fe,"width"))}(),function(){try{ie="iframeParentListener"in window.parent}catch(e){}}(),Y<0?z(`${c(Y+2)}${c(2)}`):ue.codePointAt(0)>4||Y<2&&z(c(3)),ue&&""!==ue&&"false"!==ue?ue!==e&&w(`<b>Version mismatch</>\n\nThe parent and child pages are running different versions of <i>iframe resizer</>.\n\nParent page: ${ue} - Child page: ${e}.\n`):w("<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"),Te(),Me(),function(){let e=!1;const t=t=>document.querySelectorAll(`[${t}]`).forEach((o=>{e=!0,o.removeAttribute(t),o.toggleAttribute(n,!0)}));t("data-iframe-height"),t("data-iframe-width"),e&&w("<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</>.")}(),ze(),D!==W&&(ee=S({onChange:we,root:document.documentElement,side:D?i:r})),1!==Y&&(pe.parentIframe=Object.freeze({autoResize:e=>(!0===e&&!1===R?(R=!0,Ue("autoResizeEnabled","Auto Resize enabled")):!1===e&&!0===R&&(R=!1),He(0,0,"autoResize",JSON.stringify(R)),R),close(){He(0,0,"close")},getId:()=>K,getOrigin:()=>N,getPageInfo(e){if("function"==typeof e)return ge=e,He(0,0,"pageInfo"),void w("<rb>Deprecated Method</>\n \nThe <b>getPageInfo()</> method has been deprecated and replaced with <b>getParentProps()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n");ge=null,He(0,0,"pageInfoStop")},getParentProps(e){if("function"!=typeof e)throw new TypeError("parentIframe.getParentProps(callback) callback not a function");return be=e,He(0,0,"parentInfo"),()=>{be=null,He(0,0,"parentInfoStop")}},getParentProperties(e){w("<rb>Renamed Method</>\n \nThe <b>getParentProperties()</> method has been renamed <b>getParentProps()</>. Use of the old name will be removed in a future version of <i>iframe-resizer</>.\n"),this.getParentProps(e)},moveToAnchor(e){Q.findTarget(e)},reset(){Je()},scrollBy(e,t){He(t,e,"scrollBy")},scrollTo(e,t){He(t,e,"scrollTo")},scrollToOffset(e,t){He(t,e,"scrollToOffset")},sendMessage(e,t){He(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod(e){H=e,Te()},setWidthCalculationMethod(e){fe=e,Me()},setTargetOrigin(e){se=e},resize(e,t){Ue(a,`parentIframe.resize(${e||""}${t?`,${t}`:""})`,e,t)},size(e,t){w("<rb>Deprecated Method</>\n \nThe <b>size()</> method has been deprecated and replaced with <b>resize()</>. Use of this method will be removed in a future version of <i>iframe-resizer</>.\n"),this.resize(e,t)}}),pe.parentIFrame=pe.parentIframe),function(){function e(e){He(0,0,e.type,`${e.screenY}:${e.screenX}`)}function t(t,n){l(window.document,t,e)}!0===G&&(t("mouseenter"),t("mouseleave"))}(),Q=function(){const e=()=>({x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop});function n(n){const o=n.getBoundingClientRect(),i=e();return{x:parseInt(o.left,t)+parseInt(i.x,t),y:parseInt(o.top,t)+parseInt(i.y,t)}}function o(e){function t(e){const t=n(e);He(t.y,t.x,"scrollToOffset")}const o=e.split("#")[1]||e,i=decodeURIComponent(o),r=document.getElementById(i)||document.getElementsByName(i)[0];void 0===r?He(0,0,"inPageLink",`#${o}`):t(r)}function i(){const{hash:e,href:t}=window.location;""!==e&&"#"!==e&&o(t)}function r(){for(const e of document.querySelectorAll('a[href^="#"]'))"#"!==e.getAttribute("href")&&l(e,"click",(t=>{t.preventDefault(),o(e.getAttribute("href"))}))}function a(){l(window,"hashchange",i)}function s(){setTimeout(i,f)}function c(){r(),a(),s()}return Q.enable&&(1===Y?w("In page linking requires a Professional or Business license. Please see https://iframe-resizer.com/pricing for more details."):c()),{findTarget:o}}(),Se(ke(document)()),void 0===L&&(L=`${q}px`),Ee("margin",(d="margin",(u=L).includes("-")&&(v(`Negative CSS value ignored for ${d}`),u=""),u)),Ee("background",x),Ee("padding",B),function(){const e=document.createElement("div");e.style.clear="both",e.style.display="block",e.style.height="0",document.body.append(e)}(),function(){const e=e=>e.style.setProperty("height","auto","important");e(document.documentElement),e(document.body)}(),je(),Ue("init","Init message from host page",void 0,void 0,e),document.title&&""!==document.title&&He(0,0,"title",document.title),$e({method:o="add",eventType:"After Print",eventName:"afterprint"}),$e({method:o,eventType:"Before Print",eventName:"beforeprint"}),$e({method:o,eventType:"Ready State Change",eventName:"readystatechange"}),function(){const e=new Set;let t=!1,n=0,o=[];const i=t=>{for(const n of t){const{addedNodes:t,removedNodes:o}=n;for(const n of t)e.add(n);for(const t of o)e.delete(t)}},r=16,a=2,l=200;let s=1;function c(){const d=performance.now(),u=d-n;if(u>r*s+++a&&u<l)return setTimeout(c,r*s),void(n=d);s=1,o.forEach(i),o=[],0!==e.size?(je(),ze(),Se(e),e.forEach(Ae),e.clear(),t=!1):t=!1}function d(e){o.push(e),t||(n=performance.now(),t=!0,requestAnimationFrame(c))}function u(){const e=new window.MutationObserver(d),t=document.querySelector("body"),n={attributes:!1,attributeOldValue:!1,characterData:!1,characterDataOldValue:!1,childList:!0,subtree:!0};return e.observe(t,n),e}u()}(),oe=new ResizeObserver(Oe),oe.observe(document.body),Pe.add(document.body),Ae(document.body),setTimeout(ye)}function we(e){te=e,F=te.length>0,Ue("overflowChanged","Overflow updated")}function ze(){ae=document.querySelectorAll(`[${n}]`),V=ae.length>0}function Se(e){V||ee(e)}function Ee(e,t){void 0!==t&&""!==t&&"null"!==t&&document.body.style.setProperty(e,t)}function je(){if(""!==re)for(const e of document.querySelectorAll(re))e.dataset.iframeSize=!0}function $e(e){({add(t){function n(){Ue(e.eventName,e.eventType)}p[t]=n,l(window,t,n,{passive:!0})},remove(e){const t=p[e];var n,o;delete p[e],n=e,o=t,window.removeEventListener(n,o,!1)}})[e.method](e.eventName)}function Ce(e,t,n,o){return t!==e&&(e in n||(v(`${e} is not a valid option for ${o}CalculationMethod.`),e=t),e in u&&w(`<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 remove this option.`)),e}function Te(){H=Ce(H,b,Le,"height")}function Me(){fe=Ce(fe,M,Be,"width")}function Oe(e){Array.isArray(e)&&0!==e.length&&Ue("resizeObserver",`Resize Observed: ${function(e){switch(!0){case!y(e):return"";case y(e.id):return`${e.nodeName.toUpperCase()}#${e.id}`;case y(e.name):return`${e.nodeName.toUpperCase()} (${e.name})`;default:return e.nodeName.toUpperCase()+(y(e.className)?`.${e.className}`:"")}}(e[0].target)}`)}const Pe=new WeakSet;function Ae(e){if(e.nodeType!==Node.ELEMENT_NODE)return;if(!Pe.has(e)){const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(oe.observe(e),Pe.add(e))}const t=ke(e)();for(const e of t){if(Pe.has(e)||e?.nodeType!==Node.ELEMENT_NODE)continue;const t=getComputedStyle(e)?.position;""!==t&&"static"!==t&&(oe.observe(e),Pe.add(e))}}function Ne(e){performance.mark(E);const t=(n=e).charAt(0).toUpperCase()+n.slice(1);var n;let i=0,r=document.documentElement,a=V?0:document.documentElement.getBoundingClientRect().bottom;performance.mark(E);const l=V?ae:F?te:ke(document)();let s=l.length;for(const t of l)V||!g||t.checkVisibility(o)?(i=t.getBoundingClientRect()[e]+parseFloat(getComputedStyle(t).getPropertyValue(`margin-${e}`)),i>a&&(a=i,r=t)):s-=1;return O=r,performance.mark(j,{detail:{Side:t,len:s,hasTags:V,logging:X}}),a}const Ie=e=>[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll(),e.boundingClientRect()],ke=e=>()=>e.querySelectorAll("* :not(head):not(meta):not(base):not(title):not(script):not(link):not(style):not(map):not(area):not(option):not(optgroup):not(template):not(track):not(wbr):not(nobr)"),Re={height:0,width:0},xe={height:0,width:0};function qe(e){function t(){return xe[o]=i,Re[o]=l,i}const n=e===Le,o=n?"height":"width",i=e.boundingClientRect(),r=Math.ceil(i),a=Math.floor(i),l=(e=>e.documentElementScroll()+Math.max(0,e.getOffset()))(e);switch(!0){case!e.enabled():return l;case V:return e.taggedElement();case!F&&0===xe[o]&&0===Re[o]:return t();case de&&i===xe[o]&&l===Re[o]:return Math.max(i,l);case 0===i:return l;case!F&&i!==xe[o]&&l<=Re[o]:return t();case!n:return e.taggedElement();case!F&&i<xe[o]:case l===a||l===r:case i>l:return t()}return Math.max(e.taggedElement(),t())}const Le={enabled:()=>D,getOffset:()=>P,auto:()=>qe(Le),bodyOffset:()=>{const{body:e}=document,n=getComputedStyle(e);return e.offsetHeight+parseInt(n.marginTop,t)+parseInt(n.marginBottom,t)},bodyScroll:()=>document.body.scrollHeight,offset:()=>Le.bodyOffset(),custom:()=>s.height(),documentElementOffset:()=>document.documentElement.offsetHeight,documentElementScroll:()=>document.documentElement.scrollHeight,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().bottom,document.body.getBoundingClientRect().bottom),max:()=>Math.max(...Ie(Le)),min:()=>Math.min(...Ie(Le)),grow:()=>Le.max(),lowestElement:()=>Ne(i),taggedElement:()=>Ne(i)},Be={enabled:()=>W,getOffset:()=>A,auto:()=>qe(Be),bodyScroll:()=>document.body.scrollWidth,bodyOffset:()=>document.body.offsetWidth,custom:()=>s.width(),documentElementScroll:()=>document.documentElement.scrollWidth,documentElementOffset:()=>document.documentElement.offsetWidth,boundingClientRect:()=>Math.max(document.documentElement.getBoundingClientRect().right,document.body.getBoundingClientRect().right),max:()=>Math.max(...Ie(Be)),min:()=>Math.min(...Ie(Be)),rightMostElement:()=>Ne(r),scroll:()=>Math.max(Be.bodyScroll(),Be.documentElementScroll()),taggedElement:()=>Ne(r)},De=(e,t)=>!(Math.abs(e-t)<=ce);let We=!1;function Ue(e,t,n,o,i){k=performance.now(),(R||e===a)&&(document.hidden||(We||(I=!0,function(e,t,n,o,i){const r=void 0===n?Le[H]():n,l=void 0===o?Be[fe]():o;D&&De(J,r)||W&&De(me,l)||"init"===e?(Fe(),J=r,me=l,He(J,me,e,i)):!e!==a&&(D&&H in T||W&&fe in T)?Je():I=!1}(e,0,n,o,i),requestAnimationFrame((()=>{We=!1}))),We=!0))}function Fe(){de||(de=!0,requestAnimationFrame((()=>{de=!1})))}function Ve(e){J=Le[H](),me=Be[fe](),He(J,me,e)}function Je(e){const t=H;H=b,Fe(),Ve("reset"),H=t}function He(e,t,n,o,i){Y<-1||(void 0!==i||(i=se),function(){const r=`${K}:${e+(P||0)}:${t+(A||0)}:${n}${void 0===o?"":`:${o}`}`;X&&(console.group(`[iframe-resizer][${K}]`),console.info("Sending message to host page via "+(ie?"sameDomain":"postMessage")),console.info(`%c${r}`,"font-style: italic"),I&&console.info(function(){const e=m(performance.now()-k);return"init"===n?`Initialised iFrame in %c${e}ms`:`Content size recalculated in %c${e}ms`}(),"font-weight:bold;color:#777"),console.groupEnd()),I=!1,ie?window.parent.iframeParentListener($+r):le.postMessage($+r,i)}())}function Ze(e){const t={init:function(){_=e.data,le=e.source,N=e.origin,ve(),U=!1,setTimeout((()=>{Z=!1}),f)},reset(){Z||Ve("resetPage")},resize(){Ue(a)},moveToAnchor(){Q.findTarget(o())},inPageLink(){this.moveToAnchor()},pageInfo(){const e=o();ge?setTimeout((()=>ge(JSON.parse(e)))):He(0,0,"pageInfoStop")},parentInfo(){const e=o();be?setTimeout(be(Object.freeze(JSON.parse(e)))):He(0,0,"parentInfoStop")},message(){const e=o();he(JSON.parse(e))}},n=()=>e.data.split("]")[1].split(":")[0],o=()=>e.data.slice(e.data.indexOf(":")+1),i=()=>"iframeResize"in window||void 0!==window.jQuery&&""in window.jQuery.prototype,r=()=>e.data.split(":")[2]in{true:1,false:1};$===`${e.data}`.slice(0,C)&&(!1!==U?r()&&t.init():function(){const o=n();o in t?t[o]():i()||r()||v(`Unexpected message (${e.data})`)}())}function _e(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}"iframeChildListener"in window?v("Already setup"):(window.iframeChildListener=e=>setTimeout((()=>Ze({data:e,sameDomain:!0}))),l(window,"message",Ze),l(window,"readystatechange",_e),_e())}()}();
|
package/js/iframeResizer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (parent) 5.3.
|
|
4
|
+
* @module iframe-resizer/legacy (parent) 5.3.2 (umd) - 2024-10-22
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="[iframe-resizer]";const t=t=>`${e}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(t)}]`,i=(e,...i)=>((e,i,...n)=>window?.console[e](t(i),...n))("warn",e,...i),n=(t,i)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((t=>(...i)=>[`${e}[${t}]`,...i].join(" "))(t))(i)),o="5.3.1",r="[iFrameSizer]",a=r.length,s=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),l=(e,t,i,n)=>e.addEventListener(t,i,n||!1),c=(e,t,i)=>e.removeEventListener(t,i,!1),d=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,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)},u=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),f=["<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</>."],p=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],h=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),m=e=>u(f[e]),y=e=>{const t=e[u("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=d(u(e));return i in h&&(t=h[i]),t}(i[0]);return 0===n||(e=>e[2]===d(e[0]+e[1]))(i)||(n=-2),n},g={},w=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof g[e.id].onInit&&(n(e.id,"\n[31;1mDeprecated Option[m\n\nThe [1monInit()[m function is deprecated and has been replaced with [1monReady()[m. It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),b={position:null,version:o};function v(e){function t(){M(P),R(),L("onResized",P)}function s(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function d(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const u=e=>O.slice(O.indexOf(":")+7+e);const f=(e,t)=>(i,n)=>{const o={};var r,a;r=function(){S(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},p=(e,t)=>()=>{let i=!1;const n=t=>()=>{g[d]?i&&i!==t||(e(t,d),i=t,requestAnimationFrame((()=>{i=!1}))):s()},o=n("scroll"),r=n("resize window");function a(e,t){t(window,"scroll",o),t(window,"resize",r)}function s(){a(0,c),u.disconnect(),f.disconnect()}const d=H,u=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));a(0,l),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[d].iframe,{attributes:!0,childList:!1,subtree:!1}),g[d]&&(g[d][`stop${t}`]=s)},h=e=>()=>{e in g[H]&&(g[H][e](),delete g[H][e])},m=f("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=P.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),y=f("parentInfo",(function(){const{iframe:e}=P,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,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:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),w=p(m,"PageInfo"),v=p(y,"ParentInfo"),j=h("stopPageInfo"),E=h("stopParentInfo");function W(e){const t=e.getBoundingClientRect();return k(),{x:Number(t.left)+Number(b.position.x),y:Number(t.top)+Number(b.position.y)}}function N(e){const t=e?W(P.iframe):{x:0,y:0},i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(P,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){b.position=e,A(H)}(i)}function A(e){const{x:t,y:i}=b.position,n=g[e]?.iframe;!1!==L("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?R():$()}function C(e){let t={};if(0===P.width&&0===P.height){const e=u(9).split(":");t={x:e[1],y:e[0]}}else t={x:P.width,y:P.height};L(e,{iframe:P.iframe,screenX:Number(t.x),screenY:Number(t.y),type:P.type})}const L=(e,t)=>z(H,e,t);let O=e.data,P={},H=null;"[iFrameResizerChild]Ready"!==O?r===`${O}`.slice(0,a)&&O.slice(a).split(":")[0]in g&&(P=function(){const e=O.slice(a).split(":"),t=e[1]?Number(e[1]):0,i=g[e[0]]?.iframe,n=getComputedStyle(i);return{iframe:i,id:e[0],height:t+s(n)+d(n),width:Number(e[2]),type:e[3],msg:e[4]}}(),H=P.id,H?(function(e){if(!g[e])throw new Error(`${P.type} No settings for ${e}. Message was: ${O}`)}(H),P.type in{true:1,false:1,undefined:1}||(g[H].loaded=!0,(null!==P.iframe||(i(H,`The iframe (${P.id}) was not found.`),0))&&function(){const{origin:t,sameDomain:i}=e;if(i)return!0;let n=g[H]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(;e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=g[H]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${P.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[H]?.firstRun&&g[H]&&(g[H].firstRun=!1),P.type){case"close":T(P.iframe);break;case"message":r=u(6),L("onMessage",{iframe:P.iframe,message:JSON.parse(r)});break;case"mouseenter":C("onMouseEnter");break;case"mouseleave":C("onMouseLeave");break;case"autoResize":g[H].autoResize=JSON.parse(u(9));break;case"scrollBy":!function(){const e=P.width,t=P.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":m("start",H),w();break;case"parentInfo":y("start",H),v();break;case"pageInfoStop":j();break;case"parentInfoStop":E();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=W(n);b.position={x:e.x,y:e.y},A(H),window.location.hash=t}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(u(9));break;case"title":!function(e,t){g[t]?.syncTitle&&(g[t].iframe.title=e)}(P.msg,H);break;case"reset":I(P);break;case"init":t(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){g[e].sameDomain=!1}}(H),(e=P.msg)!==o&&(void 0!==e||n(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")),F=!0,L("onReady",P.iframe);break;default:if(0===P.width&&0===P.height)return void i(H,`Unsupported message received (${P.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===P.width||0===P.height)return;if(document.hidden)return;t()}var e,r}())):i("","iframeResizer received messageData without id, message was: ",O)):Object.keys(g).forEach((e=>{g[e].mode>=0&&S("iFrame requested init",x(e),e)}))}function z(e,t,i){let n=null,o=null;if(g[e]){if(n=g[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);"onClose"===t||"onScroll"===t?o=n(i):setTimeout((()=>n(i)))}return o}function j(e){const{id:t}=e;delete g[t]}function T(e){const{id:t}=e;if(!1!==z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){i(t,e)}z(t,"onClosed",t),j(e)}}function k(e){null===b.position&&(b.position={x:window.scrollX,y:window.scrollY})}function $(){b.position=null}function R(e){null!==b.position&&(window.scrollTo(b.position.x,b.position.y),$())}function I(e){k(e.id),M(e),S("reset","reset",e.id)}function M(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=g[i];n&&t("height"),o&&t("width")}function S(e,t,o,a){g[o]&&(g[o]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameDomain:n,targetOrigin:a}=g[o];if(n)try{return void e.contentWindow.iframeChildListener(r+t)}catch(e){}i.postMessage(r+t,a)}():i(o,`[${e}] IFrame(${o}) not found`),a&&g[o]?.warningTimeout&&(g[o].msgTimeout=setTimeout((function(){if(void 0===g[o])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:r}=g[o],{sandbox:a}=e;t||i||(g[o].loadErrorShown=!0,n(o,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${o}</>) has not responded within ${g[o].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${r?"\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":""}\n${!(a?.length>0)||a.contains("allow-scripts")&&a.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\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),g[o].warningTimeout)))}function x(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,b.version,t.mode].join(":")}let E=0,F=!1,W=!1;const N=e=>t=>{function r(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&n(c,'<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 a(e){const t=g[e]?.iframe?.title;return""===t||void 0===t}const c=function(i){if(i&&"string"!=typeof i)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(i=function(){let t=e?.id||w.id+E++;return null!==document.getElementById(t)&&(t+=E++),t}(),t.id=i,(e||{}).log),i}(t.id);return c in g&&"iFrameResizer"in t?i(c,"Ignored iFrame, already setup."):(function(e){var i,o;g[c]={iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...w,...r(e),mode:y(e),syncTitle:a(c)},function(){const{direction:e}=g[c];if("horizontal"===e)return g[c].sizeWidth=!0,void(g[c].sizeHeight=!1);if("none"===e)return g[c].sizeWidth=!1,g[c].sizeHeight=!1,void(g[c].autoResize=!1);if("vertical"!==e)throw new TypeError(c,`Direction value of "${e}" is not valid`)}(),(i=e?.offsetSize||e?.offset)&&("vertical"===g[c].direction?g[c].offsetHeight=i:g[c].offsetWidth=i),e?.offset&&n(c,"<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[c].postMessageTarget&&(g[c].postMessageTarget=t.contentWindow),g[c].targetOrigin=!0===g[c].checkOrigin?""===(o=g[c].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}(e),function(){const{mode:e}=g[c];e<0&&n("Parent",`${m(e+2)}${m(2)}`),W||e<0||(W=!0,(e=>{console.info(`%c[iframe-resizer] ${e}`,"font-weight: bold;")})(`v${o} (${(e=>u(p[e]))(e)})`),e<1&&n("Parent",m(3)))}(),C(),function(){switch(t.style.overflow=!1===g[c]?.scrolling?"hidden":"auto",g[c]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=g[c]?g[c].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[c];"number"!=typeof e&&"0"!==e||(g[c].bodyMargin=`${e}px`)}(),function(e){const{id:i}=t,{mode:n,waitForLoad:o}=g[i];-1!==n&&-2!==n&&(l(t,"load",(function(){S("iFrame.onload",`${e}:${F}`,i,!0),function(){const e=g[c]?.firstRun,i=g[c]?.heightCalculationMethod in s;!e&&i&&I({iframe:t,height:0,width:0,type:"init"})}()})),!1===o&&S("init",`${e}:${F}`,i,!0))}(x(c)),function(){if(g[c]){const{iframe:e}=g[c],t={close:T.bind(null,e),disconnect:j.bind(null,e),removeListeners(){n(c,"\n<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize:S.bind(null,"Window resize","resize",c),moveToAnchor(e){S("Move to anchor",`moveToAnchor:${e}`,c)},sendMessage(e){S("Send Message",`message:${e=JSON.stringify(e)}`,c)}};e.iframeResizer=t,e.iFrameResizer=t}}()),t?.iFrameResizer};function A(){!1===document.hidden&&function(e,t){const i=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){i(n)&&S(e,t,n)}))}("Tab Visible","resize")}const C=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{l(window,"message",v),l(document,"visibilitychange",A),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))})),L="[iframeResizer] ";const O=function(){function e(e){switch(!0){case!e:throw new TypeError(`${L}iframe is not defined`);case!e.tagName:throw new TypeError(`${L}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${L}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),i.push(e)}}let t,i;return function(n,o){if("undefined"==typeof window)return[];switch(t=N(n),i=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${L}Unexpected data type (${typeof o})`)}return Object.freeze(i)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){n("","Deprecated: iFrameResize(), please use iframeResize()"),O(...e)}),O}));
|
|
20
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="[iframe-resizer]";const t=t=>`${e}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(t)}]`,i=(e,...i)=>((e,i,...n)=>window?.console[e](t(i),...n))("warn",e,...i),n=(t,i)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((t=>(...i)=>[`${e}[${t}]`,...i].join(" "))(t))(i)),o="5.3.2",r="[iFrameSizer]",a=r.length,s=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),l=(e,t,i,n)=>e.addEventListener(t,i,n||!1),c=(e,t,i)=>e.removeEventListener(t,i,!1),d=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,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)},u=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),f=["<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</>."],p=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],h=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),m=e=>u(f[e]),y=e=>{const t=e[u("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=d(u(e));return i in h&&(t=h[i]),t}(i[0]);return 0===n||(e=>e[2]===d(e[0]+e[1]))(i)||(n=-2),n},g={},w=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof g[e.id].onInit&&(n(e.id,"\n[31;1mDeprecated Option[m\n\nThe [1monInit()[m function is deprecated and has been replaced with [1monReady()[m. It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),b={position:null,version:o};function v(e){function t(){M(P),R(),L("onResized",P)}function s(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function d(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const u=e=>O.slice(O.indexOf(":")+7+e);const f=(e,t)=>(i,n)=>{const o={};var r,a;r=function(){S(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},p=(e,t)=>()=>{let i=!1;const n=t=>()=>{g[d]?i&&i!==t||(e(t,d),i=t,requestAnimationFrame((()=>{i=!1}))):s()},o=n("scroll"),r=n("resize window");function a(e,t){t(window,"scroll",o),t(window,"resize",r)}function s(){a(0,c),u.disconnect(),f.disconnect()}const d=H,u=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));a(0,l),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[d].iframe,{attributes:!0,childList:!1,subtree:!1}),g[d]&&(g[d][`stop${t}`]=s)},h=e=>()=>{e in g[H]&&(g[H][e](),delete g[H][e])},m=f("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=P.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),y=f("parentInfo",(function(){const{iframe:e}=P,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,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:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),w=p(m,"PageInfo"),v=p(y,"ParentInfo"),j=h("stopPageInfo"),E=h("stopParentInfo");function W(e){const t=e.getBoundingClientRect();return k(),{x:Number(t.left)+Number(b.position.x),y:Number(t.top)+Number(b.position.y)}}function N(e){const t=e?W(P.iframe):{x:0,y:0},i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(P,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){b.position=e,A(H)}(i)}function A(e){const{x:t,y:i}=b.position,n=g[e]?.iframe;!1!==L("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?R():$()}function C(e){let t={};if(0===P.width&&0===P.height){const e=u(9).split(":");t={x:e[1],y:e[0]}}else t={x:P.width,y:P.height};L(e,{iframe:P.iframe,screenX:Number(t.x),screenY:Number(t.y),type:P.type})}const L=(e,t)=>z(H,e,t);let O=e.data,P={},H=null;"[iFrameResizerChild]Ready"!==O?r===`${O}`.slice(0,a)&&O.slice(a).split(":")[0]in g&&(P=function(){const e=O.slice(a).split(":"),t=e[1]?Number(e[1]):0,i=g[e[0]]?.iframe,n=getComputedStyle(i);return{iframe:i,id:e[0],height:t+s(n)+d(n),width:Number(e[2]),type:e[3],msg:e[4]}}(),H=P.id,H?(function(e){if(!g[e])throw new Error(`${P.type} No settings for ${e}. Message was: ${O}`)}(H),P.type in{true:1,false:1,undefined:1}||(g[H].loaded=!0,(null!==P.iframe||(i(H,`The iframe (${P.id}) was not found.`),0))&&function(){const{origin:t,sameDomain:i}=e;if(i)return!0;let n=g[H]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(;e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=g[H]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${P.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[H]?.firstRun&&g[H]&&(g[H].firstRun=!1),P.type){case"close":T(P.iframe);break;case"message":r=u(6),L("onMessage",{iframe:P.iframe,message:JSON.parse(r)});break;case"mouseenter":C("onMouseEnter");break;case"mouseleave":C("onMouseLeave");break;case"autoResize":g[H].autoResize=JSON.parse(u(9));break;case"scrollBy":!function(){const e=P.width,t=P.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":m("start",H),w();break;case"parentInfo":y("start",H),v();break;case"pageInfoStop":j();break;case"parentInfoStop":E();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=W(n);b.position={x:e.x,y:e.y},A(H),window.location.hash=t}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(u(9));break;case"title":!function(e,t){g[t]?.syncTitle&&(g[t].iframe.title=e)}(P.msg,H);break;case"reset":I(P);break;case"init":t(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){g[e].sameDomain=!1}}(H),(e=P.msg)!==o&&(void 0!==e||n(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")),F=!0,L("onReady",P.iframe);break;default:if(0===P.width&&0===P.height)return void i(H,`Unsupported message received (${P.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===P.width||0===P.height)return;if(document.hidden)return;t()}var e,r}())):i("","iframeResizer received messageData without id, message was: ",O)):Object.keys(g).forEach((e=>{g[e].mode>=0&&S("iFrame requested init",x(e),e)}))}function z(e,t,i){let n=null,o=null;if(g[e]){if(n=g[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);"onClose"===t||"onScroll"===t?o=n(i):setTimeout((()=>n(i)))}return o}function j(e){const{id:t}=e;delete g[t]}function T(e){const{id:t}=e;if(!1!==z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){i(t,e)}z(t,"onClosed",t),j(e)}}function k(e){null===b.position&&(b.position={x:window.scrollX,y:window.scrollY})}function $(){b.position=null}function R(e){null!==b.position&&(window.scrollTo(b.position.x,b.position.y),$())}function I(e){k(e.id),M(e),S("reset","reset",e.id)}function M(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=g[i];n&&t("height"),o&&t("width")}function S(e,t,o,a){g[o]&&(g[o]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameDomain:n,targetOrigin:a}=g[o];if(n)try{return void e.contentWindow.iframeChildListener(r+t)}catch(e){}i.postMessage(r+t,a)}():i(o,`[${e}] IFrame(${o}) not found`),a&&g[o]?.warningTimeout&&(g[o].msgTimeout=setTimeout((function(){if(void 0===g[o])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:r}=g[o],{sandbox:a}=e;t||i||(g[o].loadErrorShown=!0,n(o,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${o}</>) has not responded within ${g[o].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${r?"\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":""}\n${!(a?.length>0)||a.contains("allow-scripts")&&a.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\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),g[o].warningTimeout)))}function x(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,b.version,t.mode].join(":")}let E=0,F=!1,W=!1;const N=e=>t=>{function r(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&n(c,'<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 a(e){const t=g[e]?.iframe?.title;return""===t||void 0===t}const c=function(i){if(i&&"string"!=typeof i)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(i=function(){let t=e?.id||w.id+E++;return null!==document.getElementById(t)&&(t+=E++),t}(),t.id=i,(e||{}).log),i}(t.id);return c in g&&"iFrameResizer"in t?i(c,"Ignored iFrame, already setup."):(function(e){var i,o;g[c]={iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...w,...r(e),mode:y(e),syncTitle:a(c)},function(){const{direction:e}=g[c];if("horizontal"===e)return g[c].sizeWidth=!0,void(g[c].sizeHeight=!1);if("none"===e)return g[c].sizeWidth=!1,g[c].sizeHeight=!1,void(g[c].autoResize=!1);if("vertical"!==e)throw new TypeError(c,`Direction value of "${e}" is not valid`)}(),(i=e?.offsetSize||e?.offset)&&("vertical"===g[c].direction?g[c].offsetHeight=i:g[c].offsetWidth=i),e?.offset&&n(c,"<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[c].postMessageTarget&&(g[c].postMessageTarget=t.contentWindow),g[c].targetOrigin=!0===g[c].checkOrigin?""===(o=g[c].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}(e),function(){const{mode:e}=g[c];e<0&&n("Parent",`${m(e+2)}${m(2)}`),W||e<0||(W=!0,(e=>{console.info(`%c[iframe-resizer] ${e}`,"font-weight: bold;")})(`v${o} (${(e=>u(p[e]))(e)})`),e<1&&n("Parent",m(3)))}(),C(),function(){switch(t.style.overflow=!1===g[c]?.scrolling?"hidden":"auto",g[c]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=g[c]?g[c].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[c];"number"!=typeof e&&"0"!==e||(g[c].bodyMargin=`${e}px`)}(),function(e){const{id:i}=t,{mode:n,waitForLoad:o}=g[i];-1!==n&&-2!==n&&(l(t,"load",(function(){S("iFrame.onload",`${e}:${F}`,i,!0),function(){const e=g[c]?.firstRun,i=g[c]?.heightCalculationMethod in s;!e&&i&&I({iframe:t,height:0,width:0,type:"init"})}()})),!1===o&&S("init",`${e}:${F}`,i,!0))}(x(c)),function(){if(g[c]){const{iframe:e}=g[c],t={close:T.bind(null,e),disconnect:j.bind(null,e),removeListeners(){n(c,"\n<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize:S.bind(null,"Window resize","resize",c),moveToAnchor(e){S("Move to anchor",`moveToAnchor:${e}`,c)},sendMessage(e){S("Send Message",`message:${e=JSON.stringify(e)}`,c)}};e.iframeResizer=t,e.iFrameResizer=t}}()),t?.iFrameResizer};function A(){!1===document.hidden&&function(e,t){const i=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){i(n)&&S(e,t,n)}))}("Tab Visible","resize")}const C=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{l(window,"message",v),l(document,"visibilitychange",A),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))})),L="[iframeResizer] ";const O=function(){function e(e){switch(!0){case!e:throw new TypeError(`${L}iframe is not defined`);case!e.tagName:throw new TypeError(`${L}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${L}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),i.push(e)}}let t,i;return function(n,o){if("undefined"==typeof window)return[];switch(t=N(n),i=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${L}Unexpected data type (${typeof o})`)}return Object.freeze(i)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){n("","Deprecated: iFrameResize(), please use iframeResize()"),O(...e)}),O}));
|
package/js/iframeResizer.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/legacy (parent) 5.3.
|
|
4
|
+
* @module iframe-resizer/legacy (parent) 5.3.2 (umd) - 2024-10-22
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 for non-commercial use only.
|
|
7
7
|
* For commercial use, you must purchase a license from
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="[iframe-resizer]";const t=t=>`${e}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(t)}]`,i=(e,...i)=>((e,i,...n)=>window?.console[e](t(i),...n))("warn",e,...i),n=(t,i)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((t=>(...i)=>[`${e}[${t}]`,...i].join(" "))(t))(i)),o="5.3.1",r="[iFrameSizer]",a=r.length,s=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),l=(e,t,i,n)=>e.addEventListener(t,i,n||!1),c=(e,t,i)=>e.removeEventListener(t,i,!1),d=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,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)},u=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),f=["<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</>."],p=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],h=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),m=e=>u(f[e]),y=e=>{const t=e[u("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=d(u(e));return i in h&&(t=h[i]),t}(i[0]);return 0===n||(e=>e[2]===d(e[0]+e[1]))(i)||(n=-2),n},g={},w=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof g[e.id].onInit&&(n(e.id,"\n[31;1mDeprecated Option[m\n\nThe [1monInit()[m function is deprecated and has been replaced with [1monReady()[m. It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),b={position:null,version:o};function v(e){function t(){M(P),R(),L("onResized",P)}function s(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function d(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const u=e=>O.slice(O.indexOf(":")+7+e);const f=(e,t)=>(i,n)=>{const o={};var r,a;r=function(){S(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},p=(e,t)=>()=>{let i=!1;const n=t=>()=>{g[d]?i&&i!==t||(e(t,d),i=t,requestAnimationFrame((()=>{i=!1}))):s()},o=n("scroll"),r=n("resize window");function a(e,t){t(window,"scroll",o),t(window,"resize",r)}function s(){a(0,c),u.disconnect(),f.disconnect()}const d=H,u=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));a(0,l),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[d].iframe,{attributes:!0,childList:!1,subtree:!1}),g[d]&&(g[d][`stop${t}`]=s)},h=e=>()=>{e in g[H]&&(g[H][e](),delete g[H][e])},m=f("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=P.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),y=f("parentInfo",(function(){const{iframe:e}=P,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,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:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),w=p(m,"PageInfo"),v=p(y,"ParentInfo"),j=h("stopPageInfo"),E=h("stopParentInfo");function W(e){const t=e.getBoundingClientRect();return k(),{x:Number(t.left)+Number(b.position.x),y:Number(t.top)+Number(b.position.y)}}function N(e){const t=e?W(P.iframe):{x:0,y:0},i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(P,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){b.position=e,A(H)}(i)}function A(e){const{x:t,y:i}=b.position,n=g[e]?.iframe;!1!==L("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?R():$()}function C(e){let t={};if(0===P.width&&0===P.height){const e=u(9).split(":");t={x:e[1],y:e[0]}}else t={x:P.width,y:P.height};L(e,{iframe:P.iframe,screenX:Number(t.x),screenY:Number(t.y),type:P.type})}const L=(e,t)=>z(H,e,t);let O=e.data,P={},H=null;"[iFrameResizerChild]Ready"!==O?r===`${O}`.slice(0,a)&&O.slice(a).split(":")[0]in g&&(P=function(){const e=O.slice(a).split(":"),t=e[1]?Number(e[1]):0,i=g[e[0]]?.iframe,n=getComputedStyle(i);return{iframe:i,id:e[0],height:t+s(n)+d(n),width:Number(e[2]),type:e[3],msg:e[4]}}(),H=P.id,H?(function(e){if(!g[e])throw new Error(`${P.type} No settings for ${e}. Message was: ${O}`)}(H),P.type in{true:1,false:1,undefined:1}||(g[H].loaded=!0,(null!==P.iframe||(i(H,`The iframe (${P.id}) was not found.`),0))&&function(){const{origin:t,sameDomain:i}=e;if(i)return!0;let n=g[H]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(;e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=g[H]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${P.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[H]?.firstRun&&g[H]&&(g[H].firstRun=!1),P.type){case"close":T(P.iframe);break;case"message":r=u(6),L("onMessage",{iframe:P.iframe,message:JSON.parse(r)});break;case"mouseenter":C("onMouseEnter");break;case"mouseleave":C("onMouseLeave");break;case"autoResize":g[H].autoResize=JSON.parse(u(9));break;case"scrollBy":!function(){const e=P.width,t=P.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":m("start",H),w();break;case"parentInfo":y("start",H),v();break;case"pageInfoStop":j();break;case"parentInfoStop":E();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=W(n);b.position={x:e.x,y:e.y},A(H),window.location.hash=t}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(u(9));break;case"title":!function(e,t){g[t]?.syncTitle&&(g[t].iframe.title=e)}(P.msg,H);break;case"reset":I(P);break;case"init":t(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){g[e].sameDomain=!1}}(H),(e=P.msg)!==o&&(void 0!==e||n(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")),F=!0,L("onReady",P.iframe);break;default:if(0===P.width&&0===P.height)return void i(H,`Unsupported message received (${P.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===P.width||0===P.height)return;if(document.hidden)return;t()}var e,r}())):i("","iframeResizer received messageData without id, message was: ",O)):Object.keys(g).forEach((e=>{g[e].mode>=0&&S("iFrame requested init",x(e),e)}))}function z(e,t,i){let n=null,o=null;if(g[e]){if(n=g[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);"onClose"===t||"onScroll"===t?o=n(i):setTimeout((()=>n(i)))}return o}function j(e){const{id:t}=e;delete g[t]}function T(e){const{id:t}=e;if(!1!==z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){i(t,e)}z(t,"onClosed",t),j(e)}}function k(e){null===b.position&&(b.position={x:window.scrollX,y:window.scrollY})}function $(){b.position=null}function R(e){null!==b.position&&(window.scrollTo(b.position.x,b.position.y),$())}function I(e){k(e.id),M(e),S("reset","reset",e.id)}function M(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=g[i];n&&t("height"),o&&t("width")}function S(e,t,o,a){g[o]&&(g[o]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameDomain:n,targetOrigin:a}=g[o];if(n)try{return void e.contentWindow.iframeChildListener(r+t)}catch(e){}i.postMessage(r+t,a)}():i(o,`[${e}] IFrame(${o}) not found`),a&&g[o]?.warningTimeout&&(g[o].msgTimeout=setTimeout((function(){if(void 0===g[o])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:r}=g[o],{sandbox:a}=e;t||i||(g[o].loadErrorShown=!0,n(o,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${o}</>) has not responded within ${g[o].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${r?"\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":""}\n${!(a?.length>0)||a.contains("allow-scripts")&&a.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\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),g[o].warningTimeout)))}function x(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,b.version,t.mode].join(":")}let E=0,F=!1,W=!1;const N=e=>t=>{function r(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&n(c,'<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 a(e){const t=g[e]?.iframe?.title;return""===t||void 0===t}const c=function(i){if(i&&"string"!=typeof i)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(i=function(){let t=e?.id||w.id+E++;return null!==document.getElementById(t)&&(t+=E++),t}(),t.id=i,(e||{}).log),i}(t.id);return c in g&&"iFrameResizer"in t?i(c,"Ignored iFrame, already setup."):(function(e){var i,o;g[c]={iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...w,...r(e),mode:y(e),syncTitle:a(c)},function(){const{direction:e}=g[c];if("horizontal"===e)return g[c].sizeWidth=!0,void(g[c].sizeHeight=!1);if("none"===e)return g[c].sizeWidth=!1,g[c].sizeHeight=!1,void(g[c].autoResize=!1);if("vertical"!==e)throw new TypeError(c,`Direction value of "${e}" is not valid`)}(),(i=e?.offsetSize||e?.offset)&&("vertical"===g[c].direction?g[c].offsetHeight=i:g[c].offsetWidth=i),e?.offset&&n(c,"<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[c].postMessageTarget&&(g[c].postMessageTarget=t.contentWindow),g[c].targetOrigin=!0===g[c].checkOrigin?""===(o=g[c].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}(e),function(){const{mode:e}=g[c];e<0&&n("Parent",`${m(e+2)}${m(2)}`),W||e<0||(W=!0,(e=>{console.info(`%c[iframe-resizer] ${e}`,"font-weight: bold;")})(`v${o} (${(e=>u(p[e]))(e)})`),e<1&&n("Parent",m(3)))}(),C(),function(){switch(t.style.overflow=!1===g[c]?.scrolling?"hidden":"auto",g[c]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=g[c]?g[c].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[c];"number"!=typeof e&&"0"!==e||(g[c].bodyMargin=`${e}px`)}(),function(e){const{id:i}=t,{mode:n,waitForLoad:o}=g[i];-1!==n&&-2!==n&&(l(t,"load",(function(){S("iFrame.onload",`${e}:${F}`,i,!0),function(){const e=g[c]?.firstRun,i=g[c]?.heightCalculationMethod in s;!e&&i&&I({iframe:t,height:0,width:0,type:"init"})}()})),!1===o&&S("init",`${e}:${F}`,i,!0))}(x(c)),function(){if(g[c]){const{iframe:e}=g[c],t={close:T.bind(null,e),disconnect:j.bind(null,e),removeListeners(){n(c,"\n<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize:S.bind(null,"Window resize","resize",c),moveToAnchor(e){S("Move to anchor",`moveToAnchor:${e}`,c)},sendMessage(e){S("Send Message",`message:${e=JSON.stringify(e)}`,c)}};e.iframeResizer=t,e.iFrameResizer=t}}()),t?.iFrameResizer};function A(){!1===document.hidden&&function(e,t){const i=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){i(n)&&S(e,t,n)}))}("Tab Visible","resize")}const C=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{l(window,"message",v),l(document,"visibilitychange",A),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))})),L="[iframeResizer] ";const O=function(){function e(e){switch(!0){case!e:throw new TypeError(`${L}iframe is not defined`);case!e.tagName:throw new TypeError(`${L}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${L}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),i.push(e)}}let t,i;return function(n,o){if("undefined"==typeof window)return[];switch(t=N(n),i=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${L}Unexpected data type (${typeof o})`)}return Object.freeze(i)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){n("","Deprecated: iFrameResize(), please use iframeResize()"),O(...e)}),O}));
|
|
20
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).iframeResize=t()}(this,(function(){"use strict";console.info("IFRAME-RESIZER 5\n\nThis package has been split into separate packages for Parent and Child pages. Along with new packages for jQuery, React and Vue.\n\nGoing forward you are advised to use the new separate packages for Parent and Child pages, rather than this combined package.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n");const e="[iframe-resizer]";const t=t=>`${e}[${function(e){return window.top===window.self?`Parent page: ${e}`:window?.parentIFrame?.getId?`${window.parentIFrame.getId()}: ${e}`:`Nested parent page: ${e}`}(t)}]`,i=(e,...i)=>((e,i,...n)=>window?.console[e](t(i),...n))("warn",e,...i),n=(t,i)=>console?.warn((e=>t=>window.chrome?e(t.replaceAll("<br>","\n").replaceAll("<rb>","[31;1m").replaceAll("</>","[m").replaceAll("<b>","[1m").replaceAll("<i>","[3m").replaceAll("<u>","[4m")):e(t.replaceAll("<br>","\n").replaceAll(/<[/a-z]+>/gi,"")))((t=>(...i)=>[`${e}[${t}]`,...i].join(" "))(t))(i)),o="5.3.2",r="[iFrameSizer]",a=r.length,s=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),l=(e,t,i,n)=>e.addEventListener(t,i,n||!1),c=(e,t,i)=>e.removeEventListener(t,i,!1),d=e=>{if(!e)return"";let t=-559038744,i=1103547984;for(let n,o=0;o<e.length;o++)n=e.codePointAt(o),t=Math.imul(t^n,2246822519),i=Math.imul(i^n,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)},u=e=>e.replaceAll(/[A-Za-z]/g,(e=>String.fromCodePoint((e<="Z"?90:122)>=(e=e.codePointAt(0)+19)?e:e-26))),f=["<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</>."],p=["NWSc3","zvsv","wyv","ibzpulzz","vlt"],h=Object.fromEntries(["2cgs7fdf4xb","1c9ctcccr4z","1q2pc4eebgb","ueokt0969w","w2zxchhgqz","1umuxblj2e5"].map(((e,t)=>[e,Math.max(0,t-1)]))),m=e=>u(f[e]),y=e=>{const t=e[u("spjluzl")];if(!t)return-1;const i=t.split("-");let n=function(e=""){let t=-2;const i=d(u(e));return i in h&&(t=h[i]),t}(i[0]);return 0===n||(e=>e[2]===d(e[0]+e[1]))(i)||(n=-2),n},g={},w=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyPadding:null,checkOrigin:!0,direction:"vertical",inPageLinks:!1,heightCalculationMethod:"auto",id:"iFrameResizer",log:!1,license:void 0,mouseEvents:!0,offsetHeight:null,offsetWidth:null,postMessageTarget:null,sameDomain:!1,scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,waitForLoad:!1,widthCalculationMethod:"auto",onClose:()=>!0,onClosed(){},onInit:!1,onMessage:null,onMouseEnter(){},onMouseLeave(){},onReady:e=>{"function"==typeof g[e.id].onInit&&(n(e.id,"\n[31;1mDeprecated Option[m\n\nThe [1monInit()[m function is deprecated and has been replaced with [1monReady()[m. It will be removed in a future version of iFrame Resizer.\n "),g[e.id].onInit(e))},onResized(){},onScroll:()=>!0}),b={position:null,version:o};function v(e){function t(){M(P),R(),L("onResized",P)}function s(e){if("border-box"!==e.boxSizing)return 0;return(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}function d(e){if("border-box"!==e.boxSizing)return 0;return(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}const u=e=>O.slice(O.indexOf(":")+7+e);const f=(e,t)=>(i,n)=>{const o={};var r,a;r=function(){S(`Send ${e} (${i})`,`${e}:${t()}`,n)},o[a=n]||(r(),o[a]=requestAnimationFrame((()=>{o[a]=null})))},p=(e,t)=>()=>{let i=!1;const n=t=>()=>{g[d]?i&&i!==t||(e(t,d),i=t,requestAnimationFrame((()=>{i=!1}))):s()},o=n("scroll"),r=n("resize window");function a(e,t){t(window,"scroll",o),t(window,"resize",r)}function s(){a(0,c),u.disconnect(),f.disconnect()}const d=H,u=new ResizeObserver(n("page observed")),f=new ResizeObserver(n("iframe observed"));a(0,l),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),f.observe(g[d].iframe,{attributes:!0,childList:!1,subtree:!1}),g[d]&&(g[d][`stop${t}`]=s)},h=e=>()=>{e in g[H]&&(g[H][e](),delete g[H][e])},m=f("pageInfo",(function(){const e=document.body.getBoundingClientRect(),t=P.iframe.getBoundingClientRect(),{scrollY:i,scrollX:n,innerHeight:o,innerWidth:r}=window,{clientHeight:a,clientWidth:s}=document.documentElement;return JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(a,o||0),clientWidth:Math.max(s,r||0),offsetTop:parseInt(t.top-e.top,10),offsetLeft:parseInt(t.left-e.left,10),scrollTop:i,scrollLeft:n,documentHeight:a,documentWidth:s,windowHeight:o,windowWidth:r})})),y=f("parentInfo",(function(){const{iframe:e}=P,{scrollWidth:t,scrollHeight:i}=document.documentElement,{width:n,height:o,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:n,height:o,offsetLeft:r,offsetTop:a,pageLeft:s,pageTop:l,scale:c}})})),w=p(m,"PageInfo"),v=p(y,"ParentInfo"),j=h("stopPageInfo"),E=h("stopParentInfo");function W(e){const t=e.getBoundingClientRect();return k(),{x:Number(t.left)+Number(b.position.x),y:Number(t.top)+Number(b.position.y)}}function N(e){const t=e?W(P.iframe):{x:0,y:0},i=((e,t)=>({x:e.width+t.x,y:e.height+t.y}))(P,t),n=window.parentIframe||window.parentIFrame;n?function(t,i){t["scrollTo"+(e?"Offset":"")](i.x,i.y)}(n,i):function(e){b.position=e,A(H)}(i)}function A(e){const{x:t,y:i}=b.position,n=g[e]?.iframe;!1!==L("onScroll",{iframe:n,top:i,left:t,x:t,y:i})?R():$()}function C(e){let t={};if(0===P.width&&0===P.height){const e=u(9).split(":");t={x:e[1],y:e[0]}}else t={x:P.width,y:P.height};L(e,{iframe:P.iframe,screenX:Number(t.x),screenY:Number(t.y),type:P.type})}const L=(e,t)=>z(H,e,t);let O=e.data,P={},H=null;"[iFrameResizerChild]Ready"!==O?r===`${O}`.slice(0,a)&&O.slice(a).split(":")[0]in g&&(P=function(){const e=O.slice(a).split(":"),t=e[1]?Number(e[1]):0,i=g[e[0]]?.iframe,n=getComputedStyle(i);return{iframe:i,id:e[0],height:t+s(n)+d(n),width:Number(e[2]),type:e[3],msg:e[4]}}(),H=P.id,H?(function(e){if(!g[e])throw new Error(`${P.type} No settings for ${e}. Message was: ${O}`)}(H),P.type in{true:1,false:1,undefined:1}||(g[H].loaded=!0,(null!==P.iframe||(i(H,`The iframe (${P.id}) was not found.`),0))&&function(){const{origin:t,sameDomain:i}=e;if(i)return!0;let n=g[H]?.checkOrigin;if(n&&"null"!=`${t}`&&!(n.constructor===Array?function(){let e=0,i=!1;for(;e<n.length;e++)if(n[e]===t){i=!0;break}return i}():function(){const e=g[H]?.remoteHost;return t===e}()))throw new Error(`Unexpected message received from: ${t} for ${P.iframe.id}. Message was: ${e.data}. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.`);return!0}()&&function(){switch(g[H]?.firstRun&&g[H]&&(g[H].firstRun=!1),P.type){case"close":T(P.iframe);break;case"message":r=u(6),L("onMessage",{iframe:P.iframe,message:JSON.parse(r)});break;case"mouseenter":C("onMouseEnter");break;case"mouseleave":C("onMouseLeave");break;case"autoResize":g[H].autoResize=JSON.parse(u(9));break;case"scrollBy":!function(){const e=P.width,t=P.height;(window.parentIframe||window).scrollBy(e,t)}();break;case"scrollTo":N(!1);break;case"scrollToOffset":N(!0);break;case"pageInfo":m("start",H),w();break;case"parentInfo":y("start",H),v();break;case"pageInfoStop":j();break;case"parentInfoStop":E();break;case"inPageLink":!function(e){const t=e.split("#")[1]||"",i=decodeURIComponent(t);let n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){const e=W(n);b.position={x:e.x,y:e.y},A(H),window.location.hash=t}():window.top!==window.self&&window.parentIFrame&&window.parentIFrame.moveToAnchor(t)}(u(9));break;case"title":!function(e,t){g[t]?.syncTitle&&(g[t].iframe.title=e)}(P.msg,H);break;case"reset":I(P);break;case"init":t(),function(e){try{g[e].sameDomain=!!g[e]?.iframe?.contentWindow?.iframeChildListener}catch(t){g[e].sameDomain=!1}}(H),(e=P.msg)!==o&&(void 0!==e||n(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")),F=!0,L("onReady",P.iframe);break;default:if(0===P.width&&0===P.height)return void i(H,`Unsupported message received (${P.type}), this is likely due to the iframe containing a later version of iframe-resizer than the parent page`);if(0===P.width||0===P.height)return;if(document.hidden)return;t()}var e,r}())):i("","iframeResizer received messageData without id, message was: ",O)):Object.keys(g).forEach((e=>{g[e].mode>=0&&S("iFrame requested init",x(e),e)}))}function z(e,t,i){let n=null,o=null;if(g[e]){if(n=g[e][t],"function"!=typeof n)throw new TypeError(`${t} on iFrame[${e}] is not a function`);"onClose"===t||"onScroll"===t?o=n(i):setTimeout((()=>n(i)))}return o}function j(e){const{id:t}=e;delete g[t]}function T(e){const{id:t}=e;if(!1!==z(t,"onClose",t)){try{e.parentNode&&e.remove()}catch(e){i(t,e)}z(t,"onClosed",t),j(e)}}function k(e){null===b.position&&(b.position={x:window.scrollX,y:window.scrollY})}function $(){b.position=null}function R(e){null!==b.position&&(window.scrollTo(b.position.x,b.position.y),$())}function I(e){k(e.id),M(e),S("reset","reset",e.id)}function M(e){function t(t){const i=`${e[t]}px`;e.iframe.style[t]=i}const{id:i}=e,{sizeHeight:n,sizeWidth:o}=g[i];n&&t("height"),o&&t("width")}function S(e,t,o,a){g[o]&&(g[o]?.postMessageTarget?function(){const{iframe:e,postMessageTarget:i,sameDomain:n,targetOrigin:a}=g[o];if(n)try{return void e.contentWindow.iframeChildListener(r+t)}catch(e){}i.postMessage(r+t,a)}():i(o,`[${e}] IFrame(${o}) not found`),a&&g[o]?.warningTimeout&&(g[o].msgTimeout=setTimeout((function(){if(void 0===g[o])return;const{iframe:e,loaded:t,loadErrorShown:i,waitForLoad:r}=g[o],{sandbox:a}=e;t||i||(g[o].loadErrorShown=!0,n(o,`\n<rb>No response from iFrame</>\n \nThe iframe (<i>${o}</>) has not responded within ${g[o].warningTimeout/1e3} seconds. Check <b>@iframe-resizer/child</> package has been loaded in the iframe.\n${r?"\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":""}\n${!(a?.length>0)||a.contains("allow-scripts")&&a.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\nThis message can be ignored if everything is working, or you can set the <b>warningTimeout</> option to a higher value or zero to suppress this warning.\n`))}),g[o].warningTimeout)))}function x(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,b.version,t.mode].join(":")}let E=0,F=!1,W=!1;const N=e=>t=>{function r(e){if(!e)return{};if("object"!=typeof e)throw new TypeError("Options is not an object");return("sizeWidth"in e||"sizeHeight"in e||"autoResize"in e)&&n(c,'<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 a(e){const t=g[e]?.iframe?.title;return""===t||void 0===t}const c=function(i){if(i&&"string"!=typeof i)throw new TypeError("Invalid id for iFrame. Expected String");return""!==i&&i||(i=function(){let t=e?.id||w.id+E++;return null!==document.getElementById(t)&&(t+=E++),t}(),t.id=i,(e||{}).log),i}(t.id);return c in g&&"iFrameResizer"in t?i(c,"Ignored iFrame, already setup."):(function(e){var i,o;g[c]={iframe:t,firstRun:!0,remoteHost:t?.src.split("/").slice(0,3).join("/"),...w,...r(e),mode:y(e),syncTitle:a(c)},function(){const{direction:e}=g[c];if("horizontal"===e)return g[c].sizeWidth=!0,void(g[c].sizeHeight=!1);if("none"===e)return g[c].sizeWidth=!1,g[c].sizeHeight=!1,void(g[c].autoResize=!1);if("vertical"!==e)throw new TypeError(c,`Direction value of "${e}" is not valid`)}(),(i=e?.offsetSize||e?.offset)&&("vertical"===g[c].direction?g[c].offsetHeight=i:g[c].offsetWidth=i),e?.offset&&n(c,"<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[c].postMessageTarget&&(g[c].postMessageTarget=t.contentWindow),g[c].targetOrigin=!0===g[c].checkOrigin?""===(o=g[c].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*"}(e),function(){const{mode:e}=g[c];e<0&&n("Parent",`${m(e+2)}${m(2)}`),W||e<0||(W=!0,(e=>{console.info(`%c[iframe-resizer] ${e}`,"font-weight: bold;")})(`v${o} (${(e=>u(p[e]))(e)})`),e<1&&n("Parent",m(3)))}(),C(),function(){switch(t.style.overflow=!1===g[c]?.scrolling?"hidden":"auto",g[c]?.scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=g[c]?g[c].scrolling:"no"}}(),function(){const{bodyMargin:e}=g[c];"number"!=typeof e&&"0"!==e||(g[c].bodyMargin=`${e}px`)}(),function(e){const{id:i}=t,{mode:n,waitForLoad:o}=g[i];-1!==n&&-2!==n&&(l(t,"load",(function(){S("iFrame.onload",`${e}:${F}`,i,!0),function(){const e=g[c]?.firstRun,i=g[c]?.heightCalculationMethod in s;!e&&i&&I({iframe:t,height:0,width:0,type:"init"})}()})),!1===o&&S("init",`${e}:${F}`,i,!0))}(x(c)),function(){if(g[c]){const{iframe:e}=g[c],t={close:T.bind(null,e),disconnect:j.bind(null,e),removeListeners(){n(c,"\n<rb>Deprecated Method Name</>\n\nThe [removeListeners()</> method has been renamed to [disconnect()</>.\n"),this.disconnect()},resize:S.bind(null,"Window resize","resize",c),moveToAnchor(e){S("Move to anchor",`moveToAnchor:${e}`,c)},sendMessage(e){S("Send Message",`message:${e=JSON.stringify(e)}`,c)}};e.iframeResizer=t,e.iFrameResizer=t}}()),t?.iFrameResizer};function A(){!1===document.hidden&&function(e,t){const i=e=>g[e]?.autoResize&&!g[e]?.firstRun;Object.keys(g).forEach((function(n){i(n)&&S(e,t,n)}))}("Tab Visible","resize")}const C=(e=>{let t=!1;return function(){return t?void 0:(t=!0,Reflect.apply(e,this,arguments))}})((()=>{l(window,"message",v),l(document,"visibilitychange",A),window.iframeParentListener=e=>setTimeout((()=>v({data:e,sameDomain:!0})))})),L="[iframeResizer] ";const O=function(){function e(e){switch(!0){case!e:throw new TypeError(`${L}iframe is not defined`);case!e.tagName:throw new TypeError(`${L}Not a valid DOM element`);case"IFRAME"!==e.tagName.toUpperCase():throw new TypeError(`${L}Expected <IFRAME> tag, found <${e.tagName}>`);default:t(e),i.push(e)}}let t,i;return function(n,o){if("undefined"==typeof window)return[];switch(t=N(n),i=[],typeof o){case"undefined":case"string":document.querySelectorAll(o||"iframe").forEach(e);break;case"object":e(o);break;default:throw new TypeError(`${L}Unexpected data type (${typeof o})`)}return Object.freeze(i)}}();return"undefined"!=typeof window&&(window.iFrameResize=window.iFrameResize||function(...e){n("","Deprecated: iFrameResize(), please use iframeResize()"),O(...e)}),O}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iframe-resizer",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.2",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
5
|
"homepage": "https://iframe-resizer.com",
|
|
6
6
|
"author": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"legacy"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@iframe-resizer/child": "5.3.
|
|
42
|
-
"@iframe-resizer/jquery": "5.3.
|
|
43
|
-
"@iframe-resizer/parent": "5.3.
|
|
41
|
+
"@iframe-resizer/child": "5.3.2",
|
|
42
|
+
"@iframe-resizer/jquery": "5.3.2",
|
|
43
|
+
"@iframe-resizer/parent": "5.3.2"
|
|
44
44
|
}
|
|
45
45
|
}
|