// source --> https://nice-boating-tomorrow.com/wp-content/plugins/ays-popup-box/public/js/ays-pb-public.js?ver=6.1.8 
(function( $ ) {
	'use strict';

	/**
	 * All of the code for your public-facing JavaScript source
	 * should reside in this file.
	 *
	 * Note: It has been assumed you will write jQuery code here, so the
	 * $ function reference has been prepared for usage within the scope
	 * of this function.
	 *
	 * This enables you to define handlers, for when the DOM is ready:
	 *
	 * $(function() {
	 *
	 * });
	 *
	 * When the window is loaded:
	 *
	 * $( window ).load(function() {
	 *
	 * });
	 *
	 * ...and/or other possibilities.
	 *
	 * Ideally, it is not considered best practise to attach more than a
	 * single DOM-ready or window-load handler for a particular page.
	 * Although scripts in the WordPress core, Plugins and Themes may be
	 * practising this, we should strive to set a better example in our own work.
	 */

	$(document).ready(function (){
		// Answer Sound Muter
		$(document).on('click', '.ays_pb_music_sound', function() {
			var $this = $(this);
			var audioEl = $(document).find('.ays_pb_sound').get(0);
			if($this.hasClass('ays_sound_active')){
				audioEl.volume = 0;
				$this.find('.ays_pb_fa_volume').remove();
				$this.html(pbLocalizeObj.icons.volume_mute_icon);
				$this.find('.ays_pb_fa_volume').addClass('ays_pb_fa_volume_off').removeClass('ays_pb_fa_volume');
				$this.removeClass('ays_sound_active');
			} else {
				audioEl.volume = 1;
				$this.find('.ays_pb_fa_volume_off').remove();
				$this.html(pbLocalizeObj.icons.volume_up_icon);
				$this.find('.ays_pb_fa_volume_off').addClass('ays_pb_fa_volume').removeClass('ays_pb_fa_volume_off');
				$this.addClass('ays_sound_active');
			}
		});

		$(document).on('click', '#ays_pb_dismiss_ad', function(){
			var expTime = $(this).parent().data('dismiss');
			var id = $(this).parent().data('id');

			if(expTime != ''){
				set_cookies('ays_pb_dismiss_ad_'+id, 'ays_pb_dismiss_ad_'+id, parseInt(expTime));
			}else{
				var expiryDate = new Date();
				expiryDate.setMonth(expiryDate.getMonth() + 1);
				set_cookies('ays_pb_dismiss_ad_'+id, 'ays_pb_dismiss_ad_'+id, expiryDate);
			}
			$(document).find('.ays-pb-modal-close_'+id).trigger('click');
		});

		$(document).on('click', '.asypb-cta', function(){
			let popupContainer = $(this).closest('.ays-pb-modals');
			if (!popupContainer) return;

			// Check if conversion already updated
			if (typeof popupContainer.attr('data-updated-conversion') != 'undefined') return

			var classValue = popupContainer.attr('class');
			var id = classValue.match(/av_pop_modals_(\d+)/)[1];
			updatePopupConversions(id);

			popupContainer.attr('data-updated-conversion', true);
		});

		function set_cookies( cname, cvalue, exdays ) {
			var expires = 'expires=' +  (new Date(Date.now() + exdays)).toUTCString();  
				document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/';
		}

		var isMobileDevice = false;
		if (window.innerWidth < 768) {
			isMobileDevice = true;
		}

		$('div.ays-pb-modals').each(function() {
			var classValue = $(this).attr('class');
			var id = classValue.match(/av_pop_modals_(\d+)/)[1];
			var popup = JSON.parse(atob(window.aysPopupOptions[id])).popupbox;
			var popupOptions = JSON.parse(popup.options);

			var actionType = popup.action_button_type;
			var openDelay = popup.delay;
			var scrollTop = popup.scroll_top;

			var template = popup.view_type;
			var height = popup.height;
			var minHeight = popupOptions.pb_min_height;
			var borderSize = (typeof popup.bordersize != 'undefined') ? popup.bordersize : 0;
			var enableborderSizeMobile = (typeof popupOptions != 'undefined' && typeof popupOptions.enable_bordersize_mobile != 'undefined' && popupOptions.enable_bordersize_mobile == 'on') ? true : false;
			if (typeof popupOptions != 'undefined' && typeof popupOptions.bordersize_mobile != 'undefined') {
				var borderSizeMobile = popupOptions.bordersize_mobile;
			} else {
				var borderSizeMobile = borderSize;
			}

			if (!enableborderSizeMobile) {
				borderSizeMobile = borderSize;
			}

			var enableFullScreen = popupOptions.enable_pb_fullscreen == 'on' ? true : false;

			var closeButtonPosition = popupOptions.close_button_position;
			var closeButtonText = popupOptions.close_button_text;
			var closeButtonImage = popupOptions.close_button_image;

			var enableOpenDelayMobile = popupOptions.enable_open_delay_mobile == 'on' ? true : false ;
			var enableScrollTopMobile = popupOptions.enable_scroll_top_mobile == 'on' ? true : false ;
			var enableCloseButtonPositionMobile = popupOptions.enable_close_button_position_mobile == 'on' ? true : false ;
			var enableCloseButtonTextMobile = popupOptions.enable_close_button_text_mobile == 'on' ? true : false ;

			$(document).find('.ays-pb-modal-close_'+id).on('click', function() {
				$(document).find('input#ays-pb-modal-checkbox_' + id).trigger('change');
			})

			var formattedBorderSize = borderSize;
			if (isMobileDevice) {
				if (enableCloseButtonPositionMobile) {
					closeButtonPosition = popupOptions.close_button_position_mobile;
				}
				if (enableCloseButtonTextMobile) {
					closeButtonText = popupOptions.close_button_text_mobile;
				}
				if (enableOpenDelayMobile) {
					openDelay = popupOptions.open_delay_mobile;
				}
				if (enableScrollTopMobile) {
					scrollTop = popupOptions.scroll_top_mobile;
				}
				if (enableborderSizeMobile) {
					formattedBorderSize = borderSizeMobile;
				}

				height = popupOptions.mobile_height ? popupOptions.mobile_height : popup.height;
				enableFullScreen = false;
			}

			if (actionType == 'both' || actionType == 'pageLoaded') {
				if (openDelay == 0 && scrollTop == 0) {
					$(document).find('input#ays-pb-modal-checkbox_' + id).prop('checked', true);
				}
			}

			if (enableFullScreen) {
				height = window.innerHeight;
			}
			setCloseButtonPosition(template, id, height, minHeight, formattedBorderSize, enableFullScreen, closeButtonPosition, closeButtonImage);
			setCloseButtonText(closeButtonText, closeButtonImage, id, template);
		});

		function setCloseButtonPosition(template, id, height, minHeight, borderSize, enableFullScreen, closeButtonPosition, closeButtonImage) {
			if (template !== 'default' && template !== 'lil' && template !== 'image' && template !== 'template' && template !== 'video' && template !== 'minimal' && template !== 'image_type_img_theme' && template !== 'facebook' && template !== 'notification') {
				return false;
			}

			var heightForPosition = height;
			if (minHeight > height) {
				heightForPosition = minHeight;
			}

			var closeButtonPositionValue = {};

			if (template == 'default' || template == 'image_type_img_theme' || template == 'facebook') {
				var aysConteiner       = parseInt(heightForPosition);
				var h2Height           = $(document).find('.ays-pb-modal_' + id + ' h2').outerHeight(true);
				var hrHeight           = $(document).find('.ays-pb-modal_' + id + ' hr').outerHeight(true);
				var descriptionHeight  = $(document).find('.ays-pb-modal_' + id + ' .ays_pb_description').outerHeight(true);
				var timerHeight        = $(document).find('.ays-pb-modal_' + id + ' .ays_pb_timer_' + id).outerHeight(true);
				var customHtml         = $(document).find('.ays-pb-modal_' + id + ' .ays_content_box').outerHeight(true);

				if(h2Height == undefined){
					h2Height = 0;
				}
				if(hrHeight == undefined){
					hrHeight = 0;
				}
				if(descriptionHeight == undefined){
					descriptionHeight = 0;
				}
				if(timerHeight == undefined){
					timerHeight = 0;
				}
				if(customHtml == undefined){
					customHtml = 0;
				}
				var aysConteinerHeight = (h2Height + descriptionHeight + timerHeight + customHtml + hrHeight);
				if(aysConteinerHeight < aysConteiner){
					if(enableFullScreen){
						aysConteinerHeight =  (aysConteiner - 75) + 'px';
					}else{
						aysConteinerHeight =  (aysConteiner - 55) + 'px';
					}
				}
				switch(closeButtonPosition) {
					case 'left-top':
						closeButtonPositionValue = {top: '10px', left: '10px'};
						break;
					case 'left-bottom':
						closeButtonPositionValue = {top: aysConteinerHeight, left: '10px'};
						break;
					case 'right-bottom':
						closeButtonPositionValue = {top: aysConteinerHeight, right: '10px'};		
						break;
					default:
						closeButtonPositionValue = {top: '10px', right: '4%'};
						break;
				}
			} else if (template == 'lil') {
				var closeButtonTop;
				if(enableFullScreen){
					closeButtonTop = heightForPosition - 43 + (2 * borderSize);
				}else{
					closeButtonTop = heightForPosition - 43 - (2 * borderSize);
				}
				switch(closeButtonPosition) {
					case 'left-top':
						closeButtonPositionValue = { top: '10px', left: '10px' };
						break;
					case 'left-bottom':
						closeButtonPositionValue = { top: closeButtonTop + 'px', left: '10px' };
						break;
					case 'right-bottom':
						 closeButtonPositionValue = { top: closeButtonTop + 'px', right: '40px', bottom: 'auto', left: 'auto' };
						break;
					default:
						closeButtonPositionValue = { top: '10px', right: '40px' };
						break;
				}
			} else if (template == 'template') {
				var closeBttnImageExist = closeButtonImage != '';
				switch(closeButtonPosition) {
					case 'left-top':
						var sidePostion = closeBttnImageExist ? 30 + 'px' : 20 + 'px';
						closeButtonPositionValue = { top: '14px', left: sidePostion };
						break;
					case 'left-bottom':
						var sidePostion = closeBttnImageExist ? 30 + 'px' : 16 + 'px';
						closeButtonPositionValue = { bottom: '25px', left: sidePostion };
						break;
					case 'right-bottom':
						var sidePostion = closeBttnImageExist ? 30 + 'px' : 16 + 'px';
						closeButtonPositionValue = { bottom: '25px', right: sidePostion };
						break;
					default:
						var sidePostion = closeBttnImageExist ? 30 + 'px' : 20 + 'px';
						closeButtonPositionValue = { top: '14px', right: sidePostion };
						break;
				}
			} else if (template == 'image' || template == 'minimal' || template == 'video') {
				switch(closeButtonPosition) {
					case 'left-top':
						if (enableFullScreen) {
							closeButtonPositionValue = { right: '97%' };
						} else {
							closeButtonPositionValue = {
								top: (-25 - borderSize) + 'px',
								left: (-borderSize) + 'px'
							};
						}
						break;
					case 'left-bottom':
						if (enableFullScreen) {
							closeButtonPositionValue = { top: '97%', right: '95%' };
						} else {
							var close_btn_pos = -15 - borderSize;
							closeButtonPositionValue = {
								bottom: close_btn_pos + 'px',
								left: (-borderSize) + 'px'
							};
						}
						break;
					case 'right-bottom':
						if (enableFullScreen) {
							closeButtonPositionValue = { top: '97%', left: '95%' };
						} else {
							var close_btn_pos = -15 - borderSize;
							closeButtonPositionValue = {
								bottom: close_btn_pos + 'px',
								right: (-borderSize) + 26 + 'px'
							};
						}
						break;
					default:
						if (template == 'image' || template == 'minimal') {
							var top = (enableFullScreen) ? (6 - borderSize) + 'px' : (-29 - borderSize) + 'px';
							closeButtonPositionValue = {
								top: top,
								right: (-borderSize) + 26 + 'px'
							};
						}
						if (template == 'video') {
							if (enableFullScreen) {
								closeButtonPositionValue = { right: '15px' };
							} else {
								closeButtonPositionValue = { 
									top: (-25 - borderSize) + 'px',
									right: (-borderSize) + 15 + 'px'
								};
							}
						}
						break;
				}
			} else if (template == 'notification') {
				switch(closeButtonPosition) {
					case 'left-top':
						closeButtonPositionValue = {top: '0', left: '0'};
						break;
					case 'left-bottom':
						closeButtonPositionValue = {bottom: '0', left: '0'};
						break;
					case 'right-bottom':
						closeButtonPositionValue = {bottom: '0', right: '0'};		
						break;
					default:
						closeButtonPositionValue = {top: '0', right: '0'};
						break;
				}
			}
			closeButtonPositionValue.position = 'absolute';
			$(document).find('.ays-pb-modal_' + id + ' .ays-pb-modal-close_' + id).css(closeButtonPositionValue);

		}

		function setCloseButtonText(closeButtonText, closeButtonImage, id, template) {
			var currentCloseBttnContainer = $(document).find('div.ays-pb-modal-close_' + id );
			var defaultCloseIcon = '<svg class="ays_pb_material_close_icon" xmlns="https://www.w3.org/2000/svg" height="36px" viewBox="0 0 24 24" width="36px" fill="#000000" alt="Pop-up Close"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>';
			var text = '';
			var closeBttnContainerClass = '';

			switch(template) {
				case 'default':
				case 'image_type_img_theme':
				case 'facebook':
				case 'notification':
					if(closeButtonImage != ""){
						text = "<img class='close_btn_img' src='" + closeButtonImage + "' width='30' height='30'>";
					}else{
						if(closeButtonText === '✕'){
							text = defaultCloseIcon;
						}else{
							text = closeButtonText;
						}
					}
					currentCloseBttnContainer.html(text);
					break;
				case 'win98':
					text = closeButtonText;
					currentCloseBttnContainer.find('span').html(text);
					break;
				case 'lil':
					if(closeButtonImage != ""){
						text = "<img class='close_btn_img' src='" + closeButtonImage + "' width='50' height='50'>";
					}else{
						text = closeButtonText;
						if(closeButtonText != '✕'){
							closeBttnContainerClass = 'close-lil-btn-text';
						}
					}
					currentCloseBttnContainer.find('a').addClass(closeBttnContainerClass);
					currentCloseBttnContainer.find('a').html(text);
					break;
				case 'image':
				case 'template':
				case 'minimal':
				case 'video':
					if(closeButtonImage != ""){
						text = "<img class='close_btn_img' src='" + closeButtonImage + "' width='30' height='30'>";
					}else{
						text = closeButtonText;
					}
					currentCloseBttnContainer.find('div').html(text);
					break
			}
		}

		function updatePopupConversions(id) {
			$.ajax({
				url: pbLocalizeObj.ajax,
				method: 'POST',
				dataType: 'text',
				data: {
					id: id,
					action: 'ays_increment_pb_conversions',
				},
			});
		}
	})

})( jQuery );

window.onload = function(){
	var classList = document.body.classList;
	document.ontouchmove = function(e){
    	for( var i = 0; i < classList.length; i++ ){
    		if( classList[i].startsWith('pb_disable_scroll_') ){
    			if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
                    e.preventDefault(); 
    			}
    			break;
    		}
    	}
	}

	// Handle scrollbar visibility on window resize and initial load
	function updateScrollbarVisibility() {
		var popups = document.querySelectorAll('.ays-pb-modal, .ays_cmd_window, .ays-pb-modal-macos, .ays_ubuntu_window, .ays_winxp_window, .ays_lil_window, .ays_image_window .ays_image_main, .ays_minimal_window .ays_minimal_main, .ays_template_window, .ays_win98_window');
		var isMobile = window.innerWidth < 768;
		
		popups.forEach(function(popup) {
			if (isMobile) {
				if (popup.classList.contains('ays-pb-show-scrollbar-mobile')) {
					popup.classList.add('ays-pb-show-scrollbar');
				} else {
					popup.classList.remove('ays-pb-show-scrollbar');
				}
			} else {
				if (popup.classList.contains('ays-pb-show-scrollbar-desktop')) {
					popup.classList.add('ays-pb-show-scrollbar');
				} else {
					popup.classList.remove('ays-pb-show-scrollbar');
				}
			}
		});
	}

	// Update on page load
	updateScrollbarVisibility();

	// Update on window resize with debounce
	var resizeTimer;
	window.addEventListener('resize', function() {
		clearTimeout(resizeTimer);
		resizeTimer = setTimeout(updateScrollbarVisibility, 250);
	});
};
// source --> https://nice-boating-tomorrow.com/wp-content/plugins/popups-for-divi/scripts/ie-compat.min.js?ver=3.2.5 
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e,t=[],r="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(e||(e={}));var n,o,i,s,a,c=function(e){return Object.freeze(e)},u=function(e,t){this.inlineSize=e,this.blockSize=t,c(this)},h=function(){function e(e,t,r,n){return this.x=e,this.y=t,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,c(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),f=function(e){return e instanceof SVGElement&&"getBBox"in e},l=function(e){if(f(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var o=e,i=o.offsetWidth,s=o.offsetHeight;return!(i||s||e.getClientRects().length)},d=function(e){var t,r;if(e instanceof Element)return!0;var n=null===(r=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===r?void 0:r.defaultView;return!!(n&&e instanceof n.Element)},p="undefined"!=typeof window?window:{},v=new WeakMap,g=/auto|scroll/,b=/^tb|vertical/,m=/msie|trident/i.test(p.navigator&&p.navigator.userAgent),y=function(e){return parseFloat(e||"0")},w=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=!1),new u((r?t:e)||0,(r?e:t)||0)},E=c({devicePixelContentBoxSize:w(),borderBoxSize:w(),contentBoxSize:w(),contentRect:new h(0,0,0,0)}),S=function(e,t){if(void 0===t&&(t=!1),v.has(e)&&!t)return v.get(e);if(l(e))return v.set(e,E),E;var r=getComputedStyle(e),n=f(e)&&e.ownerSVGElement&&e.getBBox(),o=!m&&"border-box"===r.boxSizing,i=b.test(r.writingMode||""),s=!n&&g.test(r.overflowY||""),a=!n&&g.test(r.overflowX||""),u=n?0:y(r.paddingTop),d=n?0:y(r.paddingRight),p=n?0:y(r.paddingBottom),S=n?0:y(r.paddingLeft),x=n?0:y(r.borderTopWidth),T=n?0:y(r.borderRightWidth),z=n?0:y(r.borderBottomWidth),B=S+d,O=u+p,R=(n?0:y(r.borderLeftWidth))+T,M=x+z,A=a?e.offsetHeight-M-e.clientHeight:0,k=s?e.offsetWidth-R-e.clientWidth:0,C=o?B+R:0,N=o?O+M:0,D=n?n.width:y(r.width)-C-k,F=n?n.height:y(r.height)-N-A,P=D+B+k+R,_=F+O+A+M,j=c({devicePixelContentBoxSize:w(Math.round(D*devicePixelRatio),Math.round(F*devicePixelRatio),i),borderBoxSize:w(P,_,i),contentBoxSize:w(D,F,i),contentRect:new h(S,u,D,F)});return v.set(e,j),j},x=function(t,r,n){var o=S(t,n),i=o.borderBoxSize,s=o.contentBoxSize,a=o.devicePixelContentBoxSize;switch(r){case e.DEVICE_PIXEL_CONTENT_BOX:return a;case e.BORDER_BOX:return i;default:return s}},T=function(e){var t=S(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=c([t.borderBoxSize]),this.contentBoxSize=c([t.contentBoxSize]),this.devicePixelContentBoxSize=c([t.devicePixelContentBoxSize])},z=function(e){if(l(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},B=function(){var e=1/0,r=[];t.forEach((function(t){if(0!==t.activeTargets.length){var n=[];t.activeTargets.forEach((function(t){var r=new T(t.target),o=z(t.target);n.push(r),t.lastReportedSize=x(t.target,t.observedBox),o<e&&(e=o)})),r.push((function(){t.callback.call(t.observer,n,t.observer)})),t.activeTargets.splice(0,t.activeTargets.length)}}));for(var n=0,o=r;n<o.length;n++){(0,o[n])()}return e},O=function(e){t.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(r){r.isActive()&&(z(r.target)>e?t.activeTargets.push(r):t.skippedTargets.push(r))}))}))},R=function(){var e,n=0;for(O(n);t.some((function(e){return e.activeTargets.length>0}));)n=B(),O(n);return t.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:r}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=r),window.dispatchEvent(e)),n>0},M=[],A=function(e){if(!n){var t=0,r=document.createTextNode("");new MutationObserver((function(){return M.splice(0).forEach((function(e){return e()}))})).observe(r,{characterData:!0}),n=function(){r.textContent=""+(t?t--:t++)}}M.push(e),n()},k=0,C={attributes:!0,characterData:!0,childList:!0,subtree:!0},N=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],D=function(e){return void 0===e&&(e=0),Date.now()+e},F=!1,P=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!F){F=!0;var r,n=D(e);r=function(){var r=!1;try{r=R()}finally{if(F=!1,e=n-D(),!k)return;r?t.run(1e3):e>0?t.run(e):t.start()}},A((function(){requestAnimationFrame(r)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,C)};document.body?t():p.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),N.forEach((function(t){return p.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),N.forEach((function(t){return p.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),_=function(e){!k&&e>0&&P.start(),!(k+=e)&&P.stop()},j=function(){function t(t,r){this.target=t,this.observedBox=r||e.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e,t=x(this.target,this.observedBox,!0);return e=this.target,f(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},t}(),I=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},L=new WeakMap,W=function(e,t){for(var r=0;r<e.length;r+=1)if(e[r].target===t)return r;return-1},X=function(){function e(){}return e.connect=function(e,t){var r=new I(e,t);L.set(e,r)},e.observe=function(e,r,n){var o=L.get(e),i=0===o.observationTargets.length;W(o.observationTargets,r)<0&&(i&&t.push(o),o.observationTargets.push(new j(r,n&&n.box)),_(1),P.schedule())},e.unobserve=function(e,r){var n=L.get(e),o=W(n.observationTargets,r),i=1===n.observationTargets.length;o>=0&&(i&&t.splice(t.indexOf(n),1),n.observationTargets.splice(o,1),_(-1))},e.disconnect=function(e){var t=this,r=L.get(e);r.observationTargets.slice().forEach((function(r){return t.unobserve(e,r.target)})),r.activeTargets.splice(0,r.activeTargets.length)},e}(),V=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");X.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!d(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");X.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!d(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");X.unobserve(this,e)},e.prototype.disconnect=function(){X.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),r=t.length;--r>=0&&t.item(r)!==this;);return r>-1}),Array.from||(Array.from=(o=Object.prototype.toString,i=function(e){return"function"==typeof e||"[object Function]"===o.call(e)},s=Math.pow(2,53)-1,a=function(e){var t=function(e){var t=Number(e);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t}(e);return Math.min(Math.max(t,0),s)},function(e){var t=this,r=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n,o=arguments.length>1?arguments[1]:void 0;if(void 0!==o){if(!i(o))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(n=arguments[2])}for(var s,c=a(r.length),u=i(t)?Object(new t(c)):new Array(c),h=0;h<c;)s=r[h],u[h]=o?void 0===n?o(s,h):o.call(n,s,h):s,h+=1;return u.length=c,u})),function(){var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,r){if(r=void 0!==r?r:this.length,"[object Array]"===Object.prototype.toString.call(this))return e.call(this,t,r);var n,o,i=[],s=this.length,a=t||0;a=a>=0?a:Math.max(0,s+a);var c="number"==typeof r?Math.min(r,s):s;if(r<0&&(c=s+r),(o=c-a)>0)if(i=new Array(o),this.charAt)for(n=0;n<o;n++)i[n]=this.charAt(a+n);else for(n=0;n<o;n++)i[n]=this[a+n];return i}}}(),window.ResizeObserver=V,String.prototype.padStart||Object.defineProperty(String.prototype,"padStart",{configurable:!0,writable:!0,value:function(e,t){return e>>=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}})}));