(()=>{function e(e){return e&&e.__esModule?e.default:e}var t=globalThis,n={},i={},o=t.parcelRequire17b9;null==o&&((o=function(e){if(e in n)return n[e].exports;if(e in i){var t=i[e];delete i[e];var o={id:e,exports:{}};return n[e]=o,t.call(o.exports,o,o.exports),o.exports}var r=Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(e,t){i[e]=t},t.parcelRequire17b9=o),(0,o.register)("8UnLC",function(e,t){!function(t){if("undefined"!=typeof window){var n,i,o,r,a,s,c,d=!0,u=10,l="",f=0,m="",h=null,g="",p=!1,w={resize:1,click:1},b=128,y=!0,v=1,E="bodyOffset",T=E,I=!0,M="",x={},O=32,k=null,S=!1,z=!1,R="[iFrameSizer]",C=R.length,A="",N={max:1,min:1,bodyScroll:1,documentElementScroll:1},F="child",j=!0,L=window.parent,P="*",W=0,D=!1,H=null,U=16,q=1,B="scroll",_=B,V=window,$=function(){es("onMessage function not defined")},J=function(){},Y=function(){},X={height:function(){return es("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return es("Custom width calculation function not defined"),document.body.scrollWidth}},Q={},K=!1;try{var G=Object.create({},{passive:{get:function(){K=!0}}});window.addEventListener("test",en,G),window.removeEventListener("test",en,G)}catch(e){}var Z={bodyOffset:function(){return document.body.offsetHeight+ew("marginTop")+ew("marginBottom")},offset:function(){return Z.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return X.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,ey(Z))},min:function(){return Math.min.apply(null,ey(Z))},grow:function(){return Z.max()},lowestElement:function(){return Math.max(Z.bodyOffset()||Z.documentElementOffset(),eb("bottom",eE()))},taggedElement:function(){return ev("bottom","data-iframe-height")}},ee={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return X.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(ee.bodyScroll(),ee.documentElementScroll())},max:function(){return Math.max.apply(null,ey(ee))},min:function(){return Math.min.apply(null,ey(ee))},rightMostElement:function(){return eb("right",eE())},taggedElement:function(){return ev("right","data-iframe-width")}},et=(n=eT,a=null,s=0,c=function(){s=Date.now(),a=null,r=n.apply(i,o),a||(i=o=null)},function(){var e=Date.now();s||(s=e);var t=U-(e-s);return i=this,o=arguments,t<=0||t>U?(a&&(clearTimeout(a),a=null),s=e,r=n.apply(i,o),a||(i=o=null)):a||(a=setTimeout(c,t)),r});"iframeResizer"in window||(window.iframeChildListener=function(e){eS({data:e,sameDomian:!0})},ei(window,"message",eS),ei(window,"readystatechange",ez),ez())}function en(){}function ei(e,t,n,i){e.addEventListener(t,n,!!K&&(i||{}))}function eo(e){return e.charAt(0).toUpperCase()+e.slice(1)}function er(e){return R+"["+A+"] "+e}function ea(e){S&&"object"==typeof window.console&&console.log(er(e))}function es(e){"object"==typeof window.console&&console.warn(er(e))}function ec(e){var t=e.split("Callback");if(2===t.length){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],es("Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}function ed(e,n){t!==n&&""!==n&&"null"!==n&&(document.body.style[e]=n,ea("Body "+e+' set to "'+n+'"'))}function eu(e){var t={add:function(t){function n(){eI(e.eventName,e.eventType)}Q[t]=n,ei(window,t,n,{passive:!0})},remove:function(e){var t=Q[e];delete Q[e],window.removeEventListener(e,t,!1)}};e.eventNames&&Array.prototype.map?(e.eventName=e.eventNames[0],e.eventNames.map(t[e.method])):t[e.method](e.eventName),ea(eo(e.method)+" event listener: "+e.eventType)}function el(e){eu({method:e,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),eu({method:e,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),eu({method:e,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),eu({method:e,eventType:"Input",eventName:"input"}),eu({method:e,eventType:"Mouse Up",eventName:"mouseup"}),eu({method:e,eventType:"Mouse Down",eventName:"mousedown"}),eu({method:e,eventType:"Orientation Change",eventName:"orientationchange"}),eu({method:e,eventType:"Print",eventNames:["afterprint","beforeprint"]}),eu({method:e,eventType:"Ready State Change",eventName:"readystatechange"}),eu({method:e,eventType:"Touch Start",eventName:"touchstart"}),eu({method:e,eventType:"Touch End",eventName:"touchend"}),eu({method:e,eventType:"Touch Cancel",eventName:"touchcancel"}),eu({method:e,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),eu({method:e,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),eu({method:e,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),"child"===F&&eu({method:e,eventType:"IFrame Resized",eventName:"resize"})}function ef(e,t,n,i){return t!==e&&(e in n||(es(e+" is not a valid option for "+i+"CalculationMethod."),e=t),ea(i+' calculation method set to "'+e+'"')),e}function em(){T=ef(T,E,Z,"height")}function eh(){_=ef(_,B,ee,"width")}function eg(){var e;!0===d?(el("add"),e=0>O,window.MutationObserver||window.WebKitMutationObserver?e?ep():h=function(){function e(e){function t(e){!1===e.complete&&(ea("Attach listeners to "+e.src),e.addEventListener("load",i,!1),e.addEventListener("error",o,!1),a.push(e))}"attributes"===e.type&&"src"===e.attributeName?t(e.target):"childList"===e.type&&Array.prototype.forEach.call(e.target.querySelectorAll("img"),t)}function t(e){ea("Remove listeners from "+e.src),e.removeEventListener("load",i,!1),e.removeEventListener("error",o,!1),a.splice(a.indexOf(e),1)}function n(e,n,i){t(e.target),eI(n,i+": "+e.target.src)}function i(e){n(e,"imageLoad","Image loaded")}function o(e){n(e,"imageLoadFailed","Image load failed")}var r,a=[],s=window.MutationObserver||window.WebKitMutationObserver,c=(r=document.querySelector("body"),c=new s(function(t){eI("mutationObserver","mutationObserver: "+t[0].target+" "+t[0].type),t.forEach(e)}),ea("Create body MutationObserver"),c.observe(r,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),c);return{disconnect:function(){"disconnect"in c&&(ea("Disconnect body MutationObserver"),c.disconnect(),a.forEach(t))}}}():(ea("MutationObserver not supported in this browser!"),ep())):ea("Auto Resize disabled")}function ep(){0!==O&&(ea("setInterval: "+O+"ms"),k=setInterval(function(){eI("interval","setInterval: "+O)},Math.abs(O)))}function ew(e,t){var n=0;return t=t||document.body,parseInt(n=null===(n=document.defaultView.getComputedStyle(t,null))?0:n[e],u)}function eb(e,t){for(var n,i=t.length,o=0,r=0,a=eo(e),s=Date.now(),c=0;c<i;c++)(o=t[c].getBoundingClientRect()[e]+ew("margin"+a,t[c]))>r&&(r=o);return s=Date.now()-s,ea("Parsed "+i+" HTML elements"),ea("Element position calculated in "+s+"ms"),(n=s)>U/2&&ea("Event throttle increased to "+(U=2*n)+"ms"),r}function ey(e){return[e.bodyOffset(),e.bodyScroll(),e.documentElementOffset(),e.documentElementScroll()]}function ev(e,t){var n=document.querySelectorAll("["+t+"]");return 0===n.length&&(es("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")),eb(e,n)}function eE(){return document.querySelectorAll("body *")}function eT(e,n,i,o){var r,a;(function(){function e(e,t){return!(Math.abs(e-t)<=W)}return r=t===i?Z[T]():i,a=t===o?ee[_]():o,e(v,r)||p&&e(q,a)})()||"init"===e?(eM(),ek(v=r,q=a,e)):!(e in{init:1,interval:1,size:1})&&(T in N||p&&_ in N)?eO(n):e in{interval:1}||ea("No change in size detected")}function eI(e,t,n,i){D&&e in w?ea("Trigger event cancelled: "+e):(e in{reset:1,resetPage:1,init:1}||ea("Trigger event: "+t),"init"===e?eT(e,t,n,i):et(e,t,n,i))}function eM(){D||(D=!0,ea("Trigger event lock on")),clearTimeout(H),H=setTimeout(function(){D=!1,ea("Trigger event lock off"),ea("--")},b)}function ex(e){v=Z[T](),q=ee[_](),ek(v,q,e)}function eO(e){var t=T;T=E,ea("Reset trigger event: "+e),eM(),ex("reset"),T=t}function ek(e,n,i,o,r){if(!0===j){var a;t===r?r=P:ea("Message targetOrigin: "+r),ea("Sending message to host page ("+(a=A+":"+e+":"+n+":"+i+(t===o?"":":"+o))+")"),L.postMessage(R+a,r)}}function eS(n){var i={init:function(){var e,i;M=n.data,L=n.source,function(){function e(e){return"true"===e}var n=M.slice(C).split(":");A=n[0],f=t===n[1]?f:Number(n[1]),p=t===n[2]?p:e(n[2]),S=t===n[3]?S:e(n[3]),O=t===n[4]?O:Number(n[4]),d=t===n[6]?d:e(n[6]),m=n[7],T=t===n[8]?T:n[8],l=n[9],g=n[10],W=t===n[11]?W:Number(n[11]),x.enable=t!==n[12]&&e(n[12]),F=t===n[13]?F:n[13],_=t===n[14]?_:n[14],z=t===n[15]?z:e(n[15])}(),ea("Initialising iFrame ("+window.location.href+")"),function(){function e(e,t){return"function"==typeof e&&(ea("Setup custom "+t+"CalcMethod"),X[t]=e,e="custom"),e}if("iFrameResizer"in window&&Object===window.iFrameResizer.constructor){var t;ea("Reading data from page: "+JSON.stringify(t=window.iFrameResizer)),Object.keys(t).forEach(ec,t),$="onMessage"in t?t.onMessage:$,J="onReady"in t?t.onReady:J,P="targetOrigin"in t?t.targetOrigin:P,T="heightCalculationMethod"in t?t.heightCalculationMethod:T,_="widthCalculationMethod"in t?t.widthCalculationMethod:_,T=e(T,"height"),_=e(_,"width")}ea("TargetOrigin for parent set to: "+P)}(),t===m&&(m=f+"px"),ed("margin",(-1!==(e=m).indexOf("-")&&(es("Negative CSS value ignored for margin"),e=""),e)),ed("background",l),ed("padding",g),(i=document.createElement("div")).style.clear="both",i.style.display="block",i.style.height="0",document.body.appendChild(i),em(),eh(),document.documentElement.style.height="",document.body.style.height="",ea('HTML & body height set to "auto"'),ea("Enable public methods"),V.parentIFrame={autoResize:function(e){return!0===e&&!1===d?(d=!0,eg()):!1===e&&!0===d&&(d=!1,el("remove"),null!==h&&h.disconnect(),clearInterval(k)),ek(0,0,"autoResize",JSON.stringify(d)),d},close:function(){ek(0,0,"close")},getId:function(){return A},getPageInfo:function(e){"function"==typeof e?(Y=e,ek(0,0,"pageInfo")):(Y=function(){},ek(0,0,"pageInfoStop"))},moveToAnchor:function(e){x.findTarget(e)},reset:function(){eO("parentIFrame.reset")},scrollTo:function(e,t){ek(t,e,"scrollTo")},scrollToOffset:function(e,t){ek(t,e,"scrollToOffset")},sendMessage:function(e,t){ek(0,0,"message",JSON.stringify(e),t)},setHeightCalculationMethod:function(e){T=e,em()},setWidthCalculationMethod:function(e){_=e,eh()},setTargetOrigin:function(e){ea("Set targetOrigin: "+e),P=e},size:function(e,t){eI("size","parentIFrame.size("+(e||"")+(t?","+t:"")+")",e,t)}},function(){function e(e){ek(0,0,e.type,e.screenY+":"+e.screenX)}function t(t,n){ea("Add event listener: "+n),ei(window.document,t,e)}!0===z&&(t("mouseenter","Mouse Enter"),t("mouseleave","Mouse Leave"))}(),eg(),x=function(){function e(e){var n=e.split("#")[1]||e,i=decodeURIComponent(n),o=document.getElementById(i)||document.getElementsByName(i)[0];if(t===o)ea("In page link (#"+n+") not found in iFrame, so sending to parent"),ek(0,0,"inPageLink","#"+n);else{var r,a,s=(r=o.getBoundingClientRect(),a={x:window.pageXOffset===t?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===t?document.documentElement.scrollTop:window.pageYOffset},{x:parseInt(r.left,10)+parseInt(a.x,10),y:parseInt(r.top,10)+parseInt(a.y,10)});ea("Moving to in page link (#"+n+") at x: "+s.x+" y: "+s.y),ek(s.y,s.x,"scrollToOffset")}}function n(){var t=window.location.hash,n=window.location.href;""!==t&&"#"!==t&&e(n)}return x.enable?Array.prototype.forEach&&document.querySelectorAll?(ea("Setting up location.hash handlers"),Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(t){"#"!==t.getAttribute("href")&&ei(t,"click",function(t){t.preventDefault(),e(this.getAttribute("href"))})}),ei(window,"hashchange",n),setTimeout(n,b)):es("In page linking not fully supported in this browser! (See README.md for IE8 workaround)"):ea("In page linking not enabled"),{findTarget:e}}(),eI("init","Init message from host page"),J(),y=!1,setTimeout(function(){I=!1},b)},reset:function(){I?ea("Page reset ignored by init"):(ea("Page size reset by host page"),ex("resetPage"))},resize:function(){eI("resizeParent","Parent window requested size check")},moveToAnchor:function(){x.findTarget(r())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var e=r();ea("PageInfoFromParent called from parent: "+e),Y(JSON.parse(e)),ea(" --")},message:function(){var e=r();ea("onMessage called from parent: "+e),$(JSON.parse(e)),ea(" --")}};function o(){return n.data.split("]")[1].split(":")[0]}function r(){return n.data.slice(n.data.indexOf(":")+1)}function a(){return n.data.split(":")[2]in{true:1,false:1}}R===(""+n.data).slice(0,C)&&function(){if(!1===y){var r;(r=o())in i?i[r]():!e.exports&&"iFrameResize"in window||window.jQuery!==t&&"iFrameResize"in window.jQuery.prototype||a()||es("Unexpected message ("+n.data+")")}else a()?i.init():ea('Ignored message of type "'+o()+'". Received before initialization.')}()}function ez(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}}()});var r={},a={};console.info(`
IFRAME-RESIZER

Iframe-Resizer 5 is now available via the following two packages:

 * @iframe-resizer/parent
 * @iframe-resizer/child

Additionally their are also new versions of iframe-resizer for React, Vue, and jQuery.

Version 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.

Please see https://iframe-resizer.com/upgrade for more details.
`),function(e){if("undefined"!=typeof window){var t,n,i=0,o=!1,r=!1,s=7,c="[iFrameSizer]",d=c.length,u=null,l=window.requestAnimationFrame,f=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),m={},h=null,g=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){I("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),p={};void 0!==window.jQuery&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each(function(t,n){L(n,e)}).end()}):T("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof define&&define.amd?define([],H):"object"==typeof a&&(a=H()),window.iFrameResize=window.iFrameResize||H()}function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function b(e,t,n){e.addEventListener(t,n,!1)}function y(e,t,n){e.removeEventListener(t,n,!1)}function v(e){return m[e]?m[e].log:o}function E(e,t){M("log",e,t,v(e))}function T(e,t){M("info",e,t,v(e))}function I(e,t){M("warn",e,t,!0)}function M(e,t,n,i){var o;!0===i&&"object"==typeof window.console&&console[e](c+"["+(o="Host page: "+t,window.top!==window.self&&(o=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+t:"Nested host page: "+t),o)+"]",n)}function x(e){function t(){n("Height"),n("Width"),N(function(){A(H),R(U),O(U,"onResized",H)},H,"init")}function n(e){var t=Number(m[U]["max"+e]),n=Number(m[U]["min"+e]),i=e.toLowerCase(),o=Number(H[i]);E(U,"Checking "+i+" is in range "+n+"-"+t),o<n&&(o=n,E(U,"Set "+i+" to min value")),o>t&&(o=t,E(U,"Set "+i+" to max value")),H[i]=""+o}function i(e){return D.slice(D.indexOf(":")+s+e)}function o(e,t){var n,i;n=function(){var n,i;F("Send Page Info","pageInfo:"+(n=document.body.getBoundingClientRect(),JSON.stringify({iframeHeight:(i=H.iframe.getBoundingClientRect()).height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-n.top,10),offsetLeft:parseInt(i.left-n.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,t)},p[i=t]||(p[i]=setTimeout(function(){p[i]=null,n()},32))}function r(e){var t=e.getBoundingClientRect();return z(U),{x:Math.floor(Number(t.left)+Number(u.x)),y:Math.floor(Number(t.top)+Number(u.y))}}function a(e){var t=e?r(H.iframe):{x:0,y:0},n={x:Number(H.width)+t.x,y:Number(H.height)+t.y};E(U,"Reposition requested from iFrame (offset x:"+t.x+" y:"+t.y+")"),window.top===window.self?(u=n,l(),E(U,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](n.x,n.y):I(U,"Unable to scroll to requested position, window.parentIFrame not found")}function l(){!1===O(U,"onScroll",u)?u=null:R(U)}function f(e){var t,n,o={};if(0===Number(H.width)&&0===Number(H.height)){var r=i(9).split(":");o={x:r[1],y:r[0]}}else o={x:H.width,y:H.height};t=e,n={iframe:H.iframe,screenX:Number(o.x),screenY:Number(o.y),type:H.type},O(U,t,n)}var h,g,w,v,M,x,k,L,P,W,D=e.data,H={},U=null;if("[iFrameResizerChild]Ready"===D)for(var q in m)F("iFrame requested init",j(q),m[q].iframe,q);else if(c===(""+D).slice(0,d)&&D.slice(d).split(":")[0]in m){(v=(w=D.slice(d).split(":"))[1]?parseInt(w[1],10):0,x=getComputedStyle(M=m[w[0]]&&m[w[0]].iframe),m[U=(H={iframe:M,id:w[0],height:v+("border-box"!==(h=x).boxSizing?0:(h.paddingTop?parseInt(h.paddingTop,10):0)+(h.paddingBottom?parseInt(h.paddingBottom,10):0))+("border-box"!==(g=x).boxSizing?0:(g.borderTopWidth?parseInt(g.borderTopWidth,10):0)+(g.borderBottomWidth?parseInt(g.borderBottomWidth,10):0)),width:w[2],type:w[3]}).id]&&(m[U].loaded=!0),(k=H.type in{true:1,false:1,undefined:1})&&E(U,"Ignoring init message from meta parent page"),!k&&(P=!0,m[L=U]||(P=!1,I(H.type+" No settings for "+L+". Message was: "+D)),P))&&(E(U,"Received: "+D),W=!0,null===H.iframe&&(I(U,"IFrame ("+H.id+") not found"),W=!1),W&&function(){var t,n=e.origin,i=m[U]&&m[U].checkOrigin;if(i&&""+n!="null"&&!(i.constructor===Array?function(){var e=0,t=!1;for(E(U,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===n){t=!0;break}return t}():(t=m[U]&&m[U].remoteHost,E(U,"Checking connection is from: "+t),n===t)))throw Error("Unexpected message received from: "+n+" for "+H.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(m[U]&&m[U].firstRun&&m[U]&&(m[U].firstRun=!1),H.type){case"close":S(H.iframe);break;case"message":w=i(6),E(U,"onMessage passed: {iframe: "+H.iframe.id+", message: "+w+"}"),g="onMessage",p={iframe:H.iframe,message:JSON.parse(w)},O(U,g,p),E(U,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":m[U].autoResize=JSON.parse(i(9));break;case"scrollTo":a(!1);break;case"scrollToOffset":a(!0);break;case"pageInfo":function e(e,t){function i(){m[T]?o(m[T].iframe,T):n()}["scroll","resize"].forEach(function(n){E(T,e+n+" listener for sendPageInfo"),t(window,n,i)})}function n(){e("Remove ",y)}o(m[U]&&m[U].iframe,U);var s,c,d,h,g,p,w,v,T=U;e("Add ",b),m[T]&&(m[T].stopPageInfo=n);break;case"pageInfoStop":m[U]&&m[U].stopPageInfo&&(m[U].stopPageInfo(),delete m[U].stopPageInfo);break;case"inPageLink":d=decodeURIComponent(c=i(9).split("#")[1]||""),(h=document.getElementById(d)||document.getElementsByName(d)[0])?(s=r(h),E(U,"Moving to in page link (#"+c+") at x: "+s.x+" y: "+s.y),u={x:s.x,y:s.y},l(),E(U,"--")):window.top===window.self?E(U,"In page link #"+c+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(c):E(U,"In page link #"+c+" not found and window.parentIFrame not found");break;case"reset":C(H);break;case"init":t(),v=H.iframe,O(U,"onInit",v);break;default:0===Number(H.width)&&0===Number(H.height)?I("Unsupported message received ("+H.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):t()}}())}else T(U,"Ignored: "+D)}function O(e,t,n){var i=null,o=null;if(m[e])if("function"==typeof(i=m[e][t]))o=i(n);else throw TypeError(t+" on iFrame["+e+"] is not a function");return o}function k(e){var t=e.id;delete m[t]}function S(e){var t=e.id;if(!1===O(t,"onClose",t))return void E(t,"Close iframe cancelled by onClose event");E(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){I(e)}O(t,"onClosed",t),E(t,"--"),k(e),n&&(n.disconnect(),n=null)}function z(t){null===u&&E(t,"Get page position: "+(u={x:void 0===window.pageXOffset?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+u.y)}function R(e){null!==u&&(window.scrollTo(u.x,u.y),E(e,"Set page position: "+u.x+","+u.y),u=null)}function C(e){E(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),z(e.id),N(function(){A(e),F("reset","reset",e.iframe,e.id)},e,"reset")}function A(e){function t(t){!function(t){if(!e.id)return E("undefined","messageData id not set");e.iframe.style[t]=e[t]+"px",E(e.id,"IFrame ("+n+") "+t+" set to "+e[t]+"px")}(t),r||"0"!==e[t]||(r=!0,E(n,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(m).forEach(function(e){function t(t){return"0px"===(m[e]&&m[e].iframe.style[t])}m[e]&&null!==m[e].iframe.offsetParent&&(t("height")||t("width"))&&F("Visibility change","resize",m[e].iframe,e)})}var t,n=w();n&&(t=document.querySelector("body"),new n(function(t){E("window","Mutation observed: "+t[0].target+" "+t[0].type),P(e,16)}).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}var n=e.iframe.id;m[n]&&(m[n].sizeHeight&&t("height"),m[n].sizeWidth&&t("width"))}function N(e,t,n){n!==t.type&&l&&!window.jasmine?(E(t.id,"Requesting animation frame"),l(e)):e()}function F(e,t,n,i,o){var r,a=!1;m[i=i||n.id]&&(n&&"contentWindow"in n&&null!==n.contentWindow?(r=m[i]&&m[i].targetOrigin,E(i,"["+e+"] Sending msg to iframe["+i+"] ("+t+") targetOrigin: "+r),n.contentWindow.postMessage(c+t,r)):I(i,"["+e+"] IFrame("+i+") not found"),o&&m[i]&&m[i].warningTimeout&&(m[i].msgTimeout=setTimeout(function(){!m[i]||m[i].loaded||a||(a=!0,I(i,"IFrame has not responded within "+m[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},m[i].warningTimeout)))}function j(e){return e+":"+m[e].bodyMarginV1+":"+m[e].sizeWidth+":"+m[e].log+":"+m[e].interval+":"+m[e].enablePublicMethods+":"+m[e].autoResize+":"+m[e].bodyMargin+":"+m[e].heightCalculationMethod+":"+m[e].bodyBackground+":"+m[e].bodyPadding+":"+m[e].tolerance+":"+m[e].inPageLinks+":"+m[e].resizeFrom+":"+m[e].widthCalculationMethod+":"+m[e].mouseEvents}function L(t,r){var a=function(e){if("string"!=typeof e)throw TypeError("Invaild id for iFrame. Expected String");if(""===e){var n;n=r&&r.id||g.id+i++,null!==document.getElementById(n)&&(n+=i++),t.id=e=n,o=(r||{}).log,E(e,"Added missing iframe ID: "+e+" ("+t.src+")")}return e}(t.id);if(a in m&&"iFrameResizer"in t)I(a,"Ignored iFrame, already setup.");else{var s,c,d,u=r;if(u=u||{},m[a]=Object.create(null),m[a].iframe=t,m[a].firstRun=!0,m[a].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),"object"!=typeof u)throw TypeError("Options is not an object");Object.keys(u).forEach(function(e){var t=e.split("Callback");if(2===t.length){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],I(a,"Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}},u);var l=u;for(var h in g)Object.prototype.hasOwnProperty.call(g,h)&&(m[a][h]=Object.prototype.hasOwnProperty.call(l,h)?l[h]:g[h]);switch(m[a]&&(m[a].targetOrigin=!0===m[a].checkOrigin?""===(s=m[a].remoteHost)||null!==s.match(/^(about:blank|javascript:|file:\/\/)/)?"*":s:"*"),E(a,"IFrame scrolling "+(m[a]&&m[a].scrolling?"enabled":"disabled")+" for "+a),t.style.overflow=!1===(m[a]&&m[a].scrolling)?"hidden":"auto",m[a]&&m[a].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=m[a]?m[a].scrolling:"no"}function p(e){var n=m[a][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,E(a,"Set "+e+" = "+t.style[e]))}function y(e){if(m[a]["min"+e]>m[a]["max"+e])throw Error("Value for min"+e+" can not be greater than max"+e)}y("Height"),y("Width"),p("maxHeight"),p("minHeight"),p("maxWidth"),p("minWidth"),("number"==typeof(m[a]&&m[a].bodyMargin)||"0"===(m[a]&&m[a].bodyMargin))&&(m[a].bodyMarginV1=m[a].bodyMargin,m[a].bodyMargin=""+m[a].bodyMargin+"px"),c=j(a),(d=w())&&(n=function(e){if(!t.parentNode)return null;var n=new e(function(e){e.forEach(function(e){Array.prototype.slice.call(e.removedNodes).forEach(function(e){e===t&&S(t)})})});return n.observe(t.parentNode,{childList:!0}),n}(d)),b(t,"load",function(){var n,i;F("iFrame.onload",c,t,e,!0),n=m[a]&&m[a].firstRun,i=m[a]&&m[a].heightCalculationMethod in f,!n&&i&&C({iframe:t,height:0,width:0,type:"init"})}),F("init",c,t,e,!0),m[a]&&(m[a].iframe.iFrameResizer={close:S.bind(null,m[a].iframe),removeListeners:k.bind(null,m[a].iframe),resize:F.bind(null,"Window resize","resize",m[a].iframe),moveToAnchor:function(e){F("Move to anchor","moveToAnchor:"+e,m[a].iframe,a)},sendMessage:function(e){F("Send Message","message:"+(e=JSON.stringify(e)),m[a].iframe,a)}})}}function P(e,t){null===h&&(h=setTimeout(function(){h=null,e()},t))}function W(){"hidden"!==document.visibilityState&&(E("document","Trigger event: Visibility change"),P(function(){D("Tab Visible","resize")},16))}function D(e,t){Object.keys(m).forEach(function(n){m[n]&&"parent"===m[n].resizeFrom&&m[n].autoResize&&!m[n].firstRun&&F(e,t,m[n].iframe,n)})}function H(){function t(e,t){if(t){if(t.tagName){if("IFRAME"!==t.tagName.toUpperCase())throw TypeError("Expected <IFRAME> tag, found <"+t.tagName+">")}else throw TypeError("Object is not a valid DOM element");L(t,e),n.push(t)}}var n,i,o=["moz","webkit","o","ms"];for(i=0;i<o.length&&!l;i+=1)l=window[o[i]+"RequestAnimationFrame"];return l?l=l.bind(window):E("setup","RequestAnimationFrame not supported"),b(window,"message",x),b(window,"resize",function(){var e;E("window","Trigger event: "+(e="resize")),P(function(){D("Window "+e,"resize")},16)}),b(document,"visibilitychange",W),b(document,"-webkit-visibilitychange",W),function(i,o){switch(n=[],i&&i.enablePublicMethods&&I("enablePublicMethods option has been removed, public methods are now always available in the iFrame"),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),t.bind(e,i));break;case"object":t(i,o);break;default:throw TypeError("Unexpected data type ("+typeof o+")")}return n}}}(),r={iframeResize:a,iframeResizer:a,contentWindow:o("8UnLC")};var s={};s=function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}return function t(n,i){function o(t,o,r){if("undefined"!=typeof document){"number"==typeof(r=e({},i,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in r)r[s]&&(a+="; "+s,!0!==r[s]&&(a+="="+r[s].split(";")[0]));return document.cookie=t+"="+n.write(o,t)+a}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],i={},o=0;o<t.length;o++){var r=t[o].split("="),a=r.slice(1).join("=");try{var s=decodeURIComponent(r[0]);if(i[s]=n.read(a,s),e===s)break}catch(e){}}return e?i[e]:i}},remove:function(t,n){o(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}();window.potio={canSkipToCheckout:new Promise(e=>e)};let c="potio-session-id";class d extends HTMLElement{uid;domain;constructor(){super(),this.uid=Math.random().toString(36).slice(-6),this.attachShadow({mode:"open"}),this.handleMessage=this.handleMessage.bind(this)}connectedCallback(){if(this.getAttribute("data-key")&&!this.getAttribute("key")&&this.setAttribute("key",this.getAttribute("data-key")),!this.getAttribute("key"))throw Error("Key is not defined");if(this.action=this.getAttribute("action"),"signup"!==this.action&&"payment"!==this.action&&"hidden"!==this.action)throw Error("Action must be either signup or payment");"hidden"===this.action&&(this.style.display="none"),this.render(),this.initIframeResizer(),window.addEventListener("message",this.handleMessage,!1)}disconnectedCallback(){window.removeEventListener("message",this.handleMessage,!1)}getIframe(){return this.shadowRoot.querySelector(`#potio-iframe-${this.uid}`)}getURL(){let e=[],t={action:this.action,client_reference_id:this.getAttribute("client-reference-id")||this.getAttribute("client_reference_id"),customer_email:this.getAttribute("customer-email")||this.getAttribute("customer_email"),customer:this.getAttribute("customer"),fetch:this.getAttribute("fetch"),experiment:this.getAttribute("experiment"),parentUri:window.location.href};for(let{name:n,value:i}of(Object.keys(t).forEach(n=>{let i=t[n];i&&e.push(`${n}=${i}`)}),this.attributes))n.startsWith("metadata-")&&e.push(`${n}=${i}`);let n=this.getAttribute("key");return`https://pricing-table.potio.cc/${n}/#${e.join("&")}`}render(){this.shadowRoot.innerHTML=`
      <style>
        :host {
          display: block;
          border: none;
        }
        body {
          margin: 0;
        }
        iframe {
          width: 100%;
          height: 100%; /* You can make this dynamic */
          border: none;
        }
      </style>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.9/iframeResizer.min.js"></script>
      <iframe id="potio-iframe-${this.uid}" src="${this.getURL()}" frameborder="0" allowtransparency="true"></iframe>
    `}initIframeResizer(){setTimeout(()=>{let e=this.getIframe();(0,r.iframeResizer)({log:!1},e)},0)}async handleMessage(e){let{type:t,options:n}=e.data;switch(t){case"navigate":let{url:i}=n;window.location.href=i;break;case"ready":this.dispatchEvent(new CustomEvent("ready"));break;case"analytics_event":let{event:o}=n;delete n.event,this.dispatchEvent(new CustomEvent(o,{detail:n}));break;case"fetch":let r=await this._fetch(n);this._sendData({fetch:r})}}_checkoutPrice(e,t){this._sendData({checkoutPrice:e,returnUrl:t})}_sendData(e){let t=this.getIframe();t&&t.contentWindow&&t.contentWindow.postMessage(e,"*")}async _fetch({url:e,index:t,options:n={}}){n.credentials="include",n.headers=n.headers||{};let i=this._getSessionID();i&&(n.headers["Potio-Session"]=i);try{let i=await fetch(e,n),o=i.headers.get("Potio-Domain");o&&(this.domain=o);let r=i.headers.get("Potio-Session");if(r&&this._setSessionID(r),!i.ok){let e=await i.text();return{error:Error(`HTTP ${i.status}: ${e}`),index:t}}return{data:await i.json(),index:t}}catch(e){return{error:e,index:t}}}_getSessionID(){let t=e(s).get(c),n=localStorage.getItem(c);return t||n?(t&&n||this._setSessionID(t),t||n):null}_setSessionID(t){e(s).set(c,t,{expires:730,domain:"."+this.domain}),localStorage.setItem(c,t)}}customElements.define("potio-pricing-table",d);class u extends HTMLElement{constructor(){super()}connectedCallback(){let e=new d;Array.from(this.attributes).forEach(t=>e.setAttribute(t.name,t.value)),e.setAttribute("experiment","yes"),this.insertAdjacentElement("afterend",e)}}customElements.define("potio-experiment",u)})();
//# sourceMappingURL=index.js.map
