!function(n){"use strict";function gt(){}function a(n,t,i,r){"addEventListener"in window?n.addEventListener(t,i,!!cr&&(r||{})):"attachEvent"in window&&n.attachEvent("on"+t,i)}function ni(n,t,i){"removeEventListener"in window?n.removeEventListener(t,i,!1):"detachEvent"in window&&n.detachEvent("on"+t,i)}function ti(n){return n.charAt(0).toUpperCase()+n.slice(1)}function lr(n){var i,r,f,t=null,u=0,e=function(){u=rt();t=null;f=n.apply(i,r);t||(i=r=null)};return function(){var s=rt(),o;return u||(u=s),o=w-(s-u),i=this,r=arguments,o<=0||o>w?(t&&(clearTimeout(t),t=null),u=s,f=n.apply(i,r),t||(i=r=null)):t||(t=setTimeout(e,o)),f}}function ii(n){return nt+"["+tt+"] "+n}function t(n){lt&&"object"==typeof console&&console.log(ii(n))}function s(n){"object"==typeof console&&console.warn(ii(n))}function ar(){vr();t("Initialising iFrame ("+location.href+")");yr();wr();ut("background",di);ut("padding",gi);tu();fi();ei();br();ru();oi();y=iu();h("init","Init message from host page");pt()}function vr(){function i(n){return"true"===n}var t=ir.substr(ur).split(":");tt=t[0];ot=n!==t[1]?Number(t[1]):ot;g=n!==t[2]?i(t[2]):g;lt=n!==t[3]?i(t[3]):lt;c=n!==t[4]?Number(t[4]):c;e=n!==t[6]?i(t[6]):e;d=t[7];r=n!==t[8]?t[8]:r;di=t[9];gi=t[10];vt=n!==t[11]?Number(t[11]):vt;y.enable=n!==t[12]&&i(t[12]);at=n!==t[13]?t[13]:at;u=n!==t[14]?t[14]:u}function yr(){function i(){var n=window.iFrameResizer;t("Reading data from page: "+JSON.stringify(n));yt="messageCallback"in n?n.messageCallback:yt;pt="readyCallback"in n?n.readyCallback:pt;p="targetOrigin"in n?n.targetOrigin:p;r="heightCalculationMethod"in n?n.heightCalculationMethod:r;u="widthCalculationMethod"in n?n.widthCalculationMethod:u}function n(n,i){return"function"==typeof n&&(t("Setup custom "+i+"CalcMethod"),bt[i]=n,n="custom"),n}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(i(),r=n(r,"height"),u=n(u,"width"));t("TargetOrigin for parent set to: "+p)}function pr(n,t){return-1!==t.indexOf("-")&&(s("Negative CSS value ignored for "+n),t=""),t}function ut(i,r){n!==r&&""!==r&&"null"!==r&&(document.body.style[i]=r,t("Body "+i+' set to "'+r+'"'))}function wr(){n===d&&(d=ot+"px");ut("margin",pr("margin",d))}function br(){document.documentElement.style.height="";document.body.style.height="";t('HTML & body height set to "auto"')}function i(n){var i={add:function(t){function i(){h(n.eventName,n.eventType)}kt[t]=i;a(window,t,i,{passive:!0})},remove:function(n){var t=kt[n];delete kt[n];ni(window,n,t)}};n.eventNames&&Array.prototype.map?(n.eventName=n.eventNames[0],n.eventNames.map(i[n.method])):i[n.method](n.eventName);t(ti(n.method)+" event listener: "+n.eventType)}function ri(n){i({method:n,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]});i({method:n,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]});i({method:n,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]});i({method:n,eventType:"Input",eventName:"input"});i({method:n,eventType:"Mouse Up",eventName:"mouseup"});i({method:n,eventType:"Mouse Down",eventName:"mousedown"});i({method:n,eventType:"Orientation Change",eventName:"orientationchange"});i({method:n,eventType:"Print",eventName:["afterprint","beforeprint"]});i({method:n,eventType:"Ready State Change",eventName:"readystatechange"});i({method:n,eventType:"Touch Start",eventName:"touchstart"});i({method:n,eventType:"Touch End",eventName:"touchend"});i({method:n,eventType:"Touch Cancel",eventName:"touchcancel"});i({method:n,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]});i({method:n,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]});i({method:n,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]});"child"===at&&i({method:n,eventType:"IFrame Resized",eventName:"resize"})}function ui(n,i,r,u){return i!==n&&(n in r||(s(n+" is not a valid option for "+u+"CalculationMethod."),n=i),t(u+' calculation method set to "'+n+'"')),n}function fi(){r=ui(r,ct,o,"height")}function ei(){u=ui(u,hr,l,"width")}function oi(){!0===e?(ri("add"),fu()):t("Auto Resize disabled")}function kr(){t("Disable outgoing messages");er=!1}function dr(){t("Remove event listener: Message");ni(window,"message",wi)}function gr(){null!==st&&st.disconnect()}function si(){ri("remove");gr();clearInterval(rr)}function nu(){kr();dr();!0===e&&si()}function tu(){var n=document.createElement("div");n.style.clear="both";n.style.display="block";document.body.appendChild(n)}function iu(){function u(){return{x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop}}function e(n){var t=n.getBoundingClientRect(),i=u();return{x:parseInt(t.left,10)+parseInt(i.x,10),y:parseInt(t.top,10)+parseInt(i.y,10)}}function i(i){function s(n){var i=e(n);t("Moving to in page link (#"+r+") at x: "+i.x+" y: "+i.y);f(i.y,i.x,"scrollToOffset")}var r=i.split("#")[1]||i,u=decodeURIComponent(r),o=document.getElementById(u)||document.getElementsByName(u)[0];n!==o?s(o):(t("In page link (#"+r+") not found in iFrame, so sending to parent"),f(0,0,"inPageLink","#"+r))}function r(){""!==location.hash&&"#"!==location.hash&&i(location.href)}function o(){function n(n){function t(n){n.preventDefault();i(this.getAttribute("href"))}"#"!==n.getAttribute("href")&&a(n,"click",t)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),n)}function h(){a(window,"hashchange",r)}function c(){setTimeout(r,ht)}function l(){Array.prototype.forEach&&document.querySelectorAll?(t("Setting up location.hash handlers"),o(),h(),c()):s("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return y.enable?l():t("In page linking not enabled"),{findTarget:i}}function ru(){t("Enable public methods");su.parentIFrame={autoResize:function(n){return!0===n&&!1===e?(e=!0,oi()):!1===n&&!0===e&&(e=!1,si()),e},close:function(){f(0,0,"close");nu()},getId:function(){return tt},getPageInfo:function(n){"function"==typeof n?(wt=n,f(0,0,"pageInfo")):(wt=function(){},f(0,0,"pageInfoStop"))},moveToAnchor:function(n){y.findTarget(n)},reset:function(){pi("parentIFrame.reset")},scrollTo:function(n,t){f(t,n,"scrollTo")},scrollToOffset:function(n,t){f(t,n,"scrollToOffset")},sendMessage:function(n,t){f(0,0,"message",JSON.stringify(n),t)},setHeightCalculationMethod:function(n){r=n;fi()},setWidthCalculationMethod:function(n){u=n;ei()},setTargetOrigin:function(n){t("Set targetOrigin: "+n);p=n},size:function(n,t){h("size","parentIFrame.size("+(n||"")+(t?","+t:"")+")",n,t)}}}function hi(){0!==c&&(t("setInterval: "+c+"ms"),rr=setInterval(function(){h("interval","setInterval: "+c)},Math.abs(c)))}function uu(){function s(n){function i(n){!1===n.complete&&(t("Attach listeners to "+n.src),n.addEventListener("load",e,!1),n.addEventListener("error",o,!1),r.push(n))}"attributes"===n.type&&"src"===n.attributeName?i(n.target):"childList"===n.type&&Array.prototype.forEach.call(n.target.querySelectorAll("img"),i)}function c(n){r.splice(r.indexOf(n),1)}function u(n){t("Remove listeners from "+n.src);n.removeEventListener("load",e,!1);n.removeEventListener("error",o,!1);c(n)}function f(t,i,r){u(t.target);h(i,r+": "+t.target.src,n,n)}function e(n){f(n,"imageLoad","Image loaded")}function o(n){f(n,"imageLoadFailed","Image load failed")}function l(n){h("mutationObserver","mutationObserver: "+n[0].target+" "+n[0].type);n.forEach(s)}function a(){var n=document.querySelector("body");return i=new v(l),t("Create body MutationObserver"),i.observe(n,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),i}var r=[],v=window.MutationObserver||window.WebKitMutationObserver,i=a();return{disconnect:function(){"disconnect"in i&&(t("Disconnect body MutationObserver"),i.disconnect(),r.forEach(u))}}}function fu(){var n=0>c;window.MutationObserver||window.WebKitMutationObserver?n?hi():st=uu():(t("MutationObserver not supported in this browser!"),hi())}function ft(n,t){function r(n){if(/^\d+(px)?$/i.test(n))return parseInt(n,ki);var i=t.style.left,r=t.runtimeStyle.left;return t.runtimeStyle.left=t.currentStyle.left,t.style.left=n||0,n=t.style.pixelLeft,t.style.left=i,t.runtimeStyle.left=r,n}var i=0;return t=t||document.body,"defaultView"in document&&"getComputedStyle"in document.defaultView?(i=document.defaultView.getComputedStyle(t,null),i=null!==i?i[n]:0):i=r(t.currentStyle[n]),parseInt(i,ki)}function eu(n){n>w/2&&(w=2*n,t("Event throttle increased to "+w+"ms"))}function et(n,i){for(var e=i.length,o=0,f=0,s=ti(n),r=rt(),u=0;u<e;u++)(o=i[u].getBoundingClientRect()[n]+ft("margin"+s,i[u]))>f&&(f=o);return r=rt()-r,t("Parsed "+e+" HTML elements"),t("Element position calculated in "+r+"ms"),eu(r),f}function k(n){return[n.bodyOffset(),n.bodyScroll(),n.documentElementOffset(),n.documentElementScroll()]}function ci(n,t){function r(){return s("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")}var i=document.querySelectorAll("["+t+"]");return 0===i.length&&r(),et(n,i)}function li(){return document.querySelectorAll("body *")}function ai(i,e,s,h){function y(){v=c;b=a;f(v,b,i)}function p(){function t(n,t){return!(Math.abs(n-t)<=vt)}return c=n!==s?s:o[r](),a=n!==h?h:l[u](),t(v,c)||g&&t(b,a)}function w(){return!(i in{init:1,interval:1,size:1})}function k(){return r in fr||g&&u in fr}function d(){t("No change in size detected")}function nt(){w()&&k()?pi(e):i in{interval:1}||d()}var c,a;p()||"init"===i?(vi(),y()):nt()}function h(n,i,r,u){function f(){n in{reset:1,resetPage:1,init:1}||t("Trigger event: "+i)}function e(){return it&&n in ou}e()?t("Trigger event cancelled: "+n):(f(),"init"===n?ai(n,i,r,u):cu(n,i,r,u))}function vi(){it||(it=!0,t("Trigger event lock on"));clearTimeout(sr);sr=setTimeout(function(){it=!1;t("Trigger event lock off");t("--")},ht)}function yi(n){v=o[r]();b=l[u]();f(v,b,n)}function pi(n){var i=r;r=ct;t("Reset trigger event: "+n);vi();yi("reset");r=i}function f(i,r,u,f,e){function o(){n===e?e=p:t("Message targetOrigin: "+e)}function s(){var s=i+":"+r,o=tt+":"+s+":"+u+(n!==f?":"+f:"");t("Sending message to host page ("+o+")");or.postMessage(nt+o,e)}!0===er&&(o(),s())}function wi(n){function e(){return nt===(""+n.data).substr(0,ur)}function u(){return n.data.split("]")[1].split(":")[0]}function i(){return n.data.substr(n.data.indexOf(":")+1)}function o(){return!("undefined"!=typeof module&&module.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype}function f(){return n.data.split(":")[2]in{"true":1,"false":1}}function c(){var t=u();t in r?r[t]():o()||f()||s("Unexpected message ("+n.data+")")}function l(){!1===nr?c():f()?r.init():t('Ignored message of type "'+u()+'". Received before initialization.')}var r={init:function(){ir=n.data;or=n.source;ar();nr=!1;setTimeout(function(){tr=!1},ht)},reset:function(){tr?t("Page reset ignored by init"):(t("Page size reset by host page"),yi("resetPage"))},resize:function(){h("resizeParent","Parent window requested size check")},moveToAnchor:function(){y.findTarget(i())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var n=i();t("PageInfoFromParent called from parent: "+n);wt(JSON.parse(n));t(" --")},message:function(){var n=i();t("MessageCallback called from parent: "+n);yt(JSON.parse(n));t(" --")}};e()&&l()}function bi(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}var dt;if("undefined"!=typeof window){var e=!0,ki=10,di="",ot=0,d="",st=null,gi="",g=!1,ou={resize:1,click:1},ht=128,nr=!0,v=1,ct="bodyOffset",r=ct,tr=!0,ir="",y={},c=32,rr=null,lt=!1,nt="[iFrameSizer]",ur=nt.length,tt="",fr={max:1,min:1,bodyScroll:1,documentElementScroll:1},at="child",er=!0,or=window.parent,p="*",vt=0,it=!1,sr=null,w=16,b=1,hr="scroll",u=hr,su=window,yt=function(){s("MessageCallback function not defined")},pt=function(){},wt=function(){},bt={height:function(){return s("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return s("Custom width calculation function not defined"),document.body.scrollWidth}},kt={},cr=!1,hu=!1;try{dt=Object.create({},{passive:{get:function(){cr=!0}},once:{get:function(){hu=!0}}});window.addEventListener("test",gt,dt);window.removeEventListener("test",gt,dt)}catch(lu){}var rt=Date.now||function(){return(new Date).getTime()},o={bodyOffset:function(){return document.body.offsetHeight+ft("marginTop")+ft("marginBottom")},offset:function(){return o.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return bt.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,k(o))},min:function(){return Math.min.apply(null,k(o))},grow:function(){return o.max()},lowestElement:function(){return Math.max(o.bodyOffset()||o.documentElementOffset(),et("bottom",li()))},taggedElement:function(){return ci("bottom","data-iframe-height")}},l={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return bt.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(l.bodyScroll(),l.documentElementScroll())},max:function(){return Math.max.apply(null,k(l))},min:function(){return Math.min.apply(null,k(l))},rightMostElement:function(){return et("right",li())},taggedElement:function(){return ci("right","data-iframe-width")}},cu=lr(ai);a(window,"message",wi);a(window,"readystatechange",bi);bi()}}()