/*! iframe resizer (iframesizer.min.js ) - v3.6.3 - 2018-10-28 * desc: force cross domain iframes to size to content. * requires: iframeresizer.contentwindow.min.js to be loaded into the target frame. * copyright: (c) 2018 david j. bradshaw - dave@bradshaw.net * license: mit */ !function(a){"use strict";function b(a,b,c){"addeventlistener"in window?a.addeventlistener(b,c,!1):"attachevent"in window&&a.attachevent("on"+b,c)}function c(a,b,c){"removeeventlistener"in window?a.removeeventlistener(b,c,!1):"detachevent"in window&&a.detachevent("on"+b,c)}function d(){var a,b=["moz","webkit","o","ms"];for(a=0;ab&&(e=b,h(v,"set "+d+" to max value")),u[d]=""+e}function g(){function b(){function a(){var a=0,b=!1;for(h(v,"checking connection is from allowed list of origins: "+d);ar[y]["max"+a])throw new error("value for min"+a+" can not be greater than max"+a)}b("height"),b("width"),a("maxheight"),a("minheight"),a("maxwidth"),a("minwidth")}function f(){var a=d&&d.id||u.id+h++;return null!==document.getelementbyid(a)&&(a+=h++),a}function g(a){return t=a,""===a&&(c.id=a=f(),i=(d||{}).log,t=a,h(a,"added missing iframe id: "+a+" ("+c.src+")")),a}function i(){switch(h(y,"iframe scrolling "+(r[y]&&r[y].scrolling?"enabled":"disabled")+" for "+y),c.style.overflow=!1===(r[y]&&r[y].scrolling)?"hidden":"auto",r[y]&&r[y].scrolling){case"omit":break;case!0:c.scrolling="yes";break;case!1:c.scrolling="no";break;default:c.scrolling=r[y]?r[y].scrolling:"no"}}function k(){"number"!=typeof(r[y]&&r[y].bodymargin)&&"0"!==(r[y]&&r[y].bodymargin)||(r[y].bodymarginv1=r[y].bodymargin,r[y].bodymargin=r[y].bodymargin+"px")}function l(){var a=r[y]&&r[y].firstrun,b=r[y]&&r[y].heightcalculationmethod in q;!a&&b&&s({iframe:c,height:0,width:0,type:"init"})}function m(){function.prototype.bind&&r[y]&&(r[y].iframe.iframeresizer={close:o.bind(null,r[y].iframe),removelisteners:n.bind(null,r[y].iframe),resize:v.bind(null,"window resize","resize",r[y].iframe),movetoanchor:function(a){v("move to anchor","movetoanchor:"+a,r[y].iframe,y)},sendmessage:function(a){a=json.stringify(a),v("send message","message:"+a,r[y].iframe,y)}})}function p(d){function e(){v("iframe.onload",d,c,a,!0),l()}b(c,"load",e),v("init",d,c,a,!0)}function q(a){if("object"!=typeof a)throw new typeerror("options is not an object")}function r(a){for(var b in u)u.hasownproperty(b)&&(r[y][b]=a.hasownproperty(b)?a[b]:u[b])}function t(a){return""===a||"file://"===a?"*":a}function u(a){a=a||{},r[y]={firstrun:!0,iframe:c,remotehost:c.src.split("/").slice(0,3).join("/")},q(a),r(a),r[y]&&(r[y].targetorigin=!0===r[y].checkorigin?t(r[y].remotehost):"*")}function x(){return y in r&&"iframeresizer"in c}var y=g(c.id);x()?j(y,"ignored iframe, already setup."):(u(d),i(),e(),k(),p(w(y)),m())}function y(a,b){null===s&&(s=settimeout(function(){s=null,a()},b))}function z(a,b,c){v[c]||(v[c]=settimeout(function(){v[c]=null,a()},b))}function a(){function a(){function a(a){function b(b){return"0px"===(r[a]&&r[a].iframe.style[b])}function c(a){return null!==a.offsetparent}r[a]&&c(r[a].iframe)&&(b("height")||b("width"))&&v("visibility change","resize",r[a].iframe,a)}for(var b in r)a(b)}function b(b){h("window","mutation observed: "+b[0].target+" "+b[0].type),y(a,16)}function c(){var a=document.queryselector("body"),c={attributes:!0,attributeoldvalue:!1,characterdata:!0,characterdataoldvalue:!1,childlist:!0,subtree:!0};new d(b).observe(a,c)}var d=window.mutationobserver||window.webkitmutationobserver;d&&c()}function b(a){function b(){d("window "+a,"resize")}h("window","trigger event: "+a),y(b,16)}function c(){function a(){d("tab visable","resize")}"hidden"!==document.visibilitystate&&(h("document","trigger event: visiblity change"),y(a,16))}function d(a,b){function c(a){return r[a]&&"parent"===r[a].resizefrom&&r[a].autoresize&&!r[a].firstrun}for(var d in r)c(d)&&v(a,b,document.getelementbyid(d),d)}function e(){b(window,"message",l),b(window,"resize",function(){b("resize")}),b(document,"visibilitychange",c),b(document,"-webkit-visibilitychange",c),b(window,"focusin",function(){b("focus")}),b(window,"focus",function(){b("focus")})}function f(){function b(a,b){function c(){if(!b.tagname)throw new typeerror("object is not a valid dom element");if("iframe"!==b.tagname.touppercase())throw new typeerror("expected