Σ(゚Д゚;≡;゚д゚)Σ(゚Д゚;≡;゚д゚)Σ(゚Д゚;≡;゚д゚)始,故人唐宰相鲁公,🆚开府南服,余以布衣从戎。明年,别公漳水湄。后明年,公以事过张睢阳庙及颜杲卿所尝往来处,悲歌慷慨,卒不负其言而从之游。今其诗具在,可考也。😭 HEX
HEX
Server: Apache
System: Linux webm006.cluster120.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64
User: studionolh (122383)
PHP: 7.3.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/s/t/u/studionolh/www/wp-includes/Requests/Cookie/reusable-blocks/scripts.tar
post.js000064400000115412152333263710006100 0ustar00/**
 * @file Contains all dynamic functionality needed on post and term pages.
 *
 * @output wp-admin/js/post.js
 */

 /* global ajaxurl, wpAjax, postboxes, pagenow, tinymce, alert, deleteUserSetting, ClipboardJS */
 /* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply, commentsBox */
 /* global WPSetThumbnailHTML, wptitlehint */

// Backward compatibility: prevent fatal errors.
window.makeSlugeditClickable = window.editPermalink = function(){};

// Make sure the wp object exists.
window.wp = window.wp || {};

( function( $ ) {
	var titleHasFocus = false,
		__ = wp.i18n.__;

	/**
	 * Control loading of comments on the post and term edit pages.
	 *
	 * @type {{st: number, get: commentsBox.get, load: commentsBox.load}}
	 *
	 * @namespace commentsBox
	 */
	window.commentsBox = {
		// Comment offset to use when fetching new comments.
		st : 0,

		/**
		 * Fetch comments using Ajax and display them in the box.
		 *
		 * @memberof commentsBox
		 *
		 * @param {number} total Total number of comments for this post.
		 * @param {number} num   Optional. Number of comments to fetch, defaults to 20.
		 * @return {boolean} Always returns false.
		 */
		get : function(total, num) {
			var st = this.st, data;
			if ( ! num )
				num = 20;

			this.st += num;
			this.total = total;
			$( '#commentsdiv .spinner' ).addClass( 'is-active' );

			data = {
				'action' : 'get-comments',
				'mode' : 'single',
				'_ajax_nonce' : $('#add_comment_nonce').val(),
				'p' : $('#post_ID').val(),
				'start' : st,
				'number' : num
			};

			$.post(
				ajaxurl,
				data,
				function(r) {
					r = wpAjax.parseAjaxResponse(r);
					$('#commentsdiv .widefat').show();
					$( '#commentsdiv .spinner' ).removeClass( 'is-active' );

					if ( 'object' == typeof r && r.responses[0] ) {
						$('#the-comment-list').append( r.responses[0].data );

						theList = theExtraList = null;
						$( 'a[className*=\':\']' ).off();

						// If the offset is over the total number of comments we cannot fetch any more, so hide the button.
						if ( commentsBox.st > commentsBox.total )
							$('#show-comments').hide();
						else
							$('#show-comments').show().children('a').text( __( 'Show more comments' ) );

						return;
					} else if ( 1 == r ) {
						$('#show-comments').text( __( 'No more comments found.' ) );
						return;
					}

					$('#the-comment-list').append('<tr><td colspan="2">'+wpAjax.broken+'</td></tr>');
				}
			);

			return false;
		},

		/**
		 * Load the next batch of comments.
		 *
		 * @memberof commentsBox
		 *
		 * @param {number} total Total number of comments to load.
		 */
		load: function(total){
			this.st = jQuery('#the-comment-list tr.comment:visible').length;
			this.get(total);
		}
	};

	/**
	 * Overwrite the content of the Featured Image postbox
	 *
	 * @param {string} html New HTML to be displayed in the content area of the postbox.
	 *
	 * @global
	 */
	window.WPSetThumbnailHTML = function(html){
		$('.inside', '#postimagediv').html(html);
	};

	/**
	 * Set the Image ID of the Featured Image
	 *
	 * @param {number} id The post_id of the image to use as Featured Image.
	 *
	 * @global
	 */
	window.WPSetThumbnailID = function(id){
		var field = $('input[value="_thumbnail_id"]', '#list-table');
		if ( field.length > 0 ) {
			$('#meta\\[' + field.attr('id').match(/[0-9]+/) + '\\]\\[value\\]').text(id);
		}
	};

	/**
	 * Remove the Featured Image
	 *
	 * @param {string} nonce Nonce to use in the request.
	 *
	 * @global
	 */
	window.WPRemoveThumbnail = function(nonce){
		$.post(
			ajaxurl, {
				action: 'set-post-thumbnail',
				post_id: $( '#post_ID' ).val(),
				thumbnail_id: -1,
				_ajax_nonce: nonce,
				cookie: encodeURIComponent( document.cookie )
			},
			/**
			 * Handle server response
			 *
			 * @param {string} str Response, will be '0' when an error occurred otherwise contains link to add Featured Image.
			 */
			function(str){
				if ( str == '0' ) {
					alert( __( 'Could not set that as the thumbnail image. Try a different attachment.' ) );
				} else {
					WPSetThumbnailHTML(str);
				}
			}
		);
	};

	/**
	 * Heartbeat locks.
	 *
	 * Used to lock editing of an object by only one user at a time.
	 *
	 * When the user does not send a heartbeat in a heartbeat-time
	 * the user is no longer editing and another user can start editing.
	 */
	$(document).on( 'heartbeat-send.refresh-lock', function( e, data ) {
		var lock = $('#active_post_lock').val(),
			post_id = $('#post_ID').val(),
			send = {};

		if ( ! post_id || ! $('#post-lock-dialog').length )
			return;

		send.post_id = post_id;

		if ( lock )
			send.lock = lock;

		data['wp-refresh-post-lock'] = send;

	}).on( 'heartbeat-tick.refresh-lock', function( e, data ) {
		// Post locks: update the lock string or show the dialog if somebody has taken over editing.
		var received, wrap, avatar;

		if ( data['wp-refresh-post-lock'] ) {
			received = data['wp-refresh-post-lock'];

			if ( received.lock_error ) {
				// Show "editing taken over" message.
				wrap = $('#post-lock-dialog');

				if ( wrap.length && ! wrap.is(':visible') ) {
					if ( wp.autosave ) {
						// Save the latest changes and disable.
						$(document).one( 'heartbeat-tick', function() {
							wp.autosave.server.suspend();
							wrap.removeClass('saving').addClass('saved');
							$(window).off( 'beforeunload.edit-post' );
						});

						wrap.addClass('saving');
						wp.autosave.server.triggerSave();
					}

					if ( received.lock_error.avatar_src ) {
						avatar = $( '<img />', {
							'class': 'avatar avatar-64 photo',
							width: 64,
							height: 64,
							alt: '',
							src: received.lock_error.avatar_src,
							srcset: received.lock_error.avatar_src_2x ?
								received.lock_error.avatar_src_2x + ' 2x' :
								undefined
						} );
						wrap.find('div.post-locked-avatar').empty().append( avatar );
					}

					wrap.show().find('.currently-editing').text( received.lock_error.text );
					wrap.find('.wp-tab-first').trigger( 'focus' );
				}
			} else if ( received.new_lock ) {
				$('#active_post_lock').val( received.new_lock );
			}
		}
	}).on( 'before-autosave.update-post-slug', function() {
		titleHasFocus = document.activeElement && document.activeElement.id === 'title';
	}).on( 'after-autosave.update-post-slug', function() {

		/*
		 * Create slug area only if not already there
		 * and the title field was not focused (user was not typing a title) when autosave ran.
		 */
		if ( ! $('#edit-slug-box > *').length && ! titleHasFocus ) {
			$.post( ajaxurl, {
					action: 'sample-permalink',
					post_id: $('#post_ID').val(),
					new_title: $('#title').val(),
					samplepermalinknonce: $('#samplepermalinknonce').val()
				},
				function( data ) {
					if ( data != '-1' ) {
						$('#edit-slug-box').html(data);
					}
				}
			);
		}
	});

}(jQuery));

/**
 * Heartbeat refresh nonces.
 */
(function($) {
	var check, timeout;

	/**
	 * Only allow to check for nonce refresh every 30 seconds.
	 */
	function schedule() {
		check = false;
		window.clearTimeout( timeout );
		timeout = window.setTimeout( function(){ check = true; }, 300000 );
	}

	$( function() {
		schedule();
	}).on( 'heartbeat-send.wp-refresh-nonces', function( e, data ) {
		var post_id,
			$authCheck = $('#wp-auth-check-wrap');

		if ( check || ( $authCheck.length && ! $authCheck.hasClass( 'hidden' ) ) ) {
			if ( ( post_id = $('#post_ID').val() ) && $('#_wpnonce').val() ) {
				data['wp-refresh-post-nonces'] = {
					post_id: post_id
				};
			}
		}
	}).on( 'heartbeat-tick.wp-refresh-nonces', function( e, data ) {
		var nonces = data['wp-refresh-post-nonces'];

		if ( nonces ) {
			schedule();

			if ( nonces.replace ) {
				$.each( nonces.replace, function( selector, value ) {
					$( '#' + selector ).val( value );
				});
			}

			if ( nonces.heartbeatNonce )
				window.heartbeatSettings.nonce = nonces.heartbeatNonce;
		}
	});
}(jQuery));

/**
 * All post and postbox controls and functionality.
 */
jQuery( function($) {
	var stamp, visibility, $submitButtons, updateVisibility, updateText,
		$textarea = $('#content'),
		$document = $(document),
		postId = $('#post_ID').val() || 0,
		$submitpost = $('#submitpost'),
		releaseLock = true,
		$postVisibilitySelect = $('#post-visibility-select'),
		$timestampdiv = $('#timestampdiv'),
		$postStatusSelect = $('#post-status-select'),
		isMac = window.navigator.platform ? window.navigator.platform.indexOf( 'Mac' ) !== -1 : false,
		copyAttachmentURLClipboard = new ClipboardJS( '.copy-attachment-url.edit-media' ),
		copyAttachmentURLSuccessTimeout,
		__ = wp.i18n.__, _x = wp.i18n._x;

	postboxes.add_postbox_toggles(pagenow);

	/*
	 * Clear the window name. Otherwise if this is a former preview window where the user navigated to edit another post,
	 * and the first post is still being edited, clicking Preview there will use this window to show the preview.
	 */
	window.name = '';

	// Post locks: contain focus inside the dialog. If the dialog is shown, focus the first item.
	$('#post-lock-dialog .notification-dialog').on( 'keydown', function(e) {
		// Don't do anything when [Tab] is pressed.
		if ( e.which != 9 )
			return;

		var target = $(e.target);

		// [Shift] + [Tab] on first tab cycles back to last tab.
		if ( target.hasClass('wp-tab-first') && e.shiftKey ) {
			$(this).find('.wp-tab-last').trigger( 'focus' );
			e.preventDefault();
		// [Tab] on last tab cycles back to first tab.
		} else if ( target.hasClass('wp-tab-last') && ! e.shiftKey ) {
			$(this).find('.wp-tab-first').trigger( 'focus' );
			e.preventDefault();
		}
	}).filter(':visible').find('.wp-tab-first').trigger( 'focus' );

	// Set the heartbeat interval to 10 seconds if post lock dialogs are enabled.
	if ( wp.heartbeat && $('#post-lock-dialog').length ) {
		wp.heartbeat.interval( 10 );
	}

	// The form is being submitted by the user.
	$submitButtons = $submitpost.find( ':submit, a.submitdelete, #post-preview' ).on( 'click.edit-post', function( event ) {
		var $button = $(this);

		if ( $button.hasClass('disabled') ) {
			event.preventDefault();
			return;
		}

		if ( $button.hasClass('submitdelete') || $button.is( '#post-preview' ) ) {
			return;
		}

		// The form submission can be blocked from JS or by using HTML 5.0 validation on some fields.
		// Run this only on an actual 'submit'.
		$('form#post').off( 'submit.edit-post' ).on( 'submit.edit-post', function( event ) {
			if ( event.isDefaultPrevented() ) {
				return;
			}

			// Stop auto save.
			if ( wp.autosave ) {
				wp.autosave.server.suspend();
			}

			if ( typeof commentReply !== 'undefined' ) {
				/*
				 * Warn the user they have an unsaved comment before submitting
				 * the post data for update.
				 */
				if ( ! commentReply.discardCommentChanges() ) {
					return false;
				}

				/*
				 * Close the comment edit/reply form if open to stop the form
				 * action from interfering with the post's form action.
				 */
				commentReply.close();
			}

			releaseLock = false;
			$(window).off( 'beforeunload.edit-post' );

			$submitButtons.addClass( 'disabled' );

			if ( $button.attr('id') === 'publish' ) {
				$submitpost.find( '#major-publishing-actions .spinner' ).addClass( 'is-active' );
			} else {
				$submitpost.find( '#minor-publishing .spinner' ).addClass( 'is-active' );
			}
		});
	});

	// Submit the form saving a draft or an autosave, and show a preview in a new tab.
	$('#post-preview').on( 'click.post-preview', function( event ) {
		var $this = $(this),
			$form = $('form#post'),
			$previewField = $('input#wp-preview'),
			target = $this.attr('target') || 'wp-preview',
			ua = navigator.userAgent.toLowerCase();

		event.preventDefault();

		if ( $this.hasClass('disabled') ) {
			return;
		}

		if ( wp.autosave ) {
			wp.autosave.server.tempBlockSave();
		}

		$previewField.val('dopreview');
		$form.attr( 'target', target ).trigger( 'submit' ).attr( 'target', '' );

		// Workaround for WebKit bug preventing a form submitting twice to the same action.
		// https://bugs.webkit.org/show_bug.cgi?id=28633
		if ( ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1 ) {
			$form.attr( 'action', function( index, value ) {
				return value + '?t=' + ( new Date() ).getTime();
			});
		}

		$previewField.val('');
	});

	// Auto save new posts after a title is typed.
	if ( $( '#auto_draft' ).val() ) {
		$( '#title' ).on( 'blur', function() {
			var cancel;

			if ( ! this.value || $('#edit-slug-box > *').length ) {
				return;
			}

			// Cancel the auto save when the blur was triggered by the user submitting the form.
			$('form#post').one( 'submit', function() {
				cancel = true;
			});

			window.setTimeout( function() {
				if ( ! cancel && wp.autosave ) {
					wp.autosave.server.triggerSave();
				}
			}, 200 );
		});
	}

	$document.on( 'autosave-disable-buttons.edit-post', function() {
		$submitButtons.addClass( 'disabled' );
	}).on( 'autosave-enable-buttons.edit-post', function() {
		if ( ! wp.heartbeat || ! wp.heartbeat.hasConnectionError() ) {
			$submitButtons.removeClass( 'disabled' );
		}
	}).on( 'before-autosave.edit-post', function() {
		$( '.autosave-message' ).text( __( 'Saving Draft…' ) );
	}).on( 'after-autosave.edit-post', function( event, data ) {
		$( '.autosave-message' ).text( data.message );

		if ( $( document.body ).hasClass( 'post-new-php' ) ) {
			$( '.submitbox .submitdelete' ).show();
		}
	});

	/*
	 * When the user is trying to load another page, or reloads current page
	 * show a confirmation dialog when there are unsaved changes.
	 */
	$( window ).on( 'beforeunload.edit-post', function( event ) {
		var editor  = window.tinymce && window.tinymce.get( 'content' );
		var changed = false;

		if ( wp.autosave ) {
			changed = wp.autosave.server.postChanged();
		} else if ( editor ) {
			changed = ( ! editor.isHidden() && editor.isDirty() );
		}

		if ( changed ) {
			event.preventDefault();
			// The return string is needed for browser compat.
			// See https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event.
			return __( 'The changes you made will be lost if you navigate away from this page.' );
		}
	}).on( 'pagehide.edit-post', function( event ) {
		if ( ! releaseLock ) {
			return;
		}

		/*
		 * Unload is triggered (by hand) on removing the Thickbox iframe.
		 * Make sure we process only the main document unload.
		 */
		if ( event.target && event.target.nodeName != '#document' ) {
			return;
		}

		var postID = $('#post_ID').val();
		var postLock = $('#active_post_lock').val();

		if ( ! postID || ! postLock ) {
			return;
		}

		var data = {
			action: 'wp-remove-post-lock',
			_wpnonce: $('#_wpnonce').val(),
			post_ID: postID,
			active_post_lock: postLock
		};

		if ( window.FormData && window.navigator.sendBeacon ) {
			var formData = new window.FormData();

			$.each( data, function( key, value ) {
				formData.append( key, value );
			});

			if ( window.navigator.sendBeacon( ajaxurl, formData ) ) {
				return;
			}
		}

		// Fall back to a synchronous POST request.
		// See https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon
		$.post({
			async: false,
			data: data,
			url: ajaxurl
		});
	});

	// Multiple taxonomies.
	if ( $('#tagsdiv-post_tag').length ) {
		window.tagBox && window.tagBox.init();
	} else {
		$('.meta-box-sortables').children('div.postbox').each(function(){
			if ( this.id.indexOf('tagsdiv-') === 0 ) {
				window.tagBox && window.tagBox.init();
				return false;
			}
		});
	}

	// Handle categories.
	$('.categorydiv').each( function(){
		var this_id = $(this).attr('id'), catAddBefore, catAddAfter, taxonomyParts, taxonomy, settingName;

		taxonomyParts = this_id.split('-');
		taxonomyParts.shift();
		taxonomy = taxonomyParts.join('-');
		settingName = taxonomy + '_tab';

		if ( taxonomy == 'category' ) {
			settingName = 'cats';
		}

		// @todo Move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.js.
		$('a', '#' + taxonomy + '-tabs').on( 'click', function( e ) {
			e.preventDefault();
			var t = $(this).attr('href');
			$(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
			$('#' + taxonomy + '-tabs').siblings('.tabs-panel').hide();
			$(t).show();
			if ( '#' + taxonomy + '-all' == t ) {
				deleteUserSetting( settingName );
			} else {
				setUserSetting( settingName, 'pop' );
			}
		});

		if ( getUserSetting( settingName ) )
			$('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').trigger( 'click' );

		// Add category button controls.
		$('#new' + taxonomy).one( 'focus', function() {
			$( this ).val( '' ).removeClass( 'form-input-tip' );
		});

		// On [Enter] submit the taxonomy.
		$('#new' + taxonomy).on( 'keypress', function(event){
			if( 13 === event.keyCode ) {
				event.preventDefault();
				$('#' + taxonomy + '-add-submit').trigger( 'click' );
			}
		});

		// After submitting a new taxonomy, re-focus the input field.
		$('#' + taxonomy + '-add-submit').on( 'click', function() {
			$('#new' + taxonomy).trigger( 'focus' );
		});

		/**
		 * Before adding a new taxonomy, disable submit button.
		 *
		 * @param {Object} s Taxonomy object which will be added.
		 *
		 * @return {Object}
		 */
		catAddBefore = function( s ) {
			if ( !$('#new'+taxonomy).val() ) {
				return false;
			}

			s.data += '&' + $( ':checked', '#'+taxonomy+'checklist' ).serialize();
			$( '#' + taxonomy + '-add-submit' ).prop( 'disabled', true );
			return s;
		};

		/**
		 * Re-enable submit button after a taxonomy has been added.
		 *
		 * Re-enable submit button.
		 * If the taxonomy has a parent place the taxonomy underneath the parent.
		 *
		 * @param {Object} r Response.
		 * @param {Object} s Taxonomy data.
		 *
		 * @return {void}
		 */
		catAddAfter = function( r, s ) {
			var sup, drop = $('#new'+taxonomy+'_parent');

			$( '#' + taxonomy + '-add-submit' ).prop( 'disabled', false );
			if ( 'undefined' != s.parsed.responses[0] && (sup = s.parsed.responses[0].supplemental.newcat_parent) ) {
				drop.before(sup);
				drop.remove();
			}
		};

		$('#' + taxonomy + 'checklist').wpList({
			alt: '',
			response: taxonomy + '-ajax-response',
			addBefore: catAddBefore,
			addAfter: catAddAfter
		});

		// Add new taxonomy button toggles input form visibility.
		$('#' + taxonomy + '-add-toggle').on( 'click', function( e ) {
			e.preventDefault();
			$('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
			$('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').trigger( 'click' );
			$('#new'+taxonomy).trigger( 'focus' );
		});

		// Sync checked items between "All {taxonomy}" and "Most used" lists.
		$('#' + taxonomy + 'checklist, #' + taxonomy + 'checklist-pop').on(
			'click',
			'li.popular-category > label input[type="checkbox"]',
			function() {
				var t = $(this), c = t.is(':checked'), id = t.val();
				if ( id && t.parents('#taxonomy-'+taxonomy).length ) {
					// Fixed for ticket #62504. See https://core.trac.wordpress.org/ticket/62504.
					$('input#in-' + taxonomy + '-' + id + ', input[id^="in-' + taxonomy + '-' + id + '-"]').prop('checked', c);
					$('input#in-popular-' + taxonomy + '-' + id).prop('checked', c);
				}
			}
		);

	}); // End cats.

	// Custom Fields postbox.
	if ( $('#postcustom').length ) {
		$( '#the-list' ).wpList( {
			/**
			 * Add current post_ID to request to fetch custom fields
			 *
			 * @ignore
			 *
			 * @param {Object} s Request object.
			 *
			 * @return {Object} Data modified with post_ID attached.
			 */
			addBefore: function( s ) {
				s.data += '&post_id=' + $('#post_ID').val();
				return s;
			},
			/**
			 * Show the listing of custom fields after fetching.
			 *
			 * @ignore
			 */
			addAfter: function() {
				$('table#list-table').show();
			}
		});
	}

	/*
	 * Publish Post box (#submitdiv)
	 */
	if ( $('#submitdiv').length ) {
		stamp = $('#timestamp').html();
		visibility = $('#post-visibility-display').html();

		/**
		 * When the visibility of a post changes sub-options should be shown or hidden.
		 *
		 * @ignore
		 *
		 * @return {void}
		 */
		updateVisibility = function() {
			// Show sticky for public posts.
			if ( $postVisibilitySelect.find('input:radio:checked').val() != 'public' ) {
				$('#sticky').prop('checked', false);
				$('#sticky-span').hide();
			} else {
				$('#sticky-span').show();
			}

			// Show password input field for password protected post.
			if ( $postVisibilitySelect.find('input:radio:checked').val() != 'password' ) {
				$('#password-span').hide();
			} else {
				$('#password-span').show();
			}
		};

		/**
		 * Make sure all labels represent the current settings.
		 *
		 * @ignore
		 *
		 * @return {boolean} False when an invalid timestamp has been selected, otherwise True.
		 */
		updateText = function() {

			if ( ! $timestampdiv.length )
				return true;

			var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'),
				optPublish = $('option[value="publish"]', postStatus), aa = $('#aa').val(),
				mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val();

			attemptedDate = new Date( aa, mm - 1, jj, hh, mn );
			originalDate = new Date(
				$('#hidden_aa').val(),
				$('#hidden_mm').val() -1,
				$('#hidden_jj').val(),
				$('#hidden_hh').val(),
				$('#hidden_mn').val()
			);
			currentDate = new Date(
				$('#cur_aa').val(),
				$('#cur_mm').val() -1,
				$('#cur_jj').val(),
				$('#cur_hh').val(),
				$('#cur_mn').val()
			);

			// Catch unexpected date problems.
			if (
				attemptedDate.getFullYear() != aa ||
				(1 + attemptedDate.getMonth()) != mm ||
				attemptedDate.getDate() != jj ||
				attemptedDate.getMinutes() != mn
			) {
				$timestampdiv.find('.timestamp-wrap').addClass('form-invalid');
				return false;
			} else {
				$timestampdiv.find('.timestamp-wrap').removeClass('form-invalid');
			}

			// Determine what the publish should be depending on the date and post status.
			if ( attemptedDate > currentDate ) {
				publishOn = __( 'Schedule for:' );
				$('#publish').val( _x( 'Schedule', 'post action/button label' ) );
			} else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
				publishOn = __( 'Publish on:' );
				$('#publish').val( __( 'Publish' ) );
			} else {
				publishOn = __( 'Published on:' );
				$('#publish').val( __( 'Update' ) );
			}

			// If the date is the same, set it to trigger update events.
			if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) {
				// Re-set to the current value.
				$('#timestamp').html(stamp);
			} else {
				$('#timestamp').html(
					'\n' + publishOn + ' <b>' +
					// translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute.
					__( '%1$s %2$s, %3$s at %4$s:%5$s' )
						.replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) )
						.replace( '%2$s', parseInt( jj, 10 ) )
						.replace( '%3$s', aa )
						.replace( '%4$s', ( '00' + hh ).slice( -2 ) )
						.replace( '%5$s', ( '00' + mn ).slice( -2 ) ) +
						'</b> '
				);
			}

			// Add "privately published" to post status when applies.
			if ( $postVisibilitySelect.find('input:radio:checked').val() == 'private' ) {
				$('#publish').val( __( 'Update' ) );
				if ( 0 === optPublish.length ) {
					postStatus.append('<option value="publish">' + __( 'Privately Published' ) + '</option>');
				} else {
					optPublish.html( __( 'Privately Published' ) );
				}
				$('option[value="publish"]', postStatus).prop('selected', true);
				$('#misc-publishing-actions .edit-post-status').hide();
			} else {
				if ( $('#original_post_status').val() == 'future' || $('#original_post_status').val() == 'draft' ) {
					if ( optPublish.length ) {
						optPublish.remove();
						postStatus.val($('#hidden_post_status').val());
					}
				} else {
					optPublish.html( __( 'Published' ) );
				}
				if ( postStatus.is(':hidden') )
					$('#misc-publishing-actions .edit-post-status').show();
			}

			// Update "Status:" to currently selected status.
			$('#post-status-display').text(
				// Remove any potential tags from post status text.
				wp.sanitize.stripTagsAndEncodeText( $('option:selected', postStatus).text() )
			);

			// Show or hide the "Save Draft" button.
			if (
				$('option:selected', postStatus).val() == 'private' ||
				$('option:selected', postStatus).val() == 'publish'
			) {
				$('#save-post').hide();
			} else {
				$('#save-post').show();
				if ( $('option:selected', postStatus).val() == 'pending' ) {
					$('#save-post').show().val( __( 'Save as Pending' ) );
				} else {
					$('#save-post').show().val( __( 'Save Draft' ) );
				}
			}
			return true;
		};

		// Show the visibility options and hide the toggle button when opened.
		$( '#visibility .edit-visibility').on( 'click', function( e ) {
			e.preventDefault();
			if ( $postVisibilitySelect.is(':hidden') ) {
				updateVisibility();
				$postVisibilitySelect.slideDown( 'fast', function() {
					$postVisibilitySelect.find( 'input[type="radio"]' ).first().trigger( 'focus' );
				} );
				$(this).hide();
			}
		});

		// Cancel visibility selection area and hide it from view.
		$postVisibilitySelect.find('.cancel-post-visibility').on( 'click', function( event ) {
			$postVisibilitySelect.slideUp('fast');
			$('#visibility-radio-' + $('#hidden-post-visibility').val()).prop('checked', true);
			$('#post_password').val($('#hidden-post-password').val());
			$('#sticky').prop('checked', $('#hidden-post-sticky').prop('checked'));
			$('#post-visibility-display').html(visibility);
			$('#visibility .edit-visibility').show().trigger( 'focus' );
			updateText();
			event.preventDefault();
		});

		// Set the selected visibility as current.
		$postVisibilitySelect.find('.save-post-visibility').on( 'click', function( event ) { // Crazyhorse branch - multiple OK cancels.
			var visibilityLabel = '', selectedVisibility = $postVisibilitySelect.find('input:radio:checked').val();

			$postVisibilitySelect.slideUp('fast');
			$('#visibility .edit-visibility').show().trigger( 'focus' );
			updateText();

			if ( 'public' !== selectedVisibility ) {
				$('#sticky').prop('checked', false);
			}

			switch ( selectedVisibility ) {
				case 'public':
					visibilityLabel = $( '#sticky' ).prop( 'checked' ) ? __( 'Public, Sticky' ) : __( 'Public' );
					break;
				case 'private':
					visibilityLabel = __( 'Private' );
					break;
				case 'password':
					visibilityLabel = __( 'Password Protected' );
					break;
			}

			$('#post-visibility-display').text( visibilityLabel );
			event.preventDefault();
		});

		// When the selection changes, update labels.
		$postVisibilitySelect.find('input:radio').on( 'change', function() {
			updateVisibility();
		});

		// Edit publish time click.
		$timestampdiv.siblings('a.edit-timestamp').on( 'click', function( event ) {
			if ( $timestampdiv.is( ':hidden' ) ) {
				$timestampdiv.slideDown( 'fast', function() {
					$( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().trigger( 'focus' );
				} );
				$(this).hide();
			}
			event.preventDefault();
		});

		// Cancel editing the publish time and hide the settings.
		$timestampdiv.find('.cancel-timestamp').on( 'click', function( event ) {
			$timestampdiv.slideUp('fast').siblings('a.edit-timestamp').show().trigger( 'focus' );
			$('#mm').val($('#hidden_mm').val());
			$('#jj').val($('#hidden_jj').val());
			$('#aa').val($('#hidden_aa').val());
			$('#hh').val($('#hidden_hh').val());
			$('#mn').val($('#hidden_mn').val());
			updateText();
			event.preventDefault();
		});

		// Save the changed timestamp.
		$timestampdiv.find('.save-timestamp').on( 'click', function( event ) { // Crazyhorse branch - multiple OK cancels.
			if ( updateText() ) {
				$timestampdiv.slideUp('fast');
				$timestampdiv.siblings('a.edit-timestamp').show().trigger( 'focus' );
			}
			event.preventDefault();
		});

		// Cancel submit when an invalid timestamp has been selected.
		$('#post').on( 'submit', function( event ) {
			if ( ! updateText() ) {
				event.preventDefault();
				$timestampdiv.show();

				if ( wp.autosave ) {
					wp.autosave.enableButtons();
				}

				$( '#publishing-action .spinner' ).removeClass( 'is-active' );
			}
		});

		// Post Status edit click.
		$postStatusSelect.siblings('a.edit-post-status').on( 'click', function( event ) {
			if ( $postStatusSelect.is( ':hidden' ) ) {
				$postStatusSelect.slideDown( 'fast', function() {
					$postStatusSelect.find('select').trigger( 'focus' );
				} );
				$(this).hide();
			}
			event.preventDefault();
		});

		// Save the Post Status changes and hide the options.
		$postStatusSelect.find('.save-post-status').on( 'click', function( event ) {
			$postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().trigger( 'focus' );
			updateText();
			event.preventDefault();
		});

		// Cancel Post Status editing and hide the options.
		$postStatusSelect.find('.cancel-post-status').on( 'click', function( event ) {
			$postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().trigger( 'focus' );
			$('#post_status').val( $('#hidden_post_status').val() );
			updateText();
			event.preventDefault();
		});
	}

	/**
	 * Handle the editing of the post_name. Create the required HTML elements and
	 * update the changes via Ajax.
	 *
	 * @global
	 *
	 * @return {void}
	 */
	function editPermalink() {
		var i, slug_value, slug_label,
			$el, revert_e,
			c = 0,
			real_slug = $('#post_name'),
			revert_slug = real_slug.val(),
			permalink = $( '#sample-permalink' ),
			permalinkOrig = permalink.html(),
			permalinkInner = $( '#sample-permalink a' ).html(),
			buttons = $('#edit-slug-buttons'),
			buttonsOrig = buttons.html(),
			full = $('#editable-post-name-full');

		// Deal with Twemoji in the post-name.
		full.find( 'img' ).replaceWith( function() { return this.alt; } );
		full = full.html();

		permalink.html( permalinkInner );

		// Save current content to revert to when cancelling.
		$el = $( '#editable-post-name' );
		revert_e = $el.html();

		buttons.html(
			'<button type="button" class="save button button-small">' + __( 'OK' ) + '</button> ' +
			'<button type="button" class="cancel button-link">' + __( 'Cancel' ) + '</button>'
		);

		// Save permalink changes.
		buttons.children( '.save' ).on( 'click', function() {
			var new_slug = $el.children( 'input' ).val();

			if ( new_slug == $('#editable-post-name-full').text() ) {
				buttons.children('.cancel').trigger( 'click' );
				return;
			}

			$.post(
				ajaxurl,
				{
					action: 'sample-permalink',
					post_id: postId,
					new_slug: new_slug,
					new_title: $('#title').val(),
					samplepermalinknonce: $('#samplepermalinknonce').val()
				},
				function(data) {
					var box = $('#edit-slug-box');
					box.html(data);
					if (box.hasClass('hidden')) {
						box.fadeIn('fast', function () {
							box.removeClass('hidden');
						});
					}

					buttons.html(buttonsOrig);
					permalink.html(permalinkOrig);
					real_slug.val(new_slug);
					$( '.edit-slug' ).trigger( 'focus' );
					wp.a11y.speak( __( 'Permalink saved' ) );
				}
			);
		});

		// Cancel editing of permalink.
		buttons.children( '.cancel' ).on( 'click', function() {
			$('#view-post-btn').show();
			$el.html(revert_e);
			buttons.html(buttonsOrig);
			permalink.html(permalinkOrig);
			real_slug.val(revert_slug);
			$( '.edit-slug' ).trigger( 'focus' );
		});

		// If more than 1/4th of 'full' is '%', make it empty.
		for ( i = 0; i < full.length; ++i ) {
			if ( '%' == full.charAt(i) )
				c++;
		}
		slug_value = ( c > full.length / 4 ) ? '' : full;
		slug_label = __( 'URL Slug' );

		$el.html(
			'<label for="new-post-slug" class="screen-reader-text">' + slug_label + '</label>' +
			'<input type="text" id="new-post-slug" value="' + slug_value + '" autocomplete="off" spellcheck="false" />'
		).children( 'input' ).on( 'keydown', function( e ) {
			var key = e.which;
			// On [Enter], just save the new slug, don't save the post.
			if ( 13 === key ) {
				e.preventDefault();
				buttons.children( '.save' ).trigger( 'click' );
			}
			// On [Esc] cancel the editing.
			if ( 27 === key ) {
				buttons.children( '.cancel' ).trigger( 'click' );
			}
		} ).on( 'keyup', function() {
			real_slug.val( this.value );
		}).trigger( 'focus' );
	}

	$( '#titlediv' ).on( 'click', '.edit-slug', function() {
		editPermalink();
	});

	/**
	 * Adds screen reader text to the title label when needed.
	 *
	 * Use the 'screen-reader-text' class to emulate a placeholder attribute
	 * and hide the label when entering a value.
	 *
	 * @param {string} id Optional. HTML ID to add the screen reader helper text to.
	 *
	 * @global
	 *
	 * @return {void}
	 */
	window.wptitlehint = function( id ) {
		id = id || 'title';

		var title = $( '#' + id ), titleprompt = $( '#' + id + '-prompt-text' );

		if ( '' === title.val() ) {
			titleprompt.removeClass( 'screen-reader-text' );
		}

		title.on( 'input', function() {
			if ( '' === this.value ) {
				titleprompt.removeClass( 'screen-reader-text' );
				return;
			}

			titleprompt.addClass( 'screen-reader-text' );
		} );
	};

	wptitlehint();

	// Resize the WYSIWYG and plain text editors.
	( function() {
		var editor, offset, mce,
			$handle = $('#post-status-info'),
			$postdivrich = $('#postdivrich');

		// If there are no textareas or we are on a touch device, we can't do anything.
		if ( ! $textarea.length || 'ontouchstart' in window ) {
			// Hide the resize handle.
			$('#content-resize-handle').hide();
			return;
		}

		/**
		 * Handle drag event.
		 *
		 * @param {Object} event Event containing details about the drag.
		 */
		function dragging( event ) {
			if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) {
				return;
			}

			if ( mce ) {
				editor.theme.resizeTo( null, offset + event.pageY );
			} else {
				$textarea.height( Math.max( 50, offset + event.pageY ) );
			}

			event.preventDefault();
		}

		/**
		 * When the dragging stopped make sure we return focus and do a confidence check on the height.
		 */
		function endDrag() {
			var height, toolbarHeight;

			if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) {
				return;
			}

			if ( mce ) {
				editor.focus();
				toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 );

				if ( toolbarHeight < 10 || toolbarHeight > 200 ) {
					toolbarHeight = 30;
				}

				height = parseInt( $('#content_ifr').css('height'), 10 ) + toolbarHeight - 28;
			} else {
				$textarea.trigger( 'focus' );
				height = parseInt( $textarea.css('height'), 10 );
			}

			$document.off( '.wp-editor-resize' );

			// Confidence check: normalize height to stay within acceptable ranges.
			if ( height && height > 50 && height < 5000 ) {
				setUserSetting( 'ed_size', height );
			}
		}

		$handle.on( 'mousedown.wp-editor-resize', function( event ) {
			if ( typeof tinymce !== 'undefined' ) {
				editor = tinymce.get('content');
			}

			if ( editor && ! editor.isHidden() ) {
				mce = true;
				offset = $('#content_ifr').height() - event.pageY;
			} else {
				mce = false;
				offset = $textarea.height() - event.pageY;
				$textarea.trigger( 'blur' );
			}

			$document.on( 'mousemove.wp-editor-resize', dragging )
				.on( 'mouseup.wp-editor-resize mouseleave.wp-editor-resize', endDrag );

			event.preventDefault();
		}).on( 'mouseup.wp-editor-resize', endDrag );
	})();

	// TinyMCE specific handling of Post Format changes to reflect in the editor.
	if ( typeof tinymce !== 'undefined' ) {
		// When changing post formats, change the editor body class.
		$( '#post-formats-select input.post-format' ).on( 'change.set-editor-class', function() {
			var editor, body, format = this.id;

			if ( format && $( this ).prop( 'checked' ) && ( editor = tinymce.get( 'content' ) ) ) {
				body = editor.getBody();
				body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
				editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
				$( document ).trigger( 'editor-classchange' );
			}
		});

		// When changing page template, change the editor body class.
		$( '#page_template' ).on( 'change.set-editor-class', function() {
			var editor, body, pageTemplate = $( this ).val() || '';

			pageTemplate = pageTemplate.substr( pageTemplate.lastIndexOf( '/' ) + 1, pageTemplate.length )
				.replace( /\.php$/, '' )
				.replace( /\./g, '-' );

			if ( pageTemplate && ( editor = tinymce.get( 'content' ) ) ) {
				body = editor.getBody();
				body.className = body.className.replace( /\bpage-template-[^ ]+/, '' );
				editor.dom.addClass( body, 'page-template-' + pageTemplate );
				$( document ).trigger( 'editor-classchange' );
			}
		});

	}

	// Save on pressing [Ctrl]/[Command] + [S] in the Text editor.
	$textarea.on( 'keydown.wp-autosave', function( event ) {
		// Key [S] has code 83.
		if ( event.which === 83 ) {
			if (
				event.shiftKey ||
				event.altKey ||
				( isMac && ( ! event.metaKey || event.ctrlKey ) ) ||
				( ! isMac && ! event.ctrlKey )
			) {
				return;
			}

			wp.autosave && wp.autosave.server.triggerSave();
			event.preventDefault();
		}
	});

	// If the last status was auto-draft and the save is triggered, edit the current URL.
	if ( $( '#original_post_status' ).val() === 'auto-draft' && window.history.replaceState ) {
		var location;

		$( '#publish' ).on( 'click', function() {
			location = window.location.href;
			location += ( location.indexOf( '?' ) !== -1 ) ? '&' : '?';
			location += 'wp-post-new-reload=true';

			window.history.replaceState( null, null, location );
		});
	}

	/**
	 * Copies the attachment URL in the Edit Media page to the clipboard.
	 *
	 * @since 5.5.0
	 *
	 * @param {MouseEvent} event A click event.
	 *
	 * @return {void}
	 */
	copyAttachmentURLClipboard.on( 'success', function( event ) {
		var triggerElement = $( event.trigger ),
			successElement = $( '.success', triggerElement.closest( '.copy-to-clipboard-container' ) );

		// Clear the selection and move focus back to the trigger.
		event.clearSelection();

		// Show success visual feedback.
		clearTimeout( copyAttachmentURLSuccessTimeout );
		successElement.removeClass( 'hidden' );

		// Hide success visual feedback after 3 seconds since last success.
		copyAttachmentURLSuccessTimeout = setTimeout( function() {
			successElement.addClass( 'hidden' );
		}, 3000 );

		// Handle success audible feedback.
		wp.a11y.speak( __( 'The file URL has been copied to your clipboard' ) );
	} );
} );

/**
 * TinyMCE word count display
 */
( function( $, counter ) {
	$( function() {
		var $content = $( '#content' ),
			$count = $( '#wp-word-count' ).find( '.word-count' ),
			prevCount = 0,
			contentEditor;

		/**
		 * Get the word count from TinyMCE and display it
		 */
		function update() {
			var text, count;

			if ( ! contentEditor || contentEditor.isHidden() ) {
				text = $content.val();
			} else {
				text = contentEditor.getContent( { format: 'raw' } );
			}

			count = counter.count( text );

			if ( count !== prevCount ) {
				$count.text( count );
			}

			prevCount = count;
		}

		/**
		 * Bind the word count update triggers.
		 *
		 * When a node change in the main TinyMCE editor has been triggered.
		 * When a key has been released in the plain text content editor.
		 */
		$( document ).on( 'tinymce-editor-init', function( event, editor ) {
			if ( editor.id !== 'content' ) {
				return;
			}

			contentEditor = editor;

			editor.on( 'nodechange keyup', _.debounce( update, 1000 ) );
		} );

		$content.on( 'input keyup', _.debounce( update, 1000 ) );

		update();
	} );

} )( jQuery, new wp.utils.WordCounter() );
post.min.js000064400000044635152333263710006672 0ustar00/*! This file is auto-generated */
window.makeSlugeditClickable=window.editPermalink=function(){},window.wp=window.wp||{},function(s){var t=!1,a=wp.i18n.__;window.commentsBox={st:0,get:function(t,e){var i=this.st;return this.st+=e=e||20,this.total=t,s("#commentsdiv .spinner").addClass("is-active"),t={action:"get-comments",mode:"single",_ajax_nonce:s("#add_comment_nonce").val(),p:s("#post_ID").val(),start:i,number:e},s.post(ajaxurl,t,function(t){t=wpAjax.parseAjaxResponse(t),s("#commentsdiv .widefat").show(),s("#commentsdiv .spinner").removeClass("is-active"),"object"==typeof t&&t.responses[0]?(s("#the-comment-list").append(t.responses[0].data),theList=theExtraList=null,s("a[className*=':']").off(),commentsBox.st>commentsBox.total?s("#show-comments").hide():s("#show-comments").show().children("a").text(a("Show more comments"))):1==t?s("#show-comments").text(a("No more comments found.")):s("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")}),!1},load:function(t){this.st=jQuery("#the-comment-list tr.comment:visible").length,this.get(t)}},window.WPSetThumbnailHTML=function(t){s(".inside","#postimagediv").html(t)},window.WPSetThumbnailID=function(t){var e=s('input[value="_thumbnail_id"]',"#list-table");0<e.length&&s("#meta\\["+e.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(t)},window.WPRemoveThumbnail=function(t){s.post(ajaxurl,{action:"set-post-thumbnail",post_id:s("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:t,cookie:encodeURIComponent(document.cookie)},function(t){"0"==t?alert(a("Could not set that as the thumbnail image. Try a different attachment.")):WPSetThumbnailHTML(t)})},s(document).on("heartbeat-send.refresh-lock",function(t,e){var i=s("#active_post_lock").val(),a=s("#post_ID").val(),n={};a&&s("#post-lock-dialog").length&&(n.post_id=a,i&&(n.lock=i),e["wp-refresh-post-lock"]=n)}).on("heartbeat-tick.refresh-lock",function(t,e){var i,a;e["wp-refresh-post-lock"]&&((e=e["wp-refresh-post-lock"]).lock_error?(i=s("#post-lock-dialog")).length&&!i.is(":visible")&&(wp.autosave&&(s(document).one("heartbeat-tick",function(){wp.autosave.server.suspend(),i.removeClass("saving").addClass("saved"),s(window).off("beforeunload.edit-post")}),i.addClass("saving"),wp.autosave.server.triggerSave()),e.lock_error.avatar_src&&(a=s("<img />",{class:"avatar avatar-64 photo",width:64,height:64,alt:"",src:e.lock_error.avatar_src,srcset:e.lock_error.avatar_src_2x?e.lock_error.avatar_src_2x+" 2x":void 0}),i.find("div.post-locked-avatar").empty().append(a)),i.show().find(".currently-editing").text(e.lock_error.text),i.find(".wp-tab-first").trigger("focus")):e.new_lock&&s("#active_post_lock").val(e.new_lock))}).on("before-autosave.update-post-slug",function(){t=document.activeElement&&"title"===document.activeElement.id}).on("after-autosave.update-post-slug",function(){s("#edit-slug-box > *").length||t||s.post(ajaxurl,{action:"sample-permalink",post_id:s("#post_ID").val(),new_title:s("#title").val(),samplepermalinknonce:s("#samplepermalinknonce").val()},function(t){"-1"!=t&&s("#edit-slug-box").html(t)})})}(jQuery),function(a){var n,t;function i(){n=!1,window.clearTimeout(t),t=window.setTimeout(function(){n=!0},3e5)}a(function(){i()}).on("heartbeat-send.wp-refresh-nonces",function(t,e){var i=a("#wp-auth-check-wrap");(n||i.length&&!i.hasClass("hidden"))&&(i=a("#post_ID").val())&&a("#_wpnonce").val()&&(e["wp-refresh-post-nonces"]={post_id:i})}).on("heartbeat-tick.wp-refresh-nonces",function(t,e){e=e["wp-refresh-post-nonces"];e&&(i(),e.replace&&a.each(e.replace,function(t,e){a("#"+t).val(e)}),e.heartbeatNonce)&&(window.heartbeatSettings.nonce=e.heartbeatNonce)})}(jQuery),jQuery(function(h){var d,e,i,a,n,s,o,l,r,t,c,p,u=h("#content"),v=h(document),f=h("#post_ID").val()||0,m=h("#submitpost"),w=!0,g=h("#post-visibility-select"),b=h("#timestampdiv"),k=h("#post-status-select"),_=!!window.navigator.platform&&-1!==window.navigator.platform.indexOf("Mac"),y=new ClipboardJS(".copy-attachment-url.edit-media"),x=wp.i18n.__,C=wp.i18n._x;function D(t){c.hasClass("wp-editor-expand")||(r?o.theme.resizeTo(null,l+t.pageY):u.height(Math.max(50,l+t.pageY)),t.preventDefault())}function j(){var t;c.hasClass("wp-editor-expand")||(t=r?(o.focus(),((t=parseInt(h("#wp-content-editor-container .mce-toolbar-grp").height(),10))<10||200<t)&&(t=30),parseInt(h("#content_ifr").css("height"),10)+t-28):(u.trigger("focus"),parseInt(u.css("height"),10)),v.off(".wp-editor-resize"),t&&50<t&&t<5e3&&setUserSetting("ed_size",t))}postboxes.add_postbox_toggles(pagenow),window.name="",h("#post-lock-dialog .notification-dialog").on("keydown",function(t){var e;9==t.which&&((e=h(t.target)).hasClass("wp-tab-first")&&t.shiftKey?(h(this).find(".wp-tab-last").trigger("focus"),t.preventDefault()):e.hasClass("wp-tab-last")&&!t.shiftKey&&(h(this).find(".wp-tab-first").trigger("focus"),t.preventDefault()))}).filter(":visible").find(".wp-tab-first").trigger("focus"),wp.heartbeat&&h("#post-lock-dialog").length&&wp.heartbeat.interval(10),i=m.find(":submit, a.submitdelete, #post-preview").on("click.edit-post",function(t){var e=h(this);e.hasClass("disabled")?t.preventDefault():e.hasClass("submitdelete")||e.is("#post-preview")||h("form#post").off("submit.edit-post").on("submit.edit-post",function(t){if(!t.isDefaultPrevented()){if(wp.autosave&&wp.autosave.server.suspend(),"undefined"!=typeof commentReply){if(!commentReply.discardCommentChanges())return!1;commentReply.close()}w=!1,h(window).off("beforeunload.edit-post"),i.addClass("disabled"),("publish"===e.attr("id")?m.find("#major-publishing-actions .spinner"):m.find("#minor-publishing .spinner")).addClass("is-active")}})}),h("#post-preview").on("click.post-preview",function(t){var e=h(this),i=h("form#post"),a=h("input#wp-preview"),n=e.attr("target")||"wp-preview",s=navigator.userAgent.toLowerCase();t.preventDefault(),e.hasClass("disabled")||(wp.autosave&&wp.autosave.server.tempBlockSave(),a.val("dopreview"),i.attr("target",n).trigger("submit").attr("target",""),-1!==s.indexOf("safari")&&-1===s.indexOf("chrome")&&i.attr("action",function(t,e){return e+"?t="+(new Date).getTime()}),a.val(""))}),h("#auto_draft").val()&&h("#title").on("blur",function(){var t;this.value&&!h("#edit-slug-box > *").length&&(h("form#post").one("submit",function(){t=!0}),window.setTimeout(function(){!t&&wp.autosave&&wp.autosave.server.triggerSave()},200))}),v.on("autosave-disable-buttons.edit-post",function(){i.addClass("disabled")}).on("autosave-enable-buttons.edit-post",function(){wp.heartbeat&&wp.heartbeat.hasConnectionError()||i.removeClass("disabled")}).on("before-autosave.edit-post",function(){h(".autosave-message").text(x("Saving Draft\u2026"))}).on("after-autosave.edit-post",function(t,e){h(".autosave-message").text(e.message),h(document.body).hasClass("post-new-php")&&h(".submitbox .submitdelete").show()}),h(window).on("beforeunload.edit-post",function(t){var e=window.tinymce&&window.tinymce.get("content"),i=!1;if(wp.autosave?i=wp.autosave.server.postChanged():e&&(i=!e.isHidden()&&e.isDirty()),i)return t.preventDefault(),x("The changes you made will be lost if you navigate away from this page.")}).on("pagehide.edit-post",function(t){if(w&&(!t.target||"#document"==t.target.nodeName)){var t=h("#post_ID").val(),e=h("#active_post_lock").val();if(t&&e){t={action:"wp-remove-post-lock",_wpnonce:h("#_wpnonce").val(),post_ID:t,active_post_lock:e};if(window.FormData&&window.navigator.sendBeacon){var i=new window.FormData;if(h.each(t,function(t,e){i.append(t,e)}),window.navigator.sendBeacon(ajaxurl,i))return}h.post({async:!1,data:t,url:ajaxurl})}}}),h("#tagsdiv-post_tag").length?window.tagBox&&window.tagBox.init():h(".meta-box-sortables").children("div.postbox").each(function(){if(0===this.id.indexOf("tagsdiv-"))return window.tagBox&&window.tagBox.init(),!1}),h(".categorydiv").each(function(){var t,a,e,i=h(this).attr("id").split("-");i.shift(),a=i.join("-"),e="category"==a?"cats":a+"_tab",h("a","#"+a+"-tabs").on("click",function(t){t.preventDefault();t=h(this).attr("href");h(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),h("#"+a+"-tabs").siblings(".tabs-panel").hide(),h(t).show(),"#"+a+"-all"==t?deleteUserSetting(e):setUserSetting(e,"pop")}),getUserSetting(e)&&h('a[href="#'+a+'-pop"]',"#"+a+"-tabs").trigger("click"),h("#new"+a).one("focus",function(){h(this).val("").removeClass("form-input-tip")}),h("#new"+a).on("keypress",function(t){13===t.keyCode&&(t.preventDefault(),h("#"+a+"-add-submit").trigger("click"))}),h("#"+a+"-add-submit").on("click",function(){h("#new"+a).trigger("focus")}),i=function(t){return!!h("#new"+a).val()&&(t.data+="&"+h(":checked","#"+a+"checklist").serialize(),h("#"+a+"-add-submit").prop("disabled",!0),t)},t=function(t,e){var i=h("#new"+a+"_parent");h("#"+a+"-add-submit").prop("disabled",!1),"undefined"!=e.parsed.responses[0]&&(e=e.parsed.responses[0].supplemental.newcat_parent)&&(i.before(e),i.remove())},h("#"+a+"checklist").wpList({alt:"",response:a+"-ajax-response",addBefore:i,addAfter:t}),h("#"+a+"-add-toggle").on("click",function(t){t.preventDefault(),h("#"+a+"-adder").toggleClass("wp-hidden-children"),h('a[href="#'+a+'-all"]',"#"+a+"-tabs").trigger("click"),h("#new"+a).trigger("focus")}),h("#"+a+"checklist, #"+a+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var t=h(this),e=t.is(":checked"),i=t.val();i&&t.parents("#taxonomy-"+a).length&&(h("input#in-"+a+"-"+i+', input[id^="in-'+a+"-"+i+'-"]').prop("checked",e),h("input#in-popular-"+a+"-"+i).prop("checked",e))})}),h("#postcustom").length&&h("#the-list").wpList({addBefore:function(t){return t.data+="&post_id="+h("#post_ID").val(),t},addAfter:function(){h("table#list-table").show()}}),h("#submitdiv").length&&(d=h("#timestamp").html(),e=h("#post-visibility-display").html(),a=function(){"public"!=g.find("input:radio:checked").val()?(h("#sticky").prop("checked",!1),h("#sticky-span").hide()):h("#sticky-span").show(),"password"!=g.find("input:radio:checked").val()?h("#password-span").hide():h("#password-span").show()},n=function(){if(b.length){var t,e=h("#post_status"),i=h('option[value="publish"]',e),a=h("#aa").val(),n=h("#mm").val(),s=h("#jj").val(),o=h("#hh").val(),l=h("#mn").val(),r=new Date(a,n-1,s,o,l),c=new Date(h("#hidden_aa").val(),h("#hidden_mm").val()-1,h("#hidden_jj").val(),h("#hidden_hh").val(),h("#hidden_mn").val()),p=new Date(h("#cur_aa").val(),h("#cur_mm").val()-1,h("#cur_jj").val(),h("#cur_hh").val(),h("#cur_mn").val());if(r.getFullYear()!=a||1+r.getMonth()!=n||r.getDate()!=s||r.getMinutes()!=l)return b.find(".timestamp-wrap").addClass("form-invalid"),!1;b.find(".timestamp-wrap").removeClass("form-invalid"),p<r?(t=x("Schedule for:"),h("#publish").val(C("Schedule","post action/button label"))):r<=p&&"publish"!=h("#original_post_status").val()?(t=x("Publish on:"),h("#publish").val(x("Publish"))):(t=x("Published on:"),h("#publish").val(x("Update"))),c.toUTCString()==r.toUTCString()?h("#timestamp").html(d):h("#timestamp").html("\n"+t+" <b>"+x("%1$s %2$s, %3$s at %4$s:%5$s").replace("%1$s",h('option[value="'+n+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(s,10)).replace("%3$s",a).replace("%4$s",("00"+o).slice(-2)).replace("%5$s",("00"+l).slice(-2))+"</b> "),"private"==g.find("input:radio:checked").val()?(h("#publish").val(x("Update")),0===i.length?e.append('<option value="publish">'+x("Privately Published")+"</option>"):i.html(x("Privately Published")),h('option[value="publish"]',e).prop("selected",!0),h("#misc-publishing-actions .edit-post-status").hide()):("future"==h("#original_post_status").val()||"draft"==h("#original_post_status").val()?i.length&&(i.remove(),e.val(h("#hidden_post_status").val())):i.html(x("Published")),e.is(":hidden")&&h("#misc-publishing-actions .edit-post-status").show()),h("#post-status-display").text(wp.sanitize.stripTagsAndEncodeText(h("option:selected",e).text())),"private"==h("option:selected",e).val()||"publish"==h("option:selected",e).val()?h("#save-post").hide():(h("#save-post").show(),"pending"==h("option:selected",e).val()?h("#save-post").show().val(x("Save as Pending")):h("#save-post").show().val(x("Save Draft")))}return!0},h("#visibility .edit-visibility").on("click",function(t){t.preventDefault(),g.is(":hidden")&&(a(),g.slideDown("fast",function(){g.find('input[type="radio"]').first().trigger("focus")}),h(this).hide())}),g.find(".cancel-post-visibility").on("click",function(t){g.slideUp("fast"),h("#visibility-radio-"+h("#hidden-post-visibility").val()).prop("checked",!0),h("#post_password").val(h("#hidden-post-password").val()),h("#sticky").prop("checked",h("#hidden-post-sticky").prop("checked")),h("#post-visibility-display").html(e),h("#visibility .edit-visibility").show().trigger("focus"),n(),t.preventDefault()}),g.find(".save-post-visibility").on("click",function(t){var e="",i=g.find("input:radio:checked").val();switch(g.slideUp("fast"),h("#visibility .edit-visibility").show().trigger("focus"),n(),"public"!==i&&h("#sticky").prop("checked",!1),i){case"public":e=h("#sticky").prop("checked")?x("Public, Sticky"):x("Public");break;case"private":e=x("Private");break;case"password":e=x("Password Protected")}h("#post-visibility-display").text(e),t.preventDefault()}),g.find("input:radio").on("change",function(){a()}),b.siblings("a.edit-timestamp").on("click",function(t){b.is(":hidden")&&(b.slideDown("fast",function(){h("input, select",b.find(".timestamp-wrap")).first().trigger("focus")}),h(this).hide()),t.preventDefault()}),b.find(".cancel-timestamp").on("click",function(t){b.slideUp("fast").siblings("a.edit-timestamp").show().trigger("focus"),h("#mm").val(h("#hidden_mm").val()),h("#jj").val(h("#hidden_jj").val()),h("#aa").val(h("#hidden_aa").val()),h("#hh").val(h("#hidden_hh").val()),h("#mn").val(h("#hidden_mn").val()),n(),t.preventDefault()}),b.find(".save-timestamp").on("click",function(t){n()&&(b.slideUp("fast"),b.siblings("a.edit-timestamp").show().trigger("focus")),t.preventDefault()}),h("#post").on("submit",function(t){n()||(t.preventDefault(),b.show(),wp.autosave&&wp.autosave.enableButtons(),h("#publishing-action .spinner").removeClass("is-active"))}),k.siblings("a.edit-post-status").on("click",function(t){k.is(":hidden")&&(k.slideDown("fast",function(){k.find("select").trigger("focus")}),h(this).hide()),t.preventDefault()}),k.find(".save-post-status").on("click",function(t){k.slideUp("fast").siblings("a.edit-post-status").show().trigger("focus"),n(),t.preventDefault()}),k.find(".cancel-post-status").on("click",function(t){k.slideUp("fast").siblings("a.edit-post-status").show().trigger("focus"),h("#post_status").val(h("#hidden_post_status").val()),n(),t.preventDefault()})),h("#titlediv").on("click",".edit-slug",function(){var t,e,a,i,n=0,s=h("#post_name"),o=s.val(),l=h("#sample-permalink"),r=l.html(),c=h("#sample-permalink a").html(),p=h("#edit-slug-buttons"),d=p.html(),u=h("#editable-post-name-full");for(u.find("img").replaceWith(function(){return this.alt}),u=u.html(),l.html(c),a=h("#editable-post-name"),i=a.html(),p.html('<button type="button" class="save button button-small">'+x("OK")+'</button> <button type="button" class="cancel button-link">'+x("Cancel")+"</button>"),p.children(".save").on("click",function(){var i=a.children("input").val();i==h("#editable-post-name-full").text()?p.children(".cancel").trigger("click"):h.post(ajaxurl,{action:"sample-permalink",post_id:f,new_slug:i,new_title:h("#title").val(),samplepermalinknonce:h("#samplepermalinknonce").val()},function(t){var e=h("#edit-slug-box");e.html(t),e.hasClass("hidden")&&e.fadeIn("fast",function(){e.removeClass("hidden")}),p.html(d),l.html(r),s.val(i),h(".edit-slug").trigger("focus"),wp.a11y.speak(x("Permalink saved"))})}),p.children(".cancel").on("click",function(){h("#view-post-btn").show(),a.html(i),p.html(d),l.html(r),s.val(o),h(".edit-slug").trigger("focus")}),t=0;t<u.length;++t)"%"==u.charAt(t)&&n++;c=n>u.length/4?"":u,e=x("URL Slug"),a.html('<label for="new-post-slug" class="screen-reader-text">'+e+'</label><input type="text" id="new-post-slug" value="'+c+'" autocomplete="off" spellcheck="false" />').children("input").on("keydown",function(t){var e=t.which;13===e&&(t.preventDefault(),p.children(".save").trigger("click")),27===e&&p.children(".cancel").trigger("click")}).on("keyup",function(){s.val(this.value)}).trigger("focus")}),window.wptitlehint=function(t){var e=h("#"+(t=t||"title")),i=h("#"+t+"-prompt-text");""===e.val()&&i.removeClass("screen-reader-text"),e.on("input",function(){""===this.value?i.removeClass("screen-reader-text"):i.addClass("screen-reader-text")})},wptitlehint(),t=h("#post-status-info"),c=h("#postdivrich"),!u.length||"ontouchstart"in window?h("#content-resize-handle").hide():t.on("mousedown.wp-editor-resize",function(t){(o="undefined"!=typeof tinymce?tinymce.get("content"):o)&&!o.isHidden()?(r=!0,l=h("#content_ifr").height()-t.pageY):(r=!1,l=u.height()-t.pageY,u.trigger("blur")),v.on("mousemove.wp-editor-resize",D).on("mouseup.wp-editor-resize mouseleave.wp-editor-resize",j),t.preventDefault()}).on("mouseup.wp-editor-resize",j),"undefined"!=typeof tinymce&&(h("#post-formats-select input.post-format").on("change.set-editor-class",function(){var t,e,i=this.id;i&&h(this).prop("checked")&&(t=tinymce.get("content"))&&((e=t.getBody()).className=e.className.replace(/\bpost-format-[^ ]+/,""),t.dom.addClass(e,"post-format-0"==i?"post-format-standard":i),h(document).trigger("editor-classchange"))}),h("#page_template").on("change.set-editor-class",function(){var t,e,i=h(this).val()||"";(i=i.substr(i.lastIndexOf("/")+1,i.length).replace(/\.php$/,"").replace(/\./g,"-"))&&(t=tinymce.get("content"))&&((e=t.getBody()).className=e.className.replace(/\bpage-template-[^ ]+/,""),t.dom.addClass(e,"page-template-"+i),h(document).trigger("editor-classchange"))})),u.on("keydown.wp-autosave",function(t){83!==t.which||t.shiftKey||t.altKey||_&&(!t.metaKey||t.ctrlKey)||!_&&!t.ctrlKey||(wp.autosave&&wp.autosave.server.triggerSave(),t.preventDefault())}),"auto-draft"===h("#original_post_status").val()&&window.history.replaceState&&h("#publish").on("click",function(){p=(p=window.location.href)+(-1!==p.indexOf("?")?"&":"?")+"wp-post-new-reload=true",window.history.replaceState(null,null,p)}),y.on("success",function(t){var e=h(t.trigger),i=h(".success",e.closest(".copy-to-clipboard-container"));t.clearSelection(),clearTimeout(s),i.removeClass("hidden"),s=setTimeout(function(){i.addClass("hidden")},3e3),wp.a11y.speak(x("The file URL has been copied to your clipboard"))})}),function(t,o){t(function(){var i,e=t("#content"),a=t("#wp-word-count").find(".word-count"),n=0;function s(){var t=!i||i.isHidden()?e.val():i.getContent({format:"raw"}),t=o.count(t);t!==n&&a.text(t),n=t}t(document).on("tinymce-editor-init",function(t,e){"content"===e.id&&(i=e).on("nodechange keyup",_.debounce(s,1e3))}),e.on("input keyup",_.debounce(s,1e3)),s()})}(jQuery,new wp.utils.WordCounter);utils/utils.js000064400000020441152336404310007404 0ustar00/**
 * IMPORTANT: Keep external dependencies as low as possible since this utils might be
 * imported by various frontend scripts; need to keep frontend script size low.
 */

// External dependencies
import includes from 'lodash/includes';
import get from 'lodash/get';
import $ from 'jquery';

// Internal dependencies
import { top_window } from '@core/admin/js/frame-helpers';

export const getBuilderUtilsParams = () => {
  if (window.et_builder_utils_params) {
    return window.et_builder_utils_params;
  }

  if (top_window.et_builder_utils_params) {
    return top_window.et_builder_utils_params;
  }

  return {};
};

export const getBuilderType = () => get(getBuilderUtilsParams(), 'builderType', '');

/**
 * Check current page's builder Type.
 *
 * @since 4.6.0
 *
 * @param {string} builderType Fe|vb|bfb|tb|lbb|lbp.
 *
 * @returns {bool}
 */
export const isBuilderType = (builderType) => builderType === getBuilderType();

/**
 * Return condition value.
 *
 * @since 4.6.0
 *
 * @param {string} conditionName
 *
 * @returns {bool}
 */
export const is = conditionName => get(getBuilderUtilsParams(), `condition.${conditionName}`);

/**
 * Is current page Frontend.
 *
 * @since 4.6.0
 *
 * @type {bool}
 */
export const isFE = isBuilderType('fe');

/**
 * Is current page Visual Builder.
 *
 * @since 4.6.0
 *
 * @type {bool}
 */
export const isVB = isBuilderType('vb');

/**
 * Is current page BFB / New Builder Experience.
 *
 * @since 4.6.0
 *
 * @type {bool}
 */
export const isBFB = isBuilderType('bfb');

/**
 * Is current page Theme Builder.
 *
 * @since 4.6.0
 *
 * @type {bool}
 */
export const isTB = isBuilderType('tb');

/**
 * Is current page Layout Block Builder.
 *
 * @type {bool}
 */
export const isLBB = isBuilderType('lbb');

/**
 * Is current page uses Divi Theme.
 *
 * @since 4.6.0
 *
 * @type {bool}
 */
export const isDiviTheme = is('diviTheme');

/**
 * Is current page uses Extra Theme.
 *
 * @since 4.6.0
 *
 * @type {bool}
 */
export const isExtraTheme = is('extraTheme');

/**
 * Is current page Layout Block Preview.
 *
 * @since 4.6.0
 *
 * @type {bool}
 */
export const isLBP = isBuilderType('lbp');

/**
 * Check if current window is block editor window (gutenberg editing page).
 *
 * @since 4.6.0
 *
 * @type {bool}
 */
export const isBlockEditor = 0 < $(top_window.document).find('.edit-post-layout__content').length;

/**
 * Check if current window is builder window (VB, BFB, TB, LBB).
 *
 * @since 4.6.0
 *
 * @type {bool}
 */
export const isBuilder = includes(['vb', 'bfb', 'tb', 'lbb'], getBuilderType());

/**
 * Get offsets value of all sides.
 *
 * @since 4.6.0
 *
 * @param {object} $selector JQuery selector instance.
 * @param {number} height
 * @param {number} width
 *
 * @returns {object}
 */
export const getOffsets = ($selector, width = 0, height = 0) => {
  // Return previously saved offset if sticky tab is active; retrieving actual offset contain risk
  // of incorrect offsets if sticky horizontal / vertical offset of relative position is modified.
  const isStickyTabActive = isBuilder && $selector.hasClass('et_pb_sticky') && 'fixed' !== $selector.css('position');
  const cachedOffsets     = $selector.data('et-offsets');
  const cachedDevice      = $selector.data('et-offsets-device');
  const currentDevice     = get(window.ET_FE, 'stores.window.breakpoint', '');

  // Only return cachedOffsets if sticky tab is active and cachedOffsets is not undefined and
  // cachedDevice equal to currentDevice.
  if (isStickyTabActive && cachedOffsets !== undefined && cachedDevice === currentDevice) {
    return cachedOffsets;
  }

  // Get top & left offsets
  const offsets = $selector.offset();

  // If no offsets found, return empty object
  if ('undefined' === typeof offsets) {
    return {};
  }

  // FE sets the flag for sticky module which uses transform as classname on module wrapper while
  // VB, BFB, TB, and LB sets the flag on CSS output's <style> element because it can't modify
  // its parent. This compromises avoids the needs to extract transform rendering logic
  const hasTransform = isBuilder
    ? $selector.children('.et-fb-custom-css-output[data-sticky-has-transform="on"]').length > 0
    : $selector.hasClass('et_pb_sticky--has-transform');

  let top  = 'undefined' === typeof offsets.top ? 0 : offsets.top;
  let left = 'undefined' === typeof offsets.left ? 0 : offsets.left;

  // If module is sticky module that uses transform, its offset calculation needs to be adjusted
  // because transform tends to modify the positioning of the module
  if (hasTransform) {
    // Calculate offset (relative to selector's parent) AFTER it is affected by transform
    // NOTE: Can't use jQuery's position() because it considers margin-left `auto` which causes issue
    // on row thus this manually calculate the difference between element and its parent's offset
    // @see https://github.com/jquery/jquery/blob/1.12-stable/src/offset.js#L149-L155
    const parentOffsets = $selector.parent().offset();

    const transformedPosition = {
      top: offsets.top - parentOffsets.top,
      left: offsets.left - parentOffsets.left,
    };

    // Calculate offset (relative to selector's parent) BEFORE it is affected by transform
    const preTransformedPosition = {
      top: $selector[0].offsetTop,
      left: $selector[0].offsetLeft,
    };

    // Update offset's top value
    top        += (preTransformedPosition.top - transformedPosition.top);
    offsets.top = top;

    // Update offset's left value
    left        += (preTransformedPosition.left - transformedPosition.left);
    offsets.left = left;
  }

  // Manually calculate right & bottom offsets
  offsets.right  = left + width;
  offsets.bottom = top + height;

  // Save copy of the offset on element's .data() in case of scenario where retrieving actual
  // offset value will lead to incorrect offset value (eg. sticky tab active with position offset)
  $selector.data('et-offsets', offsets);

  // Add current device to cache
  if ('' !== currentDevice) {
    $selector.data('et-offsets-device', offsets);
  }

  return offsets;
};

/**
 * Increase EventEmitter's max listeners if lister count is about to surpass the max listeners limit
 * IMPORTANT: Need to be placed BEFORE `.on()`.
 *
 * @since 4.6.0
 * @param {EventEmitter} emitter
 * @param eventName
 * @param {string} EventName
 */
export const maybeIncreaseEmitterMaxListeners = (emitter, eventName) => {
  const currentCount = emitter.listenerCount(eventName);
  const maxListeners = emitter.getMaxListeners();

  if (currentCount === maxListeners) {
    emitter.setMaxListeners(maxListeners + 1);
  }
};

/**
 * Decrease EventEmitter's max listeners if listener count is less than max listener limit and above
 * 10 (default max listener limit). If listener count is less than 10, max listener limit will
 * remain at 10
 * IMPORTANT: Need to be placed AFTER `.removeListener()`.
 *
 * @since 4.6.0
 *
 * @param {EventEmitter} emitter
 * @param {string} eventName
 */
export const maybeDecreaseEmitterMaxListeners = (emitter, eventName) => {
  const currentCount = emitter.listenerCount(eventName);
  const maxListeners = emitter.getMaxListeners();

  if (maxListeners > 10) {
    emitter.setMaxListeners(currentCount);
  }
};

/**
 * Expose frontend (FE) component via global object so it can be accessed and reused externally
 * Note: window.ET_Builder is for builder app's component; window.ET_FE is for frontend component.
 *
 * @since 4.6.0
 *
 * @param {string} type
 * @param {string} name
 * @param {mixed} component
 */
export const registerFrontendComponent = (type, name, component) => {
  // Make sure that ET_FE is available
  if ('undefined' === typeof window.ET_FE) {
    window.ET_FE = {};
  }

  if ('object' !== typeof window.ET_FE[type]) {
    window.ET_FE[type] = {};
  }

  window.ET_FE[type][name] = component;
};

/**
 * Set inline style with !important tag. JQuery's .css() can't set value with `!important` tag so
 * here it is.
 *
 * @since 4.6.2
 *
 * @param {object} $element
 * @param {string} cssProp
 * @param {string} value
 */
export const setImportantInlineValue = ($element, cssProp, value) => {
  // Remove prop from current inline style in case the prop is already exist
  $element.css(cssProp, '');

  // Get current inline style
  const inlineStyle = $element.attr('style');

  // Re-insert inline style + property with important tag
  $element.attr('style', `${inlineStyle} ${cssProp}: ${value} !important;`);
};
utils/sticky.js000064400000027724152336404310007565 0ustar00// Sticky Elements specific utils, used accross files

// External dependencies
import filter from 'lodash/filter';
import forEach from 'lodash/forEach';
import get from 'lodash/get';
import head from 'lodash/head';
import includes from 'lodash/includes';
import isEmpty from 'lodash/isEmpty';
import isString from 'lodash/isString';
import $ from 'jquery';

// Internal dependencies
import {
  getOffsets,
} from './utils';

/**
 * Get top / bottom limit attributes.
 *
 * @since 4.6.0
 * @param {object} $selector
 * @param limit
 * @param {string}
 * @returns {object}
 * @returns {string} Object.limit.
 * @returns {number} Object.height.
 * @returns {number} Object.width.
 * @return {object} object.offsets
 * @return {number} object.offsets.top
 * @return {number} object.offsets.right
 * @return {number} object.offsets.bottom
 * @return {number} object.offsets.left
 */
export const getLimit = ($selector, limit) => {
  // @todo update valid limits based on selector
  const validLimits = ['body', 'section', 'row', 'column'];

  if (! includes(validLimits, limit)) {
    return false;
  }

  // Limit selector
  const $limitSelector = getLimitSelector($selector, limit);

  if (! $limitSelector) {
    return false;
  }

  const height = $limitSelector.outerHeight();
  const width  = $limitSelector.outerWidth();

  return {
    limit,
    height,
    width,
    offsets: getOffsets($limitSelector, width, height),
  };
};

/**
 * Get top / bottom limit selector based on given name.
 *
 * @since 4.6.0
 *
 * @param {object} $selector
 * @param {string} limit
 *
 * @returns {bool|object}
 */
export const getLimitSelector = ($selector, limit) => {
  let parentSelector = false;

  switch (limit) {
    case 'body':
      parentSelector = '.et_builder_inner_content';
      break;
    case 'section':
      parentSelector = '.et_pb_section';
      break;
    case 'row':
      parentSelector = '.et_pb_row';
      break;
    case 'column':
      parentSelector = '.et_pb_column';
      break;
    default:
      break;
  }

  return parentSelector ? $selector.closest(parentSelector) : false;
};

/**
 * Filter invalid sticky modules
 * 1. Sticky module inside another sticky module.
 *
 * @param {object} modules
 * @param {object} currentModules
 *
 * @since 4.6.0
 */
export const filterInvalidModules = (modules, currentModules = {}) => {
  const filteredModules = {};

  forEach(modules, (module, key) => {
    // If current sticky module is inside another sticky module, ignore current module
    if ($(module.selector).parents('.et_pb_sticky_module').length > 0) {
      return;
    }

    // Repopulate the module list
    if (! isEmpty(currentModules) && currentModules[key]) {
      // Keep props that isn't available on incoming modules intact
      filteredModules[key] = {
        ...currentModules[key],
        ...module,
      };
    } else {
      filteredModules[key] = module;
    }
  });

  return filteredModules;
};

/**
 * Get sticky style of given module by cloning, adding sticky state classname, appending DOM,
 * retrieving value, then immediately the cloned DOM. This is needed for property that is most
 * likely to be affected by transition if the sticky value is retrieved on the fly, thus it needs
 * to be retrieved ahead its time by this approach.
 *
 * @since 4.6.0
 *
 * @param {string} id
 * @param {object} $module
 * @param {object} $placeholder
 *
 * @returns {object}
 */
export const getStickyStyles = (id, $module, $placeholder) => {
  // Sticky state classname to be added; these will make cloned module to have fixed position and
  // make sticky style take effect
  const stickyStyleClassname = 'et_pb_sticky et_pb_sticky_style_dom';

  // Cloned the module add sticky state classname; set the opacity to 0 and remove the transition
  // so the dimension can be immediately retrieved
  const $stickyStyleDom = $module.clone().addClass(stickyStyleClassname).attr({
    'data-sticky-style-dom-id': id,

    // Remove inline styles so on-page styles works. Especially needed if module is in sticky state
    style: '',
  }).css({
    opacity: 0,
    transition: 'none',
    animation: 'none',
  });

  // Cloned module might contain image. However the image might take more than a milisecond to be
  // loaded on the cloned module after the module is appended to the layout EVEN IF the image on
  // the $module has been loaded. This might load to inaccurate sticky style calculation. To avoid
  // it, recreate the image by getting actual width and height then recreate the image using SVG
  $stickyStyleDom.find('img').each(function(index) {
    const $img           = $(this);
    const $measuredImg   = $module.find('img').eq(index);
    const measuredWidth  = get($measuredImg, [0, 'naturalWidth'], $module.find('img').eq(index).outerWidth());
    const measuredHeight = get($measuredImg, [0, 'naturalHeight'], $module.find('img').eq(index).outerHeight());

    $img.attr({
      // Remove scrse to force DOM to use src
      scrset: '',

      // Recreate svg to use image's actual width so the image reacts appropriately when sticky
      // style modifies image dimension (eg image has 100% and padding in sticky style is larger;
      // this will resulting in image being smaller because the wrapper dimension is smaller)
      src: `data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="${measuredWidth}" height="${measuredHeight}"><rect width="${measuredWidth}" height="${measuredHeight}" /></svg>`,
    });
  });

  // Append the cloned DOM
  $module.after($stickyStyleDom);

  // Get inline margin style value that is substraction of sticky style - style due to position
  // relative to fixed change
  const getMarginStyle = corner => {
    const marginPropName = `margin${corner}`;
    const $normalModule  = $module.hasClass('et_pb_sticky') ? $placeholder : $module;

    return parseFloat($stickyStyleDom.css(marginPropName)) - parseFloat($normalModule.css(marginPropName));
  };

  /**
   * Equalize Column Heights :: If the parent container is an equal column(Flexbox), temporary hide
   * the placeholder module and the original modules to restore(expand) the width of the $stickyStyleDom.
   * We insert two clones i.e data-sticky-style-dom-id and data-sticky-placeholder-id of the module at the
   * original location of the module which causes columns(flex items) to shrink to fit in the row 
   * i.e .et_pb_equal_columns flex container.
   */
  const isEqualColumns = $module.parent().hasClass('et_pb_equal_columns');

  if(isEqualColumns) {
    $module.hide();
    $placeholder.hide();
  }

  // Measure sticky style DOM properties
  const styles = {
    height: $stickyStyleDom.outerHeight(),
    width: $stickyStyleDom.outerWidth(),
    marginRight: getMarginStyle('Right'),
    marginLeft: getMarginStyle('Left'),
    padding: $stickyStyleDom.css('padding'),
  };

  // display module and placeholder.
  if(isEqualColumns) {
    $module.show();
    $placeholder.show();
  }

  // Immediately remove the cloned DOM
  $(`.et_pb_sticky_style_dom[data-sticky-style-dom-id="${id}"]`).remove();

  return styles;
};

/**
 * Remove given property's transition from transition property's value. To make some properties
 * (eg. Width, top, left) transition smoothly when entering / leaving sticky state, its property
 * and transition need to be removed then re-added 50ms later. This is mostly happened because the
 * module positioning changed from relative to fixed when entering/leaving sticky state.
 *
 * @since 4.6.0
 *
 * @param {string} transitionValue
 * @param {Array} trimmedProperties
 *
 * @returns {string}
 */
export const trimTransitionValue = (transitionValue, trimmedProperties) => {
  // Make sure that transitionValue is string. Otherwise split will throw error
  if (! isString(transitionValue)) {
    transitionValue = '';
  }

  const transitions  = transitionValue.split(', ');
  const trimmedValue = filter(transitions, transition => ! includes(trimmedProperties, head(transition.split(' '))));

  return isEmpty(trimmedValue) ? 'none' : trimmedValue.join(', ');
};

/**
 * Calculate automatic offset that should be given based on sum of heights of all sticky modules
 * that are currently in sticky state when window reaches $target's offset.
 *
 * @since 4.6.0
 *
 * @param {object} $target
 *
 * @returns {number}
 */
export const getClosestStickyModuleOffsetTop = $target => {
  const offset = $target.offset();
  offset.right = offset.left + $target.outerWidth();

  let closestStickyElement   = null;
  let closestStickyOffsetTop = 0;

  // Get all sticky module data from store. NOTE: this util might be used on various output build
  // so it needs to get sticky store value via global object instead of importing it
  const stickyModules = get(window.ET_FE, 'stores.sticky.modules', {});

  // Loop sticky module data to get the closest sticky module to given y offset. Sticky module
  // already has map of valid modules it needs to consider as automatic offset due to
  // adjacent-column situation.
  // @see https://github.com/elegantthemes/Divi/issues/19432
  forEach(stickyModules, stickyModule => {
    // Ignore sticky module if it is stuck to bottom
    if (! includes(['top_bottom', 'top'], stickyModule.position)) {
      return;
    }

    // Ignore if $target is sticky module (that sticks to top; stuck to bottom check above has
    // made sure of it) - otherwise the auto-generate offset will subtract the element's offset
    // and causing the scroll never reaches $target location.
    // @see https://github.com/elegantthemes/Divi/issues/23240
    if ($target.is(get(stickyModule, 'selector'))) {
      return;
    }

    // Ignore if sticky module's right edge doesn't collide with target's left edge
    if (get(stickyModule, 'offsets.right', 0) < offset.left) {
      return;
    }

    // Ignore if sticky module's left edge doesn't collide with target's right edge
    if (get(stickyModule, 'offsets.left', 0) > offset.right) {
      return;
    }

    // Ignore sticky module if it is located below given y offset
    if (get(stickyModule, 'offsets.top', 0) > offset.top) {
      return;
    }

    // Ignore sticky module if its bottom limit is higher than given y offset
    const bottomLimitBottom = get(stickyModule, 'bottomLimitSettings.offsets.bottom');

    if (bottomLimitBottom && bottomLimitBottom < offset.top) {
      return;
    }

    closestStickyElement = stickyModule;
  });

  // Once closest sticky module to given y offset has been found, loop its topOffsetModules, get
  // each module's heightSticky and return the sum of their heights
  if (get(closestStickyElement, 'topOffsetModules', false)) {
    forEach(get(closestStickyElement, 'topOffsetModules', []), stickyId => {
      // Get sticky module's height on sticky state; fallback to height just to be safe
      const stickyModuleHeight = get(stickyModules, [stickyId, 'heightSticky'], get(stickyModules, [stickyId, 'height'], 0));

      // Sum up top offset module's height
      closestStickyOffsetTop += stickyModuleHeight;
    });

    // Get closest-to-y-offset's sticky module's height on sticky state;
    const closestStickyElementHeight = get(stickyModules, [closestStickyElement.id, 'heightSticky'], get(stickyModules, [closestStickyElement.id, 'height'], 0));

    // Sum up top offset module's height
    closestStickyOffsetTop += closestStickyElementHeight;
  }

  return closestStickyOffsetTop;
};

/**
 * Determine if the target is in sticky state.
 *
 * @since 4.9.5
 *
 * @param {object} $target
 *
 * @returns {bool}
 */
export const isTargetStickyState = $target => {
  const stickyModules = get(window.ET_FE, 'stores.sticky.modules', {});

  let isStickyState = false;

  forEach(stickyModules, stickyModule => {
    const isTarget             = $target.is(get(stickyModule, 'selector'));
    const {isSticky, isPaused} = stickyModule;

    // If the target is in sticky state and not paused, set isStickyState to true and exit iteration.
    // Elements can have a sticky limit (ex: section) in which case they can be sticky but paused.
    if (isTarget && isSticky && !isPaused) {
      isStickyState = true;

      return false; // Exit iteration.
    }
  });

  return isStickyState;
};
stores/window.js000064400000047752152336404310007750 0ustar00// External dependencies
import { EventEmitter } from 'events';
import forEach from 'lodash/forEach';
import get from 'lodash/get';
import includes from 'lodash/includes';
import isEqual from 'lodash/isEqual';
import $ from 'jquery';

// Internal dependencies
import { top_window } from '@core-ui/utils/frame-helpers';
import ETScriptStickyStore from './sticky';
import {
  getContentAreaSelector,
  getTemplateEditorIframe,
} from '../../frontend-builder/gutenberg/utils/selectors';
import { isTemplateEditor } from '../../frontend-builder/gutenberg/utils/conditionals';
import {
  getBuilderUtilsParams,
  isBFB,
  isExtraTheme,
  isFE,
  isLBB,
  isLBP,
  isTB,
  isVB,
  maybeDecreaseEmitterMaxListeners,
  maybeIncreaseEmitterMaxListeners,
  registerFrontendComponent,
} from '../utils/utils';

// Builder window
const $window         = $(window);
const $topWindow      = top_window.jQuery(top_window);
const hasTopWindow    = ! isEqual(window, top_window);
const windowLocations = hasTopWindow ? ['app', 'top'] : ['app'];

// Event Constants
const HEIGHT_CHANGE              = 'height_change';
const WIDTH_CHANGE               = 'width_change';
const SCROLL_TOP_CHANGE          = 'scroll_top_change';
const BREAKPOINT_CHANGE          = 'breakpoint_change';
const SCROLL_LOCATION_CHANGE     = 'scroll_location_change';
const VERTICAL_SCROLL_BAR_CHANGE = 'vertical_scroll_bar_change';

// States.
// Private, limited to this module (ETScriptWindowStore class) only
const states = {
  breakpoint: 'desktop',
  extraMobileBreakpoint: false,
  isBuilderZoomed: false,
  scrollLocation: getBuilderUtilsParams().onloadScrollLocation, // app|top
  scrollTop: {
    app: 0,
    top: 0,
  },
  height: {
    app: 0,
    top: 0,
  },
  width: {
    app: 0,
    top: 0,
  },
  bfbIframeOffset: {
    top: 0,
    left: 0,
  },
  lbpIframeOffset: {
    top: 0,
    left: 0,
  },
  verticalScrollBar: {
    app: 0,
    top: 0,
  },
};

// Valid values.
// Retrieved from server, used for validating values
const validValues = {
  scrollLocation: [...getBuilderUtilsParams().scrollLocations],
};

// Variables
const builderScrollLocations = {
  ...getBuilderUtilsParams().builderScrollLocations,
};

// @todo need to change how this works since builder already have et_screen_sizes(), unless
// we prefer to add another breakpoint functions
const deviceMinimumBreakpoints = {
  desktop: 980,
  tablet: 767,
  phone: 0,
};
const bfbFrameId               = '#et-bfb-app-frame';

/**
 * Window store.
 *
 * This store listen to direct window's events; builder callback listen to this store's events
 * to avoid dom-based calculation whenever possible; use the property passed by this store.
 *
 * @since 4.6.0
 */
class ETScriptWindowStore extends EventEmitter {
  /**
   * ETScriptWindowStore constructor.
   *
   * @since 4.6.0
   */
  constructor() {
    super();

    // Set app window onload values
    const windowWidth     = $window.innerWidth();
    const windowHeight    = $window.innerHeight();
    const windowScrollTop = $window.scrollTop();

    this.setWidth('app', windowWidth).setHeight('app', windowHeight);
    this.setScrollTop('app', windowScrollTop);
    this.setVerticalScrollBarWidth('app', (window.outerWidth - windowWidth));

    // Set top window onload values (if top window exist)
    if (hasTopWindow) {
      const topWindowWidth     = $topWindow.innerWidth();
      const topWindowHeight    = $topWindow.innerHeight();
      const topWindowScrollTop = top_window.jQuery(top_window).scrollTop();

      this.setWidth('top', topWindowWidth).setHeight('top', topWindowHeight);
      this.setScrollTop('top', topWindowScrollTop);
      this.setVerticalScrollBarWidth('top', (top_window.outerWidth - topWindowWidth));
    }

    // Set iframe offset
    if (isBFB) {
      this.setBfbIframeOffset();
    }

    // Set Layout Block iframe offset
    if (isLBP) {
      this.setLayoutBlockPreviewIframeOffset();
    }
  }

  /**
   * Set window height.
   *
   * @since 4.6.0
   *
   * @param {string} windowLocation App|top.
   * @param {number} height
   *
   * @returns {Window}
   */
  setHeight = (windowLocation = 'app', height) => {
    if (height === states.height[windowLocation]) {
      return this;
    }

    states.height[windowLocation] = height;

    this.emit(HEIGHT_CHANGE);

    return this;
  };

  /**
   * Set window width.
   *
   * @since 4.6.0
   *
   * @param {string} windowLocation App|top.
   * @param {number} width
   *
   * @returns {Window}
   */
  setWidth = (windowLocation = 'app', width) => {
    if (width === states.width[windowLocation]) {
      return this;
    }

    // Only app window could set breakpoint
    if ('app' === windowLocation) {
      this.setBreakpoint(width);

      // Extra theme has its own "mobile breakpoint" (below 1024px)
      if (isExtraTheme) {
        const outerWidth            = this.width + this.verticalScrollBar;
        const extraMobileBreakpoint = 1024;
        const fixedNavActivation    = ! states.extraMobileBreakpoint && outerWidth >= extraMobileBreakpoint;
        const fixedNavDeactivation  = states.extraMobileBreakpoint && outerWidth < extraMobileBreakpoint;

        // Re-set element props when Extra mobile breakpoint change happens
        if (fixedNavActivation || fixedNavDeactivation) {
          states.extraMobileBreakpoint = (outerWidth >= extraMobileBreakpoint);

          ETScriptStickyStore.setElementsProps();
        }
      }
    }

    states.width[windowLocation] = width;

    this.emit(WIDTH_CHANGE);

    return this;
  };

  /**
   * Set scroll location value.
   *
   * @since 4.6.0
   *
   * @param {string} scrollLocation App|top.
   *
   * @returns {ETScriptWindowStore}
   */
  setScrollLocation = scrollLocation => {
    // Prevent incorrect scroll location value from being saved
    if (! includes(validValues.scrollLocation, scrollLocation)) {
      return false;
    }

    if (scrollLocation === states.scrollLocation) {
      return this;
    }

    states.scrollLocation = scrollLocation;

    this.emit(SCROLL_LOCATION_CHANGE);

    return this;
  }

  /**
   * Set scroll top value.
   *
   * @since 4.6.0
   *
   * @param {string} windowLocation App|top.
   * @param {number} scrollTop
   *
   * @returns {ETScriptWindowStore}
   */
  setScrollTop = (windowLocation, scrollTop) => {
    if (scrollTop === states.scrollTop[windowLocation]) {
      return this;
    }

    states.scrollTop[windowLocation] = scrollTop;

    this.emit(SCROLL_TOP_CHANGE);

    return this;
  }

  /**
   * Set builder zoomed status (on builder only).
   *
   * @since 4.6.0
   *
   * @param {string} builderPreviewMode Desktop|tablet|phone|zoom|wireframe.
   */
  setBuilderZoomedStatus = builderPreviewMode => {
    const isBuilderZoomed = 'zoom' === builderPreviewMode;

    states.isBuilderZoomed = isBuilderZoomed;
  }

  /**
   * Set BFB iframe offset.
   *
   * @since 4.6.0
   */
  setBfbIframeOffset = () => {
    states.bfbIframeOffset = top_window.jQuery(bfbFrameId).offset();
  }

  /**
   * Set Layout Block iframe offset.
   *
   * @since 4.6.0
   */
  setLayoutBlockPreviewIframeOffset = () => {
    const blockId          = get(window.ETBlockLayoutModulesScript, 'blockId', '');
    const previewIframeId  = `#divi-layout-iframe-${blockId}`;
    const $block           = top_window.jQuery(previewIframeId).closest('.wp-block[data-type="divi/layout"]');
    const blockPosition    = $block.position();
    const contentSelectors = [
      // WordPress 5.4
      'block-editor-editor-skeleton__content',

      // WordPress 5.5
      'interface-interface-skeleton__content',
    ];

    let blockOffsetTop = parseInt(get(blockPosition, 'top', 0));

    // Since WordPress 5.4, blocks list position to its parent somehow is not considered
    // Previous inserted DOM are also gone + Block item now has collapsing margin top/bottom
    // These needs to be manually calculated here since the result is no longer identical
    if (includes(contentSelectors, getContentAreaSelector(top_window, false))) {
      // Find Block List Layout. By default, it's located on editor of top window.
      // When Template Editor is active, it's "moved" to editor of iframe window.
      const $blockEditorLayout = isTemplateEditor() ? getTemplateEditorIframe(top_window).find('.block-editor-block-list__layout.is-root-container') : top_window.jQuery('.block-editor-block-list__layout');

      // Blocks list position to its parent (title + content wrapper)
      // WordPress 5.4 = 183px
      // WordPress 5.5 = 161px
      if ($blockEditorLayout.length) {
        blockOffsetTop += $blockEditorLayout.position().top;
      }

      // Compensating collapsing block item margin top
      blockOffsetTop += parseInt($block.css('marginTop')) || 0;
    }

    // Admin bar in less than 600 width window uses absolute positioning which stays on top of
    // document and affecting iframe top offset
    if (600 > this.width && ETScriptStickyStore.getElementProp('wpAdminBar', 'exist', false)) {
      blockOffsetTop += ETScriptStickyStore.getElementProp('wpAdminBar', 'height', 0);
    }

    states.lbpIframeOffset.top = blockOffsetTop;
  }

  /**
   * Set vertical scrollbar width.
   *
   * @since 4.6.0
   *
   * @param {string} windowLocation
   * @param {number} width
   */
  setVerticalScrollBarWidth = (windowLocation = 'app', width) => {
    if (width === states.verticalScrollBar[windowLocation]) {
      return this;
    }

    states.verticalScrollBar[windowLocation] = width;

    this.emit(VERTICAL_SCROLL_BAR_CHANGE);

    return this;
  }

  /**
   * Get current window width.
   *
   * @since 4.6.0
   *
   * @returns {number}
   */
  get width() {
    return states.width[this.scrollLocation];
  }

  /**
   * Get current window height.
   *
   * @since 4.6.0
   *
   * @returns {number}
   */
  get height() {
    return states.height[this.scrollLocation];
  }

  /**
   * Get current window scroll location.
   *
   * @since 4.6.0
   *
   * @returns {string} App|top.
   */
  get scrollLocation() {
    return states.scrollLocation;
  }

  /**
   * Get current window scroll top / distance to document.
   *
   * @since 4.6.0
   *
   * @returns {number}
   */
  get scrollTop() {
    const multiplier = this.isBuilderZoomed ? 2 : 1;

    let appFrameOffset = 0;

    // Add app iframe offset on scrollTop calculation in BFB
    if (isBFB) {
      appFrameOffset += states.bfbIframeOffset.top;
    }

    // Add Layout Block preview iframe on scrollTop calculation
    if (isLBP) {
      appFrameOffset += states.lbpIframeOffset.top;
    }

    return (states.scrollTop[this.scrollLocation] - appFrameOffset) * multiplier;
  }

  /**
   * Get current app window breakpoint (by device).
   *
   * @since 4.6.0
   *
   * @returns {string}
   */
  get breakpoint() {
    return states.breakpoint;
  }

  /**
   * Get builder zoomed status.
   *
   * @since 4.6.0
   *
   * @returns {bool}
   */
  get isBuilderZoomed() {
    return states.isBuilderZoomed;
  }

  /**
   * Get current window vertical scrollbar width.
   *
   * @since 4.6.0
   *
   * @returns {number}
   */
  get verticalScrollBar() {
    return states.verticalScrollBar[this.scrollLocation];
  }

  /**
   * Get builder scroll location of builder context + preview mode.
   *
   * @since 4.6.0
   *
   * @param {string} previewMode Desktop|tablet|phone|zoom|wireframe.
   *
   * @returns {string} App|top.
   */
  getBuilderScrollLocation = previewMode => get(builderScrollLocations, previewMode, 'app')

  /**
   * Add width change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   *
   * @returns {Window}
   */
  addWidthChangeListener = callback => {
    maybeIncreaseEmitterMaxListeners(this, WIDTH_CHANGE);
    this.on(WIDTH_CHANGE, callback);
    return this;
  };

  /**
   * Remove width change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   *
   * @returns {Window}
   */
  removeWidthChangeListener = callback => {
    this.removeListener(WIDTH_CHANGE, callback);
    maybeDecreaseEmitterMaxListeners(this, WIDTH_CHANGE);
    return this;
  };

  /**
   * Add height change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   *
   * @returns {Window}
   */
  addHeightChangeListener = callback => {
    maybeIncreaseEmitterMaxListeners(this, HEIGHT_CHANGE);
    this.on(HEIGHT_CHANGE, callback);
    return this;
  };

  /**
   * Remove height change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   *
   * @returns {Window}
   */
  removeHeightChangeListener = callback => {
    this.removeListener(HEIGHT_CHANGE, callback);
    maybeDecreaseEmitterMaxListeners(this, HEIGHT_CHANGE);
    return this;
  };

  /**
   * Add scroll location change event listener.
   *
   * @param callback
   * @since 4.6.0
   * @returns {ETScriptWindowStore}
   */
  addScrollLocationChangeListener = callback => {
    maybeIncreaseEmitterMaxListeners(this, SCROLL_LOCATION_CHANGE);
    this.on(SCROLL_LOCATION_CHANGE, callback);
    return this;
  }

  /**
   * Remove scroll location change event listener.
   *
   * @param callback
   * @since 4.6.0
   * @returns {ETScriptWindowStore}
   */
  removeScrollLocationChangeListener = callback => {
    this.removeListener(SCROLL_LOCATION_CHANGE, callback);
    maybeDecreaseEmitterMaxListeners(this, SCROLL_LOCATION_CHANGE);
    return this;
  }

  /**
   * Add scroll top change event listener.
   *
   * @param callback
   * @since 4.6.0
   * @returns {ETScriptWindowStore}
   */
  addScrollTopChangeListener = callback => {
    maybeIncreaseEmitterMaxListeners(this, SCROLL_TOP_CHANGE);
    this.on(SCROLL_TOP_CHANGE, callback);
    return this;
  }

  /**
   * Remove scroll top change event listener.
   *
   * @param callback
   * @since 4.6.0
   * @returns {ETScriptWindowStore}
   */
  removeScrollTopChangeListener = callback => {
    this.removeListener(SCROLL_TOP_CHANGE, callback);
    maybeDecreaseEmitterMaxListeners(this, SCROLL_TOP_CHANGE);
    return this;
  }

  /**
   * Set breakpoint (by device) based on window width.
   *
   * @since 4.6.0
   *
   * @todo Update breakpoint setting mechanic so this won't need to define another screen size definition
   *       and able to reuse (et_screen_size()).
   *
   * @param {number} windowWidth
   *
   * @returns {ETScriptWindowStore}
   */
  setBreakpoint = windowWidth => {
    let newBreakpoint = '';

    forEach(deviceMinimumBreakpoints, (minWidth, device) => {
      if (windowWidth > minWidth) {
        newBreakpoint = device;

        // equals to "break"
        return false;
      }
    });

    // No need to update breakpoint property if it is unchanged
    if (this.breakpoint === newBreakpoint) {
      return;
    }

    states.breakpoint = newBreakpoint;

    this.emit(BREAKPOINT_CHANGE);

    return this;
  }

  /**
   * Add breakpoint change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   */
  addBreakpointChangeListener = callback => {
    maybeIncreaseEmitterMaxListeners(this, BREAKPOINT_CHANGE);
    this.on(BREAKPOINT_CHANGE, callback);
    return this;
  }

  /**
   * Remove breakpoint change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   */
  removeBreakpointChangeListener = callback => {
    this.removeListener(BREAKPOINT_CHANGE, callback);
    maybeDecreaseEmitterMaxListeners(this, BREAKPOINT_CHANGE);
    return this;
  }
}

// initiate window store instance
const windowStoreInstance = new ETScriptWindowStore();


/**
 * Listen for (app/top) window events, and update store's value
 * store is listener free; it only hold / set / get values.
 */
forEach(windowLocations, windowLocation => {
  const isTop          = 'top' === windowLocation;
  const isApp          = 'app' === windowLocation;
  const currentWindow  = isApp ? window : top_window;
  const $currentWindow = currentWindow.jQuery(currentWindow);

  // Scroll in Theme Builder & Layout Block Builder happens on element; adjustment needed
  // const scrollWindow   = isTop && (isTB || isLBB) ? currentWindow.document.getElementById('et-fb-app') : currentWindow;
  const scrollWindow = () => {
    // Theme Builder & Layout Block Builder
    if (isTop && (isTB || isLBB)) {
      return currentWindow.document.getElementById('et-fb-app');
    }

    // Layout Block Preview / Gutenberg
    if (isTop && isLBP) {
      return currentWindow.document.getElementsByClassName(getContentAreaSelector(currentWindow, false))[0];
    }

    return currentWindow;
  };

  // listen to current (app/top) window resize event
  currentWindow.addEventListener('resize', () => {
    const width  = currentWindow.jQuery(currentWindow).innerWidth();
    const height = currentWindow.jQuery(currentWindow).innerHeight();

    windowStoreInstance.setWidth(windowLocation, width).setHeight(windowLocation, height);
    windowStoreInstance.setVerticalScrollBarWidth(windowLocation, (currentWindow.outerWidth - width));

    if ((windowStoreInstance.width > 782 && height <= 782) || (windowStoreInstance.width <= 782 && height > 782)) {
      // Wait until admin bar's viewport style kicks in
      setTimeout(() => {
        ETScriptStickyStore.setElementHeight('wpAdminBar');

        windowStoreInstance.emit(SCROLL_TOP_CHANGE);
      }, 300);
    }
  });

  // listen to current (app/top) window scroll event
  scrollWindow().addEventListener('scroll', () => {
    const scrollTop = isTop && (isTB || isLBB || isLBP) ? scrollWindow().scrollTop : scrollWindow().pageYOffset;

    windowStoreInstance.setScrollTop(windowLocation, scrollTop);
  });

  // Top window listener only
  if (isTop) {
    // Listen to builder's preview mode change that is passed via top window event
    $currentWindow.on('et_fb_preview_mode_changed', (event, screenMode, builderMode) => {
      const scrollLocation = windowStoreInstance.getBuilderScrollLocation(builderMode);

      windowStoreInstance.setBuilderZoomedStatus(builderMode);
      windowStoreInstance.setScrollLocation(scrollLocation);
    });

    // Update iframe offset if any metabox is moved
    if (isBFB) {
      currentWindow.addEventListener('ETBFBMetaboxSortStopped', () => {
        windowStoreInstance.setBfbIframeOffset();
      });
    }

    // Gutenberg moves the scroll back to window if window's width is less than 600px
    if (isLBP) {
      currentWindow.addEventListener('scroll', () => {
        if (windowStoreInstance.width > 600) {
          return;
        }

        const scrollTop = currentWindow.pageYOffset;

        windowStoreInstance.setScrollTop(windowLocation, scrollTop);
      });
    }

    // When scroll is located on top window, there is a chance that the top window actually scrolls
    // before the builder is loaded which means initial scroll top value actually has changed
    // to avoid issue caused by it, when app window that carries this script is loaded, trigger
    // scroll event on the top window's scrolling element
    scrollWindow().dispatchEvent(new CustomEvent('scroll'));
  }

  // App window listener only
  if (isApp) {
    // Update known element props when breakpoint changes. Breakpoint change is basically less
    // aggressive resize event, happened between known window's width
    if (isFE || isVB) {
      windowStoreInstance.addBreakpointChangeListener(() => {
        ETScriptStickyStore.setElementsProps();
      });
    }

    // Update iframe offset if layout block is moved
    if (isLBP) {
      currentWindow.addEventListener('ETBlockGbBlockOrderChange', () => {
        // Need to wait at least 300ms until GB animation is done
        setTimeout(() => {
          windowStoreInstance.setLayoutBlockPreviewIframeOffset();

          windowStoreInstance.emit(SCROLL_TOP_CHANGE);
        }, 300);
      });

      // Update iframe offset if notice size is changed
      currentWindow.addEventListener('ETGBNoticeSizeChange', () => {
        if (ETScriptStickyStore.getElementProp('gbComponentsNoticeList', 'exist', false)) {
          ETScriptStickyStore.setElementHeight('gbComponentsNoticeList');

          windowStoreInstance.emit(SCROLL_TOP_CHANGE);
        }
      });
    }
  }
});

// Register store instance as component to be exposed via global object
registerFrontendComponent('stores', 'window', windowStoreInstance);

// Export store instance
// IMPORTANT: For uniformity, import this as ETScriptWindowStore
export default windowStoreInstance;
stores/document.js000064400000012365152336404310010247 0ustar00// External dependencies
import { EventEmitter } from 'events';
import debounce from 'lodash/debounce';
import get from 'lodash/get';

// Internal dependencies
import {
  maybeDecreaseEmitterMaxListeners,
  maybeIncreaseEmitterMaxListeners,
  registerFrontendComponent,
} from '../utils/utils';


const HEIGHT_CHANGE    = 'height_change';
const WIDTH_CHANGE     = 'width_change';
const DIMENSION_CHANGE = 'dimension_change';

// States
const states = {
  height: 0,
  width: 0,
};

/**
 * Document store; track document height (at the moment) and its changes. Builder elements
 * should listen and get this store's value instead of directly getting it from document.
 * ETScriptDocumentStore is not exported; intentionally export its instance so there'll only be one
 * ETScriptDocumentStore instance.
 *
 * @since 4.6.0
 */
class ETScriptDocumentStore extends EventEmitter {
  /**
   * ETScriptDocumentStore constructor.
   *
   * @since 4.6.0
   */
  constructor() {
    super();

    this.setHeight(get(document, 'documentElement.offsetHeight'));
    this.setWidth(get(document, 'documentElement.offsetWidth'));
  }

  /**
   * Record document height.
   *
   * @since 4.6.0
   *
   * @param {number} height
   *
   * @returns {Window}
   */
  setHeight = height => {
    if (height === states.height) {
      return this;
    }

    states.height = height;

    this.emit(HEIGHT_CHANGE);
    this.emit(DIMENSION_CHANGE);

    return this;
  };

  /**
   * Record document width.
   *
   * @since 4.6.0
   *
   * @param {number} width
   *
   * @returns {Window}
   */
  setWidth = width => {
    if (width === states.width) {
      return this;
    }

    states.width = width;

    this.emit(WIDTH_CHANGE);
    this.emit(DIMENSION_CHANGE);

    return this;
  };

  /**
   * Get recorded document height.
   *
   * @since 4.6.0
   *
   * @returns {number}
   */
  get height() {
    return states.height;
  }

  /**
   * Get recorded document width.
   *
   * @since 4.6.0
   *
   * @returns {number}
   */
  get width() {
    return states.width;
  }

  /**
   * Add document dimension change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   *
   * @returns {Window}
   */
  addDimensionChangeListener = callback => {
    maybeIncreaseEmitterMaxListeners(this, DIMENSION_CHANGE);
    this.on(DIMENSION_CHANGE, callback);
    return this;
  };

  /**
   * Remove document dimension change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   *
   * @returns {Window}
   */
  removeDimensionChangeListener = callback => {
    this.removeListener(DIMENSION_CHANGE, callback);
    maybeDecreaseEmitterMaxListeners(this, DIMENSION_CHANGE);
    return this;
  };

  /**
   * Add document height change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   *
   * @returns {Window}
   */
  addHeightChangeListener = callback => {
    maybeIncreaseEmitterMaxListeners(this, HEIGHT_CHANGE);
    this.on(HEIGHT_CHANGE, callback);
    return this;
  };

  /**
   * Remove document height change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   *
   * @returns {Window}
   */
  removeHeightChangeListener = callback => {
    this.removeListener(HEIGHT_CHANGE, callback);
    maybeDecreaseEmitterMaxListeners(this, HEIGHT_CHANGE);
    return this;
  };

  /**
   * Add document width change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   *
   * @returns {Window}
   */
  addWidthChangeListener = callback => {
    maybeIncreaseEmitterMaxListeners(this, WIDTH_CHANGE);
    this.on(WIDTH_CHANGE, callback);
    return this;
  };

  /**
   * Remove document width change event listener.
   *
   * @since 4.6.0
   *
   * @param {Function} callback
   *
   * @returns {Window}
   */
  removeWidthChangeListener = callback => {
    this.removeListener(WIDTH_CHANGE, callback);
    maybeDecreaseEmitterMaxListeners(this, WIDTH_CHANGE);
    return this;
  };
}

// Create document store instance
const documentStoreInstance = new ETScriptDocumentStore();

/**
 * Event's function callback to update document store's props
 *
 * @since 4.6.2
 */
function updateDocumentStoreProps() {
  const documentHeight = get(document, 'documentElement.offsetHeight');
  const documentWidth  = get(document, 'documentElement.offsetWidth');

  // Store automatically ignore if given height value is equal to the current one; so this is fine
  documentStoreInstance.setHeight(documentHeight).setWidth(documentWidth);
}

// Listen to document's DOM change, debounce its callback, and update store's props
const documentObserver = new MutationObserver(debounce(updateDocumentStoreProps, 50));

// Observe document change
// @todo probably plug this on only when necessary
// @todo also enable to plug this off
documentObserver.observe(document, {
  attributes: true,
  childList: true,
  subtree: true,
});

// Update document store properties when Divi's fixed header transition is completed
window.addEventListener('ETDiviFixedHeaderTransitionEnd', updateDocumentStoreProps);

// Register store instance as component to be exposed via global object
registerFrontendComponent('stores', 'document', documentStoreInstance);

// Export store instance.
// IMPORTANT: For uniformity, import this as ETScriptDocumentStore
export default documentStoreInstance;
stores/sticky.js000064400000100445152336404310007734 0ustar00// External dependencies
import { EventEmitter } from 'events';
import assign from 'lodash/assign';
import cloneDeep from 'lodash/cloneDeep';
import compact from 'lodash/compact';
import filter from 'lodash/filter';
import forEach from 'lodash/forEach';
import get from 'lodash/get';
import has from 'lodash/has';
import head from 'lodash/head';
import includes from 'lodash/includes';
import isEqual from 'lodash/isEqual';
import isFunction from 'lodash/isFunction';
import isObject from 'lodash/isObject';
import isUndefined from 'lodash/isUndefined';
import keys from 'lodash/keys';
import last from 'lodash/last';
import map from 'lodash/map';
import mapKeys from 'lodash/mapKeys';
import set from 'lodash/set';
import size from 'lodash/size';
import slice from 'lodash/slice';
import sortBy from 'lodash/sortBy';
import $ from 'jquery';

// Internal dependencies
import {
  isOrHasValue,
} from '@frontend-builder/utils/responsive-options-pure';
import {
  top_window,
} from '@core-ui/utils/frame-helpers';
import ETScriptDocumentStore from './document';
import ETScriptWindowStore from './window';
import {
  getOffsets,
  isBFB,
  isBuilder,
  isDiviTheme,
  isExtraTheme,
  isLBB,
  isTB,
  isVB,
  maybeDecreaseEmitterMaxListeners,
  maybeIncreaseEmitterMaxListeners,
  registerFrontendComponent,
} from '../utils/utils';

import {
  filterInvalidModules,
  getLimit,
} from '../utils/sticky';

// Event Constants
const SETTINGS_CHANGE = 'settings_change';

// Variables
const $body       = $('body');
const hasFixedNav = $body.hasClass('et_fixed_nav');

/**
 * Saved sticky elements. In FE, this means all the sticky settings that exist on current page.
 * In VB (and other builder context) this means sticky settings that exist on current page but
 * is rendered outside current builder type. Removed nested sticky module (sticky inside another
 * sticky module) from the module list.
 *
 * @since 4.6.0
 *
 * @type {object}
 */
const savedStickyElements = filterInvalidModules(cloneDeep(window.et_pb_sticky_elements));

/**
 * Defaults of known non module elements which its stickiness needs to be considered.
 *
 * @since 4.6.0
 *
 * @type {object}
 */
const elementsDefaults = {
  wpAdminBar: {
    id: 'wpAdminBar',
    selector: '#wpadminbar',
    exist: false,
    height: 0,
    window: 'top',
    condition: () => {
      // Admin bar doesn't have fixed position in smaller breakpoint
      const isPositionFixed = 'fixed' === top_window.jQuery(elements.wpAdminBar.selector).css('position');

      // When Responsive View's control is visible, admin bar offset becomes irrelevant. Note:
      // At this point the `height` value might not be updated yet, so manually get the height
      // value via `getHeight()` method.
      const hasVbAppFramePaddingTop = elements.builderAppFramePaddingTop.getHeight() > 0;

      return ! hasVbAppFramePaddingTop && ! isTB && ! isLBB && isPositionFixed;
    },
  },
  diviFixedPrimaryNav: {
    id: 'diviPrimaryNav',
    selector: '#main-header',
    exist: false,
    height: 0,
    window: 'app',
    condition: () => {
      // Divi Theme has fixed nav. Note: vertical header automatically removes .et_fixed_nav
      // classname so it is fine just to test fixed nav state against .et_fixed_nav classname only
      const hasFixedNavBodyClass = isDiviTheme && hasFixedNav;

      // Check for element's existence
      const isNavExist = $(elements.diviFixedPrimaryNav.selector).length > 0;

      // Primary nav is doesn't have fixed position in smaller breakpoint
      const isPositionFixed = 'fixed' === $(elements.diviFixedPrimaryNav.selector).css('position');

      return hasFixedNavBodyClass && isNavExist && isPositionFixed;
    },
    getHeight: () => {
      const $mainHeader = $(elementsDefaults.diviFixedPrimaryNav.selector);

      // Bail if this isn't Divi
      if (! isDiviTheme && 1 > $mainHeader.length) {
        return 0;
      }

      // Clone header
      const $clone = $mainHeader.clone();

      // Emulate fixed header state. Fixed header state is emulated as soon as the window is
      // scrolled so it is safe to assume that any sticky module on its sticky state will "meet"
      // header on its fixed state; this will avoid unwanted "jump" effect that happens because
      // fixed header has 400ms transition which could be slower than scroll speed; The fixed header
      // state also adds negative margin top state to #page-container which triggers document
      // dimension change event. Also add classname which will ensure that this clone won't
      // be visible to end user even if we only render it for a split second to avoid issues
      $clone.addClass('et-fixed-header et-script-temporary-measurement');

      // Add it to layout so its dimension can be measured
      $mainHeader.parent().append($clone);

      // Measure the fixed header height
      const height = $clone.outerHeight();

      // Immediately remove the cloned DOM from layout
      $clone.remove();

      return parseFloat(height);
    },
  },
  diviFixedSecondaryNav: {
    id: 'diviPrimaryNav',
    selector: '#top-header',
    exist: false,
    height: 0,
    window: 'app',
    condition: () => {
      // Divi Theme has fixed nav. Note: vertical header automatically removes .et_fixed_nav
      // classname so it is fine just to test fixed nav state against .et_fixed_nav classname only
      const hasFixedNavBodyClass = isDiviTheme && hasFixedNav;

      // Check for element's existence
      const isNavExist = $(elements.diviFixedSecondaryNav.selector).length > 0;

      // Primary nav is doesn't have fixed position in smaller breakpoint
      const isPositionFixed = 'fixed' === $(elements.diviFixedSecondaryNav.selector).css('position');

      return hasFixedNavBodyClass && isNavExist && isPositionFixed;
    },
  },
  extraFixedPrimaryNav: {
    id: 'extraFixedPrimaryNav',
    selector: '#main-header',
    exist: false,
    height: 0,
    window: 'app',
    condition: () => {
      if (! isObject(ETScriptWindowStore) || ! isExtraTheme) {
        return false;
      }

      // Extra Theme has fixed nav.
      const hasFixedNavBodyClass = isExtraTheme && hasFixedNav;

      // Check for element's existence.
      const isNavExist = $(elements.extraFixedPrimaryNav.selector).length > 0;

      // Extra has its own breakpoint for fixed nav. Detecting computed style is most likely fail
      // because retrieved value is always one step behind before the computed style result is retrieved
      const isPositionFixed = 1024 <= (ETScriptWindowStore.width + ETScriptWindowStore.verticalScrollBar);

      return hasFixedNavBodyClass && isNavExist && isPositionFixed;
    },
    getHeight: () => {
      const $mainHeader = $(elementsDefaults.extraFixedPrimaryNav.selector);

      // Bail if this isn't Extra
      if (! isExtraTheme && 1 > $mainHeader.length) {
        return 0;
      }

      // Clone header
      const $clone = $mainHeader.clone();

      // Emulate fixed header state. Fixed header state is emulated as soon as the window is
      // scrolled so it is safe to assume that any sticky module on its sticky state will "meet"
      // header on its fixed state; this will avoid unwanted "jump" effect that happens because
      // fixed header has 500ms transition which could be slower than scroll speed; The fixed header
      // state also adds negative margin top state to #page-container which triggers document
      // dimension change event. Also add classname which will ensure that this clone won't
      // be visible to end user even if we only render it for a split second to avoid issues
      $clone.addClass('et-fixed-header et-script-temporary-measurement');

      // Add it to layout so its dimension can be measured
      $mainHeader.parent().append($clone);

      // Measure the fixed header height
      const height = $clone.outerHeight();

      // Immediately remove the cloned DOM from layout
      $clone.remove();

      return parseFloat(height);
    },
  },
  builderAppFramePaddingTop: {
    id: 'builderAppFramePaddingTop',
    selector: isBFB ? '#et-bfb-app-frame' : '#et-fb-app-frame',
    exist: false,
    height: 0,
    window: 'top',
    getHeight: () => {
      const selector = elements.builderAppFramePaddingTop.selector;
      const cssProperty = isBFB ? 'marginTop' : 'paddingTop';
      const paddingTop = top_window.jQuery(selector).css(cssProperty);

      return parseFloat(paddingTop);
    }
  },
  tbHeader: {
    id: 'et-tb-branded-modal__header',
    selector: '.et-tb-branded-modal__header',
    exist: false,
    height: 0,
    window: 'top',
  },
  lbbHeader: {
    id: 'et-block-builder-modal--header',
    selector: '.et-block-builder-modal--header',
    exist: false,
    height: 0,
    window: 'top',
  },
  gbHeader: {
    id: 'edit-post-header',

    // This selector exist on WP 5.4 and below; hence these are used instead of `.block-editor-editor-skeleton__header`
    selector: '.edit-post-header',
    exist: false,
    height: 0,
    window: 'top',
  },
  gbFooter: {
    id: 'block-editor-editor-skeleton__footer',
    selector: '.block-editor-editor-skeleton__footer',
    exist: false,
    height: 0,
    window: 'top',
  },
  gbComponentsNoticeList: {
    id: 'components-notice-list',
    selector: '.components-notice-list',
    exist: false,
    height: 0,
    window: 'top',
    multiple: true,
  },
};

/**
 * Known non module elements which its stickiness needs to be considered.
 *
 * @since 4.6.0
 *
 * @type {object}
 */
const elements = cloneDeep(elementsDefaults);

// States
/**
 * Hold all sticky elements modules' properties.
 *
 * @since 4.6.0
 *
 * @type {object}
 */
let modules = {};


/**
 * Sticky Elements store.
 *
 * This store stores selected properties of all sticky elements on the page so a sticky element
 * can use other sticky element's calculated value quickly.
 *
 * @since 4.6.0
 */
class ETScriptStickyStore extends EventEmitter {
  /**
   * ETScriptStickyStore constructor.
   *
   * @since 4.6.0
   */
  constructor() {
    super();

    // Load modules passed via global variable from server via wp_localize_script()
    assign(modules, savedStickyElements);

    // Caculate top/bottom offsetModules which are basically list of sticky elements that need
    // to be considered for additional offset calculation when `Offset From Surrounding Sticky Elements`
    // option is toggled `on`
    this.generateOffsetModules();

    // Calculate known elements' properties. This needs to be done after DOM is ready
    if (isVB) {
      $(window).on('et_fb_init_app_after', () => {
        this.setElementsProps();
      });
    } else {
      $(() => {
        this.setElementsProps();
      });
    }

    // Some props need to be updated when document height is changed (eg. fixed nav's height)
    ETScriptDocumentStore.addHeightChangeListener(this.onDocumentHeightChange);

    // Builder specific event callback
    if (isBuilder) {
      // Event callback once the builder has been mounted
      $(window).on('et_fb_root_did_mount', this.onBuilderDidMount);

      // Listen to builder change if current window is builder window
      window.addEventListener('ETBuilderStickySettingsSyncs', this.onBuilderSettingsChange);
    }
  }

  /**
   * Get registered modules.
   *
   * @since 4.6.0
   *
   * @type {object}
   */
  get modules() {
    return modules;
  }

  /**
   * List of builder options (that is used by sticky elements) that has responsive mode.
   *
   * @since 4.6.0
   *
   * @returns {Array}
   */
  get responsiveOptions() {
    const options = [
      'position',
      'topOffset',
      'bottomOffset',
      'topLimit',
      'bottomLimit',
      'offsetSurrounding',
      'transition',
      'topOffsetModules',
      'bottomOffsetModules',
    ];

    return options;
  }

  /**
   * Update selected module / elements prop on document height change.
   *
   * @since 4.6.0
   */
  onDocumentHeightChange = () => {
    // Update Divi fixed nav height property. Divi fixed nav height change when it enters its sticky state
    // thus making it having different height when sits on top of viewport and during window scroll
    if (this.getElementProp('diviFixedPrimaryNav', 'exist', false)) {
      const getHeight = this.getElementProp('diviFixedPrimaryNav', 'getHeight');

      this.setElementProp('diviFixedPrimaryNav', 'height', getHeight());
    }

    // Update Extra's fixed height property. Extra fixed nav height changes as the window is scrolled
    if (this.getElementProp('extraFixedPrimaryNav', 'exist', false)) {
      const getExtraFixedMainHeaderHeight = this.getElementProp('extraFixedPrimaryNav', 'getHeight');

      this.setElementProp('extraFixedPrimaryNav', 'height', getExtraFixedMainHeaderHeight());
    }

    if (this.getElementProp('builderAppFramePaddingTop', 'exist', false)) {
      this.setElementHeight('builderAppFramePaddingTop');
    }
  }

  /**
   * Builder did mount listener callback.
   *
   * @since 4.6.0
   */
  onBuilderDidMount = () => {
    const stickyOnloadModuleKeys  = keys(window.et_pb_sticky_elements);
    const stickyMountedModuleKeys = keys(this.modules);

    // Has sticky elements but builder has no saved sticky module; sticky element on current
    // page is outside current builder (eg. page builder has with no sticky element saved but
    // TB header of current page has sticky element). Need to emit change to kickstart the stick
    // element initialization and generating offset modules
    if (stickyOnloadModuleKeys.length > 0 && isEqual(stickyOnloadModuleKeys, stickyMountedModuleKeys)) {
      this.onBuilderSettingsChange(undefined, true);
    }
  }

  /**
   * Builder settings change listener callback.
   *
   * @since 4.6.0
   *
   * @param {object} event
   * @param {bool}   forceUpdate
   */
  onBuilderSettingsChange = (event, forceUpdate = false) => {
    const settings = get(event, 'detail.settings');

    if (isEqual(settings, this.modules) && ! forceUpdate) {
      return;
    }

    // Update sticky settings. Removed nested sticky module (sticky inside another
    // sticky module) from the module list.
    modules = filterInvalidModules(cloneDeep(settings), modules);

    // Append saved sticky elements settings which is rendered outside of current builder
    // type because it won't be generated by current builder's components
    assign(modules, savedStickyElements);

    // Generate offset modules
    this.generateOffsetModules();

    this.emit(SETTINGS_CHANGE);
  }

  /**
   * Get id of all modules.
   *
   * @since 4.6.0
   *
   * @type {object} modules
   *
   * @returns {Array}
   */
  getModulesId = modules => map(modules, module => module.id)

  /**
   * Get modules based on its rendering position; also consider its offset surrounding setting if needed.
   *
   * @since 4.6.0
   * @param {string} top|bottom
   * @param position
   * @param offsetSurrounding
   * @param {string|bool} on|off|false When false, ignore offset surrounding value.
   * @returns {bool}
   */
  getModulesByPosition = (position, offsetSurrounding = false) => filter(modules, (module, id) => {
    // Check offset surrounding value; if param set to `false`, ignore it. If `on`|`off`, only
    // pass module that has matching value
    const isOffsetSurrounding = ! offsetSurrounding ? true : isOrHasValue(module.offsetSurrounding, offsetSurrounding);

    return includes(['top_bottom', position], this.getProp(id, 'position')) && isOffsetSurrounding;
  })

  /**
   * Sort modules from top to down based on offset prop. Passed module has no id or index prop so
   * offset which visually indicate module's position in the page will do.
   *
   * @since 4.6.0
   */
  sortModules = () => {
    const storeModules = this.modules;
    const modulesSize  = size(storeModules);

    // Return modules as-is if it is less than two modules; no need to sort it
    if (modulesSize < 2) {
      return storeModules;
    }

    // There's no index whatsoever, but offset's top and left indicates module's position
    const sortedModules = sortBy(storeModules, [
      module => module.offsets.top,
      module => module.offsets.left,
    ]);

    // sortBy returns array type value; remap id as object key
    const remappedModules = mapKeys(sortedModules, module => module.id);

    modules = cloneDeep(remappedModules);
  }

  /**
   * Set prop value.
   *
   * @since 4.6.0
   *
   * @param {string} id Need to be unique.
   * @param {string} name
   * @param {string} value
   */
  setProp = (id, name, value) => {
    // Skip updating if the id isn't exist
    if (! has(modules, id) || isUndefined(id)) {
      return;
    }

    const currentValue = this.getProp(id, name);

    // Skip updating prop if the value is the same
    if (currentValue === value) {
      return;
    }

    set(modules, `${id}.${name}`, value);
  }

  /**
   * Get prop.
   *
   * @since 4.6.0
   * @param {string} id
   * @param {string} name
   * @param {mixed} defaultValue
   * @param returnCurrentBreakpoint
   * @param {bool} return
   * @returns {mixed}
   */
  getProp = (id, name, defaultValue, returnCurrentBreakpoint = true) => {
    const value        = get(modules, `${id}.${name}`, defaultValue);
    const isResponsive = returnCurrentBreakpoint
      && isObject(value)
      && has(value, 'desktop')
      && includes(this.responsiveOptions, name);

    return isResponsive ? get(value, get(ETScriptWindowStore, 'breakpoint', 'desktop'), defaultValue) : value;
  }

  /**
   * Set known elements' props.
   *
   * @since 4.6.0
   */
  setElementsProps = () => {
    forEach(elements, (settings, name) => {
      if (! has(settings, 'window')) {
        return;
      }

      if (has(settings, 'condition') && isFunction(settings.condition) && ! settings.condition()) {
        // Reset props if it fails on condition check
        this.setElementProp(name, 'exist', get(elementsDefaults, `${name}.exist`, false));
        this.setElementProp(name, 'height', get(elementsDefaults, `${name}.height`, 0));
        return;
      }

      const currentWindow = 'top' === this.getElementProp(name, 'window') ? top_window : window;
      const $element      = currentWindow.jQuery(settings.selector);
      const hasElement    = $element.length > 0 && $element.is(':visible');

      if (hasElement) {
        this.setElementProp(name, 'exist', hasElement);

        this.setElementHeight(name);
      }
    });
  }

  /**
   * Set known element prop value.
   *
   * @since 4.6.0
   *
   * @param {string} id Need to be unique.
   * @param {string} name
   * @param {string} value
   */
  setElementProp = (id, name, value) => {
    const currentValue = this.getElementProp(id, name);

    // Skip updating prop if the value is the same
    if (currentValue === value) {
      return;
    }

    set(elements, `${id}.${name}`, value);
  }

  /**
   * Get known element prop.
   *
   * @since 4.6.0
   *
   * @param {string} id
   * @param {string} name
   * @param {mixed} defaultValue
   *
   * @returns {mixed}
   */
  getElementProp = (id, name, defaultValue) => get(elements, `${id}.${name}`, defaultValue)

  /**
   * Set element height.
   *
   * @since 4.6.0
   *
   * @param {string} name
   */
  setElementHeight = name => {
    const selector      = this.getElementProp(name, 'selector');
    const currentWindow = 'top' === this.getElementProp(name, 'window', 'app') ? top_window : window;
    const $selector     = currentWindow.jQuery(selector);

    let height = 0;

    forEach($selector, item => {
      const getHeight = this.getElementProp(name, 'getHeight', false);

      if (isFunction(getHeight)) {
        height += getHeight();
      } else {
        height += currentWindow.jQuery(item).outerHeight();
      }
    });

    this.setElementProp(name, 'height', parseInt(height));
  }

  /**
   * Generate offset modules for offset surrounding option.
   *
   * @since 4.6.0
   */
  generateOffsetModules = () => {
    // Get module's width, height, and offsets. These are needed to calculate offset module's
    // adjacent column adjustment. stickyElement will update this later on its initialization
    // This needs to be on earlier and different loop than the one below for generating offset
    // modules because in builder the modules need to be sorted from top to down first
    forEach(this.modules, (module, id) => {
      const $module       = $(this.getProp(id, 'selector'));
      const moduleWidth   = parseInt($module.outerWidth());
      const moduleHeight  = parseInt($module.outerHeight());
      const moduleOffsets = getOffsets($module, moduleWidth, moduleHeight);

      // Only update dimension props if module isn't on sticky state
      if (! this.isSticky(id)) {
        this.setProp(id, 'width', moduleWidth);
        this.setProp(id, 'height', moduleHeight);
        this.setProp(id, 'offsets', moduleOffsets);
      }

      // Set limits
      const position       = this.getProp(id, 'position', 'none');
      const isStickyBottom = includes(['bottom', 'top_bottom'], position);
      const isStickyTop    = includes(['top', 'top_bottom'], position);

      if (isStickyBottom) {
        const topLimit         = this.getProp(id, 'topLimit');
        const topLimitSettings = getLimit($module, topLimit);

        this.setProp(id, 'topLimitSettings', topLimitSettings);
      }

      if (isStickyTop) {
        const bottomLimit         = this.getProp(id, 'bottomLimit');
        const bottomLimitSettings = getLimit($module, bottomLimit);

        this.setProp(id, 'bottomLimitSettings', bottomLimitSettings);
      }
    });

    // Sort modules in builder to ensure top to bottom module order for generating offset modules
    if (isBuilder) {
      this.sortModules();
    }

    const { modules }             = this;
    const modulesSize             = size(modules);
    const topPositionModules      = this.getModulesByPosition('top', 'on');
    const topPositionModulesId    = this.getModulesId(topPositionModules);
    const bottomPositionModules   = this.getModulesByPosition('bottom', 'on');
    const bottomPositionModulesId = this.getModulesId(bottomPositionModules);

    // Capture top/bottom offsetModules updates for later loop
    const offsetModulesUpdates = [];

    forEach(modules, (module, id) => {
      if (isOrHasValue(module.offsetSurrounding, 'on')) {
        // Top position sticky: get all module id that uses top / top_bottom position +
        // has its offset surrounding turn on, that are rendered BEFORE THIS sticky element
        if (includes(['top', 'top_bottom'], this.getProp(id, 'position'))) {
          const topOffsetModuleIndex = topPositionModulesId.indexOf(id);
          const topOffsetModule      = slice(topPositionModulesId, 0, topOffsetModuleIndex);

          // Saves all top offset modules for reference. This still needs to be processed to
          // filter adjacent column later
          this.setProp(id, 'topOffsetModulesAll', topOffsetModule);

          // Mark for adjacent column filtering
          offsetModulesUpdates.push({
            prop: 'topOffsetModules',
            id,
          });
        }

        // Bottom position sticky: get all module id that uses bottom / top_bottom position +
        // has its offset surrounding turn on, that are rendered AFTER THIS sticky element
        if (includes(['bottom', 'top_bottom'], this.getProp(id, 'position'))) {
          const bottomOffsetModuleIndex = bottomPositionModulesId.indexOf(id);
          const bottomOffsetModules     = slice(bottomPositionModulesId, (bottomOffsetModuleIndex + 1), modulesSize);

          // Saves all bottom offset modules for reference. This still needs to be processed to
          // filter adjacent column later
          this.setProp(id, 'bottomOffsetModulesAll', bottomOffsetModules);

          // Mark for adjacent column filtering
          offsetModulesUpdates.push({
            prop: 'bottomOffsetModules',
            id,
          });
        }
      }
    });

    // Top / bottom offset modules adjacent column filtering
    if (offsetModulesUpdates.length > 0) {
      // Default offsets. Make sure all sides element is available
      const defaultOffsets = {
        top: 0,
        right: 0,
        bottom: 0,
        left: 0,
      };

      // Proper limit settings based on current offset modules position
      const offsetLimitPropMaps = {
        topOffsetModules: 'bottomLimitSettings',
        bottomOffsetModules: 'topLimitSettings',
      };

      forEach(offsetModulesUpdates, update => {
        // module's id
        const moduleId = update.id;

        // Need to be defined inside offsetModulesUpdates loop so each surrounding loop starts new
        // Will be updated on every loop so next loop has reference of what is prev modules has
        const prevSurroundingOffsets = {
          ...defaultOffsets,
        };

        // Loop over module's top/bottom offset module ids
        const offsetModules = filter(this.getProp(moduleId, `${update.prop}All`), id => {
          // Modules that are defined at top/bottomOffsetModules prop which is positioned after
          // current module is referred as surrounding (modules) offset
          const surroundingOffsets = {
            ...defaultOffsets,
            ...this.getProp(id, 'offsets', {}),
          };

          // Current module's offset
          const moduleOffsets = {
            ...defaultOffsets,
            ...this.getProp(moduleId, 'offsets'),
          };

          // Module limit's offset
          const moduleLimitOffsets      = this.getProp(moduleId, `${offsetLimitPropMaps[update.prop]}.offsets`);
          const surroundingLimitOffsets = this.getProp(id, `${offsetLimitPropMaps[update.prop]}.offsets`);

          // If current and surrounding modules both have limit offsets, their top and bottom needs
          // to be put in consideration in case they will never offset each other
          if (moduleLimitOffsets && surroundingLimitOffsets) {
            if (surroundingLimitOffsets.top < moduleLimitOffsets.top || surroundingLimitOffsets.bottom > moduleLimitOffsets.bottom) {
              return false;
            }
          }

          // If module has no limits, offset from surrounding sticky elements most likely not a
          // valid offset surrounding. There is a case where surrounding can be valid offset, which
          // is when current module on sticky state between surrounding limit top and bottom.
          // However this rarely happens and requires conditional offset based on current window
          // scroll top which might be over-engineer. Thus this is kept this way until further
          // confirmation with design team
          // @todo probably add conditional offset surrounding; confirm to design team
          if (! moduleLimitOffsets && surroundingLimitOffsets) {
            return false;
          }

          // Top Offset modules (sticky position top): modules rendered before current module
          // Bottom Offset module (sticky position bottom): modules rendered after current module
          // caveat: offset modules that are not vertically aligned with current module should not
          // be considered as offset modules and affecting current module's auto-added offset.
          // Hence this filter. Initially, all offset module should affect module's auto offset
          let shouldPass = true;

          // Surrounding module is beyond current module's right side
          // ***********
          // * current *
          // ***********
          //               ***************
          //               * surrounding *
          //               ***************
          const isSurroundingBeyondCurrentRight = surroundingOffsets.left >= moduleOffsets.right;

          // Surrounding module is beyond current module's left side
          //                   ***********
          //                   * current *
          //                   ***********
          // ***************
          // * surrounding *
          // ***************
          const isSurroundingBeyondCurrentLeft = surroundingOffsets.right < moduleOffsets.left;

          // Surrounding module overlaps with current module's right side
          // ***********                  ************************
          // * current *                  *       current        *
          // ***********            OR    ************************
          //    ***************               ***************
          //    * surrounding *               * surrounding *
          //    ***************               ***************
          const isSurroundingOverlapsCurrent = surroundingOffsets.left > moduleOffsets.left && surroundingOffsets.right > moduleOffsets.left;

          // Previous surrounding module overlaps with current module's left side.
          //       ************************
          //       *       current        *
          //       ************************
          // ********************   ******************************
          // * prev surrounding *   * surrounding (on this loop) *
          // ********************   ******************************
          const isPrevSurroundingOverlapsWithCurrent = moduleOffsets.left <= prevSurroundingOffsets.right && surroundingOffsets.top < prevSurroundingOffsets.bottom;

          // Ignore surrounding height if previous surrounding height has affected current module's offset
          // See isPrevSurroundingOverlapsWithCurrent's figure above
          const isPrevSurroundingHasAffectCurrent = isSurroundingOverlapsCurrent && isPrevSurroundingOverlapsWithCurrent;

          // Ignore the surrounding's height given the following scenarios
          if (isSurroundingBeyondCurrentRight || isSurroundingBeyondCurrentLeft || isPrevSurroundingHasAffectCurrent) {
            shouldPass = false;
          }

          // Save current surrounding offsets for next surrounding offsets comparison
          assign(prevSurroundingOffsets, surroundingOffsets);

          // true: surrounding's height is considered for current module's auto offset
          // false: surrounding's height is ignored
          return shouldPass;
        });

        // Set ${top/bottom}OffsetModules prop which will be synced to stickyElement
        this.setProp(moduleId, `${update.prop}Align`, offsetModules);
      });
    }

    // Perform secondary offset module calculation. The above works by getting the first surrounding
    // sticky on the next row that affects current sticky. This works well when the row is filled
    // like a grid, but fail if there is row in between which is not vertically overlap. Thus,
    // get the closest surrounding offset sticky from last calculation, then fetch it. The idea is
    // the last surrounding sticky might have offset which is not vertically align / overlap to
    // current sticky element
    forEach(this.modules, (module, moduleId) => {
      if (module.topOffsetModulesAlign) {
        const lastTopOffsetModule = last(module.topOffsetModulesAlign);
        const pervTopOffsetModule = this.getProp(lastTopOffsetModule, 'topOffsetModules', this.getProp(lastTopOffsetModule, 'topOffsetModulesAlign', []));

        this.setProp(moduleId, 'topOffsetModules', compact([
          ...pervTopOffsetModule,
          ...[lastTopOffsetModule],
        ]));
      }

      if (module.bottomOffsetModulesAlign) {
        const firstBottomOffsetModule = head(module.bottomOffsetModulesAlign);
        const pervBottomOffsetModule  = this.getProp(firstBottomOffsetModule, 'bottomOffsetModules', this.getProp(firstBottomOffsetModule, 'bottomOffsetModulesAlign', []));

        this.setProp(moduleId, 'bottomOffsetModules', compact([
          ...[firstBottomOffsetModule],
          ...pervBottomOffsetModule,
        ]));
      }
    });
  }

  /**
   * Check if module with given id is on sticky state.
   *
   * @since 4.6.0
   *
   * @param {string} id
   *
   * @returns {bool}
   */
  isSticky = id => get(this.modules, [id, 'isSticky'], false)

  /**
   * Add listener callback for settings change event.
   *
   * @since 4.6.0
   * @param callback
   * @param {Function}
   */
  addSettingsChangeListener = callback => {
    maybeIncreaseEmitterMaxListeners(this, SETTINGS_CHANGE);
    this.on(SETTINGS_CHANGE, callback);
    return this;
  }

  /**
   * Remove listener callback for settings change event.
   *
   * @since 4.6.0
   * @param callback
   * @param {Function}
   */
  removeSettingsChangeListener = callback => {
    this.removeListener(SETTINGS_CHANGE, callback);
    maybeDecreaseEmitterMaxListeners(this, SETTINGS_CHANGE);
    return this;
  }
}

const stickyStoreInstance = new ETScriptStickyStore;

// Register store instance as component to be exposed via global object
registerFrontendComponent('stores', 'sticky', stickyStoreInstance);

// Export store instance
// IMPORTANT: For uniformity, import this as ETScriptStickyStore
export default stickyStoreInstance;
cache_notice.js000064400000003422152336404310007510 0ustar00!function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=141)}({0:function(e,t){e.exports=jQuery},141:function(e,t,o){"use strict";(function(e){var t,n=(t=o(19))&&t.__esModule?t:{default:t};window.et_error_modal_shown=!1,window.et_builder_version=window.et_builder_version||"";var r=e("#et-builder-cache-notice-template");et_pb_notice_options.product_version!==window.et_builder_version&&(e("body").addClass("et_pb_stop_scroll").append(r.html()),(0,n.default)(e(".et_pb_prompt_modal")),window.et_error_modal_shown=!0)}).call(this,o(0))},19:function(e,t,o){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(t,o){var n=e(window),r=e("#wpadminbar"),i=n.height(),u=t.outerHeight(),l=r.outerHeight(),a=0-u/2+l/2;u>i-l?t.css({top:"".concat(l+15,"px"),bottom:15,marginTop:0,minHeight:0}):t.css({top:"50%",marginTop:"".concat(a,"px")}),t.addClass("et_pb_auto_centerize_modal")};t.default=o}).call(this,o(0))}});roles_admin.js000064400000013145152336404310007403 0ustar00!function(t){var e={};function o(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)o.d(n,a,function(e){return t[e]}.bind(null,a));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=148)}({0:function(t,e){t.exports=jQuery},148:function(t,e,o){"use strict";(function(t){var e=a(o(20)),n=a(o(19));function a(t){return t&&t.__esModule?t:{default:t}}t((function(){var o=t(".et_pb_roles_options_container"),a=o.find(".et_pb_yes_no_button_wrapper"),_=o.find(".et_pb_yes_no_button"),s=o.find("select"),i=t("body");function r(e,o){var n,a=t(".et_pb_roles_container_all").find("form"),_={};a.each((function(){var e=t(this),o=e.data("role_id"),n=e.serialize();_[o]=n})),n=JSON.stringify(_),t.ajax({type:"POST",url:et_pb_roles_options.ajaxurl,dataType:"json",data:{action:"et_pb_save_role_settings",et_pb_options_all:n,et_pb_save_roles_nonce:et_pb_roles_options.et_roles_nonce},beforeSend:function(e){o&&(t("#et_pb_loading_animation").removeClass("et_pb_hide_loading"),t("#et_pb_success_animation").removeClass("et_pb_active_success"),t("#et_pb_loading_animation").show())},success:function(n){o&&(t("#et_pb_loading_animation").addClass("et_pb_hide_loading"),t("#et_pb_success_animation").addClass("et_pb_active_success").show(),setTimeout((function(){t("#et_pb_success_animation").fadeToggle(),t("#et_pb_loading_animation").fadeToggle()}),1e3)),"function"==typeof e&&e()}})}function c(t){var e=t.closest(".et_pb_modal_overlay");e.addClass("et_pb_modal_closing"),setTimeout((function(){e.remove()}),600)}a.each((function(){var e=t(this),o=e.find(".et_pb_yes_no_button");"on"===e.find("select").val()?(o.removeClass("et_pb_off_state"),o.addClass("et_pb_on_state")):(o.removeClass("et_pb_on_state"),o.addClass("et_pb_off_state"))})),_.on("click",(function(){var e=t(this),o=e.closest(".et_pb_yes_no_button_wrapper").find("select");e.hasClass("et_pb_off_state")?(e.removeClass("et_pb_off_state"),e.addClass("et_pb_on_state"),o.val("on")):(e.removeClass("et_pb_on_state"),e.addClass("et_pb_off_state"),o.val("off")),o.trigger("change")})),s.on("change",(function(){var e=t(this),o=e.closest(".et_pb_yes_no_button_wrapper").find(".et_pb_yes_no_button");"on"===e.val()?(o.removeClass("et_pb_off_state"),o.addClass("et_pb_on_state")):(o.removeClass("et_pb_on_state"),o.addClass("et_pb_off_state"))})),t(".et-pb-layout-buttons:not(.et-pb-layout-buttons-reset):not(.et-pb-portability-button)").on("click",(function(){var e=t(this),o=e.data("open_tab");t(".et_pb_roles_options_container.active-container").css({display:"block",opacity:1}).stop(!0,!0).animate({opacity:0},300,(function(){var e=t(this);e.css("display","none"),e.removeClass("active-container"),t(".".concat(o)).addClass("active-container").css({display:"block",opacity:0}).stop(!0,!0).animate({opacity:1},300)})),t(".et-pb-layout-buttons").removeClass("et_pb_roles_active_menu"),e.addClass("et_pb_roles_active_menu")})),t("#et_pb_save_roles").on("click",(function(){return r(!1,!0),!1})),t(".et_pb_toggle_all").on("click",(function(){var e=t(this).closest(".et_pb_roles_section_container").find(".et-pb-main-setting"),o=0,n=0;e.each((function(){"on"===t(this).val()?o++:n++})),o>=n?e.val("off"):e.val("on"),e.trigger("change")})),t(".et-pb-layout-buttons-reset").on("click",(function(){var e="<div class='et_pb_modal_overlay' data-action='reset_roles'>\t\t\t\t<div class='et_pb_prompt_modal'>\t\t\t\t<h3>".concat(et_pb_roles_options.modal_title,"</h3>\t\t\t\t<p>").concat(et_pb_roles_options.modal_message,"</p>\t\t\t\t\t<a href='#' class='et_pb_prompt_dont_proceed et-pb-modal-close'>\t\t\t\t\t\t<span>").concat(et_pb_roles_options.modal_no,"<span>\t\t\t\t\t</span></span></a>\t\t\t\t\t<div class='et_pb_prompt_buttons'>\t\t\t\t\t\t<a href='#' class='et_pb_prompt_proceed'>").concat(et_pb_roles_options.modal_yes,"</a>\t\t\t\t\t</div>\t\t\t\t</div>\t\t\t</div>");return t("body").append(e),(0,n.default)(t(".et_pb_prompt_modal")),!1})),t("body").on("click",".et-pb-modal-close",(function(){c(t(this))})),t("body").on("click",".et_pb_prompt_proceed",(function(){var e=t(".et-pb-main-setting");e.val("on"),e.trigger("change"),c(t(this))})),i.append('<div id="et_pb_loading_animation"></div>'),i.append('<div id="et_pb_success_animation"></div>'),t("#et_pb_loading_animation").hide(),t("#et_pb_success_animation").hide(),t(".et-pb-layout-buttons").first().addClass("et_pb_roles_active_menu"),t(".et_pb_roles_container_all .et_pb_roles_options_container").first().addClass("active-container"),(0,e.default)(etCore)||(etCore.portability.save=function(t){r(t,!1)})}))}).call(this,o(0))},19:function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=function(e,o){var n=t(window),a=t("#wpadminbar"),_=n.height(),s=e.outerHeight(),i=a.outerHeight(),r=0-s/2+i/2;s>_-i?e.css({top:"".concat(i+15,"px"),bottom:15,marginTop:0,minHeight:0}):e.css({top:"50%",marginTop:"".concat(r,"px")}),e.addClass("et_pb_auto_centerize_modal")};e.default=o}).call(this,o(0))},20:function(t,e){t.exports=function(t){return void 0===t}}});library_category.js000064400000002433152336404310010446 0ustar00!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=144)}({0:function(t,e){t.exports=jQuery},144:function(t,e,n){"use strict";(function(t){t((function(){var e=t(".wp-list-table");e.find(".row-actions .edit, .row-actions .view").css("display","none"),e.on("click",".row-title",(function(){return t(this).closest("td").find(".row-actions .inline a").trigger("click"),!1})),e.on("click","td.column-posts a",(function(){return!1}))}))}).call(this,n(0))}});ext/widgets.js000064400000010015152336404310007346 0ustar00( function($) {

	$(function() {
		// WP 5.8 above - Widget Block Editor.
		var is_widgets_block_editor = $('#widgets-editor').length > 0;
		var $et_pb_sidebars         = $('div[id^=et_pb_widget_area_]');

		// 1.a Appends custom widget area create form panel.
		var et_pb_sidebars_append_widget_create_area = function() {
			var widget_editor_area = is_widgets_block_editor ? '.block-editor-writing-flow > div' : '.widget-liquid-right';

			$(widget_editor_area).append(et_pb_options.widget_info);

			var $widget_create_area = $('#et_pb_widget_area_create');
			var $widget_name_input  = $widget_create_area.find('#et_pb_new_widget_area_name');

			$widget_create_area.find('.et_pb_create_widget_area').on('click', function(event) {
				var $this_el = $(this);

				event.preventDefault();

				if ('' === $widget_name_input.val()) return;

				$.ajax({
					type: "POST",
					url: et_pb_options.ajaxurl,
					data:
					{
						action: 'et_pb_add_widget_area',
						et_admin_load_nonce: et_pb_options.et_admin_load_nonce,
						et_widget_area_name: $widget_name_input.val()
					},
					success: function(data) {
						$this_el.closest('#et_pb_widget_area_create').find('.et_pb_widget_area_result').hide().html(data).slideToggle();
					}
				});
			});
		}

		// 1.b. Appends custom widget area remove button and handles remove action.
		var et_pb_sidebars_append_delete_button = function() {
			// 1.b.1. Append custom widget area remove button.
			var widget_area_id = is_widgets_block_editor ? $(this).data('widget-area-id') : $(this).attr('id');
			var widget_wrapper = is_widgets_block_editor ? '.block-editor-block-list__block' : '.widgets-holder-wrap';
			var widget_title   = is_widgets_block_editor ? '.components-panel__body-toggle' : '.sidebar-name h2, .sidebar-name h3';

			$(this).closest(widget_wrapper).find(widget_title).before('<a href="#" class="et_pb_widget_area_remove" data-et-widget-area-id="' + widget_area_id + '">' + et_pb_options.delete_string + '</a>');

			// 1.b.2. Handles remove widget area action.
			$('.et_pb_widget_area_remove').on('click', function(event) {
				var $this_el = $(this);

				event.preventDefault();

				$.ajax( {
					type: "POST",
					url: et_pb_options.ajaxurl,
					data:
					{
						action : 'et_pb_remove_widget_area',
						et_admin_load_nonce : et_pb_options.et_admin_load_nonce,
						et_widget_area_name : $this_el.data('et-widget-area-id'),
					},
					success: function( data ){
						$('a[data-et-widget-area-id="' + data + '"]').closest(widget_wrapper).remove();
					}
				} );

				return false;
			});
		};

		// 2. Observe to append custom widget area create form and remove buttons.
		if (is_widgets_block_editor) {
			var widget_block_editor_mutation = _.debounce(function(mutations, observer) {
				var is_widget_area_create_added = $('#et_pb_widget_area_create').length > 0;
				var is_widget_area_remove_added = $('.et_pb_widget_area_remove').length > 0;

				if (! is_widget_area_create_added) {
					et_pb_sidebars_append_widget_create_area();
				}

				if (! is_widget_area_remove_added) {
					$('div[data-widget-area-id^=et_pb_widget_area_]').each(et_pb_sidebars_append_delete_button);
				}

				// Disconnect once we know the custom widget area create form and remove buttons
				// are added to the Widget Block Editor.
				if (is_widget_area_create_added && is_widget_area_remove_added) {
					observer.disconnect();
				}
			}, 1000);

			// Watch for Widgets to load the Block Editor and Widget Area blocks. There is no
			// event to know when they will be loaded, hence we use mutation observer.
			var widget_block_editor_observer = new MutationObserver(widget_block_editor_mutation);

			// WP 6.1 and below - Widget Editor mutating node.
			var widget_block_editor_node = document.querySelector('.block-editor-block-list__layout') || document.querySelector('#widgets-editor');

			widget_block_editor_observer.observe(widget_block_editor_node, {childList: true});
		} else {
			et_pb_sidebars_append_widget_create_area();
			$et_pb_sidebars.each(et_pb_sidebars_append_delete_button);
		}
	} );

} )(jQuery);ext/jquery.visible.min.js000064400000003537152336404310011450 0ustar00/*
Copyright (c) 2012 Digital Fusion, http://teamdf.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
!function(t){var i=t(window);t.fn.visible=function(t,e,o){if(!(this.length<1)){var r=this.length>1?this.eq(0):this,n=r.get(0),f=i.width(),h=i.height(),o=o?o:"both",l=e===!0?n.offsetWidth*n.offsetHeight:!0;if("function"==typeof n.getBoundingClientRect){var g=n.getBoundingClientRect(),u=g.top>=0&&g.top<h,s=g.bottom>0&&g.bottom<=h,c=g.left>=0&&g.left<f,a=g.right>0&&g.right<=f,v=t?u||s:u&&s,b=t?c||a:c&&a;if("both"===o)return l&&v&&b;if("vertical"===o)return l&&v;if("horizontal"===o)return l&&b}else{var d=i.scrollTop(),p=d+h,w=i.scrollLeft(),m=w+f,y=r.offset(),z=y.top,B=z+r.height(),C=y.left,R=C+r.width(),j=t===!0?B:z,q=t===!0?z:B,H=t===!0?R:C,L=t===!0?C:R;if("both"===o)return!!l&&p>=q&&j>=d&&m>=L&&H>=w;if("vertical"===o)return!!l&&p>=q&&j>=d;if("horizontal"===o)return!!l&&m>=L&&H>=w}}}}(jQuery);
ext/chart.min.js000064400000145573152336404310007605 0ustar00/*!
 * Chart.js
 * http://chartjs.org/
 * Version: 1.0.1
 *
 * Copyright 2015 Nick Downie
 * Released under the MIT license
 * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
 */
(function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;var i=function(t,i){return t["offset"+i]?t["offset"+i]:document.defaultView.getComputedStyle(t).getPropertyValue(i)},e=this.width=i(t.canvas,"Width"),n=this.height=i(t.canvas,"Height");t.canvas.width=e,t.canvas.height=n;var e=this.width=t.canvas.width,n=this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n<t.length;n++)i.apply(e,[t[n],n].concat(s))}else for(var o in t)i.apply(e,[t[o],o].concat(s))},o=s.clone=function(t){var i={};return n(t,function(e,s){t.hasOwnProperty(s)&&(i[s]=e)}),i},a=s.extend=function(t){return n(Array.prototype.slice.call(arguments,1),function(i){n(i,function(e,s){i.hasOwnProperty(s)&&(t[s]=e)})}),t},h=s.merge=function(){var t=Array.prototype.slice.call(arguments,0);return t.unshift({}),a.apply(null,t)},l=s.indexOf=function(t,i){if(Array.prototype.indexOf)return t.indexOf(i);for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1},r=(s.where=function(t,i){var e=[];return s.each(t,function(t){i(t)&&e.push(t)}),e},s.findNextWhere=function(t,i,e){e||(e=-1);for(var s=e+1;s<t.length;s++){var n=t[s];if(i(n))return n}},s.findPreviousWhere=function(t,i,e){e||(e=t.length);for(var s=e-1;s>=0;s--){var n=t[s];if(i(n))return n}},s.inherits=function(t){var i=this,e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},s=function(){this.constructor=e};return s.prototype=i.prototype,e.prototype=new s,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),c=s.noop=function(){},u=s.uid=function(){var t=0;return function(){return"chart-"+t++}}(),d=s.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},p=s.amd="function"==typeof define&&define.amd,f=s.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=s.max=function(t){return Math.max.apply(Math,t)},m=s.min=function(t){return Math.min.apply(Math,t)},v=(s.cap=function(t,i,e){if(f(i)){if(t>i)return i}else if(f(e)&&e>t)return e;return t},s.getDecimalPlaces=function(t){return t%1!==0&&f(t)?t.toString().split(".")[1].length:0}),S=s.radians=function(t){return t*(Math.PI/180)},x=(s.getAngleFromPoint=function(t,i){var e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s),o=2*Math.PI+Math.atan2(s,e);return 0>e&&0>s&&(o+=2*Math.PI),{angle:o,distance:n}},s.aliasPixel=function(t){return t%2===0?0:.5}),y=(s.splineCurve=function(t,i,e,s){var n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=s*n/(n+o),h=s*o/(n+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},s.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),C=(s.calculateScaleRange=function(t,i,e,s,n){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=m(t);l===r&&(l+=.5,r>=.5&&!s?r-=.5:l+=.5);for(var c=Math.abs(l-r),u=y(c),d=Math.ceil(l/(1*Math.pow(10,u)))*Math.pow(10,u),p=s?0:Math.floor(r/(1*Math.pow(10,u)))*Math.pow(10,u),f=d-p,v=Math.pow(10,u),S=Math.round(f/v);(S>a||a>2*S)&&!h;)if(S>a)v*=2,S=Math.round(f/v),S%1!==0&&(h=!0);else if(n&&u>=0){if(v/2%1!==0)break;v/=2,S=Math.round(f/v)}else v/=2,S=Math.round(f/v);return h&&(S=o,v=f/S),{steps:S,stepValue:v,min:p,max:p+S*v}},s.template=function(t,i){function e(t,i){var e=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join("	").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("	").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):s[t]=s[t];return i?e(i):e}if(t instanceof Function)return t(i);var s={};return e(t,i)}),w=(s.generateLabels=function(t,i,e,s){var o=new Array(i);return labelTemplateString&&n(o,function(i,n){o[n]=C(t,{value:e+s*(n+1)})}),o},s.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),-(s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)))},easeOutElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),s*Math.pow(2,-10*t)*Math.sin(2*(1*t-i)*Math.PI/e)+1)},easeInOutElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:2==(t/=.5)?1:(e||(e=.3*1.5),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),1>t?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e):s*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)*.5+1)},easeInBack:function(t){var i=1.70158;return 1*(t/=1)*t*((i+1)*t-i)},easeOutBack:function(t){var i=1.70158;return 1*((t=t/1-1)*t*((i+1)*t+i)+1)},easeInOutBack:function(t){var i=1.70158;return(t/=.5)<1?.5*t*t*(((i*=1.525)+1)*t-i):.5*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)},easeInBounce:function(t){return 1-w.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*w.easeInBounce(2*t):.5*w.easeOutBounce(2*t-1)+.5}}),b=s.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),P=s.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),L=(s.animationLoop=function(t,i,e,s,n,o){var a=0,h=w[e]||w.linear,l=function(){a++;var e=a/i,r=h(e);t.call(o,r,e,a),s.call(o,r,e),i>a?o.animationFrame=b(l):n.apply(o)};b(l)},s.getRelativePosition=function(t){var i,e,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX-o.left,e=s.touches[0].clientY-o.top):(i=s.clientX-o.left,e=s.clientY-o.top),{x:i,y:e}},s.addEvent=function(t,i,e){t.addEventListener?t.addEventListener(i,e):t.attachEvent?t.attachEvent("on"+i,e):t["on"+i]=e}),k=s.removeEvent=function(t,i,e){t.removeEventListener?t.removeEventListener(i,e,!1):t.detachEvent?t.detachEvent("on"+i,e):t["on"+i]=c},F=(s.bindEvents=function(t,i,e){t.events||(t.events={}),n(i,function(i){t.events[i]=function(){e.apply(t,arguments)},L(t.chart.canvas,i,t.events[i])})},s.unbindEvents=function(t,i){n(i,function(i,e){k(t.chart.canvas,e,i)})}),R=s.getMaximumWidth=function(t){var i=t.parentNode;return i.clientWidth},T=s.getMaximumHeight=function(t){var i=t.parentNode;return i.clientHeight},A=(s.getMaximumSize=s.getMaximumWidth,s.retinaScale=function(t){var i=t.ctx,e=t.canvas.width,s=t.canvas.height;window.devicePixelRatio&&(i.canvas.style.width=e+"px",i.canvas.style.height=s+"px",i.canvas.height=s*window.devicePixelRatio,i.canvas.width=e*window.devicePixelRatio,i.scale(window.devicePixelRatio,window.devicePixelRatio))}),M=s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},W=s.fontString=function(t,i,e){return i+" "+t+"px "+e},z=s.longestText=function(t,i,e){t.font=i;var s=0;return n(e,function(i){var e=t.measureText(i).width;s=e>s?e:s}),s},B=s.drawRoundedRectangle=function(t,i,e,s,n,o){t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+s-o,e),t.quadraticCurveTo(i+s,e,i+s,e+o),t.lineTo(i+s,e+n-o),t.quadraticCurveTo(i+s,e+n,i+s-o,e+n),t.lineTo(i+o,e+n),t.quadraticCurveTo(i,e+n,i,e+n-o),t.lineTo(i,e+o),t.quadraticCurveTo(i,e,i+o,e),t.closePath()};e.instances={},e.Type=function(t,i,s){this.options=i,this.chart=s,this.id=u(),e.instances[this.id]=this,i.responsive&&this.resize(),this.initialize.call(this,t)},a(e.Type.prototype,{initialize:function(){return this},clear:function(){return M(this.chart),this},stop:function(){return P(this.animationFrame),this},resize:function(t){this.stop();var i=this.chart.canvas,e=R(this.chart.canvas),s=this.options.maintainAspectRatio?e/this.chart.aspectRatio:T(this.chart.canvas);return i.width=this.chart.width=e,i.height=this.chart.height=s,A(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:c,render:function(t){return t&&this.reflow(),this.options.animation&&!t?s.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return C(this.options.legendTemplate,this)},destroy:function(){this.clear(),F(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete e.instances[this.id]},showTooltip:function(t,i){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var o=function(t){var i=!1;return t.length!==this.activeElements.length?i=!0:(n(t,function(t,e){t!==this.activeElements[e]&&(i=!0)},this),i)}.call(this,t);if(o||i){if(this.activeElements=t,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),t.length>0)if(this.datasets&&this.datasets.length>1){for(var a,h,r=this.datasets.length-1;r>=0&&(a=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,h=l(a,t[0]),-1===h);r--);var c=[],u=[],d=function(){var t,i,e,n,o,a=[],l=[],r=[];return s.each(this.datasets,function(i){t=i.points||i.bars||i.segments,t[h]&&t[h].hasValue()&&a.push(t[h])}),s.each(a,function(t){l.push(t.x),r.push(t.y),c.push(s.template(this.options.multiTooltipTemplate,t)),u.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),o=m(r),e=g(r),n=m(l),i=g(l),{x:n>this.chart.width/2?n:i,y:(o+e)/2}}.call(this,h);new e.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:c,legendColors:u,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips}).draw()}else n(t,function(t){var i=t.tooltipPosition();new e.Tooltip({x:Math.round(i.x),y:Math.round(i.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:C(this.options.tooltipTemplate,t),chart:this.chart,custom:this.options.customTooltips}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),e.Type.extend=function(t){var i=this,s=function(){return i.apply(this,arguments)};if(s.prototype=o(i.prototype),a(s.prototype,t),s.extend=e.Type.extend,t.name||i.prototype.name){var n=t.name||i.prototype.name,l=e.defaults[i.prototype.name]?o(e.defaults[i.prototype.name]):{};e.defaults[n]=a(l,t.defaults),e.types[n]=s,e.prototype[n]=function(t,i){var o=h(e.defaults.global,e.defaults[n],i||{});return new s(t,o,this)}}else d("Name not provided for this chart, so it hasn't been registered");return i},e.Element=function(t){a(this,t),this.initialize.apply(this,arguments),this.save()},a(e.Element.prototype,{initialize:function(){},restore:function(t){return t?n(t,function(t){this[t]=this._saved[t]},this):a(this,this._saved),this},save:function(){return this._saved=o(this),delete this._saved._saved,this},update:function(t){return n(t,function(t,i){this._saved[i]=this[i],this[i]=t},this),this},transition:function(t,i){return n(t,function(t,e){this[e]=(t-this._saved[e])*i+this._saved[e]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return f(this.value)}}),e.Element.extend=r,e.Point=e.Element.extend({display:!0,inRange:function(t,i){var e=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(i-this.y,2)<Math.pow(e,2)},draw:function(){if(this.display){var t=this.ctx;t.beginPath(),t.arc(this.x,this.y,this.radius,0,2*Math.PI),t.closePath(),t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.fillStyle=this.fillColor,t.fill(),t.stroke()}}}),e.Arc=e.Element.extend({inRange:function(t,i){var e=s.getAngleFromPoint(this,{x:t,y:i}),n=e.angle>=this.startAngle&&e.angle<=this.endAngle,o=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;return n&&o},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,i=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*i,y:this.y+Math.sin(t)*i}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin="bevel",this.showStroke&&i.stroke()}}),e.Rectangle=e.Element.extend({draw:function(){var t=this.ctx,i=this.width/2,e=this.x-i,s=this.x+i,n=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(e+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(e,this.base),t.lineTo(e,n),t.lineTo(s,n),t.lineTo(s,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,i){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&i>=this.y&&i<=this.base}}),e.Tooltip=e.Element.extend({draw:function(){var t=this.chart.ctx;t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var i=this.caretPadding=2,e=t.measureText(this.text).width+2*this.xPadding,s=this.fontSize+2*this.yPadding,n=s+this.caretHeight+i;this.x+e/2>this.chart.width?this.xAlign="left":this.x-e/2<0&&(this.xAlign="right"),this.y-n<0&&(this.yAlign="below");var o=this.x-e/2,a=this.y-n;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-i),t.lineTo(this.x+this.caretHeight,this.y-(i+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(i+this.caretHeight)),t.closePath(),t.fill();break;case"below":a=this.y+i+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+i),t.lineTo(this.x+this.caretHeight,this.y+i+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+i+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":o=this.x-e+(this.cornerRadius+this.caretHeight);break;case"right":o=this.x-(this.cornerRadius+this.caretHeight)}B(t,o,a,e,s,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,o+e/2,a+s/2)}}}),e.MultiTooltip=e.Element.extend({initialize:function(){this.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=W(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,i=z(this.ctx,this.font,this.labels)+this.fontSize+3,e=g([i,t]);this.width=e+2*this.xPadding;var s=this.height/2;this.y-s<0?this.y=s:this.y+s>this.chart.height&&(this.y=this.chart.height-s),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var i=this.y-this.height/2+this.yPadding,e=t-1;return 0===t?i+this.titleFontSize/2:i+(1.5*this.fontSize*e+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){if(this.custom)this.custom(this);else{B(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,s.each(this.labels,function(i,e){t.fillStyle=this.textColor,t.fillText(i,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(e+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[e].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}}),e.Scale=e.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?z(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,i=this.endPoint-this.startPoint;for(this.calculateYRange(i),this.buildYLabels(),this.calculateXLabelRotation();i>this.endPoint-this.startPoint;)i=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(i),this.buildYLabels(),t<this.yLabelWidth&&this.calculateXLabelRotation()},calculateXLabelRotation:function(){this.ctx.font=this.font;var t,i,e=this.ctx.measureText(this.xLabels[0]).width,s=this.ctx.measureText(this.xLabels[this.xLabels.length-1]).width;if(this.xScalePaddingRight=s/2+3,this.xScalePaddingLeft=e/2>this.yLabelWidth+10?e/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var n,o=z(this.ctx,this.font,this.xLabels);this.xLabelWidth=o;for(var a=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>a&&0===this.xLabelRotation||this.xLabelWidth>a&&this.xLabelRotation<=90&&this.xLabelRotation>0;)n=Math.cos(S(this.xLabelRotation)),t=n*e,i=n*s,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=n*o;this.xLabelRotation>0&&(this.endPoint-=Math.sin(S(this.xLabelRotation))*o+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:c,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var i=this.drawingArea()/(this.min-this.max);return this.endPoint-i*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),e=i/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1),s=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=e/2),Math.round(s)},update:function(t){s.extend(this,t),this.fit()},draw:function(){var t=this.ctx,i=(this.endPoint-this.startPoint)/this.steps,e=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,n(this.yLabels,function(n,o){var a=this.endPoint-i*o,h=Math.round(a),l=this.showHorizontalLines;t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(n,e-10,a),0!==o||l||(l=!0),l&&t.beginPath(),o>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),h+=s.aliasPixel(t.lineWidth),l&&(t.moveTo(e,h),t.lineTo(this.width,h),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(e-5,h),t.lineTo(e,h),t.stroke(),t.closePath()},this),n(this.xLabels,function(i,e){var s=this.calculateX(e)+x(this.lineWidth),n=this.calculateX(e-(this.offsetGridLines?.5:0))+x(this.lineWidth),o=this.xLabelRotation>0,a=this.showVerticalLines;0!==e||a||(a=!0),a&&t.beginPath(),e>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),a&&(t.moveTo(n,this.endPoint),t.lineTo(n,this.startPoint-3),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n,this.endPoint),t.lineTo(n,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(s,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*S(this.xLabelRotation)),t.font=this.font,t.textAlign=o?"right":"center",t.textBaseline=o?"middle":"top",t.fillText(i,0,0),t.restore()},this))}}),e.RadialScale=e.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var i=this.drawingArea/(this.max-this.min);return(t-this.min)*i},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,i,e,s,n,o,a,h,l,r,c,u,d=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;i<this.valuesCount;i++)t=this.getPointPosition(i,d),e=this.ctx.measureText(C(this.templateString,{value:this.labels[i]})).width+5,0===i||i===this.valuesCount/2?(s=e/2,t.x+s>p&&(p=t.x+s,n=i),t.x-s<g&&(g=t.x-s,a=i)):i<this.valuesCount/2?t.x+e>p&&(p=t.x+e,n=i):i>this.valuesCount/2&&t.x-e<g&&(g=t.x-e,a=i);l=g,r=Math.ceil(p-this.width),o=this.getIndexAngle(n),h=this.getIndexAngle(a),c=r/Math.sin(o+Math.PI/2),u=l/Math.sin(h+Math.PI/2),c=f(c)?c:0,u=f(u)?u:0,this.drawingArea=d-(u+c)/2,this.setCenterPoint(u,c)},setCenterPoint:function(t,i){var e=this.width-i-this.drawingArea,s=t+this.drawingArea;this.xCenter=(s+e)/2,this.yCenter=this.height/2},getIndexAngle:function(t){var i=2*Math.PI/this.valuesCount;return t*i-Math.PI/2},getPointPosition:function(t,i){var e=this.getIndexAngle(t);return{x:Math.cos(e)*i+this.xCenter,y:Math.sin(e)*i+this.yCenter}},draw:function(){if(this.display){var t=this.ctx;if(n(this.yLabels,function(i,e){if(e>0){var s,n=e*(this.drawingArea/this.steps),o=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var a=0;a<this.valuesCount;a++)s=this.getPointPosition(a,this.calculateCenterOffset(this.min+e*this.stepValue)),0===a?t.moveTo(s.x,s.y):t.lineTo(s.x,s.y);t.closePath(),t.stroke()}if(this.showLabels){if(t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.showLabelBackdrop){var h=t.measureText(i).width;t.fillStyle=this.backdropColor,t.fillRect(this.xCenter-h/2-this.backdropPaddingX,o-this.fontSize/2-this.backdropPaddingY,h+2*this.backdropPaddingX,this.fontSize+2*this.backdropPaddingY)}t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.fontColor,t.fillText(i,this.xCenter,o)}}},this),!this.lineArc){t.lineWidth=this.angleLineWidth,t.strokeStyle=this.angleLineColor;for(var i=this.valuesCount-1;i>=0;i--){if(this.angleLineWidth>0){var e=this.getPointPosition(i,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(e.x,e.y),t.stroke(),t.closePath()}var s=this.getPointPosition(i,this.calculateCenterOffset(this.max)+5);t.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var o=this.labels.length,a=this.labels.length/2,h=a/2,l=h>i||i>o-h,r=i===h||i===o-h;t.textAlign=0===i?"center":i===a?"center":a>i?"left":"right",t.textBaseline=r?"middle":l?"bottom":"top",t.fillText(this.labels[i],s.x,s.y)}}}}}),s.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){n(e.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return e}):"object"==typeof module&&module.exports&&(module.exports=e),t.Chart=e,e.noConflict=function(){return t.Chart=i,e}}).call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Bar",defaults:s,initialize:function(t){var s=this.options;this.ScaleClass=i.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,i,e){var n=this.calculateBaseWidth(),o=this.calculateX(e)-n/2,a=this.calculateBarWidth(t);return o+a*i+i*s.barDatasetSpacing+a/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*s.barValueSpacing},calculateBarWidth:function(t){var i=this.calculateBaseWidth()-(t-1)*s.barDatasetSpacing;return i/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),this.BarClass=i.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,bars:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.bars.push(new this.BarClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.strokeColor,fillColor:i.fillColor,highlightFill:i.highlightFill||i.fillColor,highlightStroke:i.highlightStroke||i.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,i,s){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,s,i),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){e.each(this.datasets,function(i,s){e.each(i.bars,t,this,s)},this)},getBarsAtEvent:function(t){for(var i,s=[],n=e.getRelativePosition(t),o=function(t){s.push(t.bars[i])},a=0;a<this.datasets.length;a++)for(i=0;i<this.datasets[a].bars.length;i++)if(this.datasets[a].bars[i].inRange(n.x,n.y))return e.each(this.datasets,o),s;return s},buildScale:function(t){var i=this,s=function(){var t=[];return i.eachBars(function(i){t.push(i.value)}),t},n={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var i=e.calculateScaleRange(s(),t,this.fontSize,this.beginAtZero,this.integersOnly);e.extend(this,i)},xLabels:t,font:e.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.barShowStroke?this.options.barStrokeWidth:0,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&e.extend(n,{calculateYRange:e.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new this.ScaleClass(n)},addData:function(t,i){e.each(t,function(t,e){this.datasets[e].bars.push(new this.BarClass({value:t,label:i,x:this.scale.calculateBarX(this.datasets.length,e,this.scale.valuesCount+1),y:this.scale.endPoint,width:this.scale.calculateBarWidth(this.datasets.length),base:this.scale.endPoint,strokeColor:this.datasets[e].strokeColor,fillColor:this.datasets[e].fillColor}))
},this),this.scale.addXLabel(i),this.update()},removeData:function(){this.scale.removeXLabel(),e.each(this.datasets,function(t){t.bars.shift()},this),this.update()},reflow:function(){e.extend(this.BarClass.prototype,{y:this.scale.endPoint,base:this.scale.endPoint});var t=e.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var i=t||1;this.clear();this.chart.ctx;this.scale.draw(i),e.each(this.datasets,function(t,s){e.each(t.bars,function(t,e){t.hasValue()&&(t.base=this.scale.endPoint,t.transition({x:this.scale.calculateBarX(this.datasets.length,s,e),y:this.scale.calculateY(t.value),width:this.scale.calculateBarWidth(this.datasets.length)},i).draw())},this)},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Doughnut",defaults:s,initialize:function(t){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=i.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.calculateTotal(t),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),e||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(Math.abs(t)/this.total)},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=Math.abs(t.value)},this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,function(t){t.restore(["fillColor"])}),e.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var i=t?t:1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},i),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e<this.segments.length-1&&(this.segments[e+1].startAngle=t.endAngle)},this)}}),i.types.Doughnut.extend({name:"Pie",defaults:e.merge(s,{percentageInnerCutout:0})})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,bezierCurve:!0,bezierCurveTension:.4,pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Line",defaults:s,initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)<Math.pow(this.radius+this.hitDetectionRadius,2)}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this),this.buildScale(t.labels),this.eachPoints(function(t,i){e.extend(t,{x:this.scale.calculateX(i),y:this.scale.endPoint}),t.save()},this)},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachPoints(function(t){t.save()}),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.datasets,function(t){e.each(t.points,function(t){t.inRange(s.x,s.y)&&i.push(t)})},this),i},buildScale:function(t){var s=this,n=function(){var t=[];return s.eachPoints(function(i){t.push(i.value)}),t},o={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var i=e.calculateScaleRange(n(),t,this.fontSize,this.beginAtZero,this.integersOnly);e.extend(this,i)},xLabels:t,font:e.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.pointDotRadius+this.options.pointDotStrokeWidth,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&e.extend(o,{calculateYRange:e.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new i.Scale(o)},addData:function(t,i){e.each(t,function(t,e){this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:this.scale.calculateX(this.scale.valuesCount+1),y:this.scale.endPoint,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.addXLabel(i),this.update()},removeData:function(){this.scale.removeXLabel(),e.each(this.datasets,function(t){t.points.shift()},this),this.update()},reflow:function(){var t=e.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var i=t||1;this.clear();var s=this.chart.ctx,n=function(t){return null!==t.value},o=function(t,i,s){return e.findNextWhere(i,n,s)||t},a=function(t,i,s){return e.findPreviousWhere(i,n,s)||t};this.scale.draw(i),e.each(this.datasets,function(t){var h=e.where(t.points,n);e.each(t.points,function(t,e){t.hasValue()&&t.transition({y:this.scale.calculateY(t.value),x:this.scale.calculateX(e)},i)},this),this.options.bezierCurve&&e.each(h,function(t,i){var s=i>0&&i<h.length-1?this.options.bezierCurveTension:0;t.controlPoints=e.splineCurve(a(t,h,i),t,o(t,h,i),s),t.controlPoints.outer.y>this.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.y<this.scale.startPoint&&(t.controlPoints.outer.y=this.scale.startPoint),t.controlPoints.inner.y>this.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y<this.scale.startPoint&&(t.controlPoints.inner.y=this.scale.startPoint)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(h,function(t,i){if(0===i)s.moveTo(t.x,t.y);else if(this.options.bezierCurve){var e=a(t,h,i);s.bezierCurveTo(e.controlPoints.outer.x,e.controlPoints.outer.y,t.controlPoints.inner.x,t.controlPoints.inner.y,t.x,t.y)}else s.lineTo(t.x,t.y)},this),s.stroke(),this.options.datasetFill&&h.length>0&&(s.lineTo(h[h.length-1].x,this.scale.endPoint),s.lineTo(h[0].x,this.scale.endPoint),s.fillStyle=t.fillColor,s.closePath(),s.fill()),e.each(h,function(t){t.draw()})},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"PolarArea",defaults:s,initialize:function(t){this.segments=[],this.SegmentArc=i.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),e||(this.reflow(),this.update())},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var i=[];e.each(t,function(t){i.push(t.value)});var s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var i=t||1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},i),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e<this.segments.length-1&&(this.segments[e+1].startAngle=t.endAngle),t.draw()},this),this.scale.draw()}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers;i.Type.extend({name:"Radar",defaults:{scaleShowLine:!0,angleShowLineOut:!0,scaleShowLabels:!1,scaleBeginAtZero:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:10,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'},initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){var o;this.scale.animation||(o=this.scale.getPointPosition(n,this.scale.calculateCenterOffset(e))),s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=e.getRelativePosition(t),s=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},i),n=2*Math.PI/this.scale.valuesCount,o=Math.round((s.angle-1.5*Math.PI)/n),a=[];return(o>=this.scale.valuesCount||0>o)&&(o=0),s.distance<=this.scale.drawingArea&&e.each(this.datasets,function(t){a.push(t.points[o])}),a},buildScale:function(t){this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var i=function(){var i=[];return e.each(t,function(t){t.data?i=i.concat(t.data):e.each(t.points,function(t){i.push(t.value)})}),i}(),s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s)},addData:function(t,i){this.scale.valuesCount++,e.each(t,function(t,e){var s=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:s.x,y:s.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.labels.push(i),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var i=t||1,s=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,function(t){e.each(t.points,function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),i)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(t.points,function(t,i){0===i?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)},this),s.closePath(),s.stroke(),s.fillStyle=t.fillColor,s.fill(),e.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this);ext/jquery.minicolors.js000064400000106044152336404310011404 0ustar00/*
 * jQuery MiniColors: A tiny color picker built on jQuery
 *
 * Copyright: Cory LaViska for A Beautiful Site, LLC
 *
 * Contributions and bug reports: https://github.com/claviska/jquery-minicolors
 *
 * @license: http://opensource.org/licenses/MIT
 *
 */
(function (factory) {
  if(typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['jquery'], factory);
  } else if(typeof exports === 'object') {
    // Node/CommonJS
    module.exports = factory(require('jquery'));
  } else {
    // Browser globals
    factory(jQuery);
  }
}(function ($) {
  'use strict';

  // Defaults
  $.minicolors = {
    defaults: {
      animationSpeed: 50,
      animationEasing: 'swing',
      change: null,
      changeDelay: 0,
      control: 'hue',
      defaultValue: '',
      format: 'hex',
      hide: null,
      hideSpeed: 100,
      inline: false,
      keywords: '',
      letterCase: 'lowercase',
      opacity: false,
      position: 'bottom',
      show: null,
      showSpeed: 100,
      theme: 'default',
      swatches: []
    }
  };

  // Public methods
  $.extend($.fn, {
    minicolors: function(method, data) {

      switch(method) {
        // Destroy the control
        case 'destroy':
          $(this).each(function() {
            destroy($(this));
          });
          return $(this);

        // Hide the color picker
        case 'hide':
          hide();
          return $(this);

        // Get/set opacity
        case 'opacity':
          // Getter
          if(data === undefined) {
            // Getter
            return $(this).attr('data-opacity');
          } else {
            // Setter
            $(this).each(function() {
              updateFromInput($(this).attr('data-opacity', data));
            });
          }
          return $(this);

        // Get an RGB(A) object based on the current color/opacity
        case 'rgbObject':
          return rgbObject($(this), method === 'rgbaObject');

        // Get an RGB(A) string based on the current color/opacity
        case 'rgbString':
        case 'rgbaString':
          return rgbString($(this), method === 'rgbaString');

        // Get/set settings on the fly
        case 'settings':
          if(data === undefined) {
            return $(this).data('minicolors-settings');
          } else {
            // Setter
            $(this).each(function() {
              var settings = $(this).data('minicolors-settings') || {};
              destroy($(this));
              $(this).minicolors($.extend(true, settings, data));
            });
          }
          return $(this);

        // Show the color picker
        case 'show':
          show($(this).eq(0));
          return $(this);

        // Get/set the hex color value
        case 'value':
          if(data === undefined) {
            // Getter
            return $(this).val();
          } else {
            // Setter
            $(this).each(function() {
              if(typeof(data) === 'object' && data !== null) {
                if(data.opacity !== undefined) {
                  $(this).attr('data-opacity', keepWithin(data.opacity, 0, 1));
                }
                if(data.color) {
                  $(this).val(data.color);
                }
              } else {
                $(this).val(data);
              }
              updateFromInput($(this));
            });
          }
          return $(this);

        // Initializes the control
        default:
          if(method !== 'create') data = method;
          $(this).each(function() {
            init($(this), data);
          });
          return $(this);

      }

    }
  });

  // Initialize input elements
  function init(input, settings) {
    var minicolors = $('<div class="minicolors" />');
    var defaults = $.minicolors.defaults;
    var name;
    var size;
    var swatches;
    var swatch;
    var swatchString;
    var panel;
    var i;

    // Do nothing if already initialized
    if(input.data('minicolors-initialized')) return;

    // Handle settings
    settings = $.extend(true, {}, defaults, settings);

    // The wrapper
    minicolors
      .addClass('minicolors-theme-' + settings.theme)
      .toggleClass('minicolors-with-opacity', settings.opacity);

    // Custom positioning
    if(settings.position !== undefined) {
      $.each(settings.position.split(' '), function() {
        minicolors.addClass('minicolors-position-' + this);
      });
    }

    // Input size
    if(settings.format === 'rgb') {
      size = settings.opacity ? '25' : '20';
    } else {
      size = settings.keywords ? '11' : '7';
    }

    // The input
    input
      .addClass('minicolors-input')
      .data('minicolors-initialized', false)
      .data('minicolors-settings', settings)
      .prop('size', size)
      .wrap(minicolors)
      .after(
        '<div class="minicolors-panel minicolors-slider-' + settings.control + '">' +
                '<div class="minicolors-slider minicolors-sprite">' +
                  '<div class="minicolors-picker"></div>' +
                '</div>' +
                '<div class="minicolors-opacity-slider minicolors-sprite">' +
                  '<div class="minicolors-picker"></div>' +
                '</div>' +
                '<div class="minicolors-grid minicolors-sprite">' +
                  '<div class="minicolors-grid-inner"></div>' +
                  '<div class="minicolors-picker"><div></div></div>' +
                '</div>' +
              '</div>'
      );

    // The swatch
    if(!settings.inline) {
      input.after('<span class="minicolors-swatch minicolors-sprite minicolors-input-swatch"><span class="minicolors-swatch-color"></span></span>');
      input.next('.minicolors-input-swatch').on('click', function(event) {
        event.preventDefault();
        input.trigger('focus');
      });
    }

    // Prevent text selection in IE
    panel = input.parent().find('.minicolors-panel');
    panel.on('selectstart', function() { return false; }).end();

    // Swatches
    if(settings.swatches && settings.swatches.length !== 0) {
      panel.addClass('minicolors-with-swatches');
      swatches = $('<ul class="minicolors-swatches"></ul>')
        .appendTo(panel);
      for(i = 0; i < settings.swatches.length; ++i) {
        // allow for custom objects as swatches
        if(typeof settings.swatches[i] === 'object') {
          name = settings.swatches[i].name;
          swatch = settings.swatches[i].color;
        } else {
          name = '';
          swatch = settings.swatches[i];
        }
        swatchString = swatch;
        swatch = isRgb(swatch) ? parseRgb(swatch, true) : hex2rgb(parseHex(swatch, true));
        $('<li class="minicolors-swatch minicolors-sprite"><span class="minicolors-swatch-color" title="' + name + '"></span></li>')
          .appendTo(swatches)
          .data('swatch-color', swatchString)
          .find('.minicolors-swatch-color')
          .css({
            backgroundColor: ((swatchString !== 'transparent') ? rgb2hex(swatch) : 'transparent'),
            opacity: String(swatch.a)
          });
        settings.swatches[i] = swatch;
      }
    }

    // Inline controls
    if(settings.inline) input.parent().addClass('minicolors-inline');

    updateFromInput(input, false);

    input.data('minicolors-initialized', true);
  }

  // Returns the input back to its original state
  function destroy(input) {
    var minicolors = input.parent();

    // Revert the input element
    input
      .removeData('minicolors-initialized')
      .removeData('minicolors-settings')
      .removeProp('size')
      .removeClass('minicolors-input');

    // Remove the wrap and destroy whatever remains
    minicolors.before(input).remove();
  }

  // Shows the specified dropdown panel
  function show(input) {
    var minicolors = input.parent();
    var panel = minicolors.find('.minicolors-panel');
    var settings = input.data('minicolors-settings');

    // Do nothing if uninitialized, disabled, inline, or already open
    if(
      !input.data('minicolors-initialized') ||
      input.prop('disabled') ||
      minicolors.hasClass('minicolors-inline') ||
      minicolors.hasClass('minicolors-focus')
    ) return;

    hide();

    minicolors.addClass('minicolors-focus');
    if (panel.animate) {
      panel
        .stop(true, true)
        .fadeIn(settings.showSpeed, function () {
          if (settings.show) settings.show.call(input.get(0));
        });
    } else {
      panel.show();
      if (settings.show) settings.show.call(input.get(0));
    }
  }

  // Hides all dropdown panels
  function hide() {
    $('.minicolors-focus').each(function() {
      var minicolors = $(this);
      var input = minicolors.find('.minicolors-input');
      var panel = minicolors.find('.minicolors-panel');
      var settings = input.data('minicolors-settings');

      if (panel.animate) {
        panel.fadeOut(settings.hideSpeed, function () {
          if (settings.hide) settings.hide.call(input.get(0));
          minicolors.removeClass('minicolors-focus');
        });
      } else {
        panel.hide();
        if (settings.hide) settings.hide.call(input.get(0));
        minicolors.removeClass('minicolors-focus');
      }
    });
  }

  // Moves the selected picker
  function move(target, event, animate) {
    var input = target.parents('.minicolors').find('.minicolors-input');
    var settings = input.data('minicolors-settings');
    var picker = target.find('[class$=-picker]');
    var offsetX = target.offset().left;
    var offsetY = target.offset().top;
    var x = Math.round(event.pageX - offsetX);
    var y = Math.round(event.pageY - offsetY);
    var duration = animate ? settings.animationSpeed : 0;
    var wx, wy, r, phi, styles;

    // Touch support
    if(event.originalEvent.changedTouches) {
      x = event.originalEvent.changedTouches[0].pageX - offsetX;
      y = event.originalEvent.changedTouches[0].pageY - offsetY;
    }

    // Constrain picker to its container
    if(x < 0) x = 0;
    if(y < 0) y = 0;
    if(x > target.width()) x = target.width();
    if(y > target.height()) y = target.height();

    // Constrain color wheel values to the wheel
    if(target.parent().is('.minicolors-slider-wheel') && picker.parent().is('.minicolors-grid')) {
      wx = 75 - x;
      wy = 75 - y;
      r = Math.sqrt(wx * wx + wy * wy);
      phi = Math.atan2(wy, wx);
      if(phi < 0) phi += Math.PI * 2;
      if(r > 75) {
        r = 75;
        x = 75 - (75 * Math.cos(phi));
        y = 75 - (75 * Math.sin(phi));
      }
      x = Math.round(x);
      y = Math.round(y);
    }

    // Move the picker
    styles = {
      top: y + 'px'
    };
    if(target.is('.minicolors-grid')) {
      styles.left = x + 'px';
    }
    if (picker.animate) {
      picker
        .stop(true)
        .animate(styles, duration, settings.animationEasing, function() {
          updateFromControl(input, target);
        });
    } else {
      picker
        .css(styles);
      updateFromControl(input, target);
    }
  }

  // Sets the input based on the color picker values
  function updateFromControl(input, target) {

    function getCoords(picker, container) {
      var left, top;
      if(!picker.length || !container) return null;
      left = picker.offset().left;
      top = picker.offset().top;

      return {
        x: left - container.offset().left + (picker.outerWidth() / 2),
        y: top - container.offset().top + (picker.outerHeight() / 2)
      };
    }

    var hue, saturation, brightness, x, y, r, phi;
    var hex = input.val();
    var opacity = input.attr('data-opacity');

    // Helpful references
    var minicolors = input.parent();
    var settings = input.data('minicolors-settings');
    var swatch = minicolors.find('.minicolors-input-swatch');

    // Panel objects
    var grid = minicolors.find('.minicolors-grid');
    var slider = minicolors.find('.minicolors-slider');
    var opacitySlider = minicolors.find('.minicolors-opacity-slider');

    // Picker objects
    var gridPicker = grid.find('[class$=-picker]');
    var sliderPicker = slider.find('[class$=-picker]');
    var opacityPicker = opacitySlider.find('[class$=-picker]');

    // Picker positions
    var gridPos = getCoords(gridPicker, grid);
    var sliderPos = getCoords(sliderPicker, slider);
    var opacityPos = getCoords(opacityPicker, opacitySlider);

    // Handle colors
    if(target.is('.minicolors-grid, .minicolors-slider, .minicolors-opacity-slider')) {

      // Determine HSB values
      switch(settings.control) {
        case 'wheel':
          // Calculate hue, saturation, and brightness
          x = (grid.width() / 2) - gridPos.x;
          y = (grid.height() / 2) - gridPos.y;
          r = Math.sqrt(x * x + y * y);
          phi = Math.atan2(y, x);
          if(phi < 0) phi += Math.PI * 2;
          if(r > 75) {
            r = 75;
            gridPos.x = 69 - (75 * Math.cos(phi));
            gridPos.y = 69 - (75 * Math.sin(phi));
          }
          saturation = keepWithin(r / 0.75, 0, 100);
          hue = keepWithin(phi * 180 / Math.PI, 0, 360);
          brightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);
          hex = hsb2hex({
            h: hue,
            s: saturation,
            b: brightness
          });

          // Update UI
          slider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));
          break;

        case 'saturation':
          // Calculate hue, saturation, and brightness
          hue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);
          saturation = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);
          brightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);
          hex = hsb2hex({
            h: hue,
            s: saturation,
            b: brightness
          });

          // Update UI
          slider.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: brightness }));
          minicolors.find('.minicolors-grid-inner').css('opacity', saturation / 100);
          break;

        case 'brightness':
          // Calculate hue, saturation, and brightness
          hue = keepWithin(parseInt(gridPos.x * (360 / grid.width()), 10), 0, 360);
          saturation = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);
          brightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);
          hex = hsb2hex({
            h: hue,
            s: saturation,
            b: brightness
          });

          // Update UI
          slider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));
          minicolors.find('.minicolors-grid-inner').css('opacity', 1 - (brightness / 100));
          break;

        default:
          // Calculate hue, saturation, and brightness
          hue = keepWithin(360 - parseInt(sliderPos.y * (360 / slider.height()), 10), 0, 360);
          saturation = keepWithin(Math.floor(gridPos.x * (100 / grid.width())), 0, 100);
          brightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);
          hex = hsb2hex({
            h: hue,
            s: saturation,
            b: brightness
          });

          // Update UI
          grid.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: 100 }));
          break;
      }

      // Handle opacity
      if(settings.opacity) {
        opacity = parseFloat(1 - (opacityPos.y / opacitySlider.height())).toFixed(2);
      } else {
        opacity = 1;
      }

      updateInput(input, hex, opacity);
    }
    else {
      // Set swatch color
      swatch.find('span').css({
        backgroundColor: hex,
        opacity: String(opacity)
      });

      // Handle change event
      doChange(input, hex, opacity);
    }
  }

  // Sets the value of the input and does the appropriate conversions
  // to respect settings, also updates the swatch
  function updateInput(input, value, opacity) {
    var rgb;

    // Helpful references
    var minicolors = input.parent();
    var settings = input.data('minicolors-settings');
    var swatch = minicolors.find('.minicolors-input-swatch');

    if(settings.opacity) input.attr('data-opacity', opacity);

    // Set color string
    if(settings.format === 'rgb') {
      // Returns RGB(A) string

      // Checks for input format and does the conversion
      if(isRgb(value)) {
        rgb = parseRgb(value, true);
      }
      else {
        rgb = hex2rgb(parseHex(value, true));
      }

      opacity = input.attr('data-opacity') === '' ? 1 : keepWithin(parseFloat(input.attr('data-opacity')).toFixed(2), 0, 1);
      if(isNaN(opacity) || !settings.opacity) opacity = 1;

      if(input.minicolors('rgbObject').a <= 1 && rgb && settings.opacity) {
        // Set RGBA string if alpha
        value = 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + parseFloat(opacity) + ')';
      } else {
        // Set RGB string (alpha = 1)
        value = 'rgb(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ')';
      }
    } else {
      // Returns hex color

      // Checks for input format and does the conversion
      if(isRgb(value)) {
        value = rgbString2hex(value);
      }

      value = convertCase(value, settings.letterCase);
    }

    // Update value from picker
    input.val(value);

    // Set swatch color
    swatch.find('span').css({
      backgroundColor: value,
      opacity: String(opacity)
    });

    // Handle change event
    doChange(input, value, opacity);
  }

  // Sets the color picker values from the input
  function updateFromInput(input, preserveInputValue) {
    var hex, hsb, opacity, keywords, alpha, value, x, y, r, phi;

    // Helpful references
    var minicolors = input.parent();
    var settings = input.data('minicolors-settings');
    var swatch = minicolors.find('.minicolors-input-swatch');

    // Panel objects
    var grid = minicolors.find('.minicolors-grid');
    var slider = minicolors.find('.minicolors-slider');
    var opacitySlider = minicolors.find('.minicolors-opacity-slider');

    // Picker objects
    var gridPicker = grid.find('[class$=-picker]');
    var sliderPicker = slider.find('[class$=-picker]');
    var opacityPicker = opacitySlider.find('[class$=-picker]');

    // Determine hex/HSB values
    if(isRgb(input.val())) {
      // If input value is a rgb(a) string, convert it to hex color and update opacity
      hex = rgbString2hex(input.val());
      alpha = keepWithin(parseFloat(getAlpha(input.val())).toFixed(2), 0, 1);
      if(alpha) {
        input.attr('data-opacity', alpha);
      }
    } else {
      hex = convertCase(parseHex(input.val(), true), settings.letterCase);
    }

    if(!hex){
      hex = convertCase(parseInput(settings.defaultValue, true), settings.letterCase);
    }
    hsb = hex2hsb(hex);

    // Get array of lowercase keywords
    keywords = !settings.keywords ? [] : $.map(settings.keywords.split(','), function(a) {
      return a.toLowerCase().trim();
    });

    // Set color string
    if(input.val() !== '' && $.inArray(input.val().toLowerCase(), keywords) > -1) {
      value = convertCase(input.val());
    } else {
      value = isRgb(input.val()) ? parseRgb(input.val()) : hex;
    }

    // Update input value
    if(!preserveInputValue) input.val(value);

    // Determine opacity value
    if(settings.opacity) {
      // Get from data-opacity attribute and keep within 0-1 range
      opacity = input.attr('data-opacity') === '' ? 1 : keepWithin(parseFloat(input.attr('data-opacity')).toFixed(2), 0, 1);
      if(isNaN(opacity)) opacity = 1;
      input.attr('data-opacity', opacity);
      swatch.find('span').css('opacity', String(opacity));

      // Set opacity picker position
      y = keepWithin(opacitySlider.height() - (opacitySlider.height() * opacity), 0, opacitySlider.height());
      opacityPicker.css('top', y + 'px');
    }

    // Set opacity to zero if input value is transparent
    if(input.val().toLowerCase() === 'transparent') {
      swatch.find('span').css('opacity', String(0));
    }

    // Update swatch
    swatch.find('span').css('backgroundColor', hex);

    // Determine picker locations
    switch(settings.control) {
      case 'wheel':
        // Set grid position
        r = keepWithin(Math.ceil(hsb.s * 0.75), 0, grid.height() / 2);
        phi = hsb.h * Math.PI / 180;
        x = keepWithin(75 - Math.cos(phi) * r, 0, grid.width());
        y = keepWithin(75 - Math.sin(phi) * r, 0, grid.height());
        gridPicker.css({
          top: y + 'px',
          left: x + 'px'
        });

        // Set slider position
        y = 150 - (hsb.b / (100 / grid.height()));
        if(hex === '') y = 0;
        sliderPicker.css('top', y + 'px');

        // Update panel color
        slider.css('backgroundColor', hsb2hex({ h: hsb.h, s: hsb.s, b: 100 }));
        break;

      case 'saturation':
        // Set grid position
        x = keepWithin((5 * hsb.h) / 12, 0, 150);
        y = keepWithin(grid.height() - Math.ceil(hsb.b / (100 / grid.height())), 0, grid.height());
        gridPicker.css({
          top: y + 'px',
          left: x + 'px'
        });

        // Set slider position
        y = keepWithin(slider.height() - (hsb.s * (slider.height() / 100)), 0, slider.height());
        sliderPicker.css('top', y + 'px');

        // Update UI
        slider.css('backgroundColor', hsb2hex({ h: hsb.h, s: 100, b: hsb.b }));
        minicolors.find('.minicolors-grid-inner').css('opacity', hsb.s / 100);
        break;

      case 'brightness':
        // Set grid position
        x = keepWithin((5 * hsb.h) / 12, 0, 150);
        y = keepWithin(grid.height() - Math.ceil(hsb.s / (100 / grid.height())), 0, grid.height());
        gridPicker.css({
          top: y + 'px',
          left: x + 'px'
        });

        // Set slider position
        y = keepWithin(slider.height() - (hsb.b * (slider.height() / 100)), 0, slider.height());
        sliderPicker.css('top', y + 'px');

        // Update UI
        slider.css('backgroundColor', hsb2hex({ h: hsb.h, s: hsb.s, b: 100 }));
        minicolors.find('.minicolors-grid-inner').css('opacity', 1 - (hsb.b / 100));
        break;

      default:
        // Set grid position
        x = keepWithin(Math.ceil(hsb.s / (100 / grid.width())), 0, grid.width());
        y = keepWithin(grid.height() - Math.ceil(hsb.b / (100 / grid.height())), 0, grid.height());
        gridPicker.css({
          top: y + 'px',
          left: x + 'px'
        });

        // Set slider position
        y = keepWithin(slider.height() - (hsb.h / (360 / slider.height())), 0, slider.height());
        sliderPicker.css('top', y + 'px');

        // Update panel color
        grid.css('backgroundColor', hsb2hex({ h: hsb.h, s: 100, b: 100 }));
        break;
    }

    // Fire change event, but only if minicolors is fully initialized
    if(input.data('minicolors-initialized')) {
      doChange(input, value, opacity);
    }
  }

  // Runs the change and changeDelay callbacks
  function doChange(input, value, opacity) {
    var settings = input.data('minicolors-settings');
    var lastChange = input.data('minicolors-lastChange');
    var obj, sel, i;

    // Only run if it actually changed
    if(!lastChange || lastChange.value !== value || lastChange.opacity !== opacity) {

      // Remember last-changed value
      input.data('minicolors-lastChange', {
        value: value,
        opacity: opacity
      });

      // Check and select applicable swatch
      if(settings.swatches && settings.swatches.length !== 0) {
        if(!isRgb(value)) {
          obj = hex2rgb(value);
        }
        else {
          obj = parseRgb(value, true);
        }
        sel = -1;
        for(i = 0; i < settings.swatches.length; ++i) {
          if(obj.r === settings.swatches[i].r && obj.g === settings.swatches[i].g && obj.b === settings.swatches[i].b && obj.a === settings.swatches[i].a) {
            sel = i;
            break;
          }
        }

        input.parent().find('.minicolors-swatches .minicolors-swatch').removeClass('selected');
        if(sel !== -1) {
          input.parent().find('.minicolors-swatches .minicolors-swatch').eq(i).addClass('selected');
        }
      }

      // Fire change event
      if(settings.change) {
        if(settings.changeDelay) {
          // Call after a delay
          clearTimeout(input.data('minicolors-changeTimeout'));
          input.data('minicolors-changeTimeout', setTimeout(function() {
            settings.change.call(input.get(0), value, opacity);
          }, settings.changeDelay));
        } else {
          // Call immediately
          settings.change.call(input.get(0), value, opacity);
        }
      }
      input.trigger('change').trigger('input');
    }
  }

  // Generates an RGB(A) object based on the input's value
  function rgbObject(input) {
    var rgb,
      opacity = $(input).attr('data-opacity');
    if( isRgb($(input).val()) ) {
      rgb = parseRgb($(input).val(), true);
    } else {
      var hex = parseHex($(input).val(), true);
      rgb = hex2rgb(hex);
    }
    if( !rgb ) return null;
    if( opacity !== undefined ) $.extend(rgb, { a: parseFloat(opacity) });
    return rgb;
  }

  // Generates an RGB(A) string based on the input's value
  function rgbString(input, alpha) {
    var rgb,
      opacity = $(input).attr('data-opacity');
    if( isRgb($(input).val()) ) {
      rgb = parseRgb($(input).val(), true);
    } else {
      var hex = parseHex($(input).val(), true);
      rgb = hex2rgb(hex);
    }
    if( !rgb ) return null;
    if( opacity === undefined ) opacity = 1;
    if( alpha ) {
      return 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + parseFloat(opacity) + ')';
    } else {
      return 'rgb(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ')';
    }
  }

  // Converts to the letter case specified in settings
  function convertCase(string, letterCase) {
    return letterCase === 'uppercase' ? string.toUpperCase() : string.toLowerCase();
  }

  // Parses a string and returns a valid hex string when possible
  function parseHex(string, expand) {
    string = string.replace(/^#/g, '');
    if(!string.match(/^[A-F0-9]{3,6}/ig)) return '';
    if(string.length !== 3 && string.length !== 6) return '';
    if(string.length === 3 && expand) {
      string = string[0] + string[0] + string[1] + string[1] + string[2] + string[2];
    }
    return '#' + string;
  }

  // Parses a string and returns a valid RGB(A) string when possible
  function parseRgb(string, obj) {
    var values = string.replace(/[^\d,.]/g, '');
    var rgba = values.split(',');

    rgba[0] = keepWithin(parseInt(rgba[0], 10), 0, 255);
    rgba[1] = keepWithin(parseInt(rgba[1], 10), 0, 255);
    rgba[2] = keepWithin(parseInt(rgba[2], 10), 0, 255);
    if(rgba[3] !== undefined) {
      rgba[3] = keepWithin(parseFloat(rgba[3], 10), 0, 1);
    }

    // Return RGBA object
    if( obj ) {
      if (rgba[3] !== undefined) {
        return {
          r: rgba[0],
          g: rgba[1],
          b: rgba[2],
          a: rgba[3]
        };
      } else {
        return {
          r: rgba[0],
          g: rgba[1],
          b: rgba[2]
        };
      }
    }

    // Return RGBA string
    if(typeof(rgba[3]) !== 'undefined' && rgba[3] <= 1) {
      return 'rgba(' + rgba[0] + ', ' + rgba[1] + ', ' + rgba[2] + ', ' + rgba[3] + ')';
    } else {
      return 'rgb(' + rgba[0] + ', ' + rgba[1] + ', ' + rgba[2] + ')';
    }

  }

  // Parses a string and returns a valid color string when possible
  function parseInput(string, expand) {
    if(isRgb(string)) {
      // Returns a valid rgb(a) string
      return parseRgb(string);
    } else {
      return parseHex(string, expand);
    }
  }

  // Keeps value within min and max
  function keepWithin(value, min, max) {
    if(value < min) value = min;
    if(value > max) value = max;
    return value;
  }

  // Checks if a string is a valid RGB(A) string
  function isRgb(string) {
    var rgb = string.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
    return (rgb && rgb.length === 4) ? true : false;
  }

  // Function to get alpha from a RGB(A) string
  function getAlpha(rgba) {
    rgba = rgba.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i);
    return (rgba && rgba.length === 6) ? rgba[4] : '1';
  }

  // Converts an HSB object to an RGB object
  function hsb2rgb(hsb) {
    var rgb = {};
    var h = Math.round(hsb.h);
    var s = Math.round(hsb.s * 255 / 100);
    var v = Math.round(hsb.b * 255 / 100);
    if(s === 0) {
      rgb.r = rgb.g = rgb.b = v;
    } else {
      var t1 = v;
      var t2 = (255 - s) * v / 255;
      var t3 = (t1 - t2) * (h % 60) / 60;
      if(h === 360) h = 0;
      if(h < 60) { rgb.r = t1; rgb.b = t2; rgb.g = t2 + t3; }
      else if(h < 120) {rgb.g = t1; rgb.b = t2; rgb.r = t1 - t3; }
      else if(h < 180) {rgb.g = t1; rgb.r = t2; rgb.b = t2 + t3; }
      else if(h < 240) {rgb.b = t1; rgb.r = t2; rgb.g = t1 - t3; }
      else if(h < 300) {rgb.b = t1; rgb.g = t2; rgb.r = t2 + t3; }
      else if(h < 360) {rgb.r = t1; rgb.g = t2; rgb.b = t1 - t3; }
      else { rgb.r = 0; rgb.g = 0; rgb.b = 0; }
    }
    return {
      r: Math.round(rgb.r),
      g: Math.round(rgb.g),
      b: Math.round(rgb.b)
    };
  }

  // Converts an RGB string to a hex string
  function rgbString2hex(rgb){
    rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
    return (rgb && rgb.length === 4) ? '#' +
      ('0' + parseInt(rgb[1],10).toString(16)).slice(-2) +
      ('0' + parseInt(rgb[2],10).toString(16)).slice(-2) +
      ('0' + parseInt(rgb[3],10).toString(16)).slice(-2) : '';
  }

  // Converts an RGB object to a hex string
  function rgb2hex(rgb) {
    var hex = [
      rgb.r.toString(16),
      rgb.g.toString(16),
      rgb.b.toString(16)
    ];
    $.each(hex, function(nr, val) {
      if(val.length === 1) hex[nr] = '0' + val;
    });
    return '#' + hex.join('');
  }

  // Converts an HSB object to a hex string
  function hsb2hex(hsb) {
    return rgb2hex(hsb2rgb(hsb));
  }

  // Converts a hex string to an HSB object
  function hex2hsb(hex) {
    var hsb = rgb2hsb(hex2rgb(hex));
    if(hsb.s === 0) hsb.h = 360;
    return hsb;
  }

  // Converts an RGB object to an HSB object
  function rgb2hsb(rgb) {
    var hsb = { h: 0, s: 0, b: 0 };
    var min = Math.min(rgb.r, rgb.g, rgb.b);
    var max = Math.max(rgb.r, rgb.g, rgb.b);
    var delta = max - min;
    hsb.b = max;
    hsb.s = max !== 0 ? 255 * delta / max : 0;
    if(hsb.s !== 0) {
      if(rgb.r === max) {
        hsb.h = (rgb.g - rgb.b) / delta;
      } else if(rgb.g === max) {
        hsb.h = 2 + (rgb.b - rgb.r) / delta;
      } else {
        hsb.h = 4 + (rgb.r - rgb.g) / delta;
      }
    } else {
      hsb.h = -1;
    }
    hsb.h *= 60;
    if(hsb.h < 0) {
      hsb.h += 360;
    }
    hsb.s *= 100/255;
    hsb.b *= 100/255;
    return hsb;
  }

  // Converts a hex string to an RGB object
  function hex2rgb(hex) {
    hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
    return {
      r: hex >> 16,
      g: (hex & 0x00FF00) >> 8,
      b: (hex & 0x0000FF)
    };
  }

  // Handle events
  $([document])
    // Hide on clicks outside of the control
    .on('mousedown.minicolors touchstart.minicolors', function(event) {
      if(!$(event.target).parents().add(event.target).hasClass('minicolors')) {
        hide();
      }
    })
    // Start moving
    .on('mousedown.minicolors touchstart.minicolors', '.minicolors-grid, .minicolors-slider, .minicolors-opacity-slider', function(event) {
      var target = $(this);
      event.preventDefault();
      $(event.delegateTarget).data('minicolors-target', target);
      move(target, event, true);
    })
    // Move pickers
    .on('mousemove.minicolors touchmove.minicolors', function(event) {
      var target = $(event.delegateTarget).data('minicolors-target');
      if(target) move(target, event);
    })
    // Stop moving
    .on('mouseup.minicolors touchend.minicolors', function() {
      $(this).removeData('minicolors-target');
    })
    // Selected a swatch
    .on('click.minicolors', '.minicolors-swatches li', function(event) {
      event.preventDefault();
      var target = $(this), input = target.parents('.minicolors').find('.minicolors-input'), color = target.data('swatch-color');
      updateInput(input, color, getAlpha(color));
      updateFromInput(input);
    })
    // Show panel when swatch is clicked
    .on('mousedown.minicolors touchstart.minicolors', '.minicolors-input-swatch', function(event) {
      var input = $(this).parent().find('.minicolors-input');
      event.preventDefault();
      show(input);
    })
    // Show on focus
    .on('focus.minicolors', '.minicolors-input', function() {
      var input = $(this);
      if(!input.data('minicolors-initialized')) return;
      show(input);
    })
    // Update value on blur
    .on('blur.minicolors', '.minicolors-input', function() {
      var input = $(this);
      var settings = input.data('minicolors-settings');
      var keywords;
      var hex;
      var rgba;
      var swatchOpacity;
      var value;

      if(!input.data('minicolors-initialized')) return;

      // Get array of lowercase keywords
      keywords = !settings.keywords ? [] : $.map(settings.keywords.split(','), function(a) {
        return a.toLowerCase().trim();
      });

      // Set color string
      if(input.val() !== '' && $.inArray(input.val().toLowerCase(), keywords) > -1) {
        value = input.val();
      } else {
        // Get RGBA values for easy conversion
        if(isRgb(input.val())) {
          rgba = parseRgb(input.val(), true);
        } else {
          hex = parseHex(input.val(), true);
          rgba = hex ? hex2rgb(hex) : null;
        }

        // Convert to format
        if(rgba === null) {
          value = settings.defaultValue;
        } else if(settings.format === 'rgb') {
          value = settings.opacity ?
            parseRgb('rgba(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ',' + input.attr('data-opacity') + ')') :
            parseRgb('rgb(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ')');
        } else {
          value = rgb2hex(rgba);
        }
      }

      // Update swatch opacity
      swatchOpacity = settings.opacity ? input.attr('data-opacity') : 1;
      if(value.toLowerCase() === 'transparent') swatchOpacity = 0;
      input
        .closest('.minicolors')
        .find('.minicolors-input-swatch > span')
        .css('opacity', String(swatchOpacity));

      // Set input value
      input.val(value);

      // Is it blank?
      if(input.val() === '') input.val(parseInput(settings.defaultValue, true));

      // Adjust case
      input.val(convertCase(input.val(), settings.letterCase));

    })
    // Handle keypresses
    .on('keydown.minicolors', '.minicolors-input', function(event) {
      var input = $(this);
      if(!input.data('minicolors-initialized')) return;
      switch(event.which) {
        case 9: // tab
          hide();
          break;
        case 13: // enter
        case 27: // esc
          hide();
          input.blur();
          break;
      }
    })
    // Update on keyup
    .on('keyup.minicolors', '.minicolors-input', function() {
      var input = $(this);
      if(!input.data('minicolors-initialized')) return;
      updateFromInput(input, true);
    })
    // Update on paste
    .on('paste.minicolors', '.minicolors-input', function() {
      var input = $(this);
      if(!input.data('minicolors-initialized')) return;
      setTimeout(function() {
        updateFromInput(input, true);
      }, 1);
    });
}));ext/jquery-ui-1.11.4.custom.min.js000064400000165467152336404310012473 0ustar00/*! jQuery UI - v1.11.4 - 2016-03-02
* http://jqueryui.com
* Includes: core.js, widget.js, mouse.js, datepicker.js, slider.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(c.inline?c.dpDiv.parent()[0]:c.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var h=0,l=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=l.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=l.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var u=!1;e(document).mouseup(function(){u=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!u){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),u=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),u=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),e.extend(e.ui,{datepicker:{version:"1.11.4"}});var c;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,c,d=this._dialogInst;return d||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},e.data(this._dialogInput[0],"datepicker",d)),r(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+c]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),c===n&&(c=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,c=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)
},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),c=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,_=-1,b=!1,y=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=y(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(y(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||y("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",c,d);break;case"o":_=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":y("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),_>-1)for(g=1,v=_;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},c="",d=!1;if(t)for(s=0;e.length>s;s++)if(d)"'"!==e.charAt(s)||h("'")?c+=e.charAt(s):d=!1;else switch(e.charAt(s)){case"d":c+=l("d",t.getDate(),2);break;case"D":c+=u("D",t.getDay(),n,a);break;case"o":c+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":c+=l("m",t.getMonth()+1,2);break;case"M":c+=u("M",t.getMonth(),o,r);break;case"y":c+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":c+=t.getTime();break;case"!":c+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?c+="'":d=!0;break;default:c+=e.charAt(s)}return c},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,c,d,p,f,m,g,v,_,b,y,x,w,k,D,T,S,M,N,C,P,I,A,H,z,F,E,W,O,L,R=new Date,j=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),K=this._get(e,"navigationAsDateFormat"),U=this._getNumberOfMonths(e),q=this._get(e,"showCurrentAtPos"),V=this._get(e,"stepMonths"),G=1!==U[0]||1!==U[1],X=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),Q=this._getMinMaxDate(e,"max"),Z=e.drawMonth-q,et=e.drawYear;if(0>Z&&(Z+=12,et--),Q)for(t=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-U[0]*U[1]+1,Q.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-V,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+V,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?X:j,o=K?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,c=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),_=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),y="",w=0;U[0]>w;w++){for(k="",this.maxRows=4,D=0;U[1]>D;D++){if(T=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",G){if(M+="<div class='ui-datepicker-group",U[1]>1)switch(D){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case U[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,$,Q,w>0||D>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=c?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)C=(x+u)%7,N+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[C]+"'>"+p[C]+"</span></th>";for(M+=N+"</tr></thead><tbody>",P=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,P)),I=(this._getFirstDayOfMonth(et,Z)-u+7)%7,A=Math.ceil((I+P)/7),H=G?this.maxRows>A?this.maxRows:A:A,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-I)),F=0;H>F;F++){for(M+="<tr>",E=c?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)W=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],O=z.getMonth()!==Z,L=O&&!_||!W[0]||$&&$>z||Q&&z>Q,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(O?" ui-datepicker-other-month":"")+(z.getTime()===T.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===T.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(O&&!v?"":" "+W[1]+(z.getTime()===X.getTime()?" "+this._currentClass:"")+(z.getTime()===j.getTime()?" ui-datepicker-today":""))+"'"+(O&&!v||!W[2]?"":" title='"+W[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(O&&!v?"&#xa0;":L?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===j.getTime()?" ui-state-highlight":"")+(z.getTime()===X.getTime()?" ui-state-active":"")+(O?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(G?"</div>"+(U[0]>0&&D===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}y+=k}return y+=l,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,c,d,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),_=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(a||!g)y+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(y+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");y+="</select>"}if(_||(b+=y+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(c=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10);return isNaN(t)?d:t},f=p(c[0]),m=Math.max(f,p(c[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),_&&(b+=(!a&&g&&v?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.slider",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===c.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,s=Math.floor(+(e-t).toFixed(this._precision())/i)*i;e=s+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}})});ext/jquery.validate.js000064400000116170152336404310011020 0ustar00/*!
 * jQuery Validation Plugin v1.12.0
 *
 * http://jqueryvalidation.org/
 *
 * Copyright (c) 2014 Jörn Zaefferer
 * Released under the MIT license
 *
 * Modified to adapt the latest jQuery version (v3 above) included on WordPress 5.6:
 * - (2020-12-15) - jQuery isFunction method is deprecated.
 * - (2020-12-15) - jQuery submit method is deprecated.
 * - (2021-01-30) - jQuery trim method is deprecated.
 * - (2021-02-05) - jQuery focus event shorthand is deprecated.
 */
(function($) {

$.extend($.fn, {
	// http://jqueryvalidation.org/validate/
	validate: function( options ) {

		// if nothing is selected, return nothing; can't chain anyway
		if ( !this.length ) {
			if ( options && options.debug && window.console ) {
				console.warn( "Nothing selected, can't validate, returning nothing." );
			}
			return;
		}

		// check if a validator for this form was already created
		var validator = $.data( this[0], "validator" );
		if ( validator ) {
			return validator;
		}

		// Add novalidate tag if HTML5.
		this.attr( "novalidate", "novalidate" );

		validator = new $.validator( options, this[0] );
		$.data( this[0], "validator", validator );

		if ( validator.settings.onsubmit ) {

			this.validateDelegate( ":submit", "click", function( event ) {
				if ( validator.settings.submitHandler ) {
					validator.submitButton = event.target;
				}
				// allow suppressing validation by adding a cancel class to the submit button
				if ( $(event.target).hasClass("cancel") ) {
					validator.cancelSubmit = true;
				}

				// allow suppressing validation by adding the html5 formnovalidate attribute to the submit button
				if ( $(event.target).attr("formnovalidate") !== undefined ) {
					validator.cancelSubmit = true;
				}
			});

			// validate the form on submit
			this.on("submit", function( event ) {
				if ( validator.settings.debug ) {
					// prevent form submit to be able to see console output
					event.preventDefault();
				}
				function handle() {
					var hidden;
					if ( validator.settings.submitHandler ) {
						if ( validator.submitButton ) {
							// insert a hidden input as a replacement for the missing submit button
							hidden = $("<input type='hidden'/>").attr("name", validator.submitButton.name).val( $(validator.submitButton).val() ).appendTo(validator.currentForm);
						}
						validator.settings.submitHandler.call( validator, validator.currentForm, event );
						if ( validator.submitButton ) {
							// and clean up afterwards; thanks to no-block-scope, hidden can be referenced
							hidden.remove();
						}
						return false;
					}
					return true;
				}

				// prevent submit for invalid forms or custom submit handlers
				if ( validator.cancelSubmit ) {
					validator.cancelSubmit = false;
					return handle();
				}
				if ( validator.form() ) {
					if ( validator.pendingRequest ) {
						validator.formSubmitted = true;
						return false;
					}
					return handle();
				} else {
					validator.focusInvalid();
					return false;
				}
			});
		}

		return validator;
	},
	// http://jqueryvalidation.org/valid/
	valid: function() {
		var valid, validator;

		if ( $(this[0]).is("form")) {
			valid = this.validate().form();
		} else {
			valid = true;
			validator = $(this[0].form).validate();
			this.each(function() {
				valid = validator.element(this) && valid;
			});
		}
		return valid;
	},
	// attributes: space separated list of attributes to retrieve and remove
	removeAttrs: function( attributes ) {
		var result = {},
			$element = this;
		$.each(attributes.split(/\s/), function( index, value ) {
			result[value] = $element.attr(value);
			$element.removeAttr(value);
		});
		return result;
	},
	// http://jqueryvalidation.org/rules/
	rules: function( command, argument ) {
		var element = this[0],
			settings, staticRules, existingRules, data, param, filtered;

		if ( command ) {
			settings = $.data(element.form, "validator").settings;
			staticRules = settings.rules;
			existingRules = $.validator.staticRules(element);
			switch (command) {
			case "add":
				$.extend(existingRules, $.validator.normalizeRule(argument));
				// remove messages from rules, but allow them to be set separately
				delete existingRules.messages;
				staticRules[element.name] = existingRules;
				if ( argument.messages ) {
					settings.messages[element.name] = $.extend( settings.messages[element.name], argument.messages );
				}
				break;
			case "remove":
				if ( !argument ) {
					delete staticRules[element.name];
					return existingRules;
				}
				filtered = {};
				$.each(argument.split(/\s/), function( index, method ) {
					filtered[method] = existingRules[method];
					delete existingRules[method];
					if ( method === "required" ) {
						$(element).removeAttr("aria-required");
					}
				});
				return filtered;
			}
		}

		data = $.validator.normalizeRules(
		$.extend(
			{},
			$.validator.classRules(element),
			$.validator.attributeRules(element),
			$.validator.dataRules(element),
			$.validator.staticRules(element)
		), element);

		// make sure required is at front
		if ( data.required ) {
			param = data.required;
			delete data.required;
			data = $.extend({ required: param }, data );
			$(element).attr( "aria-required", "true" );
		}

		// make sure remote is at back
		if ( data.remote ) {
			param = data.remote;
			delete data.remote;
			data = $.extend( data, { remote: param });
		}

		return data;
	}
});

// Custom selectors
$.extend($.expr.pseudos, {
	// http://jqueryvalidation.org/blank-selector/
	blank: function( a ) { return !("" + $(a).val()).trim(); },
	// http://jqueryvalidation.org/filled-selector/
	filled: function( a ) { return !!("" + $(a).val()).trim(); },
	// http://jqueryvalidation.org/unchecked-selector/
	unchecked: function( a ) { return !$(a).prop("checked"); }
});

// constructor for validator
$.validator = function( options, form ) {
	this.settings = $.extend( true, {}, $.validator.defaults, options );
	this.currentForm = form;
	this.init();
};

// http://jqueryvalidation.org/jQuery.validator.format/
$.validator.format = function( source, params ) {
	if ( arguments.length === 1 ) {
		return function() {
			var args = $.makeArray(arguments);
			args.unshift(source);
			return $.validator.format.apply( this, args );
		};
	}
	if ( arguments.length > 2 && params.constructor !== Array  ) {
		params = $.makeArray(arguments).slice(1);
	}
	if ( params.constructor !== Array ) {
		params = [ params ];
	}
	$.each(params, function( i, n ) {
		source = source.replace( new RegExp("\\{" + i + "\\}", "g"), function() {
			return n;
		});
	});
	return source;
};

$.extend($.validator, {

	defaults: {
		messages: {},
		groups: {},
		rules: {},
		errorClass: "error",
		validClass: "valid",
		errorElement: "label",
		focusInvalid: true,
		errorContainer: $([]),
		errorLabelContainer: $([]),
		onsubmit: true,
		ignore: ":hidden",
		ignoreTitle: false,
		onfocusin: function( element ) {
			this.lastActive = element;

			// hide error label and remove error class on focus if enabled
			if ( this.settings.focusCleanup && !this.blockFocusCleanup ) {
				if ( this.settings.unhighlight ) {
					this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
				}
				this.addWrapper(this.errorsFor(element)).hide();
			}
		},
		onfocusout: function( element ) {
			if ( !this.checkable(element) && (element.name in this.submitted || !this.optional(element)) ) {
				this.element(element);
			}
		},
		onkeyup: function( element, event ) {
			if ( event.which === 9 && this.elementValue(element) === "" ) {
				return;
			} else if ( element.name in this.submitted || element === this.lastElement ) {
				this.element(element);
			}
		},
		onclick: function( element ) {
			// click on selects, radiobuttons and checkboxes
			if ( element.name in this.submitted ) {
				this.element(element);

			// or option elements, check parent select in that case
			} else if ( element.parentNode.name in this.submitted ) {
				this.element(element.parentNode);
			}
		},
		highlight: function( element, errorClass, validClass ) {
			if ( element.type === "radio" ) {
				this.findByName(element.name).addClass(errorClass).removeClass(validClass);
			} else {
				$(element).addClass(errorClass).removeClass(validClass);
			}
		},
		unhighlight: function( element, errorClass, validClass ) {
			if ( element.type === "radio" ) {
				this.findByName(element.name).removeClass(errorClass).addClass(validClass);
			} else {
				$(element).removeClass(errorClass).addClass(validClass);
			}
		}
	},

	// http://jqueryvalidation.org/jQuery.validator.setDefaults/
	setDefaults: function( settings ) {
		$.extend( $.validator.defaults, settings );
	},

	messages: {
		required: "This field is required.",
		remote: "Please fix this field.",
		email: "Please enter a valid email address.",
		url: "Please enter a valid URL.",
		date: "Please enter a valid date.",
		dateISO: "Please enter a valid date (ISO).",
		number: "Please enter a valid number.",
		digits: "Please enter only digits.",
		creditcard: "Please enter a valid credit card number.",
		equalTo: "Please enter the same value again.",
		maxlength: $.validator.format("Please enter no more than {0} characters."),
		minlength: $.validator.format("Please enter at least {0} characters."),
		rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."),
		range: $.validator.format("Please enter a value between {0} and {1}."),
		max: $.validator.format("Please enter a value less than or equal to {0}."),
		min: $.validator.format("Please enter a value greater than or equal to {0}.")
	},

	autoCreateRanges: false,

	prototype: {

		init: function() {
			this.labelContainer = $(this.settings.errorLabelContainer);
			this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);
			this.containers = $(this.settings.errorContainer).add( this.settings.errorLabelContainer );
			this.submitted = {};
			this.valueCache = {};
			this.pendingRequest = 0;
			this.pending = {};
			this.invalid = {};
			this.reset();

			var groups = (this.groups = {}),
				rules;
			$.each(this.settings.groups, function( key, value ) {
				if ( typeof value === "string" ) {
					value = value.split(/\s/);
				}
				$.each(value, function( index, name ) {
					groups[name] = key;
				});
			});
			rules = this.settings.rules;
			$.each(rules, function( key, value ) {
				rules[key] = $.validator.normalizeRule(value);
			});

			function delegate(event) {
				var validator = $.data(this[0].form, "validator"),
					eventType = "on" + event.type.replace(/^validate/, ""),
					settings = validator.settings;
				if ( settings[eventType] && !this.is( settings.ignore ) ) {
					settings[eventType].call(validator, this[0], event);
				}
			}
			$(this.currentForm)
				.validateDelegate(":text, [type='password'], [type='file'], select, textarea, " +
					"[type='number'], [type='search'] ,[type='tel'], [type='url'], " +
					"[type='email'], [type='datetime'], [type='date'], [type='month'], " +
					"[type='week'], [type='time'], [type='datetime-local'], " +
					"[type='range'], [type='color'] ",
					"focusin focusout keyup", delegate)
				.validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", delegate);

			if ( this.settings.invalidHandler ) {
				$(this.currentForm).on("invalid-form.validate", this.settings.invalidHandler);
			}

			// Add aria-required to any Static/Data/Class required fields before first validation
			// Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html
			$(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required", "true");
		},

		// http://jqueryvalidation.org/Validator.form/
		form: function() {
			this.checkForm();
			$.extend(this.submitted, this.errorMap);
			this.invalid = $.extend({}, this.errorMap);
			if ( !this.valid() ) {
				$(this.currentForm).triggerHandler("invalid-form", [ this ]);
			}
			this.showErrors();
			return this.valid();
		},

		checkForm: function() {
			this.prepareForm();
			for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) {
				this.check( elements[i] );
			}
			return this.valid();
		},

		// http://jqueryvalidation.org/Validator.element/
		element: function( element ) {
			var cleanElement = this.clean( element ),
				checkElement = this.validationTargetFor( cleanElement ),
				result = true;

			this.lastElement = checkElement;

			if ( checkElement === undefined ) {
				delete this.invalid[ cleanElement.name ];
			} else {
				this.prepareElement( checkElement );
				this.currentElements = $( checkElement );

				result = this.check( checkElement ) !== false;
				if (result) {
					delete this.invalid[checkElement.name];
				} else {
					this.invalid[checkElement.name] = true;
				}
			}
			// Add aria-invalid status for screen readers
			$( element ).attr( "aria-invalid", !result );

			if ( !this.numberOfInvalids() ) {
				// Hide error containers on last error
				this.toHide = this.toHide.add( this.containers );
			}
			this.showErrors();
			return result;
		},

		// http://jqueryvalidation.org/Validator.showErrors/
		showErrors: function( errors ) {
			if ( errors ) {
				// add items to error list and map
				$.extend( this.errorMap, errors );
				this.errorList = [];
				for ( var name in errors ) {
					this.errorList.push({
						message: errors[name],
						element: this.findByName(name)[0]
					});
				}
				// remove items from success list
				this.successList = $.grep( this.successList, function( element ) {
					return !(element.name in errors);
				});
			}
			if ( this.settings.showErrors ) {
				this.settings.showErrors.call( this, this.errorMap, this.errorList );
			} else {
				this.defaultShowErrors();
			}
		},

		// http://jqueryvalidation.org/Validator.resetForm/
		resetForm: function() {
			if ( $.fn.resetForm ) {
				$(this.currentForm).resetForm();
			}
			this.submitted = {};
			this.lastElement = null;
			this.prepareForm();
			this.hideErrors();
			this.elements()
					.removeClass( this.settings.errorClass )
					.removeData( "previousValue" )
					.removeAttr( "aria-invalid" );
		},

		numberOfInvalids: function() {
			return this.objectLength(this.invalid);
		},

		objectLength: function( obj ) {
			/* jshint unused: false */
			var count = 0,
				i;
			for ( i in obj ) {
				count++;
			}
			return count;
		},

		hideErrors: function() {
			this.addWrapper( this.toHide ).hide();
		},

		valid: function() {
			return this.size() === 0;
		},

		size: function() {
			return this.errorList.length;
		},

		focusInvalid: function() {
			if ( this.settings.focusInvalid ) {
				try {
					$(this.findLastActive() || this.errorList.length && this.errorList[0].element || [])
					.filter(":visible")
					.trigger('focus')
					// manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
					.trigger("focusin");
				} catch(e) {
					// ignore IE throwing errors when focusing hidden elements
				}
			}
		},

		findLastActive: function() {
			var lastActive = this.lastActive;
			return lastActive && $.grep(this.errorList, function( n ) {
				return n.element.name === lastActive.name;
			}).length === 1 && lastActive;
		},

		elements: function() {
			var validator = this,
				rulesCache = {};

			// select all valid inputs inside the form (no submit or reset buttons)
			return $(this.currentForm)
			.find("input, select, textarea")
			.not(":submit, :reset, :image, [disabled]")
			.not( this.settings.ignore )
			.filter(function() {
				if ( !this.name && validator.settings.debug && window.console ) {
					console.error( "%o has no name assigned", this);
				}

				// select only the first element for each name, and only those with rules specified
				if ( this.name in rulesCache || !validator.objectLength($(this).rules()) ) {
					return false;
				}

				rulesCache[this.name] = true;
				return true;
			});
		},

		clean: function( selector ) {
			return $(selector)[0];
		},

		errors: function() {
			var errorClass = this.settings.errorClass.split(" ").join(".");
			return $(this.settings.errorElement + "." + errorClass, this.errorContext);
		},

		reset: function() {
			this.successList = [];
			this.errorList = [];
			this.errorMap = {};
			this.toShow = $([]);
			this.toHide = $([]);
			this.currentElements = $([]);
		},

		prepareForm: function() {
			this.reset();
			this.toHide = this.errors().add( this.containers );
		},

		prepareElement: function( element ) {
			this.reset();
			this.toHide = this.errorsFor(element);
		},

		elementValue: function( element ) {
			var val,
				$element = $(element),
				type = $element.attr("type");

			if ( type === "radio" || type === "checkbox" ) {
				return $("input[name='" + $element.attr("name") + "']:checked").val();
			}

			val = $element.val();
			if ( typeof val === "string" ) {
				return val.replace(/\r/g, "");
			}
			return val;
		},

		check: function( element ) {
			element = this.validationTargetFor( this.clean( element ) );

			var rules = $(element).rules(),
				rulesCount = $.map( rules, function(n, i) {
					return i;
				}).length,
				dependencyMismatch = false,
				val = this.elementValue(element),
				result, method, rule;

			for (method in rules ) {
				rule = { method: method, parameters: rules[method] };
				try {

					result = $.validator.methods[method].call( this, val, element, rule.parameters );

					// if a method indicates that the field is optional and therefore valid,
					// don't mark it as valid when there are no other rules
					if ( result === "dependency-mismatch" && rulesCount === 1 ) {
						dependencyMismatch = true;
						continue;
					}
					dependencyMismatch = false;

					if ( result === "pending" ) {
						this.toHide = this.toHide.not( this.errorsFor(element) );
						return;
					}

					if ( !result ) {
						this.formatAndAdd( element, rule );
						return false;
					}
				} catch(e) {
					if ( this.settings.debug && window.console ) {
						console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e );
					}
					throw e;
				}
			}
			if ( dependencyMismatch ) {
				return;
			}
			if ( this.objectLength(rules) ) {
				this.successList.push(element);
			}
			return true;
		},

		// return the custom message for the given element and validation method
		// specified in the element's HTML5 data attribute
		// return the generic message if present and no method specific message is present
		customDataMessage: function( element, method ) {
			return $( element ).data( "msg" + method[ 0 ].toUpperCase() +
				method.substring( 1 ).toLowerCase() ) || $( element ).data("msg");
		},

		// return the custom message for the given element name and validation method
		customMessage: function( name, method ) {
			var m = this.settings.messages[name];
			return m && (m.constructor === String ? m : m[method]);
		},

		// return the first defined argument, allowing empty strings
		findDefined: function() {
			for (var i = 0; i < arguments.length; i++) {
				if ( arguments[i] !== undefined ) {
					return arguments[i];
				}
			}
			return undefined;
		},

		defaultMessage: function( element, method ) {
			return this.findDefined(
				this.customMessage( element.name, method ),
				this.customDataMessage( element, method ),
				// title is never undefined, so handle empty string as undefined
				!this.settings.ignoreTitle && element.title || undefined,
				$.validator.messages[method],
				"<strong>Warning: No message defined for " + element.name + "</strong>"
			);
		},

		formatAndAdd: function( element, rule ) {
			var message = this.defaultMessage( element, rule.method ),
				theregex = /\$?\{(\d+)\}/g;
			if ( typeof message === "function" ) {
				message = message.call(this, rule.parameters, element);
			} else if (theregex.test(message)) {
				message = $.validator.format(message.replace(theregex, "{$1}"), rule.parameters);
			}
			this.errorList.push({
				message: message,
				element: element,
				method: rule.method
			});

			this.errorMap[element.name] = message;
			this.submitted[element.name] = message;
		},

		addWrapper: function( toToggle ) {
			if ( this.settings.wrapper ) {
				toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );
			}
			return toToggle;
		},

		defaultShowErrors: function() {
			var i, elements, error;
			for ( i = 0; this.errorList[i]; i++ ) {
				error = this.errorList[i];
				if ( this.settings.highlight ) {
					this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );
				}
				this.showLabel( error.element, error.message );
			}
			if ( this.errorList.length ) {
				this.toShow = this.toShow.add( this.containers );
			}
			if ( this.settings.success ) {
				for ( i = 0; this.successList[i]; i++ ) {
					this.showLabel( this.successList[i] );
				}
			}
			if ( this.settings.unhighlight ) {
				for ( i = 0, elements = this.validElements(); elements[i]; i++ ) {
					this.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass );
				}
			}
			this.toHide = this.toHide.not( this.toShow );
			this.hideErrors();
			this.addWrapper( this.toShow ).show();
		},

		validElements: function() {
			return this.currentElements.not(this.invalidElements());
		},

		invalidElements: function() {
			return $(this.errorList).map(function() {
				return this.element;
			});
		},

		showLabel: function( element, message ) {
			var label = this.errorsFor( element );
			if ( label.length ) {
				// refresh error/success class
				label.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );
				// replace message on existing label
				label.html(message);
			} else {
				// create label
				label = $("<" + this.settings.errorElement + ">")
					.attr("for", this.idOrName(element))
					.addClass(this.settings.errorClass)
					.html(message || "");
				if ( this.settings.wrapper ) {
					// make sure the element is visible, even in IE
					// actually showing the wrapped element is handled elsewhere
					label = label.hide().show().wrap("<" + this.settings.wrapper + "/>").parent();
				}
				if ( !this.labelContainer.append(label).length ) {
					if ( this.settings.errorPlacement ) {
						this.settings.errorPlacement(label, $(element) );
					} else {
						label.insertAfter(element);
					}
				}
			}
			if ( !message && this.settings.success ) {
				label.text("");
				if ( typeof this.settings.success === "string" ) {
					label.addClass( this.settings.success );
				} else {
					this.settings.success( label, element );
				}
			}
			this.toShow = this.toShow.add(label);
		},

		errorsFor: function( element ) {
			var name = this.idOrName(element);
			return this.errors().filter(function() {
				return $(this).attr("for") === name;
			});
		},

		idOrName: function( element ) {
			return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name);
		},

		validationTargetFor: function( element ) {
			// if radio/checkbox, validate first element in group instead
			if ( this.checkable(element) ) {
				element = this.findByName( element.name ).not(this.settings.ignore)[0];
			}
			return element;
		},

		checkable: function( element ) {
			return (/radio|checkbox/i).test(element.type);
		},

		findByName: function( name ) {
			return $(this.currentForm).find("[name='" + name + "']");
		},

		getLength: function( value, element ) {
			switch ( element.nodeName.toLowerCase() ) {
			case "select":
				return $("option:selected", element).length;
			case "input":
				if ( this.checkable( element) ) {
					return this.findByName(element.name).filter(":checked").length;
				}
			}
			return value.length;
		},

		depend: function( param, element ) {
			return this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true;
		},

		dependTypes: {
			"boolean": function( param ) {
				return param;
			},
			"string": function( param, element ) {
				return !!$(param, element.form).length;
			},
			"function": function( param, element ) {
				return param(element);
			}
		},

		optional: function( element ) {
			var val = this.elementValue(element);
			return !$.validator.methods.required.call(this, val, element) && "dependency-mismatch";
		},

		startRequest: function( element ) {
			if ( !this.pending[element.name] ) {
				this.pendingRequest++;
				this.pending[element.name] = true;
			}
		},

		stopRequest: function( element, valid ) {
			this.pendingRequest--;
			// sometimes synchronization fails, make sure pendingRequest is never < 0
			if ( this.pendingRequest < 0 ) {
				this.pendingRequest = 0;
			}
			delete this.pending[element.name];
			if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
				$(this.currentForm).trigger("submit");
				this.formSubmitted = false;
			} else if (!valid && this.pendingRequest === 0 && this.formSubmitted) {
				$(this.currentForm).triggerHandler("invalid-form", [ this ]);
				this.formSubmitted = false;
			}
		},

		previousValue: function( element ) {
			return $.data(element, "previousValue") || $.data(element, "previousValue", {
				old: null,
				valid: true,
				message: this.defaultMessage( element, "remote" )
			});
		}

	},

	classRuleSettings: {
		required: { required: true },
		email: { email: true },
		url: { url: true },
		date: { date: true },
		dateISO: { dateISO: true },
		number: { number: true },
		digits: { digits: true },
		creditcard: { creditcard: true }
	},

	addClassRules: function( className, rules ) {
		if ( className.constructor === String ) {
			this.classRuleSettings[className] = rules;
		} else {
			$.extend(this.classRuleSettings, className);
		}
	},

	classRules: function( element ) {
		var rules = {},
			classes = $(element).attr("class");

		if ( classes ) {
			$.each(classes.split(" "), function() {
				if ( this in $.validator.classRuleSettings ) {
					$.extend(rules, $.validator.classRuleSettings[this]);
				}
			});
		}
		return rules;
	},

	attributeRules: function( element ) {
		var rules = {},
			$element = $(element),
			type = element.getAttribute("type"),
			method, value;

		for (method in $.validator.methods) {

			// support for <input required> in both html5 and older browsers
			if ( method === "required" ) {
				value = element.getAttribute(method);
				// Some browsers return an empty string for the required attribute
				// and non-HTML5 browsers might have required="" markup
				if ( value === "" ) {
					value = true;
				}
				// force non-HTML5 browsers to return bool
				value = !!value;
			} else {
				value = $element.attr(method);
			}

			// convert the value to a number for number inputs, and for text for backwards compability
			// allows type="date" and others to be compared as strings
			if ( /min|max/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) {
				value = Number(value);
			}

			if ( value || value === 0 ) {
				rules[method] = value;
			} else if ( type === method && type !== "range" ) {
				// exception: the jquery validate 'range' method
				// does not test for the html5 'range' type
				rules[method] = true;
			}
		}

		// maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs
		if ( rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength) ) {
			delete rules.maxlength;
		}

		return rules;
	},

	dataRules: function( element ) {
		var method, value,
			rules = {}, $element = $( element );
		for ( method in $.validator.methods ) {
			value = $element.data( "rule" + method[ 0 ].toUpperCase() + method.substring( 1 ).toLowerCase() );
			if ( value !== undefined ) {
				rules[ method ] = value;
			}
		}
		return rules;
	},

	staticRules: function( element ) {
		var rules = {},
			validator = $.data(element.form, "validator");

		if ( validator.settings.rules ) {
			rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {};
		}
		return rules;
	},

	normalizeRules: function( rules, element ) {
		// handle dependency check
		$.each(rules, function( prop, val ) {
			// ignore rule when param is explicitly false, eg. required:false
			if ( val === false ) {
				delete rules[prop];
				return;
			}
			if ( val.param || val.depends ) {
				var keepRule = true;
				switch (typeof val.depends) {
				case "string":
					keepRule = !!$(val.depends, element.form).length;
					break;
				case "function":
					keepRule = val.depends.call(element, element);
					break;
				}
				if ( keepRule ) {
					rules[prop] = val.param !== undefined ? val.param : true;
				} else {
					delete rules[prop];
				}
			}
		});

		// evaluate parameters
		$.each(rules, function( rule, parameter ) {
			rules[rule] = 'function' === typeof parameter ? parameter(element) : parameter;
		});

		// clean number parameters
		$.each([ "minlength", "maxlength" ], function() {
			if ( rules[this] ) {
				rules[this] = Number(rules[this]);
			}
		});
		$.each([ "rangelength", "range" ], function() {
			var parts;
			if ( rules[this] ) {
				if ( Array.isArray(rules[this]) ) {
					rules[this] = [ Number(rules[this][0]), Number(rules[this][1]) ];
				} else if ( typeof rules[this] === "string" ) {
					parts = rules[this].split(/[\s,]+/);
					rules[this] = [ Number(parts[0]), Number(parts[1]) ];
				}
			}
		});

		if ( $.validator.autoCreateRanges ) {
			// auto-create ranges
			if ( rules.min && rules.max ) {
				rules.range = [ rules.min, rules.max ];
				delete rules.min;
				delete rules.max;
			}
			if ( rules.minlength && rules.maxlength ) {
				rules.rangelength = [ rules.minlength, rules.maxlength ];
				delete rules.minlength;
				delete rules.maxlength;
			}
		}

		return rules;
	},

	// Converts a simple string to a {string: true} rule, e.g., "required" to {required:true}
	normalizeRule: function( data ) {
		if ( typeof data === "string" ) {
			var transformed = {};
			$.each(data.split(/\s/), function() {
				transformed[this] = true;
			});
			data = transformed;
		}
		return data;
	},

	// http://jqueryvalidation.org/jQuery.validator.addMethod/
	addMethod: function( name, method, message ) {
		$.validator.methods[name] = method;
		$.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];
		if ( method.length < 3 ) {
			$.validator.addClassRules(name, $.validator.normalizeRule(name));
		}
	},

	methods: {

		// http://jqueryvalidation.org/required-method/
		required: function( value, element, param ) {
			// check if dependency is met
			if ( !this.depend(param, element) ) {
				return "dependency-mismatch";
			}
			if ( element.nodeName.toLowerCase() === "select" ) {
				// could be an array for select-multiple or a string, both are fine this way
				var val = $(element).val();
				return val && val.length > 0;
			}
			if ( this.checkable(element) ) {
				return this.getLength(value, element) > 0;
			}
			return value.trim().length > 0;
		},

		// http://jqueryvalidation.org/email-method/
		email: function( value, element ) {
			// From http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-%28type=email%29
			// Retrieved 2014-01-14
			// If you have a problem with this implementation, report a bug against the above spec
			// Or use custom methods to implement your own email validation
			return this.optional(element) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);
		},

		// http://jqueryvalidation.org/url-method/
		url: function( value, element ) {
			// contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/
			return this.optional(element) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
		},

		// http://jqueryvalidation.org/date-method/
		date: function( value, element ) {
			return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());
		},

		// http://jqueryvalidation.org/dateISO-method/
		dateISO: function( value, element ) {
			return this.optional(element) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(value);
		},

		// http://jqueryvalidation.org/number-method/
		number: function( value, element ) {
			return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
		},

		// http://jqueryvalidation.org/digits-method/
		digits: function( value, element ) {
			return this.optional(element) || /^\d+$/.test(value);
		},

		// http://jqueryvalidation.org/creditcard-method/
		// based on http://en.wikipedia.org/wiki/Luhn/
		creditcard: function( value, element ) {
			if ( this.optional(element) ) {
				return "dependency-mismatch";
			}
			// accept only spaces, digits and dashes
			if ( /[^0-9 \-]+/.test(value) ) {
				return false;
			}
			var nCheck = 0,
				nDigit = 0,
				bEven = false,
				n, cDigit;

			value = value.replace(/\D/g, "");

			// Basing min and max length on
			// http://developer.ean.com/general_info/Valid_Credit_Card_Types
			if ( value.length < 13 || value.length > 19 ) {
				return false;
			}

			for ( n = value.length - 1; n >= 0; n--) {
				cDigit = value.charAt(n);
				nDigit = parseInt(cDigit, 10);
				if ( bEven ) {
					if ( (nDigit *= 2) > 9 ) {
						nDigit -= 9;
					}
				}
				nCheck += nDigit;
				bEven = !bEven;
			}

			return (nCheck % 10) === 0;
		},

		// http://jqueryvalidation.org/minlength-method/
		minlength: function( value, element, param ) {
			var length = Array.isArray( value ) ? value.length : this.getLength(value.trim(), element);
			return this.optional(element) || length >= param;
		},

		// http://jqueryvalidation.org/maxlength-method/
		maxlength: function( value, element, param ) {
			var length = Array.isArray( value ) ? value.length : this.getLength(value.trim(), element);
			return this.optional(element) || length <= param;
		},

		// http://jqueryvalidation.org/rangelength-method/
		rangelength: function( value, element, param ) {
			var length = Array.isArray( value ) ? value.length : this.getLength(value.trim(), element);
			return this.optional(element) || ( length >= param[0] && length <= param[1] );
		},

		// http://jqueryvalidation.org/min-method/
		min: function( value, element, param ) {
			return this.optional(element) || value >= param;
		},

		// http://jqueryvalidation.org/max-method/
		max: function( value, element, param ) {
			return this.optional(element) || value <= param;
		},

		// http://jqueryvalidation.org/range-method/
		range: function( value, element, param ) {
			return this.optional(element) || ( value >= param[0] && value <= param[1] );
		},

		// http://jqueryvalidation.org/equalTo-method/
		equalTo: function( value, element, param ) {
			// bind to the blur event of the target in order to revalidate whenever the target field is updated
			// TODO find a way to bind the event just once, avoiding the unbind-rebind overhead
			var target = $(param);
			if ( this.settings.onfocusout ) {
				target.off(".validate-equalTo").on("blur.validate-equalTo", function() {
					$(element).valid();
				});
			}
			return value === target.val();
		},

		// http://jqueryvalidation.org/remote-method/
		remote: function( value, element, param ) {
			if ( this.optional(element) ) {
				return "dependency-mismatch";
			}

			var previous = this.previousValue(element),
				validator, data;

			if (!this.settings.messages[element.name] ) {
				this.settings.messages[element.name] = {};
			}
			previous.originalMessage = this.settings.messages[element.name].remote;
			this.settings.messages[element.name].remote = previous.message;

			param = typeof param === "string" && { url: param } || param;

			if ( previous.old === value ) {
				return previous.valid;
			}

			previous.old = value;
			validator = this;
			this.startRequest(element);
			data = {};
			data[element.name] = value;
			$.ajax($.extend(true, {
				url: param,
				mode: "abort",
				port: "validate" + element.name,
				dataType: "json",
				data: data,
				context: validator.currentForm,
				success: function( response ) {
					var valid = response === true || response === "true",
						errors, message, submitted;

					validator.settings.messages[element.name].remote = previous.originalMessage;
					if ( valid ) {
						submitted = validator.formSubmitted;
						validator.prepareElement(element);
						validator.formSubmitted = submitted;
						validator.successList.push(element);
						delete validator.invalid[element.name];
						validator.showErrors();
					} else {
						errors = {};
						message = response || validator.defaultMessage( element, "remote" );
						errors[element.name] = previous.message = 'function' === typeof message ? message(value) : message;
						validator.invalid[element.name] = true;
						validator.showErrors(errors);
					}
					previous.valid = valid;
					validator.stopRequest(element, valid);
				}
			}, param));
			return "pending";
		}

	}

});

$.format = function deprecated() {
	throw "$.format has been deprecated. Please use $.validator.format instead.";
};

}(jQuery));

// ajax mode: abort
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
(function($) {
	var pendingRequests = {},
		ajax;
	// Use a prefilter if available (1.5+)
	if ( $.ajaxPrefilter ) {
		$.ajaxPrefilter(function( settings, _, xhr ) {
			var port = settings.port;
			if ( settings.mode === "abort" ) {
				if ( pendingRequests[port] ) {
					pendingRequests[port].abort();
				}
				pendingRequests[port] = xhr;
			}
		});
	} else {
		// Proxy ajax
		ajax = $.ajax;
		$.ajax = function( settings ) {
			var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
				port = ( "port" in settings ? settings : $.ajaxSettings ).port;
			if ( mode === "abort" ) {
				if ( pendingRequests[port] ) {
					pendingRequests[port].abort();
				}
				pendingRequests[port] = ajax.apply(this, arguments);
				return pendingRequests[port];
			}
			return ajax.apply(this, arguments);
		};
	}
}(jQuery));

// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation
// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target
(function($) {
	$.extend($.fn, {
		validateDelegate: function( delegate, type, handler ) {
			return this.on(type, function( event ) {
				var target = $(event.target);
				if ( target.is(delegate) ) {
					return handler.apply(target, arguments);
				}
			});
		}
	});
}(jQuery));
ext/jquery-ui-1.10.4.custom.min.js000064400000163623152336404310012462 0ustar00/*! jQuery UI - v1.10.4 - 2014-03-04
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.datepicker.js, jquery.ui.slider.js
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */

(function(e,t){function i(t,i){var s,a,o,r=t.nodeName.toLowerCase();return"area"===r?(s=t.parentNode,a=s.name,t.href&&a&&"map"===s.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&n(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,a=e(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(o,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(o,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,a=e.ui[t].prototype;for(s in n)a.plugins[s]=a.plugins[s]||[],a.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;s.length>n;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e,t){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(n.inline?t.parent()[0]:n.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function s(t,i){e.extend(t,i);for(var a in i)null==i[a]&&(t[a]=i[a]);return t}e.extend(e.ui,{datepicker:{version:"1.10.4"}});var n,r="datepicker";e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var a,s,n;a=t.nodeName.toLowerCase(),s="div"===a||"span"===a,t.id||(this.uuid+=1,t.id="dp"+this.uuid),n=this._newInst(e(t),s),n.settings=e.extend({},i||{}),"input"===a?this._connectDatepicker(t,n):s&&this._inlineDatepicker(t,n)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var a=e(t);i.append=e([]),i.trigger=e([]),a.hasClass(this.markerClassName)||(this._attachments(a,i),a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,r,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var a,s,n,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[o?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),a=this._get(i,"showOn"),("focus"===a||"both"===a)&&t.focus(this._showDatepicker),("button"===a||"both"===a)&&(s=this._get(i,"buttonText"),n=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(n?e("<img/>").attr({src:n,alt:s,title:s}):s)),t[o?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,a,s,n=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(i=0,a=0,s=0;e.length>s;s++)e[s].length>i&&(i=e[s].length,a=s);return a},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length)}},_inlineDatepicker:function(t,i){var a=e(t);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(i.dpDiv),e.data(t,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,a,n,o){var u,c,h,l,d,p=this._dialogInst;return p||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],r,p)),s(p.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(c=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[c/2-100+l,h/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(t){var i,a=e(t),s=e.data(t,r);a.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,r),"input"===i?(s.append.remove(),s.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&a.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,a,n){var r,o,u,c,h=this._getInst(i);return 2===arguments.length&&"string"==typeof a?"defaults"===a?e.extend({},e.datepicker._defaults):h?"all"===a?e.extend({},h.settings):this._get(h,a):null:(r=a||{},"string"==typeof a&&(r={},r[a]=n),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),u=this._getMinMaxDate(h,"min"),c=this._getMinMaxDate(h,"max"),s(h.settings,r),null!==u&&r.dateFormat!==t&&r.minDate===t&&(h.settings.minDate=this._formatDate(h,u)),null!==c&&r.dateFormat!==t&&r.maxDate===t&&(h.settings.maxDate=this._formatDate(h,c)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(e(i),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),t)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,a,s,n=e.datepicker._getInst(t.target),r=!0,o=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",n.dpDiv),s[0]&&e.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,s[0]),i=e.datepicker._get(n,"onSelect"),i?(a=e.datepicker._formatDate(n),i.apply(n.input?n.input[0]:null,[a,n])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(i){var a,s,n=e.datepicker._getInst(i.target);return e.datepicker._get(n,"constrainInput")?(a=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">s||!a||a.indexOf(s)>-1):t},_doKeyUp:function(t){var i,a=e.datepicker._getInst(t.target);if(a.input.val()!==a.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,e.datepicker._getFormatConfig(a)),i&&(e.datepicker._setDateFromField(a),e.datepicker._updateAlternate(a),e.datepicker._updateDatepicker(a))}catch(s){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,a,n,r,o,u,c;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),a=e.datepicker._get(i,"beforeShow"),n=a?a.apply(t,[t,i]):{},n!==!1&&(s(i.settings,n),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),o={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),o=e.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(u=e.datepicker._get(i,"showAnim"),c=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[u]?i.dpDiv.show(u,e.datepicker._get(i,"showOptions"),c):i.dpDiv[u||"show"](u?c:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,n=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,a=this._getNumberOfMonths(t),s=a[1],r=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",r*s+"em"),t.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,a){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,u=document.documentElement.clientWidth+(a?0:e(document).scrollLeft()),c=document.documentElement.clientHeight+(a?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-r:0,i.left-=a&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=a&&i.top===t.input.offset().top+o?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>u&&u>s?Math.abs(i.left+s-u):0),i.top-=Math.min(i.top,i.top+n>c&&c>n?Math.abs(n+o):0),i},_findPos:function(t){for(var i,a=this._getInst(t),s=this._get(a,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,a,s,n,o=this._curInst;!o||t&&o!==e.data(t,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),a=this._get(o,"duration"),s=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),a,s):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?a:null,s),i||s(),this._datepickerShowing=!1,n=this._get(o,"onClose"),n&&n.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),a=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==a)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,a){var s=e(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,i+("M"===a?this._get(n,"showCurrentAtPos"):0),a),this._updateDatepicker(n))},_gotoToday:function(t){var i,a=e(t),s=this._getInst(a[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(a)},_selectMonthYear:function(t,i,a){var s=e(t),n=this._getInst(s[0]);n["selected"+("M"===a?"Month":"Year")]=n["draw"+("M"===a?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,i,a,s){var n,r=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(n=this._getInst(r[0]),n.selectedDay=n.currentDay=e("a",s).html(),n.selectedMonth=n.currentMonth=i,n.selectedYear=n.currentYear=a,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var a,s=e(t),n=this._getInst(s[0]);i=null!=i?i:this._formatDate(n),n.input&&n.input.val(i),this._updateAlternate(n),a=this._get(n,"onSelect"),a?a.apply(n.input?n.input[0]:null,[i,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,a,s,n=this._get(t,"altField");n&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),a=this._getDate(t),s=this.formatDate(i,a,this._getFormatConfig(t)),e(n).each(function(){e(this).val(s)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(i,a,s){if(null==i||null==a)throw"Invalid arguments";if(a="object"==typeof a?""+a:a+"",""===a)return null;var n,r,o,u,c=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,p=(s?s.dayNames:null)||this._defaults.dayNames,g=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,m=(s?s.monthNames:null)||this._defaults.monthNames,f=-1,_=-1,v=-1,k=-1,y=!1,b=function(e){var t=i.length>n+1&&i.charAt(n+1)===e;return t&&n++,t},D=function(e){var t=b(e),i="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=RegExp("^\\d{1,"+i+"}"),n=a.substring(c).match(s);if(!n)throw"Missing number at position "+c;return c+=n[0].length,parseInt(n[0],10)},w=function(i,s,n){var r=-1,o=e.map(b(i)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,i){var s=i[1];return a.substr(c,s.length).toLowerCase()===s.toLowerCase()?(r=i[0],c+=s.length,!1):t}),-1!==r)return r+1;throw"Unknown name at position "+c},M=function(){if(a.charAt(c)!==i.charAt(n))throw"Unexpected literal at position "+c;c++};for(n=0;i.length>n;n++)if(y)"'"!==i.charAt(n)||b("'")?M():y=!1;else switch(i.charAt(n)){case"d":v=D("d");break;case"D":w("D",d,p);break;case"o":k=D("o");break;case"m":_=D("m");break;case"M":_=w("M",g,m);break;case"y":f=D("y");break;case"@":u=new Date(D("@")),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"!":u=new Date((D("!")-this._ticksTo1970)/1e4),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"'":b("'")?M():y=!0;break;default:M()}if(a.length>c&&(o=a.substr(c),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===f?f=(new Date).getFullYear():100>f&&(f+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=f?0:-100)),k>-1)for(_=1,v=k;;){if(r=this._getDaysInMonth(f,_-1),r>=v)break;_++,v-=r}if(u=this._daylightSavingAdjust(new Date(f,_-1,v)),u.getFullYear()!==f||u.getMonth()+1!==_||u.getDate()!==v)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var a,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,u=function(t){var i=e.length>a+1&&e.charAt(a+1)===t;return i&&a++,i},c=function(e,t,i){var a=""+t;if(u(e))for(;i>a.length;)a="0"+a;return a},h=function(e,t,i,a){return u(e)?a[t]:i[t]},l="",d=!1;if(t)for(a=0;e.length>a;a++)if(d)"'"!==e.charAt(a)||u("'")?l+=e.charAt(a):d=!1;else switch(e.charAt(a)){case"d":l+=c("d",t.getDate(),2);break;case"D":l+=h("D",t.getDay(),s,n);break;case"o":l+=c("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":l+=c("m",t.getMonth()+1,2);break;case"M":l+=h("M",t.getMonth(),r,o);break;case"y":l+=u("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=1e4*t.getTime()+this._ticksTo1970;break;case"'":u("'")?l+="'":d=!0;break;default:l+=e.charAt(a)}return l},_possibleChars:function(e){var t,i="",a=!1,s=function(i){var a=e.length>t+1&&e.charAt(t+1)===i;return a&&t++,a};for(t=0;e.length>t;t++)if(a)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):a=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":a=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,i){return e.settings[i]!==t?e.settings[i]:this._defaults[i]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),a=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),n=s,r=this._getFormatConfig(e);try{n=this.parseDate(i,a,r)||s}catch(o){a=t?"":a}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=a?n.getDate():0,e.currentMonth=a?n.getMonth():0,e.currentYear=a?n.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,a){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},n=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(a){}for(var s=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,n=s.getFullYear(),r=s.getMonth(),o=s.getDate(),u=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,c=u.exec(i);c;){switch(c[2]||"d"){case"d":case"D":o+=parseInt(c[1],10);break;case"w":case"W":o+=7*parseInt(c[1],10);break;case"m":case"M":r+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r));break;case"y":case"Y":n+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r))}c=u.exec(i)}return new Date(n,r,o)},r=null==i||""===i?a:"string"==typeof i?n(i):"number"==typeof i?isNaN(i)?a:s(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?a:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var a=!t,s=e.selectedMonth,n=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),s===e.selectedMonth&&n===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(a?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),a="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(a,-i,"M")},next:function(){e.datepicker._adjustDate(a,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(a)},selectDay:function(){return e.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(a,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,a,s,n,r,o,u,c,h,l,d,p,g,m,f,_,v,k,y,b,D,w,M,C,x,I,N,T,A,E,S,Y,F,P,O,j,K,R,H=new Date,W=this._daylightSavingAdjust(new Date(H.getFullYear(),H.getMonth(),H.getDate())),L=this._get(e,"isRTL"),U=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),z=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),G=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),Q=1!==q[0]||1!==q[1],V=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),X=this._getMinMaxDate(e,"max"),Z=e.drawMonth-G,et=e.drawYear;if(0>Z&&(Z+=12,et--),X)for(t=this._daylightSavingAdjust(new Date(X.getFullYear(),X.getMonth()-q[0]*q[1]+1,X.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=z?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):i,a=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=z?this.formatDate(s,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):s,n=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>",r=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?V:W,r=z?this.formatDate(r,o,this._getFormatConfig(e)):r,u=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",c=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(L?u:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(L?"":u)+"</div>":"",h=parseInt(this._get(e,"firstDay"),10),h=isNaN(h)?0:h,l=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),g=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),f=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),v=this._get(e,"selectOtherMonths"),k=this._getDefaultDate(e),y="",D=0;q[0]>D;D++){for(w="",this.maxRows=4,M=0;q[1]>M;M++){if(C=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),x=" ui-corner-all",I="",Q){if(I+="<div class='ui-datepicker-group",q[1]>1)switch(M){case 0:I+=" ui-datepicker-group-first",x=" ui-corner-"+(L?"right":"left");break;case q[1]-1:I+=" ui-datepicker-group-last",x=" ui-corner-"+(L?"left":"right");break;default:I+=" ui-datepicker-group-middle",x=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+x+"'>"+(/all|left/.test(x)&&0===D?L?n:a:"")+(/all|right/.test(x)&&0===D?L?a:n:"")+this._generateMonthYearHeader(e,Z,et,$,X,D>0||M>0,g,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=l?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",b=0;7>b;b++)T=(b+h)%7,N+="<th"+((b+h+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[T]+"'>"+p[T]+"</span></th>";for(I+=N+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),E=(this._getFirstDayOfMonth(et,Z)-h+7)%7,S=Math.ceil((E+A)/7),Y=Q?this.maxRows>S?this.maxRows:S:S,this.maxRows=Y,F=this._daylightSavingAdjust(new Date(et,Z,1-E)),P=0;Y>P;P++){for(I+="<tr>",O=l?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(F)+"</td>":"",b=0;7>b;b++)j=f?f.apply(e.input?e.input[0]:null,[F]):[!0,""],K=F.getMonth()!==Z,R=K&&!v||!j[0]||$&&$>F||X&&F>X,O+="<td class='"+((b+h+6)%7>=5?" ui-datepicker-week-end":"")+(K?" ui-datepicker-other-month":"")+(F.getTime()===C.getTime()&&Z===e.selectedMonth&&e._keyEvent||k.getTime()===F.getTime()&&k.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(K&&!_?"":" "+j[1]+(F.getTime()===V.getTime()?" "+this._currentClass:"")+(F.getTime()===W.getTime()?" ui-datepicker-today":""))+"'"+(K&&!_||!j[2]?"":" title='"+j[2].replace(/'/g,"&#39;")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+F.getMonth()+"' data-year='"+F.getFullYear()+"'")+">"+(K&&!_?"&#xa0;":R?"<span class='ui-state-default'>"+F.getDate()+"</span>":"<a class='ui-state-default"+(F.getTime()===W.getTime()?" ui-state-highlight":"")+(F.getTime()===V.getTime()?" ui-state-active":"")+(K?" ui-priority-secondary":"")+"' href='#'>"+F.getDate()+"</a>")+"</td>",F.setDate(F.getDate()+1),F=this._daylightSavingAdjust(F);I+=O+"</tr>"}Z++,Z>11&&(Z=0,et++),I+="</tbody></table>"+(Q?"</div>"+(q[0]>0&&M===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=I}y+=w}return y+=c,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,a,s,n,r,o){var u,c,h,l,d,p,g,m,f=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),k="<div class='ui-datepicker-title'>",y="";if(n||!f)y+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(u=a&&a.getFullYear()===i,c=s&&s.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;12>h;h++)(!u||h>=a.getMonth())&&(!c||s.getMonth()>=h)&&(y+="<option value='"+h+"'"+(h===t?" selected='selected'":"")+">"+o[h]+"</option>");y+="</select>"}if(v||(k+=y+(!n&&f&&_?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",n||!_)k+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(l=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10);
return isNaN(t)?d:t},g=p(l[0]),m=Math.max(g,p(l[1]||"")),g=a?Math.max(g,a.getFullYear()):g,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=g;g++)e.yearshtml+="<option value='"+g+"'"+(g===i?" selected='selected'":"")+">"+g+"</option>";e.yearshtml+="</select>",k+=e.yearshtml,e.yearshtml=null}return k+=this._get(e,"yearSuffix"),v&&(k+=(!n&&f&&_?"":"&#xa0;")+y),k+="</div>"},_adjustInstDate:function(e,t,i){var a=e.drawYear+("Y"===i?t:0),s=e.drawMonth+("M"===i?t:0),n=Math.min(e.selectedDay,this._getDaysInMonth(a,s))+("D"===i?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(a,s,n)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),s=i&&i>t?i:t;return a&&s>a?a:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,a){var s=this._getNumberOfMonths(e),n=this._daylightSavingAdjust(new Date(i,a+(0>t?t:s[0]*s[1]),1));return 0>t&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(e,n)},_isInRange:function(e,t){var i,a,s=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=null,o=null,u=this._get(e,"yearRange");return u&&(i=u.split(":"),a=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=a),i[1].match(/[+\-].*/)&&(o+=a)),(!s||t.getTime()>=s.getTime())&&(!n||t.getTime()<=n.getTime())&&(!r||t.getFullYear()>=r)&&(!o||o>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,a){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(a,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.4"})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,l,h,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),l=a.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-a.width()/2,top:e.pageY-l.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),u["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](u,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);ext/jquery-ui-timepicker-addon.js000064400000216011152336404310013053 0ustar00/*! jQuery Timepicker Addon - v1.4.3 - 2013-11-30
* http://trentrichardson.com/examples/timepicker
* Copyright (c) 2013 Trent Richardson; Licensed MIT
*
* Modified to adapt the latest jQuery version (v3 above) included on WordPress 5.6:
* - (2020-12-15) - jQuery isFunction method is deprecated.
* - (2020-12-28) - jQuery change shorthand is deprecated.
* - (2021-02-01) - Number type value passed to css method is deprecated.
* - (2021-02-01) - jQuery :eq() selector is deprecated.
* - (2021-02-03) - jQuery bind method is deprecated.
* - (2021-02-04) - jQuery click event shorthand is deprecated.
* - (2021-02-05) - jQuery focus event shorthand is deprecated.
*/
(function ($) {

	/*
	* Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
	*/
	$.ui.timepicker = $.ui.timepicker || {};
	if ($.ui.timepicker.version) {
		return;
	}

	/*
	* Extend jQueryUI, get it started with our version number
	*/
	$.extend($.ui, {
		timepicker: {
			version: "1.4.3"
		}
	});

	/*
	* Timepicker manager.
	* Use the singleton instance of this class, $.timepicker, to interact with the time picker.
	* Settings for (groups of) time pickers are maintained in an instance object,
	* allowing multiple different settings on the same page.
	*/
	var Timepicker = function () {
		this.regional = []; // Available regional settings, indexed by language code
		this.regional[''] = { // Default regional settings
			currentText: 'Now',
			closeText: 'Done',
			amNames: ['AM', 'A'],
			pmNames: ['PM', 'P'],
			timeFormat: 'HH:mm',
			timeSuffix: '',
			timeOnlyTitle: 'Choose Time',
			timeText: 'Time',
			hourText: 'Hour',
			minuteText: 'Minute',
			secondText: 'Second',
			millisecText: 'Millisecond',
			microsecText: 'Microsecond',
			timezoneText: 'Time Zone',
			isRTL: false
		};
		this._defaults = { // Global defaults for all the datetime picker instances
			showButtonPanel: true,
			timeOnly: false,
			showHour: null,
			showMinute: null,
			showSecond: null,
			showMillisec: null,
			showMicrosec: null,
			showTimezone: null,
			showTime: true,
			stepHour: 1,
			stepMinute: 1,
			stepSecond: 1,
			stepMillisec: 1,
			stepMicrosec: 1,
			hour: 0,
			minute: 0,
			second: 0,
			millisec: 0,
			microsec: 0,
			timezone: null,
			hourMin: 0,
			minuteMin: 0,
			secondMin: 0,
			millisecMin: 0,
			microsecMin: 0,
			hourMax: 23,
			minuteMax: 59,
			secondMax: 59,
			millisecMax: 999,
			microsecMax: 999,
			minDateTime: null,
			maxDateTime: null,
			onSelect: null,
			hourGrid: 0,
			minuteGrid: 0,
			secondGrid: 0,
			millisecGrid: 0,
			microsecGrid: 0,
			alwaysSetTime: true,
			separator: ' ',
			altFieldTimeOnly: true,
			altTimeFormat: null,
			altSeparator: null,
			altTimeSuffix: null,
			pickerTimeFormat: null,
			pickerTimeSuffix: null,
			showTimepicker: true,
			timezoneList: null,
			addSliderAccess: false,
			sliderAccessArgs: null,
			controlType: 'slider',
			defaultValue: null,
			parse: 'strict'
		};
		$.extend(this._defaults, this.regional['']);
	};

	$.extend(Timepicker.prototype, {
		$input: null,
		$altInput: null,
		$timeObj: null,
		inst: null,
		hour_slider: null,
		minute_slider: null,
		second_slider: null,
		millisec_slider: null,
		microsec_slider: null,
		timezone_select: null,
		hour: 0,
		minute: 0,
		second: 0,
		millisec: 0,
		microsec: 0,
		timezone: null,
		hourMinOriginal: null,
		minuteMinOriginal: null,
		secondMinOriginal: null,
		millisecMinOriginal: null,
		microsecMinOriginal: null,
		hourMaxOriginal: null,
		minuteMaxOriginal: null,
		secondMaxOriginal: null,
		millisecMaxOriginal: null,
		microsecMaxOriginal: null,
		ampm: '',
		formattedDate: '',
		formattedTime: '',
		formattedDateTime: '',
		timezoneList: null,
		units: ['hour', 'minute', 'second', 'millisec', 'microsec'],
		support: {},
		control: null,

		/*
		* Override the default settings for all instances of the time picker.
		* @param  {Object} settings  object - the new settings to use as defaults (anonymous object)
		* @return {Object} the manager object
		*/
		setDefaults: function (settings) {
			extendRemove(this._defaults, settings || {});
			return this;
		},

		/*
		* Create a new Timepicker instance
		*/
		_newInst: function ($input, opts) {
			var tp_inst = new Timepicker(),
				inlineSettings = {},
				fns = {},
				overrides, i;

			for (var attrName in this._defaults) {
				if (this._defaults.hasOwnProperty(attrName)) {
					var attrValue = $input.attr('time:' + attrName);
					if (attrValue) {
						try {
							inlineSettings[attrName] = eval(attrValue);
						} catch (err) {
							inlineSettings[attrName] = attrValue;
						}
					}
				}
			}

			overrides = {
				beforeShow: function (input, dp_inst) {
					if ('function' === typeof tp_inst._defaults.evnts.beforeShow) {
						return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);
					}
				},
				onChangeMonthYear: function (year, month, dp_inst) {
					// Update the time as well : this prevents the time from disappearing from the $input field.
					tp_inst._updateDateTime(dp_inst);
					if ('function' === typeof tp_inst._defaults.evnts.onChangeMonthYear) {
						tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
					}
				},
				onClose: function (dateText, dp_inst) {
					if (tp_inst.timeDefined === true && $input.val() !== '') {
						tp_inst._updateDateTime(dp_inst);
					}
					if ('function' === typeof tp_inst._defaults.evnts.onClose) {
						tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);
					}
				}
			};
			for (i in overrides) {
				if (overrides.hasOwnProperty(i)) {
					fns[i] = opts[i] || null;
				}
			}

			tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {
				evnts: fns,
				timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
			});
			tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) {
				return val.toUpperCase();
			});
			tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) {
				return val.toUpperCase();
			});

			// detect which units are supported
			tp_inst.support = detectSupport(
					tp_inst._defaults.timeFormat +
					(tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
					(tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));

			// controlType is string - key to our this._controls
			if (typeof(tp_inst._defaults.controlType) === 'string') {
				if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') {
					tp_inst._defaults.controlType = 'select';
				}
				tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
			}
			// controlType is an object and must implement create, options, value methods
			else {
				tp_inst.control = tp_inst._defaults.controlType;
			}

			// prep the timezone options
			var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60,
					0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];
			if (tp_inst._defaults.timezoneList !== null) {
				timezoneList = tp_inst._defaults.timezoneList;
			}
			var tzl = timezoneList.length, tzi = 0, tzv = null;
			if (tzl > 0 && typeof timezoneList[0] !== 'object') {
				for (; tzi < tzl; tzi++) {
					tzv = timezoneList[tzi];
					timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) };
				}
			}
			tp_inst._defaults.timezoneList = timezoneList;

			// set the default units
			tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :
							((new Date()).getTimezoneOffset() * -1);
			tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin :
							tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
			tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin :
							tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
			tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin :
							tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
			tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin :
							tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
			tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin :
							tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
			tp_inst.ampm = '';
			tp_inst.$input = $input;

			if (tp_inst._defaults.altField) {
				tp_inst.$altInput = $(tp_inst._defaults.altField).css({
					cursor: 'pointer'
				}).on('focus', function () {
					$input.trigger("focus");
				});
			}

			if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
				tp_inst._defaults.minDate = new Date();
			}
			if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
				tp_inst._defaults.maxDate = new Date();
			}

			// datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
			if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
				tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
			}
			if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
				tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
			}
			if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
				tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
			}
			if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
				tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
			}
			tp_inst.$input.on('focus', function(){
				tp_inst._onFocus();
			});

			return tp_inst;
		},

		/*
		* add our sliders to the calendar
		*/
		_addTimePicker: function (dp_inst) {
			var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();

			this.timeDefined = this._parseTime(currDT);
			this._limitMinMaxDateTime(dp_inst, false);
			this._injectTimePicker();
		},

		/*
		* parse the time string from input value or _setTime
		*/
		_parseTime: function (timeString, withDate) {
			if (!this.inst) {
				this.inst = $.datepicker._getInst(this.$input[0]);
			}

			if (withDate || !this._defaults.timeOnly) {
				var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
				try {
					var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
					if (!parseRes.timeObj) {
						return false;
					}
					$.extend(this, parseRes.timeObj);
				} catch (err) {
					$.timepicker.log("Error parsing the date/time string: " + err +
									"\ndate/time string = " + timeString +
									"\ntimeFormat = " + this._defaults.timeFormat +
									"\ndateFormat = " + dp_dateFormat);
					return false;
				}
				return true;
			} else {
				var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
				if (!timeObj) {
					return false;
				}
				$.extend(this, timeObj);
				return true;
			}
		},

		/*
		* generate and inject html for timepicker into ui datepicker
		*/
		_injectTimePicker: function () {
			var $dp = this.inst.dpDiv,
				o = this.inst.settings,
				tp_inst = this,
				litem = '',
				uitem = '',
				show = null,
				max = {},
				gridSize = {},
				size = null,
				i = 0,
				l = 0;

			// Prevent displaying twice
			if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
				var noDisplay = ' style="display:none;"',
					html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
								'<dd class="ui_tpicker_time"' + ((o.showTime) ? '' : noDisplay) + '></dd>';

				// Create the markup
				for (i = 0, l = this.units.length; i < l; i++) {
					litem = this.units[i];
					uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
					show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];

					// Added by Peter Medeiros:
					// - Figure out what the hour/minute/second max should be based on the step values.
					// - Example: if stepMinute is 15, then minMax is 45.
					max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
					gridSize[litem] = 0;

					html += '<dt class="ui_tpicker_' + litem + '_label"' + (show ? '' : noDisplay) + '>' + o[litem + 'Text'] + '</dt>' +
								'<dd class="ui_tpicker_' + litem + '"><div class="ui_tpicker_' + litem + '_slider"' + (show ? '' : noDisplay) + '></div>';

					if (show && o[litem + 'Grid'] > 0) {
						html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';

						if (litem === 'hour') {
							for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {
								gridSize[litem]++;
								var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o);
								html += '<td data-for="' + litem + '">' + tmph + '</td>';
							}
						}
						else {
							for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) {
								gridSize[litem]++;
								html += '<td data-for="' + litem + '">' + ((m < 10) ? '0' : '') + m + '</td>';
							}
						}

						html += '</tr></table></div>';
					}
					html += '</dd>';
				}

				// Timezone
				var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
				html += '<dt class="ui_tpicker_timezone_label"' + (showTz ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
				html += '<dd class="ui_tpicker_timezone" ' + (showTz ? '' : noDisplay) + '></dd>';

				// Create the elements from string
				html += '</dl></div>';
				var $tp = $(html);

				// if we only want time picker...
				if (o.timeOnly === true) {
					$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
					$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
				}

				// add sliders, adjust grids, add events
				for (i = 0, l = tp_inst.units.length; i < l; i++) {
					litem = tp_inst.units[i];
					uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
					show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];

					// add the slider
					tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]);

					// adjust the grid and add click event
					if (show && o[litem + 'Grid'] > 0) {
						size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']);
						$tp.find('.ui_tpicker_' + litem + ' table').css({
							width: size + "%",
							marginLeft: o.isRTL ? '0px' : ((size / (-2 * gridSize[litem])) + "%"),
							marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0px',
							borderCollapse: 'collapse'
						}).find('td').on('click', function(e) {
								var $t = $(this),
									h = $t.html(),
									n = parseInt(h.replace(/[^0-9]/g), 10),
									ap = h.replace(/[^apm]/ig),
									f = $t.data('for'); // loses scope, so we use data-for

								if (f === 'hour') {
									if (ap.indexOf('p') !== -1 && n < 12) {
										n += 12;
									}
									else {
										if (ap.indexOf('a') !== -1 && n === 12) {
											n = 0;
										}
									}
								}

								tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);

								tp_inst._onTimeChange();
								tp_inst._onSelectHandler();
							}).css({
								cursor: 'pointer',
								width: (100 / gridSize[litem]) + '%',
								textAlign: 'center',
								overflow: 'hidden'
							});
					} // end if grid > 0
				} // end for loop

				// Add timezone options
				this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select");
				$.fn.append.apply(this.timezone_select,
				$.map(o.timezoneList, function (val, idx) {
					return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val);
				}));
				if (typeof(this.timezone) !== "undefined" && this.timezone !== null && this.timezone !== "") {
					var local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1;
					if (local_timezone === this.timezone) {
						selectLocalTimezone(tp_inst);
					} else {
						this.timezone_select.val(this.timezone);
					}
				} else {
					if (typeof(this.hour) !== "undefined" && this.hour !== null && this.hour !== "") {
						this.timezone_select.val(o.timezone);
					} else {
						selectLocalTimezone(tp_inst);
					}
				}
				this.timezone_select.on('change', function () {
					tp_inst._onTimeChange();
					tp_inst._onSelectHandler();
				});
				// End timezone options

				// inject timepicker into datepicker
				var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
				if ($buttonPanel.length) {
					$buttonPanel.before($tp);
				} else {
					$dp.append($tp);
				}

				this.$timeObj = $tp.find('.ui_tpicker_time');

				if (this.inst !== null) {
					var timeDefined = this.timeDefined;
					this._onTimeChange();
					this.timeDefined = timeDefined;
				}

				// slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
				if (this._defaults.addSliderAccess) {
					var sliderAccessArgs = this._defaults.sliderAccessArgs,
						rtl = this._defaults.isRTL;
					sliderAccessArgs.isRTL = rtl;

					setTimeout(function () { // fix for inline mode
						if ($tp.find('.ui-slider-access').length === 0) {
							$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);

							// fix any grids since sliders are shorter
							var sliderAccessWidth = $tp.find('.ui-slider-access').eq(0).outerWidth(true);
							if (sliderAccessWidth) {
								$tp.find('table:visible').each(function () {
									var $g = $(this),
										oldWidth = $g.outerWidth(),
										oldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''),
										newWidth = oldWidth - sliderAccessWidth,
										newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',
										css = { width: newWidth, marginRight: 0, marginLeft: 0 };
									css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft;
									$g.css(css);
								});
							}
						}
					}, 10);
				}
				// end slideAccess integration

				tp_inst._limitMinMaxDateTime(this.inst, true);
			}
		},

		/*
		* This function tries to limit the ability to go outside the
		* min/max date range
		*/
		_limitMinMaxDateTime: function (dp_inst, adjustSliders) {
			var o = this._defaults,
				dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);

			if (!this._defaults.showTimepicker) {
				return;
			} // No time so nothing to check here

			if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) {
				var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
					minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);

				if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) {
					this.hourMinOriginal = o.hourMin;
					this.minuteMinOriginal = o.minuteMin;
					this.secondMinOriginal = o.secondMin;
					this.millisecMinOriginal = o.millisecMin;
					this.microsecMinOriginal = o.microsecMin;
				}

				if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) {
					this._defaults.hourMin = minDateTime.getHours();
					if (this.hour <= this._defaults.hourMin) {
						this.hour = this._defaults.hourMin;
						this._defaults.minuteMin = minDateTime.getMinutes();
						if (this.minute <= this._defaults.minuteMin) {
							this.minute = this._defaults.minuteMin;
							this._defaults.secondMin = minDateTime.getSeconds();
							if (this.second <= this._defaults.secondMin) {
								this.second = this._defaults.secondMin;
								this._defaults.millisecMin = minDateTime.getMilliseconds();
								if (this.millisec <= this._defaults.millisecMin) {
									this.millisec = this._defaults.millisecMin;
									this._defaults.microsecMin = minDateTime.getMicroseconds();
								} else {
									if (this.microsec < this._defaults.microsecMin) {
										this.microsec = this._defaults.microsecMin;
									}
									this._defaults.microsecMin = this.microsecMinOriginal;
								}
							} else {
								this._defaults.millisecMin = this.millisecMinOriginal;
								this._defaults.microsecMin = this.microsecMinOriginal;
							}
						} else {
							this._defaults.secondMin = this.secondMinOriginal;
							this._defaults.millisecMin = this.millisecMinOriginal;
							this._defaults.microsecMin = this.microsecMinOriginal;
						}
					} else {
						this._defaults.minuteMin = this.minuteMinOriginal;
						this._defaults.secondMin = this.secondMinOriginal;
						this._defaults.millisecMin = this.millisecMinOriginal;
						this._defaults.microsecMin = this.microsecMinOriginal;
					}
				} else {
					this._defaults.hourMin = this.hourMinOriginal;
					this._defaults.minuteMin = this.minuteMinOriginal;
					this._defaults.secondMin = this.secondMinOriginal;
					this._defaults.millisecMin = this.millisecMinOriginal;
					this._defaults.microsecMin = this.microsecMinOriginal;
				}
			}

			if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) {
				var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
					maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);

				if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) {
					this.hourMaxOriginal = o.hourMax;
					this.minuteMaxOriginal = o.minuteMax;
					this.secondMaxOriginal = o.secondMax;
					this.millisecMaxOriginal = o.millisecMax;
					this.microsecMaxOriginal = o.microsecMax;
				}

				if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) {
					this._defaults.hourMax = maxDateTime.getHours();
					if (this.hour >= this._defaults.hourMax) {
						this.hour = this._defaults.hourMax;
						this._defaults.minuteMax = maxDateTime.getMinutes();
						if (this.minute >= this._defaults.minuteMax) {
							this.minute = this._defaults.minuteMax;
							this._defaults.secondMax = maxDateTime.getSeconds();
							if (this.second >= this._defaults.secondMax) {
								this.second = this._defaults.secondMax;
								this._defaults.millisecMax = maxDateTime.getMilliseconds();
								if (this.millisec >= this._defaults.millisecMax) {
									this.millisec = this._defaults.millisecMax;
									this._defaults.microsecMax = maxDateTime.getMicroseconds();
								} else {
									if (this.microsec > this._defaults.microsecMax) {
										this.microsec = this._defaults.microsecMax;
									}
									this._defaults.microsecMax = this.microsecMaxOriginal;
								}
							} else {
								this._defaults.millisecMax = this.millisecMaxOriginal;
								this._defaults.microsecMax = this.microsecMaxOriginal;
							}
						} else {
							this._defaults.secondMax = this.secondMaxOriginal;
							this._defaults.millisecMax = this.millisecMaxOriginal;
							this._defaults.microsecMax = this.microsecMaxOriginal;
						}
					} else {
						this._defaults.minuteMax = this.minuteMaxOriginal;
						this._defaults.secondMax = this.secondMaxOriginal;
						this._defaults.millisecMax = this.millisecMaxOriginal;
						this._defaults.microsecMax = this.microsecMaxOriginal;
					}
				} else {
					this._defaults.hourMax = this.hourMaxOriginal;
					this._defaults.minuteMax = this.minuteMaxOriginal;
					this._defaults.secondMax = this.secondMaxOriginal;
					this._defaults.millisecMax = this.millisecMaxOriginal;
					this._defaults.microsecMax = this.microsecMaxOriginal;
				}
			}

			if (adjustSliders !== undefined && adjustSliders === true) {
				var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
					minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
					secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),
					millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10),
					microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10);

				if (this.hour_slider) {
					this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax });
					this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));
				}
				if (this.minute_slider) {
					this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax });
					this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));
				}
				if (this.second_slider) {
					this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax });
					this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));
				}
				if (this.millisec_slider) {
					this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax });
					this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));
				}
				if (this.microsec_slider) {
					this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax });
					this.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec));
				}
			}

		},

		/*
		* when a slider moves, set the internal time...
		* on time change is also called when the time is updated in the text field
		*/
		_onTimeChange: function () {
			if (!this._defaults.showTimepicker) {
                                return;
			}
			var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
				minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
				second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
				millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
				microsec = (this.microsec_slider) ? this.control.value(this, this.microsec_slider, 'microsec') : false,
				timezone = (this.timezone_select) ? this.timezone_select.val() : false,
				o = this._defaults,
				pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
				pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;

			if (typeof(hour) === 'object') {
				hour = false;
			}
			if (typeof(minute) === 'object') {
				minute = false;
			}
			if (typeof(second) === 'object') {
				second = false;
			}
			if (typeof(millisec) === 'object') {
				millisec = false;
			}
			if (typeof(microsec) === 'object') {
				microsec = false;
			}
			if (typeof(timezone) === 'object') {
				timezone = false;
			}

			if (hour !== false) {
				hour = parseInt(hour, 10);
			}
			if (minute !== false) {
				minute = parseInt(minute, 10);
			}
			if (second !== false) {
				second = parseInt(second, 10);
			}
			if (millisec !== false) {
				millisec = parseInt(millisec, 10);
			}
			if (microsec !== false) {
				microsec = parseInt(microsec, 10);
			}
			if (timezone !== false) {
				timezone = timezone.toString();
			}

			var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];

			// If the update was done in the input field, the input field should not be updated.
			// If the update was done using the sliders, update the input field.
			var hasChanged = (
						hour !== parseInt(this.hour,10) || // sliders should all be numeric
						minute !== parseInt(this.minute,10) ||
						second !== parseInt(this.second,10) ||
						millisec !== parseInt(this.millisec,10) ||
						microsec !== parseInt(this.microsec,10) ||
						(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
						(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
					);

			if (hasChanged) {

				if (hour !== false) {
					this.hour = hour;
				}
				if (minute !== false) {
					this.minute = minute;
				}
				if (second !== false) {
					this.second = second;
				}
				if (millisec !== false) {
					this.millisec = millisec;
				}
				if (microsec !== false) {
					this.microsec = microsec;
				}
				if (timezone !== false) {
					this.timezone = timezone;
				}

				if (!this.inst) {
					this.inst = $.datepicker._getInst(this.$input[0]);
				}

				this._limitMinMaxDateTime(this.inst, true);
			}
			if (this.support.ampm) {
				this.ampm = ampm;
			}

			// Updates the time within the timepicker
			this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
			if (this.$timeObj) {
				if (pickerTimeFormat === o.timeFormat) {
					this.$timeObj.text(this.formattedTime + pickerTimeSuffix);
				}
				else {
					this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
				}
			}

			this.timeDefined = true;
			if (hasChanged) {
				this._updateDateTime();
				this.$input.trigger('focus');
			}
		},

		/*
		* call custom onSelect.
		* bind to sliders slidestop, and grid click.
		*/
		_onSelectHandler: function () {
			var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
			var inputEl = this.$input ? this.$input[0] : null;
			if (onSelect && inputEl) {
				onSelect.apply(inputEl, [this.formattedDateTime, this]);
			}
		},

		/*
		* update our input with the new date time..
		*/
		_updateDateTime: function (dp_inst) {
			dp_inst = this.inst || dp_inst;
			var dtTmp = (dp_inst.currentYear > 0?
							new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
							new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
				dt = $.datepicker._daylightSavingAdjust(dtTmp),
				//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
				//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)),
				dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
				formatCfg = $.datepicker._getFormatConfig(dp_inst),
				timeAvailable = dt !== null && this.timeDefined;
			this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
			var formattedDateTime = this.formattedDate;

			// if a slider was changed but datepicker doesn't have a value yet, set it
			if (dp_inst.lastVal === "") {
                dp_inst.currentYear = dp_inst.selectedYear;
                dp_inst.currentMonth = dp_inst.selectedMonth;
                dp_inst.currentDay = dp_inst.selectedDay;
            }

			/*
			* remove following lines to force every changes in date picker to change the input value
			* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
			* If the user manually empty the value in the input field, the date picker will never change selected value.
			*/
			//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
			//	return;
			//}

			if (this._defaults.timeOnly === true) {
				formattedDateTime = this.formattedTime;
			} else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
				formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
			}

			this.formattedDateTime = formattedDateTime;

			if (!this._defaults.showTimepicker) {
				this.$input.val(this.formattedDate);
			} else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
				this.$altInput.val(this.formattedTime);
				this.$input.val(this.formattedDate);
			} else if (this.$altInput) {
				this.$input.val(formattedDateTime);
				var altFormattedDateTime = '',
					altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
					altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;

				if (!this._defaults.timeOnly) {
					if (this._defaults.altFormat) {
						altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
					}
					else {
						altFormattedDateTime = this.formattedDate;
					}

					if (altFormattedDateTime) {
						altFormattedDateTime += altSeparator;
					}
				}

				if (this._defaults.altTimeFormat) {
					altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;
				}
				else {
					altFormattedDateTime += this.formattedTime + altTimeSuffix;
				}
				this.$altInput.val(altFormattedDateTime);
			} else {
				this.$input.val(formattedDateTime);
			}

			this.$input.trigger("change");
		},

		_onFocus: function () {
			if (!this.$input.val() && this._defaults.defaultValue) {
				this.$input.val(this._defaults.defaultValue);
				var inst = $.datepicker._getInst(this.$input.get(0)),
					tp_inst = $.datepicker._get(inst, 'timepicker');
				if (tp_inst) {
					if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
						try {
							$.datepicker._updateDatepicker(inst);
						} catch (err) {
							$.timepicker.log(err);
						}
					}
				}
			}
		},

		/*
		* Small abstraction to control types
		* We can add more, just be sure to follow the pattern: create, options, value
		*/
		_controls: {
			// slider methods
			slider: {
				create: function (tp_inst, obj, unit, val, min, max, step) {
					var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60
					return obj.prop('slide', null).slider({
						orientation: "horizontal",
						value: rtl ? val * -1 : val,
						min: rtl ? max * -1 : min,
						max: rtl ? min * -1 : max,
						step: step,
						slide: function (event, ui) {
							tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);
							tp_inst._onTimeChange();
						},
						stop: function (event, ui) {
							tp_inst._onSelectHandler();
						}
					});
				},
				options: function (tp_inst, obj, unit, opts, val) {
					if (tp_inst._defaults.isRTL) {
						if (typeof(opts) === 'string') {
							if (opts === 'min' || opts === 'max') {
								if (val !== undefined) {
									return obj.slider(opts, val * -1);
								}
								return Math.abs(obj.slider(opts));
							}
							return obj.slider(opts);
						}
						var min = opts.min,
							max = opts.max;
						opts.min = opts.max = null;
						if (min !== undefined) {
							opts.max = min * -1;
						}
						if (max !== undefined) {
							opts.min = max * -1;
						}
						return obj.slider(opts);
					}
					if (typeof(opts) === 'string' && val !== undefined) {
						return obj.slider(opts, val);
					}
					return obj.slider(opts);
				},
				value: function (tp_inst, obj, unit, val) {
					if (tp_inst._defaults.isRTL) {
						if (val !== undefined) {
							return obj.slider('value', val * -1);
						}
						return Math.abs(obj.slider('value'));
					}
					if (val !== undefined) {
						return obj.slider('value', val);
					}
					return obj.slider('value');
				}
			},
			// select methods
			select: {
				create: function (tp_inst, obj, unit, val, min, max, step) {
					var sel = '<select class="ui-timepicker-select" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
						format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;

					for (var i = min; i <= max; i += step) {
						sel += '<option value="' + i + '"' + (i === val ? ' selected' : '') + '>';
						if (unit === 'hour') {
							sel += $.datepicker.formatTime(format.replace(/[^ht ]/ig, '').trim(), {hour: i}, tp_inst._defaults);
						}
						else if (unit === 'millisec' || unit === 'microsec' || i >= 10) { sel += i; }
						else {sel += '0' + i.toString(); }
						sel += '</option>';
					}
					sel += '</select>';

					obj.children('select').remove();

					$(sel).appendTo(obj).on('change', function (e) {
						tp_inst._onTimeChange();
						tp_inst._onSelectHandler();
					});

					return obj;
				},
				options: function (tp_inst, obj, unit, opts, val) {
					var o = {},
						$t = obj.children('select');
					if (typeof(opts) === 'string') {
						if (val === undefined) {
							return $t.data(opts);
						}
						o[opts] = val;
					}
					else { o = opts; }
					return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
				},
				value: function (tp_inst, obj, unit, val) {
					var $t = obj.children('select');
					if (val !== undefined) {
						return $t.val(val);
					}
					return $t.val();
				}
			}
		} // end _controls

	});

	$.fn.extend({
		/*
		* shorthand just to use timepicker.
		*/
		timepicker: function (o) {
			o = o || {};
			var tmp_args = Array.prototype.slice.call(arguments);

			if (typeof o === 'object') {
				tmp_args[0] = $.extend(o, {
					timeOnly: true
				});
			}

			return $(this).each(function () {
				$.fn.datetimepicker.apply($(this), tmp_args);
			});
		},

		/*
		* extend timepicker to datepicker
		*/
		datetimepicker: function (o) {
			o = o || {};
			var tmp_args = arguments;

			if (typeof(o) === 'string') {
				if (o === 'getDate') {
					return $.fn.datepicker.apply($(this[0]), tmp_args);
				} else {
					return this.each(function () {
						var $t = $(this);
						$t.datepicker.apply($t, tmp_args);
					});
				}
			} else {
				return this.each(function () {
					var $t = $(this);
					$t.datepicker($.timepicker._newInst($t, o)._defaults);
				});
			}
		}
	});

	/*
	* Public Utility to parse date and time
	*/
	$.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
		var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
		if (parseRes.timeObj) {
			var t = parseRes.timeObj;
			parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
			parseRes.date.setMicroseconds(t.microsec);
		}

		return parseRes.date;
	};

	/*
	* Public utility to parse time
	*/
	$.datepicker.parseTime = function (timeFormat, timeString, options) {
		var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}),
			iso8601 = (timeFormat.replace(/\'.*?\'/g, '').indexOf('Z') !== -1);

		// Strict parse requires the timeString to match the timeFormat exactly
		var strictParse = function (f, s, o) {

			// pattern for standard and localized AM/PM markers
			var getPatternAmpm = function (amNames, pmNames) {
				var markers = [];
				if (amNames) {
					$.merge(markers, amNames);
				}
				if (pmNames) {
					$.merge(markers, pmNames);
				}
				markers = $.map(markers, function (val) {
					return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&');
				});
				return '(' + markers.join('|') + ')?';
			};

			// figure out position of time elements.. cause js cant do named captures
			var getFormatPositions = function (timeFormat) {
				var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),
					orders = {
						h: -1,
						m: -1,
						s: -1,
						l: -1,
						c: -1,
						t: -1,
						z: -1
					};

				if (finds) {
					for (var i = 0; i < finds.length; i++) {
						if (orders[finds[i].toString().charAt(0)] === -1) {
							orders[finds[i].toString().charAt(0)] = i + 1;
						}
					}
				}
				return orders;
			};

			var regstr = '^' + f.toString()
					.replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
							var ml = match.length;
							switch (match.charAt(0).toLowerCase()) {
							case 'h':
								return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
							case 'm':
								return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
							case 's':
								return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
							case 'l':
								return '(\\d?\\d?\\d)';
							case 'c':
								return '(\\d?\\d?\\d)';
							case 'z':
								return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
							case 't':
								return getPatternAmpm(o.amNames, o.pmNames);
							default:    // literal escaped in quotes
								return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?';
							}
						})
					.replace(/\s/g, '\\s?') +
					o.timeSuffix + '$',
				order = getFormatPositions(f),
				ampm = '',
				treg;

			treg = s.match(new RegExp(regstr, 'i'));

			var resTime = {
				hour: 0,
				minute: 0,
				second: 0,
				millisec: 0,
				microsec: 0
			};

			if (treg) {
				if (order.t !== -1) {
					if (treg[order.t] === undefined || treg[order.t].length === 0) {
						ampm = '';
						resTime.ampm = '';
					} else {
						ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? 'AM' : 'PM';
						resTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0];
					}
				}

				if (order.h !== -1) {
					if (ampm === 'AM' && treg[order.h] === '12') {
						resTime.hour = 0; // 12am = 0 hour
					} else {
						if (ampm === 'PM' && treg[order.h] !== '12') {
							resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12
						} else {
							resTime.hour = Number(treg[order.h]);
						}
					}
				}

				if (order.m !== -1) {
					resTime.minute = Number(treg[order.m]);
				}
				if (order.s !== -1) {
					resTime.second = Number(treg[order.s]);
				}
				if (order.l !== -1) {
					resTime.millisec = Number(treg[order.l]);
				}
				if (order.c !== -1) {
					resTime.microsec = Number(treg[order.c]);
				}
				if (order.z !== -1 && treg[order.z] !== undefined) {
					resTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z]);
				}


				return resTime;
			}
			return false;
		};// end strictParse

		// First try JS Date, if that fails, use strictParse
		var looseParse = function (f, s, o) {
			try {
				var d = new Date('2012-01-01 ' + s);
				if (isNaN(d.getTime())) {
					d = new Date('2012-01-01T' + s);
					if (isNaN(d.getTime())) {
						d = new Date('01/01/2012 ' + s);
						if (isNaN(d.getTime())) {
							throw "Unable to parse time with native Date: " + s;
						}
					}
				}

				return {
					hour: d.getHours(),
					minute: d.getMinutes(),
					second: d.getSeconds(),
					millisec: d.getMilliseconds(),
					microsec: d.getMicroseconds(),
					timezone: d.getTimezoneOffset() * -1
				};
			}
			catch (err) {
				try {
					return strictParse(f, s, o);
				}
				catch (err2) {
					$.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f);
				}
			}
			return false;
		}; // end looseParse

		if (typeof o.parse === "function") {
			return o.parse(timeFormat, timeString, o);
		}
		if (o.parse === 'loose') {
			return looseParse(timeFormat, timeString, o);
		}
		return strictParse(timeFormat, timeString, o);
	};

	/**
	 * Public utility to format the time
	 * @param {string} format format of the time
	 * @param {Object} time Object not a Date for timezones
	 * @param {Object} [options] essentially the regional[].. amNames, pmNames, ampm
	 * @returns {string} the formatted time
	 */
	$.datepicker.formatTime = function (format, time, options) {
		options = options || {};
		options = $.extend({}, $.timepicker._defaults, options);
		time = $.extend({
			hour: 0,
			minute: 0,
			second: 0,
			millisec: 0,
			microsec: 0,
			timezone: null
		}, time);

		var tmptime = format,
			ampmName = options.amNames[0],
			hour = parseInt(time.hour, 10);

		if (hour > 11) {
			ampmName = options.pmNames[0];
		}

		tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
			switch (match) {
			case 'HH':
				return ('0' + hour).slice(-2);
			case 'H':
				return hour;
			case 'hh':
				return ('0' + convert24to12(hour)).slice(-2);
			case 'h':
				return convert24to12(hour);
			case 'mm':
				return ('0' + time.minute).slice(-2);
			case 'm':
				return time.minute;
			case 'ss':
				return ('0' + time.second).slice(-2);
			case 's':
				return time.second;
			case 'l':
				return ('00' + time.millisec).slice(-3);
			case 'c':
				return ('00' + time.microsec).slice(-3);
			case 'z':
				return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);
			case 'Z':
				return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);
			case 'T':
				return ampmName.charAt(0).toUpperCase();
			case 'TT':
				return ampmName.toUpperCase();
			case 't':
				return ampmName.charAt(0).toLowerCase();
			case 'tt':
				return ampmName.toLowerCase();
			default:
				return match.replace(/'/g, "");
			}
		});

		return tmptime;
	};

	/*
	* the bad hack :/ override datepicker so it doesn't close on select
	// inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378
	*/
	$.datepicker._base_selectDate = $.datepicker._selectDate;
	$.datepicker._selectDate = function (id, dateStr) {
		var inst = this._getInst($(id)[0]),
			tp_inst = this._get(inst, 'timepicker');

		if (tp_inst) {
			tp_inst._limitMinMaxDateTime(inst, true);
			inst.inline = inst.stay_open = true;
			//This way the onSelect handler called from calendarpicker get the full dateTime
			this._base_selectDate(id, dateStr);
			inst.inline = inst.stay_open = false;
			this._notifyChange(inst);
			this._updateDatepicker(inst);
		} else {
			this._base_selectDate(id, dateStr);
		}
	};

	/*
	* second bad hack :/ override datepicker so it triggers an event when changing the input field
	* and does not redraw the datepicker on every selectDate event
	*/
	$.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
	$.datepicker._updateDatepicker = function (inst) {

		// don't popup the datepicker if there is another instance already opened
		var input = inst.input[0];
		if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {
			return;
		}

		if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {

			this._base_updateDatepicker(inst);

			// Reload the time control when changing something in the input text field.
			var tp_inst = this._get(inst, 'timepicker');
			if (tp_inst) {
				tp_inst._addTimePicker(inst);
			}
		}
	};

	/*
	* third bad hack :/ override datepicker so it allows spaces and colon in the input field
	*/
	$.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
	$.datepicker._doKeyPress = function (event) {
		var inst = $.datepicker._getInst(event.target),
			tp_inst = $.datepicker._get(inst, 'timepicker');

		if (tp_inst) {
			if ($.datepicker._get(inst, 'constrainInput')) {
				var ampm = tp_inst.support.ampm,
					tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone,
					dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
					datetimeChars = tp_inst._defaults.timeFormat.toString()
											.replace(/[hms]/g, '')
											.replace(/TT/g, ampm ? 'APM' : '')
											.replace(/Tt/g, ampm ? 'AaPpMm' : '')
											.replace(/tT/g, ampm ? 'AaPpMm' : '')
											.replace(/T/g, ampm ? 'AP' : '')
											.replace(/tt/g, ampm ? 'apm' : '')
											.replace(/t/g, ampm ? 'ap' : '') +
											" " + tp_inst._defaults.separator +
											tp_inst._defaults.timeSuffix +
											(tz ? tp_inst._defaults.timezoneList.join('') : '') +
											(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
											dateChars,
					chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
				return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
			}
		}

		return $.datepicker._base_doKeyPress(event);
	};

	/*
	* Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField
	* Update any alternate field to synchronise with the main field.
	*/
	$.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
	$.datepicker._updateAlternate = function (inst) {
		var tp_inst = this._get(inst, 'timepicker');
		if (tp_inst) {
			var altField = tp_inst._defaults.altField;
			if (altField) { // update alternate field too
				var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
					date = this._getDate(inst),
					formatCfg = $.datepicker._getFormatConfig(inst),
					altFormattedDateTime = '',
					altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
					altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
					altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;

				altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
				if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
					if (tp_inst._defaults.altFormat) {
						altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime;
					}
					else {
						altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;
					}
				}
				$(altField).val(altFormattedDateTime);
			}
		}
		else {
			$.datepicker._base_updateAlternate(inst);
		}
	};

	/*
	* Override key up event to sync manual input changes.
	*/
	$.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
	$.datepicker._doKeyUp = function (event) {
		var inst = $.datepicker._getInst(event.target),
			tp_inst = $.datepicker._get(inst, 'timepicker');

		if (tp_inst) {
			if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
				try {
					$.datepicker._updateDatepicker(inst);
				} catch (err) {
					$.timepicker.log(err);
				}
			}
		}

		return $.datepicker._base_doKeyUp(event);
	};

	/*
	* override "Today" button to also grab the time.
	*/
	$.datepicker._base_gotoToday = $.datepicker._gotoToday;
	$.datepicker._gotoToday = function (id) {
		var inst = this._getInst($(id)[0]),
			$dp = inst.dpDiv;
		this._base_gotoToday(id);
		var tp_inst = this._get(inst, 'timepicker');
		selectLocalTimezone(tp_inst);
		var now = new Date();
		this._setTime(inst, now);
		$('.ui-datepicker-today', $dp).trigger('click');
	};

	/*
	* Disable & enable the Time in the datetimepicker
	*/
	$.datepicker._disableTimepickerDatepicker = function (target) {
		var inst = this._getInst(target);
		if (!inst) {
			return;
		}

		var tp_inst = this._get(inst, 'timepicker');
		$(target).datepicker('getDate'); // Init selected[Year|Month|Day]
		if (tp_inst) {
			inst.settings.showTimepicker = false;
			tp_inst._defaults.showTimepicker = false;
			tp_inst._updateDateTime(inst);
		}
	};

	$.datepicker._enableTimepickerDatepicker = function (target) {
		var inst = this._getInst(target);
		if (!inst) {
			return;
		}

		var tp_inst = this._get(inst, 'timepicker');
		$(target).datepicker('getDate'); // Init selected[Year|Month|Day]
		if (tp_inst) {
			inst.settings.showTimepicker = true;
			tp_inst._defaults.showTimepicker = true;
			tp_inst._addTimePicker(inst); // Could be disabled on page load
			tp_inst._updateDateTime(inst);
		}
	};

	/*
	* Create our own set time function
	*/
	$.datepicker._setTime = function (inst, date) {
		var tp_inst = this._get(inst, 'timepicker');
		if (tp_inst) {
			var defaults = tp_inst._defaults;

			// calling _setTime with no date sets time to defaults
			tp_inst.hour = date ? date.getHours() : defaults.hour;
			tp_inst.minute = date ? date.getMinutes() : defaults.minute;
			tp_inst.second = date ? date.getSeconds() : defaults.second;
			tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
			tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;

			//check if within min/max times..
			tp_inst._limitMinMaxDateTime(inst, true);

			tp_inst._onTimeChange();
			tp_inst._updateDateTime(inst);
		}
	};

	/*
	* Create new public method to set only time, callable as $().datepicker('setTime', date)
	*/
	$.datepicker._setTimeDatepicker = function (target, date, withDate) {
		var inst = this._getInst(target);
		if (!inst) {
			return;
		}

		var tp_inst = this._get(inst, 'timepicker');

		if (tp_inst) {
			this._setDateFromField(inst);
			var tp_date;
			if (date) {
				if (typeof date === "string") {
					tp_inst._parseTime(date, withDate);
					tp_date = new Date();
					tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
					tp_date.setMicroseconds(tp_inst.microsec);
				} else {
					tp_date = new Date(date.getTime());
					tp_date.setMicroseconds(date.getMicroseconds());
				}
				if (tp_date.toString() === 'Invalid Date') {
					tp_date = undefined;
				}
				this._setTime(inst, tp_date);
			}
		}

	};

	/*
	* override setDate() to allow setting time too within Date object
	*/
	$.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
	$.datepicker._setDateDatepicker = function (target, date) {
		var inst = this._getInst(target);
		if (!inst) {
			return;
		}

		if (typeof(date) === 'string') {
			date = new Date(date);
			if (!date.getTime()) {
				$.timepicker.log("Error creating Date object from string.");
			}
		}

		var tp_inst = this._get(inst, 'timepicker');
		var tp_date;
		if (date instanceof Date) {
			tp_date = new Date(date.getTime());
			tp_date.setMicroseconds(date.getMicroseconds());
		} else {
			tp_date = date;
		}

		// This is important if you are using the timezone option, javascript's Date
		// object will only return the timezone offset for the current locale, so we
		// adjust it accordingly.  If not using timezone option this won't matter..
		// If a timezone is different in tp, keep the timezone as is
		if (tp_inst && tp_date) {
			// look out for DST if tz wasn't specified
			if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
				tp_inst.timezone = tp_date.getTimezoneOffset() * -1;
			}
			date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
			tp_date = $.timepicker.timezoneAdjust(tp_date, tp_inst.timezone);
		}

		this._updateDatepicker(inst);
		this._base_setDateDatepicker.apply(this, arguments);
		this._setTimeDatepicker(target, tp_date, true);
	};

	/*
	* override getDate() to allow getting time too within Date object
	*/
	$.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
	$.datepicker._getDateDatepicker = function (target, noDefault) {
		var inst = this._getInst(target);
		if (!inst) {
			return;
		}

		var tp_inst = this._get(inst, 'timepicker');

		if (tp_inst) {
			// if it hasn't yet been defined, grab from field
			if (inst.lastVal === undefined) {
				this._setDateFromField(inst, noDefault);
			}

			var date = this._getDate(inst);
			if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {
				date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
				date.setMicroseconds(tp_inst.microsec);

				// This is important if you are using the timezone option, javascript's Date
				// object will only return the timezone offset for the current locale, so we
				// adjust it accordingly.  If not using timezone option this won't matter..
				if (tp_inst.timezone != null) {
					// look out for DST if tz wasn't specified
					if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
						tp_inst.timezone = date.getTimezoneOffset() * -1;
					}
					date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
				}
			}
			return date;
		}
		return this._base_getDateDatepicker(target, noDefault);
	};

	/*
	* override parseDate() because UI 1.8.14 throws an error about "Extra characters"
	* An option in datapicker to ignore extra format characters would be nicer.
	*/
	$.datepicker._base_parseDate = $.datepicker.parseDate;
	$.datepicker.parseDate = function (format, value, settings) {
		var date;
		try {
			date = this._base_parseDate(format, value, settings);
		} catch (err) {
			// Hack!  The error message ends with a colon, a space, and
			// the "extra" characters.  We rely on that instead of
			// attempting to perfectly reproduce the parsing algorithm.
			if (err.indexOf(":") >= 0) {
				date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(':') - 2)), settings);
				$.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
			} else {
				throw err;
			}
		}
		return date;
	};

	/*
	* override formatDate to set date with time to the input
	*/
	$.datepicker._base_formatDate = $.datepicker._formatDate;
	$.datepicker._formatDate = function (inst, day, month, year) {
		var tp_inst = this._get(inst, 'timepicker');
		if (tp_inst) {
			tp_inst._updateDateTime(inst);
			return tp_inst.$input.val();
		}
		return this._base_formatDate(inst);
	};

	/*
	* override options setter to add time to maxDate(Time) and minDate(Time). MaxDate
	*/
	$.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
	$.datepicker._optionDatepicker = function (target, name, value) {
		var inst = this._getInst(target),
			name_clone;
		if (!inst) {
			return null;
		}

		var tp_inst = this._get(inst, 'timepicker');
		if (tp_inst) {
			var min = null,
				max = null,
				onselect = null,
				overrides = tp_inst._defaults.evnts,
				fns = {},
				prop;
			if (typeof name === 'string') { // if min/max was set with the string
				if (name === 'minDate' || name === 'minDateTime') {
					min = value;
				} else if (name === 'maxDate' || name === 'maxDateTime') {
					max = value;
				} else if (name === 'onSelect') {
					onselect = value;
				} else if (overrides.hasOwnProperty(name)) {
					if (typeof (value) === 'undefined') {
						return overrides[name];
					}
					fns[name] = value;
					name_clone = {}; //empty results in exiting function after overrides updated
				}
			} else if (typeof name === 'object') { //if min/max was set with the JSON
				if (name.minDate) {
					min = name.minDate;
				} else if (name.minDateTime) {
					min = name.minDateTime;
				} else if (name.maxDate) {
					max = name.maxDate;
				} else if (name.maxDateTime) {
					max = name.maxDateTime;
				}
				for (prop in overrides) {
					if (overrides.hasOwnProperty(prop) && name[prop]) {
						fns[prop] = name[prop];
					}
				}
			}
			for (prop in fns) {
				if (fns.hasOwnProperty(prop)) {
					overrides[prop] = fns[prop];
					if (!name_clone) { name_clone = $.extend({}, name); }
					delete name_clone[prop];
				}
			}
			if (name_clone && isEmptyObject(name_clone)) { return; }
			if (min) { //if min was set
				if (min === 0) {
					min = new Date();
				} else {
					min = new Date(min);
				}
				tp_inst._defaults.minDate = min;
				tp_inst._defaults.minDateTime = min;
			} else if (max) { //if max was set
				if (max === 0) {
					max = new Date();
				} else {
					max = new Date(max);
				}
				tp_inst._defaults.maxDate = max;
				tp_inst._defaults.maxDateTime = max;
			} else if (onselect) {
				tp_inst._defaults.onSelect = onselect;
			}
		}
		if (value === undefined) {
			return this._base_optionDatepicker.call($.datepicker, target, name);
		}
		return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
	};

	/*
	* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
	* it will return false for all objects
	*/
	var isEmptyObject = function (obj) {
		var prop;
		for (prop in obj) {
			if (obj.hasOwnProperty(prop)) {
				return false;
			}
		}
		return true;
	};

	/*
	* jQuery extend now ignores nulls!
	*/
	var extendRemove = function (target, props) {
		$.extend(target, props);
		for (var name in props) {
			if (props[name] === null || props[name] === undefined) {
				target[name] = props[name];
			}
		}
		return target;
	};

	/*
	* Determine by the time format which units are supported
	* Returns an object of booleans for each unit
	*/
	var detectSupport = function (timeFormat) {
		var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals
			isIn = function (f, t) { // does the format contain the token?
					return f.indexOf(t) !== -1 ? true : false;
				};
		return {
				hour: isIn(tf, 'h'),
				minute: isIn(tf, 'm'),
				second: isIn(tf, 's'),
				millisec: isIn(tf, 'l'),
				microsec: isIn(tf, 'c'),
				timezone: isIn(tf, 'z'),
				ampm: isIn(tf, 't') && isIn(timeFormat, 'h'),
				iso8601: isIn(timeFormat, 'Z')
			};
	};

	/*
	* Converts 24 hour format into 12 hour
	* Returns 12 hour without leading 0
	*/
	var convert24to12 = function (hour) {
		hour %= 12;

		if (hour === 0) {
			hour = 12;
		}

		return String(hour);
	};

	var computeEffectiveSetting = function (settings, property) {
		return settings && settings[property] ? settings[property] : $.timepicker._defaults[property];
	};

	/*
	* Splits datetime string into date and time substrings.
	* Throws exception when date can't be parsed
	* Returns {dateString: dateString, timeString: timeString}
	*/
	var splitDateTime = function (dateTimeString, timeSettings) {
		// The idea is to get the number separator occurrences in datetime and the time format requested (since time has
		// fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
		var separator = computeEffectiveSetting(timeSettings, 'separator'),
			format = computeEffectiveSetting(timeSettings, 'timeFormat'),
			timeParts = format.split(separator), // how many occurrences of separator may be in our format?
			timePartsLen = timeParts.length,
			allParts = dateTimeString.split(separator),
			allPartsLen = allParts.length;

		if (allPartsLen > 1) {
			return {
				dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator),
				timeString: allParts.splice(0, timePartsLen).join(separator)
			};
		}

		return {
			dateString: dateTimeString,
			timeString: ''
		};
	};

	/*
	* Internal function to parse datetime interval
	* Returns: {date: Date, timeObj: Object}, where
	*   date - parsed date without time (type Date)
	*   timeObj = {hour: , minute: , second: , millisec: , microsec: } - parsed time. Optional
	*/
	var parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
		var date,
			parts,
			parsedTime;

		parts = splitDateTime(dateTimeString, timeSettings);
		date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings);

		if (parts.timeString === '') {
			return {
				date: date
			};
		}

		parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings);

		if (!parsedTime) {
			throw 'Wrong time format';
		}

		return {
			date: date,
			timeObj: parsedTime
		};
	};

	/*
	* Internal function to set timezone_select to the local timezone
	*/
	var selectLocalTimezone = function (tp_inst, date) {
		if (tp_inst && tp_inst.timezone_select) {
			var now = date || new Date();
			tp_inst.timezone_select.val(-now.getTimezoneOffset());
		}
	};

	/*
	* Create a Singleton Instance
	*/
	$.timepicker = new Timepicker();

	/**
	 * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)
	 * @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned
	 * @param {boolean} iso8601 if true formats in accordance to iso8601 "+12:45"
	 * @return {string}
	 */
	$.timepicker.timezoneOffsetString = function (tzMinutes, iso8601) {
		if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) {
			return tzMinutes;
		}

		var off = tzMinutes,
			minutes = off % 60,
			hours = (off - minutes) / 60,
			iso = iso8601 ? ':' : '',
			tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);

		if (tz === '+00:00') {
			return 'Z';
		}
		return tz;
	};

	/**
	 * Get the number in minutes that represents a timezone string
	 * @param  {string} tzString formatted like "+0500", "-1245", "Z"
	 * @return {number} the offset minutes or the original string if it doesn't match expectations
	 */
	$.timepicker.timezoneOffsetNumber = function (tzString) {
		var normalized = tzString.toString().replace(':', ''); // excuse any iso8601, end up with "+1245"

		if (normalized.toUpperCase() === 'Z') { // if iso8601 with Z, its 0 minute offset
			return 0;
		}

		if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
			return tzString;
		}

		return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
					((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)
					parseInt(normalized.substr(3, 2), 10))); // minutes
	};

	/**
	 * No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)
	 * @param  {Date} date
	 * @param  {string} toTimezone formatted like "+0500", "-1245"
	 * @return {Date}
	 */
	$.timepicker.timezoneAdjust = function (date, toTimezone) {
		var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
		if (!isNaN(toTz)) {
			date.setMinutes(date.getMinutes() + -date.getTimezoneOffset() - toTz);
		}
		return date;
	};

	/**
	 * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to
	 * enforce date range limits.
	 * n.b. The input value must be correctly formatted (reformatting is not supported)
	 * @param  {Element} startTime
	 * @param  {Element} endTime
	 * @param  {Object} options Options for the timepicker() call
	 * @return {jQuery}
	 */
	$.timepicker.timeRange = function (startTime, endTime, options) {
		return $.timepicker.handleRange('timepicker', startTime, endTime, options);
	};

	/**
	 * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to
	 * enforce date range limits.
	 * @param  {Element} startTime
	 * @param  {Element} endTime
	 * @param  {Object} options Options for the `timepicker()` call. Also supports `reformat`,
	 *   a boolean value that can be used to reformat the input values to the `dateFormat`.
	 * @param  {string} method Can be used to specify the type of picker to be added
	 * @return {jQuery}
	 */
	$.timepicker.datetimeRange = function (startTime, endTime, options) {
		$.timepicker.handleRange('datetimepicker', startTime, endTime, options);
	};

	/**
	 * Calls `datepicker` on the `startTime` and `endTime` elements, and configures them to
	 * enforce date range limits.
	 * @param  {Element} startTime
	 * @param  {Element} endTime
	 * @param  {Object} options Options for the `timepicker()` call. Also supports `reformat`,
	 *   a boolean value that can be used to reformat the input values to the `dateFormat`.
	 * @return {jQuery}
	 */
	$.timepicker.dateRange = function (startTime, endTime, options) {
		$.timepicker.handleRange('datepicker', startTime, endTime, options);
	};

	/**
	 * Calls `method` on the `startTime` and `endTime` elements, and configures them to
	 * enforce date range limits.
	 * @param  {string} method Can be used to specify the type of picker to be added
	 * @param  {Element} startTime
	 * @param  {Element} endTime
	 * @param  {Object} options Options for the `timepicker()` call. Also supports `reformat`,
	 *   a boolean value that can be used to reformat the input values to the `dateFormat`.
	 * @return {jQuery}
	 */
	$.timepicker.handleRange = function (method, startTime, endTime, options) {
		options = $.extend({}, {
			minInterval: 0, // min allowed interval in milliseconds
			maxInterval: 0, // max allowed interval in milliseconds
			start: {},      // options for start picker
			end: {}         // options for end picker
		}, options);

		function checkDates(changed, other) {
			var startdt = startTime[method]('getDate'),
				enddt = endTime[method]('getDate'),
				changeddt = changed[method]('getDate');

			if (startdt !== null) {
				var minDate = new Date(startdt.getTime()),
					maxDate = new Date(startdt.getTime());

				minDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval);
				maxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval);

				if (options.minInterval > 0 && minDate > enddt) { // minInterval check
					endTime[method]('setDate', minDate);
				}
				else if (options.maxInterval > 0 && maxDate < enddt) { // max interval check
					endTime[method]('setDate', maxDate);
				}
				else if (startdt > enddt) {
					other[method]('setDate', changeddt);
				}
			}
		}

		function selected(changed, other, option) {
			if (!changed.val()) {
				return;
			}
			var date = changed[method].call(changed, 'getDate');
			if (date !== null && options.minInterval > 0) {
				if (option === 'minDate') {
					date.setMilliseconds(date.getMilliseconds() + options.minInterval);
				}
				if (option === 'maxDate') {
					date.setMilliseconds(date.getMilliseconds() - options.minInterval);
				}
			}
			if (date.getTime) {
				other[method].call(other, 'option', option, date);
			}
		}

		$.fn[method].call(startTime, $.extend({
			onClose: function (dateText, inst) {
				checkDates($(this), endTime);
			},
			onSelect: function (selectedDateTime) {
				selected($(this), endTime, 'minDate');
			}
		}, options, options.start));
		$.fn[method].call(endTime, $.extend({
			onClose: function (dateText, inst) {
				checkDates($(this), startTime);
			},
			onSelect: function (selectedDateTime) {
				selected($(this), startTime, 'maxDate');
			}
		}, options, options.end));

		checkDates(startTime, endTime);
		selected(startTime, endTime, 'minDate');
		selected(endTime, startTime, 'maxDate');
		return $([startTime.get(0), endTime.get(0)]);
	};

	/**
	 * Log error or data to the console during error or debugging
	 * @param  {Object} err pass any type object to log to the console during error or debugging
	 * @return {void}
	 */
	$.timepicker.log = function (err) {
		if (window.console) {
			window.console.log(err);
		}
	};

	/*
	 * Add util object to allow access to private methods for testability.
	 */
	$.timepicker._util = {
		_extendRemove: extendRemove,
		_isEmptyObject: isEmptyObject,
		_convert24to12: convert24to12,
		_detectSupport: detectSupport,
		_selectLocalTimezone: selectLocalTimezone,
		_computeEffectiveSetting: computeEffectiveSetting,
		_splitDateTime: splitDateTime,
		_parseDateTimeInternal: parseDateTimeInternal
	};

	/*
	* Microsecond support
	*/
	if (!Date.prototype.getMicroseconds) {
		Date.prototype.microseconds = 0;
		Date.prototype.getMicroseconds = function () { return this.microseconds; };
		Date.prototype.setMicroseconds = function (m) {
			this.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1000));
			this.microseconds = m % 1000;
			return this;
		};
	}

	/*
	* Keep up with the version
	*/
	$.timepicker.version = "1.4.3";

})(jQuery);ext/jquery.tablesorter.min.js000064400000042015152336404310012333 0ustar00/*
 *
 * TableSorter 2.0 - Client-side table sorting with ease!
 * Version 2.0.5b
 * @requires jQuery v1.2.3
 *
 * Copyright (c) 2007 Christian Bach
 * Examples and docs at: http://tablesorter.com
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Modified to adapt the latest jQuery version (v3 above) included on WordPress 5.6:
 * - (2020-12-28) - jQuery mousedown shorthand is deprecated.
 * - (2021-01-30) - jQuery trim method is deprecated.
 * - (2021-02-01) - Number type value passed to css method is deprecated.
 * - (2021-02-01) - jQuery :first selector is deprecated.
 * - (2021-02-04) - jQuery bind method is deprecated.
 * - (2021-02-04) - jQuery click event shorthand is deprecated.
 */
(function($){$.extend({tablesorter:new
function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,rows,-1,i);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,rows,rowIndex,cellIndex){var l=parsers.length,node=false,nodeValue=false,keepLooking=true;while(nodeValue==''&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug){log('Checking if value was empty on row:'+rowIndex);}}else{keepLooking=false;}}for(var i=1;i<l;i++){if(parsers[i].is(nodeValue,table,node)){return parsers[i];}}return parsers[0];}function getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){return rows[rowIndex].cells[cellIndex];}function trimAndGetNodeText(config,node){return getElementText(config,node).trim();}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=$(table.tBodies[0].rows[i]),cols=[];if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue;}cache.row.push(c);for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]));}cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){var text="";if(!node)return"";if(!config.supportsTextContent)config.supportsTextContent=node.textContent||false;if(config.textExtraction=="simple"){if(config.supportsTextContent){text=node.textContent;}else{if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){text=node.childNodes[0].innerHTML;}else{text=node.innerHTML;}}}else{if(typeof(config.textExtraction)=="function"){text=config.textExtraction(node);}else{text=$(node).text();}}return text;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){var pos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){var l=r[pos].length;for(var j=0;j<l;j++){tableBody[0].appendChild(r[pos][j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false;var header_index=computeTableHeaderCellIndexes(table);$tableHeaders=$(table.config.selectorHeaders,table).each(function(index){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(table.config.sortInitialOrder);this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(checkHeaderOptionsSortingLocked(table,index))this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(table,index);if(!this.sortDisabled){var $th=$(this).addClass(table.config.cssHeader);if(table.config.onRenderHeader)table.config.onRenderHeader.apply($th);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function computeTableHeaderCellIndexes(t){var matrix=[];var lookup={};var thead=t.getElementsByTagName('THEAD')[0];var trs=thead.getElementsByTagName('TR');for(var i=0;i<trs.length;i++){var cells=trs[i].cells;for(var j=0;j<cells.length;j++){var c=cells[j];var rowIndex=c.parentNode.rowIndex;var cellId=rowIndex+"-"+c.cellIndex;var rowSpan=c.rowSpan||1;var colSpan=c.colSpan||1
var firstAvailCol;if(typeof(matrix[rowIndex])=="undefined"){matrix[rowIndex]=[];}for(var k=0;k<matrix[rowIndex].length+1;k++){if(typeof(matrix[rowIndex][k])=="undefined"){firstAvailCol=k;break;}}lookup[cellId]=firstAvailCol;for(var k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(matrix[k])=="undefined"){matrix[k]=[];}var matrixrow=matrix[k];for(var l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x";}}}}return lookup;}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){return(v.toLowerCase()=="desc")?1:0;}else{return(v==1)?1:0;}}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr",table.tBodies[0]).first().find('td').each(function(){colgroup.append($('<col>').css('width',$(this).width()+"px"));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(table.config.parsers[c].type=="text")?((order==0)?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c)):((order==0)?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c));var e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";if(table.config.debug){benchmark("Evaling expression:"+dynamicExp,new Date());}eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function makeSortFunction(type,direction,index){var a="a["+index+"]",b="b["+index+"]";if(type=='text'&&direction=='asc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+a+" < "+b+") ? -1 : 1 )));";}else if(type=='text'&&direction=='desc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+b+" < "+a+") ? -1 : 1 )));";}else if(type=='numeric'&&direction=='asc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+b+"));";}else if(type=='numeric'&&direction=='desc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+b+" - "+a+"));";}};function makeSortText(i){return"((a["+i+"] < b["+i+"]) ? -1 : ((a["+i+"] > b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.on("click",function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).on("mousedown",function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.on("update",function(){var me=this;setTimeout(function(){me.config.parsers=buildParserCache(me,$headers);cache=buildCache(me);},1);}).on("updateCell",function(e,cell){var config=this.config;var pos=[(cell.parentNode.rowIndex-1),cell.cellIndex];cache.normalized[pos[0]][pos[1]]=config.parsers[pos[1]].format(getElementText(config,cell),cell);}).on("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).on("appendCache",function(){appendToTable(this,cache);}).on("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).on("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){return/^[-+]?\d*$/.test(s.replace(/[,.']/g,'').trim());};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return s.toLocaleLowerCase().trim();},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return s.replace(new RegExp(/(https?|ftp|file):\/\//),'').trim();},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test(s.trim());},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if (c.dateFormat == "pt") {s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");} else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}var $tr,row=-1,odd;$("tr:visible",table.tBodies[0]).each(function(i){$tr=$(this);if(!$tr.hasClass(table.config.cssChildRow))row++;odd=(row%2==0);$tr.removeClass(table.config.widgetZebra.css[odd?0:1]).addClass(table.config.widgetZebra.css[odd?1:0])});if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery);ext/wp-color-picker-alpha.js000064400000042125152336404310012007 0ustar00/**
 * wp-color-picker-alpha
 *
 * Version 1.0
 * Copyright (c) 2017 Elegant Themes.
 * Licensed under the GPLv2 license.
 *
 * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
 * Only run in input and is defined data alpha in true
 * Add custom colorpicker UI
 *
 * This is modified version made by Elegant Themes based on the work covered by
 * the following copyright:
 *
 * wp-color-picker-alpha Version: 1.1
 * https://github.com/23r9i0/wp-color-picker-alpha
 * Copyright (c) 2015 Sergio P.A. (23r9i0).
 * Licensed under the GPLv2 license.
 */
( function( $ ) {
	// Variable for some backgrounds
	var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==';
	// html stuff for wpColorPicker copy of the original color-picker.js
	var	_before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',
		_after = '<div class="wp-picker-holder" />',
		_wrap = '<div class="wp-picker-container" />',
		_button = '<input type="button" class="button button-small button-clear hidden" />',
		_wrappingLabel = '<label></label>',
		_wrappingLabelText = '<span class="screen-reader-text"></span>',
		_close_button = '<button type="button" class="button button-confirm" />',
		_close_button_icon = '<div style="fill: #3EF400; width: 25px; height: 25px; margin-top: -1px;"><svg viewBox="0 0 28 28" preserveAspectRatio="xMidYMid meet" shapeRendering="geometricPrecision"><g><path d="M19.203 9.21a.677.677 0 0 0-.98 0l-5.71 5.9-2.85-2.95a.675.675 0 0 0-.98 0l-1.48 1.523a.737.737 0 0 0 0 1.015l4.82 4.979a.677.677 0 0 0 .98 0l7.68-7.927a.737.737 0 0 0 0-1.015l-1.48-1.525z" fillRule="evenodd" /></g></svg></div>';

  // Color picker label translation. By default, set label manually without translation.
  var _defaultString    = 'Default';
  var _defaultAriaLabel = 'Select default color';
  var _clearString      = 'Clear';
  var _clearAriaLabel   = 'Clear color';
  var _colorValue       = 'Color value';
  var _selectColor      = 'Select Color';

  if ('undefined' !== typeof wp && 'undefined' !== typeof wp.i18n && 'undefined' !== typeof wp.i18n.__) {
    // Directly use wp.i18n if it exists. wp.i18n is added on 5.0.
    var __ = wp.i18n.__;
    _defaultString    = __( 'Default' );
    _defaultAriaLabel = __( 'Select default color' );
    _clearString      = __( 'Clear' );
    _clearAriaLabel   = __( 'Clear color' );
    _colorValue       = __( 'Color value' );
    _selectColor      = __( 'Select Color' );
  } else if ('undefined' !== typeof wpColorPickerL10n && 'undefined' !== typeof wpColorPickerL10n.current) {
    // Or use wpColorPickerL10n if it's still supported. wpColorPickerL10n is deprecated
    // since 5.5.
    _defaultString    = wpColorPickerL10n.defaultString;
    _defaultAriaLabel = wpColorPickerL10n.defaultAriaLabel;
    _clearString      = wpColorPickerL10n.clear,
    _clearAriaLabel   = wpColorPickerL10n.clearAriaLabel;
    _colorValue       = wpColorPickerL10n.defaultLabel;
    _selectColor      = wpColorPickerL10n.pick;
  }

	/**
	 * Overwrite Color
	 * for enable support rbga
	 */
	Color.fn.toString = function() {
		if ( this._alpha < 1 )
			return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );

		var hex = parseInt( this._color, 10 ).toString( 16 );

		if ( this.error )
			return '';

		if ( hex.length < 6 ) {
			for ( var i = 6 - hex.length - 1; i >= 0; i-- ) {
				hex = '0' + hex;
			}
		}

		return '#' + hex;
	};

	/**
	 * Overwrite wpColorPicker
	 */
	$.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, {

		_create: function() {
			// Return early if Iris support is missing.
			if ( ! $.support.iris ) {
				return;
			}

			var self = this,
				el = self.element;

			// Override default options with options bound to the element.
			$.extend( self.options, el.data() );

			// Create a color picker which only allows adjustments to the hue.
			if ( self.options.type === 'hue' ) {
				return self._createHueOnly();
			}

			// Bind the close event.
			self.close = self.close.bind(self);

			self.initialValue = el.val();

			// Add a CSS class to the input field.
			el.addClass( 'wp-color-picker' );

			/*
			 * Check if there's already a wrapping label, e.g. in the Customizer.
			 * If there's no label, add a default one to match the Customizer template.
			 */
			if ( ! el.parent( 'label' ).length ) {
				// Wrap the input field in the default label.
				el.wrap( _wrappingLabel );
				// Insert the default label text.
				self.wrappingLabelText = $( _wrappingLabelText )
					.insertBefore( el )
					.text( _colorValue );
			}

			/*
			 * At this point, either it's the standalone version or the Customizer
			 * one, we have a wrapping label to use as hook in the DOM, let's store it.
			 */
			self.wrappingLabel = el.parent();

			// Wrap the label in the main wrapper.
			self.wrappingLabel.wrap( _wrap );
			// Store a reference to the main wrapper.
			self.wrap = self.wrappingLabel.parent();
			// Set up the toggle button and insert it before the wrapping label.
			self.toggler = $( _before )
				.insertBefore( self.wrappingLabel )
				.css( { backgroundColor: self.initialValue } )
				.attr( 'title', _selectColor )
				.addClass( 'et-wp-color-result-updated');

			// some strings were changed in recent colorpicker update, but we still need to use legacy strings in some places
			if ( typeof et_pb_color_picker_strings !== 'undefined' ) {
				self.toggler.attr( 'data-legacy_title', et_pb_color_picker_strings.legacy_pick ).attr( 'data-current', et_pb_color_picker_strings.legacy_current );
			}

			// Set the toggle button span element text.
			self.toggler.find( '.wp-color-result-text' ).text( _selectColor );
			// Set up the Iris container and insert it after the wrapping label.
			self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
			// Store a reference to the Clear/Default button.
			self.button = $( _button );
			self.close_button = $( _close_button ).html( _close_button_icon );

			if ( self.options.diviColorpicker ) {
				el.after( self.close_button );
			}

			// Set up the Clear/Default button.
			if ( self.options.defaultColor ) {
				self.button
					.addClass( 'wp-picker-default' )
					.val( _defaultString )
					.attr( 'aria-label', _defaultAriaLabel );
			} else {
				self.button
					.addClass( 'wp-picker-clear' )
					.val( _clearString )
					.attr( 'aria-label', _clearAriaLabel );
			}

			// Wrap the wrapping label in its wrapper and append the Clear/Default button.
			self.wrappingLabel
				.wrap( '<span class="wp-picker-input-wrap hidden" />' )
				.after( self.button );

			/*
			 * The input wrapper now contains the label+input+Clear/Default button.
			 * Store a reference to the input wrapper: we'll use this to toggle
			 * the controls visibility.
			 */
			self.inputWrapper = el.closest( '.wp-picker-input-wrap' );

			/*
			 * CSS for support < 4.9
			 */
			self.toggler.css({
				'height': '24px',
				'margin': '0 6px 6px 0',
				'padding': '0 0 0 30px',
				'font-size': '11px'
			});


			el.iris( {
				target: self.pickerContainer,
				hide: self.options.hide,
				width: self.options.width,
				height: self.options.height,
				mode: self.options.mode,
				palettes: self.options.palettes,
				diviColorpicker: self.options.diviColorpicker,
				change: function( event, ui ) {
					if ( self.options.alpha ) {
						self.toggler.css( {
							'background-image' : 'url(' + image + ')',
							'position' : 'relative'
						} );
						if ( self.toggler.find('span.color-alpha').length == 0 ) {
							self.toggler.append('<span class="color-alpha" />');
						}
						self.toggler.find( 'span.color-alpha' ).css( {
							'width'                     : '100%',
							'height'                    : '100%',
							'position'                  : 'absolute',
							'top'                       : '0px',
							'left'                      : '0px',
							'border-top-left-radius'    : '3px',
							'border-bottom-left-radius' : '3px',
							'background'                : ui.color.toString()
						} );
					} else {
						self.toggler.css( { backgroundColor: ui.color.toString() } );
					}

					// check for a custom cb
					if ( 'function' === typeof self.options.change ) {
						self.options.change.call( this, event, ui );
					}
				}
			} );

			el.val( self.initialValue );
			self._addListeners();

			// Force the color picker to always be closed on initial load.
			if ( ! self.options.hide ) {
				self.toggler.trigger('click');
			}
		},

		_addListeners: function() {
			var self = this;

			// Prevent any clicks inside this widget from leaking to the top and closing it.
			self.wrap.on( 'click.wpcolorpicker', function( event ) {
				event.stopPropagation();
				return false;
			});

			self.toggler.on('click', function() {
				if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
					self.close();
				} else {
					self.open();
				}
			});

			self.element.on( 'change', function( event ) {
				// Empty or Error = clear
				if ( $( this ).val() === '' || self.element.hasClass( 'iris-error' ) ) {
					if ( self.options.alpha ) {
						self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
					} else {
						self.toggler.css( 'backgroundColor', '' );
					}

					// fire clear callback if we have one
					if ( 'function' === typeof self.options.clear )
						self.options.clear.call( this, event );
				}
			} );

			self.button.on( 'click', function( event ) {
				if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
					self.element.val( '' );
					if ( self.options.alpha ) {
						self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
					} else {
						self.toggler.css( 'backgroundColor', '' );
					}

					if ( 'function' === typeof self.options.clear )
						self.options.clear.call( this, event );

				} else if ( $( this ).hasClass( 'wp-picker-default' ) ) {
					self.element.val( self.options.defaultColor ).trigger('change');
				}
			});

			self.close_button.on('click', function(event) {
				event.preventDefault();
				self.close();
			});
		},

		close: function() {
			this._super();
			var self = this;

			if ('function' === typeof self.options.onClose) {
				self.options.onClose.call(this);
			}
		},
	});

	/**
	 * Overwrite iris
	 */
	$.widget( 'a8c.iris', $.a8c.iris, {
		_create: function() {
			this._super();

			// Global option for check is mode rbga is enabled
			this.options.alpha = this.element.data( 'alpha' ) || false;

			// Is not input disabled
			if ( ! this.element.is( ':input' ) ) {
				this.options.alpha = false;
			}

			if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) {
				var self = this,
					el = self.element,
					_html = '<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>',
					aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ),
					aSlider = aContainer.find( '.iris-slider-offset-alpha' ),
					controls = {
						aContainer: aContainer,
						aSlider: aSlider
					};

				// Set default width for input reset
				self.options.defaultWidth = el.width();

				// Update width for input
				if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != 1 ) {
					el.width( parseInt( self.options.defaultWidth+100 ) );
				}

				// Push new controls
				$.each( controls, function( k, v ){
					self.controls[k] = v;
				});

				// Change size strip and add margin for sliders
				self.controls.square.css({'margin-right': '0px'});
				var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ),
					stripsMargin = emptyWidth/6,
					stripsWidth = (emptyWidth/2) - stripsMargin;

				$.each( [ 'aContainer', 'strip' ], function( k, v ) {
					self.controls[v].width( stripsWidth ).css({ 'margin-left': stripsMargin + 'px' });
				});

				// Add new slider
				self._initControls();

				// For updated widget
				self._change();
			}
		},
		_initControls: function() {
			this._super();

			if ( this.options.alpha ) {
				var self = this,
					controls = self.controls;

				controls.aSlider.slider({
					orientation: 'vertical',
					min: 0,
					max: 100,
					step: 1,
					value: parseInt( self._color._alpha*100 ),
					slide: function( event, ui ) {
						// Update alpha value
						self._color._alpha = parseFloat( ui.value/100 );
						self._change.apply( self, arguments );
					}
				});
			}
		},
		_change: function() {
			this._super();
			var self = this,
				el = self.element;

			if ( this.options.alpha ) {
				var	controls = self.controls,
					alpha = parseInt( self._color._alpha*100 ),
					color = self._color.toRgb(),
					gradient = [
						'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
						'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
					],
					defaultWidth = self.options.defaultWidth,
					target = self.picker.closest('.wp-picker-container').find( '.wp-color-result' );

				// Generate background slider alpha, only for CSS3 old browser fuck!! :)
				controls.aContainer.css({ 'background': 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' });

				if ( target.hasClass('wp-picker-open') ) {
					// Update alpha value
					controls.aSlider.slider( 'value', alpha );

					/**
					 * Disabled change opacity in default slider Saturation ( only is alpha enabled )
					 * and change input width for view all value
					 */
					if ( self._color._alpha < 1 ) {
						var style = controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' );

						controls.strip.attr( 'style', style );

						el.width( parseInt( defaultWidth+100 ) );
					} else {
						el.width( defaultWidth );
					}
				}
			}

			var reset = el.data('reset-alpha') || false;
			if ( reset ) {
				self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
					self._color._alpha = 1;
					self.active = 'external';
					self._change();
				});
			}
		},
		_addInputListeners: function( input ) {
			var self = this,
				debounceTimeout = 700, // originally set to 100, but some user perceive it as "jumps to random colors at third digit"
				callback = function( event ){
					var color = new Color( input.val() ),
						val = input.val();

					input.removeClass( 'iris-error' );
					// we gave a bad color
					if ( color.error ) {
						// don't error on an empty input
						if ( val !== '' ) {
							input.addClass( 'iris-error' );
						}
					} else {
						if ( color.toString() !== self._color.toString() ) {
							// let's not do this on keyup for hex shortcodes
							if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) ) {
								self._setOption( 'color', color.toString() );
							}
						}
					}
				};

			input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) );

			// If we initialized hidden, show on first focus. The rest is up to you.
			if ( self.options.hide ) {
				input.one( 'focus', function() {
					self.show();
				});
			}
		},
		_dimensions: function( reset ) {
			// whatever size
			var self = this,
				opts = self.options,
				controls = self.controls,
				square = controls.square,
				strip = self.picker.find( '.iris-strip' ),
				squareWidth = '77.5%',
				stripWidth = '12%',
				totalPadding = 20,
				innerWidth = opts.border ? opts.width - totalPadding : opts.width,
				controlsHeight,
				paletteCount = Array.isArray( opts.palettes ) ? opts.palettes.length : self._palettes.length,
				paletteMargin, paletteWidth, paletteContainerWidth;

			if ( reset ) {
				square.css( 'width', '' );
				strip.css( 'width', '' );
				self.picker.css( {width: '', height: ''} );
			}

			squareWidth = innerWidth * ( parseFloat( squareWidth ) / 100 );
			stripWidth = innerWidth * ( parseFloat( stripWidth ) / 100 );
			controlsHeight = opts.border ? squareWidth + totalPadding : squareWidth;

			if (opts.diviColorpicker ) {
				square.width( opts.width ).height( opts.height );
				controlsHeight = opts.height;
			} else {
				square.width( squareWidth ).height( squareWidth );
			}

			strip.height( squareWidth ).width( stripWidth );
			self.picker.css({
				width: 'number' === typeof opts.width ? opts.width + 'px' : opts.width,
				height: 'number' === typeof controlsHeight ? controlsHeight + 'px' : controlsHeight,
			});

			if ( ! opts.palettes ) {
				return self.picker.css( 'paddingBottom', '' );
			}

			// single margin at 2%
			paletteMargin = squareWidth * 2 / 100;
			paletteContainerWidth = squareWidth - ( ( paletteCount - 1 ) * paletteMargin );
			paletteWidth = paletteContainerWidth / paletteCount;
			self.picker.find('.iris-palette').each( function( i ) {
				var margin = i === 0 ? 0 : paletteMargin;
				$( this ).css({
					width: paletteWidth + 'px',
					height: paletteWidth + 'px',
					marginLeft: margin + 'px',
				});
			});
			self.picker.css( 'paddingBottom', paletteWidth + paletteMargin + 'px' );
			strip.height( paletteWidth + paletteMargin + squareWidth );
		}
	} );
}( jQuery ) );

// Auto Call plugin is class is color-picker.
jQuery(function($) {
  $('.color-picker').wpColorPicker();
});
ext/lz-string.min.js000064400000011746152336404310010427 0ustar00/*!
* Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
* For more information see LICENSE.txt or http://www.wtfpl.net/
*
*  For more information, the home page:
*  http://pieroxy.net/blog/pages/lz-string/testing.html
*
*  LZ-based compression algorithm, version 1.4.4
*/
var LZString=function(){function o(o,r){if(!t[o]){t[o]={};for(var n=0;n<o.length;n++)t[o][o.charAt(n)]=n}return t[o][r]}var r=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",t={},i={compressToBase64:function(o){if(null==o)return"";var r=i._compress(o,6,function(o){return n.charAt(o)});switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(r){return null==r?"":""==r?null:i._decompress(r.length,32,function(e){return o(n,r.charAt(e))})},compressToUTF16:function(o){return null==o?"":i._compress(o,15,function(o){return r(o+32)})+" "},decompressFromUTF16:function(o){return null==o?"":""==o?null:i._decompress(o.length,16384,function(r){return o.charCodeAt(r)-32})},compressToUint8Array:function(o){for(var r=i.compress(o),n=new Uint8Array(2*r.length),e=0,t=r.length;t>e;e++){var s=r.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null===o||void 0===o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;t>e;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":i._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(n){return o(e,r.charAt(n))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(o,r,n){if(null==o)return"";var e,t,i,s={},p={},u="",c="",a="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;i<o.length;i+=1)if(u=o.charAt(i),Object.prototype.hasOwnProperty.call(s,u)||(s[u]=f++,p[u]=!0),c=a+u,Object.prototype.hasOwnProperty.call(s,c))a=c;else{if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++),s[c]=f++,a=String(u)}if(""!==a){if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(n(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:i._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(o,n,e){var t,i,s,p,u,c,a,l,f=[],h=4,d=4,m=3,v="",w=[],A={val:e(0),position:n,index:1};for(i=0;3>i;i+=1)f[i]=i;for(p=0,c=Math.pow(2,2),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(t=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 2:return""}for(f[3]=l,s=l,w.push(l);;){if(A.index>o)return"";for(p=0,c=Math.pow(2,m),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(l=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 2:return w.join("")}if(0==h&&(h=Math.pow(2,m),m++),f[l])v=f[l];else{if(l!==d)return null;v=s+s.charAt(0)}w.push(v),f[d++]=s+v.charAt(0),h--,s=v,0==h&&(h=Math.pow(2,m),m++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString);
ext/wp-color-picker-alpha.min.js000064400000021117152336404310012567 0ustar00/*! wp-color-picker-alpha - Version 1.0
 * Copyright (c) 2017 Elegant Themes; Licensed under the GPLv2 license.
 * This is modified version made by Elegant Themes based on the work covered by the following copyright:
 * wp-color-picker-alpha - Version: 1.1
 * https://github.com/23r9i0/wp-color-picker-alpha
 * Copyright (c) 2015 Sergio P.A. (23r9i0);  Licensed under the GPLv2 license.
 */
!function(t){var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",i="Default",o="Select default color",r="Clear",a="Clear color",l="Color value",n="Select Color";if("undefined"!=typeof wp&&void 0!==wp.i18n&&void 0!==wp.i18n.__){var s=wp.i18n.__;i=s("Default"),o=s("Select default color"),r=s("Clear"),a=s("Clear color"),l=s("Color value"),n=s("Select Color")}else"undefined"!=typeof wpColorPickerL10n&&void 0!==wpColorPickerL10n.current&&(i=wpColorPickerL10n.defaultString,o=wpColorPickerL10n.defaultAriaLabel,r=wpColorPickerL10n.clear,a=wpColorPickerL10n.clearAriaLabel,l=wpColorPickerL10n.defaultLabel,n=wpColorPickerL10n.pick);Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);if(this.error)return"";if(t.length<6)for(var e=6-t.length-1;e>=0;e--)t="0"+t;return"#"+t},t.widget("wp.wpColorPicker",t.wp.wpColorPicker,{_create:function(){if(t.support.iris){var s=this,p=s.element;if(t.extend(s.options,p.data()),"hue"===s.options.type)return s._createHueOnly();s.close=s.close.bind(s),s.initialValue=p.val(),p.addClass("wp-color-picker"),p.parent("label").length||(p.wrap("<label></label>"),s.wrappingLabelText=t('<span class="screen-reader-text"></span>').insertBefore(p).text(l)),s.wrappingLabel=p.parent(),s.wrappingLabel.wrap('<div class="wp-picker-container" />'),s.wrap=s.wrappingLabel.parent(),s.toggler=t('<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>').insertBefore(s.wrappingLabel).css({backgroundColor:s.initialValue}).attr("title",n).addClass("et-wp-color-result-updated"),"undefined"!=typeof et_pb_color_picker_strings&&s.toggler.attr("data-legacy_title",et_pb_color_picker_strings.legacy_pick).attr("data-current",et_pb_color_picker_strings.legacy_current),s.toggler.find(".wp-color-result-text").text(n),s.pickerContainer=t('<div class="wp-picker-holder" />').insertAfter(s.wrappingLabel),s.button=t('<input type="button" class="button button-small button-clear hidden" />'),s.close_button=t('<button type="button" class="button button-confirm" />').html('<div style="fill: #3EF400; width: 25px; height: 25px; margin-top: -1px;"><svg viewBox="0 0 28 28" preserveAspectRatio="xMidYMid meet" shapeRendering="geometricPrecision"><g><path d="M19.203 9.21a.677.677 0 0 0-.98 0l-5.71 5.9-2.85-2.95a.675.675 0 0 0-.98 0l-1.48 1.523a.737.737 0 0 0 0 1.015l4.82 4.979a.677.677 0 0 0 .98 0l7.68-7.927a.737.737 0 0 0 0-1.015l-1.48-1.525z" fillRule="evenodd" /></g></svg></div>'),s.options.diviColorpicker&&p.after(s.close_button),s.options.defaultColor?s.button.addClass("wp-picker-default").val(i).attr("aria-label",o):s.button.addClass("wp-picker-clear").val(r).attr("aria-label",a),s.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(s.button),s.inputWrapper=p.closest(".wp-picker-input-wrap"),s.toggler.css({height:"24px",margin:"0 6px 6px 0",padding:"0 0 0 30px","font-size":"11px"}),p.iris({target:s.pickerContainer,hide:s.options.hide,width:s.options.width,height:s.options.height,mode:s.options.mode,palettes:s.options.palettes,diviColorpicker:s.options.diviColorpicker,change:function(t,i){s.options.alpha?(s.toggler.css({"background-image":"url("+e+")",position:"relative"}),0==s.toggler.find("span.color-alpha").length&&s.toggler.append('<span class="color-alpha" />'),s.toggler.find("span.color-alpha").css({width:"100%",height:"100%",position:"absolute",top:"0px",left:"0px","border-top-left-radius":"3px","border-bottom-left-radius":"3px",background:i.color.toString()})):s.toggler.css({backgroundColor:i.color.toString()}),"function"==typeof s.options.change&&s.options.change.call(this,t,i)}}),p.val(s.initialValue),s._addListeners(),s.options.hide||s.toggler.trigger("click")}},_addListeners:function(){var e=this;e.wrap.on("click.wpcolorpicker",function(t){return t.stopPropagation(),!1}),e.toggler.on("click",function(){e.toggler.hasClass("wp-picker-open")?e.close():e.open()}),e.element.on("change",function(i){(""===t(this).val()||e.element.hasClass("iris-error"))&&(e.options.alpha?e.toggler.find("span.color-alpha").css("backgroundColor",""):e.toggler.css("backgroundColor",""),"function"==typeof e.options.clear&&e.options.clear.call(this,i))}),e.button.on("click",function(i){t(this).hasClass("wp-picker-clear")?(e.element.val(""),e.options.alpha?e.toggler.find("span.color-alpha").css("backgroundColor",""):e.toggler.css("backgroundColor",""),"function"==typeof e.options.clear&&e.options.clear.call(this,i)):t(this).hasClass("wp-picker-default")&&e.element.val(e.options.defaultColor).trigger("change")}),e.close_button.on("click",function(t){t.preventDefault(),e.close()})},close:function(){this._super();"function"==typeof this.options.onClose&&this.options.onClose.call(this)}}),t.widget("a8c.iris",t.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),void 0!==this.options.alpha&&this.options.alpha){var e=this,i=e.element,o=t('<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>').appendTo(e.picker.find(".iris-picker-inner")),r=o.find(".iris-slider-offset-alpha"),a={aContainer:o,aSlider:r};e.options.defaultWidth=i.width(),(e._color._alpha<1||1!=e._color.toString().indexOf("rgb"))&&i.width(parseInt(e.options.defaultWidth+100)),t.each(a,function(t,i){e.controls[t]=i}),e.controls.square.css({"margin-right":"0px"});var l=e.picker.width()-e.controls.square.width()-20,n=l/6,s=l/2-n;t.each(["aContainer","strip"],function(t,i){e.controls[i].width(s).css({"margin-left":n+"px"})}),e._initControls(),e._change()}},_initControls:function(){if(this._super(),this.options.alpha){var t=this;t.controls.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(e,i){t._color._alpha=parseFloat(i.value/100),t._change.apply(t,arguments)}})}},_change:function(){this._super();var t=this,i=t.element;if(this.options.alpha){var o=t.controls,r=parseInt(100*t._color._alpha),a=t._color.toRgb(),l=["rgb("+a.r+","+a.g+","+a.b+") 0%","rgba("+a.r+","+a.g+","+a.b+", 0) 100%"],n=t.options.defaultWidth,s=t.picker.closest(".wp-picker-container").find(".wp-color-result");if(o.aContainer.css({background:"linear-gradient(to bottom, "+l.join(", ")+"), url("+e+")"}),s.hasClass("wp-picker-open"))if(o.aSlider.slider("value",r),t._color._alpha<1){var p=o.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)");o.strip.attr("style",p),i.width(parseInt(n+100))}else i.width(n)}(i.data("reset-alpha")||!1)&&t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){t._color._alpha=1,t.active="external",t._change()})},_addInputListeners:function(t){var e=this,i=function(i){var o=new Color(t.val()),r=t.val();t.removeClass("iris-error"),o.error?""!==r&&t.addClass("iris-error"):o.toString()!==e._color.toString()&&("keyup"===i.type&&r.match(/^[0-9a-fA-F]{3}$/)||e._setOption("color",o.toString()))};t.on("change",i).on("keyup",e._debounce(i,700)),e.options.hide&&t.one("focus",function(){e.show()})},_dimensions:function(e){var i,o,r,a=this.options,l=this.controls.square,n=this.picker.find(".iris-strip"),s="77.5%",p="12%",c=a.border?a.width-20:a.width,h=Array.isArray(a.palettes)?a.palettes.length:this._palettes.length;if(e&&(l.css("width",""),n.css("width",""),this.picker.css({width:"",height:""})),s=c*(parseFloat(s)/100),p=c*(parseFloat(p)/100),i=a.border?s+20:s,a.diviColorpicker?(l.width(a.width).height(a.height),i=a.height):l.width(s).height(s),n.height(s).width(p),this.picker.css({width:"number"==typeof a.width?a.width+"px":a.width,height:"number"==typeof i?i+"px":i}),!a.palettes)return this.picker.css("paddingBottom","");r=(s-(h-1)*(o=2*s/100))/h,this.picker.find(".iris-palette").each(function(e){var i=0===e?0:o;t(this).css({width:r+"px",height:r+"px",marginLeft:i+"px"})}),this.picker.css("paddingBottom",r+o+"px"),n.height(r+o+s)}})}(jQuery),jQuery(function(t){t(".color-picker").wpColorPicker()});ext/wp-color-picker-alpha-48.min.js000064400000016377152336404310013034 0ustar00/*! wp-color-picker-alpha - Version 1.0
 * Copyright (c) 2017 Elegant Themes; Licensed under the GPLv2 license.
 * This is modified version made by Elegant Themes based on the work covered by the following copyright:
 * wp-color-picker-alpha - Version: 1.1
 * https://github.com/23r9i0/wp-color-picker-alpha
 * Copyright (c) 2015 Sergio P.A. (23r9i0);  Licensed under the GPLv2 license.
 */
!function(t){var i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==";Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);if(this.error)return"";if(t.length<6)for(var i=6-t.length-1;i>=0;i--)t="0"+t;return"#"+t},t.widget("wp.wpColorPicker",t.wp.wpColorPicker,{_create:function(){if(t.support.iris){var o=this,e=o.element;t.extend(o.options,e.data()),o.close=t.proxy(o.close,o),o.initialValue=e.val(),e.addClass("wp-color-picker").hide().wrap('<div class="wp-picker-container" />'),o.wrap=e.parent(),o.toggler=t('<a tabindex="0" class="wp-color-result" />').insertBefore(e).css({backgroundColor:o.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current),o.pickerContainer=t('<div class="wp-picker-holder" />').insertAfter(e),o.button=t('<input type="button" class="button button-small button-clear hidden" />'),o.close_button=t('<button type="button" class="button button-confirm" />'),o.options.defaultColor?o.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString):o.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear),e.wrap('<span class="wp-picker-input-wrap" />').after(o.button),o.options.diviColorpicker&&(o.close_button.html('<div style="fill: #3EF400; width: 25px; height: 25px; margin-top: -1px;"><svg viewBox="0 0 28 28" preserveAspectRatio="xMidYMid meet" shapeRendering="geometricPrecision"><g><path d="M19.203 9.21a.677.677 0 0 0-.98 0l-5.71 5.9-2.85-2.95a.675.675 0 0 0-.98 0l-1.48 1.523a.737.737 0 0 0 0 1.015l4.82 4.979a.677.677 0 0 0 .98 0l7.68-7.927a.737.737 0 0 0 0-1.015l-1.48-1.525z" fillRule="evenodd" /></g></svg></div>'),e.after(o.close_button)),e.iris({target:o.pickerContainer,hide:o.options.hide,width:o.options.width,height:o.options.height,diviColorpicker:o.options.diviColorpicker,mode:o.options.mode,palettes:o.options.palettes,change:function(e,r){o.options.alpha?(o.toggler.css({"background-image":"url("+i+")"}).html("<span />"),o.toggler.find("span").css({width:"100%",height:"100%",position:"absolute",top:0,left:0,"border-top-left-radius":"3px","border-bottom-left-radius":"3px",background:r.color.toString()})):o.toggler.css({backgroundColor:r.color.toString()}),t.isFunction(o.options.change)&&o.options.change.call(this,e,r)}}),e.val(o.initialValue),o._addListeners(),o.options.hide||o.toggler.click()}},_addListeners:function(){var i=this;i.wrap.on("click.wpcolorpicker",function(t){t.stopPropagation()}),i.toggler.click(function(){i.toggler.hasClass("wp-picker-open")?i.close():i.open()}),i.element.change(function(o){(""===t(this).val()||i.element.hasClass("iris-error"))&&(i.options.alpha?(i.toggler.css("backgroundColor",""),i.toggler.find("span").css("backgroundColor","")):i.toggler.css("backgroundColor",""),t.isFunction(i.options.clear)&&i.options.clear.call(this,o))}),i.toggler.on("keyup",function(t){13!==t.keyCode&&32!==t.keyCode||(t.preventDefault(),i.toggler.trigger("click").next().focus())}),i.button.click(function(o){var e=t(this);e.hasClass("wp-picker-clear")?(i.element.val(""),i.options.alpha?(i.toggler.css("backgroundColor",""),i.toggler.find("span").css("backgroundColor","")):i.toggler.css("backgroundColor",""),t.isFunction(i.options.clear)&&i.options.clear.call(this,o)):e.hasClass("wp-picker-default")&&i.element.val(i.options.defaultColor).change()}),i.close_button.click(function(t){t.preventDefault(),i.close()})},close:function(){this._super();t.isFunction(this.options.onClose)&&this.options.onClose.call(this)}}),t.widget("a8c.iris",t.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),void 0!==this.options.alpha&&this.options.alpha){var i=this,o=i.element,e=t('<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>').appendTo(i.picker.find(".iris-picker-inner")),r={aContainer:e,aSlider:e.find(".iris-slider-offset-alpha")};i.options.defaultWidth=o.width(),(i._color._alpha<1||1!=i._color.toString().indexOf("rgb"))&&o.width(parseInt(i.options.defaultWidth+100)),t.each(r,function(t,o){i.controls[t]=o}),i.controls.square.css({"margin-right":"0"});var s=i.picker.width()-i.controls.square.width()-20,n=s/6,a=s/2-n;t.each(["aContainer","strip"],function(t,o){i.controls[o].width(a).css({"margin-left":n+"px"})}),i._initControls(),i._change()}},_initControls:function(){if(this._super(),this.options.alpha){var t=this;t.controls.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(i,o){t._color._alpha=parseFloat(o.value/100),t._change.apply(t,arguments)}})}},_change:function(){this._super();var t=this,o=t.element;if(this.options.alpha){var e=t.controls,r=parseInt(100*t._color._alpha),s=t._color.toRgb(),n=["rgb("+s.r+","+s.g+","+s.b+") 0%","rgba("+s.r+","+s.g+","+s.b+", 0) 100%"],a=t.options.defaultWidth,l=t.picker.closest(".wp-picker-container").find(".wp-color-result");if(e.aContainer.css({background:"linear-gradient(to bottom, "+n.join(", ")+"), url("+i+")"}),l.hasClass("wp-picker-open"))if(e.aSlider.slider("value",r),t._color._alpha<1){var c=e.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)");e.strip.attr("style",c),o.width(parseInt(a+100))}else o.width(a)}(o.data("reset-alpha")||!1)&&t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){t._color._alpha=1,t.active="external",t._change()})},_addInputListeners:function(t){var i=this,o=function(o){var e=new Color(t.val()),r=t.val();t.removeClass("iris-error"),e.error?""!==r&&t.addClass("iris-error"):e.toString()!==i._color.toString()&&("keyup"===o.type&&r.match(/^[0-9a-fA-F]{3}$/)||i._setOption("color",e.toString()))};t.on("change",o).on("keyup",i._debounce(o,700)),i.options.hide&&t.one("focus",function(){i.show()})},_dimensions:function(i){var o,e,r,s=this,n=s.options,a=s.controls.square,l=s.picker.find(".iris-strip"),c="77.5%",p="12%",h=n.border?n.width-20:n.width,d=t.isArray(n.palettes)?n.palettes.length:s._palettes.length;if(i&&(a.css("width",""),l.css("width",""),s.picker.css({width:"",height:""})),c=h*(parseFloat(c)/100),p=h*(parseFloat(p)/100),o=n.border?c+20:c,n.diviColorpicker?(a.width(n.width).height(n.height),o=n.height):a.width(c).height(c),l.height(c).width(p),s.picker.css({width:n.width,height:o}),!n.palettes)return s.picker.css("paddingBottom","");r=(c-(d-1)*(e=2*c/100))/d,s.picker.find(".iris-palette").each(function(i){var o=0===i?0:e;t(this).css({width:r,height:r,marginLeft:o})}),s.picker.css("paddingBottom",r+e),l.height(r+e+c)}})}(jQuery),jQuery(document).ready(function(t){t(".color-picker").wpColorPicker()});ext/media-library.js000064400000010036152336404310010424 0ustar00/* global wp */

/**
 * media-library.js
 *
 * Adapted from WordPress
 *
 * @copyright 2017 by the WordPress contributors.
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * This program incorporates work covered by the following copyright and
 * permission notices:
 *
 * b2 is (c) 2001, 2002 Michel Valdrighi - m@tidakada.com - http://tidakada.com
 *
 * b2 is released under the GPL
 *
 * WordPress - Web publishing software
 *
 * Copyright 2003-2010 by the contributors
 *
 * WordPress is released under the GPL
 */

var Select = wp.media.view.MediaFrame.Select,
  Library = wp.media.controller.Library,
  l10n = wp.media.view.l10n;

wp.media.view.MediaFrame.ETSelect = wp.media.view.MediaFrame.Select.extend({
  initialize: function() {
    _.defaults( this.options, {
      multiple: true,
      editing: false,
      embed: true,
      state: 'insert',
      metadata: {},
      title: l10n.insertMediaTitle,
      button: {
        text: l10n.insertIntoPost
      },
    });

    // Call 'initialize' directly on the parent class.
    Select.prototype.initialize.apply( this, arguments );
    this.createIframeStates();
  },

  /**
   * Create the default states.
   */
  createStates: function() {
    var options = this.options;

    var states = [
      // Main states.
      new Library({
        id:         'insert',
        title:      options.title,
        priority:   20,
        toolbar:    'main-insert',
        filterable: 'all',
        library:    wp.media.query( options.library ),
        multiple:   options.multiple ? 'reset' : false,
        editable:   true,
        allowLocalEdits: true,
        displaySettings: true,
        displayUserSettings: true
      }),
    ];
    if (options.embed) {
      // Embed states.
      states.push(new wp.media.controller.Embed( { metadata: options.metadata } ))
	}
	this.states.add(states);
  },

  bindHandlers: function() {
    var handlers;

    Select.prototype.bindHandlers.apply( this, arguments );

    this.on( 'toolbar:create:main-insert', this.createToolbar, this );
    this.on( 'toolbar:create:main-embed', this.mainEmbedToolbar, this );

    handlers = {
      content: {
        'embed': 'embedContent',
      },

      toolbar: {
        'main-insert': 'mainInsertToolbar',
      }
    };

    _.each( handlers, function( regionHandlers, region ) {
      _.each( regionHandlers, function( callback, handler ) {
        this.on( region + ':render:' + handler, this[ callback ], this );
      }, this );
    }, this );
  },

  // Content
  embedContent: function() {
    var view = new wp.media.view.Embed({
      controller: this,
      model:      this.state()
    }).render();

    this.content.set( view );

    if ( ! wp.media.isTouchDevice ) {
      view.url.input.focus();
    }
  },

  // Toolbars
  mainInsertToolbar: function( view ) {
    var options = this.options;
    var controller = this;

    view.set( 'insert', {
      style:    'primary',
      priority: 80,
      text:     options.button.text,
      requires: { selection: true },

      /**
       * @fires wp.media.controller.State#insert
       */
      click: function() {
        var state = controller.state(),
          selection = state.get('selection');

        controller.close();
        state.trigger( 'insert', selection ).reset();
      }
    });
  },

  mainEmbedToolbar: function( toolbar ) {
    toolbar.view = new wp.media.view.Toolbar.Embed({
      controller: this
    });
  }
});
ext/waypoints.min.js000064400000021437152336404310010531 0ustar00/*!
* Waypoints - 4.0.0
* Copyright © 2011-2015 Caleb Troughton
* Licensed under the MIT license.
* https://github.com/imakewebthings/waypoints/blog/master/licenses.txt
*
* Modified to adapt the latest jQuery version (v3 above) included on WordPress 5.6:
* - (2020-12-15) - jQuery isFunction method is deprecated.
*/
!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return "function"==typeof arguments[0]&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}();ext/wp-color-picker-alpha-48.js000064400000032230152336404310012234 0ustar00/**
 * wp-color-picker-alpha
 *
 * Version 1.0
 * Copyright (c) 2017 Elegant Themes.
 * Licensed under the GPLv2 license.
 *
 * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
 * Only run in input and is defined data alpha in true
 * Add custom colorpicker UI
 *
 * This is modified version made by Elegant Themes based on the work covered by
 * the following copyright:
 *
 * wp-color-picker-alpha Version: 1.1
 * https://github.com/23r9i0/wp-color-picker-alpha
 * Copyright (c) 2015 Sergio P.A. (23r9i0).
 * Licensed under the GPLv2 license.
 */
( function( $ ) {
	// Variable for some backgrounds
	var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==';
	// html stuff for wpColorPicker copy of the original color-picker.js
	var	_before = '<a tabindex="0" class="wp-color-result" />',
		_after = '<div class="wp-picker-holder" />',
		_wrap = '<div class="wp-picker-container" />',
		_button = '<input type="button" class="button button-small button-clear hidden" />',
		_close_button = '<button type="button" class="button button-confirm" />',
		_close_button_icon = '<div style="fill: #3EF400; width: 25px; height: 25px; margin-top: -1px;"><svg viewBox="0 0 28 28" preserveAspectRatio="xMidYMid meet" shapeRendering="geometricPrecision"><g><path d="M19.203 9.21a.677.677 0 0 0-.98 0l-5.71 5.9-2.85-2.95a.675.675 0 0 0-.98 0l-1.48 1.523a.737.737 0 0 0 0 1.015l4.82 4.979a.677.677 0 0 0 .98 0l7.68-7.927a.737.737 0 0 0 0-1.015l-1.48-1.525z" fillRule="evenodd" /></g></svg></div>';

	/**
	 * Overwrite Color
	 * for enable support rbga
	 */
	Color.fn.toString = function() {
		if ( this._alpha < 1 )
			return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );

		var hex = parseInt( this._color, 10 ).toString( 16 );

		if ( this.error )
			return '';

		if ( hex.length < 6 ) {
			for ( var i = 6 - hex.length - 1; i >= 0; i-- ) {
				hex = '0' + hex;
			}
		}

		return '#' + hex;
	};

	/**
	 * Overwrite wpColorPicker
	 */
	$.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, {
		_create: function() {
			// bail early for unsupported Iris.
			if ( ! $.support.iris ) {
				return;
			}

			var self = this,
				el = self.element;

			$.extend( self.options, el.data() );

			// keep close bound so it can be attached to a body listener
			self.close = $.proxy( self.close, self );

			self.initialValue = el.val();

			// Set up HTML structure, hide things
			el.addClass( 'wp-color-picker' ).hide().wrap( _wrap );
			self.wrap = el.parent();
			self.toggler = $( _before ).insertBefore( el ).css( { backgroundColor: self.initialValue } ).attr( 'title', wpColorPickerL10n.pick ).attr( 'data-current', wpColorPickerL10n.current );
			self.pickerContainer = $( _after ).insertAfter( el );
			self.button = $( _button );
			self.close_button = $( _close_button );

			if ( self.options.defaultColor ) {
				self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString );
			} else {
				self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear );
			}

			el.wrap( '<span class="wp-picker-input-wrap" />' ).after(self.button);

			if ( self.options.diviColorpicker ) {
				self.close_button.html( _close_button_icon );
				el.after( self.close_button );
			}

			el.iris( {
				target: self.pickerContainer,
				hide: self.options.hide,
				width: self.options.width,
				height: self.options.height,
				diviColorpicker: self.options.diviColorpicker,
				mode: self.options.mode,
				palettes: self.options.palettes,
				change: function( event, ui ) {
					if ( self.options.alpha ) {
						self.toggler.css( { 'background-image': 'url(' + image + ')' } ).html('<span />');
						self.toggler.find('span').css({
							'width': '100%',
							'height': '100%',
							'position': 'absolute',
							'top': 0,
							'left': 0,
							'border-top-left-radius': '3px',
							'border-bottom-left-radius': '3px',
							'background': ui.color.toString()
						});
					} else {
						self.toggler.css( { backgroundColor: ui.color.toString() } );
					}
					// check for a custom cb
					if ( $.isFunction( self.options.change ) ) {
						self.options.change.call( this, event, ui );
					}
				}
			} );

			el.val( self.initialValue );
			self._addListeners();
			if ( ! self.options.hide ) {
				self.toggler.click();
			}
		},
		_addListeners: function() {
			var self = this;

			// prevent any clicks inside this widget from leaking to the top and closing it
			self.wrap.on( 'click.wpcolorpicker', function( event ) {
				event.stopPropagation();
			});

			self.toggler.click( function(){
				if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
					self.close();
				} else {
					self.open();
				}
			});

			self.element.change( function( event ) {
				var me = $( this ),
					val = me.val();
				// Empty or Error = clear
				if ( val === '' || self.element.hasClass('iris-error') ) {
					if ( self.options.alpha ) {
						self.toggler.css( 'backgroundColor', '' );
						self.toggler.find('span').css( 'backgroundColor', '' );
					} else {
						self.toggler.css( 'backgroundColor', '' );
					}
					// fire clear callback if we have one
					if ( $.isFunction( self.options.clear ) ) {
						self.options.clear.call( this, event );
					}
				}
			});

			// open a keyboard-focused closed picker with space or enter
			self.toggler.on( 'keyup', function( event ) {
				if ( event.keyCode === 13 || event.keyCode === 32 ) {
					event.preventDefault();
					self.toggler.trigger( 'click' ).next().focus();
				}
			});

			self.button.click( function( event ) {
				var me = $( this );
				if ( me.hasClass( 'wp-picker-clear' ) ) {
					self.element.val( '' );
					if ( self.options.alpha ) {
						self.toggler.css( 'backgroundColor', '' );
						self.toggler.find('span').css( 'backgroundColor', '' );
					} else {
						self.toggler.css( 'backgroundColor', '' );
					}
					if ( $.isFunction( self.options.clear ) ) {
						self.options.clear.call( this, event );
					}
				} else if ( me.hasClass( 'wp-picker-default' ) ) {
					self.element.val( self.options.defaultColor ).change();
				}
			});

			self.close_button.click( function( event ) {
				event.preventDefault();
				self.close();
			});
		},
		close: function() {
			this._super();
			var self = this;

			if ($.isFunction(self.options.onClose)) {
				self.options.onClose.call(this);
			}
		},
	});

	/**
	 * Overwrite iris
	 */
	$.widget( 'a8c.iris', $.a8c.iris, {
		_create: function() {
			this._super();

			// Global option for check is mode rbga is enabled
			this.options.alpha = this.element.data( 'alpha' ) || false;

			// Is not input disabled
			if ( ! this.element.is( ':input' ) ) {
				this.options.alpha = false;
			}

			if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) {
				var self = this,
					el = self.element,
					_html = '<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>',
					aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ),
					aSlider = aContainer.find( '.iris-slider-offset-alpha' ),
					controls = {
						aContainer: aContainer,
						aSlider: aSlider
					};

				// Set default width for input reset
				self.options.defaultWidth = el.width();

				// Update width for input
				if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != 1 ) {
					el.width( parseInt( self.options.defaultWidth+100 ) );
				}

				// Push new controls
				$.each( controls, function( k, v ){
					self.controls[k] = v;
				});

				// Change size strip and add margin for sliders
				self.controls.square.css({'margin-right': '0'});
				var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ),
					stripsMargin = emptyWidth/6,
					stripsWidth = (emptyWidth/2) - stripsMargin;

				$.each( [ 'aContainer', 'strip' ], function( k, v ) {
					self.controls[v].width( stripsWidth ).css({ 'margin-left': stripsMargin + 'px' });
				});

				// Add new slider
				self._initControls();

				// For updated widget
				self._change();
			}
		},
		_initControls: function() {
			this._super();

			if ( this.options.alpha ) {
				var self = this,
					controls = self.controls;

				controls.aSlider.slider({
					orientation: 'vertical',
					min: 0,
					max: 100,
					step: 1,
					value: parseInt( self._color._alpha*100 ),
					slide: function( event, ui ) {
						// Update alpha value
						self._color._alpha = parseFloat( ui.value/100 );
						self._change.apply( self, arguments );
					}
				});
			}
		},
		_change: function() {
			this._super();
			var self = this,
				el = self.element;

			if ( this.options.alpha ) {
				var	controls = self.controls,
					alpha = parseInt( self._color._alpha*100 ),
					color = self._color.toRgb(),
					gradient = [
						'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
						'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
					],
					defaultWidth = self.options.defaultWidth,
					target = self.picker.closest('.wp-picker-container').find( '.wp-color-result' );

				// Generate background slider alpha, only for CSS3 old browser fuck!! :)
				controls.aContainer.css({ 'background': 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' });

				if ( target.hasClass('wp-picker-open') ) {
					// Update alpha value
					controls.aSlider.slider( 'value', alpha );

					/**
					 * Disabled change opacity in default slider Saturation ( only is alpha enabled )
					 * and change input width for view all value
					 */
					if ( self._color._alpha < 1 ) {
						var style = controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' );

						controls.strip.attr( 'style', style );

						el.width( parseInt( defaultWidth+100 ) );
					} else {
						el.width( defaultWidth );
					}
				}
			}

			var reset = el.data('reset-alpha') || false;
			if ( reset ) {
				self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
					self._color._alpha = 1;
					self.active = 'external';
					self._change();
				});
			}
		},
		_addInputListeners: function( input ) {
			var self = this,
				debounceTimeout = 700, // originally set to 100, but some user perceive it as "jumps to random colors at third digit"
				callback = function( event ){
					var color = new Color( input.val() ),
						val = input.val();

					input.removeClass( 'iris-error' );
					// we gave a bad color
					if ( color.error ) {
						// don't error on an empty input
						if ( val !== '' ) {
							input.addClass( 'iris-error' );
						}
					} else {
						if ( color.toString() !== self._color.toString() ) {
							// let's not do this on keyup for hex shortcodes
							if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) ) {
								self._setOption( 'color', color.toString() );
							}
						}
					}
				};

			input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) );

			// If we initialized hidden, show on first focus. The rest is up to you.
			if ( self.options.hide ) {
				input.one( 'focus', function() {
					self.show();
				});
			}
		},
		_dimensions: function( reset ) {
			// whatever size
			var self = this,
				opts = self.options,
				controls = self.controls,
				square = controls.square,
				strip = self.picker.find( '.iris-strip' ),
				squareWidth = '77.5%',
				stripWidth = '12%',
				totalPadding = 20,
				innerWidth = opts.border ? opts.width - totalPadding : opts.width,
				controlsHeight,
				paletteCount = $.isArray( opts.palettes ) ? opts.palettes.length : self._palettes.length,
				paletteMargin, paletteWidth, paletteContainerWidth;

			if ( reset ) {
				square.css( 'width', '' );
				strip.css( 'width', '' );
				self.picker.css( {width: '', height: ''} );
			}

			squareWidth = innerWidth * ( parseFloat( squareWidth ) / 100 );
			stripWidth = innerWidth * ( parseFloat( stripWidth ) / 100 );
			controlsHeight = opts.border ? squareWidth + totalPadding : squareWidth;

			if (opts.diviColorpicker ) {
				square.width( opts.width ).height( opts.height );
				controlsHeight = opts.height;
			} else {
				square.width( squareWidth ).height( squareWidth );
			}

			strip.height( squareWidth ).width( stripWidth );
			self.picker.css( { width: opts.width, height: controlsHeight } );

			if ( ! opts.palettes ) {
				return self.picker.css( 'paddingBottom', '' );
			}

			// single margin at 2%
			paletteMargin = squareWidth * 2 / 100;
			paletteContainerWidth = squareWidth - ( ( paletteCount - 1 ) * paletteMargin );
			paletteWidth = paletteContainerWidth / paletteCount;
			self.picker.find('.iris-palette').each( function( i ) {
				var margin = i === 0 ? 0 : paletteMargin;
				$( this ).css({
					width: paletteWidth,
					height: paletteWidth,
					marginLeft: margin
				});
			});
			self.picker.css( 'paddingBottom', paletteWidth + paletteMargin );
			strip.height( paletteWidth + paletteMargin + squareWidth );
		}
	} );
}( jQuery ) );

// Auto Call plugin is class is color-picker
jQuery( document ).ready( function( $ ) {
  $( '.color-picker' ).wpColorPicker();
} );block-layout-frontend-preview.js000064400000373527152336404310013025 0ustar00!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=149)}([function(t,e){t.exports=jQuery},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var r=n(32),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(6),o=n(53),i=n(54),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},function(t,e,n){var r=n(2).Symbol;t.exports=r},function(t,e,n){var r=n(23),o=n(63);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},function(t,e,n){var r=n(21);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(93),o=n(66),i=n(7);t.exports=function(t){return i(t)?r(t):o(t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},function(t,e,n){var r=n(150),o=n(197),i=n(28),a=n(1),c=n(200);t.exports=function(t){return"function"==typeof t?t:null==t?i:"object"==typeof t?a(t)?o(t[0],t[1]):r(t):c(t)}},function(t,e,n){var r=n(5),o=n(3);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},function(t,e,n){var r=n(162),o=n(165);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(12);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}},function(t,e,n){var r=n(106);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(42),o=n(43);t.exports=function(t,e,n,i){var a=!n;n||(n={});for(var c=-1,u=e.length;++c<u;){var s=e[c],l=i?i(n[s],t[s],s,n,t):void 0;void 0===l&&(l=t[s]),a?o(n,s,l):r(n,s,l)}return n}},function(t,e,n){var r=n(193),o=n(57),i=n(194),a=n(195),c=n(95),u=n(5),s=n(86),l="[object Map]",f="[object Promise]",d="[object Set]",p="[object WeakMap]",v="[object DataView]",g=s(r),h=s(o),y=s(i),b=s(a),m=s(c),_=u;(r&&_(new r(new ArrayBuffer(1)))!=v||o&&_(new o)!=l||i&&_(i.resolve())!=f||a&&_(new a)!=d||c&&_(new c)!=p)&&(_=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?s(n):"";if(r)switch(r){case g:return v;case h:return l;case y:return f;case b:return d;case m:return p}return e}),t.exports=_},function(t,e,n){var r=n(1),o=n(67),i=n(98),a=n(8);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(a(t))}},,function(t,e){t.exports=function(t){return void 0===t}},function(t,e,n){var r=n(6),o=n(10),i=n(1),a=n(12),c=r?r.prototype:void 0,u=c?c.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(5),o=n(4);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){var r=n(189),o=n(3),i=Object.prototype,a=i.hasOwnProperty,c=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return o(t)&&a.call(t,"callee")&&!c.call(t,"callee")};t.exports=u},function(t,e,n){(function(t){var r=n(2),o=n(190),i=e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,c=a&&a.exports===i?r.Buffer:void 0,u=(c?c.isBuffer:void 0)||o;t.exports=u}).call(this,n(62)(t))},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(105),o=n(206),i=n(207);t.exports=function(t,e,n){return e==e?i(t,e,n):r(t,o,n)}},function(t,e,n){var r=n(93),o=n(219),i=n(7);t.exports=function(t){return i(t)?r(t,!0):o(t)}},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(52))},function(t,e,n){var r=n(34),o=n(157),i=n(158),a=n(159),c=n(160),u=n(161);function s(t){var e=this.__data__=new r(t);this.size=e.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=a,s.prototype.has=c,s.prototype.set=u,t.exports=s},function(t,e,n){var r=n(152),o=n(153),i=n(154),a=n(155),c=n(156);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=c,t.exports=u},function(t,e,n){var r=n(22);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(13)(Object,"create");t.exports=r},function(t,e,n){var r=n(174);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(191),o=n(64),i=n(65),a=i&&i.isTypedArray,c=a?o(a):r;t.exports=c},function(t,e,n){var r=n(40);t.exports=function(t,e,n){var o=null==t?void 0:r(t,e);return void 0===o?n:o}},function(t,e,n){var r=n(18),o=n(14);t.exports=function(t,e){for(var n=0,i=(e=r(e,t)).length;null!=t&&n<i;)t=t[o(e[n++])];return n&&n==i?t:void 0}},function(t,e,n){var r=n(68),o=n(205)(r);t.exports=o},function(t,e,n){var r=n(43),o=n(22),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(108);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e,n){var r=n(33),o=n(45),i=n(42),a=n(114),c=n(218),u=n(115),s=n(31),l=n(221),f=n(222),d=n(90),p=n(74),v=n(17),g=n(223),h=n(224),y=n(118),b=n(1),m=n(25),_=n(228),w=n(4),x=n(230),k=n(9),O=n(30),j="[object Arguments]",B="[object Function]",S="[object Object]",E={};E[j]=E["[object Array]"]=E["[object ArrayBuffer]"]=E["[object DataView]"]=E["[object Boolean]"]=E["[object Date]"]=E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Map]"]=E["[object Number]"]=E[S]=E["[object RegExp]"]=E["[object Set]"]=E["[object String]"]=E["[object Symbol]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E["[object Error]"]=E[B]=E["[object WeakMap]"]=!1,t.exports=function t(e,n,A,W,I,T){var C,M=1&n,F=2&n,P=4&n;if(A&&(C=I?A(e,W,I,T):A(e)),void 0!==C)return C;if(!w(e))return e;var L=b(e);if(L){if(C=g(e),!M)return s(e,C)}else{var D=v(e),R=D==B||"[object GeneratorFunction]"==D;if(m(e))return u(e,M);if(D==S||D==j||R&&!I){if(C=F||R?{}:y(e),!M)return F?f(e,c(C,e)):l(e,a(C,e))}else{if(!E[D])return I?e:{};C=h(e,D,M)}}T||(T=new r);var V=T.get(e);if(V)return V;T.set(e,C),x(e)?e.forEach((function(r){C.add(t(r,n,A,r,e,T))})):_(e)&&e.forEach((function(r,o){C.set(o,t(r,n,A,o,e,T))}));var $=L?void 0:(P?F?p:d:F?O:k)(e);return o($||e,(function(r,o){$&&(r=e[o=r]),i(C,o,t(r,n,A,o,e,T))})),C}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},function(t,e,n){var r=n(4),o=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},function(t,e,n){var r=n(120),o=n(240),i=n(241),a=n(122),c=n(252),u=n(78),s=n(253),l=n(128),f=n(129),d=n(15),p=Math.max;t.exports=function(t,e,n,v,g,h,y,b){var m=2&e;if(!m&&"function"!=typeof t)throw new TypeError("Expected a function");var _=v?v.length:0;if(_||(e&=-97,v=g=void 0),y=void 0===y?y:p(d(y),0),b=void 0===b?b:d(b),_-=g?g.length:0,64&e){var w=v,x=g;v=g=void 0}var k=m?void 0:u(t),O=[t,e,n,v,g,w,x,h,y,b];if(k&&s(O,k),t=O[0],e=O[1],n=O[2],v=O[3],g=O[4],!(b=O[9]=void 0===O[9]?m?0:t.length:p(O[9]-_,0))&&24&e&&(e&=-25),e&&1!=e)j=8==e||16==e?i(t,e,b):32!=e&&33!=e||g.length?a.apply(void 0,O):c(t,e,n,v);else var j=o(t,e,n);return f((k?r:l)(j,O),t,e)}},function(t,e,n){var r=n(46),o=n(4);t.exports=function(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=r(t.prototype),i=t.apply(n,e);return o(i)?i:n}}},function(t,e){var n="__lodash_placeholder__";t.exports=function(t,e){for(var r=-1,o=t.length,i=0,a=[];++r<o;){var c=t[r];c!==e&&c!==n||(t[r]=n,a[i++]=r)}return a}},function(t,e,n){var r=n(259),o=n(111),i=n(71);t.exports=function(t){return i(o(t,void 0,r),t+"")}},function(t,e,n){var r=n(8),o=n(55),i=/&(?:amp|lt|gt|quot|#39);/g,a=RegExp(i.source);t.exports=function(t){return(t=r(t))&&a.test(t)?t.replace(i,o):t}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(6),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,c=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,c),n=t[c];try{t[c]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[c]=n:delete t[c]),o}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(56)({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});t.exports=r},function(t,e){t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},function(t,e,n){var r=n(13)(n(2),"Map");t.exports=r},function(t,e,n){var r=n(166),o=n(173),i=n(175),a=n(176),c=n(177);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=c,t.exports=u},function(t,e,n){var r=n(178),o=n(3);t.exports=function t(e,n,i,a,c){return e===n||(null==e||null==n||!o(e)&&!o(n)?e!=e&&n!=n:r(e,n,i,a,t,c))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}},function(t,e,n){var r=n(187),o=n(92),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,c=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return i.call(t,e)})))}:o;t.exports=c},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){(function(t){var r=n(32),o=e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,c=function(){try{var t=i&&i.require&&i.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=c}).call(this,n(62)(t))},function(t,e,n){var r=n(27),o=n(192),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=[];for(var n in Object(t))i.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(1),o=n(12),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||(a.test(t)||!i.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var r=n(102),o=n(9);t.exports=function(t,e){return t&&r(t,e,o)}},function(t,e,n){var r=n(5),o=n(1),i=n(3);t.exports=function(t){return"string"==typeof t||!o(t)&&i(t)&&"[object String]"==r(t)}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(216),o=n(112)(r);t.exports=o},function(t,e,n){var r=n(22),o=n(7),i=n(26),a=n(4);t.exports=function(t,e,n){if(!a(n))return!1;var c=typeof e;return!!("number"==c?o(n)&&i(e,n.length):"string"==c&&e in n)&&r(n[e],t)}},function(t,e,n){var r=n(94)(Object.getPrototypeOf,Object);t.exports=r},function(t,e,n){var r=n(91),o=n(116),i=n(30);t.exports=function(t){return r(t,i,o)}},function(t,e,n){var r=n(89);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},function(t,e,n){var r=n(46),o=n(77);function i(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}i.prototype=r(o.prototype),i.prototype.constructor=i,t.exports=i},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(121),o=n(243),i=r?function(t){return r.get(t)}:o;t.exports=i},function(t,e,n){var r=n(46),o=n(77);function i(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}i.prototype=r(o.prototype),i.prototype.constructor=i,t.exports=i},function(t,e){t.exports=function(t){return t.placeholder}},function(t,e,n){var r=n(5),o=n(73),i=n(3),a=Function.prototype,c=Object.prototype,u=a.toString,s=c.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=s.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},function(t,e,n){var r=n(66),o=n(17),i=n(24),a=n(1),c=n(7),u=n(25),s=n(27),l=n(38),f=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(c(t)&&(a(t)||"string"==typeof t||"function"==typeof t.splice||u(t)||l(t)||i(t)))return!t.length;var e=o(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(s(t))return!r(t).length;for(var n in t)if(f.call(t,n))return!1;return!0}},function(t,e){t.exports=function(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getTemplateEditorIframe=e.getMotionEffectTrackerContainer=e.getEditorWritingFlowSelector=e.getEditorInserterMenuSelector=e.getContentAreaSelectorList=e.getContentAreaSelectorByVersion=e.getContentAreaSelector=void 0;var r=u(n(85)),o=u(n(103)),i=u(n(1)),a=u(n(104)),c=u(n(39));function u(t){return t&&t.__esModule?t:{default:t}}var s=function(){return{6.8:"block-editor-block-canvas",5.5:"interface-interface-skeleton__content",5.4:"block-editor-editor-skeleton__content",5.3:"edit-post-layout__content",5.2:"edit-post-layout__content","gutenberg-7.1":"edit-post-editor-regions__content"}};e.getContentAreaSelectorList=s;var l=function t(e,n){if((0,i.default)(e))return(0,r.default)(e,(function(e){return t(e,n)}));var o=n?".":"",a=(0,c.default)({6.8:"block-editor-block-canvas",5.5:"interface-interface-skeleton__content",5.4:"block-editor-editor-skeleton__content",5.3:"edit-post-layout__content",5.2:"edit-post-layout__content","gutenberg-7.1":"edit-post-editor-regions__content"},e,"");return"".concat(o).concat(a)};e.getContentAreaSelectorByVersion=l;var f=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e?".":"";return n+((0,o.default)(t.document.querySelector(l("6.8",!0)))?(0,o.default)(t.document.querySelector(l("5.5",!0)))?(0,o.default)(t.document.querySelector(l("5.4",!0)))?(0,o.default)(t.document.querySelector(l("gutenberg-7.1",!0)))?l("5.2"):l("gutenberg-7.1"):l("5.4"):l("5.5"):l("6.8"))};e.getContentAreaSelector=f;e.getEditorWritingFlowSelector=function(){arguments.length>0&&void 0!==arguments[0]||window;var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=t?".":"",n="block-editor-writing-flow";return e+n};e.getEditorInserterMenuSelector=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=f(t,!1),r=e?".":"";return r+((0,a.default)(l(["5.4","5.5"]),n)?"block-editor-inserter__menu":"editor-inserter__menu")};e.getMotionEffectTrackerContainer=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=f(t,!1),r=e?".":"";return r+("block-editor-editor-skeleton__content"===n?"block-editor-writing-flow":n)};e.getTemplateEditorIframe=function(t){return t.jQuery('iframe[name="editor-canvas"]').contents()}},function(t,e,n){var r=n(10),o=n(11),i=n(203),a=n(1);t.exports=function(t,e){return(a(t)?r:i)(t,o(e,3))}},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(179),o=n(88),i=n(182);t.exports=function(t,e,n,a,c,u){var s=1&n,l=t.length,f=e.length;if(l!=f&&!(s&&f>l))return!1;var d=u.get(t),p=u.get(e);if(d&&p)return d==e&&p==t;var v=-1,g=!0,h=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++v<l;){var y=t[v],b=e[v];if(a)var m=s?a(b,y,v,e,t,u):a(y,b,v,t,e,u);if(void 0!==m){if(m)continue;g=!1;break}if(h){if(!o(e,(function(t,e){if(!i(h,e)&&(y===t||c(y,t,n,a,u)))return h.push(e)}))){g=!1;break}}else if(y!==b&&!c(y,b,n,a,u)){g=!1;break}}return u.delete(t),u.delete(e),g}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e,n){var r=n(2).Uint8Array;t.exports=r},function(t,e,n){var r=n(91),o=n(61),i=n(9);t.exports=function(t){return r(t,i,o)}},function(t,e,n){var r=n(60),o=n(1);t.exports=function(t,e,n){var i=e(t);return o(t)?i:r(i,n(t))}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(188),o=n(24),i=n(1),a=n(25),c=n(26),u=n(38),s=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),l=!n&&o(t),f=!n&&!l&&a(t),d=!n&&!l&&!f&&u(t),p=n||l||f||d,v=p?r(t.length,String):[],g=v.length;for(var h in t)!e&&!s.call(t,h)||p&&("length"==h||f&&("offset"==h||"parent"==h)||d&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||c(h,g))||v.push(h);return v}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(13)(n(2),"WeakMap");t.exports=r},function(t,e,n){var r=n(4);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},function(t,e,n){var r=n(198),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)})),e}));t.exports=a},function(t,e,n){var r=n(58);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},function(t,e,n){var r=n(199),o=n(101);t.exports=function(t,e){return null!=t&&o(t,e,r)}},function(t,e,n){var r=n(18),o=n(24),i=n(1),a=n(26),c=n(63),u=n(14);t.exports=function(t,e,n){for(var s=-1,l=(e=r(e,t)).length,f=!1;++s<l;){var d=u(e[s]);if(!(f=null!=t&&n(t,d)))break;t=t[d]}return f||++s!=l?f:!!(l=null==t?0:t.length)&&c(l)&&a(d,l)&&(i(t)||o(t))}},function(t,e,n){var r=n(204)();t.exports=r},function(t,e){t.exports=function(t){return null===t}},function(t,e,n){var r=n(29),o=n(7),i=n(69),a=n(15),c=n(210),u=Math.max;t.exports=function(t,e,n,s){t=o(t)?t:c(t),n=n&&!s?a(n):0;var l=t.length;return n<0&&(n=u(l+n,0)),i(t)?n<=l&&t.indexOf(e,n)>-1:!!l&&r(t,e,n)>-1}},function(t,e){t.exports=function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}},function(t,e,n){var r=n(208),o=1/0;t.exports=function(t){return t?(t=r(t))===o||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(209),o=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(o,""):t}},function(t,e,n){var r=n(13),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){var r=n(110),o=n(72);t.exports=function(t){return r((function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,c=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,c&&o(n[0],n[1],c)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var u=n[r];u&&t(e,u,r,a)}return e}))}},function(t,e,n){var r=n(28),o=n(111),i=n(71);t.exports=function(t,e){return i(o(t,e,r),t+"")}},function(t,e,n){var r=n(70),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,c=o(i.length-e,0),u=Array(c);++a<c;)u[a]=i[e+a];a=-1;for(var s=Array(e+1);++a<e;)s[a]=i[a];return s[e]=n(u),r(t,this,s)}}},function(t,e){var n=Date.now;t.exports=function(t){var e=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(44);t.exports=function(t){return r(t,4)}},function(t,e,n){var r=n(16),o=n(9);t.exports=function(t,e){return t&&r(e,o(e),t)}},function(t,e,n){(function(t){var r=n(2),o=e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,c=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=c?c(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(62)(t))},function(t,e,n){var r=n(60),o=n(73),i=n(61),a=n(92),c=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,i(t)),t=o(t);return e}:a;t.exports=c},function(t,e,n){var r=n(75);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(46),o=n(73),i=n(27);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},function(t,e){t.exports={}},function(t,e,n){var r=n(28),o=n(121),i=o?function(t,e){return o.set(t,e),t}:r;t.exports=i},function(t,e,n){var r=n(95),o=r&&new r;t.exports=o},function(t,e,n){var r=n(123),o=n(124),i=n(242),a=n(48),c=n(125),u=n(80),s=n(251),l=n(49),f=n(2);t.exports=function t(e,n,d,p,v,g,h,y,b,m){var _=128&n,w=1&n,x=2&n,k=24&n,O=512&n,j=x?void 0:a(e);return function B(){for(var S=arguments.length,E=Array(S),A=S;A--;)E[A]=arguments[A];if(k)var W=u(B),I=i(E,W);if(p&&(E=r(E,p,v,k)),g&&(E=o(E,g,h,k)),S-=I,k&&S<m){var T=l(E,W);return c(e,n,t,B.placeholder,d,E,T,y,b,m-S)}var C=w?d:this,M=x?C[e]:e;return S=E.length,y?E=s(E,y):O&&S>1&&E.reverse(),_&&b<S&&(E.length=b),this&&this!==f&&this instanceof B&&(M=j||a(M)),M.apply(C,E)}}},function(t,e){var n=Math.max;t.exports=function(t,e,r,o){for(var i=-1,a=t.length,c=r.length,u=-1,s=e.length,l=n(a-c,0),f=Array(s+l),d=!o;++u<s;)f[u]=e[u];for(;++i<c;)(d||i<a)&&(f[r[i]]=t[i]);for(;l--;)f[u++]=t[i++];return f}},function(t,e){var n=Math.max;t.exports=function(t,e,r,o){for(var i=-1,a=t.length,c=-1,u=r.length,s=-1,l=e.length,f=n(a-u,0),d=Array(f+l),p=!o;++i<f;)d[i]=t[i];for(var v=i;++s<l;)d[v+s]=e[s];for(;++c<u;)(p||i<a)&&(d[v+r[c]]=t[i++]);return d}},function(t,e,n){var r=n(126),o=n(128),i=n(129);t.exports=function(t,e,n,a,c,u,s,l,f,d){var p=8&e;e|=p?32:64,4&(e&=~(p?64:32))||(e&=-4);var v=[t,e,c,p?u:void 0,p?s:void 0,p?void 0:u,p?void 0:s,l,f,d],g=n.apply(void 0,v);return r(t)&&o(g,v),g.placeholder=a,i(g,t,e)}},function(t,e,n){var r=n(76),o=n(78),i=n(127),a=n(245);t.exports=function(t){var e=i(t),n=a[e];if("function"!=typeof n||!(e in r.prototype))return!1;if(t===n)return!0;var c=o(n);return!!c&&t===c[0]}},function(t,e,n){var r=n(244),o=Object.prototype.hasOwnProperty;t.exports=function(t){for(var e=t.name+"",n=r[e],i=o.call(r,e)?n.length:0;i--;){var a=n[i],c=a.func;if(null==c||c==t)return a.name}return e}},function(t,e,n){var r=n(120),o=n(112)(r);t.exports=o},function(t,e,n){var r=n(247),o=n(248),i=n(71),a=n(249);t.exports=function(t,e,n){var c=e+"";return i(t,o(c,a(r(c),n)))}},function(t,e,n){var r=n(105),o=n(11),i=n(15),a=Math.max;t.exports=function(t,e,n){var c=null==t?0:t.length;if(!c)return-1;var u=null==n?0:i(n);return u<0&&(u=a(c+u,0)),r(t,o(e,3),u)}},function(t,e,n){var r=n(45),o=n(41),i=n(132),a=n(1);t.exports=function(t,e){return(a(t)?r:o)(t,i(e))}},function(t,e,n){var r=n(28);t.exports=function(t){return"function"==typeof t?t:r}},function(t,e){t.exports=function(t){return t&&t.length?t[0]:void 0}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(40),o=n(283),i=n(18);t.exports=function(t,e,n){for(var a=-1,c=e.length,u={};++a<c;){var s=e[a],l=r(t,s);n(l,s)&&o(u,i(s,t),l)}return u}},function(t,e,n){var r=n(43),o=n(22);t.exports=function(t,e,n){(void 0!==n&&!o(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},,,,,,,,,,,,function(t,e,n){"use strict";(function(t){var e=n(84),r=n(212);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var i=/ \d+vh/,a=/ \d+vh/g;!function(t){var n,c,u=ET_Builder.Frames.top,s=ETBlockLayoutPreview.blockId,l=!1,f=(0,e.getContentAreaSelector)(u,!1);function d(t){if("string"!=typeof t)return!1;var e=t.substr(-3,3);if(-1<["deg","rem"].indexOf(e))return e;var n=t.substr(-2,2);if(-1<["em","px","cm","mm","in","pt","pc","ex","vh","vw","ms"].indexOf(n))return n;var r=t.substr(-1,1);return-1<["%"].indexOf(r)&&r}var p={vhStylesArray:[],vhStyles:"",styleId:"et-block-layout-preview-overwrite-vh-style",init:function(){if(!(this.vhStylesArray.length>0)){var e=[],n=function(e){var n=[],r=[];if("string"==typeof e.style.cssText&&t(e.style.cssText.split(";")).each((function(t,e){i.test(e)&&r.push("".concat(e.trim(),";"))})),r.length>0){var o="".concat(e.selectorText,"{").concat(r.join(" "),"}");n.push(o)}return n};t(document.styleSheets).each((function(r,o){try{t(o.cssRules).each((function(r,o){if(o.selectorText&&i.test(o.cssText)&&(e=e.concat(n(o))),o.media&&i.test(o.cssText)){var a=[];t(o.cssRules).each((function(t,e){a=a.concat(n(e))})),e=e.concat(["@media ".concat(o.conditionText," {").concat(a.join(" "),"}")])}}))}catch(t){}})),this.vhStylesArray=e,this.vhStyles=e.join(" "),t("<style>",{id:this.styleId}).html(this.getStyles()).appendTo("body")}},getStyles:function(){var e=this.vhStyles,n=u||window,r=u.jQuery(".edit-post-header").outerHeight(),o=(t(n).height()-r)/100;return e.replace(a,(function(t){var e=parseInt(t);return"".concat(e*o,"px")}))},onEditorWindowResize:function(){t("style#".concat(p.styleId)).html(p.getStyles())}},v={position:{settings:{fixed:[],blockOffsetTop:0},isActive:function(){return"object"===o(ETBlockLayoutPreview.assistiveSettings.position)},getAssistiveSettings:function(){return ETBlockLayoutPreview.assistiveSettings.position},init:function(){if(this.isActive()&&"object"===o(ETBlockLayoutPreview.styleModes)){var e=u.jQuery(".block-editor-editor-skeleton__footer"),n=e.length<1?0:e.height(),r=t("#page-container"),i=r.outerWidth(),a=r.css("margin-left"),s=u.jQuery(".edit-post-header").outerHeight(),l=u.jQuery("#wpadminbar").outerHeight(),p=parseInt(u.innerHeight)-s-l-n,g=c.position().top,h=this.getAssistiveSettings();"block-editor-editor-skeleton__content"===f&&(g+=u.jQuery(".block-editor-block-list__layout").position().top,g+=parseInt(c.css("marginTop"))),ETBlockLayoutPreview.styleModes.forEach((function(e){for(var n,r,o,c,u,s,l,f,y,b,m,_,w,x,k=0;k<h.length;k++)if("fixed"===h[k].settings.position[e]){if(r=(n=h[k]).selector,u=(o="string"==typeof n.settings.position_fixed_origin[e]?n.settings.position_fixed_origin[e].split("_"):[])[0],l=o[1],m="desktop"===e?"0px":null,_=void 0!==n.settings.position.tablet,w=void 0!==n.settings.position.phone,x=_||w,-1<["top","center","bottom"].indexOf(u)){var O,j=d(O=n.settings.vertical_offset[e]);s=-1<["%","vh"].indexOf(j)?"".concat(parseInt(O)/100*p,"px"):O,"top"===u&&(c="string"==typeof s&&""!==s?s:m),"center"===u&&(c="".concat(p/2,"px")),"bottom"===u&&(v.position.setStyle("verticalOffset",r,"bottom: auto !important;",e,x),c="".concat(p-parseInt(t(r).outerHeight()),"px"),s&&(c="calc(".concat(c," - ").concat(s,")"))),"string"==typeof c&&(v.position.settings.fixed.push({selector:r,property:"top",initialValue:c,mode:e,isResponsive:x}),v.position.setStyle("verticalOffset",r,"top: ".concat(parseInt(c)-g,"px !important; bottom: auto !important;"),e,x))}-1<["left","right"].indexOf(l)&&(y=d(f=n.settings.horizontal_offset[e]),"string"==typeof(b=-1<["%","vw"].indexOf(y)?"".concat(parseInt(f)/100*i,"px"):"string"==typeof f&&""!==f?f:m)&&v.position.setStyle("horizontalOffset",r,"".concat(l,": calc(").concat(a," + ").concat(b,") !important;"),e,x))}v.position.settings.blockOffsetTop=g}))}},reinit:function(){v.position.settings.fixed=[],v.position.init(),v.position.applyFixedAdjustment()},applyFixedAdjustment:function(e){if(void 0===e){var n=u.document.getElementsByClassName(f);n[0]&&(e=t(n[0]).scrollTop())}var r=v.position.settings,o=e-r.blockOffsetTop;r.fixed.forEach((function(t){v.position.setStyle("verticalOffset",t.selector,"".concat(t.property,": ")+"calc(".concat(t.initialValue," + ").concat(o,"px)")+" !important; bottom: auto !important;",t.mode,t.isResponsive)}))},setStyle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a="".concat(n," .et-builder-adjustment-style.et-builder-adjustment-style--").concat(e,"-").concat(o),c="hover"===o?":hover":"",u="".concat(n+c,"{").concat(r,"}");i&&"desktop"===o?u="@media all and (min-width: 981px) { ".concat(u," }"):i&&"tablet"===o?u="@media all and (max-width: 980px) { ".concat(u," }"):i&&"phone"===o&&(u="@media all and (max-width: 767px) { ".concat(u," }")),t(a).remove(),t(n).append(t("<style />",{class:"et-builder-adjustment-style et-builder-adjustment-style--".concat(e,"-").concat(o),type:"text/css",text:u}))},onEditorScroll:function(){var e=t(this).scrollTop();v.position.applyFixedAdjustment(e)},onGbBlockOrderChange:function(){setTimeout((function(){v.position.reinit()}),300)},onEditorWindowResize:function(){v.position.reinit()}}};t((function(){n=u.jQuery('iframe[name="divi-layout-iframe-'.concat(s,'"]')),c=n.closest('.wp-block[data-type="divi/layout"]'),c.offset(),t("html").each((function(){"hidden"!==t(this).css("overflow")&&"scroll"!==t(this).css("overflow-y")||t(this).addClass("et-block-layout-force-overflow-auto")}));var o=new CustomEvent("ETBlockLayoutPreviewReady",{detail:{blockId:ETBlockLayoutPreview.blockId}});function i(){var n=(0,r.isTemplateEditor)()?(0,e.getTemplateEditorIframe)(u).find('iframe[name="divi-layout-iframe-'.concat(s,'"]')):u.jQuery('iframe[name="divi-layout-iframe-'.concat(s,'"]')),o=t("html").height(),i=n.closest('.wp-block[data-type="divi/layout"]');if(i.length<1&&(i=n.closest(".wp-block.is-reusable")),t("#et-boc").parents().addClass("et-pb-layout-preview-ancestor"),t("body").hasClass("et_divi_builder")&&t("#page-container .et-pb-layout-preview-ancestor").each((function(){t(this).width()!==t(this).parent().width()&&t(this).addClass("et-pb-layout-preview-width-correction")})),n.length&&(n.height(o),n.parent().css({lineHeight:1}),l&&n.closest(".et-block").css({height:""})),n.closest((0,e.getEditorInserterMenuSelector)(u,!0)).length>0){var a=u.innerWidth,c=o*(n.parent().width()/a);n.closest(".et-block").height(c)}else{var f="margin: 0 auto !important;",d=t("#page-container .et_pb_section").first().attr("data-box-shadow-offset");d&&(f+=" padding-top: ".concat(d," !important;"));var p=t("#page-container .et_pb_section").last().attr("data-box-shadow-offset");p&&(f+=" padding-bottom: ".concat(p," !important;"));var g="0px"===i.css("paddingRight")?0:28;t("#page-container").css({cssText:f,width:!window.ETBuilderBackend&&"".concat(i.outerWidth()-g,"px")}),v.position.isActive()&&v.position.onEditorWindowResize()}}function a(){i(),setTimeout((function(){l=!0,i(),l=!1}),1e3)}u.document.dispatchEvent(o),a(),t(window).on("resize",et_pb_debounce((function(){a()}),350)),p.init(),v.position.init();var d=window.et_pb_debounce((function(){p.onEditorWindowResize(),v.position.isActive()&&v.position.onEditorWindowResize()}),500);if(u.addEventListener("resize",d),v.position.isActive()){var g=u.document.getElementsByClassName(f);g[0]&&g[0].addEventListener("scroll",v.position.onEditorScroll),window.addEventListener("ETBlockGbBlockOrderChange",v.position.onGbBlockOrderChange)}window.addEventListener("unload",(function(){u.removeEventListener("resize",d),v.position.isActive()&&g[0]&&g[0].removeEventListener("scroll",v.position.onEditorScroll)})),t("body").on("click","a",(function(e){var n=t(this).attr("href").substr(0,1);if(!("#"===n)&&!t(this).is(".et_pb_ajax_pagination_container .wp-pagenavi a,.et_pb_ajax_pagination_container .pagination a"))return e.preventDefault(),""===n||u.document.dispatchEvent(new CustomEvent("ETBlockLayoutExternalLinkClick",{detail:{blockId:ETBlockLayoutPreview.blockId}})),!1})),t("body").on("submit","form",(function(t){return t.preventDefault(),u.document.dispatchEvent(new CustomEvent("ETBlockLayoutUnwantedFormSubmission",{detail:{blockId:ETBlockLayoutPreview.blockId}})),!1}))}))}(t)}).call(this,n(0))},function(t,e,n){var r=n(151),o=n(196),i=n(97);t.exports=function(t){var e=o(t);return 1==e.length&&e[0][2]?i(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(33),o=n(59);t.exports=function(t,e,n,i){var a=n.length,c=a,u=!i;if(null==t)return!c;for(t=Object(t);a--;){var s=n[a];if(u&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<c;){var l=(s=n[a])[0],f=t[l],d=s[1];if(u&&s[2]){if(void 0===f&&!(l in t))return!1}else{var p=new r;if(i)var v=i(f,d,l,t,e,p);if(!(void 0===v?o(d,f,3,i,p):v))return!1}}return!0}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(35),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():o.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(35);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(35);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(35);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var r=n(34);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(34),o=n(57),i=n(58);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(23),o=n(163),i=n(4),a=n(86),c=/^\[object .+?Constructor\]$/,u=Function.prototype,s=Object.prototype,l=u.toString,f=s.hasOwnProperty,d=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?d:c).test(a(t))}},function(t,e,n){var r,o=n(164),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},function(t,e,n){var r=n(2)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(167),o=n(34),i=n(57);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(t,e,n){var r=n(168),o=n(169),i=n(170),a=n(171),c=n(172);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=c,t.exports=u},function(t,e,n){var r=n(36);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(36),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(36),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},function(t,e,n){var r=n(36);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,n){var r=n(37);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(37);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(37);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(37);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},function(t,e,n){var r=n(33),o=n(87),i=n(183),a=n(186),c=n(17),u=n(1),s=n(25),l=n(38),f="[object Arguments]",d="[object Array]",p="[object Object]",v=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,g,h,y){var b=u(t),m=u(e),_=b?d:c(t),w=m?d:c(e),x=(_=_==f?p:_)==p,k=(w=w==f?p:w)==p,O=_==w;if(O&&s(t)){if(!s(e))return!1;b=!0,x=!1}if(O&&!x)return y||(y=new r),b||l(t)?o(t,e,n,g,h,y):i(t,e,_,n,g,h,y);if(!(1&n)){var j=x&&v.call(t,"__wrapped__"),B=k&&v.call(e,"__wrapped__");if(j||B){var S=j?t.value():t,E=B?e.value():e;return y||(y=new r),h(S,E,n,g,y)}}return!!O&&(y||(y=new r),a(t,e,n,g,h,y))}},function(t,e,n){var r=n(58),o=n(180),i=n(181);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,t.exports=a},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(6),o=n(89),i=n(22),a=n(87),c=n(184),u=n(185),s=r?r.prototype:void 0,l=s?s.valueOf:void 0;t.exports=function(t,e,n,r,s,f,d){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!f(new o(t),new o(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var p=c;case"[object Set]":var v=1&r;if(p||(p=u),t.size!=e.size&&!v)return!1;var g=d.get(t);if(g)return g==e;r|=2,d.set(t,e);var h=a(p(t),p(e),r,s,f,d);return d.delete(t),h;case"[object Symbol]":if(l)return l.call(t)==l.call(e)}return!1}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},function(t,e,n){var r=n(90),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,i,a,c){var u=1&n,s=r(t),l=s.length;if(l!=r(e).length&&!u)return!1;for(var f=l;f--;){var d=s[f];if(!(u?d in e:o.call(e,d)))return!1}var p=c.get(t),v=c.get(e);if(p&&v)return p==e&&v==t;var g=!0;c.set(t,e),c.set(e,t);for(var h=u;++f<l;){var y=t[d=s[f]],b=e[d];if(i)var m=u?i(b,y,d,e,t,c):i(y,b,d,t,e,c);if(!(void 0===m?y===b||a(y,b,n,i,c):m)){g=!1;break}h||(h="constructor"==d)}if(g&&!h){var _=t.constructor,w=e.constructor;_==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w||(g=!1)}return c.delete(t),c.delete(e),g}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(5),o=n(3);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(5),o=n(63),i=n(3),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},function(t,e,n){var r=n(94)(Object.keys,Object);t.exports=r},function(t,e,n){var r=n(13)(n(2),"DataView");t.exports=r},function(t,e,n){var r=n(13)(n(2),"Promise");t.exports=r},function(t,e,n){var r=n(13)(n(2),"Set");t.exports=r},function(t,e,n){var r=n(96),o=n(9);t.exports=function(t){for(var e=o(t),n=e.length;n--;){var i=e[n],a=t[i];e[n]=[i,a,r(a)]}return e}},function(t,e,n){var r=n(59),o=n(39),i=n(100),a=n(67),c=n(96),u=n(97),s=n(14);t.exports=function(t,e){return a(t)&&c(e)?u(s(t),e):function(n){var a=o(n,t);return void 0===a&&a===e?i(n,t):r(e,a,3)}}},function(t,e,n){var r=n(99);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(201),o=n(202),i=n(67),a=n(14);t.exports=function(t){return i(t)?r(a(t)):o(t)}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(40);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e,n){var r=n(41),o=n(7);t.exports=function(t,e){var n=-1,i=o(t)?Array(t.length):[];return r(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}},function(t,e){t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),c=a.length;c--;){var u=a[t?c:++o];if(!1===n(i[u],u,i))break}return e}}},function(t,e,n){var r=n(7);t.exports=function(t,e){return function(n,o){if(null==n)return n;if(!r(n))return t(n,o);for(var i=n.length,a=e?i:-1,c=Object(n);(e?a--:++a<i)&&!1!==o(c[a],a,c););return n}}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}},function(t,e,n){var r=n(107),o=n(4),i=n(12),a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,u=/^0o[0-7]+$/i,s=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=c.test(t);return n||u.test(t)?s(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e){var n=/\s/;t.exports=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}},function(t,e,n){var r=n(211),o=n(9);t.exports=function(t){return null==t?[]:r(t,o(t))}},function(t,e,n){var r=n(10);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.isVersion=e.isTemplateEditor=void 0;var r=n(84);e.isVersion=function(t){return(0,r.getContentAreaSelector)(window,!1)===(0,r.getContentAreaSelectorByVersion)(t)};e.isTemplateEditor=function(){return t.$topWindow(".edit-post-visual-editor").hasClass("is-template-mode")}}).call(this,n(213))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.viewportScrollTop=e.viewModeDraggableHandleWidth=e.triggerResizeForUIUpdate=e.topWindow=e.topViewportWidth=e.topDocument=e.stripHTMLTags=e.sprintf=e.setElementFont=e.sanitized_previously=e.replaceCodeContentEntities=e.removeFancyQuotes=e.removeClassNameByPrefix=e.processRangeValue=e.processIconFontData=e.processFontIcon=e.parseShortcode=e.parseInlineCssIntoObject=e.maybeLoadFont=e.maybeGetScrollbarWidth=e.log=e.linkRel=e.isYes=e.isValidHtml=e.isTB=e.isRealMobileDevice=e.isOnOff=e.isOn=e.isOff=e.isNo=e.isModuleLocked=e.isModuleDeleted=e.isMobileDevice=e.isLimitedMode=e.isJson=e.isIEOrEdge=e.isIE=e.isElementInViewport=e.isDefault=e.isBlockEditor=e.isBFB=e.is=e.intentionallyCloneDeep=e.intentionallyClone=e.hasValue=e.hasNumericValue=e.hasLocalStorage=e.hasBodyMargin=e.getViewModeByWidth=e.getSpacing=e.getScrollbarWidth=e.getRowLayouts=e.getResponsiveStatus=e.getProcessedTabSlug=e.getPreviewModes=e.getPrevBreakpoint=e.getOS=e.getNextBreakpoint=e.getModuleSectionType=e.getModuleAncestor=e.getModuleAddressSequence=e.getKeyboardList=e.getIntegerValue=e.getGradient=e.getFormattedPx=e.getFontFieldIndexes=e.getFixedHeaderHeight=e.getCorners=e.getCorner=e.getComponentType=e.getCommentsMarkup=e.getBreakpoints=e.getAdminBarHeight=e.generateResponsiveCss=e.generatePlaceholderCss=e.fontnameToClass=e.fixSliderHeight=e.fixBuilderContent=e.enableScrollLock=e.disableScrollLock=e.default=e.decodeOptionListValue=e.decodeHtmlEntities=e.cookies=e.condition=e.closestElement=e.callWindow=e.applyMixinsSafely=e.appendPrependCommaSeparatedSelectors=e.appWindow=e.appDocument=e.$topWindow=e.$topDocument=e.$appWindow=e.$appDocument=void 0;var r=K(n(214)),o=K(n(215)),i=K(n(113)),a=K(n(232)),c=K(n(233)),u=K(n(265)),s=K(n(131)),l=K(n(267)),f=K(n(268)),d=K(n(39)),p=K(n(269)),v=K(n(133)),g=K(n(104)),h=K(n(271)),y=K(n(1)),b=K(n(82)),m=K(n(272)),_=K(n(23)),w=K(n(273)),x=K(n(103)),k=K(n(4)),O=K(n(69)),j=K(n(20)),B=K(n(9)),S=K(n(85)),E=K(n(274)),A=K(n(99)),W=K(n(275)),I=K(n(276)),T=K(n(280)),C=K(n(281)),M=K(n(284)),F=K(n(285)),P=K(n(288)),L=K(n(291)),D=K(n(293)),R=K(n(301)),V=K(n(51)),$=K(n(302)),z=n(304),H=K(n(310)),N=n(311),U=K(n(312)),q=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==Y(t)&&"function"!=typeof t)return{default:t};var n=G(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&Object.prototype.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}r.default=t,n&&n.set(t,r);return r}(n(313)),Q=n(317);function G(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(G=function(t){return t?n:e})(t)}function K(t){return t&&t.__esModule?t:{default:t}}function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function J(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function X(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?J(Object(n),!0).forEach((function(e){nt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Z(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return tt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function et(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function nt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var rt,ot={},it=["et_pb_row","et_pb_row_inner"],at=["et_pb_column","et_pb_column_inner"],ct=function(t){switch(t){case"force_left":return"left";case"justified":return"justify";default:return t}},ut=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),nt(this,"postID",(0,d.default)(window.ETBuilderBackend,"currentPage.id")),nt(this,"path",(0,d.default)(window.ETBuilderBackend,"cookie_path"))}var e,n,r;return e=t,n=[{key:"secure",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;return"https:"===t.location.protocol}},{key:"getName",value:function(t,e){return"et-".concat(t,"-post-").concat(this.postID,"-").concat(e)}},{key:"set",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:300,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;o.wpCookies.set(this.getName(t,e),(0,j.default)(n)?e:n,r,this.path,!1,this.secure(o))}},{key:"get",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;return n.wpCookies.get(this.getName(t,e))}},{key:"remove",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;n.wpCookies.remove(this.getName(t,e),this.path,!1,this.secure(n))}}],n&&et(e.prototype,n),r&&et(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),st=new ut;e.cookies=st;var lt=window,ft=lt.document,dt=null,pt=null;t(window).on("et_fb_init",(function(){lt=window.ET_Builder.Frames.app,ft=lt.document}));var vt={applyMixinsSafely:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(!(0,b.default)(n))return(0,s.default)(n,(function(e){(0,l.default)(e,(function(e,n){(0,j.default)(t[n])?t[n]=(0,_.default)(e)?e.bind(t):e:t[n]=(0,_.default)(e)?(0,T.default)(t[n],e.bind(t)):t[n]}))})),t},intentionallyClone:function(t){return(0,i.default)(t)},intentionallyCloneDeep:function(t){return(0,a.default)(t)},sanitized_previously:N.sanitizedPreviously,log:function(t,e,n){if(!ET_FB.utils.debug())return!1;var r=e||"general";if((0,g.default)(ET_FB.utils.debugLogAreas(),r))switch(n||"log"){case"warn":console.warn(t);break;case"info":console.info(t);break;default:console.log(t)}},sprintf:H.default,isJson:q.isJson,isValidHtml:q.isValidHtml,getOS:function(){if(!(0,j.default)(window.navigator)){if(-1!=navigator.appVersion.toLocaleLowerCase().indexOf("win"))return"Windows";if(-1!=navigator.appVersion.toLocaleLowerCase().indexOf("mac"))return"MacOS";if(-1!=navigator.appVersion.toLocaleLowerCase().indexOf("x11"))return"UNIX";if(-1!=navigator.appVersion.toLocaleLowerCase().indexOf("linux"))return"Linux"}return"Unknown"},isModuleLocked:function(t,e){var n=t.props||t,r=(0,d.default)(n,"address"),o=vt.isOn((0,d.default)(n,"attrs.locked"))||(0,d.default)(n,"lockedParent");if(!o){var i=vt.getModuleAddressSequence(r);(0,s.default)(i,(function(t){var n=(0,u.default)(e,{address:t});if(vt.isOn((0,d.default)(n,"attrs.locked"))||(0,d.default)(n,"lockedParent"))return o=!0,!1}))}return o},isModuleDeleted:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if((0,d.default)(t,"attrs._deleted"))return!0;if(n){var r=(0,d.default)(t,"address","").split(".");if(r.length>1){var o=vt.getModuleAddressSequence(r),i=!1;if((0,s.default)(o,(function(t){var n=(0,u.default)(e,{address:t});(0,d.default)(n,"attrs._deleted")&&(i=!0)})),i)return!0}}return!1},getComponentType:function(t){var e=t.props||t,n=(0,d.default)(e,"type"),r="module";switch(!0){case"et_pb_section"===n:r="section";break;case(0,g.default)(it,n):r="row";break;case(0,g.default)(at,n):r="column"}return r},getModuleSectionType:function(t,e){var n=t.props||t,r=(0,v.default)((0,d.default)(n,"address").split(".")),o=(0,u.default)(e,{address:r});return vt.isOn((0,d.default)(o,"attrs.fullwidth"))?"fullwidth":vt.isOn((0,d.default)(o,"attrs.specialty"))?"specialty":"regular"},getModuleAncestor:function(t,e,n){var r,o=e.props||e,i=vt.getModuleSectionType(o,n),a=vt.getModuleAddressSequence((0,d.default)(o,"address",""));return(0,s.default)(a,(function(e){var o=(0,u.default)(n,{address:e}),a=(0,d.default)(o,"type","");if("specialty"===i)0===a.replace("et_pb_","").indexOf(t)&&(r=o);else a.replace("et_pb_","")===t&&(r=o)})),r},is:function(t,e){var n=e.props||e,r=!1;switch(t){case"section":r="section"===Pe(n);break;case"row":r="row"===Pe(n);break;case"row-inner":r="et_pb_row_inner"===(0,d.default)(n,"type");break;case"column":r="column"===Pe(n);break;case"column-inner":r="et_pb_column_inner"===(0,d.default)(n,"type");break;case"module":r="module"===Pe(n)&&!(0,d.default)(n,"is_module_child");break;case"fullwidth":r=wt((0,d.default)(n,"attrs.fullwidth"));break;case"regular":r="section"===Pe(n)&&!wt((0,d.default)(n,"attrs.fullwidth"))&&!wt((0,d.default)(n,"attrs.specialty"));break;case"specialty":r=wt((0,d.default)(n,"attrs.specialty"));break;case"disabled":r=wt((0,d.default)(n,"attrs.disabled"));break;case"locked":r=wt((0,d.default)(n,"attrs.locked"));break;case"removed":r="et-fb-removed-component"===(0,d.default)(n,"component_path","");break;default:r=(0,d.default)(n,t)}return r},isOn:q.isOn,isOff:q.isOff,isOnOff:q.isOnOff,isYes:q.isYes,isNo:q.isNo,isDefault:q.isDefault,isMobileDevice:function(){if(null===dt)try{document.createEvent("TouchEvent"),dt=vt.$appWindow().width()<=1024}catch(t){dt=!1}return dt},isFileExtension:q.isFileExtension,isIEOrEdge:function(){return document.documentMode||window.StyleMedia},isIE:function(){return vt.$appWindow("body").hasClass("ie")},isBlockEditor:function(){return(0,p.default)(window,"wp.blocks")},isResponsiveView:function(t){return(0,g.default)(["tablet","phone"],t)},isRealMobileDevice:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},getConditionalDefault:function(t,e,n,r){if(!(0,y.default)(t)||!(0,k.default)((0,d.default)(t,"1")))return t;var o=Z(t,2),i=o[0],a=o[1];r&&(i=U.default.getHoverField(i));var c=n?n.resolve(i):(0,d.default)(e,i);return(0,j.default)(c)&&(c=(0,B.default)(a)[0]),(0,d.default)(a,c)},getValueOrConditionalDefault:function(t,e,n){var r=(0,d.default)(e,t);return(0,j.default)(r)||""===r?vt.getConditionalDefault((0,d.default)(n,t),e):r},condition:function(t){return(0,d.default)(ETBuilderBackend,["conditionalTags",t])},hasNumericValue:q.hasNumericValue,hasValue:q.hasValue,get:q.get,getResponsiveStatus:function(t){var e=(0,O.default)(t)?t.split("|"):["off","desktop"];return!(0,j.default)(e[0])&&vt.isOn(e[0])},getResponsiveLastMode:function(t){var e=(0,O.default)(t)?t.split("|"):["off","desktop"];return(0,d.default)(e,[1],"desktop")},parseShortcode:function(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this,a=document.documentMode,c="et-fb-preview-".concat((0,W.default)(),"-").concat(Math.floor(1e3*Math.random()+1)),u="".concat(ETBuilderBackend.site_url,"/?et_pb_preview=true&et_pb_preview_nonce=").concat(ETBuilderBackend.nonces.preview,"&iframe_id=").concat(c);setTimeout((function(){var s=t('*[data-shortcode-id="'.concat(r,'"]')),l=s.length?"".concat(s.width(),"px"):"100%",f=t("<iframe />",{id:c,src:u,style:"position: absolute; bottom: 0; left: 0; opacity: 0; pointer-events: none; width: ".concat(l,"; height: 100%;")}),d=!1,p={et_pb_preview_nonce:ETBuilderBackend.nonces.preview,is_fb_preview:!0,shortcode:e},v=o||t("body");v.append(f),f.on("load",(function(){if(!d){var t=v.find("#".concat(c))[0];!(0,j.default)(a)&&a<10&&(p=JSON.stringify(p)),t.contentWindow.postMessage(p,u),d=!0;var e=window.addEventListener?"addEventListener":"attachEvent";(0,window[e])("attachEvent"==e?"onmessage":"message",(function(t){t.data.iframe_id===c&&(0,O.default)(t.data.html)&&i.hasValue(t.data)&&(n(t.data),o||f.remove())}),!1)}}))}),0)},renderExtendedIcon:function(t){var e=vt.getExtendedIconData(t);return 0===e.unicode.indexOf("&#")?vt.decodeIconUnicode(e.unicode):e.unicode},maybeFaIconType:function(t){return"divi"!==vt.getExtendedIconData(t).type},getExtendedIconFontFamily:function(t){return"divi"!==vt.getExtendedIconData(t).type?"FontAwesome":"ETmodules"},getExtendedIconFontWeight:function(t){return Number.parseInt(vt.getExtendedIconData(t).fontWeight)},maybeBlackExtendedIconFontWeight:function(t){return vt.maybeBlackFontWeightIcon(vt.getExtendedIconData(t).fontWeight)},maybeNormalExtendedIconFontWeight:function(t){return vt.maybeNormalFontWeightIcon(vt.getExtendedIconData(t).fontWeight)},maybeBlackFontWeightIcon:function(t){return 900===Number.parseInt(t)},maybeNormalFontWeightIcon:function(t){return 400===Number.parseInt(t)},decodeIconUnicode:function(e){return void 0===e||(0,b.default)(e)?null:t.parseHTML((0,V.default)(e))[0].nodeValue},convertIconUnicodeToCssValue:function(t){var e=vt.getExtendedIconData(t),n="";if(1===e.unicode.length){if("divi"!==e.type)return'"\\'.concat(e.unicode,'"');for(var r=ETBuilderBackend.fontIconsExtended,o=0;o<r.length;o++)if(r[o].decoded_unicode===e.unicode){n=r[o].unicode;break}}else n=e.unicode;return n=(n=(n=n.toLowerCase().replace("&#x","")).replace("&amp;#x","")).replace(";",""),'"\\'.concat(n,'"')},getExtendedIconStyleData:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hover_icon",n=["","_phone","_tablet","__hover","__sticky"],r=X({},t);return n.forEach((function(t){void 0!==r["".concat(e).concat(t)]&&vt.maybeExtendedFontIconRaw(r["".concat(e).concat(t)])&&(r["".concat(e,"_font_family").concat(t)]=vt.getExtendedIconFontFamily(r["".concat(e).concat(t)]),r["".concat(e,"_font_weight").concat(t)]=vt.getExtendedIconData(r["".concat(e).concat(t)]).fontWeight,r["".concat(e).concat(t)]=vt.convertIconUnicodeToCssValue(r["".concat(e).concat(t)]),void 0!==r["".concat(e,"_last_edited")]&&(r["".concat(e,"_font_family_last_edited")]=r["".concat(e,"_last_edited")],r["".concat(e,"_font_weight_last_edited")]=r["".concat(e,"_last_edited")]),"__hover"===t&&void 0!==r["".concat(e,"__hover_enabled")]&&(r["".concat(e,"_font_family__hover_enabled")]=r["".concat(e,"__hover_enabled")],r["".concat(e,"_font_weight__hover_enabled")]=r["".concat(e,"__hover_enabled")]),"__sticky"===t&&void 0!==r["".concat(e,"__sticky_enabled")]&&(r["".concat(e,"_font_family__sticky_enabled")]=r["".concat(e,"__sticky_enabled")],r["".concat(e,"_font_weight__sticky_enabled")]=r["".concat(e,"__sticky_enabled")]))})),{attrs:r,font_family_attr_name:"".concat(e,"_font_family"),font_weight_attr_name:"".concat(e,"_font_weight")}},getExtendedIconData:function(t){if(vt.maybeExtendedFontIconRaw(t)){var e=t.split("||");return{unicode:e[0],type:e[1],fontWeight:void 0!==e[2]?e[2]:400}}return!1},maybeExtendedFontIconRaw:function(t){return!(0,b.default)(t)&&"string"==typeof t&&0<t.indexOf("||")&&(0<t.indexOf("fa")||0<t.indexOf("divi"))},processIconFontData:function(t){if(!(0,b.default)(t)&&"string"==typeof t&&0<t.indexOf("||")&&(0<t.indexOf("fa")||0<t.indexOf("divi"))){var e=t.split("||");return{iconFontFamily:"divi"!==e[1]?"FontAwesome":"ETmodules",iconFontWeight:void 0!==e[2]?e[2]:400}}},processFontIcon:function(e,n){if((0,j.default)(e))return null;if((0,b.default)(e))return"";if((0,b.default)(n)&&0<e.indexOf("||")&&(0<e.indexOf("fa")||0<e.indexOf("divi"))){var r=e.split("||")[0];return t.parseHTML((0,V.default)(r))[0].nodeValue}var o=parseInt(e.replace(/[^0-9]/g,"")),i=n?ETBuilderBackend.fontIconsDown:ETBuilderBackend.fontIcons;return null===e.trim().match(/^%%/)||(0,j.default)(i[o])||(e=i[o]),e?t.parseHTML((0,V.default)(e))[0].nodeValue:null},generateResponsiveCss:function(t,e,n,r){if((0,b.default)(t))return"";var o=[];return(0,s.default)(t,(function(t,i){if(""!==t&&void 0!==t){var a={selector:e,declaration:"",device:i},c=void 0!==r&&""!==r?r:";";Array.isArray(t)&&!(0,b.default)(t)?(0,s.default)(t,(function(t,e){""!==t&&(a.declaration+="".concat(e,":").concat(t).concat(c))})):a.declaration="".concat(n,":").concat(t).concat(c),o.push(a)}})),o},generatePlaceholderCss:q.generatePlaceholderCss,replaceCodeContentEntities:q.replaceCodeContentEntities,removeFancyQuotes:q.removeFancyQuotes,processRangeValue:function(t,e){if((0,j.default)(t))return"";var n="string"==typeof t?t.trim():t,r=parseFloat(n),o=n.toString().replace(r,"");return""===o&&(o="line_height"===(void 0!==e?e:"")&&3>=r?"em":"px"),isNaN(r)?"":r.toString()+o},getCorners:q.getCorners,getCorner:q.getCorner,gradientFieldsMapping:function(t){var e={repeat:"color_gradient_repeat",type:"color_gradient_type",direction:"color_gradient_direction",radialDirection:"color_gradient_direction_radial",stops:"color_gradient_stops",unit:"color_gradient_unit",overlaysImage:"color_gradient_overlays_image",colorStart:"color_gradient_start",startPosition:"color_gradient_start_position",colorEnd:"color_gradient_end",endPosition:"color_gradient_end_position"};return t?(0,d.default)(e,t):e},gradientDefault:function(){return{type:ETBuilderBackend.defaults.backgroundOptions.type,direction:ETBuilderBackend.defaults.backgroundOptions.direction,radialDirection:ETBuilderBackend.defaults.backgroundOptions.radialDirection,stops:ETBuilderBackend.defaults.backgroundOptions.stops,overlaysImage:ETBuilderBackend.defaults.backgroundOptions.overlaysImage,colorStart:ETBuilderBackend.defaults.backgroundOptions.colorStart,startPosition:ETBuilderBackend.defaults.backgroundOptions.startPosition,colorEnd:ETBuilderBackend.defaults.backgroundOptions.colorEnd,endPosition:ETBuilderBackend.defaults.backgroundOptions.endPosition}},getSpacing:q.getSpacing,closestElement:q.closestElement,getBreakpoints:function(){return["desktop","tablet","phone"]},getPrevBreakpoint:function(t){return vt.getBreakpoints()[(0,h.default)(vt.getBreakpoints(),t)-1]},getNextBreakpoint:function(t){return vt.getBreakpoints()[(0,h.default)(vt.getBreakpoints(),t)+1]},getPreviewModes:function(){return["wireframe","zoom","desktop","tablet","phone"]},getGradient:function(t,e){var n,r,i=(t=(0,o.default)(vt.gradientDefault(),(0,M.default)(t,q.hasValue))).stops.replace(/\|/g,", ");switch(t.type){case"conic":n="conic",r="from ".concat(t.direction," at ").concat(t.radialDirection);break;case"elliptical":n="radial",r="ellipse at ".concat(t.radialDirection);break;case"radial":case"circular":n="radial",r="circle at ".concat(t.radialDirection);break;default:n="linear",r=t.direction}return n=wt(t.repeat)?"repeating-".concat(n):n,-1!==t.stops.indexOf("gcid-")&&(0,s.default)(e,(function(t){-1!==i.indexOf(t[0])&&(i=i.replaceAll(t[0],t[1].color))})),"".concat(n,"-gradient( ").concat(r,", ").concat(i," )")},removeClassNameByPrefix:function(e,n){var r=t(void 0===n?"body":n),o=r.attr("class"),i=new RegExp("".concat(e,"[^\\s]+"),"g");if(!(0,j.default)(o)){var a=o.replace(i,"");r.attr("class",a.trim())}},getKeyboardList:function(t){var e;switch(t){case"sectionLayout":e=["49","50","51"];break;case"rowLayout":e=["49","50","51","52","53","54","55","56","57","48","189"];break;case"arrowDirections":e=["38","39","40","37"];break;default:e=!1}return e},getRowLayouts:function(t,e){var n="et_pb_row"===t?ETBuilderBackend.columnLayouts.regular:[];if("et_pb_row_inner"===t&&!(0,j.default)(e)){var r=ETBuilderBackend.columnLayouts.specialty[e];n=(0,S.default)((0,F.default)(r.columns),(function(t){var e=t+1;return 1===e?"4_4":(0,S.default)((0,F.default)(e),(function(){return"1_".concat(e)})).join(",")}))}return n},maybeLoadFont:function(e,n){var r=vt.$topWindow("head").add(t("head")),o=ETBuilderBackend.et_builder_fonts_data,i=ETBuilderBackend.customFonts,a=ETBuilderBackend.removedFonts,c=ETBuilderBackend.useGoogleFonts,u=(0,B.default)(ETBuilderBackend.websafeFonts),l=void 0!==o[e]&&void 0!==o[e].styles?":".concat(o[e].styles):"",f=void 0!==o[e]&&void 0!==o[e].character_set?"&".concat(o[e].character_set):"",p=(0,d.default)(a,"".concat(e,".parent_font"),!1)?a[e].parent_font:e,v=e?vt.fontnameToClass(e):"";if((0,j.default)(i[e])){if(r.find("link#".concat(v)).length||!c||(0,g.default)(u,e))return;e=p.replace(/ /g,"+"),r.append('<link id="'.concat(v,'" href="//fonts.googleapis.com/css?family=').concat(e).concat(l).concat(f,'" rel="stylesheet" type="text/css" />'))}else{if(r.find("style#".concat(v)).length)return;var h=(0,d.default)(i[e],"font_url",""),y=(0,O.default)(h)?"src: url('".concat(h,"');"):"";if(""===y&&!(0,O.default)(h)){var b={eot:{url:(0,d.default)(h,"eot",!1),format:"embedded-opentype"},woff2:{url:(0,d.default)(h,"woff2",!1),format:"woff2"},woff:{url:(0,d.default)(h,"woff",!1),format:"woff"},ttf:{url:(0,d.default)(h,"ttf",!1),format:"truetype"},otf:{url:(0,d.default)(h,"otf",!1),format:"opentype"}};b.eot.url&&(y="src: url('".concat(b.eot.url,"'); src: url('").concat(b.eot.url,"?#iefix') format('embedded-opentype')")),(0,s.default)(b,(function(t,e){"eot"!==e&&t.url&&(y+=""===y?"src: ":", ",y+="url('".concat(t.url,"') format('").concat(t.format,"')"))}))}r.append('<style id="'.concat(v,'">@font-face{font-family:"').concat(e,'"; ').concat(y,";}</style>"))}},fontnameToClass:function(t){return"et_gf_".concat(t.replace(/ /g,"_").toLowerCase())},callWindow:function(t){if((0,p.default)(window,t)){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];(0,d.default)(window,t).apply(void 0,n)}},$appDocument:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vt.appDocument();return lt.jQuery(t)},$appWindow:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vt.appWindow();return lt.jQuery(t)},$topDocument:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vt.topDocument();return vt.topWindow().jQuery(t)},$topWindow:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vt.topWindow();return vt.topWindow().jQuery(t)},$TBViewport:function(){return vt.$topWindow(".et-common-visual-builder").first()},$TBScrollTarget:function(){return vt.$TBViewport().find("#et-fb-app")},topViewportWidth:function(){return vt.isTB()?vt.$TBViewport().width():vt.topWindow().innerWidth},topViewportHeight:function(){return vt.isTB()?vt.$TBViewport().height():vt.$topWindow().height()},viewportScrollTop:function(){var t=vt.appWindow().ET_Builder.API.State.View_Mode;return vt.isTB()?vt.$TBScrollTarget().scrollTop():vt.isBFB()||t.isPhone()||t.isTablet()||t.isZoom()?vt.$topWindow().scrollTop():vt.$appWindow().scrollTop()},getTopWindowWidth:function(){return vt.isBFB()?vt.$topWindow("#et_pb_layout").width():vt.$topWindow().width()},getAppWindowWidth:function(){return vt.$appWindow().width()},getBuilderAvailableWidth:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(vt.isBFB())return vt.topDocument().getElementById("et_pb_layout").clientWidth;var o=e&&t,i=(0,d.default)(vt.appWindow(),"ET_Builder.API.State.View_Mode",{}),a=vt.maybeGetScrollbarWidth(i.current),c=vt.getTopWindowWidth();return a&&vt.isTB()&&(c-=a),o&&(0,g.default)(["left","right"],n)&&(c-=r),c},appDocument:function(){return ft},appWindow:function(){return lt},topDocument:function(){return vt.topWindow().document},topWindow:function(){return z.top_window},hasFixedHeader:function(){return(0,g.default)(["fixed","absolute"],t("header").css("position"))},isElementInViewport:function(e){if(e.length>0&&(e=e[0]),!(0,b.default)(e)){var n=e.ownerDocument?e.ownerDocument.defaultView:e.defaultView,r=n.jQuery&&n.jQuery(n),o=n.frameElement?n.frameElement.getBoundingClientRect():{};if(r){var i=e.getBoundingClientRect(),a=i.top;i.height;o.top&&(a-=Math.abs(o.top));var c=r.height(),u=0;return vt.hasFixedHeader()&&(u=t("header").height()),a<=c&&a>=u}}},getCommentsMarkup:function(t,e){(0,j.default)(t);var n=ETBuilderBackend.commentsModuleMarkup;if("h1"!==t&&(n=(n=n.replace("<h1","<".concat(t))).replace("</h1>","</".concat(t,">"))),"h3"!==e){var o=new RegExp('<h3 id="reply-title" class="comment-reply-title">(.*?)</h3>',"g");n=(0,r.default)(n,o,(function(t){return t=(t=t.replace("<h3","<".concat(e))).replace("</h3>","</".concat(e,">"))}))}return n},decodeHtmlEntities:function(t){return(t=(0,O.default)(t)?t:"").replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(e)}))},isLimitedMode:function(){return vt.condition("is_limited_mode")},isBFB:function(){return vt.condition("is_bfb")},isTB:function(){return vt.condition("is_tb")},isLB:function(){return vt.condition("is_layout_block")},isFB:function(){return!vt.isBFB()&&!vt.isTB()&&!vt.isLB()},getWindowScrollLocation:function(t){return!vt.condition("is_bfb")&&(0,g.default)(["wireframe","desktop"],t)?"app":"top"},hasBodyMargin:function(){return t("#et_pb_root").hasClass("et-fb-has-body-margin")},fixSliderHeight:function(t){setTimeout((function(){return et_fix_slider_height(t)}),600)},fixBuilderContent:function(e){setTimeout((function(){e.find(".et-waypoint, .et_pb_circle_counter, .et_pb_number_counter").each((function(){var e=t(this);e.hasClass("et_pb_circle_counter")&&(vt.appWindow().et_pb_reinit_circle_counters(e),(0,j.default)(e.data("easyPieChart"))||e.data("easyPieChart").update(e.data("number-value"))),e.hasClass("et_pb_number_counter")&&(vt.appWindow().et_pb_reinit_number_counters(e),(0,j.default)(e.data("easyPieChart"))||e.data("easyPieChart").update(e.data("number-value"))),e.find(".et_pb_counter_amount").length>0&&e.find(".et_pb_counter_amount").each((function(){vt.appWindow().et_bar_counters_init(t(this))})),e.css({opacity:"1"})})),e.find(".et_parallax_bg").length&&e.find(".et_parallax_bg").each((function(){window.et_pb_parallax_init(t(this))})),vt.appWindow().et_reinit_waypoint_modules(),(0,j.default)(window.et_shortcodes_init)||vt.appWindow().et_shortcodes_init(e),vt.$appWindow().trigger("resize")}),0)},triggerResizeForUIUpdate:function(){var e=this;clearTimeout(window.ETBuilderFauxResize),window.ETBuilderFauxResize=setTimeout((function(){var n=e;t(window).trigger("resize"),vt.callWindow("et_fix_page_container_position"),n.condition("is_bfb")&&setTimeout((function(){t(document.activeElement).is("iframe")&&t(document.activeElement).trigger("blur")}),200)}),200)},getHeadingLevel:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"h2",n=t.parentAttrs,r=t.attrs;return vt.hasValue(r.header_level)?r.header_level:vt.hasValue(n)&&vt.hasValue(n.header_level)?n.header_level:e},generateRowStructureClass:function(t){if((0,j.default)(t.content)||""===t.content||(0,b.default)(t.content))return"";var e="";switch((0,s.default)(t.content,(function(t){var n=(0,d.default)(t,"attrs.type");n&&(0,O.default)(n)&&(e+="_".concat(n.replace("_","-").trim()))})),e){case"_4-4":case"_1-2_1-2":case"_1-3_1-3_1-3":case"_2-5_3-5":case"_3-5_2-5":case"_1-3_2-3":case"_2-3_1-3":case"_1-5_3-5_1-5":case"_3-8_3-8":case"_1-3_1-3":e="";break;case"_1-4_1-4_1-4_1-4":e="et_pb_row_4col";break;case"_1-5_1-5_1-5_1-5_1-5":e="et_pb_row_5col";break;case"_1-6_1-6_1-6_1-6_1-6_1-6":e="et_pb_row_6col";break;default:e="et_pb_row".concat(e)}return e},shouldComponentUpdate:function(t,e,n){var r=e,o=t.props;t.props.wireframeMode&&(r=vt._cleanPropsForWireframeComparison(e),o=vt._cleanPropsForWireframeComparison(t.props));var i=t&&t.state&&(0,k.default)(t.state)?t.state:{},a=n&&(0,k.default)(n)?n:{},c=o||{},u=c.isInViewport,s=c.computedState,l=r||{},f=u===l.isInViewport,d=s===l.computedState,p=i.isInViewportUpdater===a.isInViewportUpdater;return!(r._v===o._v&&!1===u&&f&&d&&p)&&(!(0,m.default)(r,o)||!(0,m.default)(n,t.state))},shouldComponentUpdateDelayed:function(t,e){var n=((0,k.default)(t)?t:{}).props,r=(0,k.default)(n)?n:{},o=(0,k.default)(e)?e:{},i=r.isInViewport,a=r.previewMode,c=r._v,u=o.isInViewport,s=o.previewMode,l=o._v;return!1===i&&!1===u&&(a!==s||c!==l)},shouldComponentUpdateOnScroll:function(t,e){var n=t.props,r=n.isInViewport,o=n.eventMode,i=e.isInViewport,a=e.eventMode;return!1===r&&!1===i&&o!==a&&("grid"===o||"grid"===a)},shouldComponentUpdateInViewport:function(t,e,n){var r=(0,k.default)(t)?t:{},o=r.props,i=r.state,a=(0,k.default)(o)?o:{},c=(0,k.default)(e)?e:{},s=(0,k.default)(i)?i:{},l=(0,k.default)(n)?n:{};if(s.isInViewportUpdater!==l.isInViewportUpdater)return!0;var f=a.isInViewport,d=a.shortcode_index,p=c.isInViewport,v=c.shortcode_index;if(!1!==f||!1!==p)return!0;if(d!==v)return!0;if((0,y.default)(a.content)&&(0,y.default)(c.content)){var g=vt.getPropsFlat(a),h=vt.getPropsFlat(c);return(0,L.default)(g,(function(t){var e=t._key,n=t.shortcode_index,r=(0,u.default)(h,(function(t){return t._key===e}));return!r||r.shortcode_index!==n}))}return!1},whyComponentDidUpdate:function(t,e,n,r){if(t){var o=t.props,i=t.state,a=X({},o),c=X({},i),u={},l={};(0,s.default)(a,(function(t,n){if((0,k.default)(t))(0,s.default)(t,(function(t,o){var i=(0,d.default)(e,"".concat(n,".").concat(o));(0,m.default)(t,i)||(u["".concat(n,":").concat(o)]={currentProps:t,previousProps:i,componentId:r})}));else{var o=(0,d.default)(e,n);(0,m.default)(t,o)||(u[n]={currentProps:t,previousProps:o,componentId:r})}})),(0,b.default)(u)||console.table(u),(0,s.default)(c,(function(t,e){if((0,k.default)(t))(0,s.default)(t,(function(t,o){var i=(0,d.default)(n,"".concat(e,".").concat(o));(0,m.default)(t,i)||(l["".concat(e,".").concat(o)]={currentState:t,previousState:i,componentId:r})}));else{var o=(0,d.default)(n,e);(0,m.default)(t,o)||(l[e]={currentState:t,previousState:o,componentId:r})}})),(0,b.default)(l)||console.table(l)}},findObjectByKeyDeep:function(t,e){var n;return(0,s.default)(t,(function(t,r){return r===e?(n=t,!0):(0,k.default)(t)?(n=vt.findObjectByKeyDeep(t,e),!(0,w.default)(n)):void 0})),n},getPropsFlat:function(t,e){return(0,w.default)(e)&&(e=[]),t&&(0,y.default)(t.content)&&(0,s.default)(t.content,(function(t){vt.getPropsFlat(t,e)})),t&&t._key&&e.push(t),e},_cleanPropsForWireframeComparison:function(t){if((0,j.default)(t))return t;var e=(0,I.default)(t,["attrs","children","content"]);return t.attrs&&(e.attrs=(0,C.default)(t.attrs,["locked","global_module","admin_label","collapsed","ab_subject_id","ab_goal","disabled","disabled_on","column_structure","type","_deleted"])),t.content&&(0,y.default)(t.content)&&!(0,b.default)(t.content)?(e.content=[],(0,s.default)(t.content,(function(t){e.content.push(vt._cleanPropsForWireframeComparison(t))}))):(0,y.default)(t.content)||(e.content=""),e},getAdminBarHeight:function(){if(vt.isTB())return 32;var t=vt.$topWindow("#wpadminbar");return t.length>0?parseInt(t.innerHeight()):0},getScrollbarWidth:Q.getScrollbarWidth,maybeGetScrollbarWidth:function(t){if(vt.isBFB())return 0;var e=vt.$topWindow("html"),n=vt.$appWindow("html"),r=vt.isTB()?vt.getAdminBarHeight():0,o=vt.$topDocument("#et-fb-app-frame").outerHeight(!0),i=e.outerHeight();return(0,g.default)(["desktop","wireframe"],t)&&(o=n.innerHeight()+r,i=vt.$topWindow().innerHeight()),(0,g.default)(["zoom"],t)&&(o=Math.ceil(n.innerHeight()/2)+r,i=vt.$topWindow().innerHeight()),o>i?vt.getScrollbarWidth():0},getScrollTargets:function(){var t=(0,d.default)(vt.appWindow(),"ET_Builder.API.State.View_Mode",{}),e=vt.$appWindow("html");return vt.isTB()?e=vt.$TBScrollTarget():vt.isBlockEditor()||!vt.isBFB()&&(t.isDesktop()||t.isWireframe())||(e=vt.$topWindow("html")),e},getScrollEventTarget:function(){var t=vt.appWindow().ET_Builder.API.State.View_Mode,e=vt.appWindow();return vt.isTB()?e=vt.$TBScrollTarget().get(0):(vt.isBFB()||!t.isDesktop()&&!t.isWireframe())&&(e=vt.topWindow()),e},enableScrollLock:function(){var t=vt.$topWindow(".et-fb-page-settings-bar"),e=vt.$topWindow("#wpadminbar"),n=vt.$topWindow(".et_fixed_nav:not(.et_vertical_nav) #top-header"),r=vt.$topWindow(".et_fixed_nav:not(.et_vertical_nav) #main-header"),o=((0,d.default)(vt.appWindow(),"ET_Builder.API.State.View_Mode",{}),t.hasClass("et-fb-page-settings-bar--corner")),i=(t.hasClass("et-fb-page-settings-bar--right-corner"),t.hasClass("et-fb-page-settings-bar--left-corner")),a=(t.hasClass("et-fb-page-settings-bar--right"),t.hasClass("et-fb-page-settings-bar--vertical"));vt.getScrollTargets().css({overflowY:"hidden",paddingRight:"".concat(vt.getScrollbarWidth(),"px")}),vt.isBFB()||(o||a||t.css("width","calc(100% - ".concat(rt,"px)")),i&&t.find(".et-fb-page-settings-bar__column--right").css("right","".concat(rt,"px"))),e.css("width","calc(100% - ".concat(rt,"px)")),n.css("width","calc(100% - ".concat(rt,"px)")),r.css("width","calc(100% - ".concat(rt,"px)"))},disableScrollLock:function(){var t=vt.$topWindow(".et-fb-page-settings-bar"),e=vt.$topWindow("#wpadminbar"),n=vt.$topWindow(".et_fixed_nav:not(.et_vertical_nav) #top-header"),r=vt.$topWindow(".et_fixed_nav:not(.et_vertical_nav) #main-header"),o=((0,d.default)(vt.appWindow(),"ET_Builder.API.State.View_Mode",{}),t.hasClass("et-fb-page-settings-bar--corner")),i=(t.hasClass("et-fb-page-settings-bar--right-corner"),t.hasClass("et-fb-page-settings-bar--left-corner")),a=(t.hasClass("et-fb-page-settings-bar--right"),t.hasClass("et-fb-page-settings-bar--vertical"));vt.getScrollTargets().css({overflowY:"auto",paddingRight:"0px"}),vt.isBFB()||vt.isTB()||(o||a||t.css("width",""),i&&t.find(".et-fb-page-settings-bar__column--right").css("right","0px")),vt.condition("is_bfb")&&e.css("width","100%"),n.css("width",""),r.css("width","")},cookies:st,getEventsTarget:function(t){return vt.isBFB()||t?vt.topWindow():vt.appWindow()},linkRel:function(t){var e=[];if(t){var n=["bookmark","external","nofollow","noreferrer","noopener"];t.split("|").forEach((function(t,r){t&&"off"!==t&&e.push(n[r])}))}return e.length?e.join(" "):null},setElementFont:function(t,e,n){var r="";if(""===t||(0,j.default)(t))return"";function o(t,e,n,r,o,i){var a="",c=i?" !important":"";return n&&!e?a="".concat(t,":").concat(o).concat(c,";"):!n&&e&&(a="".concat(t,":").concat(r).concat(c,";")),a}var i=t?t.split("|"):[],a=(void 0===n?"||||||||":n).split("|");if(!(0,b.default)(i)){var c=(0,$.default)(i[0],"--"),u=i[0],s=""!==i[1]?i[1]:"",l="on"===i[2],f="on"===i[3],v="on"===i[4],g="on"===i[5],h="on"===i[6],y=(0,j.default)(i[7])?"":i[7],m=(0,j.default)(i[8])?"":i[8],_=""!==a[1]?a[1]:"",w="on"===a[2],x="on"===a[3],k="on"===a[4],O="on"===a[5],B="on"===a[6];s="on"===s?"700":s,_="on"===_?"700":_,s=(0,$.default)(s,"--")?"var(".concat(s,")"):s,u&&""!==u&&"Default"!==u&&(c||vt.maybeLoadFont(u),r+=function(t,e){var n,r,o,i,a,c=(0,p.default)(ETBuilderBackend.customFonts,t,!1)?ETBuilderBackend.customFonts:ETBuilderBackend.et_builder_fonts_data,u=e?" !important":"",s=ETBuilderBackend.removedFonts;a=(0,j.default)(c[t])||(0,j.default)(c[t].add_ms_version)?"":"'".concat(t," MS', "),(0,d.default)(s,t,!1)&&(o=s[t].styles,t=s[t].parent_font),o&&""!==o&&(i=" font-weight:".concat((0,$.default)(o,"--")?"var(".concat(o,")"):"".concat(o),";")),r=(0,j.default)(c[t])?"serif":function(t){var e=t||"sans-serif",n=e;switch(e){case"sans-serif":n="Helvetica, Arial, Lucida, sans-serif";break;case"serif":n='Georgia, "Times New Roman", serif';break;case"cursive":n="cursive"}return n}(c[t].type);var l=(0,$.default)(t,"--")?"var(".concat(t,")"):"'".concat(t,"'");return"font-family:".concat(l,",").concat(a).concat(r).concat(u,";").concat(null!==(n=i)&&void 0!==n?n:"")}(u,e)),r+=o("font-weight",""!==_,""!==s,"normal",s,e),r+=o("font-style",w,l,"normal","italic",e),r+=o("text-transform",x,f,"none","uppercase",e),r+=o("text-decoration",k,v,"none","underline",e),r+=o("font-variant",O,g,"none","small-caps",e),r+=o("text-decoration",B,h,"none","line-through",e),r+=o("text-decoration-style",!1,""!==m,"solid",m,e),r+=o("-webkit-text-decoration-color",!1,""!==y,"",y,e),r=(r+=o("text-decoration-color",!1,""!==y,"",y,e)).trim()}return r},setResetFontStyle:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!(0,O.default)(t)||!(0,O.default)(e))return"";var r=t.split("|"),o=e.split("|");if((0,b.default)(r)||(0,b.default)(o))return"";var i=!(0,j.default)(r[2])&&"on"===r[2],a=!(0,j.default)(r[3])&&"on"===r[3],c=!(0,j.default)(r[4])&&"on"===r[4],u=!(0,j.default)(r[5])&&"on"===r[5],s=!(0,j.default)(r[6])&&"on"===r[6],l=!(0,j.default)(o[2])&&"on"===o[2],f=!(0,j.default)(o[3])&&"on"===o[3],d=!(0,j.default)(o[4])&&"on"===o[4],p=!(0,j.default)(o[5])&&"on"===o[5],v=!(0,j.default)(o[6])&&"on"===o[6],g="",h=n?" !important":"";if(!i&&l&&(g+="font-style: normal".concat(h,";")),!a&&f&&(g+="text-transform: none".concat(h,";")),!u&&p&&(g+="font-variant: none".concat(h,";")),!c&&d){var y=s||v?"line-through":"none";g+="text-decoration: ".concat(y).concat(h,";")}if(!s&&v){var m=c||d?"underline":"none";g+="text-decoration: ".concat(m).concat(h,";")}return g},decodeOptionListValue:function(t){var e=["&#91;","&#93;"],n=["[","]"];return t?JSON.parse((0,r.default)((0,r.default)(t,e[0],n[0]),e[1],n[1])):t},moduleHasBackground:function(t,e){var n,r,o,i,a,c,u=(0,j.default)(e)?["color","gradient","image","video","pattern","mask"]:e,l=!1;return(0,s.default)(u,(function(e){switch(e){case"color":l=vt.hasValue(t.background_color);break;case"gradient":l=vt.isOn(t.use_background_color_gradient);break;case"image":l=vt.hasValue(t.background_image);break;case"video":n=vt.hasValue(t.background_video_mp4),r=vt.hasValue(t.background_video_webm),l=n||r;break;case"pattern":o=vt.hasValue(t.background_pattern_style),a=vt.isOn(t.background_enable_pattern_style),l=o&&a;break;case"mask":i=vt.hasValue(t.background_mask_style),c=vt.isOn(t.background_enable_mask_style),l=i&&c}return!l})),l},fitVids:function(t){t.length&&t.fitVids({customSelector:"iframe[src^='http://www.hulu.com'], iframe[src^='http://www.dailymotion.com'], iframe[src^='http://www.funnyordie.com'], iframe[src^='https://embed-ssl.ted.com'], iframe[src^='http://embed.revision3.com'], iframe[src^='https://flickr.com'], iframe[src^='http://blip.tv'], iframe[src^='http://www.collegehumor.com']"})},toTextOrientation:ct,getTextOrientation:(0,c.default)(ct,(function(t){return vt.condition("is_rtl")&&"left"===t?"right":t})),isBuilderFocused:function(){return vt.$appDocument(ETBuilderBackend.css.containerPrefix).is(":hover")||vt.$topDocument(ETBuilderBackend.css.containerPrefix).is(":hover")},getFixedHeaderHeight:function(){var t=vt.$appWindow("body");return t.hasClass("et_divi_theme")&&vt.$topWindow().width()>=980&&!t.hasClass("et_vertical_nav")&&(parseInt(vt.$appWindow("#top-header.et-fixed-header").height()),parseInt(vt.$appWindow("#main-header.et-fixed-header").height())),t.hasClass("et_extra")&&parseInt(vt.$appWindow(".et-fixed-header #main-header").height()),0},parseInlineCssIntoObject:function(t){return(0,f.default)((0,S.default)(t.split("; "),(function(t){return t.split(": ")})))},getProcessedTabSlug:function(t){return"advanced"===t?"design":t},getModuleAddressSequence:function(t){var e=[];if((0,y.default)(t)?e=t:(0,O.default)(t)&&(e=t.split(".")),e.length<1)return[];if((0,L.default)(e,(function(t){return isNaN(parseFloat(t))})))return[];var n=(0,B.default)(e),r=[];return(0,s.default)(n,(function(t){var n=parseInt(t,10)+1,o=(0,R.default)(e,n).join(".");r.push(o)})),r},getFontFieldIndexes:function(t){return(0,d.default)({font:[0],weight:[1],style:[2,3,4,5,6],line_style:[7],line_color:[8]},t,[])},flattenFields:function(t){return(0,P.default)(t,(function(t,e,n){if("composite"===e.type){var r=(0,d.default)(e,"composite_structure",{}),i=(0,S.default)(r,"controls").reduce((function(t,n){var r=(0,E.default)(n,(function(t,n){var r=(0,d.default)(t,"name",n),i=(0,d.default)(t,"tab_slug",(0,d.default)(e,"tab_slug","")),a=(0,d.default)(t,"toggle_slug",(0,d.default)(e,"toggle_slug",""));return(0,o.default)({},t,{name:r,tab_slug:vt.getProcessedTabSlug(i),toggle_slug:a})}));return X(X({},t),r)}),{});return X(X({},t),i)}return X(X({},t),{},nt({},n,e))}),{})},hasLocalStorage:function(){if(!(0,x.default)(pt))return pt;try{pt=!!ET_Builder.Frames.top.localStorage}catch(t){}return pt},showCoreModal:function(t){if(ETBuilderBackend[t]){var e=ETBuilderBackend[t].header,n=ETBuilderBackend[t].text,r=ETBuilderBackend[t].buttons,o=ETBuilderBackend.coreModalTemplate,i=ETBuilderBackend.coreModalButtonsTemplate,a=ETBuilderBackend[t].classes,c=r?(0,P.default)(r,(function(t,e){return t+e}),""):"";c=vt.sprintf(i,c);var u=(0,B.default)(r).length>1?"et-core-modal-two-buttons":"",s=vt.sprintf(o,e,n,c);vt.$topWindow(".et-core-modal-overlay").remove(),vt.$topWindow(s).appendTo(vt.$topWindow("body")).addClass(u).addClass(a),vt.$appWindow().trigger("et-core-modal-active")}},hideCoreModal:function(t){vt.$topWindow(".".concat(t)).addClass("et-core-closing").delay(600).queue((function(){vt.$topWindow(this).removeClass("et-core-active et-core-closing").dequeue().remove()}))},stripHTMLTags:function(t){return t.replace(/(<([^>]+)>)/gi,"")},getIntegerValue:function(t){switch(Y(t)){case"string":return Math.trunc(t.replace(/[^\-\.\d]/g,"").replace(/(?!^)-/g,"").replace(/\..*/g,""));case"number":return Math.trunc(t);default:return 0}},getFormattedPx:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=vt.getIntegerValue(t);return 0!==n?"".concat(n,"px"):e?"":"0px"},scrollToAddress:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",r=vt.$appWindow('[data-address="'.concat(t,'"]'));if(r&&r.length){var o=vt.isTB()||vt.isBFB()||(0,g.default)(["zoom","tablet","phone"],n),i=o?vt.$topWindow("html"):vt.$appWindow("html");vt.isTB()&&(i=vt.$TBScrollTarget());var a=r.offset().top;"zoom"===n&&(a=Math.ceil(.5*a));var c=vt.viewportScrollTop(),u=vt.isBFB()?vt.$topWindow("#et-bfb-app-frame").offset().top-vt.getAdminBarHeight():0,s=vt.isTB()||vt.isBFB()?0:vt.$appWindow("#et-boc").offset().top,l=a+u-s,f=Math.abs(l-c),d=400,p=800,v=6e3,h=Math.ceil(f/1e3)*d;h<p&&(h=p),h>v&&(h=v),i.stop(),0<f?i.animate({scrollTop:l},h,(function(){(0,_.default)(e)&&e()})):(0,_.default)(e)&&e()}},viewModeDraggableHandleWidth:30,appendPrependCommaSeparatedSelectors:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=[],i=t.split(","),a=(0,S.default)(i,D.default),c="prefix"===n;return(0,s.default)(a,(function(t){c&&r?o.push("".concat(e," ").concat(t)):c&&!r?o.push("".concat(e).concat(t)):!c&&r?o.push("".concat(t," ").concat(e)):c||r||o.push("".concat(t).concat(e))})),(0,P.default)(o,(function(t,e){return"".concat(t,", ").concat(e)}))}};vt.maybeLoadFont=(0,A.default)(vt.maybeLoadFont.bind(vt)),window.ET_FB=window.ET_FB||{},window.ET_FB.utils={log:vt.log,defaultAllLogAreas:["general","store_action_obj","store_emit","warning"],debug:function(){if(!(0,j.default)(ot.debug))return ot.debug;try{return ot.debug="true"===localStorage.getItem("et_fb_debug"),ot.debug}catch(t){return!1}},debugOn:function(){try{return localStorage.setItem("et_fb_debug","true"),ot.debug=!0,"Debug mode is activated"}catch(t){return"Debug mode was not activated due to lack of support or other error"}},debugOff:function(){return localStorage.setItem("et_fb_debug","false"),ot.debug=!1,"Debug mode is deactivated"},debugSetLogAreas:function(t){return localStorage.setItem("et_fb_debug_log_areas",t),"Separate by space to set multiple areas. You are now logging these areas: ".concat(vt.debugLogAreas().join(", "))},debugAddLogArea:function(t){var e=localStorage.getItem("et_fb_debug_log_areas");return localStorage.setItem("et_fb_debug_log_areas","".concat(e," ").concat(t)),"Separate by space to set multiple areas. You are now logging these areas: ".concat(vt.debugLogAreas().join(", "))},debugSetAllLogAreas:function(){return localStorage.setItem("et_fb_debug_log_areas",vt.defaultAllLogAreas.join(" ")),"You are now logging these areas: ".concat(vt.defaultAllLogAreas.join(", "))},debugLogAreas:function(){var t=localStorage.getItem("et_fb_debug_log_areas");return!(0,j.default)(ot.enableAllLogAreas)&&ot.enableAllLogAreas?vt.defaultAllLogAreas:(0,j.default)(ot.enabledLogAreas)?null===t?vt.defaultAllLogAreas:t.split(" "):ot.enabledLogAreas}};var gt=vt.applyMixinsSafely,ht=vt.intentionallyCloneDeep,yt=vt.intentionallyClone,bt=vt.sanitized_previously,mt=vt.log,_t=vt.is,wt=vt.isOn,xt=vt.isOff,kt=vt.isOnOff,Ot=vt.isYes,jt=vt.isNo,Bt=vt.isDefault,St=vt.isMobileDevice,Et=vt.isIEOrEdge,At=vt.isIE,Wt=vt.isBlockEditor,It=vt.condition,Tt=vt.hasLocalStorage,Ct=vt.hasNumericValue,Mt=vt.hasValue,Ft=vt.getResponsiveStatus,Pt=vt.parseShortcode,Lt=vt.processFontIcon,Dt=vt.processIconFontData,Rt=vt.generateResponsiveCss,Vt=vt.generatePlaceholderCss,$t=vt.replaceCodeContentEntities,zt=vt.removeFancyQuotes,Ht=vt.processRangeValue,Nt=vt.getCorners,Ut=vt.getCorner,qt=vt.getSpacing,Qt=vt.closestElement,Gt=vt.getBreakpoints,Kt=vt.getViewModeByWidth,Yt=vt.getPreviewModes,Jt=vt.getGradient,Xt=vt.removeClassNameByPrefix,Zt=vt.getKeyboardList,te=vt.getRowLayouts,ee=vt.maybeLoadFont,ne=vt.fontnameToClass,re=vt.getCommentsMarkup,oe=vt.callWindow,ie=vt.decodeHtmlEntities,ae=vt.hasBodyMargin,ce=vt.fixSliderHeight,ue=vt.fixBuilderContent,se=vt.triggerResizeForUIUpdate,le=vt.enableScrollLock,fe=vt.disableScrollLock,de=vt.linkRel,pe=vt.setElementFont,ve=vt.decodeOptionListValue,ge=vt.sprintf,he=vt.isJson,ye=vt.isValidHtml,be=vt.getNextBreakpoint,me=vt.getPrevBreakpoint,_e=vt.appDocument,we=vt.$appDocument,xe=vt.appWindow,ke=vt.$appWindow,Oe=vt.topDocument,je=vt.$topDocument,Be=vt.topWindow,Se=vt.$topWindow,Ee=vt.getFixedHeaderHeight,Ae=vt.parseInlineCssIntoObject,We=vt.getOS,Ie=vt.isBFB,Te=vt.isTB,Ce=vt.isLimitedMode,Me=vt.isModuleLocked,Fe=vt.isModuleDeleted,Pe=vt.getComponentType,Le=vt.getModuleSectionType,De=vt.getModuleAncestor,Re=vt.getScrollbarWidth,Ve=vt.getProcessedTabSlug,$e=vt.getModuleAddressSequence,ze=vt.getFontFieldIndexes,He=vt.isRealMobileDevice,Ne=vt.stripHTMLTags,Ue=vt.appendPrependCommaSeparatedSelectors,qe=vt.getIntegerValue,Qe=vt.getFormattedPx,Ge=vt.viewModeDraggableHandleWidth,Ke=vt.getAdminBarHeight,Ye=vt.viewportScrollTop,Je=vt.isElementInViewport,Xe=vt.topViewportWidth,Ze=vt.maybeGetScrollbarWidth;e.maybeGetScrollbarWidth=Ze,e.topViewportWidth=Xe,e.isElementInViewport=Je,e.viewportScrollTop=Ye,e.getAdminBarHeight=Ke,e.viewModeDraggableHandleWidth=Ge,e.getFormattedPx=Qe,e.getIntegerValue=qe,e.appendPrependCommaSeparatedSelectors=Ue,e.stripHTMLTags=Ne,e.isRealMobileDevice=He,e.getFontFieldIndexes=ze,e.getModuleAddressSequence=$e,e.getProcessedTabSlug=Ve,e.getScrollbarWidth=Re,e.getModuleAncestor=De,e.getModuleSectionType=Le,e.getComponentType=Pe,e.isModuleDeleted=Fe,e.isModuleLocked=Me,e.isLimitedMode=Ce,e.isTB=Te,e.isBFB=Ie,e.getOS=We,e.parseInlineCssIntoObject=Ae,e.getFixedHeaderHeight=Ee,e.$topWindow=Se,e.topWindow=Be,e.$topDocument=je,e.topDocument=Oe,e.$appWindow=ke,e.appWindow=xe,e.$appDocument=we,e.appDocument=_e,e.getPrevBreakpoint=me,e.getNextBreakpoint=be,e.isValidHtml=ye,e.isJson=he,e.sprintf=ge,e.decodeOptionListValue=ve,e.setElementFont=pe,e.linkRel=de,e.disableScrollLock=fe,e.enableScrollLock=le,e.triggerResizeForUIUpdate=se,e.fixBuilderContent=ue,e.fixSliderHeight=ce,e.hasBodyMargin=ae,e.decodeHtmlEntities=ie,e.callWindow=oe,e.getCommentsMarkup=re,e.fontnameToClass=ne,e.maybeLoadFont=ee,e.getRowLayouts=te,e.getKeyboardList=Zt,e.removeClassNameByPrefix=Xt,e.getGradient=Jt,e.getPreviewModes=Yt,e.getViewModeByWidth=Kt,e.getBreakpoints=Gt,e.closestElement=Qt,e.getSpacing=qt,e.getCorner=Ut,e.getCorners=Nt,e.processRangeValue=Ht,e.removeFancyQuotes=zt,e.replaceCodeContentEntities=$t,e.generatePlaceholderCss=Vt,e.generateResponsiveCss=Rt,e.processIconFontData=Dt,e.processFontIcon=Lt,e.parseShortcode=Pt,e.getResponsiveStatus=Ft,e.hasValue=Mt,e.hasNumericValue=Ct,e.hasLocalStorage=Tt,e.condition=It,e.isBlockEditor=Wt,e.isIE=At,e.isIEOrEdge=Et,e.isMobileDevice=St,e.isDefault=Bt,e.isNo=jt,e.isYes=Ot,e.isOnOff=kt,e.isOff=xt,e.isOn=wt,e.is=_t,e.log=mt,e.sanitized_previously=bt,e.intentionallyClone=yt,e.intentionallyCloneDeep=ht,e.applyMixinsSafely=gt;var tn=vt;e.default=tn}).call(this,n(0))},function(t,e,n){var r=n(8);t.exports=function(){var t=arguments,e=r(t[0]);return t.length<3?e:e.replace(t[1],t[2])}},function(t,e,n){var r=n(42),o=n(16),i=n(109),a=n(7),c=n(27),u=n(9),s=Object.prototype.hasOwnProperty,l=i((function(t,e){if(c(e)||a(e))o(e,u(e),t);else for(var n in e)s.call(e,n)&&r(t,n,e[n])}));t.exports=l},function(t,e,n){var r=n(217),o=n(108),i=n(28),a=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=a},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e,n){var r=n(16),o=n(30);t.exports=function(t,e){return t&&r(e,o(e),t)}},function(t,e,n){var r=n(4),o=n(27),i=n(220),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=o(t),n=[];for(var c in t)("constructor"!=c||!e&&a.call(t,c))&&n.push(c);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var r=n(16),o=n(61);t.exports=function(t,e){return r(t,o(t),e)}},function(t,e,n){var r=n(16),o=n(116);t.exports=function(t,e){return r(t,o(t),e)}},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},function(t,e,n){var r=n(75),o=n(225),i=n(226),a=n(227),c=n(117);t.exports=function(t,e,n){var u=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new u(+t);case"[object DataView]":return o(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return c(t,n);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(t);case"[object RegExp]":return i(t);case"[object Symbol]":return a(t)}}},function(t,e,n){var r=n(75);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},function(t,e){var n=/\w*$/;t.exports=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}},function(t,e,n){var r=n(6),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;t.exports=function(t){return i?Object(i.call(t)):{}}},function(t,e,n){var r=n(229),o=n(64),i=n(65),a=i&&i.isMap,c=a?o(a):r;t.exports=c},function(t,e,n){var r=n(17),o=n(3);t.exports=function(t){return o(t)&&"[object Map]"==r(t)}},function(t,e,n){var r=n(231),o=n(64),i=n(65),a=i&&i.isSet,c=a?o(a):r;t.exports=c},function(t,e,n){var r=n(17),o=n(3);t.exports=function(t){return o(t)&&"[object Set]"==r(t)}},function(t,e,n){var r=n(44);t.exports=function(t){return r(t,5)}},function(t,e,n){t.exports=n(234)},function(t,e,n){var r=n(235)("flowRight",n(263));r.placeholder=n(119),t.exports=r},function(t,e,n){var r=n(236),o=n(238);t.exports=function(t,e,n){return r(o,t,e,n)}},function(t,e,n){var r=n(237),o=n(119),i=Array.prototype.push;function a(t,e){return 2==e?function(e,n){return t(e,n)}:function(e){return t(e)}}function c(t){for(var e=t?t.length:0,n=Array(e);e--;)n[e]=t[e];return n}function u(t,e){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var o=r[0]=e.apply(void 0,r);return t.apply(void 0,r),o}}}t.exports=function t(e,n,s,l){var f="function"==typeof n,d=n===Object(n);if(d&&(l=s,s=n,n=void 0),null==s)throw new TypeError;l||(l={});var p=!("cap"in l)||l.cap,v=!("curry"in l)||l.curry,g=!("fixed"in l)||l.fixed,h=!("immutable"in l)||l.immutable,y=!("rearg"in l)||l.rearg,b=f?s:o,m="curry"in l&&l.curry,_="fixed"in l&&l.fixed,w="rearg"in l&&l.rearg,x=f?s.runInContext():void 0,k=f?s:{ary:e.ary,assign:e.assign,clone:e.clone,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isError:e.isError,isFunction:e.isFunction,isWeakMap:e.isWeakMap,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,toInteger:e.toInteger,toPath:e.toPath},O=k.ary,j=k.assign,B=k.clone,S=k.curry,E=k.forEach,A=k.isArray,W=k.isError,I=k.isFunction,T=k.isWeakMap,C=k.keys,M=k.rearg,F=k.toInteger,P=k.toPath,L=C(r.aryMethod),D={castArray:function(t){return function(){var e=arguments[0];return A(e)?t(c(e)):t.apply(void 0,arguments)}},iteratee:function(t){return function(){var e=arguments[0],n=arguments[1],r=t(e,n),o=r.length;return p&&"number"==typeof n?(n=n>2?n-2:1,o&&o<=n?r:a(r,n)):r}},mixin:function(t){return function(e){var n=this;if(!I(n))return t(n,Object(e));var r=[];return E(C(e),(function(t){I(e[t])&&r.push([t,n.prototype[t]])})),t(n,Object(e)),E(r,(function(t){var e=t[1];I(e)?n.prototype[t[0]]=e:delete n.prototype[t[0]]})),n}},nthArg:function(t){return function(e){var n=e<0?1:F(e)+1;return S(t(e),n)}},rearg:function(t){return function(e,n){var r=n?n.length:0;return S(t(e,n),r)}},runInContext:function(n){return function(r){return t(e,n(r),l)}}};function R(t,e){if(p){var n=r.iterateeRearg[t];if(n)return function(t,e){return N(t,(function(t){var n=e.length;return function(t,e){return 2==e?function(e,n){return t.apply(void 0,arguments)}:function(e){return t.apply(void 0,arguments)}}(M(a(t,n),e),n)}))}(e,n);var o=!f&&r.iterateeAry[t];if(o)return function(t,e){return N(t,(function(t){return"function"==typeof t?a(t,e):t}))}(e,o)}return e}function V(t,e,n){if(g&&(_||!r.skipFixed[t])){var o=r.methodSpread[t],a=o&&o.start;return void 0===a?O(e,n):function(t,e){return function(){for(var n=arguments.length,r=n-1,o=Array(n);n--;)o[n]=arguments[n];var a=o[e],c=o.slice(0,e);return a&&i.apply(c,a),e!=r&&i.apply(c,o.slice(e+1)),t.apply(this,c)}}(e,a)}return e}function $(t,e,n){return y&&n>1&&(w||!r.skipRearg[t])?M(e,r.methodRearg[t]||r.aryRearg[n]):e}function z(t,e){for(var n=-1,r=(e=P(e)).length,o=r-1,i=B(Object(t)),a=i;null!=a&&++n<r;){var c=e[n],u=a[c];null==u||I(u)||W(u)||T(u)||(a[c]=B(n==o?u:Object(u))),a=a[c]}return i}function H(e,n){var o=r.aliasToReal[e]||e,i=r.remap[o]||o,a=l;return function(e){var r=f?x:k,c=f?x[i]:n,u=j(j({},a),e);return t(r,o,c,u)}}function N(t,e){return function(){var n=arguments.length;if(!n)return t();for(var r=Array(n);n--;)r[n]=arguments[n];var o=y?0:n-1;return r[o]=e(r[o]),t.apply(void 0,r)}}function U(t,e,n){var o,i=r.aliasToReal[t]||t,a=e,s=D[i];return s?a=s(e):h&&(r.mutate.array[i]?a=u(e,c):r.mutate.object[i]?a=u(e,function(t){return function(e){return t({},e)}}(e)):r.mutate.set[i]&&(a=u(e,z))),E(L,(function(t){return E(r.aryMethod[t],(function(e){if(i==e){var n=r.methodSpread[i],c=n&&n.afterRearg;return o=c?V(i,$(i,a,t),t):$(i,V(i,a,t),t),o=function(t,e,n){return m||v&&n>1?S(e,n):e}(0,o=R(i,o),t),!1}})),!o})),o||(o=a),o==e&&(o=m?S(o,1):function(){return e.apply(this,arguments)}),o.convert=H(i,e),o.placeholder=e.placeholder=n,o}if(!d)return U(n,s,b);var q=s,Q=[];return E(L,(function(t){E(r.aryMethod[t],(function(t){var e=q[r.remap[t]||t];e&&Q.push([t,U(t,e,q)])}))})),E(C(q),(function(t){var e=q[t];if("function"==typeof e){for(var n=Q.length;n--;)if(Q[n][0]==t)return;e.convert=H(t,e),Q.push([t,e])}})),E(Q,(function(t){q[t[0]]=t[1]})),q.convert=function(t){return q.runInContext.convert(t)(void 0)},q.placeholder=q,E(C(q),(function(t){E(r.realToAlias[t]||[],(function(e){q[e]=q[t]}))})),q}},function(t,e){e.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},e.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},e.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},e.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},e.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},e.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},e.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},e.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},e.realToAlias=function(){var t=Object.prototype.hasOwnProperty,n=e.aliasToReal,r={};for(var o in n){var i=n[o];t.call(r,i)?r[i].push(o):r[i]=[o]}return r}(),e.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},e.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},e.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},function(t,e,n){t.exports={ary:n(239),assign:n(114),clone:n(113),curry:n(254),forEach:n(45),isArray:n(1),isError:n(255),isFunction:n(23),isWeakMap:n(256),iteratee:n(257),keys:n(66),rearg:n(258),toInteger:n(15),toPath:n(262)}},function(t,e,n){var r=n(47);t.exports=function(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,r(t,128,void 0,void 0,void 0,void 0,e)}},function(t,e,n){var r=n(48),o=n(2);t.exports=function(t,e,n){var i=1&e,a=r(t);return function e(){var r=this&&this!==o&&this instanceof e?a:t;return r.apply(i?n:this,arguments)}}},function(t,e,n){var r=n(70),o=n(48),i=n(122),a=n(125),c=n(80),u=n(49),s=n(2);t.exports=function(t,e,n){var l=o(t);return function o(){for(var f=arguments.length,d=Array(f),p=f,v=c(o);p--;)d[p]=arguments[p];var g=f<3&&d[0]!==v&&d[f-1]!==v?[]:u(d,v);if((f-=g.length)<n)return a(t,e,i,o.placeholder,void 0,d,g,void 0,void 0,n-f);var h=this&&this!==s&&this instanceof o?l:t;return r(h,this,d)}}},function(t,e){t.exports=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}},function(t,e){t.exports=function(){}},function(t,e){t.exports={}},function(t,e,n){var r=n(76),o=n(79),i=n(77),a=n(1),c=n(3),u=n(246),s=Object.prototype.hasOwnProperty;function l(t){if(c(t)&&!a(t)&&!(t instanceof r)){if(t instanceof o)return t;if(s.call(t,"__wrapped__"))return u(t)}return new o(t)}l.prototype=i.prototype,l.prototype.constructor=l,t.exports=l},function(t,e,n){var r=n(76),o=n(79),i=n(31);t.exports=function(t){if(t instanceof r)return t.clone();var e=new o(t.__wrapped__,t.__chain__);return e.__actions__=i(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}},function(t,e){var n=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;t.exports=function(t){var e=t.match(n);return e?e[1].split(r):[]}},function(t,e){var n=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;t.exports=function(t,e){var r=e.length;if(!r)return t;var o=r-1;return e[o]=(r>1?"& ":"")+e[o],e=e.join(r>2?", ":" "),t.replace(n,"{\n/* [wrapped with "+e+"] */\n")}},function(t,e,n){var r=n(45),o=n(250),i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];t.exports=function(t,e){return r(i,(function(n){var r="_."+n[0];e&n[1]&&!o(t,r)&&t.push(r)})),t.sort()}},function(t,e,n){var r=n(29);t.exports=function(t,e){return!!(null==t?0:t.length)&&r(t,e,0)>-1}},function(t,e,n){var r=n(31),o=n(26),i=Math.min;t.exports=function(t,e){for(var n=t.length,a=i(e.length,n),c=r(t);a--;){var u=e[a];t[a]=o(u,n)?c[u]:void 0}return t}},function(t,e,n){var r=n(70),o=n(48),i=n(2);t.exports=function(t,e,n,a){var c=1&e,u=o(t);return function e(){for(var o=-1,s=arguments.length,l=-1,f=a.length,d=Array(f+s),p=this&&this!==i&&this instanceof e?u:t;++l<f;)d[l]=a[l];for(;s--;)d[l++]=arguments[++o];return r(p,c?n:this,d)}}},function(t,e,n){var r=n(123),o=n(124),i=n(49),a="__lodash_placeholder__",c=128,u=Math.min;t.exports=function(t,e){var n=t[1],s=e[1],l=n|s,f=l<131,d=s==c&&8==n||s==c&&256==n&&t[7].length<=e[8]||384==s&&e[7].length<=e[8]&&8==n;if(!f&&!d)return t;1&s&&(t[2]=e[2],l|=1&n?0:4);var p=e[3];if(p){var v=t[3];t[3]=v?r(v,p,e[4]):p,t[4]=v?i(t[3],a):e[4]}return(p=e[5])&&(v=t[5],t[5]=v?o(v,p,e[6]):p,t[6]=v?i(t[5],a):e[6]),(p=e[7])&&(t[7]=p),s&c&&(t[8]=null==t[8]?e[8]:u(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=l,t}},function(t,e,n){var r=n(47);function o(t,e,n){var i=r(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return i.placeholder=o.placeholder,i}o.placeholder={},t.exports=o},function(t,e,n){var r=n(5),o=n(3),i=n(81);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!i(t)}},function(t,e,n){var r=n(17),o=n(3);t.exports=function(t){return o(t)&&"[object WeakMap]"==r(t)}},function(t,e,n){var r=n(44),o=n(11);t.exports=function(t){return o("function"==typeof t?t:r(t,1))}},function(t,e,n){var r=n(47),o=n(50),i=o((function(t,e){return r(t,256,void 0,void 0,void 0,e)}));t.exports=i},function(t,e,n){var r=n(260);t.exports=function(t){return(null==t?0:t.length)?r(t,1):[]}},function(t,e,n){var r=n(60),o=n(261);t.exports=function t(e,n,i,a,c){var u=-1,s=e.length;for(i||(i=o),c||(c=[]);++u<s;){var l=e[u];n>0&&i(l)?n>1?t(l,n-1,i,a,c):r(c,l):a||(c[c.length]=l)}return c}},function(t,e,n){var r=n(6),o=n(24),i=n(1),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},function(t,e,n){var r=n(10),o=n(31),i=n(1),a=n(12),c=n(98),u=n(14),s=n(8);t.exports=function(t){return i(t)?r(t,u):a(t)?[t]:o(c(s(t)))}},function(t,e,n){var r=n(264)(!0);t.exports=r},function(t,e,n){var r=n(79),o=n(50),i=n(78),a=n(127),c=n(1),u=n(126);t.exports=function(t){return o((function(e){var n=e.length,o=n,s=r.prototype.thru;for(t&&e.reverse();o--;){var l=e[o];if("function"!=typeof l)throw new TypeError("Expected a function");if(s&&!f&&"wrapper"==a(l))var f=new r([],!0)}for(o=f?o:n;++o<n;){l=e[o];var d=a(l),p="wrapper"==d?i(l):void 0;f=p&&u(p[0])&&424==p[1]&&!p[4].length&&1==p[9]?f[a(p[0])].apply(f,p[3]):1==l.length&&u(l)?f[d]():f.thru(l)}return function(){var t=arguments,r=t[0];if(f&&1==t.length&&c(r))return f.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}},function(t,e,n){var r=n(266)(n(130));t.exports=r},function(t,e,n){var r=n(11),o=n(7),i=n(9);t.exports=function(t){return function(e,n,a){var c=Object(e);if(!o(e)){var u=r(n,3);e=i(e),n=function(t){return u(c[t],t,c)}}var s=t(e,n,a);return s>-1?c[u?e[s]:s]:void 0}}},function(t,e,n){var r=n(68),o=n(132);t.exports=function(t,e){return t&&r(t,o(e))}},function(t,e){t.exports=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r}},function(t,e,n){var r=n(270),o=n(101);t.exports=function(t,e){return null!=t&&o(t,e,r)}},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&n.call(t,e)}},function(t,e,n){var r=n(29),o=n(15),i=Math.max;t.exports=function(t,e,n){var a=null==t?0:t.length;if(!a)return-1;var c=null==n?0:o(n);return c<0&&(c=i(a+c,0)),r(t,e,c)}},function(t,e,n){var r=n(59);t.exports=function(t,e){return r(t,e)}},function(t,e){t.exports=function(t){return null==t}},function(t,e,n){var r=n(43),o=n(68),i=n(11);t.exports=function(t,e){var n={};return e=i(e,3),o(t,(function(t,o,i){r(n,o,e(t,o,i))})),n}},function(t,e,n){var r=n(2);t.exports=function(){return r.Date.now()}},function(t,e,n){var r=n(10),o=n(44),i=n(277),a=n(18),c=n(16),u=n(279),s=n(50),l=n(74),f=s((function(t,e){var n={};if(null==t)return n;var s=!1;e=r(e,(function(e){return e=a(e,t),s||(s=e.length>1),e})),c(t,l(t),n),s&&(n=o(n,7,u));for(var f=e.length;f--;)i(n,e[f]);return n}));t.exports=f},function(t,e,n){var r=n(18),o=n(134),i=n(278),a=n(14);t.exports=function(t,e){return e=r(e,t),null==(t=i(t,e))||delete t[a(o(e))]}},function(t,e,n){var r=n(40),o=n(83);t.exports=function(t,e){return e.length<2?t:r(t,o(e,0,-1))}},function(t,e,n){var r=n(81);t.exports=function(t){return r(t)?void 0:t}},function(t,e,n){var r=n(110),o=n(47),i=n(80),a=n(49),c=r((function(t,e){var n=a(e,i(c));return o(t,32,void 0,e,n)}));c.placeholder={},t.exports=c},function(t,e,n){var r=n(282),o=n(50)((function(t,e){return null==t?{}:r(t,e)}));t.exports=o},function(t,e,n){var r=n(135),o=n(100);t.exports=function(t,e){return r(t,e,(function(e,n){return o(t,n)}))}},function(t,e,n){var r=n(42),o=n(18),i=n(26),a=n(4),c=n(14);t.exports=function(t,e,n,u){if(!a(t))return t;for(var s=-1,l=(e=o(e,t)).length,f=l-1,d=t;null!=d&&++s<l;){var p=c(e[s]),v=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return t;if(s!=f){var g=d[p];void 0===(v=u?u(g,p,d):void 0)&&(v=a(g)?g:i(e[s+1])?[]:{})}r(d,p,v),d=d[p]}return t}},function(t,e,n){var r=n(10),o=n(11),i=n(135),a=n(74);t.exports=function(t,e){if(null==t)return{};var n=r(a(t),(function(t){return[t]}));return e=o(e),i(t,n,(function(t,n){return e(t,n[0])}))}},function(t,e,n){var r=n(286)();t.exports=r},function(t,e,n){var r=n(287),o=n(72),i=n(106);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&o(e,n,a)&&(n=a=void 0),e=i(e),void 0===n?(n=e,e=0):n=i(n),a=void 0===a?e<n?1:-1:i(a),r(e,n,a,t)}}},function(t,e){var n=Math.ceil,r=Math.max;t.exports=function(t,e,o,i){for(var a=-1,c=r(n((e-t)/(o||1)),0),u=Array(c);c--;)u[i?c:++a]=t,t+=o;return u}},function(t,e,n){var r=n(289),o=n(41),i=n(11),a=n(290),c=n(1);t.exports=function(t,e,n){var u=c(t)?r:a,s=arguments.length<3;return u(t,i(e,4),n,s,o)}},function(t,e){t.exports=function(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}},function(t,e){t.exports=function(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}},function(t,e,n){var r=n(88),o=n(11),i=n(292),a=n(1),c=n(72);t.exports=function(t,e,n){var u=a(t)?r:i;return n&&c(t,e,n)&&(e=void 0),u(t,o(e,3))}},function(t,e,n){var r=n(41);t.exports=function(t,e){var n;return r(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}},function(t,e,n){var r=n(21),o=n(107),i=n(294),a=n(295),c=n(296),u=n(297),s=n(8);t.exports=function(t,e,n){if((t=s(t))&&(n||void 0===e))return o(t);if(!t||!(e=r(e)))return t;var l=u(t),f=u(e),d=c(l,f),p=a(l,f)+1;return i(l,d,p).join("")}},function(t,e,n){var r=n(83);t.exports=function(t,e,n){var o=t.length;return n=void 0===n?o:n,!e&&n>=o?t:r(t,e,n)}},function(t,e,n){var r=n(29);t.exports=function(t,e){for(var n=t.length;n--&&r(e,t[n],0)>-1;);return n}},function(t,e,n){var r=n(29);t.exports=function(t,e){for(var n=-1,o=t.length;++n<o&&r(e,t[n],0)>-1;);return n}},function(t,e,n){var r=n(298),o=n(299),i=n(300);t.exports=function(t){return o(t)?i(t):r(t)}},function(t,e){t.exports=function(t){return t.split("")}},function(t,e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return n.test(t)}},function(t,e){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+o+")"+"?",s="[\\ufe0e\\ufe0f]?",l=s+u+("(?:\\u200d(?:"+[i,a,c].join("|")+")"+s+u+")*"),f="(?:"+[i+r+"?",r,a,c,n].join("|")+")",d=RegExp(o+"(?="+o+")|"+f+l,"g");t.exports=function(t){return t.match(d)||[]}},function(t,e,n){var r=n(83),o=n(15);t.exports=function(t,e,n){return t&&t.length?(e=n||void 0===e?1:o(e),r(t,0,e<0?0:e)):[]}},function(t,e,n){var r=n(303),o=n(21),i=n(15),a=n(8);t.exports=function(t,e,n){return t=a(t),n=null==n?0:r(i(n),0,t.length),e=o(e),t.slice(n,n+e.length)==e}},function(t,e){t.exports=function(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.top_window=e.is_iframe=void 0;var r,o=(r=n(305))&&r.__esModule?r:{default:r};var i=window;e.top_window=i;var a,c=!1;e.is_iframe=c;try{a=!!window.top.document&&window.top}catch(t){a=!1}a&&a.__Cypress__?window.parent===a?(e.top_window=i=window,e.is_iframe=c=!1):(e.top_window=i=window.parent,e.is_iframe=c=!0):a&&(e.top_window=i=a,e.is_iframe=c=a!==window.self),window.ET_Builder=(0,o.default)(window.ET_Builder||{},{Frames:{top:i}})},function(t,e,n){var r=n(306),o=n(109)((function(t,e,n){r(t,e,n)}));t.exports=o},function(t,e,n){var r=n(33),o=n(136),i=n(102),a=n(307),c=n(4),u=n(30),s=n(137);t.exports=function t(e,n,l,f,d){e!==n&&i(n,(function(i,u){if(d||(d=new r),c(i))a(e,n,u,l,t,f,d);else{var p=f?f(s(e,u),i,u+"",e,n,d):void 0;void 0===p&&(p=i),o(e,u,p)}}),u)}},function(t,e,n){var r=n(136),o=n(115),i=n(117),a=n(31),c=n(118),u=n(24),s=n(1),l=n(308),f=n(25),d=n(23),p=n(4),v=n(81),g=n(38),h=n(137),y=n(309);t.exports=function(t,e,n,b,m,_,w){var x=h(t,n),k=h(e,n),O=w.get(k);if(O)r(t,n,O);else{var j=_?_(x,k,n+"",t,e,w):void 0,B=void 0===j;if(B){var S=s(k),E=!S&&f(k),A=!S&&!E&&g(k);j=k,S||E||A?s(x)?j=x:l(x)?j=a(x):E?(B=!1,j=o(k,!0)):A?(B=!1,j=i(k,!0)):j=[]:v(k)||u(k)?(j=x,u(x)?j=y(x):p(x)&&!d(x)||(j=c(k))):B=!1}B&&(w.set(k,j),m(j,k,b,_,w),w.delete(k)),r(t,n,j)}}},function(t,e,n){var r=n(7),o=n(3);t.exports=function(t){return o(t)&&r(t)}},function(t,e,n){var r=n(16),o=n(30);t.exports=function(t){return r(t,o(t))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=/%%|%(?:(\d+)\$)?((?:[-+#0 ]|'[\s\S])*)(\d+)?(?:\.(\d*))?([\s\S])/g,e=arguments,n=0,r=e[n++],o=function(t,e,n,r){n||(n=" ");var o=t.length>=e?"":new Array(1+e-t.length>>>0).join(n);return r?t+o:o+t},i=function(t,e,n,r,i){var a=r-t.length;return a>0&&(t=n||"0"!==i?o(t,r,i,n):[t.slice(0,e.length),o("",a,"0",!0),t.slice(e.length)].join("")),t},a=function(t,e,n,r,a,c){return t=o((t>>>0).toString(e),a||0,"0",!1),i(t,"",n,r,c)},c=function(t,e,n,r,o){return null!=r&&(t=t.slice(0,r)),i(t,"",e,n,o)},u=function(t,r,u,s,l,f){var d,p,v,g,h;if("%%"===t)return"%";var y,b,m=" ",_=!1,w="";for(y=0,b=u.length;y<b;y++)switch(u.charAt(y)){case" ":case"0":m=u.charAt(y);break;case"+":w="+";break;case"-":_=!0;break;case"'":y+1<b&&(m=u.charAt(y+1),y++)}if(s=s?+s:0,!isFinite(s))throw new Error("Width must be finite");if(l=l?+l:"d"===f?0:"fFeE".indexOf(f)>-1?6:void 0,r&&0==+r)throw new Error("Argument number must be greater than zero");if(r&&+r>=e.length)throw new Error("Too few arguments");switch(h=r?e[+r]:e[n++],f){case"%":return"%";case"s":return c("".concat(h),_,s,l,m);case"c":return c(String.fromCharCode(+h),_,s,l,m);case"b":return a(h,2,_,s,l,m);case"o":return a(h,8,_,s,l,m);case"x":return a(h,16,_,s,l,m);case"X":return a(h,16,_,s,l,m).toUpperCase();case"u":return a(h,10,_,s,l,m);case"i":case"d":return d=+h||0,h=(p=(d=Math.round(d-d%1))<0?"-":w)+o(String(Math.abs(d)),l,"0",!1),_&&"0"===m&&(m=" "),i(h,p,_,s,m);case"e":case"E":case"f":case"F":case"g":case"G":return p=(d=+h)<0?"-":w,v=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],g=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2],h=p+Math.abs(d)[v](l),i(h,p,_,s,m)[g]();default:return""}};try{return r.replace(t,u)}catch(t){return!1}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isYes=e.isOnOff=e.isOn=e.isOff=e.isNo=e.isDefault=void 0,e.sanitizedPreviously=function(t){return t};e.isOn=function(t){return"on"===t};e.isOff=function(t){return"off"===t};e.isOnOff=function(t){return"on"===t||"off"===t};e.isYes=function(t){return"yes"===t};e.isNo=function(t){return"no"===t};e.isDefault=function(t){return"default"===t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isEnabled=e.hoverSuffix=e.getHoverField=e.getHoverEnabledField=e.getFieldBaseName=e.enabledSuffix=e.default=void 0;var r=a(n(82)),o=a(n(69)),i=a(n(39));function a(t){return t&&t.__esModule?t:{default:t}}var c="__hover",u="__hover_enabled",s=function(){return c};e.hoverSuffix=s;var l=function(){return u};e.enabledSuffix=l;var f=function(t){return!(0,r.default)(t)&&(0,o.default)(t)?t.split(c).shift():t};e.getFieldBaseName=f;var d=function(t){return"".concat(f(t)).concat(c)};e.getHoverField=d;var p=function(t){return"".concat(f(t)).concat(u)};e.getHoverEnabledField=p;var v=function(t,e){return 0===(0,i.default)(e,p(t),"").indexOf("on")};e.isEnabled=v;var g={isEnabled:v,hoverSuffix:s,enabledSuffix:l,getFieldBaseName:f,getHoverField:d,getHoverEnabledField:p};e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isOnOff=e.isOn=e.isOff=e.isNo=e.isJson=e.isFileExtension=e.isDefault=e.hasValue=e.hasNumericValue=e.getSpacing=e.getPercentage=e.getCorners=e.getCorner=e.get=e.generatePlaceholderCss=e.closestElement=void 0,e.isRealMobileDevice=function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},e.toString=e.toOnOff=e.set=e.replaceCodeContentEntities=e.removeFancyQuotes=e.prop=e.isYes=e.isValidHtml=void 0;var r=d(n(4)),o=d(n(133)),i=d(n(134)),a=d(n(131)),c=d(n(1)),u=d(n(82)),s=d(n(8)),l=d(n(314)),f=d(n(130));function d(t){return t&&t.__esModule?t:{default:t}}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){g(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(316);var h=function(t){return""!==t&&void 0!==t&&!1!==t&&!(0,l.default)(t)};e.hasValue=h;var y=function(t,e){return h(t)?t:e};e.get=y;e.isJson=function(t){try{return(0,r.default)(JSON.parse(t))}catch(t){return!1}};e.isValidHtml=function(t){var e=["area","base","br","col","embed","hr","img","input","link","menuitem","meta","param","source","track","wbr","!--"].join("|"),n=new RegExp("<(".concat(e,").*?>"),"gi"),r=t.replace(n,""),o=r.match(/<[^\/].*?>/g)||[],i=r.match(/<\/.+?>/g)||[];return o.length===i.length};e.isOn=function(t){return"on"===t};e.isOff=function(t){return"off"===t};e.isOnOff=function(t){return"on"===t||"off"===t};e.toOnOff=function(t){return t?"on":"off"};e.isYes=function(t){return"yes"===t};e.isNo=function(t){return"no"===t};e.isDefault=function(t){return"default"===t};e.isFileExtension=function(t,e){return e===(0,o.default)((0,i.default)(t.split(".")).split("?"))};e.generatePlaceholderCss=function(t,e){var n=["::-webkit-input-placeholder",":-moz-placeholder","::-moz-placeholder",":-ms-input-placeholder"],r=[];return!(0,u.default)(t)&&(0,c.default)(t)&&(0,a.default)(t,(function(t){(0,a.default)(n,(function(n){r.push({selector:t+n,declaration:e})}))})),r};e.replaceCodeContentEntities=function(t){return"string"==typeof(t=(0,s.default)(t))&&(t=(t=(t=(t=t.replace(/&#039;/g,"'")).replace(/&#091;/g,"[")).replace(/&#093;/g,"]")).replace(/&#215;/g,"x")),t};e.hasNumericValue=function(t){return""!==t&&void 0!==t&&!(0,l.default)(parseInt(t))};e.removeFancyQuotes=function(t){return"string"==typeof(t=(0,s.default)(t))&&(t=t.replace(/&#8221;/g,"").replace(/&#8243;/g,"")),t};var b=function(){return["top","right","bottom","left"]};e.getCorners=b;e.getCorner=function(t){return["top","right","bottom","left"][t]};e.getSpacing=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0px";if(!h(t))return n;var r=["top","right","bottom","left"],o=(0,f.default)(r,(function(t){return t===e})),i=(0,s.default)(t).split("|");return h(i[o])?i[o]:n};e.toString=function(t){return h(t)?(0,s.default)(t):""};e.prop=function(t,e,n){return n&&y(n[e],t)||t};e.set=function(t,e,n){return v(v({},n||{}),{},g({},t,e))};e.getPercentage=function(t,e){return t/100*parseFloat(e)};e.closestElement=function(t,e){return t.closest(e)}},function(t,e,n){var r=n(315);t.exports=function(t){return r(t)&&t!=+t}},function(t,e,n){var r=n(5),o=n(3);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==r(t)}},function(t,e,n){"use strict";Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(Element.prototype.matches.call(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null})},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.windowHasScrollbar=e.getViewportAdaptableRectangle=e.getViewportAdaptablePositioning=e.getScrollbarWidth=void 0;e.getViewportAdaptablePositioning=function(t,e,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,c=r(t,n,0,e.offset().top,e.parent().width(),o,30,30,i,a);return{position:{left:c.left,top:c.top},size:{width:c.width,height:c.height},flags:{fitsInBottomSpace:c.fitsInBottomSpace,fitsInBottomAndTopSpace:c.fitsInBottomAndTopSpace,fitsWithScroll:c.fitsWithScroll}}};var n=function(t,e,n,r,o,i){var a=e<=Math.min(r,n-o)-i,c=e<=n-o-i,u=Math.max(o,t),s=e;return a||(c?(u-=e-(r-i),s=e):(u=o,s=n-o-i)),{position:u,size:s,fitsInAfterSpace:a,fitsInBeforeAndAfterSpace:c}},r=function(e,r,o,i,a,c){var u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:30,f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:30,d=e.scrollLeft(),p=e.scrollTop(),v=e.width(),g=e.height(),h=v-((o=o>=d?o:d+u)-d),y=g-((i=i>=p?i:p+l)-p),b=r.parents().filter((function(){var e=t(this).css("transform");return"none"!==e&&e.length>0})).first(),m=n(o-d,a,v,h,u,s),_=m.position,w=m.size,x=m.fitsInAfterSpace,k=m.fitsInBeforeAndAfterSpace,O=n(i-p,c,g,y,l,f),j=O.position,B=O.size,S=O.fitsInAfterSpace,E=O.fitsInBeforeAndAfterSpace;return b.length>0&&(_-=b.offset().left-d,j-=b.offset().top-p),{left:_,top:j,width:w,height:B,fitsInRightSpace:x,fitsInRightAndLeftSpace:k,fitsInBottomSpace:S,fitsInBottomAndTopSpace:E,fitsWithScroll:!S&&!E}};e.getViewportAdaptableRectangle=r;var o=-1;e.getScrollbarWidth=function(){if(0<o)return o;var t=document.createElement("div"),e=document.createElement("div");t.style.visibility="hidden",t.style.width="100px",e.style.width="100%",e.style.height="100%",t.appendChild(e),document.body.appendChild(t);var n=t.offsetWidth;t.style.overflow="scroll";var r=e.offsetWidth;return document.body.removeChild(t),o=n-r};e.windowHasScrollbar=function(t){return t.document.body.scrollHeight>t.document.body.clientHeight}}).call(this,n(0))}]);bfb_admin_script.js000064400000012515152336404310010374 0ustar00!function(t){var e={};function o(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=138)}({0:function(t,e){t.exports=jQuery},138:function(t,e,o){"use strict";(function(t){var e=o(139),n=document.createEvent("Event"),i=0;n.initEvent("et_fb_before_disabling_bfb",!0,!0);var a,r=t("#et_pb_layout").addClass("et-drag-disabled");function s(){a&&clearTimeout(a),a=setTimeout((function(){var e=t("#et_pb_layout"),o=t("#et-fb-app"),n=t(".et_pb_toggle_builder_wrapper.et_pb_builder_is_used"),i=t("#et_pb_toggle_builder"),a=t("#et_pb_fb_cta"),r=t(".et-fb-button-group--responsive-mode"),s=t(".et-fb-button-group--builder-mode"),_=t(".et-fb-page-settings-bar__column--right"),l=(n.outerWidth()||0)-(parseFloat(i.outerWidth()||0)+parseFloat(a.outerWidth()||0)+parseFloat(a.css("marginLeft")))+((r.length&&r.is(":visible")?r.outerWidth():0)+(s.length&&s.is(":visible")?s.outerWidth()+10:0)+(_.length?_.outerWidth():0))<=30;e.toggleClass("et_pb_layout--compact",l),o.toggleClass("et-fb-app--compact",l)}),50)}function _(e){t("#title").prop("required")&&t("#title").removeProp("required"),e.hasClass("disabled")?i<=20?(i++,setTimeout((function(){_(e)}),1e3)):t(".et-bfb-page-preloading").remove():e.trigger("click")}function l(e){void 0!==window.tinyMCE&&window.tinyMCE.get("content")&&!window.tinyMCE.get("content").isHidden()?window.tinyMCE.get("content").setContent(e,{format:"html"}):t("#content").val(e)}t(window).on("et_fb_init_app_after",(function(){r.removeClass("et-drag-disabled")})),t(window).on("load",(function(){setTimeout((function(){var e=t("#et_pb_toggle_builder"),o=t("#et_pb_fb_cta");t(".et_pb_toggle_builder_wrapper").css("opacity",""),e.addClass("et_pb_ready"),e.hasClass("et_pb_builder_is_used")&&o.addClass("et_pb_ready")}),250);var e=function(){t(this).find(".postbox").removeClass("first-visible"),t(this).is("#normal-sortables")&&t(this).find(".postbox:visible").first().addClass("first-visible")};t(".meta-box-sortables").sortable("option","update",e),t("#screen-options-wrap").on("change",".hide-postbox-tog",(function(){t(".meta-box-sortables").each(e)})),t(".handle-order-higher, .handle-order-lower").on("click",(function(){t(".meta-box-sortables").each(e)})),t(".meta-box-sortables").on("sortstart",(function(){t("body").addClass("et-bfb--metabox-dragged")})),t(".meta-box-sortables").on("sortstop",(function(){t("body").removeClass("et-bfb--metabox-dragged"),window.dispatchEvent(new CustomEvent("ETBFBMetaboxSortStopped",{}))}))})),t(window).on("et_fb_disabling_bfb_confirmed",(function(){var e=t("#et_pb_old_content"),o=t("#et_pb_use_builder"),n=t("#minor-publishing-actions #save-post").length>0?t("#minor-publishing-actions #save-post"):t("#publishing-action #publish");l(e.val()),e.val(""),o.val("off"),_(n)})),t(window).on("et_fb_init_app_after resize et_fb_toolbar_change",s),t(e.top_window).on("et-preview-animation-complete et-bfb-modal-snapped",s),t("#et_pb_toggle_builder").on("click",(function(e){e.preventDefault();var o=t(this),i=t("#et_pb_use_builder"),a=function(){var e;e=void 0!==window.tinyMCE&&window.tinyMCE.get("content")&&!window.tinyMCE.get("content").isHidden()?window.tinyMCE.get("content").getContent():t("#content").val();return e.trim()}(),r=t("#minor-publishing-actions #save-post").length>0?t("#minor-publishing-actions #save-post"):t("#publishing-action #publish"),s=t("#et_pb_old_content"),d=t("#titlediv #title").length>0?t("#titlediv #title").val():"";if(o.hasClass("et_pb_builder_is_used"))window.dispatchEvent(n);else if(i.val("on"),""!==a&&(s.val(a),a.indexOf("[et_pb_section")<0&&"skip"!==et_bfb_options.skip_default_content_adding&&(a='[et_pb_section][et_pb_row][et_pb_column type="'.concat(et_bfb_options.default_initial_column_type,'"][').concat(et_bfb_options.default_initial_text_module,"]").concat(a,"[/").concat(et_bfb_options.default_initial_text_module,"][/et_pb_column][/et_pb_row][/et_pb_section]")),l(a)),t("body").append('<div class="et-bfb-page-preloading"></div>'),""!==a||""!==d)_(r);else{var b=t("#post_ID").length>0?t("#post_ID").val():0;t.ajax({type:"POST",url:et_bfb_options.ajaxurl,data:{action:"et_builder_activate_bfb_auto_draft",et_enable_bfb_nonce:et_bfb_options.et_enable_bfb_nonce,et_post_id:b},complete:function(){_(r)}})}}))}).call(this,o(0))},139:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.top_window=e.is_iframe=void 0;var n=window;e.top_window=n;var i,a=!1;e.is_iframe=a;try{i=!!window.top.document&&window.top}catch(t){i=!1}i&&i.__Cypress__?window.parent===i?(e.top_window=n=window,e.is_iframe=a=!1):(e.top_window=n=window.parent,e.is_iframe=a=!0):i&&(e.top_window=n=i,e.is_iframe=a=i!==window.self)}});failure_notice.js000064400000002367152336404310010103 0ustar00!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=143)}({0:function(e,t){e.exports=jQuery},143:function(e,t,n){"use strict";(function(e){e((function(){e("body").on("click",".et_pb_prompt_dont_proceed",(function(){var t=e(this).closest(".et_pb_modal_overlay");return e("body").removeClass("et_pb_stop_scroll"),t.addClass("et_pb_modal_closing"),setTimeout((function(){t.remove()}),600),!1}))}))}).call(this,n(0))}});cpt-modules-wrapper.js000064400000002724152336404310011022 0ustar00!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=142)}({0:function(e,t){e.exports=jQuery},142:function(e,t,n){"use strict";(function(e){et_modules_wrapper.builderCssContainerPrefix;var t=et_modules_wrapper.builderCssLayoutPrefix,n=e(".et_pb_module:not(".concat(t," .et_pb_module, .et_pb_section .et_pb_module), .et_pb_row:not(").concat(t," .et_pb_row, .et_pb_section .et_pb_row), .et_pb_section:not(").concat(t," .et_pb_section)"));n.length>0&&n.each((function(){var t=e(this);0===t.closest("#et-boc").length&&t.wrap('<div id="et-boc"></div>'),0===t.closest(".et-l").length&&t.wrap('<div class="et-l"></div>')}))}).call(this,n(0))}});reset_memory_limit_increase_setting.js000064400000003217152336404310014424 0ustar00!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=147)}({0:function(e,t){e.exports=jQuery},147:function(e,t,n){"use strict";(function(e){e((function(){var t=e("#epanel-ajax-saving");e(".et_disable_memory_limit_increase").on("click",(function(n){n.preventDefault(),e.ajax({type:"POST",url:ajaxurl,data:{action:"et_reset_memory_limit_increase",et_builder_reset_memory_limit_nonce:et_reset_memory_limit_increase.et_builder_reset_memory_limit_nonce},beforeSend:function(e){t.addClass("et_loading").removeClass("success-animation"),t.fadeIn("fast")},success:function(n){t.removeClass("et_loading").removeClass("success-animation"),setTimeout((function(){t.fadeOut("slow")}),500),"success"===n&&(e(".et_disable_memory_limit_increase").closest(".epanel-box").hide(),t.addClass("success-animation"))}})}))}))}).call(this,n(0))}});page-settings-metabox.js000064400000004265152336404310011321 0ustar00!function(t){var e={};function n(i){if(e[i])return e[i].exports;var _=e[i]={i:i,l:!1,exports:{}};return t[i].call(_.exports,_,_.exports,n),_.l=!0,_.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var _ in t)n.d(i,_,function(e){return t[e]}.bind(null,_));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=146)}({0:function(t,e){t.exports=jQuery},146:function(t,e,n){"use strict";(function(t){var e=t("#et_settings_meta_box"),n=e.find(".et_pb_page_settings_container").first(),i=t(".et_pb_toggle_builder_wrapper"),_=t(".et_pb_page_setting"),s=t(".et_pb_page_layout_settings"),o=t("#formatdiv"),r=window.et_pb_options;i.hasClass("et_pb_builder_is_used")&&function(){var e=s.closest("#et_settings_meta_box").find(".et_pb_page_layout_settings");if(_.filter(":visible").length>1?(e.hide(),s.find(".et_pb_side_nav_settings").show()):("post"!==r.post_type&&"no"===r.is_third_party_post_type&&e.hide(),s.closest("#et_settings_meta_box").find(".et_pb_side_nav_settings").show(),s.closest("#et_settings_meta_box").find(".et_pb_single_title").show()),e.length>0){var n=e.find('option[value="et_full_width_page"]');n.length>0&&n.show()}if(o.length){var i=o.find('input[type="radio"]:checked').val();o.hide(),t(".et_divi_format_setting.et_divi_".concat(i,"_settings")).hide()}"project"===r.post_type&&s.closest("#et_settings_meta_box").find(".et_pb_project_nav").show()}(),n.hasClass("et_pb_page_settings_container--tb-has-header")&&e.find(".et_pb_nav_settings").hide(),n.hasClass("et_pb_page_settings_container--tb-has-body")&&e.find(".et_pb_page_layout_settings, .et_pb_single_title").hide(),0===n.height()&&e.hide()}).call(this,n(0))}});builder.js000064400001171473152336404310006547 0ustar00!function(e){var t={};function i(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(o,n,function(t){return e[t]}.bind(null,n));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=140)}({0:function(e,t){e.exports=jQuery},140:function(e,t,i){"use strict";(function(e,t){var o,n=(o=i(19))&&o.__esModule?o:{default:o};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var s=s||{};window.ET_PageBuilder=s,window.wp=window.wp||{},window.et_builder_version="4.27.6",window.et_builder_product_name="Divi";var l=window.et_error_modal_shown,d=!1,r=!1,c=0,p=0,b=0,u="et_pb_templates_",g={},h={},f=[],m={s:!1,r:!1,c:!1};function v(e,t){if(_.isUndefined(t))return e;return e.replace(/<!-- (\d+) -->/g,(function(e,i){return t[i]}))}function w(){return new Promise((function(t,i){e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_builder_library_get_layouts_data",postId:et_pb_options.postId,nonce:et_pb_options.library_get_layouts_data_nonce}}).then((function(e){t(S(e,"data",""))}))}))}var y=w();function k(){var e,t,i=et_pb_options.product_version;e="et_forced_localstorage_clear",(t=localStorage.getItem(e))||(t=wpCookies.get(e)),t!==i&&(localStorage.clear(),wpCookies.set(e,i),localStorage.setItem(e,i),setTimeout((function(){window.location.reload()}),100))}function C(t){var i,o=0,n=new Date,a="".concat(n.getYear(),"_").concat(n.getMonth(),"_").concat(n.getDate()),s="".concat(et_pb_options.et_builder_module_parent_shortcodes,"|").concat(et_pb_options.et_builder_module_child_shortcodes).split("|"),c=et_pb_options.product_version,g=et_pb_options.active_plugins.join("|"),h="",f=0,m={missing_modules_array:[]};if((t=!_.isUndefined(t)&&t)||(e('script[src="'.concat(et_pb_options.builder_js_src,'"]')).length||e(".et-pb-cache-update").show(),e("body").on("click",".et_builder_increase_memory",(function(){var t=e(this);return e.ajax({type:"POST",dataType:"json",url:et_pb_options.ajaxurl,data:{action:"et_pb_increase_memory_limit",et_admin_load_nonce:et_pb_options.et_admin_load_nonce},success:function(e){_.isUndefined(e.success)?t.addClass("et_builder_modal_action_button_fail").prop("disabled",!0).text(et_pb_options.memory_limit_not_increased):t.addClass("et_builder_modal_action_button_success").text(et_pb_options.memory_limit_increased)}}),!1})),e("body").on("click",".et_pb_reload_builder",(function(){return location.reload(),!1}))),function(){if(!$())return!1;if(!_.isUndefined(et_pb_options.force_cache_purge)&&"true"===et_pb_options.force_cache_purge)return!1;var e=localStorage.getItem("".concat(u,"settings_date")),t=localStorage.getItem("".concat(u,"settings_product_version")),i=localStorage.getItem("".concat(u,"settings_active_plugins"));if(_.isUndefined(e)||_.isNull(e))return!1;if(_.isUndefined(t)||_.isNull(t))return!1;if(i!==g)return!1;if(a!=e||c!=t)return function(){if(!$())return!1;_.forEach(_.keys(localStorage),(function(e){j(e,"et_pb_templates_")&&localStorage.removeItem(e)}))}(),!1;return!0}()){if(r)return;for(var w in s){var y=s[w],S=u+y,x=LZString.decompressFromUTF16(localStorage.getItem(S));f++,_.isUndefined(x)||_.isNull(x)||""===x?m.missing_modules_array.push(y):h+=LZString.decompressFromUTF16(localStorage.getItem(S)),!d&&(m.missing_modules_array.length===parseInt(et_pb_options.et_builder_templates_amount)||m.missing_modules_array.length&&s.length===f)&&(d=!0,e.ajax({type:"POST",dataType:"json",url:et_pb_options.ajaxurl,data:{action:"et_pb_get_backbone_template",et_post_type:et_pb_options.post_type,et_modules_slugs:JSON.stringify(m),et_admin_load_nonce:et_pb_options.et_admin_load_nonce},success:function(t){var i;d=!1,!_.isUndefined(t.templates)&&t.templates.length&&_.each(t.templates,(function(o){i=v(o.template,t.unique);try{localStorage.setItem(u+o.slug,LZString.compressToUTF16(i))}catch(e){k()}e("body").append(i)}))}}),m.missing_modules_array=[])}e("body").append(h)}else i=setInterval((function(){if(o===Math.ceil(et_pb_options.et_builder_modules_count/et_pb_options.et_builder_templates_amount))return clearInterval(i),!1;var t;r=!0,p++,t=o*et_pb_options.et_builder_templates_amount,e.ajax({type:"POST",dataType:"json",url:et_pb_options.ajaxurl,data:{action:"et_pb_get_backbone_templates",et_post_type:et_pb_options.post_type,et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_templates_start_from:t},error:function(){var t=e("#et-builder-failure-notice-template");l||t.length&&(e(".et_pb_failure_notification_modal").length||($()&&(localStorage.removeItem("".concat(u,"settings_date")),localStorage.removeItem("".concat(u,"settings_product_version")),localStorage.removeItem("".concat(u,"settings_active_plugins"))),e("body").addClass("et_pb_stop_scroll").append(t.html())))},success:function(t){var i;for(var o in t.templates){if(i=v(t.templates[o],t.unique),$())try{localStorage.setItem("et_pb_templates_".concat(o),LZString.compressToUTF16(i))}catch(e){k()}e("body").append(i)}b++,p>0&&p===b&&(r=!1,C())}}),o++}),800),function(){if(!$())return!1;try{localStorage.setItem("".concat(u,"settings_date"),a),localStorage.setItem("".concat(u,"settings_product_version"),c),localStorage.setItem("".concat(u,"settings_active_plugins"),g)}catch(e){}}();function $(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}}function S(e,t,i){if(!_.isObject(e))return i;var o=_.reduce(t.split("."),(function(e,t){return e?e[t]:void 0}),e);return _.isUndefined(o)?i:o}function x(e,t){if(!t)return!0;var i=t.split("."),o=_.first(i);return _.has(e,o)&&x(e[o],_.rest(i).join("."))}function j(e,t){return e.substr(0,t.length)===t}C(),s.isDynamicContent=function(e){if("string"!=typeof e)return!1;var t=new RegExp(/^<p>(.*)<\/p>$/,"i"),i=/^\s+|\s+$/,o=e.replace(i,"");o=(o=o.replace(t,"$1")).replace(i,"");try{if(/^@ET-DC@(.*?)@$/.test(o))return!0;var n=JSON.parse(o);if(void 0!==n.dynamic&&!0===n.dynamic)return!0}catch(e){}return!1},document.addEventListener("DOMContentLoaded",(function(){function i(){e("#et-builder-right-click-controls").remove(),e("#et_pb_layout_right_click_overlay").remove()}function o(t){t.on("click",(function(t){var i=e(this);t.preventDefault(),(u=wp.media.frames.et_pb_file_frame=new wp.media.view.MediaFrame.ETSelect({title:i.data("choose"),library:{type:i.data("type")},button:{text:i.data("update")},multiple:!1})).on("select",(function(){var e=u.state().props.get("url"),t=i.siblings(".et-pb-upload-field");t.val(e),t.trigger("change"),p(i)})),u.on("insert",(function(){var e=u.state().get("selection").models[0];if(!_.isUndefined(e)){var t=i.siblings(".et-pb-upload-field");t.val(e.get("url")),t.trigger("change"),p(i)}})),u.open()})),t.siblings(".et-pb-upload-field").on("input",(function(){p(e(this).siblings(".et-pb-upload-button"))})),t.siblings(".et-pb-upload-field").each((function(){p(e(this).siblings(".et-pb-upload-button"))}))}function l(t){t.on("click",(function(i){e(this);var o=t.next(".et-pb-gallery"),n=t.closest(".et-pb-options-tab").find("#et_pb_gallery_orderby");if(i.preventDefault(),"undefined"!=typeof wp&&wp.media&&wp.media.gallery){var a=o.val().length?' ids="'.concat(o.val(),'"'):"",s=n.val().length?' orderby="'.concat(n.val(),'"'):"",l="[gallery".concat(a).concat(s,"]");u=wp.media.frames.et_pb_file_frame=wp.media.gallery.edit(l),a||u.setState("gallery-library"),_(u.$el),u.on("content:render:browse",(function(e){_(e.$el)})),u.state("gallery-edit").on("update",(function(e){var t=wp.media.gallery.shortcode(e).attrs.named;t.ids&&o.val(t.ids),t.orderby?n.val(t.orderby):n.val("")}))}function _(t){setTimeout((function(){t.find(".gallery-settings").find("label.setting").each((function(){e(this).find(".link-to, .columns, .size").length?e(this).remove():e(this).has("input[type=checkbox]").length&&e(this).children("input[type=checkbox]").css("margin","11px 5px")}))}),10)}}))}function d(e){return e.siblings("input").attr("id").replace("et_pb_","").replace("_list","")}function r(t){t.on("click",(function(t){var i=e(this),o=e("#et_pb_src.et-pb-upload-field").val().trim();t.preventDefault(),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_video_get_oembed_thumbnail",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_video_url:o},success:function(t){t.length?e("#et_pb_image_src").val(t).trigger("input"):(i.after('<div class="et-pb-error">'.concat(et_pb_options.video_module_image_error,"</div>")),i.siblings(".et-pb-error").delay(5e3).fadeOut(800))}})}))}function p(t){if(!(t.length<1)){var i=t.siblings(".et-pb-upload-field"),o=i.siblings(".et-pb-upload-preview"),n=i.closest(".et-pb-option").find(".et-pb-option-preview"),a=n.length,s=i.val().trim(),l=t.data("type"),d=t.closest(".et_pb_module_settings").attr("data-module_type"),r=t.closest(".et-pb-options-tabs").find("#et_pb_featured_image").val(),c=t.closest(".et-pb-options-tabs").find("#et_pb_featured_placement").val(),p=e("#postimagediv img").attr("src"),b=_.contains(et_pb_options.et_builder_modules_featured_image_background,d)&&"on"===r&&"background"===c,u=i.closest(".et-pb-option-container-inner").attr("data-base_name"),g="background"===u?"":"".concat(u,"_");if(b?(s=p,n.addClass("et-pb-featured-image-background")):n.removeClass("et-pb-featured-image-background"),"image"===l||"video"===l&&a){if(""===s)return a?void n.addClass("et-pb-option-preview--empty").find(".et-pb-preview-content").remove():void(o.length&&o.remove());if(a){n.find(".et-pb-preview-content").remove();var h=t.closest(".et-pb-option-container--background"),f=h.find("input, select"),m=h.attr("data-column-index"),v=["url(".concat(s,")")],w=ke(h.find(".et_pb_background-tab--gradient"),u),y={},k="",C=!1,S=!1;if(w&&(C=!0,v.push(w)),f.each((function(){if(void 0!==e(this).attr("id")){var t=e(this).attr("id").replace("et_pb_",""),i=e(this).val(),o=void 0!==e(this).attr("data-default")?e(this).attr("data-default"):"",n=""!==i&&void 0!==i;void 0!==m&&(t=t.replace("_".concat(m),"")),y[t]=n?i:o}})),"image"===l){var x={position:"absolute",top:"0px",right:"0px",bottom:"0px",left:"0px"};"on"===y["".concat(g,"parallax")]?(x.backgroundImage="url(".concat(s,")"),x.backgroundRepeat="no-repeat",x.backgroundSize="cover",x.backgroundPosition="center"):(void 0===y["".concat(u,"_position")]&&(y["".concat(u,"_position")]=""),"on"===y["".concat(u,"_color_gradient_overlays_image")]&&v.reverse(),S=!0,x.backgroundImage=v.join(", "),x.backgroundSize=y["".concat(u,"_size")],x.backgroundPosition=y["".concat(u,"_position")].replace("_"," "),x.backgroundRepeat=y["".concat(u,"_repeat")],x.backgroundBlendMode=y["".concat(u,"_blend")],x.backgroundColor=C&&S?"initial":y["".concat(u,"_color")]),k=e("<div />",{class:"et-pb-preview-content"}).css(x)}else"video"===l&&(k=e("<video />",{class:"et-pb-preview-content",src:s,loop:!0,controls:!0,height:190}));n.removeClass("et-pb-option-preview--empty").prepend(k)}else o.length||(t.siblings(".description").before("".concat('<div class="et-pb-upload-preview"><strong class="et-pb-upload-preview-title">').concat(et_pb_options.preview_image,"</strong>")+'<img src="" width="408" /></div>'),o=i.siblings(".et-pb-upload-preview"));o.find("img").attr("src",s)}}}function b(e){var t=e.closest(".et-pb-option-container"),i=parseInt(t.find(".iris-square-value.ui-draggable").width()),o=parseInt(t.find(".iris-square-value.ui-draggable").css("left"))+i/2,n=parseInt(t.width());""!==e&&o>n-50?t.addClass("on-right-corner"):t.removeClass("on-right-corner")}_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},s.Helpers={},s.Helpers.getSettingValue=function(t){var i,o,n=[],a=t.is("#et_pb_content_main")?"et_pb_content":t.attr("id");if(t.is(":checkbox"))a=t.attr("name"),t.closest(".et-pb-option-container").find('[name="'.concat(a,'"]:checked')).each((function(){n.push(e(this).val())})),i=n.join(",");else if(t.is("#et_pb_content_main"))i=(i=t.html()).replace(/\^\^/g,"%22");else if(t.closest(".et-pb-custom-css-option").length)i=""!==(o=t.val())?o.replace(/(?:\r\n|\r|\n)/g,"||").replace(/\\/g,"%92"):"";else if(t.hasClass("et-pb-range-input"))i=fe(t),t.hasClass("et-pb-validate-unit")&&(i=Se(i.toString(),!1,"no_default_unit"));else if(t.hasClass("et-pb-range")){var s=t.siblings(".et-pb-range-input");i=fe(s),s.hasClass("et-pb-validate-unit")&&(i=Se(i.toString(),!1,"no_default_unit"))}else t.hasClass("et-pb-validate-unit")?i=Se(t.val(),!1,""):t.hasClass("et-pb-text-align-select")?t.closest(".et-pb-option-container").find(".et_text_align_active").length&&(i=t.val()):t.is(":checkbox")||(i=t.is("textarea.wp-editor-area")?ee(a):t.val(),t.hasClass("et-pb-range-input")&&"px"===i&&(i=""));return _.isNull(i)&&(i=""),i},s.Helpers.hasValue=function(e){return!_.isUndefined(e)&&""!==e},s.Helpers.isOn=function(e){return!_.isUndefined(e)&&"on"===e},s.Helpers.moduleHasBackground=function(e,t){var i=this,o=_.isUndefined(t)?["color","gradient","image","video"]:t,n=!1;return _.forEach(o,(function(t){var o=!1;switch(t){case"color":o=i.hasValue(e.et_pb_background_color);break;case"gradient":o=i.isOn(e.et_pb_use_background_color_gradient);break;case"image":o=i.hasValue(e.et_pb_background_image);break;case"video":var a=i.hasValue(e.et_pb_background_video_mp4),s=i.hasValue(e.et_pb_background_video_webm);o=a||s}o&&(n=!0)})),n},s.Module=Backbone.Model.extend({defaults:{type:"element",_builder_version:et_pb_options.product_version}}),s.SavedTemplate=Backbone.Model.extend({defaults:{title:"template",ID:0,shortcode:"",is_global:"false",layout_type:"",module_type:"",categories:[],unsynced_options:[]}}),s.History=Backbone.Model.extend({defaults:{timestamp:_.now(),shortcode:"",current_active_history:!1,verb:"did",noun:"something"},max_history_limit:100,validate:function(e,t){t.collection.length;var i=t.collection.findWhere({current_active_history:!0}),o=e.shortcode,n=_.isUndefined(i)?t.collection.at(t.collection.length-1):i;if(o===(!_.isUndefined(n)&&n.get("shortcode")))return"duplicate";V.enable_history=!1;var a=t.collection.models.length-(this.max_history_limit-1);if(a>0)for(var s=1;s<=a;s++)t.collection.shift()}}),s.Layout=Backbone.Model.extend({defaults:{moduleNumber:0,forceRemove:!1,modules:JSON.parse(et_pb_options.et_builder_modules),views:[]},initialize:function(){_.each(this.get("modules"),(function(e){e.title=e.title.replace(/%%/g,'"'),e.title=e.title.replace(/\|\|/g,"'")}))},addView:function(e,t){var i=this.get("views");i[e]=t,this.set({views:i})},getView:function(e){return this.get("views")[e]},getChildViews:function(e){var t=this.get("views"),i={};return _.each(t,(function(t,o){void 0!==t&&t.model.attributes.parent===e&&(i[o]=t)})),i},getChildrenViews:function(e){var t,i=this,o=i.get("views"),n={};return _.each(o,(function(o,a){void 0!==o&&o.model.attributes.parent===e&&(t=i.getChildrenViews(o.model.attributes.cid),_.isEmpty(t)||_.extend(n,t),n[a]=o)})),n},getParentViews:function(e){for(var t=this.getView(e),i={};!_.isUndefined(t);)i[t.model.attributes.cid]=t,t=this.getView(t.model.attributes.parent);return i},getSectionView:function(e){var t,i=this.getParentViews(e);return t=_.filter(i,(function(e){return"section"===e.model.attributes.type})),!_.isUndefined(t[0])&&t[0]},setNewParentID:function(e,t){var i=this.get("views");i[e].model.attributes.parent=t,this.set({views:i})},removeView:function(e){var t=this.get("views"),i={};_.each(t,(function(t,o){o!=e&&(i[o]=t)})),this.set({views:i})},generateNewId:function(){var e=this.get("moduleNumber")+1;return this.set({moduleNumber:e}),e},generateTemplateName:function(t){return-1!==e.inArray(t,["row","row_inner","section","column","column_inner"])&&(t="et_pb_".concat(t)),"#et-builder-".concat(t,"-module-template")},getModuleOptionsNames:function(e){var t=this.get("modules");return this.addAdminLabel(_.findWhere(t,{label:e}).options)},getNumberOf:function(e,t){var i=this.get("views"),o=0;return _.each(i,(function(i){if(void 0!==i){var n=i.model.attributes.type;i.model.attributes.parent!==t||n!==e&&n!=="".concat(e,"_inner")||o++}})),o},getNumberOfModules:function(e){var t=this.get("views"),i=0;return _.each(t,(function(t){void 0!==t&&t.model.attributes.type===e&&i++})),i},getTitleByShortcodeTag:function(e){var t=this.get("modules"),i=_.findWhere(t,{label:e});return _.isUndefined(i)?e:i.title},getDefaultAdminLabel:function(t){return e.inArray(t,["section","row","column","row_inner","column_inner"])>-1?void 0!==et_pb_options.noun[t]?et_pb_options.noun[t]:t:this.getTitleByShortcodeTag(t)},isModuleFullwidth:function(e){var t=this.get("modules");return"on"===_.findWhere(t,{label:e}).fullwidth_only},isChildrenLocked:function(e){var t=this.getChildrenViews(e),i=!1;return _.each(t,(function(e){"on"!==e.model.get("et_pb_locked")&&"on"!==e.model.get("et_pb_parent_locked")||(i=!0)})),i},addAdminLabel:function(e){return _.union(e,["admin_label"])},removeGlobalAttributes:function(e,t){var i=this,o=(t=!_.isUndefined(t)&&t,_.isUndefined(e.model.attributes.global_parent_cid)?e.model.attributes.cid:e.model.attributes.global_parent_cid),n=this.getView(o),a=this.getChildrenViews(o);this.is_global(n.model)&&(t&&n.model.set("et_pb_temp_global_module",n.model.get("et_pb_global_module")),n.model.unset("et_pb_global_module")),_.each(a,(function(e){i.is_global_children(e.model)&&(t&&e.model.set("et_pb_temp_global_parent",e.model.get("et_pb_global_parent")),e.model.unset("et_pb_global_parent")),i.has_global_parent_cid(e.model)&&(t&&e.model.set("et_pb_temp_global_parent_cid",e.model.get("global_parent_cid")),e.model.unset("global_parent_cid"))}))},removeTemporaryGlobalAttributes:function(e,t){var i=this,o=(t=!_.isUndefined(t)&&t,(_.isUndefined(e.model.attributes.et_pb_temp_global_module)?$.findWhere({et_pb_temp_global_module:e.model.attributes.et_pb_temp_global_parent}):e.model).attributes.cid),n=k.getView(o),a=k.getChildrenViews(o);this.is_temp_global(n.model)&&(t&&n.model.set("et_pb_global_module",n.model.get("et_pb_temp_global_module")),n.model.unset("et_pb_temp_global_module")),_.each(a,(function(e){i.is_temp_global_children(e.model)&&(t&&e.model.set("et_pb_global_parent",e.model.get("et_pb_temp_global_parent")),e.model.unset("et_pb_temp_global_parent")),i.has_temp_global_parent_cid(e.model)&&(t&&e.model.set("global_parent_cid",e.model.get("et_pb_temp_global_parent_cid")),e.model.unset("et_pb_temp_global_parent_cid"))})),t&&Ie(o)},is_app:function(e){return"app"===e.attributes.type},is_global:function(e){return!this.is_app(e)&&!(!e.has("et_pb_global_module")||""===e.get("et_pb_global_module"))},is_global_children:function(e){return!this.is_app(e)&&!(!e.has("et_pb_global_parent")||""===e.get("et_pb_global_parent"))},has_global_parent_cid:function(e){return!(!e.has("global_parent_cid")||""===e.get("global_parent_cid"))},is_temp_global:function(e){return!(!e.has("et_pb_temp_global_module")||""===e.get("et_pb_temp_global_module"))},is_temp_global_children:function(e){return!(!e.has("et_pb_temp_global_parent")||""===e.get("et_pb_temp_global_parent"))},has_temp_global_parent_cid:function(e){return!(!e.has("et_pb_temp_global_parent_cid")||""===e.get("et_pb_temp_global_parent_cid"))},changeColumnStructure:function(t,i,o,n){var a=i.layout.split(","),s=i.specialty_columns,l=i.layout_specialty,d=_.size(a),r=t.options.view,c=Pe(t);if(i.is_structure_change){var p=k.getChildViews(t.model.get("cid")),b=[],u=0;_.each(p,(function(e){b[u]=e.model.get("cid"),u+=1}))}if(_.each(a,(function(e,i){var o=d==i+1?"true":"false",n={type:"column",cid:k.generateNewId(),parent:t.model.get("cid"),layout:e,view:r};void 0!==t.model.get("et_pb_global_parent")&&""!==t.model.get("et_pb_global_parent")&&(n.et_pb_global_parent=t.model.get("et_pb_global_parent"),n.global_parent_cid=t.model.get("global_parent_cid")),void 0!==l[i]&&"1"===l[i]&&(n.layout_specialty=l[i],n.specialty_columns=parseInt(s)),void 0!==t.model.get("specialty_row")&&(t.model.set("module_type","row_inner",{silent:!0}),t.model.set("type","row_inner",{silent:!0})),t.collection.add([n],{update_shortcodes:o})})),i.is_structure_change){var g=[];p=k.getChildViews(t.model.get("cid")),u=0,_.each(p,(function(e){g[u]=e.model.get("cid"),u+=1})),g.splice(0,b.length);for(var h=0;h<b.length;h++){var f,m=!!(b.length>g.length&&h>g.length-1),w=b[h],y=m?g[g.length-1]:g[h],C=k.getView(w).$el.html(),S=k.getChildViews(w),x="";k.getView(w).model.destroy(),k.getView(w).remove(),k.removeView(w),f=e('.et-pb-column[data-cid="'.concat(y,'"]')),m?(f.find(".et-pb-insert-module").remove(),x=f.html(),f.html(x+C)):f.html(C),_.each(S,(function(e){e.model.set("parent",y,{silent:!0})}))}V.allowHistorySaving("edited","column")}(void 0!==t.model.get("template_type")&&"section"===t.model.get("template_type")&&"on"===t.model.get("et_pb_specialty")||!o)&&Ue(),void 0!==t.model.get("et_pb_template_type")&&"row"===t.model.get("et_pb_template_type")&&De("_et_pb_row_layout",i.layout),void 0!==c&&""!==c&&Ie(c),n||V.allowHistorySaving("added","column"),v.trigger("et-add:columns")}}),s.Modules=Backbone.Collection.extend({model:s.Module}),s.SavedTemplates=Backbone.Collection.extend({model:s.SavedTemplate}),s.Histories=Backbone.Collection.extend({model:s.History}),s.TemplatesView=window.wp.Backbone.View.extend({className:"et_pb_saved_layouts_list",tagName:"ul",render:function(){var t="",i=void 0===this.options.category?"all":this.options.category;return this.collection.each((function(o){if("all"===i||-1!==e.inArray(i,o.get("categories"))){var n=new s.SingleTemplateView({model:o});this.$el.append(n.el),t=void 0!==n.model.get("is_global")&&"global"===n.model.get("is_global")?"global":""}}),this),"global"===t&&this.$el.addClass("et_pb_global"),this}}),s.SingleTemplateView=window.wp.Backbone.View.extend({tagName:"li",template:_.template(e("#et-builder-saved-entry").html()),events:{click:"insertSection"},initialize:function(){this.render()},render:function(){this.$el.html(this.template(this.model.toJSON())),void 0!==this.model.get("module_type")&&""!==this.model.get("module_type")&&"module"===this.model.get("layout_type")&&this.$el.addClass(this.model.get("module_type"))},insertSection:function(t){var i=e(t.target),o=void 0!==i.closest(".et_pb_modal_settings").data("parent_cid")?i.closest(".et_pb_modal_settings").data("parent_cid"):"",n=void 0!==e(".et-pb-settings-heading").data("current_row")?e(".et-pb-settings-heading").data("current_row"):"",a="global"===this.model.get("is_global")?this.model.get("ID"):"",s=void 0!==e(".et-pb-saved-modules-switcher").data("specialty_columns")?"on":"off",l=this.model.get("shortcode"),_=this.model.get("unsynced_options"),d=!1,r="row"===this.model.get("layout_type")?n:o,c=k.getView(r),p="row_inner"===this.options.model.get("layout_type")?"saved_row":"saved_".concat(this.options.model.get("layout_type")),b=i.closest(".et_pb_modal_settings_container"),u=Pe(c);"on"===s&&(r=c.model.get("parent"),c=k.getView(r)),"section"!==this.model.get("layout_type")&&""!==u&&(d=!0,a=""),V.allowHistorySaving("added",p),t.preventDefault(),l=V.codeModuleContentPrep(l),void 0!==window.switchEditors&&(l=qe(window.switchEditors.wpautop(l))),l=V.codeModuleContentUnPrep(l),V.createLayoutFromContent(l,o,"",{ignore_template_tag:"ignore_template",current_row_cid:n,global_id:a,after_section:o,is_reinit:"reinit",unsynced_options:_}),Ue(),!0===d&&Ie(u),b.length&&b.find(".et-pb-modal-close").trigger("click")}}),s.TemplatesModal=window.wp.Backbone.View.extend({className:"et_pb_modal_settings",template:_.template(e("#et-builder-load_layout-template").html()),events:{"click .et-pb-options-tabs-links li a":"switchTab"},render:function(){return this.$el.html(this.template({display_switcher:"off"})),this.$el.addClass("et_pb_modal_no_tabs"),this},switchTab:function(t){var i=e(t.currentTarget).parent();t.preventDefault(),Ee(i,"section","")}}),s.SectionView=window.wp.Backbone.View.extend({className:"et_pb_section",template:_.template(e("#et-builder-section-template").html()),events:{"click .et-pb-settings-section":"showSettings","click .et-pb-clone-section":"cloneSection","click .et-pb-remove-section":"removeSection","click .et-pb-section-add-main":"addSection","click .et-pb-section-add-fullwidth":"addFullwidthSection","click .et-pb-section-add-specialty":"addSpecialtySection","click .et-pb-section-add-saved":"addSavedSection","click .et-pb-expand":"expandSection","click .et-pb-insert-row":"addFirstRow","contextmenu .et-pb-section-add":"showRightClickOptions","click.et_pb_section > .et-pb-controls .et-pb-unlock":"unlockSection","contextmenu.et_pb_section > .et-pb-controls":"showRightClickOptions","contextmenu.et_pb_row > .et-pb-right-click-trigger-overlay":"showRightClickOptions","click.et_pb_section > .et-pb-controls":"hideRightClickOptions","click.et_pb_row > .et-pb-right-click-trigger-overlay":"hideRightClickOptions","click > .et-pb-locked-overlay":"showRightClickOptions","contextmenu > .et-pb-locked-overlay":"showRightClickOptions",click:"setABTesting"},initialize:function(){this.child_views=[],this.listenTo(this.model,"change:admin_label",this.renameModule),this.listenTo(this.model,"change:et_pb_disabled",this.toggleDisabledClass)},render:function(){return this.$el.html(this.template(this.model.toJSON())),"on"===this.model.get("et_pb_specialty")&&(this.$el.addClass("et_pb_section_specialty"),"true"===this.model.get("et_pb_specialty_placeholder")&&this.$el.addClass("et_pb_section_placeholder")),"on"!==this.model.get("et_pb_specialty")&&"on"!==this.model.get("et_pb_fullwidth")||this.$el.find(".et-pb-insert-row").remove(),(void 0!==this.model.get("et_pb_global_module")||void 0!==this.model.get("et_pb_template_type")&&"section"===this.model.get("et_pb_template_type")&&"global"===et_pb_options.is_global_template)&&this.$el.addClass("et_pb_global"),void 0!==this.model.get("et_pb_disabled")&&"on"===this.model.get("et_pb_disabled")&&this.$el.addClass("et_pb_disabled"),void 0!==this.model.get("et_pb_locked")&&"on"===this.model.get("et_pb_locked")&&this.$el.addClass("et_pb_locked"),void 0!==this.model.get("et_pb_collapsed")&&"on"===this.model.get("et_pb_collapsed")&&this.$el.addClass("et_pb_collapsed"),void 0!==this.model.get("pasted_module")&&this.model.get("pasted_module")&&Y(this.$el),_.isUndefined(this.model.get("et_pb_temp_global_module"))||this.$el.addClass("et_pb_global_temp"),J.is_active()&&(J.is_subject(this.model)&&(this.$el.addClass("et_pb_ab_subject"),J.set_subject_rank_coloring(this)),J.is_goal(this.model)&&this.$el.addClass("et_pb_ab_goal"),J.is_user_has_permission(this.model.get("cid"),"section")||this.$el.addClass("et_pb_ab_no_permission")),this.makeRowsSortable(),this},showSettings:function(t){var i,o,n=this,a=void 0!==t?e(t.currentTarget):"",l={model:this.model,collection:this.collection,attributes:{"data-open_view":"module_settings"},triggered_by_right_click:this.triggered_by_right_click,do_preview:this.do_preview};if(void 0!==t&&t.preventDefault(),!this.isSectionLocked()&&!V.isLoading&&!J.is_selecting())if(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"section")){if(""!==a&&a.closest(".et_pb_section_specialty").length){var _=a.closest(".et_pb_section_specialty").find(".et-pb-section-content > .et-pb-column"),d="";_.length&&_.each((function(){d+=""===d?"1_1":",1_1"})),l.model.attributes.columns_layout=d}if(!1===(o=(i=new s.ModalView(l)).render()))return C(!0),setTimeout((function(){n.showSettings()}),500),void v.trigger("et-pb-loading:started");v.trigger("et-pb-loading:ended"),e("body").append(o.el),(void 0!==i.model.get("et_pb_global_module")&&""!==i.model.get("et_pb_global_module")||void 0!==this.model.get("et_pb_template_type")&&"section"===this.model.get("et_pb_template_type")&&"global"===et_pb_options.is_global_template)&&e(".et_pb_modal_settings_container").addClass("et_pb_saved_global_modal"),void 0!==this.model.get("et_pb_specialty")&&"on"===this.model.get("et_pb_specialty")&&e(".et_pb_modal_settings_container").addClass("et_pb_specialty_section_settings"),Re()}else J.alert("has_no_permission")},addSection:function(e){var t=k.generateNewId();e.preventDefault(),i(),V.isLoading||J.is_selecting()||(V.allowHistorySaving("added","section"),this.collection.add([{type:"section",module_type:"section",et_pb_fullwidth:"off",et_pb_specialty:"off",cid:t,view:this,created:"auto",admin_label:et_pb_options.noun.section}]))},addFullwidthSection:function(e){var t=k.generateNewId();e.preventDefault(),i(),V.isLoading||J.is_selecting()||(V.allowHistorySaving("added","fullwidth_section"),this.collection.add([{type:"section",module_type:"section",et_pb_fullwidth:"on",et_pb_specialty:"off",cid:t,view:this,created:"auto",admin_label:et_pb_options.noun.section}]))},addSpecialtySection:function(t){var o=k.generateNewId(),n=e(t.target),a=void 0!==n&&void 0!==n.data("is_template")?"section":"";t.preventDefault(),i(),V.isLoading||J.is_selecting()||(V.allowHistorySaving("added","specialty_section"),this.collection.add([{type:"section",module_type:"section",et_pb_fullwidth:"off",et_pb_specialty:"on",cid:o,template_type:a,view:this,created:"auto",admin_label:et_pb_options.noun.section}]))},addSavedSection:function(t){var o={attributes:{"data-open_view":"saved_templates","data-parent_cid":this.model.get("cid")},view:this},n=new s.ModalView(o);i(),V.isLoading||J.is_selecting()||(e("body").append(n.render().el),Ae("include_global","","section",e(".et-pb-saved-modules-tab"),"regular",0,"all"),t.preventDefault())},expandSection:function(e){e.preventDefault(),this.$el.closest(".et_pb_section").removeClass("et_pb_collapsed"),this.options.model.attributes.et_pb_collapsed="off",J.is_active()&&"on"===this.model.get("et_pb_ab_subject")&&J.subject_carousel(this.model.get("cid")),V.allowHistorySaving("expanded","section"),V.saveAsShortcode()},unlockSection:function(e){if(e.preventDefault(),!V.isLoading&&!J.is_selecting()){var t,i=this,o=i.$el.closest(".et_pb_section");He().done((function(e){!0===e?(o.removeClass("et_pb_locked"),i.options.model.attributes.et_pb_locked="off",t=k.getChildrenViews(i.model.get("cid")),_.each(t,(function(e,t){e.$el.removeClass("et_pb_parent_locked"),e.model.set("et_pb_parent_locked","off",{silent:!0})})),V.allowHistorySaving("unlocked","section"),V.saveAsShortcode()):alert(et_pb_options.locked_section_permission_alert)}))}},addFirstRow:function(){if(!V.isLoading){var e=k.generateNewId(),t=void 0!==this.model.get("et_pb_global_module")&&""!==this.model.get("et_pb_global_module")?this.model.get("et_pb_global_module"):"",i=""!==t?this.model.get("cid"):"";this.collection.add([{type:"row",module_type:"row",cid:e,parent:this.model.get("cid"),view:this,et_pb_global_parent:t,global_parent_cid:i,admin_label:et_pb_options.noun.row}]),k.getView(e).displayColumnsOptions()}},addRow:function(e){if(!V.isLoading){var t=k.generateNewId(),i=void 0!==this.model.get("et_pb_global_module")&&""!==this.model.get("et_pb_global_module")?this.model.get("et_pb_global_module"):"",o=""!==i?this.model.get("cid"):"";this.collection.add([{type:"row",module_type:"row",cid:t,parent:this.model.get("cid"),view:this,appendAfter:e,et_pb_global_parent:i,global_parent_cid:o,admin_label:et_pb_options.noun.row}]),k.getView(t).displayColumnsOptions()}},cloneSection:function(e){if(e.preventDefault(),!this.isSectionLocked()&&!V.isLoading&&!J.is_selecting()){if(J.is_active()){if(!J.is_user_has_permission(this.model.get("cid"),"section"))return void J.alert("has_no_permission");if(J.has_goal(this.model)&&!J.is_subject(this.model))return void J.alert("cannot_clone_section_has_goal")}this.$el.clone();var t,i={model:this.model,view:this.$el,view_event:e};t=new s.RightClickOptionsView(i,!0),V.allowHistorySaving("cloned","section"),t.copy(e),t.pasteAfter(e)}},makeRowsSortable:function(){var t=this,o="on"!==t.model.get("et_pb_fullwidth")?".et-pb-section-content":".et_pb_fullwidth_sortable_area",n=":not(.et_pb_locked) > ".concat(o);"on"!==t.model.get("et_pb_specialty")&&(J.is_active()&&!J.is_user_has_permission(this.model.get("cid"),"section")||t.$el.find(o).sortable({connectWith:n,delay:100,cancel:".et-pb-settings, .et-pb-clone, .et-pb-remove, .et-pb-row-add, .et-pb-insert-module, .et-pb-insert-column, .et-pb-insert-row, .et_pb_locked, .et-pb-disable-sort",update:function(i,n){var a=t.$el.find(o);if(V.isLoading)a.sortable("cancel");else{if(J.is_active()){if(!J.is_user_has_permission(e(n.item).children(".et-pb-row-content").attr("data-cid"),"row"))return J.alert("has_no_permission"),a.sortable("cancel"),void Ue();var s=e(n.item),l=_.isEmpty(e(n.sender))?e(i.target).parents(".et_pb_section"):e(n.sender).parents(".et_pb_section"),d=_.isEmpty(e(n.sender))?e(i.toElement).parents(".et_pb_section"):e(i.target).parents(".et_pb_section"),r=s.hasClass("et_pb_ab_subject"),c=s.hasClass("et_pb_ab_goal"),p=s.find(".et_pb_ab_subject").length,b=s.find(".et_pb_ab_goal").length,u=l.closest(".et_pb_ab_subject").length,g=d.closest(".et_pb_ab_subject").length,h=d.closest(".et_pb_ab_goal").length;if(c&&!r&&g)return J.alert("cannot_move_goal_into_subject"),a.sortable("cancel"),void Ue();if(b&&g)return J.alert("cannot_move_goal_into_subject"),a.sortable("cancel"),void Ue();if(r&&!c&&h)return J.alert("cannot_move_subject_into_goal"),a.sortable("cancel"),void Ue();if(p&&h)return J.alert("cannot_move_subject_into_goal"),a.sortable("cancel"),void Ue();c&&u&&(J.alert("cannot_move_row_goal_out_from_subject"),a.sortable("cancel"),Ue())}if(!e(n.item).closest(i.target).length)return e(i.target).find(".et_pb_row").length||(e(this).sortable("cancel"),alert(et_pb_options.section_only_row_dragged_away)),void(e(n.item).closest(".et-pb-disable-sort").length&&e(i.target).sortable("cancel"));var f=e(n.item).find(".et-pb-row-content").data("cid"),m=t.collection.find((function(e){return e.get("cid")==f}));if(e(n.item).closest(".et_pb_section.et_pb_global").length&&e(n.item).hasClass("et_pb_global"))e(n.sender).sortable("cancel"),alert(et_pb_options.global_row_alert);else if((e(n.item).closest(".et_pb_section.et_pb_global").length||e(n.sender).closest(".et_pb_section.et_pb_global").length)&&""===et_pb_options.template_post_id){var w,y,C;if((y=e(n.sender).closest(".et_pb_section.et_pb_global"))===(C=e(n.item).closest(".et_pb_section.et_pb_global")))Ie(w=m.get("global_parent_cid")),Ue();else{var S=y;0!==C.length||(_.isUndefined(m.get("et_pb_global_parent"))||""===m.get("et_pb_global_parent"))&&_.isUndefined(m.get("global_parent_cid"))||(m.unset("et_pb_global_parent"),m.unset("global_parent_cid"),k.removeGlobalAttributes(k.getView(m.get("cid"))));for(var x=1;x<=2;x++)void 0!==(w=S.find(".et-pb-section-content").data("cid"))&&""!==w&&(Ie(w),Ue()),S=C}}k.setNewParentID(n.item.find(".et-pb-row-content").data("cid"),t.model.attributes.cid),V.allowHistorySaving("moved","row"),v.trigger("et-sortable:update");var j=parseInt(e(this).attr("data-cid")),T=0;e(this).find(".et-pb-row-content").each((function(){T++;var t=parseInt(e(this).data("cid")),i=j+T;$.findWhere({cid:t}).set({layout_index:i})})),$.comparator="layout_index",$.sort()}},start:function(t,o){if(i(),t.altKey){var n=k.getView(e(o.item).children(".et-pb-row-content").data("cid")),a={model:n.model,view:n.$el,view_event:t},l=new s.RightClickOptionsView(a,!0);l.copy(t,!0),l.pasteAfter(t,void 0,void 0,void 0,!0,!0),V.allowHistorySaving("cloned","row")}}}))},addChildView:function(e){this.child_views.push(e)},removeChildViews:function(){var e=k.getChildViews(this.model.attributes.cid);_.each(e,(function(e){void 0!==e.model&&e.model.destroy(),e.remove()}))},removeSection:function(e,t){var i,o=!1;if(e&&e.preventDefault(),!this.isSectionLocked()&&!k.isChildrenLocked(this.model.get("cid"))&&(!V.isLoading||!_.isUndefined(t)||k.get("forceRemove"))&&(!J.is_selecting()||!_.isUndefined(t)||k.get("forceRemove"))){if(J.is_active()){if(!J.is_user_has_permission(this.model.get("cid"),"section"))return void J.alert("has_no_permission");if(J.is_unremovable_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return;if(J.has_goal(this.model)&&!J.is_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return void J.alert("cannot_remove_section_has_goal");if(J.has_unremovable_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return void J.alert("cannot_remove_section_has_unremovable_subject")}"on"===this.model.get("et_pb_fullwidth")?this.removeChildViews():(i=k.getChildViews(this.model.get("cid")),_.each(i,(function(e){"column"===e.model.get("type")?e.removeColumn():e.removeRow(!1,!0)}))),k.get("forceRemove")||"on"!==this.model.get("et_pb_specialty")&&"on"!==this.model.get("et_pb_fullwidth")||1!==k.getNumberOfModules("section")||(o=!0),(k.get("forceRemove")||o||k.getNumberOfModules("section")>1)&&(this.model.destroy(),k.removeView(this.model.get("cid")),this.remove()),o?V.removeAllSections(!0):(_.isUndefined(t)?V.allowHistorySaving("removed","section"):V.allowHistorySaving("cleared","layout"),e&&v.trigger("et-module:removed"),J.update())}},isSectionLocked:function(){return"on"===this.model.get("et_pb_locked")},showRightClickOptions:function(e){e.preventDefault();var t={model:this.model,view:this.$el,view_event:e};new s.RightClickOptionsView(t)},hideRightClickOptions:function(e){e.preventDefault(),i()},renameModule:function(){this.$(".et-pb-section-title").html(this.model.get("admin_label"))},toggleDisabledClass:function(){void 0!==this.model.get("et_pb_disabled")&&"on"===this.model.get("et_pb_disabled")?this.$el.addClass("et_pb_disabled"):this.$el.removeClass("et_pb_disabled")},setABTesting:function(e){e.preventDefault(),e.stopPropagation(),J.set(this,e)}}),s.RowView=window.wp.Backbone.View.extend({className:"et_pb_row",template:_.template(e("#et-builder-row-template").html()),events:{"click .et-pb-settings-row":"showSettings","click .et-pb-insert-column":"displayColumnsOptions","click .et-pb-clone-row":"cloneRow","click .et-pb-row-add":"addNewRow","click .et-pb-remove-row":"removeRow","click .et-pb-change-structure":"changeStructure","click .et-pb-expand":"expandRow","contextmenu .et-pb-row-add":"showRightClickOptions","click.et_pb_row > .et-pb-controls .et-pb-unlock":"unlockRow","contextmenu.et_pb_row > .et-pb-controls":"showRightClickOptions","contextmenu.et_pb_row > .et-pb-right-click-trigger-overlay":"showRightClickOptions","contextmenu .et-pb-column":"showRightClickOptions","click.et_pb_row > .et-pb-controls":"hideRightClickOptions","click.et_pb_row > .et-pb-right-click-trigger-overlay":"hideRightClickOptions","click > .et-pb-locked-overlay":"showRightClickOptions","contextmenu > .et-pb-locked-overlay":"showRightClickOptions",click:"setABTesting"},initialize:function(){this.listenTo(v,"et-add:columns",this.toggleInsertColumnButton),this.listenTo(this.model,"change:admin_label",this.renameModule),this.listenTo(this.model,"change:et_pb_disabled",this.toggleDisabledClass)},render:function(){var e=k.getParentViews(this.model.get("parent"));return void 0!==this.model.get("view")&&void 0!==this.model.get("view").model.get("layout_specialty")&&this.model.set("specialty_row","1",{silent:!0}),this.$el.html(this.template(this.model.toJSON())),(void 0!==this.model.get("et_pb_global_module")||void 0!==this.model.get("et_pb_template_type")&&"row"===this.model.get("et_pb_template_type")&&"global"===et_pb_options.is_global_template)&&this.$el.addClass("et_pb_global"),void 0!==this.model.get("et_pb_disabled")&&"on"===this.model.get("et_pb_disabled")&&this.$el.addClass("et_pb_disabled"),void 0!==this.model.get("et_pb_locked")&&"on"===this.model.get("et_pb_locked")&&(this.$el.addClass("et_pb_locked"),_.each(e,(function(e){e.$el.addClass("et_pb_children_locked")}))),void 0!==this.model.get("et_pb_parent_locked")&&"on"===this.model.get("et_pb_parent_locked")&&this.$el.addClass("et_pb_parent_locked"),void 0!==this.model.get("et_pb_collapsed")&&"on"===this.model.get("et_pb_collapsed")&&this.$el.addClass("et_pb_collapsed"),void 0!==this.model.get("pasted_module")&&this.model.get("pasted_module")&&Y(this.$el),k.is_temp_global(this.model)&&this.$el.addClass("et_pb_global_temp"),J.is_active()&&(J.is_subject(this.model)&&(this.$el.addClass("et_pb_ab_subject"),J.set_subject_rank_coloring(this)),J.is_goal(this.model)&&this.$el.addClass("et_pb_ab_goal"),J.is_user_has_permission(this.model.get("cid"),"row")||this.$el.addClass("et_pb_ab_no_permission")),this},showSettings:function(t){var i,o,n=this,a={model:this.model,collection:this.collection,attributes:{"data-open_view":"module_settings"},triggered_by_right_click:this.triggered_by_right_click,do_preview:this.do_preview};if(void 0!==t&&t.preventDefault(),!this.isRowLocked()&&!V.isLoading&&!J.is_selecting())if(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"row")){if(!1===(o=(i=new s.ModalView(a)).render()))return C(!0),setTimeout((function(){n.showSettings()}),500),void v.trigger("et-pb-loading:started");v.trigger("et-pb-loading:ended"),e("body").append(o.el),(void 0!==i.model.get("et_pb_global_module")&&""!==i.model.get("et_pb_global_module")||k.getView(i.model.get("cid")).$el.closest(".et_pb_global").length||void 0!==this.model.get("et_pb_template_type")&&"row"===this.model.get("et_pb_template_type")&&"global"===et_pb_options.is_global_template)&&e(".et_pb_modal_settings_container").addClass("et_pb_saved_global_modal")}else J.alert("has_no_permission")},displayColumnsOptions:function(t){if(t&&t.preventDefault(),!this.isRowLocked()&&!V.isLoading&&!J.is_selecting()){var i;this.model.set("open_view","column_settings",{silent:!0}),i=new s.ModalView({model:this.model,collection:this.collection,attributes:{"data-open_view":"column_settings"},view:this}),e("body").append(i.render().el),this.toggleInsertColumnButton()}},changeStructure:function(t){var i;t.preventDefault();this.isRowLocked()||V.isLoading||J.is_selecting()||(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"row")?(this.model.set("change_structure","true",{silent:!0}),this.model.set("open_view","column_settings",{silent:!0}),s.Events=v,i=new s.ModalView({model:this.model,collection:this.collection,attributes:{"data-open_view":"column_settings"},view:this}),e("body").append(i.render().el)):J.alert("has_no_permission"))},expandRow:function(e){e.preventDefault(),this.$el.closest(".et_pb_row").removeClass("et_pb_collapsed"),this.options.model.attributes.et_pb_collapsed="off",J.is_active()&&"on"===this.model.get("et_pb_ab_subject")&&J.subject_carousel(this.model.get("cid")),V.allowHistorySaving("expanded","row"),V.saveAsShortcode()},unlockRow:function(e){if(e.preventDefault(),!V.isLoading&&!J.is_selecting()){var t,i,o=this,n=o.$el.closest(".et_pb_row");He().done((function(e){!0===e?(n.removeClass("et_pb_locked"),o.options.model.attributes.et_pb_locked="off",t=k.getChildrenViews(o.model.get("cid")),_.each(t,(function(e,t){e.$el.removeClass("et_pb_parent_locked"),e.model.set("et_pb_parent_locked","off",{silent:!0})})),i=k.getParentViews(o.model.get("parent")),_.each(i,(function(e,t){k.isChildrenLocked(e.model.get("cid"))||e.$el.removeClass("et_pb_children_locked")})),V.allowHistorySaving("unlocked","row"),V.saveAsShortcode()):alert(et_pb_options.locked_row_permission_alert)}))}},toggleInsertColumnButton:function(){if(void 0!==this.model){var e,t=this.model.get("cid");e=this.collection.find((function(e){return("column"===e.get("type")||"column_inner"===e.get("type"))&&e.get("parent")===t})),_.isUndefined(e)||(this.$(".et-pb-insert-column").hide(),this.$(".et-pb-change-structure").show())}},addNewRow:function(t){var o=this.$el.closest(".et-pb-section-content"),n=e(t.currentTarget),a=n.closest(".et-pb-column-specialty").length?n.closest(".et-pb-column-specialty").data("cid"):o.data("cid"),s=k.getView(a),l="";t.preventDefault(),V.isLoading||(i(),"on"!==this.model.get("et_pb_parent_locked")&&(this.$el.closest(".et_pb_section.et_pb_global").length&&void 0===s.model.get("et_pb_template_type")&&(l=Pe(this)),!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"add_row")?(V.allowHistorySaving("added","row"),s.addRow(this.$el),""!==l&&Ie(l)):J.alert("has_no_permission")))},cloneRow:function(e){var t,i="",o=k.getView(this.model.get("parent")),n={model:this.model,view:this.$el,view_event:e};if(e.preventDefault(),!this.isRowLocked()&&!V.isLoading&&!J.is_selecting()){if(J.is_active()){if(!J.is_user_has_permission(this.model.get("cid")))return void J.alert("has_no_permission");if(J.has_goal(this.model)&&!J.is_subject(this.model))return void J.alert("cannot_clone_row_has_goal")}this.$el.closest(".et_pb_section.et_pb_global").length&&void 0===o.model.get("et_pb_template_type")&&(i=Pe(this)),t=new s.RightClickOptionsView(n,!0),V.allowHistorySaving("cloned","row"),t.copy(e),t.pasteAfter(e),""!==i&&Ie(i)}},removeRow:function(e,t){var i,o="",n=k.getView(this.model.get("parent"));if(!this.isRowLocked()&&!k.isChildrenLocked(this.model.get("cid"))&&!V.isLoading&&(!J.is_selecting()||!_.isUndefined(t)||k.get("forceRemove"))){if(J.is_active()){if(!J.is_user_has_permission(this.model.get("cid")))return void J.alert("has_no_permission");if(J.is_unremovable_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return;if(J.has_goal(this.model)&&!J.is_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return void J.alert("cannot_remove_row_has_goal");if(J.has_unremovable_subject(this.model)&&_.isUndefined(t)&&!k.get("forceRemove"))return void J.alert("cannot_remove_row_has_unremovable_subject")}e&&(e.preventDefault(),this.$el.closest(".et-pb-column-specialty").length&&e.stopPropagation(),this.$el.closest(".et_pb_section.et_pb_global").length&&void 0===n.model.get("et_pb_template_type")&&(o=Pe(this))),i=k.getChildViews(this.model.get("cid")),_.each(i,(function(e){e.removeColumn()})),k.get("forceRemove")||k.getNumberOf("row",this.model.get("parent"))>1?(this.model.destroy(),k.removeView(this.model.get("cid")),this.remove()):(this.$(".et-pb-insert-column").show(),this.$(".et-pb-change-structure").hide(),Ue()),V.allowHistorySaving("removed","row"),e&&v.trigger("et-module:removed"),""!==o&&Ie(o),J.update()}},isRowLocked:function(){return"on"===this.model.get("et_pb_locked")||"on"===this.model.get("et_pb_parent_locked")},showRightClickOptions:function(t){t.preventDefault();var i,o=e(t.target);o.closest(".et-pb-insert-module").length||o.closest(".et-pb-insert-row").length||o.hasClass("et_pb_module_block")||o.closest(".et_pb_module_block").length||(i={model:this.model,view:this.$el,view_event:t},new s.RightClickOptionsView(i))},hideRightClickOptions:function(e){e.preventDefault(),i()},renameModule:function(){this.$(".et-pb-row-title").html(this.model.get("admin_label"))},toggleDisabledClass:function(){void 0!==this.model.get("et_pb_disabled")&&"on"===this.model.get("et_pb_disabled")?this.$el.addClass("et_pb_disabled"):this.$el.removeClass("et_pb_disabled")},setABTesting:function(e){e.preventDefault(),e.stopPropagation(),J.set(this,e)}}),s.ModalView=window.wp.Backbone.View.extend({className:"et_pb_modal_settings_container",template:_.template(e("#et-builder-modal-template").html()),events:{"click .et-pb-modal-save":"saveSettings","click .et-pb-modal-preview-template":"preview","click .et-pb-preview-mobile":"resizePreviewScreen","click .et-pb-preview-tablet":"resizePreviewScreen","click .et-pb-preview-desktop":"resizePreviewScreen","click .et-pb-modal-close":"closeModal","click .et-pb-modal-save-template":"saveTemplate","change #et_pb_select_category":"applyFilter"},initialize:function(e){this.listenTo(v,"et-add:columns",this.removeView),this.listenTo(v,"et-new_module:show_settings",this.removeView),this.listenTo(v,"et-saved_layout:loaded",this.removeView),this.options=e},render:function(){var t,i={model:this.model,collection:this.collection,view:this.options.view},o=!1;if(this.$el.attr("tabindex",0),void 0===this.model||void 0===this.model.get("view")||"row_inner"!==this.model.get("module_type")&&"row"!==this.model.get("module_type")||this.model.get("parent")===this.model.get("view").$el.data("cid")||this.model.set("view",k.getView(this.model.get("parent")),{silent:!0}),"all_modules"===this.attributes["data-open_view"]&&"section"===this.model.get("module_type")&&"on"===this.model.get("et_pb_fullwidth")&&(this.model.set("type","column",{silent:!0}),o=!0),void 0!==this.model){var n=k.getView(this.model.get("parent"));"column_specialty_settings"===this.attributes["data-open_view"]&&this.model.set("open_view","column_specialty_settings",{silent:!0}),this.$el.html(this.template(this.model.toJSON())),"column_specialty_settings"===this.attributes["data-open_view"]&&this.model.unset("open_view","column_specialty_settings",{silent:!0})}else this.$el.html(this.template());if(o&&this.model.set("type","section",{silent:!0}),this.container=this.$(".et-pb-modal-container"),"column_settings"===this.attributes["data-open_view"])t=new s.ColumnSettingsView(i);else if("all_modules"===this.attributes["data-open_view"])i.attributes={"data-parent_cid":this.model.get("cid")},t=new s.ModulesView(i);else if("module_settings"===this.attributes["data-open_view"]){var l=this.model.get("module_type");"row"!==l||_.isUndefined(n)||"column"!==n.model.get("type")||(l="row_inner"),i.attributes={"data-module_type":l},i.view=this,t=new s.ModuleSettingsView(i)}else"save_layout"===this.attributes["data-open_view"]?t=new s.SaveLayoutSettingsView(i):"column_specialty_settings"===this.attributes["data-open_view"]?t=new s.ColumnSettingsView(i):"saved_templates"===this.attributes["data-open_view"]?t=new s.TemplatesModal({attributes:{"data-parent_cid":this.attributes["data-parent_cid"]}}):"help"===this.attributes["data-open_view"]&&(t=new s.HelpView);if(void 0!==t.attributes&&"no_template"===t.attributes["data-no_template"])return!1;if(this.container.append(t.render().el),"column_settings"===this.attributes["data-open_view"]&&this.model.unset("open_view",{silent:!0}),"all_modules"===this.attributes["data-open_view"]){var d=e(t.render().el);d.find("li.et_pb_post_content, li.et_pb_fullwidth_post_content").remove(),"section"===this.model.get("module_type")&&a("undefined"!==this.model.get("et_pb_fullwidth"))&&"on"===this.model.get("et_pb_fullwidth")?d.find(".et-pb-all-modules li:not(.et_pb_fullwidth_only_module)").remove():d.find("li.et_pb_fullwidth_only_module").remove()}if(e(".et_pb_modal_overlay").length&&(e(".et_pb_modal_overlay").remove(),e("body").removeClass("et_pb_stop_scroll")),e("body").hasClass("et_pb_modal_fade_in")?e("body").append('<div class="et_pb_modal_overlay et_pb_no_animation"></div>'):e("body").append('<div class="et_pb_modal_overlay"></div>'),e("body").addClass("et_pb_stop_scroll"),this.isABTestingModule()){var r=e(t.render().el).closest(".et_pb_modal_settings_container");r.addClass("has_ab_testing_module"),r.find(".et-pb-modal-save-template").remove()}return this},closeModal:function(t){t.preventDefault(),e(".et_modal_on_top").length?e(".et_modal_on_top").remove():(void 0!==this.model&&"module"===this.model.get("type")&&this.$(".wp-editor-area").length&&(se("et_pb_content"),se("et_pb_description"),se("et_pb_footer_content")),Te(this),X(this,"trigger_event"))},removeView:function(){if(void 0===this.model||"row"===this.model.get("type")||"column"===this.model.get("type")||"row_inner"===this.model.get("type")||"column_inner"===this.model.get("type")||"section"===this.model.get("type")&&("on"===this.model.get("et_pb_fullwidth")||"on"===this.model.get("et_pb_specialty")))if(void 0!==this.model&&void 0!==this.model.get("type")&&("column"===this.model.get("type")||"column_inner"===this.model.get("type")||"section"===this.model.get("type")&&"on"===this.model.get("et_pb_fullwidth"))){var t=this;e(t.el).find(".et-pb-main-settings.active-container").hasClass("et-pb-saved-modules-tab")?X(t):(t.remove(),e("body").addClass("et_pb_modal_fade_in"),e(".et_pb_modal_overlay").addClass("et_pb_no_animation"),setTimeout((function(){e(".et_pb_modal_settings_container").addClass("et_pb_no_animation"),e("body").removeClass("et_pb_modal_fade_in")}),500))}else X(this);else this.removeOverlay()},saveSettings:function(t,i){var o=this,n="",a=k.getView(o.model.get("cid")),s=(_.isUndefined(o.model.get("parent"))||k.getView(o.model.get("parent")),a),l=(i=!!_.isUndefined(i)||i,"not-allowed"===e(t.target).css("cursor"));if(_.isUndefined(s.model.get("et_pb_global_module")))for(;!_.isUndefined(s.model.get("parent"))&&""===n;)s=k.getView(s.model.get("parent")),n=""!==n||_.isUndefined(s.model.get("et_pb_global_module"))?n:s.model.get("cid");else n=s.model.get("cid");t.preventDefault(),l||(e("#publish").addClass("disabled"),V.disable_publish=!0,(void 0!==s.model.get("global_parent_cid")&&""!==s.model.get("global_parent_cid")||void 0!==s.model.get("et_pb_global_module")&&""!==s.model.get("et_pb_global_module"))&&(n=void 0!==s.model.get("global_parent_cid")?s.model.get("global_parent_cid"):s.model.get("cid")),o.performSaving(),""!==n&&Ie(n),V.allowHistorySaving("edited",o.model.get("type"),o.model.get("admin_label")),i&&(se("et_pb_content"),se("et_pb_description"),se("et_pb_footer_content"),Te(o),X(o,"trigger_event"),J.is_active()&&J.set_subject_rank_coloring(a)))},preview:function(t){var i,o,n,a=this.model.get("cid"),s=e(t.target).is("a")?e(t.target):e(t.target).parent("a"),l=e(t.target).parents(".et-pb-modal-container"),d=document.documentMode;if(t.preventDefault(),_.isUndefined(this.options.triggered_by_right_click)?this.saveSettings(t,!1):delete this.options.triggered_by_right_click,_.isUndefined(this.options.do_preview)||delete this.options.do_preview,"1"===et_pb_options.is_divi_library&&e.inArray(et_pb_options.layout_type,["row","module"])>-1?a=void 0:"section"!==this.model.get("type")&&(n=k.getSectionView(this.model.get("parent")),_.isUndefined(n)||(a=n.model.attributes.cid)),i=V.generateCompleteShortcode(a),o={et_pb_preview_nonce:et_pb_options.et_pb_preview_nonce,shortcode:i,post_title:e("#title").val(),post_id:et_pb_options.postId},s.toggleClass("active"),l.toggleClass("et-pb-item-previewing"),s.hasClass("active")){var r=e("<iframe />",{id:"et-pb-preview-screen",src:"".concat(et_pb_options.preview_url,"&et_pb_preview_nonce=").concat(et_pb_options.et_pb_preview_nonce)}),c=!1;e(".et-pb-preview-tab").html(r),e("#et-pb-preview-screen").on("load",(function(){if(!c){var e=document.getElementById("et-pb-preview-screen");!_.isUndefined(d)&&d<10&&(o=JSON.stringify(o)),e.contentWindow.postMessage(o,et_pb_options.preview_url),c=!0}}))}else e(".et-pb-preview-tab").empty(),e(".et-pb-preview-screensize-switcher a").removeClass("active"),e(".et-pb-preview-desktop").addClass("active")},resizePreviewScreen:function(t){t.preventDefault();var i=e(t.target),o=_.isUndefined(i.data("width"))?"100%":i.data("width");e(".et-pb-preview-screensize-switcher a").removeClass("active"),i.addClass("active"),e("#et-pb-preview-screen").animate({width:o})},getAttr:function(e,t){return _.isUndefined(e[t])?"":e[t]},performSaving:function(t){var i,o=this,n={},l=[],d={},r=void 0!==t&&""!==t?t:"input, select, textarea, #et_pb_content_main",c=o.model.get("module_type"),p=o.model.get("_address");if(c=-1===c.indexOf("et_pb_")?"et_pb_".concat(c):c,(i=e(this)[0].$el.find("form.validate")).length){var b=i.validate();if(!b.form())return Ve("failed form validation"),Ve("failed elements: "),Ve(b.errorList),void b.focusInvalid();Ve("passed form validation")}var u="global"===et_pb_options.is_global_template?et_pb_options.template_post_id:this.model.get("et_pb_global_module");if(e(".et_pb_global_sync_switcher").length>0&&void 0!==u&&""!==u){var g=[];e(".et_pb_global_unsynced").length>0&&e(".et_pb_global_unsynced").each((function(){var t=e(this),i=t.data("option_name");i=_.includes(["content","raw_content"],i)?"et_pb_content_field":i,g.push(i),_.isUndefined(t.data("additional_options"))||"mobile"!==t.data("additional_options")||(g.push("".concat(i,"_tablet")),g.push("".concat(i,"_phone")))})),h[u]=g,"global"===et_pb_options.is_global_template&&0!==e("#et_pb_unsynced_global_attrs").length&&e("#et_pb_unsynced_global_attrs").val(JSON.stringify(g))}s.Events.trigger("et-modal-settings:save",this);var f=!_.isUndefined(et_pb_options.et_pb_module_settings_migrations)&&et_pb_options.et_pb_module_settings_migrations,m=!_.isUndefined(f.name_changes)&&f.name_changes;m&&!_.isUndefined(m[p])&&(_.forEach(m[p],(function(e,t){l.push("et_pb_".concat(t))})),delete et_pb_options.et_pb_module_settings_migrations.name_changes[p]),this.$(r).each((function(){var t=e(this),i=ve(t)||"",o=t.is("#et_pb_content_main")?"et_pb_content":t.attr("id");if(t.is(":checkbox")&&(o=t.attr("name")),void 0===o||-1!==o.indexOf("qt_")&&"button"===t.attr("type"))return!0;if(t.hasClass("et-pb-helper-field"))return!0;if(t.is(":checkbox")&&void 0!==n[o])return!0;var a=o.indexOf("divider_color")>-1;t.hasClass("et-pb-color-picker-hex")&&new Color(t.val()).error&&!t.hasClass("et-pb-is-cleared")&&!a&&t.val(t.data("selected-value")),""!==(i="".concat(i))&&(d[o]=i);var r,c,p=s.Helpers.getSettingValue(t);r=p,c=i,(t.hasClass("et-pb-range-input")?_.isEqual(parseFloat(r),parseFloat(c)):_.isEqual(r,c))?l.push(o):n[o]=p})),n.module_defaults=d;var v=this.model.attributes,w=this.model._previousAttributes,y=v.type,k=_.isUndefined(n.et_pb_custom_padding_last_edited)?[]:n.et_pb_custom_padding_last_edited.split("|"),C="object"===a(k)&&"on"===k[0],S=o.getAttr(n,"et_pb_custom_padding")!==o.getAttr(w,"et_pb_custom_padding"),x=C&&o.getAttr(n,"et_pb_custom_padding_tablet")!==o.getAttr(w,"et_pb_custom_padding_tablet"),j=C&&o.getAttr(n,"et_pb_custom_padding_phone")!==o.getAttr(w,"et_pb_custom_padding_phone"),$=S||x||j;if("section"===y&&(C||$)&&(n.et_pb_padding_mobile=""),"row"===y||"row_inner"===y){(C||$)&&(n.et_pb_padding_mobile="");for(var T=void 0===v.columns_layout?0:v.columns_layout.split(",").length,V=1;V<=T;V++){var U=n["et_pb_padding_".concat(V,"_last_edited")],O=void 0===U?[]:U.split("|"),A="object"===a(O)&&"on"===O[0],M=o.getAttr(n,"et_pb_padding_top_".concat(V))!==o.getAttr(w,"et_pb_padding_top_".concat(V)),L=o.getAttr(n,"et_pb_padding_right_".concat(V))!==o.getAttr(w,"et_pb_padding_right_".concat(V)),E=o.getAttr(n,"et_pb_padding_bottom_".concat(V))!==o.getAttr(w,"et_pb_padding_bottom_".concat(V)),D=o.getAttr(n,"et_pb_padding_left_".concat(V))!==o.getAttr(w,"et_pb_padding_left_".concat(V)),I=M||L||E||D,P=A&&o.getAttr(n,"et_pb_padding_".concat(V,"_tablet"))!==o.getAttr(w,"et_pb_padding_".concat(V,"_tablet")),R=A&&o.getAttr(n,"et_pb_padding_".concat(V,"_phone"))!==o.getAttr(w,"et_pb_padding_".concat(V,"_phone"));if(A||(I||P||R)){n.et_pb_column_padding_mobile="";break}}}this.model.set(n),l.map(this.model.unset.bind(this.model))},isABTestingModule:function(){var e=this.model;return J.is_active()&&(J.is_subject(e)||J.has_subject(e)||J.is_goal(e)||J.has_goal(e))},saveTemplate:function(t){var i=-1!==this.model.get("module_type").indexOf("fullwidth")?"fullwidth":"regular",o=void 0!==this.model.get("columns_layout")?this.model.get("columns_layout"):"0",n="not-allowed"===e(t.target).css("cursor")||this.isABTestingModule();t.preventDefault(),n||G("save_template",this,i,o)},removeOverlay:function(){var t=e(".et_pb_modal_overlay");if(t.length&&(t.addClass("et_pb_overlay_closing"),setTimeout((function(){t.remove(),e("body").removeClass("et_pb_stop_scroll")}),600)),!_.isUndefined(V.disable_publish))setTimeout((function(){_.isUndefined(V.disable_publish)||(e("#publish").removeClass("disabled"),delete V.disable_publish)}),3e3)},applyFilter:function(t){var i=e(t.target),o=i.data("attr"),n=i.val();o.append_to.html(""),Ae(o.include_global,"",o.layout_type,o.append_to,o.module_width,o.specialty_cols,n)}}),s.ColumnView=window.wp.Backbone.View.extend({template:_.template(e("#et-builder-column-template").html()),templateAddRow:_.template(e("#et-builder-specialty-column-template").html()),events:{"click .et-pb-insert-module":"addModule","click .et-pb-insert-row":"addModule","contextmenu > .et-pb-insert-module":"showRightClickOptions",click:"hideRightClickOptions"},initialize:function(){this.$el.attr("data-cid",this.model.get("cid"))},render:function(){var t=this,o="section"===this.model.get("module_type")&&"on"===this.model.get("et_pb_fullwidth"),n=o?".et_pb_fullwidth_sortable_area":".et-pb-column:not(.et-pb-column-specialty, .et_pb_parent_locked)";return this.$el.html(this.template(this.model.toJSON())),void 0!==this.model.attributes.specialty_columns&&this.$el.html(this.templateAddRow(this.model.toJSON())),o&&this.$el.addClass("et_pb_fullwidth_sortable_area"),"1"===this.model.get("layout_specialty")&&(n=".et-pb-column-specialty:not(.et_pb_parent_locked)"),"manually"!==this.model.get("created")||_.isUndefined(this.model.get("et_pb_specialty_columns"))||this.$el.addClass("et-pb-column-specialty"),this.isColumnParentLocked(this.model.get("parent"))&&(this.$el.addClass("et_pb_parent_locked"),this.model.set("et_pb_parent_locked","on",{silent:!0})),J.is_active()&&!J.is_user_has_permission(this.model.get("cid"),"column")||this.$el.sortable({cancel:".et-pb-settings, .et-pb-clone, .et-pb-remove, .et-pb-insert-module, .et-pb-insert-column, .et-pb-insert-row, .et_pb_locked, .et-pb-disable-sort",connectWith:n,delay:100,items:"1"!==this.model.get("layout_specialty")?".et_pb_module_block":".et_pb_row",receive:function(t,i){var o,n,a=e(this),s=!1;a.hasClass("et-pb-column-specialty")&&(!e(i.sender).find(".et_pb_row").length||e(i.item).is(".et_pb_module_block")?(alert(et_pb_options.section_only_row_dragged_away),s=!0):(o=e(i.item).find(".et-pb-row-container > .et-pb-column").length,((n="2_3"===k.getView(a.data("cid")).model.get("layout"))&&3===o||!n&&4===o)&&(alert(et_pb_options.stop_dropping_3_col_row),s=!0))),e(i.item).closest(".et-pb-disable-sort").length&&(s=!0),(e(i.item).closest(".et_pb_section.et_pb_global").length||e(i.item).closest(".et_pb_row.et_pb_global").length)&&e(i.item).hasClass("et_pb_global")&&(alert(et_pb_options.global_module_alert),s=!0),s&&(e(i.sender).sortable("cancel"),Ue()),a.is(".et-pb-column-specialty")&&a.find(".et_pb_row").length<=1&&a.find(".et-pb-insert-row").length&&a.find(".et-pb-insert-row").remove()},update:function(i,o){if(V.isLoading)t.$el.sortable("cancel");else{if(J.is_active()){var n=e(o.item).hasClass("et_pb_row")?e(o.item).children(".et-pb-row-content").attr("data-cid"):e(o.item).attr("data-cid");if(!J.is_user_has_permission(n))return J.alert("has_no_permission"),t.$el.sortable("cancel"),void Ue();var a=e(o.item),s=_.isEmpty(e(o.sender))?e(i.target):e(o.sender),l=_.isEmpty(e(o.sender))?e(i.toElement).parent():e(i.target),d=a.hasClass("et_pb_ab_subject"),r=a.hasClass("et_pb_ab_goal"),c=s.closest(".et_pb_ab_subject").length,p=l.closest(".et_pb_ab_subject").length,b=l.closest(".et_pb_ab_goal").length;if(r&&!d&&c)return J.alert("cannot_move_module_goal_out_from_subject"),e(t.$el).sortable("cancel"),void Ue();if(r&&!d&&!c&&p)return J.alert("cannot_move_goal_into_subject"),e(t.$el).sortable("cancel"),void Ue();if(d&&!r&&b)return J.alert("cannot_move_subject_into_goal"),e(t.$el).sortable("cancel"),void Ue()}var u,g,h=o.item.data("cid");g=e(o.item),void 0===h&&e(i.target).is(".et-pb-column-specialty")&&(g=e(o.item).closest(".et_pb_row").find(".et-pb-row-content"),h=g.data("cid")),!e(i.target).is(".et-pb-column-specialty")&&e(o.item).closest(i.target).length&&1===e(i.target).find(".et_pb_module_block").length&&(e(i.target).find(".et-pb-insert-module").length?g.insertBefore(e(i.target).find(".et-pb-insert-module")):e(i.target).append(g)),u=t.collection.find((function(e){return e.get("cid")==h})),V.allowHistorySaving("moved","module",u.get("admin_label")),u.get("parent")===t.model.attributes.cid&&e(o.item).closest(i.target).length?v.trigger("et-model-changed-position-within-column"):u.set("parent",t.model.attributes.cid);var f=parseInt(e(this).attr("data-cid")),m=0;if(e(this).find(".et_pb_module_block").each((function(){m++;var t=parseInt(e(this).data("cid")),i=f+m;$.findWhere({cid:t}).set({layout_index:i})})),$.comparator="layout_index",$.sort(),(e(o.item).closest(".et_pb_section.et_pb_global").length||e(o.item).closest(".et_pb_row.et_pb_global").length||e(o.sender).closest(".et_pb_row.et_pb_global").length||e(o.sender).closest(".et_pb_section.et_pb_global").length)&&""===et_pb_options.template_post_id){h=o.item.data("cid");var w,y,C=e(o.sender).closest(".et_pb_row.et_pb_global"),S=e(o.item).closest(".et_pb_row.et_pb_global");if((w=C.length>0?C:e(o.sender).closest(".et_pb_section.et_pb_global"))===(y=S.length>0?S:e(o.item).closest(".et_pb_section.et_pb_global"))){var x;Ie(x=C.length>0?e(o.sender).closest(".et-pb-row-content").data("cid"):e(o.sender).closest(".et-pb-section-content").data("cid")),Ue()}else{var j=w;0!==y.length||(_.isUndefined(u.get("et_pb_global_parent"))||""===u.get("et_pb_global_parent"))&&_.isUndefined(u.get("global_parent_cid"))||(u.unset("et_pb_global_parent"),u.unset("global_parent_cid"),k.removeGlobalAttributes(k.getView(u.get("cid"))));for(var T=1;T<=2;T++)void 0!==(x=void 0!==j.find(".et-pb-section-content").data("cid")?j.find(".et-pb-section-content").data("cid"):j.find(".et-pb-row-content").data("cid"))&&""!==x&&(Ie(x),Ue()),j=y}}}},start:function(t,o){if(i(),t.altKey){var n=e(o.item).hasClass("et_pb_row")?e(o.item).children(".et-pb-row-content").attr("data-cid"):e(o.item).attr("data-cid"),a=k.getView(n),l={model:a.model,view:a.$el,view_event:t},_=new s.RightClickOptionsView(l,!0);_.copy(t,!0),_.pasteAfter(t,void 0,void 0,void 0,!0,!0),V.allowHistorySaving("cloned","module",a.model.get("admin_label"))}}}),this},addModule:function(t){var o,n=e(t.target),a=n.is("span")?n.parent(".et-pb-insert-module"):n;(t.preventDefault(),t.stopPropagation(),this.isColumnLocked())||(V.isLoading||J.is_selecting()||(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"add_module")?a.parent().is(t.delegateTarget)&&(i(),e(t.target).is(".et-pb-insert-row")?this.addRow():(o=new s.ModalView({model:this.model,collection:this.collection,attributes:{"data-open_view":"all_modules"},view:this}),e("body").append(o.render().el))):J.alert("has_no_permission")))},addRow:function(e){var t=k.generateNewId(),i=void 0!==this.model.get("et_pb_global_parent")&&""!==this.model.get("et_pb_global_parent")?this.model.get("et_pb_global_parent"):"",o=""!==i?this.model.get("global_parent_cid"):"";V.isLoading||this.isColumnLocked()||(this.collection.add([{type:"row",module_type:"row",cid:t,parent:this.model.get("cid"),view:this,appendAfter:e,et_pb_global_parent:i,global_parent_cid:o,admin_label:et_pb_options.noun.row}]),k.getView(t).displayColumnsOptions())},removeColumn:function(){var e;e=k.getChildViews(this.model.get("cid")),_.each(e,(function(e){"row"===e.model.get("type")||"row_inner"===e.model.get("type")?e.removeRow():e.removeModule()})),k.removeView(this.model.get("cid")),this.model.destroy(),this.remove()},isColumnLocked:function(){return"on"===this.model.get("et_pb_locked")||"on"===this.model.get("et_pb_parent_locked")},isColumnParentLocked:function(e){var t=k.getView(e);return!(_.isUndefined(t)||"on"!==t.model.get("et_pb_locked")&&"on"!==t.model.get("et_pb_parent_locked"))},showRightClickOptions:function(e){e.preventDefault();var t={model:this.model,view:this.$el,view_event:e};t.model.attributes.is_insert_module=!0,new s.RightClickOptionsView(t)},hideRightClickOptions:function(e){e.preventDefault(),i()}}),s.ColumnSettingsView=window.wp.Backbone.View.extend({className:"et_pb_modal_settings",template:_.template(e("#et-builder-column-settings-template").html()),events:{"click .et-pb-column-layouts li":"addColumns","click .et-pb-options-tabs-links li a":"switchTab"},initialize:function(e){this.listenTo(v,"et-add:columns",this.removeView),this.listenTo(v,"et-modal-view-removed",this.removeViewAndEmptySection),this.options=e},render:function(){return this.$el.html(this.template(this.model.toJSON())),k.getView(this.model.get("cid")).$el.closest(".et_pb_global").length&&this.$el.addClass("et_pb_no_global"),(void 0!==this.model.get("et_pb_specialty")&&"on"===this.model.get("et_pb_specialty")||void 0!==this.model.get("change_structure")&&"true"===this.model.get("change_structure"))&&this.$el.addClass("et_pb_modal_no_tabs"),this},addColumns:function(t){t.preventDefault();var i=this,o=e(t.target).is("li")?e(t.target):e(t.target).closest("li"),n={layout:o.data("layout"),layout_specialty:"section"===i.model.get("type")&&"on"===i.model.get("et_pb_specialty")?o.data("specialty").split(","):"",is_structure_change:void 0!==i.model.get("change_structure")&&"true"===i.model.get("change_structure"),specialty_columns:o.data("specialty_columns")};k.changeColumnStructure(i,n)},removeView:function(){var e=this;setTimeout((function(){e.remove()}),300)},switchTab:function(t){var i=e(t.currentTarget).parent();t.preventDefault(),Ee(i,"row","")},removeViewAndEmptySection:function(){"on"===this.model.get("et_pb_specialty")&&(this.options.view.model.destroy(),k.removeView(this.options.view.model.get("cid")),this.options.view.remove()),this.remove()}}),s.SaveLayoutSettingsView=window.wp.Backbone.View.extend({className:"et_pb_modal_settings",template:_.template(e("#et-builder-load_layout-template").html()),events:{"click .et_pb_layout_button_load":"legacyLoadLayout","click .et_pb_layout_button_delete":"deleteLayout","click .et-pb-options-tabs-links li a":"switchTab"},initialize:function(t){this.options=t,this.layoutIsLoading=!1,this.back_button_template=_.template(e("#et-builder-library-back-button-template").html()),this.current_page={},this.account_status_error=!1,this.account_status_error_template=_.template(e("#et-builder-library-account-status-error-template").html()),this.listenTo(v,"et-modal-view-removed",this.remove),this.listenTo(v,"et-pb-loading:ended",this.onLoadingEnded),this.listenTo(this,"after-render",this.afterRender)},render:function(){this.$el.html(this.template({display_switcher:"on"}));var t=e("#post_type").val();return"layout"===t&&(this.isCategoryBuilder=!0,Le("predefined","et-pb-all-modules-tab",this.$el,t),Le("not_predefined","et-pb-saved-modules-tab",this.$el,t)),setTimeout(_.bind((function(){this.trigger("after-render")}),this),150),this},remove:function(){e(window).off("et_cloud_page_changed",this.onPageChanged.bind(this)),e(window).off("et_cloud_use_item",this.onUseLayout.bind(this)),e(window).off("et_cloud_download_progress",this.onDownloadProgress.bind(this)),window.wp.Backbone.View.prototype.remove.apply(this)},afterRender:function(){this.$modal=this.$el.parents(".et_pb_modal_settings_container"),this.isCategoryBuilder||(this.$modal.addClass("et_pb_library_modal"),this.emitLoadingStarted(),this.loadLibrary(),Promise.all([y]).then(_.bind((function(t){this.local_layouts=t[0].layouts_data,this.custom_layouts=t[0].custom_layouts_data,e(window).on("et_cloud_page_changed",this.onPageChanged.bind(this)),e(window).on("et_cloud_use_item",this.onUseLayout.bind(this)),e(window).on("et_cloud_download_progress",this.onDownloadProgress.bind(this)),this.emitLoadingEnded()}),this)),this.$modal.find(".et_pb_modal_settings").on("click",".et-pb-library-back-button",this.onClickBackButton.bind(this)),e("<ul><li><span>").addClass("et-pb-load-layouts").hide(0).find("span").addClass("et_pb_layout_button_load").on("click",_.bind((function(t){this.onUseLayout(e(t.target).parent().data("layout_id"))}),this)).parents("ul").appendTo(this.$modal.find(".et-pb-all-modules-tab")))},emitLoadingStarted:function(){this.layoutIsLoading=!0,v.trigger("et-pb-loading:started")},emitLoadingEnded:function(){this.layoutIsLoading=!1,v.trigger("et-pb-loading:ended")},deleteLayout:function(t){t.preventDefault();var i=e(t.currentTarget).closest("li");i.hasClass("et_pb_deleting_layout")||(i.addClass("et_pb_deleting_layout"),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_delete_layout",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_layout_id:i.data("layout_id")},beforeSend:function(){v.trigger("et-pb-loading:started"),i.css("opacity","0.5")},complete:function(){v.trigger("et-pb-loading:ended")},success:function(e){1==i.closest("ul").find("> li").length&&i.closest("ul").prev("h3").hide(),i.remove()}}))},getLayout:function(t){return new Promise((function(i,o){e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_builder_library_get_layout",nonce:et_pb_options.library_get_layout_nonce,id:t,is_BB:!0}}).then((function(e){i({content:S(e,"data.savedShortcode",""),migrations:S(e,"data.migrations","")})}))}))},importLayout:function(t){var i=window.etCore.portability,o=i.importFB.bind(i),n=e(window);return new Promise((function(i,a){(t=new Blob([t],{type:"application/json"})).lastModified=Date.now(),t.name="layout.json",n.on("et_fb_layout_import_finished.et_bb",(function(){i({content:S(window.et_fb_import_layout_response,"data.postContent.post_content",S(window.et_fb_import_layout_response,"data.postContent","")),migrations:S(window.et_fb_import_layout_response,"data.migrations","")}),n.off("et_fb_layout_import_finished.et_bb")})),o(t,e("#post_ID").val())}))},isCurrentLayoutEmpty:function(){return _.isEmpty(V.collection.findWhere({type:"module"}))},legacyLoadLayout:function(t){if(t.preventDefault(),!this.layoutIsLoading){this.layoutIsLoading=!0,this.$el.find(".et-pb-main-settings").css({opacity:"0.5"});var i=e(t.currentTarget).closest("li"),o=i.closest(".et-pb-main-settings").find("#et_pb_load_layout_replace").is(":checked"),n=ee("content");e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_load_layout",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_layout_id:i.data("layout_id"),et_replace_content:o?"on":"off"},beforeSend:function(){v.trigger("et-pb-loading:started")},complete:function(){v.trigger("et-pb-loading:ended"),v.trigger("et-saved_layout:loaded")},success:function(e){n=o?e:e+n,V.removeAllSections(),""!==n&&V.allowHistorySaving("loaded","layout"),V.createNewLayout(n,"load_layout")}})}},loadLibrary:function(){var t={context:"layout",initialTab:"et-pb-all-modules-tab",predefinedTab:"et-pb-all-modules-tab",cloudTab:"et-pb-saved-modules-tab",globalSupport:!1,animation:"on",showHelpButton:!1,showLoadOptions:!this.isCurrentLayoutEmpty()};e(window).trigger("et_cloud_container_ready",[t])},onAccountStatusError:function(t){this.account_status_error=!0;var i={expired:"expired"===t};this.$library.hide(),e(this.account_status_error_template(i)).insertBefore(this.$library).on("click",".button",this.onClickAccountSubmitButton.bind(this))},onAuthenticationComplete:function(t){this.account_status_error&&(this.emitLoadingEnded(),t.authenticated?(this.account_status_error=!1,this.onClickBackButton(),this.library.call("retryUseLayout"),et_pb_options.et_account.et_username=this.account.et_username,et_pb_options.et_account.et_api_key=this.account.et_api_key,e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_builder_library_update_account",nonce:et_pb_options.library_update_account_nonce,et_username:this.account.et_username,et_api_key:this.account.et_api_key,status:t.status}})):this.$el.find("et-pb-library-account-status-error").addClass("et-pb-library-account-status-error--auth-failed"))},onClickAccountSubmitButton:function(e){this.account={et_username:this.$el.find("#et_username").val(),et_api_key:this.$el.find("#et_api_key").val()},this.emitLoadingStarted(),this.library.call("authenticate",this.account)},onClickBackButton:function(){window.ETCloudApp.goTo("back")},onDownloadProgress:function(e,t){this.layoutIsLoading||(this.layoutIsLoading=!0,this.$el.find(".et-pb-main-settings").css({opacity:"0.5"}),this.emitLoadingStarted())},onLoadingEnded:function(){!this.isCategoryBuilder&&this.layoutIsLoading&&v.trigger("et-pb-loading:started")},onMouseEnterIFrame:function(e){this.inside_iframe=!0,this.windowX=window.scrollX,this.windowY=window.scrollY},onMouseLeaveIFrame:function(e){this.inside_iframe=!1},onPageChanged:function(e,t){t?this.removeBackButton():this.showBackButton()},onUseLayout:function(e,t){var i,o=!0;_.isObject(t)?(i=t.item,o="on"===t.replace_content):i=t;var n=_.isString(i)?this.importLayout:this.getLayout,a=this;this.emitLoadingStarted(),n(i).then(_.bind((function(e){var t=e.content;o||(t=ee("content")+t),_.isUndefined(e.migrations)||(et_pb_options.et_pb_module_settings_migrations=e.migrations),V.removeAllSections(),t&&V.allowHistorySaving("loaded","layout"),V.createNewLayout(t,"load_layout"),this.emitLoadingEnded(),v.trigger("et-saved_layout:loaded"),a.layoutIsLoading=!1}),this)).catch(_.bind((function(e){this.emitLoadingEnded(),v.trigger("et-saved_layout:loaded"),console.error(e),a.layoutIsLoading=!1}),this))},removeBackButton:function(){this.$modal.find(".et_pb_modal_settings").find(".et-pb-library-back-button").remove(),this.isBackButtonShown=!1},showBackButton:function(){this.isBackButtonShown||(this.isBackButtonShown=!0,this.$modal.find(".et_pb_modal_settings").prepend(this.back_button_template()))},switchTab:function(t){t.preventDefault();var i=e(t.currentTarget).parent(),o=i.data("open_tab"),n={},a=this.$modal.find(".active-container");if(this.isCategoryBuilder)Ee(i,"layout","");else if(o!==this.current_tab){if(this.account_status_error&&(this.account_status_error=!1,this.$el.find(".et-pb-library-account-status-error").remove()),this.removeBackButton(),j(o,"et-pb-")){if(i.addClass("et-pb-options-tabs-links-active").siblings().removeClass("et-pb-options-tabs-links-active"),"et-pb-all-modules-tab"!==o){var s=i.data("custom_tab_id"),l=_.isUndefined(s)||""===s?this.local_layouts:this.custom_layouts[s];n=e.extend(l,{filters:{type:"layout"},load_options:{show:!this.isCurrentLayoutEmpty()}})}a.hasClass("et-pb-all-modules-tab")||(a.removeClass("active-container").fadeOut(),a.siblings(".et-pb-all-modules-tab").addClass("active-container").css("opacity","").fadeIn()),o!==this.current_tab&&window.ETCloudApp.toggleTab({items:n,tab:o})}else Ee(i,"layout","");this.current_tab=o}}}),s.ModulesView=window.wp.Backbone.View.extend({className:"et_pb_modal_settings",template:_.template(e("#et-builder-modules-template").html()),events:{"click .et-pb-all-modules li":"addModule","click .et-pb-options-tabs-links li a":"switchTab"},initialize:function(e){this.options=e,this.listenTo(v,"et-modal-view-removed",this.remove)},render:function(){var e=void 0!==k.getView(this.model.get("parent"))?k.getView(this.model.get("parent")):this;return this.$el.html(this.template(k.toJSON())),(k.getView(this.model.get("cid")).$el.closest(".et_pb_global").length||void 0!==e.model.get("et_pb_template_type")&&"module"===e.model.get("et_pb_template_type"))&&this.$el.addClass("et_pb_no_global"),this},addModule:function(t){var i=e(t.currentTarget),o=i.find(".et_module_title").text(),n=i.attr("class").replace(" et_pb_fullwidth_only_module",""),a="",s=k.getView(this.model.get("parent")),l=void 0!==s?s:this;t.preventDefault(),void 0!==this.model.get("et_pb_global_parent")&&""!==this.model.get("et_pb_global_parent")&&(a=this.model.get("global_parent_cid")),V.allowHistorySaving("added","module",o),this.collection.add([{type:"module",cid:k.generateNewId(),module_type:n,admin_label:o,parent:this.attributes["data-parent_cid"],view:this.options.view,global_parent_cid:a}]),this.remove(),""!==a&&Ie(a),void 0!==l.model.get("et_pb_template_type")&&"module"===l.model.get("et_pb_template_type")&&De("_et_pb_module_type",n),Re()},switchTab:function(t){var i=e(t.currentTarget).parent(),o=a(this.model.get("et_pb_fullwidth"))&&"on"===this.model.get("et_pb_fullwidth")?"fullwidth":"regular";t.preventDefault(),Ee(i,"module",o)}}),s.ModuleSettingsView=window.wp.Backbone.View.extend({className:"et_pb_module_settings",initialize:function(){var t=S(JSON.parse(et_pb_options.et_builder_modules_with_children),this.attributes["data-module_type"],!1),i=!!t&&"#et-builder-advanced-setting-".concat(t,"-title"),o=k.generateTemplateName(this.attributes["data-module_type"]);e(o).length<1||i&&e(i).length<1?this.attributes["data-no_template"]="no_template":(this.template=_.template(e(k.generateTemplateName(this.attributes["data-module_type"])).html()),this.listenTo(v,"et-modal-view-removed",this.removeModule),this.listenTo(v,"et-advanced-module:saved",this.renderMap))},events:{},render:function(){var t,i,n,a,c,p,u,g,h,f,m,w,y,C,S,x,j,$,T,V,U,A,M,L,E=this,D=this.$el,I=[],P=this.model.attributes.cid,R=!1,H=["et_pb_font_icon","et_pb_button_one_icon","et_pb_button_two_icon","et_pb_button_icon"];(E.model.set("et_pb__builder_version",et_pb_options.product_version),_.each(this.model.attributes,(function(t,i,o){if("string"==typeof t&&"et_pb_content"!==i&&-1===e.inArray(i,H)&&!/^\%\%\d+\%\%$/.test(t.trim()))return o[i]=t.replace(/%22/g,'"')})),this.$el.html(this.template(this.model.attributes)),t=this.$el.find("#et_pb_content, .et_pb_tiny_mce_field"),c=this.$el.find(".et-pb-color-picker-hex"),p=this.$el.find(".et-builder-color-picker-alpha"),g=this.$el.find(".et-pb-upload-button"),x=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview"),j=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--add"),$=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--edit"),T=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--delete"),h=this.$el.find(".et-pb-video-image-button"),f=this.$el.find(".et-pb-gallery-button"),u=this.$el.find(".et-pb-date-time-picker"),m=this.$el.find(".et_font_icon"),w=D.find(".et-validate-number"),C=D.find("form.validate"),y=D.find(".et-pb-option--warning"),S=D.find(".et_pb_email_add_account"),C.length&&(Ve("validation enabled"),C.validate({debug:!0})),c.length)&&c.each((function(){var t=e(this),i=function(){setTimeout((function(){t.attr("data-color-type",t.attr("value").match(/^rgba?/i)?"rgb":"hex")}),1)};i(),t.on("keypress",i),t.wpColorPicker({defaultColor:t.data("default-color"),palettes:""!==et_pb_options.page_color_palette?et_pb_options.page_color_palette.split("|"):et_pb_options.default_color_palette.split("|"),change:function(t,o){var n,a=e(this),s=a.closest(".et-pb-option-container"),l=s.find(".et-pb-reset-setting"),d=a.closest(".et-pb-custom-color-container"),r=s.find(".et-pb-option-preview"),c=a.hasClass("et-pb-color-picker-hex-has-preview"),p=a.closest(".et_pb_background-tab--gradient").length>0,u=o.color.toString().toLowerCase();d.length&&(d.find(".et-pb-custom-color-picker").val(o.color.toString()),s.hasClass("et-pb-option-container--font")&&d.find(".et-pb-custom-color-picker").trigger("change")),n=ve(a).toLowerCase(),s.hasClass("et-pb-option-container--font")||(u!==n?l.length&&l.addClass("et-pb-reset-icon-visible"):(l.length&&l.removeClass("et-pb-reset-icon-visible"),c&&r.addClass("et-pb-option-preview--empty")),c&&""!==u&&r.removeClass("et-pb-option-preview--empty")),c&&r.css({backgroundColor:u}),p&&ye(a),_.has(t,"originalEvent")&&_.has(t.originalEvent,"type")&&"square"===t.originalEvent.type&&(s.find(".button-confirm").css("backgroundColor","".concat(u," !important")),s.hasClass("is-dragging")||s.addClass("is-dragging"),clearTimeout(V),V=setTimeout((function(){b(a),s.find(".button-confirm").css("backgroundColor",""),s.removeClass("is-dragging")}),300)),clearTimeout(U),U=setTimeout((function(){a.trigger("focus")}),300),a.hasClass("et-pb-is-cleared")&&a.removeClass("et-pb-is-cleared"),a.trigger("et_pb_setting:color_picker:change",[u]),i()},clear:function(){e(this).val(et_pb_options.invalid_color),e(this).closest(".et-pb-option-container").find(".et-pb-main-setting").val(""),e(this).siblings(".et-pb-color-picker-hex").trigger("et_pb_setting:color_picker:change",[""])},width:t.closest(".et-pb-option--background").length?660:300,height:190,diviColorpicker:!!t.closest(".et-pb-option--background").length});var o=t.data("default-color")||"",n=t.closest(".et-pb-option-container").find(".et-pb-reset-setting");if(t.hasClass("et-pb-color-picker-hex-has-preview")){var a=t.closest(".et-pb-option-container");a.find(".et-pb-option-preview-button--add, .et-pb-option-preview-button--edit, .et-pb-option-preview").on("click",(function(e){e.stopPropagation(),t.wpColorPicker("open")})),a.find(".et-pb-option-preview-button--delete").on("click",(function(e){e.stopPropagation();var i=ve(t).toLowerCase();t.wpColorPicker("color",i).val(i).addClass("et-pb-is-cleared"),""===i&&a.find(".et-pb-option-preview").removeAttr("style").addClass("et-pb-option-preview--empty")}))}if(!n.length)return!0;var s="".concat(t.val());o.toLowerCase()!==s.toLowerCase()&&n.addClass("et-pb-reset-icon-visible")}));if(p.length&&p.each((function(){var t=e(this),i=t.data("value").split("|"),o=i[0]||"#444444",n=i[2]||1;t.attr("data-opacity",n),t.val(o),t.minicolors({control:"hue",defaultValue:e(this).data("default-color")||"",opacity:!0,changeDelay:200,show:function(){t.minicolors("opacity",t.data("opacity"))},change:function(i,o){if(i){var n,a=t.minicolors("rgbObject"),s=e(t.data("field")),l=[];l.push(i),l.push("".concat(a.r,", ").concat(a.g,", ").concat(a.b)),l.push(o),n=l.join("|"),s.length&&s.val(n)}},theme:"bootstrap"})})),g.length&&o(g),j.length||$.length||x){var N=function(t){t.preventDefault(),t.stopPropagation(),e(this).hasClass("et-pb-option-preview")&&!e(this).hasClass("et-pb-option-preview--empty")&&"video"===e(this).siblings(".button").attr("data-type")||Ge(e(this))||e(this).closest(".et-pb-option").find(".et-pb-upload-button").trigger("click")};x.on("click",N),j.on("click",N),$.on("click",N)}if(T.length&&T.on("click",(function(t){if(t.preventDefault(),t.stopPropagation(),!Ge(e(this))){var i=e(this).closest(".et-pb-option"),o=i.find(".et-pb-upload-field"),n=i.find(".et-pb-option-preview");o.val(""),n.addClass("et-pb-option-preview--empty").find(".et-pb-preview-content").remove()}})),h.length&&r(h),f.length&&l(f),S.length&&(A=S,M=this,L=window.et_pb_module_field_dependencies.et_pb_signup,A.each((function(){var t=e(this),i=t.siblings("select"),o=t.siblings(".et_pb_email_force_fetch_lists"),n=t.siblings(".et_pb_email_remove_account"),a=e(this).siblings("input").closest(".et-pb-option").data("option_name"),s=_.keys(L[a].affects);s=_.map(s,(function(e){return"#et_pb_".concat(e)})).join(", "),e(this).closest(".et-pb-options-tab").find(s).one("et-pb-option-field-shown",(function(){!function(t,i,o){t.on("click",(function(){e(this).hasClass("et_pb_email_submit")?(v.trigger("et-pb-loading:started"),function(t,i){var o=d(t),n=t.closest(".et-pb-option--select_with_option_groups").parent().find('[class*="et_pb_email_'.concat(o,'"]:visible')),a={},s="et_builder_email_add_account_nonce";function l(e){t.val(t.data("previous_value")).trigger("change"),n.val(""),v.trigger("et-pb-loading:ended"),"error"in e&&e.error&&alert(e.message)}n.each((function(){var t,i,o=e(this).attr("id").replace("pb_","");i="_list",(t=o).substr(t.length-i.length,t.length)!==i&&(a[o]=e(this).val())})),a.action="et_builder_email_add_account",a[s]=et_pb_options.et_builder_email_add_account_nonce,a.et_bb=!0,a.et_provider=o,e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:a}).done((function(e,o,n){e=JSON.parse(e),t.html(_.template(e.accounts_list).bind(i)(i.model.attributes)),l(e)})).fail(l)}(i,o)):i.val(i.data("previous_value")).trigger("change")})),t.appendTo(t.parent())}(e(this).siblings("button"),i,M)})),o.data("original_text",o.text()),n.data("original_text",n.text()),i.on("change",(function(){var a=e(this).val();if("add_new_account"!==a||i.parent().hasClass("new_account_in_progress"))if("fetch_lists"!==a||i.parent().hasClass("fetch_lists_in_progress"))if("remove_account"!==a||i.parent().hasClass("remove_account_in_progress"))i.parent().removeClass("new_account_in_progress remove_account_in_progress fetch_lists_in_progress"),M.$el.prev().find(".et-pb-modal-save, .et-pb-modal-save-template").css("cursor",""),"none"===a?i.parent().addClass("no_account_selected"):i.parent().removeClass("no_account_selected"),t.show(),n.text(n.data("original_text")),o.text(o.data("original_text")),a&&"none"!==a?(n.show(),o.show()):(n.hide(),o.hide()),t.siblings("span").remove(),t.siblings("p").show(),i.show();else{i.parent().addClass("remove_account_in_progress"),t.hide().siblings("p").hide(),n.text(n.data("confirm_text")),o.text(o.data("cancel_text"));var s="".concat(i.data("confirm_remove_text")," ").concat(i.data("selected_account"));e("<span>").text(s).insertAfter(i).addClass("et_pb_email_account_message"),i.hide()}else i.parent().addClass("fetch_lists_in_progress"),v.trigger("et-pb-loading:started"),function(t,i,o){var n=d(t),a=t.data("selected_account");function s(e){t.val(t.data("previous_value")).trigger("change"),i.removeClass("fetch_lists_in_progress"),v.trigger("et-pb-loading:ended"),"error"in e&&e.error&&alert(e.message)}e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_builder_email_get_lists",et_builder_email_fetch_lists_nonce:et_pb_options.et_builder_email_fetch_lists_nonce,et_provider:n,et_account:a,et_bb:!0}}).done((function(e,i,n){e=JSON.parse(e),t.html(_.template(e.accounts_list).bind(o)(o.model.attributes)),s(e)})).fail(s)}(i,t,M);else i.parent().addClass("new_account_in_progress"),e("<span>").text(i.data("adding_new_account_text")).insertAfter(i).addClass("et_pb_email_account_message"),t.hide().siblings().not("span").hide(),i.siblings("#et_pb_aweber_list").length>0&&window.open("https://auth.aweber.com/1.0/oauth/authorize_app/b17f3351")})),t.on("click",(function(){M.$el.prev().find(".et-pb-modal-save, .et-pb-modal-save-template").css("cursor","not-allowed"),i.data("previous_value",i.val()).val("add_new_account").trigger("change")})),o.on("click",(function(){if(i.parent().hasClass("remove_account_in_progress"))i.val(i.data("previous_value")).trigger("change");else{var e=i.find(":selected").parent().attr("label");i.data("selected_account",e),i.data("previous_value",i.val()).val("fetch_lists").trigger("change")}})),n.on("click",(function(){if(i.parent().hasClass("remove_account_in_progress"))return v.trigger("et-pb-loading:started"),void function(t,i){var o=d(t),n=t.data("selected_account");function a(e){t.val("none").trigger("change"),v.trigger("et-pb-loading:ended"),"error"in e&&e.error&&alert(e.message)}e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_builder_email_remove_account",et_builder_email_remove_account_nonce:et_pb_options.et_builder_email_remove_account_nonce,et_provider:o,et_account:n,et_bb:!0}}).done((function(e,o,n){e=JSON.parse(e),t.html(_.template(e.accounts_list).bind(i)(i.model.attributes)),a(e)})).fail(a)}(i,M);var t=i.find(":selected").parent().attr("label");t&&(i.data("selected_account",t),i.data("previous_value",i.val()).val("remove_account").trigger("change"))})),setTimeout((function(){i.trigger("change")}),200)}))),u.length&&u.datetimepicker({dateFormat:"yy-mm-dd",beforeShow:function(){var t=e("#ui-datepicker-div");t.closest(".et-fb-option--date-picker").length<1&&t.wrap('<span class="et-fb-option--date-picker"></span>')}}),w.length&&w.on("keyup",(function(){var t=e(this);(t.val()<0||!e.isNumeric(t.val())&&""!==t.val())&&t.val(0),t.val()>100&&t.val(100),""!==t.val()&&t.val(Math.round(t.val()))})),m.length){var B=this;m.each((function(){var t,i,o,n=e(this),a=n.siblings(".et-pb-font-icon"),s=a.val().trim(),l=n.find("li"),_="et_active";function d(){""!==s&&(-1!==(s=(s=s.replace("[","%91")).replace("]","%93")).search(/^%%/)?(o=parseInt(s.replace(/%/g,"")),t=n.find("li").eq(o)):t='"'===s?n.find("li").eq(0):n.find('li[data-icon="'.concat(s,'"]')),t.addClass(_),n.is(":visible")&&setTimeout((function(){(i=t.offset().top-n.offset().top)>0&&n.animate({scrollTop:i},0)}),110))}d(),B.$el.find(".et-pb-options-tabs-links").on("et_pb_main_tab:changed",d),l.on("click",(function(){var t=e(this),i=t.index();if(t.hasClass(_))return!1;t.siblings(".".concat(_)).removeClass(_).end().addClass(_),i="%%".concat(i,"%%"),a.val(i)}))}))}return t.length&&t.each((function(){var t=e(this),o=t.attr("id");if((n=t.closest(".et-pb-option")).hasClass("et-pb-option-advanced-module")&&(R=!0),R){var l=k.generateNewId();E.view_cid=l,n.hide(),t.attr("id","et_pb_content_main"),a=new s.AdvancedModuleSettingsView({model:E,el:E.$el.find(".et-pb-option-advanced-module-settings"),attributes:{cid:l,value_changes:E.model.get("value_changes")}}),k.addView(l,a),n.before(a.render()),""!==t.html()&&(a.generateAdvancedSortableItems(t.html(),E.$el.find(".et-pb-option-advanced-module-settings").data("module_type")),v.trigger("et-advanced-module:updated_order",E.$el))}else i=t.closest(".et-pb-option-container"),I[o]=t.html(),t.remove(),i.prepend(O.find("#".concat(o,"_editor")).html()),setTimeout((function(){void 0!==window.switchEditors&&window.switchEditors.go(o,ie());var e="et_pb_content"!==o?"load_secondary_editor":"";ae(o,I[o],e),window.wpActiveEditor=o}),100)})),y.length&&y.each((function(){var t=e(this),i=t.find(".et-pb-option-warning"),o=i.attr("data-display_if"),n=i.attr("data-name");et_pb_options[n]===o&&t.addClass("et-pb-option--warning-active")})),this.renderMap(),pe(this.$el,P),R||setTimeout((function(){D.find("select, input, textarea, radio").eq(0).trigger("focus")}),1),this},removeModule:function(){this.remove()},is_latlng:function(e){var t=e.split(","),i=!_.isUndefined(t[0])&&parseFloat(t[0]),o=!_.isUndefined(t[1])&&parseFloat(t[1]);return!("undefined"==typeof google||!i||_.isNaN(i)||!o||_.isNaN(o))&&new google.maps.LatLng(i,o)},renderMap:function(){var e=this,t=this.$el.find(".et-pb-map");if("undefined"!=typeof google&&t.length){var i=this.view_cid,o=this.$el.find(".et_pb_address"),n=this.$el.find(".et_pb_address_lat"),a=this.$el.find(".et_pb_address_lng"),s=this.$el.find(".et_pb_find_address"),l=this.$el.find(".et_pb_zoom_level"),d=new google.maps.Geocoder,r={},c=isNaN(parseInt(l.val()))?18:parseInt(l.val()),p=function(e){t.map.setCenter(e)},b=function(){t.map.setZoom(c)};o.on("blur",(function(){var t=o.val();t.length<=0||d.geocode({address:t},(function(i,s){if(s==google.maps.GeocoderStatus.OK){var l=i[0],_=l.geometry.location,d=e.is_latlng(t);d&&(_=d),isNaN(_.lat())||isNaN(_.lng())?alert(et_pb_options.map_pin_address_invalid):(o.val(l.formatted_address),n.val(_.lat()),a.val(_.lng()),p(_))}else alert("".concat(et_pb_options.geocode_error,": ").concat(s))}))})),s.on("click",(function(e){e.preventDefault()})),l.on("blur",b),setTimeout((function(){t.map=new google.maps.Map(t[0],{zoom:c,mapTypeId:google.maps.MapTypeId.ROADMAP}),""!==n.val()&&""!==a.val()&&p(new google.maps.LatLng(n.val(),a.val())),""!==l&&b(),setTimeout((function(){var e=k.getChildViews(i);_.size(e)&&_.each(e,(function(e,i){_.isUndefined(e.model.get("et_pb_pin_address_lat"))||_.isUndefined(e.model.get("et_pb_pin_address_lng"))||(r[i]=new google.maps.Marker({map:t.map,position:new google.maps.LatLng(parseFloat(e.model.get("et_pb_pin_address_lat")),parseFloat(e.model.get("et_pb_pin_address_lng"))),title:e.model.get("et_pb_title"),icon:{url:"".concat(et_pb_options.images_uri,"/marker.png"),size:new google.maps.Size(46,43),anchor:new google.maps.Point(16,43)},shape:{coord:[1,1,46,43],type:"rect"}}))}))}),500),google.maps.event.addListener(t.map,"center_changed",(function(){var e=t.map.getCenter();n.val(e.lat()),a.val(e.lng())})),google.maps.event.addListener(t.map,"zoom_changed",(function(){var e=t.map.getZoom();l.val(e)}))}),200)}}}),s.AdvancedModuleSettingsView=window.wp.Backbone.View.extend({initialize:function(){this.listenTo(v,"et-advanced-module:updated",this.generateContent),this.listenTo(v,"et-modal-view-removed",this.removeModule),this.module_type=this.$el.data("module_type"),s.Events=v,this.child_views=[],this.$el.attr("data-cid",this.attributes.cid),this.$sortable_options=this.$el.find(".et-pb-sortable-options"),this.$content_textarea=this.$el.siblings(".et-pb-option-main-content").find("#et_pb_content_main"),_.includes(["et_pb_column","et_pb_column_inner"],this.module_type)?this.$sortable_options.addClass("et-pb-sortable-options--disabled"):this.$sortable_options.sortable({axis:"y",cancel:".et-pb-advanced-setting-remove, .et-pb-advanced-setting-options",update:function(e,t){v.trigger("et-advanced-module:updated"),v.trigger("et-advanced-module:updated_order")}}),this.$add_sortable_item=this.$el.find(".et-pb-add-sortable-option").addClass("et-pb-add-sortable-initial")},events:{"click .et-pb-add-sortable-option":"addModule","click .et-pb-advanced-setting-clone":"cloneModule"},render:function(){return this},addModule:function(e){e.preventDefault(),this.model.collection.add([{type:"module",module_type:this.module_type,cid:k.generateNewId(),view:this,created:"manually",mode:"advanced",parent:this.attributes.cid,parent_cid:this.model.model.attributes.cid}],{update_shortcodes:"false"}),this.$add_sortable_item.removeClass("et-pb-add-sortable-initial"),v.trigger("et-advanced-module:updated_order")},cloneModule:function(t){t.preventDefault();var i=e(t.target).closest("li").data("cid"),o=V.collection.find((function(e){return e.get("cid")==i})),n=_.clone(o.attributes);n.created="manually",n.cloned_cid=i,n.cid=k.generateNewId(),this.model.collection.add(n),v.trigger("et-advanced-module:updated"),v.trigger("et-advanced-module:saved"),v.trigger("et-advanced-module:updated_order")},generateContent:function(){var t="";this.$sortable_options.find("li").each((function(){var i=e(this);t+=V.generateModuleShortcode(i,!1)})),t=t.replace(/%22/g,"^^"),this.$content_textarea.html(t),this.$sortable_options.find("li").length?this.$add_sortable_item.removeClass("et-pb-add-sortable-initial"):this.$add_sortable_item.addClass("et-pb-add-sortable-initial")},generateAdvancedSortableItems:function(t,i){var o=this,n=V.getShortCodeChildTags(),a=window.wp.shortcode.regexp(n),s=V.wp_regexp_not_global(n),l=t.match(a);""!==t&&this.$add_sortable_item.removeClass("et-pb-add-sortable-initial"),_.each(l,(function(t,n){var l,d=t.match(s),r=d[2],c=""!==d[3]?window.wp.shortcode.attrs("".concat(d[3]," ").concat(n)):"",p=d[5],b=k.generateNewId(),u={},g=void 0!==p&&""!==p&&p.match(a),h=et_pb_options.et_pb_module_settings_migrations.name_changes,f=_.includes(["et_pb_column","et_pb_column_inner"],r);l={type:"module",module_type:i,cid:b,view:o,created:"auto",mode:"advanced",parent:o.attributes.cid,parent_cid:o.model.model.attributes.cid};var m=k.getView(o.model.model.attributes.cid);if(f){var v=e(m.$el).find(".et-pb-column");_.isUndefined(v[n])||(l.column_cid=e(v[n]).data("cid"))}if(_.isObject(c.named)){for(var w in c.named){var y,C="admin_label"!==w?"et_pb_".concat(w):w;f&&"et_pb_type"===C&&(C="layout"),y=(y=c.named[w]).replace(/\^\^/g,'"'),u[C]=y}l.et_pb_content=p,l=_.extend(l,u)}g||(l.et_pb_content=p),_.isEmpty(h)||_.isEmpty(h[o.module_type])||_.forEach(h[o.module_type],(function(e,t){_.isUndefined(l["et_pb_".concat(t)])||(l["et_pb_".concat(e)]=l["et_pb_".concat(t)],delete l["et_pb_".concat(t)])})),_.isUndefined(o.attributes.value_changes)||_.isUndefined(o.attributes.value_changes[n])||_.forEach(o.attributes.value_changes[n],(function(e,t){l["et_pb_".concat(t)]=e})),o.model.collection.add([l],{update_shortcodes:"false"})}))},removeModule:function(){_.each(this.child_views,(function(e){e.removeView()})),this.remove()}}),s.AdvancedModuleSettingView=window.wp.Backbone.View.extend({tagName:"li",initialize:function(){this.template=_.template(e("#et-builder-advanced-setting").html())},events:{"click .et-pb-advanced-setting-options":"showSettings","click .et-pb-advanced-setting-remove":"removeView"},render:function(){var e;return this.$el.html(this.template(this.model.attributes)),e=new s.AdvancedModuleSettingTitleView({model:this.model,view:this}),this.$el.prepend(e.render().el),this.child_view=e,void 0!==this.model.get("cloned_cid")&&""!==this.model.get("cloned_cid")||this.showSettings(),this},showSettings:function(t){var i;t&&t.preventDefault(),i=new s.AdvancedModuleSettingEditViewContainer({view:this,attributes:{show_settings_clicked:!!t,"data-module_type":this.model.get("module_type")}}),e(".et_pb_modal_settings_container").after(i.render().el),Re()},removeView:function(e){e&&e.preventDefault(),_.isUndefined(this.child_view)||this.child_view.remove(),this.remove(),this.model.destroy(),v.trigger("et-advanced-module:updated"),v.trigger("et-advanced-module:updated_order")}}),s.AdvancedModuleSettingTitleView=window.wp.Backbone.View.extend({tagName:"span",className:"et-sortable-title",initialize:function(){var t="et_pb_column_inner"===this.model.get("module_type")?"et_pb_column":this.model.get("module_type"),i="#et-builder-advanced-setting-".concat(t,"-title");this.template=_.template(e(i).html()),this.listenTo(v,"et-advanced-module:updated",this.render)},render:function(){return _.isUndefined(this.model.attributes.et_pb_admin_title)||""!==this.model.attributes.et_pb_admin_title||delete this.model.attributes.et_pb_admin_title,this.$el.html(this.template(this.model.attributes)),this}}),s.AdvancedModuleSettingEditViewContainer=window.wp.Backbone.View.extend({className:"et_pb_modal_settings_container",initialize:function(){this.template=_.template(e("#et-builder-advanced-setting-edit").html()),this.model=this.options.view.model,this.listenTo(v,"et-modal-view-removed",this.removeView)},events:{"click .et-pb-modal-save":"saveSettings","click .et-pb-modal-close":"removeView"},is_latlng:function(e){var t=e.split(","),i=!_.isUndefined(t[0])&&parseFloat(t[0]),o=!_.isUndefined(t[1])&&parseFloat(t[1]);return!(!i||_.isNaN(i)||!o||_.isNaN(o))&&new google.maps.LatLng(i,o)},render:function(){var t,i,n,a,d,c,p,u,g,h,f,m,v,w,y,k=this.model.attributes.cid,C=this;(this.$el.html(this.template()),this.$el.addClass("et_pb_modal_settings_container_step2"),this.$el.attr("data-parent-cid",k),("auto"!==this.model.get("created")||this.attributes.show_settings_clicked)&&(t=new s.AdvancedModuleSettingEditView({view:this}),this.$el.append(t.render().el),this.child_view=t),this.model.set("et_pb__builder_version",et_pb_options.product_version),s.Events.trigger("et-advanced-module-settings:render",this),i=this.$el.find(".et-pb-color-picker-hex"),g=this.$el.find(".et-builder-color-picker-alpha"),i.length)&&i.each((function(){var t=e(this);if(t.wpColorPicker({defaultColor:t.data("default-color"),palettes:""!==et_pb_options.page_color_palette?et_pb_options.page_color_palette.split("|"):et_pb_options.default_color_palette.split("|"),change:function(t,i){var o=e(this),n=o.closest(".et-pb-option-container"),a=n.find(".et-pb-reset-setting"),s=o.closest(".et-pb-custom-color-container"),l=n.find(".et-pb-option-preview"),d=o.hasClass("et-pb-color-picker-hex-has-preview"),r=o.closest(".et_pb_background-tab--gradient").length>0,c=i.color.toString().toLowerCase();s.length&&s.find(".et-pb-custom-color-picker").val(i.color.toString()),(a.length||d||r)&&(c!==ve(o).toLowerCase()?a.addClass("et-pb-reset-icon-visible"):(a.removeClass("et-pb-reset-icon-visible"),d&&l.addClass("et-pb-option-preview--empty")),d&&""!==c&&l.removeClass("et-pb-option-preview--empty"),d&&l.css({backgroundColor:c}),r&&ye(o),(d||r)&&(_.has(t,"originalEvent")&&_.has(t.originalEvent,"type")&&"square"===t.originalEvent.type&&(n.find(".button-confirm").css("backgroundColor","".concat(c," !important")),n.hasClass("is-dragging")||n.addClass("is-dragging"),clearTimeout(w),w=setTimeout((function(){b(o),n.find(".button-confirm").css("backgroundColor",""),n.removeClass("is-dragging")}),300)),clearTimeout(y),y=setTimeout((function(){o.trigger("focus")}),300)),o.hasClass("et-pb-is-cleared")&&o.removeClass("et-pb-is-cleared"),o.trigger("et_pb_setting:color_picker:change",[c]))},width:t.closest(".et-pb-option--background").length?660:300,height:190,diviColorpicker:!!t.closest(".et-pb-option--background").length}),t.hasClass("et-pb-color-picker-hex-has-preview")){var i=t.closest(".et-pb-option-container");i.find(".et-pb-option-preview-button--add, .et-pb-option-preview-button--edit, .et-pb-option-preview").on("click",(function(e){e.stopPropagation(),t.wpColorPicker("open")})),i.find(".et-pb-option-preview-button--delete").on("click",(function(e){e.stopPropagation();var o=ve(t).toLowerCase();t.wpColorPicker("color",o).val(o).addClass("et-pb-is-cleared"),""===o&&i.find(".et-pb-option-preview").removeAttr("style").addClass("et-pb-option-preview--empty")}))}}));if(g.length&&g.each((function(){var t=e(this),i=t.data("value").split("|"),o=i[0]||"#444444",n=i[2]||1;t.attr("data-opacity",n),t.val(o),t.minicolors({control:"hue",defaultValue:e(this).data("default-color")||"",opacity:!0,changeDelay:200,show:function(){t.minicolors("opacity",t.data("opacity"))},change:function(i,o){if(i){var n,a=t.minicolors("rgbObject"),s=e(t.data("field")),l=[];l.push(i),l.push("".concat(a.r,", ").concat(a.g,", ").concat(a.b)),l.push(o),n=l.join("|"),s.length&&s.val(n)}},theme:"bootstrap"})})),n=this.$el.find(".et-pb-upload-button"),u=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview"),f=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--add"),m=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--edit"),v=this.$el.find(".et-pb-option-container--upload .et-pb-option-preview-button--delete"),n.length&&o(n),f.length||m.length||u.length){var x=function(t){t.preventDefault(),t.stopPropagation(),e(this).hasClass("et-pb-option-preview")&&!e(this).hasClass("et-pb-option-preview--empty")||e(this).closest(".et-pb-option").find(".et-pb-upload-button").trigger("click")};u.on("click",x),f.on("click",x),m.on("click",x)}if(v.length&&v.on("click",(function(t){t.preventDefault(),t.stopPropagation();var i=e(this).closest(".et-pb-option"),o=i.find(".et-pb-upload-field"),n=i.find(".et-pb-option-preview");o.val(""),n.addClass("et-pb-option-preview--empty").find(".et-pb-preview-content").remove()})),(a=this.$el.find(".et-pb-video-image-button")).length&&r(a),d=this.$el.find(".et-pb-map"),"undefined"!=typeof google&&d.length){var j,T,V=this.$el.find(".et_pb_pin_address"),U=this.$el.find(".et_pb_pin_address_lat"),O=this.$el.find(".et_pb_pin_address_lng"),A=this.$el.find(".et_pb_find_address"),M=this.$el.find(".et_pb_zoom_level"),L=new google.maps.Geocoder,E=function(e){T.setPosition(e),j.setCenter(e)};V.on("change",(function(){var e=V.val().trim();e.length<=0||L.geocode({address:e},(function(t,i){if(i==google.maps.GeocoderStatus.OK){var o=t[0],n=o.geometry.location,a=C.is_latlng(e);a&&(n=a),isNaN(n.lat())||isNaN(n.lng())?alert(et_pb_options.map_pin_address_invalid):(V.val(o.formatted_address),U.val(n.lat()),O.val(n.lng()),E(n))}else alert("".concat(et_pb_options.geocode_error,": ").concat(i))}))})),A.on("click",(function(e){e.preventDefault()})),setTimeout((function(){j=new google.maps.Map(d[0],{zoom:parseInt(M.val()),mapTypeId:google.maps.MapTypeId.ROADMAP}),T=new google.maps.Marker({map:j,draggable:!0,icon:{url:"".concat(et_pb_options.images_uri,"/marker.png"),size:new google.maps.Size(46,43),anchor:new google.maps.Point(16,43)},shape:{coord:[1,1,46,43],type:"rect"}}),google.maps.event.addListener(T,"dragend",(function(){var e=T.getPosition();U.val(e.lat()),O.val(e.lng()),E(e);var t=new google.maps.LatLng(e.lat(),e.lng());L.geocode({latLng:t},(function(e,t){t==google.maps.GeocoderStatus.OK?e[0]?V.val(e[0].formatted_address):alert(et_pb_options.no_results):alert("".concat(et_pb_options.geocode_error_2,": ").concat(t))}))})),""!=U.val()&&""!=O.val()&&E(new google.maps.LatLng(U.val(),O.val()))}),200)}if((h=this.$el.find(".et-pb-gallery-button")).length&&l(h),(c=this.$el.find(".et-pb-social-network")).length){var D=this.$el.find(".reset-default-color"),I=this.$el.find("#et_pb_background_color");D.length&&D.on("click",(function(){var e=D.parents(".et-pb-main-settings");c=e.find(".et-pb-social-network"),(I=e.find("#et_pb_background_color")).length&&(I.wpColorPicker("color",c.find("option:selected").data("color")),D.css("display","none"))})),c.on("change",(function(){var e=c.parents(".et-pb-main-settings");if(!c.data("is_rendering_setting_view")&&c.val().length){var t=e.find("#et_pb_content"),i=e.find("#et_pb_background_color");if(t.length&&t.val(c.find("option:selected").text()),i.length){var o=c.find("option:selected").data("color");i.val(o).wpColorPicker("color",o),i.closest(".et-pb-option-container").find(".et-pb-option-preview").css({backgroundColor:o})}}})),I.val()!==c.find("option:selected").data("color")&&D.css("display","inline")}if((p=this.$el.find(".et_font_icon")).length){var P=this;p.each((function(){var t,i,o,n=e(this),a=n.siblings(".et-pb-font-icon"),s=a.val().trim(),l=n.find("li"),_="et_active";function d(){""!==s&&(-1!==s.search(/^%%/)?(o=parseInt(s.replace(/%/g,"")),t=n.find("li").eq(o)):t=n.find('li[data-icon="'.concat(s,'"]')),t.addClass(_),n.is(":visible")&&setTimeout((function(){(i=t.offset().top-n.offset().top)>0&&n.animate({scrollTop:i},0)}),110))}d(),P.$el.find(".et-pb-options-tabs-links").on("et_pb_main_tab:changed",d),l.on("click",(function(){var t=e(this),i=t.index();if(t.hasClass(_))return!1;t.siblings(".".concat(_)).removeClass(_).end().addClass(_),i="%%".concat(i,"%%"),a.val(i)}))}))}return function(t,i){var o=t.find(".et-pb-options-tab-advanced"),n=o.find(".et-pb-main-setting"),a=(e(".et_pb_modal_settings_container:not(.et_pb_modal_settings_container_step2)").find(".et-pb-options-tab-advanced"),$.findWhere({cid:i})),s=_.includes(["et_pb_column","et_pb_column_inner"],S(a,"attributes.module_type","")),l=function(t){var i=me(e(t)),o=e(t).data(i);return _.isArray(o)&&_.isObject(o[1])};if(s)return;o.length&&n.each((function(){var t=e(this),i=t.attr("id"),o="",n="";if(t.hasClass("et-pb-range")){var s=t.siblings(".et-pb-range-input");n=s.data(o)||"",s.each((function(){var t=e(this),i=t.attr("id"),s=void 0!==t.data("device")?t.data("device"):"all",_=e("#".concat(i));if(_.length&&!l(t)){if(a.attributes.module_defaults=a.attributes.module_defaults||[],a.attributes.module_defaults[i]=_.val(),"all"!==s){var d=t.siblings(".et-pb-main-setting.et_pb_setting_mobile_".concat(s));d.data("default_inherited",_.val()),d.data("default",_.val())}o=me(_),n=_.data(o)||"",t.data("default_inherited",n),t.data("default",_.val())}}))}else if(t.closest(".et-presets").length);else{var _=e("#".concat(i));if(_.length){var d=_.val();a.attributes.module_defaults=a.attributes.module_defaults||[],a.attributes.module_defaults[i]=d,o=me(_),n=_.data(o)||"",t.data("default_inherited",n),t.data(o,d)}}}))}(this.$el,k),pe(this.$el,k),this},removeView:function(e){e&&e.preventDefault(),this.$el.find("#et_pb_content")&&e&&se("et_pb_content"),Te(this),this.child_view&&this.child_view.remove(),this.remove()},saveSettings:function(t){var i=this,o={},n=this.model.get("module_defaults")||"";if(t.preventDefault(),this.$("input, select, textarea").each((function(){var t,a=e(this),s=a.attr("id"),l=[];if(a.is(":checkbox")&&(s=a.attr("name")),void 0===s||-1!==s.indexOf("qt_")&&"button"===a.attr("type"))return!0;if(a.is(":checkbox")||(s=a.attr("id").replace("data.","")),a.is(":checkbox")&&void 0!==o[s])return!0;if(t=a.is("#et_pb_content")?ee("et_pb_content"):a.val(),a.is(".et-pb-text-align-select")&&!a.parent().find(".et_text_align_active").length)return!0;if(_.isEmpty(a.data("check_attr_default"))||"yes"!==a.data("check_attr_default")){if(""!==n&&void 0!==n[s]&&n[s]===t){if(!a.hasClass("yes_no_button"))return i.model.unset(s),!0;delete n[s],i.model.set("module_defaults",n)}}else if(we(a))return i.model.unset(s),!0;a.is(":checkbox")&&void 0===o[s]&&(a.closest(".et-pb-option-container").find('[name="'.concat(s,'"]:checked')).each((function(){l.push(e(this).val())})),t=l.join(",")),a.closest(".et-pb-custom-css-option").length&&(t=""!==t?t.replace(/(?:\r\n|\r|\n)/g,"||"):""),o[s]=t})),_.isUndefined(o.et_pb_pin_address)||_.isUndefined(o.et_pb_pin_address_lat)||_.isUndefined(o.et_pb_pin_address_lng)||""!==o.et_pb_pin_address&&""!==o.et_pb_pin_address_lat&&""!==o.et_pb_pin_address_lng){var a=k.getView(i.model.attributes.view.model.model.attributes.cid);if(_.isUndefined(a.model.get("value_changes"))||a.model.unset("value_changes"),!_.isUndefined(i.model.attributes.column_cid))k.getView(i.model.attributes.column_cid).model.set(o,{silent:!0});this.model.set(o,{silent:!0}),v.trigger("et-advanced-module:updated"),v.trigger("et-advanced-module:saved"),se("et_pb_content"),this.removeView()}else alert(et_pb_options.map_pin_address_error)}}),s.AdvancedModuleSettingEditView=window.wp.Backbone.View.extend({className:"et_pb_module_settings",initialize:function(){this.model=this.options.view.options.view.model;var t="et_pb_column_inner"===this.model.get("module_type")?"et_pb_column":this.model.get("module_type");this.template=_.template(e("#et-builder-advanced-setting-".concat(t)).html())},events:{},render:function(){var e,t,i=this.$el;if(this.$el.html(this.template({data:this.model.toJSON()})),this.$el.find(".et-pb-main-settings").addClass("et-pb-main-settings-advanced"),(e=this.$el.find("div#et_pb_content")).length){t=e.closest(".et-pb-option-container");var o=e.html();e.remove(),t.prepend(O.find("#et_pb_content_editor").html()),setTimeout((function(){void 0!==window.switchEditors&&window.switchEditors.go("et_pb_content",ie()),ae("et_pb_content",o),window.wpActiveEditor="et_pb_content"}),300)}return setTimeout((function(){i.find("select, input, textarea, radio").eq(0).trigger("focus")}),1),this}}),s.BlockModuleView=window.wp.Backbone.View.extend({className:function(){var e="et_pb_module_block";return void 0!==this.model.attributes.className&&(e+=this.model.attributes.className),e},template:_.template(e("#et-builder-block-module-template").html()),initialize:function(){this.listenTo(this.model,"change:admin_label",this.renameModule),this.listenTo(this.model,"change:et_pb_disabled",this.toggleDisabledClass),this.listenTo(this.model,"change:et_pb_global_module",this.removeGlobal)},events:{"click .et-pb-settings":"showSettings","click .et-pb-clone-module":"cloneModule","click .et-pb-remove-module":"removeModule","click .et-pb-unlock":"unlockModule",contextmenu:"showRightClickOptions","click.et-pb-right-click":"hideRightClickOptions","click.et-ab-testing":"setABTesting"},render:function(){var e=k.getParentViews(this.model.get("parent"));return this.$el.html(this.template(this.model.attributes)),(void 0!==this.model.attributes.et_pb_global_module||void 0!==this.model.attributes.et_pb_template_type&&"module"===this.model.attributes.et_pb_template_type&&"global"===et_pb_options.is_global_template)&&this.$el.addClass("et_pb_global"),void 0!==this.model.get("et_pb_locked")&&"on"===this.model.get("et_pb_locked")&&_.each(e,(function(e){e.$el.addClass("et_pb_children_locked")})),void 0!==this.model.get("et_pb_parent_locked")&&"on"===this.model.get("et_pb_parent_locked")&&this.$el.addClass("et_pb_parent_locked"),J.is_active()&&(J.is_subject(this.model)&&(this.$el.addClass("et_pb_ab_subject"),J.set_subject_rank_coloring(this)),J.is_goal(this.model)&&this.$el.addClass("et_pb_ab_goal"),J.is_user_has_permission(this.model.get("cid"),"module",this.model)||this.$el.addClass("et_pb_ab_no_permission")),"removed"===this.model.get("component_status")||(k.isModuleFullwidth(this.model.get("module_type"))&&this.$el.addClass("et_pb_fullwidth_module"),void 0!==this.model.get("pasted_module")&&this.model.get("pasted_module")&&Y(this.$el)),this},cloneModule:function(e){var t,i="",o={model:this.model,view:this.$el,view_event:e};e.preventDefault(),V.isLoading||J.is_selecting()||this.isModuleLocked()||(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"module")?((this.$el.closest(".et_pb_section.et_pb_global").length||this.$el.closest(".et_pb_row.et_pb_global").length)&&""===et_pb_options.template_post_id&&(i=Pe(this)),t=new s.RightClickOptionsView(o,!0),V.allowHistorySaving("cloned","module",this.model.get("admin_label")),t.copy(e),t.pasteAfter(e),""!==i&&Ie(i)):J.alert("has_no_permission"))},renameModule:function(){this.$(".et-pb-module-title").html(this.model.get("admin_label"))},removeGlobal:function(){this.isModuleLocked()||void 0===this.model.get("et_pb_global_module")&&this.$el.removeClass("et_pb_global")},toggleDisabledClass:function(){void 0!==this.model.get("et_pb_disabled")&&"on"===this.model.get("et_pb_disabled")?this.$el.addClass("et_pb_disabled"):this.$el.removeClass("et_pb_disabled")},showSettings:function(t){var o=this,n={model:this.model,collection:this.collection,attributes:{"data-open_view":"module_settings"},triggered_by_right_click:this.triggered_by_right_click,do_preview:this.do_preview};if(void 0!==t&&t.preventDefault(),i(),!this.isModuleLocked()&&!V.isLoading&&!J.is_selecting())if(!J.is_active()||J.is_user_has_permission(this.model.get("cid"),"module")){if(void 0!==this.model.get("et_pb_global_module")&&""!==this.model.get("et_pb_global_module"))!function(t){var i,o=t.model.get("et_pb_global_module"),n="html"===ie()?"skip":"apply";e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_pb_get_global_module",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_global_id:o,et_global_autop:n},beforeSend:function(){v.trigger("et-pb-loading:started")},complete:function(){v.trigger("et-pb-loading:ended")},success:function(n){if(!n||n.error)k.removeGlobalAttributes(t);else{var a=V.getShortCodeParentTags(),l=window.wp.shortcode.regexp(a),d=V.wp_regexp_not_global(a),r=qe(n.shortcode).match(l),c=n.sync_status,p="updated"===c?JSON.parse(n.excluded_options):[];"updated"===c?h[o]=0<p.length?p:[]:f[o]=[],_.each(r,(function(i,n){var a=i.match(d),s=a[2],r=""!==a[3]?window.wp.shortcode.attrs(a[3]):"",p=a[5],b=(void 0!==p&&""!==p&&p.match(l),r.named.saved_tabs||t.model.get("et_pb_saved_tabs")),u="updated"!==c&&"all"!==b&&-1===b.indexOf("general"),g="updated"===c?-1===h[o].indexOf("et_pb_content_field"):""!==b&&(-1!==b.indexOf("general")||"all"===b);if("all"===b&&"updated"!==c&&(h[o]=[],c="updated"),_.isObject(r.named))for(var m in r.named)if("template_type"!==m&&("admin_label"!==m||"admin_label"===m&&!u)){if("updated"===c&&-1!==h[o].indexOf(m))continue;var v="admin_label"!==m?"et_pb_".concat(m):m;""!==m&&t.model.set(v,r.named[m],{silent:!0}),"updated"!==c&&f[o].push(m)}if(g){var w="et_pb_content",y=V.getShortCodeRawContentTags();e.inArray(s,y)>-1&&(w="et_pb_raw_content",p=p.replace(/<!-- \[et_pb_line_break_holder\] -->/g,"\n")),t.model.set(w,p,{silent:!0}),"updated"!==c&&f[o].push("et_pb_content_field")}"updated"!==c&&t.model.set("legacy_synced_options",f[o],{silent:!0})}))}i=new s.ModalView(t),e("body").append(i.render().el),!0===t.triggered_by_right_click&&!0===t.do_preview&&e(".et-pb-modal-preview-template").trigger("click"),n&&!n.error&&(e(".et_pb_modal_settings_container").addClass("et_pb_saved_global_modal et_pb_modal_selective_sync"),Je(e(".et_pb_modal_settings_container"),o))}})}(n),this.triggered_by_right_click=void 0,this.do_preview=void 0;else{var a=new s.ModalView(n).render();if(!1===a)return C(!0),setTimeout((function(){o.showSettings()}),500),void v.trigger("et-pb-loading:started");v.trigger("et-pb-loading:ended"),e("body").append(a.el)}Re(),(void 0!==this.model.get("et_pb_global_parent")&&""!==this.model.get("et_pb_global_parent")||k.getView(this.model.get("cid")).$el.closest(".et_pb_global").length)&&(e(".et_pb_modal_settings_container").addClass("et_pb_saved_global_modal"),"module"===et_pb_options.global_module_type&&(Je(e(".et_pb_modal_settings_container"),et_pb_options.template_post_id),e(".et_pb_modal_settings_container").addClass("et_pb_modal_selective_sync")))}else J.alert("has_no_permission")},removeModule:function(e){var t="";if(!this.isModuleLocked()&&!V.isLoading&&(!J.is_selecting()||k.get("forceRemove"))){if(J.is_active()){if(!J.is_user_has_permission(this.model.get("cid"),"module"))return void J.alert("has_no_permission");if(J.is_unremovable_subject(this.model)&&!k.get("forceRemove"))return}e&&(e.preventDefault(),(this.$el.closest(".et_pb_section.et_pb_global").length||this.$el.closest(".et_pb_row.et_pb_global").length)&&""===et_pb_options.template_post_id&&(t=Pe(this))),this.model.destroy(),V.allowHistorySaving("removed","module",this.model.get("admin_label")),k.removeView(this.model.get("cid")),this.remove(),e&&v.trigger("et-module:removed"),""!==t&&Ie(t),J.update()}},unlockModule:function(e){if(e.preventDefault(),!V.isLoading&&!J.is_selecting()){var t,i=this,o=i.$el.closest(".et_pb_module_block");He().done((function(e){!0===e?(o.removeClass("et_pb_locked"),i.options.model.attributes.et_pb_locked="off",t=k.getParentViews(i.model.get("parent")),_.each(t,(function(e,t){k.isChildrenLocked(e.model.get("cid"))||e.$el.removeClass("et_pb_children_locked")})),V.allowHistorySaving("unlocked","module",i.options.model.get("admin_label")),V.saveAsShortcode()):alert(et_pb_options.locked_module_permission_alert)}))}},isModuleLocked:function(){return"on"===this.model.get("et_pb_locked")||"on"===this.model.get("et_pb_parent_locked")},showRightClickOptions:function(e){e.preventDefault();var t={model:this.model,view:this.$el,view_event:e};new s.RightClickOptionsView(t)},hideRightClickOptions:function(e){e.preventDefault(),i()},setABTesting:function(e){e.preventDefault(),e.stopPropagation(),J.set(this,e)}}),s.HelpView=window.wp.Backbone.View.extend({tagName:"div",id:"et-builder-help",className:"et_pb_modal_settings",template:_.template(e("#et-builder-help-template").html()),isOSX:-1!=navigator.userAgent.indexOf("Mac OS X"),renderKbd:function(t){var i=t;return"super"===i&&(i=this.isOSX?"cmd":"ctrl"),e("<kbd />",{class:"key-".concat(i)}).html(i)},render:function(){var t=this,o=this.$el;i(),o.html(this.template());var n=o.find(".et-pb-shortcuts-tab");return _.each(et_pb_help_options.shortcuts,(function(i){_.each(i,(function(i){if(_.isUndefined(i.title)){var o=e("<p />",{class:"et-pb-shortcut-item"}),a=e("<span />",{class:"et-pb-shortcut-keys"});_.each(i.kbd,(function(i,o){o>0&&a.append(" + "),_.isArray(i)?_.each(i,(function(t,i){i>0&&a.append(" / "),a.append(e("<kbd />").html(t))})):a.append(t.renderKbd(i))})),o.append(a),o.append(e("<span />",{class:"et-pb-shortcut-desc"}).html(i.desc)),n.append(o)}else n.append(e("<h2 />",{class:"et-pb-shortcut-subtitle"}).html(i.title))}))})),this}}),s.RightClickOptionsView=window.wp.Backbone.View.extend({tagName:"div",id:"et-builder-right-click-controls",template:_.template(e("#et-builder-right-click-controls-template").html()),events:{"click .et-pb-right-click-rename":"rename","click .et-pb-right-click-start-ab-testing":"startABTesting","click .et-pb-right-click-end-ab-testing":"endABTesting","click .et-pb-right-click-save-to-library":"saveToLibrary","click .et-pb-right-click-undo":"undo","click .et-pb-right-click-redo":"redo","click .et-pb-right-click-disable":"disable","click .et_pb_disable_on_option":"disable_device","click .et-pb-right-click-lock":"lock","click .et-pb-right-click-collapse":"collapse","click .et-pb-right-click-copy":"copy","click .et-pb-right-click-paste-after":"pasteAfter","click .et-pb-right-click-paste-app":"pasteApp","click .et-pb-right-click-paste-column":"pasteColumn","click .et-pb-right-click-preview":"preview","click .et-pb-right-click-disable-global":"disableGlobal"},initialize:function(t,i){var o;i=!_.isUndefined(i)&&i;if(this.type=this.options.model.attributes.type,this.et_pb_has_storage_support=Ne(),this.has_compatible_clipboard_content=Ye.get(this.getClipboardType()),this.history_noun="row_inner"===this.type?"row":this.type,!V.isLoading&&!J.is_selecting()){if("1"===et_pb_options.is_divi_library&&!1!==this.has_compatible_clipboard_content){switch(et_pb_options.layout_type){case"module":o=[];break;case"row":o=["module"];break;case"section":o=["module","row"];break;default:o=["module","row","section"]}-1==e.inArray(this.type,o)&&(this.has_compatible_clipboard_content=!1)}!1===i&&this.render()}},render:function(){var t=e(this.options.view),i=this.$el.html(this.template()),o=this.options.view.offset(),n=this.options.view_event.pageX-o.left-100,a=this.options.view_event.pageY-o.top;this.closeAllRightClickOptions(),e(this.options.view_event.toElement).is("#et-builder-right-click-controls a")||i.find("li").length<1||(t.append(i),i.find(".options").css({top:"".concat(a,"px"),left:"".concat(n,"px"),"margin-top":"".concat(0-i.find(".options").height()-40,"px")}).animate({"margin-top":0-i.find(".options").height()-10,opacity:1},300),e("#et_pb_layout").prepend('<div id="et_pb_layout_right_click_overlay" />'))},closeAllRightClickOptions:function(){return i(),!1},rename:function(e){e.preventDefault();this.$el.parent();G("rename_admin_label",this.options.model.attributes.cid),this.closeAllRightClickOptions()},startABTesting:function(t){this.closeAllRightClickOptions(),J.toggle_status(!0),V.disable_publish=!0,e("#publish").addClass("disabled"),J.check_create_db(),V.is_selecting_ab_testing_subject=!0,e("#et_pb_layout").addClass("et_pb_select_ab_testing_subject")},endABTesting:function(e){this.closeAllRightClickOptions(),J.toggle_status(!1),V.is_selecting_ab_testing_subject=!1,J.count_subjects()>0&&G("turn_off_ab_testing")},disableGlobal:function(e){e.preventDefault(),this.closeAllRightClickOptions(),k.removeGlobalAttributes(this),Ue()},saveToLibrary:function(t){t.preventDefault();var i=this.options.model,o=i.attributes.type,n={model:i,collection:$,attributes:{"data-open_view":"module_settings"}};if(this.closeAllRightClickOptions(),!J.is_active()||!J.is_ab_testing_item(i)&&"app"!==o)if("app"===this.type)G("save_layout");else{var a=new s.ModalView(n);e("body").append(a.render().el),Re(),a.saveTemplate(t)}else J.alert("cannot_save_".concat(o,"_layout_has_ab_testing"))},undo:function(e){e.preventDefault(),V.undo(e),this.closeAllRightClickOptions()},redo:function(e){e.preventDefault(),V.redo(e),this.closeAllRightClickOptions()},disable:function(t){t.preventDefault();var i,o,n,a=e(t.target).hasClass("et-pb-right-click-disable")?e(t.target):e(t.target).closest("a"),s=a.closest("li").find("span.et_pb_disable_on_options"),l=s.find("span.et_pb_disable_on_option"),_=!(void 0===this.options.model.attributes.et_pb_disabled||"on"!==this.options.model.attributes.et_pb_disabled),d=void 0!==this.options.model.attributes.et_pb_disabled_on?this.options.model.attributes.et_pb_disabled_on:"";return a.addClass("et_pb_right_click_hidden"),s.addClass("et_pb_right_click_visible"),_?l.addClass("et_pb_disable_on_active"):""!==d&&(i=d.split("|"),o=0,n="phone",l.each((function(){var t=e(this);t.hasClass("et_pb_disable_on_".concat(n))&&"on"===i[o]&&t.addClass("et_pb_disable_on_active"),o++,n=1===o?"tablet":"desktop"}))),!1},disable_device:function(t){var i,o,n,a,s=e(t.target),l=(e(this),s.hasClass("et_pb_disable_on_active")?"off":"on"),_=void 0!==this.options.model.attributes.et_pb_disabled_on?this.options.model.attributes.et_pb_disabled_on:"",d=this.$el.parent();return s.hasClass("et_pb_disable_on_phone")?(n=0,a="phone"):s.hasClass("et_pb_disable_on_tablet")?(n=1,a="tablet"):(n=2,a="desktop"),(o=""!==_?_.split("|"):["","",""])[n]=l,this.options.model.attributes.et_pb_disabled_on="".concat(o[0],"|").concat(o[1],"|").concat(o[2]),"on"===o[0]&&"on"===o[1]&&"on"===o[2]?(d.addClass("et_pb_disabled"),this.options.model.attributes.et_pb_disabled="on",i="disabled"):(d.removeClass("et_pb_disabled"),this.options.model.attributes.et_pb_disabled="off",i="off"===l?"enabled":"disabled"),s.toggleClass("et_pb_disable_on_active"),this.updateGlobalModule(),V.allowHistorySaving(i,this.history_noun,void 0,a),V.saveAsShortcode(),!1},lock:function(e){e.preventDefault(),this.$el.parent().hasClass("et_pb_locked")?(this.unlockItem(),V.allowHistorySaving("unlocked",this.history_noun)):(this.lockItem(),V.allowHistorySaving("locked",this.history_noun)),this.closeAllRightClickOptions(),V.saveAsShortcode()},unlockItem:function(){var e,t,i=this,o=i.$el.parent();He().done((function(n){!0===n?(o.removeClass("et_pb_locked"),i.options.model.attributes.et_pb_locked="off","module"!==i.options.model.get("type")&&(e=k.getChildrenViews(i.model.get("cid")),_.each(e,(function(e,t){e.$el.removeClass("et_pb_parent_locked"),e.model.set("et_pb_parent_locked","off",{silent:!0})}))),"section"!==i.options.model.get("type")&&(t=k.getParentViews(i.model.get("parent")),_.each(t,(function(e,t){k.isChildrenLocked(e.model.get("cid"))||e.$el.removeClass("et_pb_children_locked")}))),V.allowHistorySaving("unlocked",i.history_noun),V.saveAsShortcode(),i.updateGlobalModule()):alert(et_pb_options.locked_item_permission_alert)}))},lockItem:function(){var e,t,i=this,o=i.$el.parent();He().done((function(n){!0===n?(o.addClass("et_pb_locked"),i.options.model.attributes.et_pb_locked="on","module"!==i.options.model.get("type")&&(e=k.getChildrenViews(i.model.get("cid")),_.each(e,(function(e,t){e.$el.addClass("et_pb_parent_locked"),e.model.set("et_pb_parent_locked","on",{silent:!0})}))),"section"!==i.options.model.get("type")&&(t=k.getParentViews(i.model.get("parent")),_.each(t,(function(e,t){e.$el.addClass("et_pb_children_locked")}))),V.allowHistorySaving("locked",i.history_noun),V.saveAsShortcode(),i.updateGlobalModule()):alert(et_pb_options.locked_item_permission_alert)}))},collapse:function(e){e.preventDefault();var t,i=this.$el.parent(),o=this.options.model.attributes.cid;i.toggleClass("et_pb_collapsed"),i.hasClass("et_pb_collapsed")?(this.options.model.attributes.et_pb_collapsed="on",t="collapsed"):(this.options.model.attributes.et_pb_collapsed="off",t="expanded"),J.is_active()&&"on"===this.model.get("et_pb_ab_subject")&&J.subject_carousel(o),this.updateGlobalModule(),this.closeAllRightClickOptions(),V.allowHistorySaving(t,this.history_noun),V.saveAsShortcode()},copy:function(e,t){t||e.preventDefault();var i,o=_.clone(this.model.attributes),n=o.type;"row_inner"===n&&(n="row"),_.isUndefined(o.view)||delete o.view,_.isUndefined(o.appendAfter)||delete o.appendAfter,"row"!==n&&"section"!==n||(o.childviews=this.getChildViews(o.cid)),delete o.className,delete o.et_pb_locked,i=JSON.stringify(o),Ye.set(this.getClipboardType(),i),this.closeAllRightClickOptions()},pasteAfter:function(e,t,i,o,n,a){if(n||e.preventDefault(),Fe(this.model)){t=_.isUndefined(t)?this.model.get("parent"):t,i=_.isUndefined(i)?this.getClipboardType():i,o=!!_.isUndefined(o)||o;var s,l=k.getView(t);s=Ye.get(i),s=JSON.parse(s),_.isUndefined(s.et_pb_ab_subject)&&"on"!==s.et_pb_ab_subject||(s.et_pb_ab_subject_id=J.get_subject_id()),o&&(s.cloned_cid=this.model.get("cid")),this.setPasteViews(s,t,"main_parent"),!J.is_active()||"row"!==s.type&&"row_inner"!==s.type&&"section"!==s.type||"on"!==s.et_pb_ab_subject||J.subject_carousel(s.cid),v.trigger("et-advanced-module:updated"),v.trigger("et-advanced-module:saved"),_.isUndefined(l)||!k.is_global(l.model)&&!k.is_global_children(l.model)||this.updateGlobalModule(),this.closeAllRightClickOptions(),"did"!==U.verb||a||V.allowHistorySaving("copied",this.history_noun),n||V.saveAsShortcode()}},pasteApp:function(e){e.preventDefault();var t=$.where({type:"section"}),i=_.last(t);this.model=i,this.options.model=i,this.pasteAfter(e,void 0,"et_pb_clipboard_section",!1)},pasteColumn:function(e){e.preventDefault();var t=this.model.get("cid"),i="section"===this.model.get("type")?"et_pb_clipboard_module_fullwidth":"et_pb_clipboard_module";this.pasteAfter(e,t,i,!1)},getClipboardType:function(){var e=this.model.attributes.type,t=_.isUndefined(this.model.attributes.module_type)?this.model.attributes.type:this.model.attributes.module_type,i="et_pb_clipboard_".concat(e),o="et_pb_fullwidth";return t.substr(0,o.length)===o&&(i+="_fullwidth"),i},getChildViews:function(e){var t,i=this,o=$.models,n=[];return _.each(o,(function(o,a){o.attributes.parent===e&&(t=o.attributes,_.isUndefined(t.view)||delete t.view,_.isUndefined(t.appendAfter)||delete t.appendAfter,t.created="manually",t.childviews=i.getChildViews(o.attributes.cid),n.push(t))})),n},setPasteViews:function(e,t,i){var o=this,n=k.generateNewId(),a=this.model.collection.indexOf(this.model),s=!(_.isUndefined(e.childviews)||!_.isArray(e.childviews))&&e.childviews;e.cid=n,e.parent=t,e.created="manually",e.pasted_module=void 0!==i&&"main_parent"===i,_.isUndefined(e.et_pb_global_parent)||""===e.et_pb_global_parent||(e.et_pb_global_parent=Pe(k.getView(t))),!_.isUndefined(e.et_pb_global_module)&&_.isUndefined(e.global_parent_cid)&&_.isUndefined(this.set_global_parent_cid)&&(this.global_parent_cid=n,this.set_global_parent_cid=!0),_.isUndefined(e.global_parent_cid)||(e.global_parent_cid=this.global_parent_cid),_.each(["et_pb_global_parent","global_parent_cid"],(function(t){!_.isUndefined(o.options.model.get(t))&&_.isUndefined(e[t])&&(e[t]=o.options.model.get(t))})),_.isUndefined(e.et_pb_template_type)||delete e.et_pb_template_type,_.isUndefined(e.et_pb_ab_subject)&&"on"!==e.et_pb_ab_subject||(e.et_pb_ab_subject_id=J.get_subject_id()),delete e.childviews,_.isUndefined(e.admin_label)&&(e.admin_label=_.isUndefined(e.module_type)?"":k.getDefaultAdminLabel(e.module_type)),this.model.collection.add(e,{at:a}),s&&_.each(s,(function(e){o.setPasteViews(e,n)}))},updateGlobalModule:function(){var e;k.is_global(this.model)?e=this.options.model.get("cid"):k.is_global_children(this.model)&&(e=this.options.model.get("global_parent_cid")),_.isUndefined(e)||Ie(e)},hasOption:function(e){var t="function"==typeof this.model.get&&this.model.get("cid"),i=!1,o=this.options.model.attributes.type,n=J.is_active(),a=!!n&&J.is_goal(this.model),s=!!n&&J.is_goal_children(this.model),l=!!n&&J.has_goal(this.model),d=!!n&&J.is_subject(this.model),r=!!n&&J.is_subject_children(this.model),c=!n||J.is_user_has_permission(t,"right_click_change"),p=!n||J.is_user_has_permission(t,"copy"),b=!n||J.is_user_has_permission(t,"paste");switch(e){case"rename":this.hasOptionSupport(["module","section","row_inner","row"])&&"on"!==this.options.model.attributes.et_pb_locked&&c&&(i=!0);break;case"save-to-library":!this.hasOptionSupport(["app","section","row_inner","row","module"])||k.is_global(this.options.model)||k.is_global_children(this.options.model)||"on"===this.options.model.attributes.et_pb_locked||J.is_active()&&(J.is_ab_testing_item(this.options.model)||"app"===o)||"1"===et_pb_options.is_divi_library||(i=!0);break;case"start-ab-testing":this.hasOptionSupport(["section","row_inner","row","module"])&&!n&&(i=!0);break;case"end-ab-testing":this.hasOptionSupport(["section","row_inner","row","module"])&&(d||a||r||s)&&n&&(i=!0);break;case"disable-global":this.hasOptionSupport(["section","row_inner","row","module"])&&(k.is_global(this.options.model)||k.is_global_children(this.options.model))&&(i=!0);break;case"undo":this.hasOptionSupport(["app","section","row_inner","row","column","column_inner","module"])&&this.hasUndo()&&(i=!0);break;case"redo":this.hasOptionSupport(["app","section","row_inner","row","column","column_inner","module"])&&this.hasRedo()&&(i=!0);break;case"disable":this.hasOptionSupport(["section","row_inner","row","module"])&&"on"!==this.options.model.attributes.et_pb_locked&&!1===this.hasDisabledParent()&&_.isUndefined(this.model.attributes.et_pb_skip_module)&&c&&(i=!0);break;case"lock":this.hasOptionSupport(["section","row_inner","row","module"])&&_.isUndefined(this.model.attributes.et_pb_skip_module)&&c&&(i=!0);break;case"collapse":this.hasOptionSupport(["section","row_inner","row"])&&"on"!==this.options.model.attributes.et_pb_locked&&(!J.is_active()||"on"!==this.options.model.get("et_pb_ab_subject")||"off"!==this.options.model.get("et_pb_collapsed")&&!_.isUndefined(this.options.model.get("et_pb_collapsed")))&&_.isUndefined(this.model.attributes.et_pb_skip_module)&&(i=!0);break;case"copy":this.hasOptionSupport(["section","row_inner","row","module"])&&this.et_pb_has_storage_support&&_.isUndefined(this.model.attributes.et_pb_skip_module)&&p&&!a&&!l&&(i=!0);break;case"paste-after":this.hasOptionSupport(["section","row_inner","row","module"])&&this.et_pb_has_storage_support&&this.has_compatible_clipboard_content&&b&&Fe(this.options.model)&&(i=!0);break;case"paste-app":this.hasOptionSupport(["app"])&&this.et_pb_has_storage_support&&Ye.get("et_pb_clipboard_section")&&(i=!0);break;case"paste-column":!_.isUndefined(this.model.attributes.is_insert_module)&&(("column"===this.type||"column_inner"==this.type)&&Ye.get("et_pb_clipboard_module")||"section"===this.type&&Ye.get("et_pb_clipboard_module_fullwidth"))&&this.et_pb_has_storage_support&&(i=!0);break;case"preview":this.hasOptionSupport(["section","row_inner","row","module"])&&"on"!==this.options.model.attributes.et_pb_locked&&(i=!0)}return i},hasOptionSupport:function(e){return!_.isUndefined(_.findWhere(e,this.type))},hasUndo:function(){return V.hasUndo()},hasRedo:function(){return V.hasRedo()},hasDisabledParent:function(){for(var e=k.getView(this.model.attributes.parent),t={},i=!1;!_.isUndefined(e);)_.isUndefined(e.model.attributes.et_pb_disabled)||"on"!==e.model.attributes.et_pb_disabled||(i=!0),t[e.model.attributes.cid]=e,e=k.getView(e.model.attributes.parent);return i},preview:function(t){t.preventDefault();var i=k.getView(this.model.get("cid"));this.closeAllRightClickOptions(),i.triggered_by_right_click=!0,i.do_preview=!0,i.showSettings(t),e(".et-pb-modal-preview-template").trigger("click")}}),s.visualizeHistoriesView=window.wp.Backbone.View.extend({el:"#et-pb-histories-visualizer",template:_.template(e("#et-builder-histories-visualizer-item-template").html()),events:{"click li":"rollback"},verb:"did",noun:"module",noun_alias:void 0,addition:"",getItemID:function(e){return"#et-pb-history-".concat(e.get("timestamp"))},getVerb:function(){var e=this.verb;return _.isUndefined(et_pb_options.verb[e])||(e=et_pb_options.verb[e]),e},getNoun:function(){var e=this.noun;return _.isUndefined(this.noun_alias)?_.isUndefined(et_pb_options.noun[e])||(e=et_pb_options.noun[e]):e=this.noun_alias,e},getAddition:function(){var e=this.addition;return _.isUndefined(et_pb_options.addition[e])||(e=et_pb_options.addition[e]),e},addItem:function(e){this.options=e,this.$el.prepend(this.template()),this.setHistoriesHeight()},changeItem:function(t){var i=this.getItemID(t),o=e(i),n=t.collection.findWhere({current_active_history:!0}),a=t.collection.indexOf(n),s=t.collection.indexOf(t);this.options=t,this.$el.find("li").removeClass("undo redo active"),a===s?(o.addClass("active"),this.$el.find("li").slice(0,o.index()).addClass("redo"),this.$el.find("li").slice(o.index()+1).addClass("undo")):this.$el.find("li:not( .active, .redo )").addClass("undo"),this.setHistoriesHeight()},removeItem:function(e){var t=this.getItemID(e);this.$el.find(t).remove(),this.setHistoriesHeight()},setHistoryMeta:function(e,t,i,o){_.isUndefined(e)||(this.verb=e),_.isUndefined(t)||(this.noun=t),_.isUndefined(i)?this.noun_alias=void 0:this.noun_alias=i,_.isUndefined(o)||(this.addition=o)},setHistoriesHeight:function(){var t=this;setTimeout((function(){var i=e("#et_pb_layout"),o=i.find(".hndle"),n=e("#et_pb_layout_controls"),a=i.outerHeight()-o.outerHeight()-n.outerHeight();t.$el.css({"max-height":"".concat(a,"px")})}),200)},rollback:function(t){t.preventDefault();var i=e(t.target),o=(i.is("li")?i:i.parent("li")).data("timestamp"),n=this.options.collection.findWhere({timestamp:o}),a=n.get("shortcode");V.resetCurrentActiveHistoryMarker(),n.set({current_active_history:!0}),v.trigger("et-pb-loading:started"),ae("content",a,"saving_to_content"),setTimeout((function(){var t=e("#et_pb_layout"),i=t.innerHeight();t.css({height:"".concat(i,"px")}),V.removeAllSections(),V.$el.find(".et_pb_section").remove(),V.enable_history=!1,V.createLayoutFromContent(Oe(a),"","",{is_reinit:"reinit"}),J.is_active_based_on_models()?(J.toggle_status(!0),Ue()):J.toggle_status(!1),t.css({height:"auto"}),v.trigger("et-pb-loading:ended"),V.updateHistoriesButtonState()}),600)}}),s.AppView=window.wp.Backbone.View.extend({el:e("#et_pb_main_container"),template:_.template(e("#et-builder-app-template").html()),template_button:_.template(e("#et-builder-add-specialty-section-button").html()),events:{"click .et-pb-layout-buttons-save":"saveLayout","click .et-pb-layout-buttons-load":"loadLayout","click .et-pb-layout-buttons-clear":"clearLayout","click .et-pb-layout-buttons-history":"toggleHistory","click #et-pb-histories-visualizer-overlay":"closeHistory","contextmenu #et-pb-histories-visualizer-overlay":"closeHistory","click .et-pb-layout-buttons-redo":"redo","click .et-pb-layout-buttons-undo":"undo","click .et-pb-layout-buttons-view-ab-stats":"viewABStats","click .et-pb-layout-buttons-settings":"settings","contextmenu .et-pb-layout-buttons-save":"showRightClickOptions","contextmenu .et-pb-layout-buttons-load":"showRightClickOptions","contextmenu .et-pb-layout-buttons-clear":"showRightClickOptions","contextmenu .et-pb-layout-buttons-redo":"showRightClickOptions","contextmenu .et-pb-layout-buttons-undo":"showRightClickOptions","contextmenu #et_pb_main_container_right_click_overlay":"showRightClickOptions","click #et_pb_main_container_right_click_overlay":"hideRightClickOptions"},initialize:function(){this.listenTo(this.collection,"add",this.addModule),this.listenTo(T,"add",this.addVisualizeHistoryItem),this.listenTo(T,"change",this.changeVisualizeHistoryItem),this.listenTo(T,"remove",this.removeVisualizeHistoryItem),this.listenTo(v,"et-sortable:update",_.debounce(this.saveAsShortcode,128)),this.listenTo(v,"et-model-changed-position-within-column",_.debounce(this.saveAsShortcode,128)),this.listenTo(v,"et-module:removed",_.debounce(this.saveAsShortcode,128)),this.listenTo(v,"et-pb-loading:started",this.startLoadingAnimation),this.listenTo(v,"et-pb-loading:ended",this.endLoadingAnimation),this.listenTo(v,"et-pb-content-updated",this.recalculateModulesOrder),this.listenTo(v,"et-advanced-module:updated_order",this.updateAdvancedModulesOrder),this.listenTo(v,"et-pb-content-updated",_.debounce(this.updateYoastContent,500)),this.$builder_toggle_button=e("body").find("#et_pb_toggle_builder"),this.$builder_toggle_button_wrapper=e("body").find(".et_pb_toggle_builder_wrapper"),this.render(),this.maybeGenerateInitialLayout(),e("#et_builder_version").val("BB|".concat(window.et_builder_product_name,"|").concat(window.et_builder_version))},render:function(){return this.$el.html(this.template()),this.makeSectionsSortable(),this.addLoadingAnimation(),e("#et_pb_main_container_right_click_overlay").remove(),this.$el.prepend('<div id="et_pb_main_container_right_click_overlay" />'),this.updateHistoriesButtonState(),this},addLoadingAnimation:function(){e("body").append('<div id="et_pb_loading_animation"></div>'),this.$loading_animation=e("#et_pb_loading_animation").hide()},startLoadingAnimation:function(){this.pageBuilderIsActive()&&(this.$loading_animation.next().length&&(e("body").append(this.$loading_animation),this.$loading_animation=e("#et_pb_loading_animation")),this.$loading_animation.show(),this.isLoading=!0)},endLoadingAnimation:function(){this.$loading_animation.hide(),this.isLoading=!1;try{var e=window.localStorage.getItem("et_page_loading");e&&(console.log("Builder load : %c%f","color: red",parseInt((Date.now()-parseInt(e,10))/10,10)/100),window.localStorage.removeItem("et_page_loading"))}catch(e){}},pageBuilderIsActive:function(){return this.$builder_toggle_button.hasClass("et_pb_builder_is_used")||this.$builder_toggle_button_wrapper.hasClass("et_pb_builder_is_used")},saveLayout:function(e){e.preventDefault(),J.is_active()?J.alert("cannot_save_app_layout_has_ab_testing"):(i(),G("save_layout"))},loadLayout:function(t){var o;t.preventDefault(),i(),J.is_active()?J.alert("cannot_load_layout_has_ab_testing"):(o=new s.ModalView({attributes:{"data-open_view":"save_layout"},view:this}),e("body").append(o.render().el))},clearLayout:function(e){e.preventDefault(),i(),J.is_active()?J.alert("cannot_clear_layout_has_ab_testing"):G("clear_layout")},getHistoriesCount:function(){return this.options.history.length},getHistoriesIndex:function(){var e=this.options.history.findWhere({current_active_history:!0});return _.isUndefined(e)?this.options.history.models.length-1:this.options.history.indexOf(e)},isDoingCombination:function(){return!_.isUndefined(this.is_doing_combination)&&this.is_doing_combination},enableHistory:function(){return!_.isUndefined(this.enable_history)&&this.enable_history},allowHistorySaving:function(e,t,i,o){this.enable_history=!0,U.setHistoryMeta(e,t,i,o)},codeModuleContentPrepCB:function(e,t){var i=t;return i=(i=(i=(i=i.replace(/<br[\s]?[\/]?>/g,"<!\u2013- [et_pb_br_holder] -\u2013>")).replace(/<p /g,"<pee ")).replace(/<p>/g,"<pee>")).replace(/<\/p>/g,"</pee>"),e.replace(t,i)},codeModuleContentPrep:function(e){return e=(e=e.replace(/\[et_pb_code.*?\]([^]*)\[\/et_pb_code\]/g,this.codeModuleContentPrepCB)).replace(/\[et_pb_fullwidth_code.*?\]([^]*)\[\/et_pb_fullwidth_code\]/g,this.codeModuleContentPrepCB)},codeModuleContentUnPrepCB:function(e,t){var i=t;return i=(i=(i=(i=(i=(i=i.replace(/\n/g,"")).replace(/<p>/g,"")).replace(/<\/p>/g,"")).replace(/<!\u2013- \[et_pb_br_holder\] -\u2013>/g,"<br />")).replace(/<pee/g,"<p")).replace(/<\/pee>/g,"</p>"),e.replace(t,i)},codeModuleContentUnPrep:function(e){return e=(e=e.replace(/\[et_pb_code.*?\]([^]*)\[\/et_pb_code\]/g,this.codeModuleContentUnPrepCB)).replace(/\[et_pb_fullwidth_code.*?\]([^]*)\[\/et_pb_fullwidth_code\]/g,this.codeModuleContentUnPrepCB)},reviseHistories:function(){var e,t=this;if(this.hasRedo()){var i=_.range(this.getHistoriesIndex()+1,this.getHistoriesCount()).reverse();_.each(i,(function(i){e=t.options.history.at(i),t.options.history.remove(e)}))}this.updateHistoriesButtonState()},resetCurrentActiveHistoryMarker:function(){var e=this.options.history.where({current_active_history:!0});_.isEmpty(e)||_.each(e,(function(e){e.set({current_active_history:!1})}))},hasUndo:function(){return this.getHistoriesIndex()>0},hasRedo:function(){return this.getHistoriesCount()-this.getHistoriesIndex()>1},hasOverlayRendered:function(){return!!e(".et_pb_modal_overlay").length},updateHistoriesButtonState:function(){this.hasUndo()?e(".et-pb-layout-buttons-undo").removeClass("disabled"):e(".et-pb-layout-buttons-undo").addClass("disabled"),this.hasRedo()?e(".et-pb-layout-buttons-redo").removeClass("disabled"):e(".et-pb-layout-buttons-redo").addClass("disabled"),this.hasUndo()||this.hasRedo()?e(".et-pb-layout-buttons-history").removeClass("disabled"):e(".et-pb-layout-buttons-history").addClass("disabled")},getUndoModel:function(){var e=this.options.history.at(this.getHistoriesIndex()-1);return!_.isUndefined(e)&&e},undo:function(t){t.preventDefault();var i,o=this,n=this.getUndoModel();this.hasUndo()&&(_.isUndefined(n)||this.hasOverlayRendered()||(i=n.get("shortcode"),this.resetCurrentActiveHistoryMarker(),n.set({current_active_history:!0}),v.trigger("et-pb-loading:started"),ae("content",i,"saving_to_content"),setTimeout((function(){var t=e("#et_pb_layout"),n=t.innerHeight();t.css({height:"".concat(n,"px")}),V.removeAllSections(),V.$el.find(".et_pb_section").remove(),o.enable_history=!1,V.createLayoutFromContent(Oe(i),"","",{is_reinit:"reinit"}),t.css({height:"auto"}),v.trigger("et-pb-loading:ended"),o.updateHistoriesButtonState()}),600)))},viewABStats:function(e){e.preventDefault(),"1"!==et_pb_options.is_divi_library&&G("view_ab_stats")},settings:function(e){e.preventDefault(),"1"!==et_pb_options.is_divi_library&&G("open_settings")},getRedoModel:function(){var e=this.options.history.at(this.getHistoriesIndex()+1);return!_.isUndefined(e)&&e},toggleHistory:function(t){t.preventDefault();var i=e("#et-pb-histories-visualizer");i.hasClass("active")&&(i.addClass("fadeout"),setTimeout((function(){i.removeClass("fadeout")}),500)),e(".et-pb-layout-buttons-history, #et-pb-histories-visualizer, #et-pb-histories-visualizer-overlay").toggleClass("active")},closeHistory:function(e){e.preventDefault(),this.toggleHistory(e)},redo:function(t){t.preventDefault();var i,o=this,n=this.getRedoModel();this.hasRedo()&&!_.isUndefined(n)&&n&&(this.hasOverlayRendered()||(this.options.history.indexOf(n),i=n.get("shortcode"),this.resetCurrentActiveHistoryMarker(),n.set({current_active_history:!0}),v.trigger("et-pb-loading:started"),ae("content",i,"saving_to_content"),setTimeout((function(){var t=e("#et_pb_layout"),n=t.innerHeight();t.css({height:"".concat(n,"px")}),V.removeAllSections(),V.$el.find(".et_pb_section").remove(),o.enable_history=!1,V.createLayoutFromContent(Oe(i),"","",{is_reinit:"reinit"}),t.css({height:"auto"}),v.trigger("et-pb-loading:ended"),o.updateHistoriesButtonState()}),600)))},addHistory:function(e){if(this.enableHistory()&&!this.isDoingCombination()){var t=new Date,i=t.getHours()>12?t.getHours()-12:t.getHours(),o=t.getMinutes(),n=t.getHours()>12?"PM":"AM";this.hasRedo()&&this.reviseHistories(),this.resetCurrentActiveHistoryMarker(),this.options.history.add({timestamp:_.now(),datetime:"".concat("0".concat(i).slice(-2),":").concat("0".concat(o).slice(-2)," ").concat(n),shortcode:e,current_active_history:!0,verb:U.verb,noun:U.noun},{validate:!0}),U.setHistoryMeta("did","something")}this.updateHistoriesButtonState()},addVisualizeHistoryItem:function(e){U.addItem(e)},changeVisualizeHistoryItem:function(e){U.changeItem(e)},removeVisualizeHistoryItem:function(e){U.removeItem(e)},maybeGenerateInitialLayout:function(){k.generateNewId();var t=this;v.trigger("et-pb-loading:started"),setTimeout((function(){var i="";if(void 0===window.tinyMCE||!window.tinyMCE.get("content")||window.tinyMCE.get("content").isHidden()||e("iframe#content_ifr").length)""!==(i=ee("content",!0))&&t.allowHistorySaving("loaded","page"),t.addHistory(i),t.pageBuilderIsActive()?-1!==i.indexOf("[et_pb_")||"1"===et_pb_options.is_divi_library&&"module"===et_pb_options.layout_type?-1!==i.indexOf("specialty_placeholder")?(t.createLayoutFromContent(Oe(i)),e(".et_pb_section_specialty").append(t.template_button())):t.createLayoutFromContent(Oe(i)):V.reInitialize():t.createLayoutFromContent(i),function(e,t){if(void 0===window.switchEditors)return;var i=tinyMCEPreInit.mceInit.et_pb_content.tadv_noautop;if(void 0!==i&&!0===i)return;_.each(V.collection.models,(function(i){var o=JSON.parse(et_pb_options.et_builder_modules_with_children);if(!_.includes(_.keys(o),i.get("module_type"))){var n=i.get("et_pb_content");if(void 0!==n){if("tinymce"===e)n=window.switchEditors.wpautop(n.replace(/<p>\xa0<\/p>/g,"<p>&nbsp;</p>"));else{if(!_.isUndefined(t)&&"initial_load"===t)return;n=window.switchEditors.pre_wpautop(n)}i.set("et_pb_content",n,{silent:!0})}}}))}(ie(),"initial_load"),v.trigger("et-pb-content-updated"),v.trigger("et-pb-loading:ended"),e("#et_pb_main_container").addClass("et_pb_loading_animation"),setTimeout((function(){e("#et_pb_main_container").removeClass("et_pb_loading_animation")}),500),t.listenTo(t.collection,"change reset add",_.debounce(t.saveAsShortcode,128)),J.update();else{if(30<++c){var o=e("#et-builder-failure-notice-template");return v.trigger("et-pb-loading:ended"),e("#et_pb_main_container").removeClass("et_pb_loading_animation"),void e("body").addClass("et_pb_stop_scroll").append(o.html())}t.maybeGenerateInitialLayout()}}),500)},wp_regexp_not_global:_.memoize((function(e){return new RegExp("\\[(\\[?)(".concat(e,")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)"))})),getShortCodeParentTags:function(e){var t="et_pb_section|et_pb_row|et_pb_column|et_pb_column_inner|et_pb_row_inner".split("|");if(t=t.concat(et_pb_options.et_builder_module_parent_shortcodes.split("|")),!_.isUndefined(e)&&""!==e){var i=e.split("|"),o=_.difference(i,t);_.isEmpty(o)||(t=_.union(t,o))}return t=t.join("|")},getShortCodeChildTags:function(){return et_pb_options.et_builder_module_child_shortcodes},getShortCodeRawContentTags:function(){return et_pb_options.et_builder_module_raw_content_shortcodes.split("|")},createLayoutFromContent:function(t,i,o,n,a){var s=this,l=_.isUndefined(t)||""===t?"":t.match(/\[([^\W\/\[\]\x00-\x20=]+)/g),d=l&&_.isArray(l)?l.join("|").replace(/\[/g,""):"",r=this.getShortCodeParentTags().split("|"),c=void 0===o||""===o?this.getShortCodeParentTags(d):this.getShortCodeChildTags(),p=window.wp.shortcode.regexp(c),b=this.wp_regexp_not_global(c),u=t.match(p),g=this.getShortCodeRawContentTags(),m=void 0===n?{}:n;_.each(u,(function(t,o){var n,l=t.match(b),d=l[2],c=l[2],u=""!==l[3]?window.wp.shortcode.attrs(l[3]):"",v=l[5],w=k.generateNewId(),y={},C=e.inArray(c,["et_pb_section","et_pb_row","et_pb_column","et_pb_row_inner","et_pb_column_inner"])>-1,S=C&&void 0!==v&&""!==v&&v.match(p),x="",j=!C&&-1===_.indexOf(r,c);if(C&&(c=c.replace("et_pb_","")),n={type:c,cid:w,created:"manually",module_type:c,component_status:""},void 0!==m.current_row_cid&&""!==m.current_row_cid&&(n.current_row=m.current_row_cid),void 0!==m.global_parent&&""!==m.global_parent&&(n.et_pb_global_parent=m.global_parent,n.global_parent_cid=m.global_parent_cid),"section"===c&&void 0!==m.after_section&&""!==m.after_section&&(n.after_section=m.after_section),"section"!==c&&(n.parent=i),-1!==c.indexOf("et_pb_")&&(n.type="module"),d===n.type&&(n.type="module"),n.admin_label=j?c:k.getDefaultAdminLabel(c),n._address=_.isUndefined(m.predefined_address)?o.toString():m.predefined_address,_.isUndefined(a)||(n._address="".concat(a,".").concat(n._address)),_.isObject(u.named)){var $=!1;for(var T in"global"!==et_pb_options.is_global_template||C||void 0===u.named.template_type||"module"!==u.named.template_type||("updated"===et_pb_options.selective_sync_status?h[et_pb_options.template_post_id]=et_pb_options.excluded_global_options:($=!0,f[et_pb_options.template_post_id]=[])),x=void 0!==u.named.global_module&&""===x?u.named.global_module:x,"reinit"===m.is_reinit&&("migrate"!==m.migrate_global_modules||""===x&&""===m.global_parent)||(u=function(e,t,i,o){var n=!_.isUndefined(et_pb_options.et_pb_module_settings_migrations)&&et_pb_options.et_pb_module_settings_migrations,a=!_.isUndefined(n.name_changes)&&n.name_changes,s=!_.isUndefined(n.value_changes)&&n.value_changes;a&&!_.isUndefined(a[i])&&_.forEach(a[i],(function(t,i){!_.isUndefined(e.named[i])&&_.isUndefined(e.named[t])&&(e.named[t]=e.named[i])}));s&&!_.isUndefined(s[t])&&_.forEach(s[t],(function(t,i){e.named[i]=t}));if(_.includes(["module","row"],o)){var l={},d=t.length;_.forEach(s,(function(e,i){"".concat(t,".")===String(i).substr(0,d+1)&&(l[i.substr(t.length+1)]=e)})),_.isEmpty(l)||(e.named.value_changes=l)}return e}(u,n._address,n.type,c)),u.named)if(void 0===m.ignore_template_tag||""===m.ignore_template_tag||"ignore_template"===m.ignore_template_tag&&"template_type"!==T){var U="admin_label"!==T&&"specialty_columns"!==T&&"value_changes"!==T?"et_pb_".concat(T):T,O=!1;"et_pb_signup"===c&&-1!==e.inArray(T,["description","footer_content"])&&(u.named[T]=u.named[T].replace(/%91/g,"[").replace(/%93/g,"]"),u.named[T]=u.named[T].replace(/%22/g,'"')),$&&f[et_pb_options.template_post_id].push(T),"column"!==c&&"column_inner"!==c||"et_pb_type"!==U||(U="layout"),_.isEmpty(m.unsynced_options)||-1===_.indexOf(m.unsynced_options,T)||(O=!0),O||(y[U]=u.named[T],"value_changes"===T&&delete u.named[T])}n=_.extend(n,y)}if("section"===c&&"on"===n.et_pb_specialty&&(v=function(e){return e.replace(/(\[et_pb_(row |row_inner) [\s\S]*?\][\s\S]*\[\/et_pb_(row |row_inner)\])/im,te)}(v)),void 0!==n.specialty_columns&&(n.layout_specialty="1",n.specialty_columns=parseInt(n.specialty_columns)),S||!_.isUndefined(m.unsynced_options)&&!_.isEmpty(m.unsynced_options)&&-1!==_.indexOf(m.unsynced_options,"et_pb_content_field")||(e.inArray(c,g)>-1?(n.et_pb_raw_content=n.et_pb_raw_content||v||"",n.et_pb_raw_content=n.et_pb_raw_content.replace(/<!-- \[et_pb_line_break_holder\] -->/g,"\n")):n.et_pb_content=v),_.includes(["row","row_inner"],c)&&(n.et_pb_content=v),"et_pb_contact_form"===c&&void 0!==n.et_pb_custom_message&&(n.et_pb_custom_message=_.unescape(n.et_pb_custom_message.replace(/\|\|et_pb_line_break_holder\|\|/g,"\r\n"))),"undefined"!==!n.et_pb_disabled&&"on"===n.et_pb_disabled&&(n.className=" et_pb_disabled"),"undefined"!==!n.et_pb_locked&&"on"===n.et_pb_locked&&(n.className=" et_pb_locked"),void 0!==m.global_id&&""!==m.global_id&&(n.et_pb_global_module=m.global_id),!C&&-1===_.indexOf(r,c))return n.title=c,n.component_status="removed",void s.collection.add([n]);if(s.collection.add([n]),"reinit"===m.is_reinit||""===x||""!==x&&"row"!==c&&"row_inner"!==c&&"section"!==c){if(S){var A=void 0===m.global_parent||""===m.global_parent?x:m.global_parent,M=void 0===m.global_parent_cid||""===m.global_parent_cid?void 0!==x&&""!==x?w:"":m.global_parent_cid,L=C?"":S;s.createLayoutFromContent(v,w,L,{is_reinit:m.is_reinit,global_parent:A,global_parent_cid:M,migrate_global_modules:m.migrate_global_modules},n._address)}}else B++,function(t,i,o,n){e("body").find(".et_pb_global_loading_overlay").length||e("body").append('<div class="et_pb_global_loading_overlay"></div>');var a="html"===ie()?"skip":"apply";e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_pb_get_global_module",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_global_id:t,et_global_autop:a},success:function(a){var s=!1;if(!a||a.error){var l=k.getView(i);if(!l)return void e("body").find(".et_pb_global_loading_overlay").remove();var d=l.$el.find("[data-cid]");l.model.unset("et_pb_global_module"),d.length&&d.each((function(){var t=e(this).data("cid");if(void 0!==t&&""!==t){var i=k.getView(t);void 0!==i&&i.model.unset("et_pb_global_parent")}}))}else{var r=o.replace(/ global_parent="\S+"/g,""),c=qe(a.shortcode.replace(/template_type="\S+"/,'global_module="'.concat(t,'"')));c=(c=c.replace(/]\s?\n\s?\n\s?/g,"] ").replace(/\s?\n\s?\n\s?\[/g," [")).replace(/]\s+/g,"]").replace(/\s+\[/g,"["),r=r.replace(/]\s+/g,"]").replace(/\s+\[/g,"["),oe("content")&&(c=c.replace(/\r?\n|\r/g,"")),_.unescape(c)!==_.unescape(r)&&(s=!0,V.createLayoutFromContent(a.shortcode,"","",{ignore_template_tag:"ignore_template",current_row_cid:i,global_id:t,is_reinit:"reinit",predefined_address:n}))}if(z++,B===z){var p=!_.isUndefined(et_pb_options.et_pb_module_settings_migrations)&&et_pb_options.et_pb_module_settings_migrations;(s||!1!==p)&&Ue(!0,"migrate"),setTimeout((function(){e("body").find(".et_pb_global_loading_overlay").remove()}),650)}}})}(x,w,t,n._address),s.createLayoutFromContent(v,w,"",{is_reinit:"reinit"},n._address)}))},addModule:function(t){var i,o,n,a={model:t,collection:$},l=void 0!==t.get("cloned_cid")&&t.get("cloned_cid");switch(t.get("type")){case"section":if(i=new s.SectionView(a),k.addView(t.get("cid"),i),_.isUndefined(t.get("view"))?void 0!==t.get("after_section")&&""!==t.get("after_section")?k.getView(t.get("after_section")).$el.after(i.render().el):void 0!==t.get("current_row")?this.replaceElement(t.get("current_row"),i):l?this.$el.find('div[data-cid="'.concat(l,'"]')).closest(".et_pb_section").after(i.render().el):this.$el.append(i.render().el):t.get("view").$el.after(i.render().el),"on"===t.get("et_pb_fullwidth")){e(i.render().el).addClass("et_pb_section_fullwidth");var d=new s.ColumnView(a);i.addChildView(d),e(i.render().el).find(".et-pb-section-content").append(d.render().el)}var r;if("on"===t.get("et_pb_specialty")&&"auto"===t.get("created")&&!t.get("pasted_module"))e(i.render().el).addClass("et_pb_section_specialty"),r=new s.ModalView({model:a.model,collection:a.collection,attributes:{"data-open_view":"column_specialty_settings"},et_view:i,view:i}),e("body").append(r.render().el);t.get("pasted_module")||"manually"===t.get("created")||"on"===t.get("et_pb_fullwidth")||"on"===t.get("et_pb_specialty")||i.addRow();break;case"row":case"row_inner":i=new s.RowView(a),""!==t.get("parent")&&k.getView(t.get("parent")).$el.find(".et-pb-insert-row").hide(),k.addView(t.get("cid"),i),_.isUndefined(t.get("current_row"))?_.isUndefined(t.get("appendAfter"))?l?k.getView(t.get("parent")).$el.find('div[data-cid="'.concat(l,'"]')).parent().after(i.render().el):k.getView(t.get("parent")).$el.find(".et-pb-section-content").length?k.getView(t.get("parent")).$el.find(".et-pb-section-content").append(i.render().el):k.getView(t.get("parent")).$el.find("> .et-pb-insert-module, > .et-pb-insert-row").hide().end().append(i.render().el):t.get("appendAfter").after(i.render().el):this.replaceElement(t.get("current_row"),i),t.unset("columns_layout"),"manually"===t.get("created")&&"row_inner"===t.get("module_type")&&t.set("view",k.getView(t.get("parent")),{silent:!0});break;case"column":case"column_inner":a.className="et-pb-column et-pb-column-".concat(t.get("layout")),_.isUndefined(t.get("layout_specialty"))||"1"!==t.get("layout_specialty")||(a.className+=" et-pb-column-specialty"),i=new s.ColumnView(a),k.addView(t.get("cid"),i),_.isUndefined(t.get("layout_specialty"))?(n=void 0!==(o=k.getView(t.get("parent"))).model.get("columns_layout")?"".concat(o.model.get("columns_layout"),",").concat(t.get("layout")):t.get("layout"),o.model.set("columns_layout",n),"on"!==k.getView(t.get("parent")).model.get("et_pb_specialty")?(k.getView(t.get("parent")).$el.find(".et-pb-row-container").append(i.render().el),k.getView(t.get("parent")).toggleInsertColumnButton()):k.getView(t.get("parent")).$el.find(".et-pb-section-content").append(i.render().el)):(k.getView(t.get("parent")).$el.find(".et-pb-section-content").append(i.render().el),"1"===t.get("layout_specialty")&&("manually"!==t.get("created")&&this.collection.add([{type:"row",module_type:"row",cid:k.generateNewId(),parent:t.get("cid"),view:i,admin_label:et_pb_options.noun.row}]),k.getView(t.get("parent")).model.set("specialty_columns",parseInt(t.get("specialty_columns")))));break;case"module":if(a.attributes={"data-cid":t.get("cid")},"advanced"!==t.get("mode")&&"manually"===t.get("created")&&"column_inner"===k.getView(t.get("parent")).model.get("module_type")){var c=k.getView(t.get("parent")).model.get("parent");k.getView(c).$el.find(".et-pb-insert-column").hide()}if(void 0!==t.get("mode")&&"advanced"===t.get("mode"))i=new s.AdvancedModuleSettingView(a),t.attributes.view.child_views.push(i),void 0!==t.get("cloned_cid")&&""!==t.get("cloned_cid")?k.getView(t.get("cloned_cid")).$el.after(i.render().el):k.getView(t.get("parent")).$el.find(".et-pb-sortable-options").append(i.render().el),k.addView(t.get("cid"),i);else{var p="";if(v.trigger("et-new_module:show_settings"),i=new s.BlockModuleView(a),void 0!==t.attributes.view&&"on"===t.attributes.view.model.get("et_pb_fullwidth")?(k.getView(t.get("parent")).addChildView(i),p=k.getView(t.get("parent")).model.get("et_pb_template_type")):void 0!==t.attributes.view&&(p=k.getView(k.getView(t.get("parent")).model.get("parent")).model.get("et_pb_template_type")),l)k.getView(t.get("parent")).$el.find('div[data-cid="'.concat(l,'"]')).after(i.render().el);else if(k.getView(t.get("parent")).$el.find(".et-pb-insert-module").length)k.getView(t.get("parent")).$el.find(".et-pb-insert-module").before(i.render().el);else{var b=k.getView(t.get("parent"));void 0!==b.model.get("et_pb_fullwidth")&&"on"===b.model.get("et_pb_fullwidth")?b.$el.find(".et_pb_fullwidth_sortable_area").append(i.render().el):b.$el.append(i.render().el)}k.addView(t.get("cid"),i),void 0!==p&&"module"===p&&t.set("template_type","module",{silent:!0}),"manually"!==t.get("created")&&(a.attributes={"data-open_view":"module_settings"},this.openModuleSettings(a))}}t.unset("cloned_cid")},openModuleSettings:function(t){var i=this,o=new s.ModalView(t).render();if(!1===o)return setTimeout((function(){i.openModuleSettings(t)}),500),void v.trigger("et-pb-loading:started");v.trigger("et-pb-loading:ended"),e("body").append(o.el)},saveAsShortcode:function(e,t,i){var o=arguments.length>0&&"object"===a(arguments[0])&&arguments[0].et_action||"";if(ne(),!i||"false"!==i.update_shortcodes){var n=this.generateCompleteShortcode();this.addHistory(n),J.update();var s=o||"";ae("content",n,s),v.trigger("et-pb-content-updated")}},getDefaultSectionBackgroundColor:function(){var t=e("#_et_pb_section_background_color").val();return""!==t&&t||(t="#ffffff"),t},getSectionsBackgroundColor:function(){var t=this,i=[];return this.$el.find(".et_pb_section").each((function(){var o=e(this).find(".et-pb-data-cid").data("cid"),n=S($.find((function(e){return e.get("cid")==o})),"attributes.et_pb_background_color","");""!==n&&n||(n=t.getDefaultSectionBackgroundColor()),i.push(n)})),i},generateCompleteShortcode:function(t,i,o,n,a){var s="",l=this,_=void 0===t;i=void 0===i?"":i;return this.$el.find(".et_pb_section").each((function(){var d=e(this).find(".et-pb-section-content"),r=!1,c=void 0!==d.data("skip")&&d.data("skip");(!1===_&&t===d.data("cid")||!0===_)&&!0!==c&&(s+=l.generateModuleShortcode(e(this),!0,i,o),r=!0),d.closest(".et_pb_section").hasClass("et_pb_section_fullwidth")?d.find(".et_pb_module_block").each((function(){var a=e(this).data("cid");(!1!==_||t!==a&&!0!==r)&&!0!==_||(s+=l.generateModuleShortcode(e(this),!1,i,o,"",n))})):!d.closest(".et_pb_section").hasClass("et_pb_section_specialty")||!0!==r&&!0!==_&&"module"!==i&&"row"!==i||!0===c?d.find(".et_pb_row").each((function(){var d=e(this),c=d.find(".et-pb-row-content"),p=c.data("cid"),b=!1,u=void 0!==c.data("skip")&&c.data("skip");(!1!==_||t!==p&&!0!==r)&&!0!==_||!0===u||(s+=l.generateModuleShortcode(e(this),!0,i,o),b=!0),d.find(".et-pb-column").each((function(){var d=e(this),c=d.data("cid");$.findWhere({cid:c});(!1!==_||!0!==r&&!0!==b)&&!0!==_||!0===u||(s+=l.generateModuleShortcode(e(this),!0,i,o,"column")),d.find(".et_pb_module_block").each((function(){var d=e(this).data("cid");(!1!==_||t!==d&&!0!==r&&!0!==b)&&!0!==_||(s+=l.generateModuleShortcode(e(this),!1,i,o,"",n,a))})),(!1!==_||!0!==r&&!0!==b)&&!0!==_||!0===u||(s+="[/et_pb_column]")})),(!1!==_||t!==p&&!0!==r)&&!0!==_||!0===u||(s+="[/et_pb_row]")})):d.find("> .et-pb-column").each((function(){var d=e(this),c=d.data("cid"),p=$.findWhere({cid:c}),b="1"===p.get("layout_specialty")?' specialty_columns="'.concat(p.get("specialty_columns"),'"'):"",u=p.get("layout");!0!==r&&!0!==_||(s+='[et_pb_column type="'.concat(u,'"').concat(b,"]")),d.hasClass("et-pb-column-specialty")?d.find(".et_pb_row").each((function(){var a=e(this),d=a.find(".et-pb-row-content").data("cid"),c=($.findWhere({cid:d}),!1);(!0===r||!0===_||"row"===i&&d===t)&&(c=!0,s+=l.generateModuleShortcode(e(this),!0,i,o,"row_inner")),a.find(".et-pb-column").each((function(){var a=e(this),d=a.data("cid");$.findWhere({cid:d});!0===c&&(s+=l.generateModuleShortcode(e(this),!0,i,o,"column_inner",!1,!1,u)),a.find(".et_pb_module_block").each((function(){var a=e(this).data("cid");(!1!==_||t!==a&&!0!==r&&!0!==c)&&!0!==_||(s+=l.generateModuleShortcode(e(this),!1,i,o,"",n))})),!0===c&&(s+="[/et_pb_column_inner]")})),(!0===r||!0===_||"row"===i&&d===t)&&(s+="[/et_pb_row_inner]")})):d.find(".et_pb_module_block").each((function(){var d=e(this).data("cid");(!1!==_||t!==d&&!0!==r)&&!0!==_||(s+=l.generateModuleShortcode(e(this),!1,i,o,"",n,a))})),!0!==r&&!0!==_||(s+="[/et_pb_column]")})),(!1===_&&t===d.data("cid")||!0===_)&&!0!==c&&(s+="[/et_pb_section]")})),s},generateModuleShortcode:function(t,i,o,n,a,l,d,r){var c,p,b,u,g="",f="",m=t,v=!(m.is(".et_pb_section")||m.is(".et_pb_row")||m.is(".et_pb_row_inner")||m.is(".et_pb_column")||m.is(".et_pb_column_inner")),w=m.is(".et_pb_section")||m.is(".et_pb_row")||m.is(".et_pb_row_inner")?"et_pb_":"",y=void 0===m.data("cid")?m.find(".et-pb-data-cid").data("cid"):m.data("cid"),C=$.find((function(e){return e.get("cid")==y})),S=void 0!==C?C.get("module_type"):"undefined",x=[];if(void 0!==a&&""!==a&&(S=a),void 0!==C){if("section"===(p=C.attributes).type){var j=parseInt(C.attributes._address),T=j-1,V=j+1,U=this.getSectionsBackgroundColor(),O=_.isUndefined(p.et_pb_background_color)?this.getDefaultSectionBackgroundColor():p.et_pb_background_color,A=_.isUndefined(U[T])?"":U[T],M=_.isUndefined(U[V])?"":U[V],L=s.Helpers.moduleHasBackground(p,["gradient","image","video"]);A!==O||L||(A="#000000"),p.et_pb_prev_background_color=A,M!==O||L||(M="#000000"),p.et_pb_next_background_color=M}for(var E in c="module"===et_pb_options.layout_type&&"global"===et_pb_options.is_global_template||d&&v&&!_.isUndefined(p.et_pb_global_module),d&&v&&void 0!==p.et_pb_global_module&&(x=_.isEmpty(h[p.et_pb_global_module])?[]:h[p.et_pb_global_module]),p){if(!_.isEmpty(x)){var D=-1!==e.inArray(E,["et_pb_content","et_pb_raw_content"])?"et_pb_content_field":E.replace("et_pb_","");if(-1!==e.inArray(D,x))continue}if((void 0===n||"ignore_global"!==n||void 0!==n&&"ignore_global"===n&&"et_pb_global_module"!==E&&"et_pb_global_parent"!==E)&&(void 0===l||"ignore_global_tabs"!==l||void 0!==l&&"ignore_global_tabs"===l&&"et_pb_saved_tabs"!==E)){var I,P=E;if(_.includes(["et_pb_fb_built","et_pb_bb_built","_address"],P))continue;if(-1===P.indexOf("et_pb_")&&"admin_label"!==P)continue;if(I=void 0!==C.get(P)?C.get(P):"","et_pb_content"===P||"et_pb_raw_content"===P){f=I,"et_pb_raw_content"===P&&(f=f.replace(/\r?\n|\r/g,"\x3c!-- [et_pb_line_break_holder] --\x3e")),f=f.trim();var R=JSON.parse(et_pb_options.et_builder_modules_with_children);_.includes(_.keys(R),C.get("module_type"))||""===f||"et_pb_content"!==P||(f="\n\n".concat(f,"\n\n"))}else if(""!==I||c){if(void 0!==p.module_defaults&&void 0!==p.module_defaults[P])if(p.module_defaults[P]==="".concat(I)&&!c){delete C.attributes[P];continue}P=P.replace("et_pb_",""),"string"==typeof I&&(I=(I=I.replace(/\"/g,"%22").replace(/\\/g,"%92")).replace(/\[/g,"%91").replace(/\]/g,"%93")),"et_pb_contact_form"===S&&"custom_message"===P&&(I=_.escape(I.replace(/\r?\n|\r/g,"||et_pb_line_break_holder||")));/^(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}[\.]{0,1}/.test(I)&&(I=_.escape(_.unescape(I))),"admin_label"===P?I!==k.getDefaultAdminLabel(p.module_type)&&(g=" ".concat(P,'="').concat(I,'"').concat(g)):g+=" ".concat(P,'="').concat(I,'"')}}}return u="section"!==S&&"row"!==S?"module":S,u="row_inner"===S?"row":u,void 0!==o&&o===u&&(g+=' template_type="'.concat(o,'"')),void 0!==p.template_type&&(g+=' template_type="'.concat(p.template_type,'"')),"section"===S&&(g=' bb_built="1"'.concat(g)),_.includes(["column","column_inner"],S)&&(g=' type="'.concat(C.get("layout"),'"').concat(g),w="et_pb_","column_inner"===S&&(g+=' saved_specialty_column_type="'.concat(r,'"'))),b="[".concat(w).concat(S).concat(g),""===f&&void 0!==p.type&&"module"===p.type?(i=!0,b+=" /]"):b+="]",i||(b+="".concat(f,"[/").concat(w).concat(S,"]")),b}},makeSectionsSortable:function(){var t=this;this.$el.sortable({items:"> *:not(#et_pb_layout_controls, #et_pb_main_container_right_click_overlay, #et-pb-histories-visualizer, #et-pb-histories-visualizer-overlay)",cancel:".et-pb-settings, .et-pb-clone, .et-pb-remove, .et-pb-section-add, .et-pb-row-add, .et-pb-insert-module, .et-pb-insert-column, .et_pb_locked, .et-pb-disable-sort",delay:100,update:function(i,o){if(V.isLoading)t.$el.sortable("cancel");else{if(J.is_active()){var n=e(o.item).children(".et-pb-section-content").attr("data-cid");if(!J.is_user_has_permission(n,"section"))return J.alert("has_no_permission"),t.$el.sortable("cancel"),void Ue()}t.allowHistorySaving("moved","section"),v.trigger("et-sortable:update")}},start:function(t,o){if(i(),t.altKey){var n=k.getView(e(o.item).children(".et-pb-section-content").data("cid")),a={model:n.model,view:n.$el,view_event:t},l=new s.RightClickOptionsView(a,!0);l.copy(t,!0),l.pasteAfter(t,void 0,void 0,void 0,!0,!0),V.allowHistorySaving("cloned","section")}}})},reInitialize:function(){var e=ee("content"),t=""==e,i=et_pb_options.default_initial_column_type,o=et_pb_options.default_initial_text_module;v.trigger("et-pb-loading:started"),this.removeAllSections(),-1===e.indexOf("[et_pb_section")&&(t||(e='[et_pb_column type="'.concat(i,'"][').concat(o,"]").concat(e,"[/").concat(o,"][/et_pb_column]")),e="[et_pb_section][et_pb_row]".concat(e,"[/et_pb_row][/et_pb_section]")),this.createNewLayout(e),v.trigger("et-pb-loading:ended")},removeAllSections:function(t){k.set("forceRemove",!0),this.$el.find(".et-pb-section-content").each((function(){var t=e(this),i=k.getView(t.data("cid"));void 0!==i&&i.removeSection(!1,!0)})),k.set("forceRemove",!1),t&&("[et_pb_section][et_pb_row][/et_pb_row][/et_pb_section]",this.createNewLayout("[et_pb_section][et_pb_row][/et_pb_row][/et_pb_section]"))},createNewLayout:function(e,t){t=t||"";this.stopListening(this.collection,"change reset add",this.saveAsShortcode),e=V.codeModuleContentPrep(e),"load_layout"===t&&void 0!==window.switchEditors&&(e=qe(window.switchEditors.wpautop(e))),e=V.codeModuleContentUnPrep(e),this.createLayoutFromContent(e),this.saveAsShortcode({et_action:t}),this.listenTo(this.collection,"change reset add",_.debounce(this.saveAsShortcode,128))},replaceElement:function(e,t){var i=k.getView(e);i.$el.after(t.render().el),i.model.destroy(),k.removeView(e),i.remove()},showRightClickOptions:function(e){e.preventDefault();var t={model:{attributes:{type:"app",module_type:"app"}},view:this.$el,view_event:e};new s.RightClickOptionsView(t)},hideRightClickOptions:function(e){e.preventDefault(),i()},recalculateModulesOrder:function(){this.collection;this.order_modules_array=[],this.order_modules_array.children_count=[],this.$el.find(".et_pb_section").each((function(t){var i=e(this).find(".et-pb-section-content"),o=i.data("cid");V.setModuleOrder(o),V.setModuleAddresses(o,t),i.closest(".et_pb_section").hasClass("et_pb_section_fullwidth")?i.find(".et_pb_module_block").each((function(){var t=e(this).data("cid");V.setModuleOrder(t)})):i.closest(".et_pb_section").hasClass("et_pb_section_specialty")?i.find("> .et-pb-column").each((function(){var t=e(this),i=t.data("cid");V.setModuleOrder(i),t.hasClass("et-pb-column-specialty")?t.find(".et_pb_row").each((function(){var t=e(this),i=t.find(".et-pb-row-content").data("cid");V.setModuleOrder(i),t.find(".et-pb-column").each((function(){var t=e(this),i=t.data("cid");V.setModuleOrder(i),t.find(".et_pb_module_block").each((function(){var t=e(this).data("cid");V.setModuleOrder(t)}))}))})):t.find(".et_pb_module_block").each((function(){var t=e(this).data("cid");V.setModuleOrder(t,"specialty")}))})):i.find(".et_pb_row").each((function(){var t=e(this),i=t.find(".et-pb-row-content").data("cid");V.setModuleOrder(i),t.find(".et-pb-column").each((function(){var t=e(this),i=t.data("cid");V.setModuleOrder(i),t.find(".et_pb_module_block").each((function(){var t=e(this).data("cid");V.setModuleOrder(t)}))}))}))}))},parseShortcode:function(i,o,n){var a=document.documentMode,s="et-fb-preview-".concat(Date.now(),"-").concat(Math.floor(1e3*Math.random()+1)),l="".concat(et_pb_options.preview_url,"&et_pb_preview=true&et_pb_preview_nonce=").concat(et_pb_options.et_pb_preview_nonce,"&iframe_id=").concat(s);setTimeout((function(){var d=e('*[data-shortcode-id="'.concat(n,'"]')),r=d.length?"".concat(d.width(),"px"):"100%",c=t("<iframe />",{id:s,src:l,style:"position: absolute; bottom: 0; left: 0; opacity: 0; pointer-events: none; width:".concat(r,"; height: 100%;")}),p=!1,b={et_pb_preview_nonce:et_pb_options.et_pb_preview_nonce,shortcode:i,post_title:e("#title").val(),post_id:et_pb_options.postId};e("body").append(c),c.on("load",(function(){if(!p){var e=document.getElementById(s);!_.isUndefined(a)&&a<10&&(b=JSON.stringify(b)),e.contentWindow.postMessage(b,l),p=!0;var t=window.addEventListener?"addEventListener":"attachEvent";(0,window[t])("attachEvent"==t?"onmessage":"message",(function(e){e.data.iframe_id===s&&_.isString(e.data.html)&&(o(e.data),c.remove())}),!1)}}))}),0)},updateYoastContent:function(){if(Be()){var t=ee("content",!0),i=e("#yoast-readability-analysis-collapsible-metabox");e(".et-pb-yoast-loading").remove(),i.find("svg").first().after('<svg class="yoast-svg-icon et-pb-yoast-loading yoast-svg-icon-loading-spinner SvgIcon__StyledSvg-jBzRth mPAyu" aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 66 66" fill="#64a60a" style="position: absolute; background: #fff; border-radius: 5px; max-width: 18px;"><circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle></svg>'),this.parseShortcode(t,(function(e){var t=_.isUndefined(e.html)?"":e.html;F=t,YoastSEO.app.pluginReloaded("ET_PB_Yoast_Content")}),"yoast_preview_content")}},setModuleOrder:function(e,t){var i,o,n,a,s,l,_=JSON.parse(et_pb_options.et_builder_modules_with_children);if(void 0!==(i=$.findWhere({cid:e}))){if("column"!==(a=void 0!==i.attributes.module_type?i.attributes.module_type:i.attributes.type)&&"column_inner"!==a&&"specialty"!==t||(n=$.findWhere({cid:i.attributes.parent}),"column"===a&&"row_inner"===n.attributes.module_type&&(a="column_inner")),o=void 0!==this.order_modules_array[a]?this.order_modules_array[a]:0,i.attributes.module_order=o,"row"!==a&&"row_inner"!==a&&"section"!==a||void 0===i.attributes.columns_order||(i.attributes.columns_order=[]),"column"!==a&&"column_inner"!==a&&"specialty"!==t||(void 0!==n.attributes.columns_order?n.attributes.columns_order.push(o):n.attributes.columns_order=[o]),void 0!==_[a]){if(l=_[a],s=void 0!==this.order_modules_array.children_count[l]?this.order_modules_array.children_count[l]:0,i.attributes.child_start_from=s,void 0!==i.attributes.et_pb_content&&""!==i.attributes.et_pb_content){var d=V.getShortCodeChildTags(),r=window.wp.shortcode.regexp(d),c=i.attributes.et_pb_content.match(r);s+=null!==c?c.length:0}this.order_modules_array.children_count[l]=s}this.order_modules_array[a]=o+1}},setModuleAddresses:function(e,t,i){var o=$.findWhere({cid:e}),n=$.where({parent:e});if(!_.isUndefined(o)){var a=_.isUndefined(o.attributes.module_type)?o.attributes.type:o.attributes.module_type,s=o.get("_address"),l="section"===a?t.toString():"".concat(i,".").concat(t.toString()),d=!_.isUndefined(s)&&"et_pb_module_settings_migrations.value_changes.".concat(s),r=!!d&&x(et_pb_options,d),c=x(et_pb_options,"et_pb_module_settings_migrations.name_changes")&&!_.isUndefined(et_pb_options.et_pb_module_settings_migrations.name_changes[s]);l!==s&&(r&&(et_pb_options.et_pb_module_settings_migrations.value_changes[l]=_.clone(et_pb_options.et_pb_module_settings_migrations.value_changes[s]),delete et_pb_options.et_pb_module_settings_migrations.value_changes[s]),c&&(et_pb_options.et_pb_module_settings_migrations.name_changes[l]=_.clone(et_pb_options.et_pb_module_settings_migrations.name_changes[s]),delete et_pb_options.et_pb_module_settings_migrations.name_changes[s])),o.set({_address:l}),!_.isUndefined(n)&&n.length>0&&_.forEach(n,(function(e,t){V.setModuleAddresses(e.attributes.cid,t,l)}))}},updateAdvancedModulesOrder:function(t){var i,o=void 0!==t?t.find(".et-pb-option-advanced-module-settings"):e(".et-pb-option-advanced-module-settings"),n=0;o.length&&(i=o.find(".et-pb-sortable-options > li")).length&&i.each((function(){var t,i,o,a=e(this).data("cid");t=$.findWhere({cid:a}),o=void 0!==(i=$.findWhere({cid:t.attributes.parent_cid})).attributes.child_start_from?i.attributes.child_start_from:0,t.attributes.module_order=n+o,n++}))}}),s.Controls={},s.Controls.BorderRadiusControl=function(e){this.initialize(e)},e.extend(s.Controls.BorderRadiusControl.prototype,{initialize:function(e){if(this._container=e,this._setting_field=e.siblings(".et-pb-main-setting"),!this._setting_field.length)return!1;this._link_button=e.find(".et-pb-border-radius-wrap-link-button > a"),this._radius_fields=e.find(".et-pb-border-radius-option-input"),this._radius_preview=e.find(".et-pb-border-radius-preview"),this._defalut_value=_.isUndefined(this._setting_field.data("default_inherited"))?this._setting_field.data("default"):this._setting_field.data("default_inherited");var t=this._setting_field.val();if(_.isEmpty(t)){t=this._defalut_value,this._setting_field.val(this._defalut_value);var i=this._setting_field;setTimeout((function(){i.trigger("et_pb_setting:change")}),100)}var o=t;this._values=this._splitValue(o),this._lastValue="",this._setting_field.on("change",this._onSettingChange.bind(this)),this._radius_fields.on("change",this._onFieldChange.bind(this)),this._link_button.on("click",this._onClickLink.bind(this)),this._render()},_onClickLink:function(e){if(e.preventDefault(),e.stopPropagation(),this._getSettingValue("border-link")){var t=this._getValues();t["border-link"]=!1,this._onChange(this._combineValues(t))}else{""===this._lastValue&&(this._lastValue=this._getSettingValue("top-left"));var i=this._spreadValue(this._lastValue);this._onChange(this._combineValues(i))}},_onSettingChange:function(e){var t=_.isUndefined(e.target.value)||""===e.target.value?this._getDefaultValue():e.target.value;this._values=this._splitValue(t),this._render()},_onChange:function(t){var i=_.isUndefined(t)?this._getDefaultValue():t;e(this._setting_field).val(i),this._values=this._splitValue(i),e(this._setting_field).trigger("et_pb_setting:change"),this._render()},_isOn:function(e){return"on"===e},_isLinkedMode:function(){return this._getSettingValue("border-link")},_spreadValue:function(e){return{"border-link":!0,"top-left":e,"top-right":e,"bottom-right":e,"bottom-left":e}},_onFieldChange:function(e){var t,i=Se(e.target.value,!1);if(this._lastValue=i,this._isLinkedMode())t=this._spreadValue(i);else{var o=e.target.getAttribute("data-corner");(t=this._getValues())[o]=i}this._onChange(this._combineValues(t))},_getDefaultValue:function(){return _.isUndefined(this._defalut_value)||""===this._defalut_value?"on||||":this._setting_field.val()},_getValues:function(){return this._values},_getSettingValue:function(e){return this._getValues()[e]},_splitValue:function(e){var t=e.split("|");return{"border-link":!!_.isUndefined(t[0])||this._isOn(t[0]),"top-left":_.isUndefined(t[1])||""===t[1]?"0px":t[1],"top-right":_.isUndefined(t[2])||""===t[2]?"0px":t[2],"bottom-right":_.isUndefined(t[3])||""===t[3]?"0px":t[3],"bottom-left":_.isUndefined(t[4])||""===t[4]?"0px":t[4]}},_combineValues:function(e){return"".concat(e["border-link"]?"on":"off","|").concat(e["top-left"],"|").concat(e["top-right"],"|").concat(e["bottom-right"],"|").concat(e["bottom-left"])},_render:function(){_.each(this._radius_fields,(function(t){e(t).val(this._getSettingValue(e(t).data("corner")))}),this),e(this._link_button).toggleClass("active",this._getSettingValue("border-link")),e(this._radius_preview).css("border-top-left-radius",this._getSettingValue("top-left")),e(this._radius_preview).css("border-top-right-radius",this._getSettingValue("top-right")),e(this._radius_preview).css("border-bottom-right-radius",this._getSettingValue("bottom-right")),e(this._radius_preview).css("border-bottom-left-radius",this._getSettingValue("bottom-left"))}}),s.Controls.BorderRadius=function(t){var i=t.find(".et-pb-border-radius-wrap");i.length&&i.each((function(){new s.Controls.BorderRadiusControl(e(this))}))},s.Controls.TabbedControl=function(e){this.initialize(e)},e.extend(s.Controls.TabbedControl.prototype,{_getByPath:function(e,t){return _.reduce(t.split("."),(function(e,t){return e?e[t]:void 0}),e)},initialize:function(t){var i=t.find(".et-pb-settings-tab"),o=t.find(".et-pb-settings-tab-content");if(!i.length||!o.length)return!1;var n=this;this._$container=t,this._suffix=t.data("attr-suffix"),this._tabs={},this._tab_content={},this._first_tab=null,this._active_tab=null,this._tab_settings_map=null,this._outside_preview=t.find(".et-pb-outside-preview-container"),this._reset_button=t.closest(".et-pb-composite-tabbed-wrapper").siblings(".et-pb-composite-tabbed-reset-setting"),this._is_child_settings_container=t.parents(".et_pb_modal_settings_container").hasClass("et_pb_modal_settings_container_step2"),i.each((function(){var t=e(this).find(".et-pb-settings-tab-title");n._tabs[e(t).data("tab")]=t,t.length&&t.on("click",n._onClickTab.bind(n))})),o.each((function(t,i){var o=e(i).data("tab");n._tab_content[o]={content:this,"preview-area":e(i).find(".et-pb-tab-preview-container")},0===t&&(n._first_tab=o,n._active_tab=o)})),setTimeout((function(){n._buildTabSettingsMap(),e(o).on("et_pb_setting:change et_pb_setting:color_picker:change",n._onChangeHandler.bind(n)),e(o).on("change","select",n._onChangeHandler.bind(n)),e(n._reset_button).on("click",n._onClickReset.bind(n)),n._render()}),100)},_buildTabSettingsMap:function(){var t={};_.map(this._tab_content,(function(i,o){t[o]={};var n=!1;e(i.content).find(".et-pb-main-setting").each((function(i,a){var l=ve(e(a)),_=e(a).parents(".et-pb-composite-tabbed-option").data("control-index");t[o][_]={},t[o][_].default=l,t[o][_].value=s.Helpers.getSettingValue(e(a)),n=n||!we(e(a))})),_.contains(["top_divider","bottom_divider"],o)?t[o].modified=t[o]["".concat(o,"_style")].value!==t[o]["".concat(o,"_style")].default:t[o].modified=n})),this._tab_settings_map=t},_isAnySettingModified:function(){var e=!1;return _.map(this._tab_settings_map,(function(t){this._getByPath(t,"modified")&&(e=!0)}),this),e},_onChangeHandler:function(e){setTimeout(this._onSettingChange.bind(this),100)},_onSettingChange:function(){this._buildTabSettingsMap(),this._render()},_onClickTab:function(e){e.preventDefault();var t=e.target.getAttribute("data-tab");this._makeTabActive(t),this._render()},_onClickReset:function(){var e=this;_.map(this._tab_settings_map,(function(t){_.map(t,(function(t,i){e._$container.find('[data-control-index="'.concat(i,'"]')).find(".et-pb-reset-setting").trigger("click")}),this)})),this._active_tab=this._first_tab},_makeTabActive:function(e){this._active_tab=e},_showTab:function(t){e(this._tabs[t]).closest(".et-pb-settings-tab").addClass("active"),e(this._tab_content[t].content).show()},_hideTab:function(t){e(this._tabs[t]).closest(".et-pb-settings-tab").removeClass("active"),e(this._tab_content[t].content).hide()},_renderOutsidePreviewArea:function(e){return!1},_renderTabPreviewArea:function(e,t){return!1},_render:function(){this._renderOutsidePreviewArea(this._outside_preview),this._renderTabPreviewArea(this._active_tab,this._tab_content[this._active_tab]["preview-area"]),_.map(this._tabs,(function(t,i){i===this._active_tab?this._showTab(i):this._hideTab(i),this._tab_settings_map[i].modified?e(this._tabs[i]).closest(".et-pb-settings-tab").addClass("modified"):e(this._tabs[i]).closest(".et-pb-settings-tab").removeClass("modified")}),this),this._isAnySettingModified()?e(this._reset_button).addClass("et-pb-reset-icon-visible"):e(this._reset_button).removeClass("et-pb-reset-icon-visible")}}),s.Controls.Tabbed=function(t){var i=t.find(".et-pb-composite-tabbed");i.length&&i.each((function(){new s.Controls.TabbedControl(e(this))}))},s.Controls.BorderStylesControl=function(e){this._setting_values=null,this._had_previously_resetted=!1,this.initialize(e)},e.extend(s.Controls.BorderStylesControl.prototype,s.Controls.TabbedControl.prototype,{_processWidth:function(e){var t=parseInt(e);return t>50&&(t=50),Se(t.toString(),!1,"px")},_setControlInitials:function(e){var t=e.parents(".et-pb-composite-tabbed-option").data("control-index");this._setting_values[t]={};var i=e.data("saved_value"),o=me(e),n="",a="",s="";if(e.hasClass("et-pb-range")){var l=e.siblings(".et-pb-range-input");a=l.data(o),s=l.data("default_inherited"),n=l.val(),l.data("check_attr_default","yes")}else n=e.val(),a=e.data(o),s=e.data("default_inherited"),e.data("check_attr_default","yes");var d=_.isUndefined(a)?"":a,r="",c=(r=_.isUndefined(i)?n:_.isEmpty(i)?n===a?a:"":i)!==d;_.isEmpty(s)||(_.isEmpty(r)||r===s)&&(c=!1),_.isEmpty(s)||a===s||c||this._updateControl(e,a,!1),this._setting_values[t].saved_value=c?r:"",this._setting_values[t].default_value=a,this._setting_values[t].default_inherited=s,this._setting_values[t].control=e;var p=t.replace(this._suffix,"").lastIndexOf("_"),b=t.substr(p).replace(this._suffix,"");this._setting_values[t].tab="border".concat(b);var u=this._tab_settings_map["border".concat(b)].modified;this._tab_settings_map["border".concat(b)].modified=u||c},_recalculateEdgeSettings:function(e){if(-1!==e.indexOf("all")){var t=e.replace(this._suffix,"").lastIndexOf("_"),i=e.substr(0,t),o=this;_.map(this._setting_values,(function(t,n){if(-1!==n.indexOf(i)&&-1===n.indexOf("all")){var a=t.control,s=_.isEmpty(o._setting_values[e].saved_value)?o._setting_values[e].default_value:o._setting_values[e].saved_value;if(_.isEmpty(t.default_inherited))t.default_value=s,_.isEmpty(t.saved_value)?o._updateControl(a,s,s):o._updateControl(a,!1,s);else{s=o._setting_values[e].saved_value;var l=o._setting_values[e].default_value;if(_.isEmpty(t.saved_value))if(_.isEmpty(s))if(_.isEmpty(t.saved_default))t.default_value===t.default_inherited?(t.default_value=l,o._updateControl(a,l,l)):o._updateControl(a,t.default_value,!1);else{var d=t.saved_default;t.default_value=d,o._updateControl(a,d,d),t.saved_default=""}else _.isEmpty(t.saved_default)&&(t.saved_default=t.default_value),t.default_value=s,o._updateControl(a,s,s);else{var r=_.isEmpty(s)?l:s;t.default_value=r,o._updateControl(a,t.saved_value,r)}}}}))}},_onSettingChange:function(e,t,i){var o=i?"":s.Helpers.getSettingValue(e);this._updateSetting(t,o),this._recalculateEdgeSettings(t)},_onChangeHandler:function(t,i){if(_.isUndefined(i)||"et_pb_from_all_tab"!==i){var o=e(t.target),n=o.parents(".et-pb-composite-tabbed-option").data("control-index"),a=!_.isUndefined(i)&&"et_pb_reset_setting"===i;this._had_previously_resetted?this._had_previously_resetted=!1:(a&&(this._had_previously_resetted=!0),"et_pb_setting:color_picker:change"===t.type?(this._updateSetting(n,i),this._recalculateEdgeSettings(n)):-1===n.indexOf("color")&&this._onSettingChange(o,n,a),this._render())}},_updateSetting:function(e,t){var i=this,o=this._setting_values[e],n=t!==o.default_value;o.saved_value=n?t:"";var a=o.tab,s=!1;_.map(this._tab_settings_map[a],(function(e,t){if("modified"!==t){var o=i._setting_values[t].saved_value,a=i._setting_values[t].default_value;n=!_.isEmpty(o)&&o!==a,s=s||n}})),this._tab_settings_map[a].modified=s},_updateControl:function(e,t,i){var o=me(e),n=e.hasClass("et-pb-range"),a=null;n&&(a=e.siblings(".et-pb-range-input")),i&&(n?(a.data(o,i),e.data(o,parseFloat(i)||0)):e.data(o,i)),t&&(n&&(e.val(parseFloat(t)||0),e=a),e.val(t).trigger("change",["et_pb_from_all_tab"]))},_resetAllTab:function(){var e=this;_.map(this._setting_values,(function(t,i){-1!==i.indexOf("all")&&(t.saved_value="",e._updateControl(t.control,t.default_value,!1),e._recalculateEdgeSettings(i))}))},_resetEdgeTabs:function(){_.map(this._setting_values,(function(e,t){-1===t.indexOf("all")&&(_.isEmpty(e.default_inherited)?e.default_value="":_.isEmpty(e.saved_default)||(e.default_value=e.saved_default,e.saved_default=""),e.saved_value="")}))},_onClickReset:function(){this._is_child_settings_container?(this._resetAllTab(),this._resetEdgeTabs()):(this._resetEdgeTabs(),this._resetAllTab()),this._active_tab=this._first_tab,this._render()},_buildTabSettingsMap:function(){var t=this,i={};_.map(this._tab_content,(function(t,o){i[o]={},e(t.content).find(".et-pb-main-setting").each((function(t,n){var a=e(n).parents(".et-pb-composite-tabbed-option").data("control-index");i[o][a]={}})),i[o].modified=!1})),this._tab_settings_map=i,null===this._setting_values&&(this._setting_values={},_.map(this._tab_content,(function(i,o){"border_all"!==o&&e(i.content).find(".et-pb-main-setting").each((function(i,o){t._setControlInitials(e(o))}))})),e(this._tab_content.border_all.content).find(".et-pb-main-setting").each((function(i,o){t._setControlInitials(e(o));var n=e(o).parents(".et-pb-composite-tabbed-option").data("control-index");t._recalculateEdgeSettings(n)})))},_renderTabPreviewArea:function(e,t){var i=["width","style","color"],o={};_.forEach(["top","right","bottom","left"],(function(e){var t="";_.forEach(i,(function(i){var o="border_".concat(i,"_").concat(e).concat(this._suffix),n=_.isEmpty(this._setting_values[o].saved_value)?this._setting_values[o].default_value:this._setting_values[o].saved_value;"width"==i&&(n=this._processWidth(n)),t+=" ".concat(n)}),this),o["border-".concat(e)]=t}),this),_.map(o,(function(e,i){t.find(".et-pb-tab-preview-container-preview").css(i,e)}),this)}}),s.Controls.BorderStyles=function(t){var i=t.find(".et-pb-composite-tabbed-border-style");i.length&&i.each((function(){new s.Controls.BorderStylesControl(e(this))}))},e("body").on("click contextmenu","#et_pb_layout_right_click_overlay",(function(e){e.preventDefault(),i()}));var u,v=_.extend({},Backbone.Events),k=new s.Layout,$=new s.Modules,T=new s.Histories,V=new s.AppView({model:s.Module,collection:$,history:T}),U=new s.visualizeHistoriesView,O=e("#et_pb_hidden_editor"),A=(O.html(),e("#et_pb_toggle_builder")),M=e(".et_pb_toggle_builder_wrapper"),L=e("#et_pb_layout"),E=e("#et_pb_old_content"),D=e("#formatdiv"),I=e("#et_pb_use_builder"),P=e("#et_pb_main_editor_wrap"),R=e(".et_pb_page_setting"),H=e(".et_pb_page_layout_settings"),N=[],B=0,z=0,F=!1,W={};s.Events=v;var J={is_active:function(){return!(!e("#et_pb_use_ab_testing").length||"on"!==e("#et_pb_use_ab_testing").val())},toggle_status:function(t){var i=e("#et_pb_use_ab_testing"),o=i.val();t=!_.isUndefined(t)&&t;("on"===o&&!t||("off"===o||""===o)&&t)&&i.addClass("et_pb_value_updated"),ne(),t?(i.val("on"),this.toggle_portability(!1)):i.val("off")},toggle_portability:function(t){var i=e(".et-pb-app-portability-button"),o="et-core-disabled",n=i.hasClass(o);_.isUndefined(t)&&(t=!!n),t?i.removeClass(o):i.addClass(o)},get_stats_refresh_interval:function(){return e("#et_pb_ab_stats_refresh_interval").length?e("#et_pb_ab_stats_refresh_interval").val():"hourly"},get_shortcode_tracking_status:function(){return e("#_et_pb_enable_shortcode_tracking").length&&""!==e("#_et_pb_enable_shortcode_tracking").val()?e("#_et_pb_enable_shortcode_tracking").val():"off"},is_active_based_on_models:function(){var e=$.where({et_pb_ab_subject:"on"}),t=$.where({et_pb_ab_goal:"on"});return e.length>1&&t.length>0},has_permission:function(){return"1"===et_pb_ab_js_options.has_permission},check_create_db:function(){return"exists"!==et_pb_options.ab_db_status&&e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_create_ab_tables",et_pb_ab_nonce:et_pb_options.ab_testing_builder_nonce},success:function(e){if(!e.length||"success"!==e)return!1;et_pb_options.ab_db_status="exists"}}),!0},is_selecting_subject:function(){return!_.isUndefined(V.is_selecting_ab_testing_subject)&&!0===V.is_selecting_ab_testing_subject},is_selecting_goal:function(){return!_.isUndefined(V.is_selecting_ab_testing_goal)&&!0===V.is_selecting_ab_testing_goal},is_selecting_winner:function(){return!_.isUndefined(V.is_selecting_ab_testing_winner)&&!0===V.is_selecting_ab_testing_winner},is_selecting:function(){return!!(this.is_selecting_subject()||this.is_selecting_goal()||this.is_selecting_winner())},is_subject:function(e){return!(!this.is_active()||k.is_app(e)||!e.has("et_pb_ab_subject")||"on"!==e.get("et_pb_ab_subject"))},is_subject_children:function(e){var t=k.getParentViews(e.attributes.parent),i=!1;return _.isEmpty(t)||_.each(t,(function(e){_.isUndefined(e.model.get("et_pb_ab_subject"))||"on"!==e.model.get("et_pb_ab_subject")||(i=!0)})),i},is_unremovable_subject:function(e){return!!(this.is_active()&&this.is_subject(e)&&this.subjects().length<3)},is_goal:function(e){return!(!this.is_active()||k.is_app(e)||!e.has("et_pb_ab_goal")||"on"!==e.get("et_pb_ab_goal"))},is_goal_children:function(e){var t=k.getParentViews(e.attributes.parent),i=!1;return _.isEmpty(t)||_.each(t,(function(t){!k.is_app(e)&&t.model.has("et_pb_ab_goal")&&"on"===t.model.get("et_pb_ab_goal")&&(i=!0)})),i},is_user_has_permission:function(e,t,i){if(!e)return!1;var o,n=k.getView(e),a=(i=_.isUndefined(i)?n.model:i,J.has_permission()),s=J.is_subject(i),l=J.is_subject_children(i),d=J.has_subject(i),r=J.is_goal(i),c=J.is_goal_children(i),p=J.has_goal(i);return o="section"===t?s||d||r||p:"module"===t||"add_module"===t?s||l||r||c:"add_row"===t||"paste"===t?l||c:"copy"===t?s||d||r||p:s||l||d||r||c||p,!(!a&&o)},is_ab_testing_item:function(e){return!!(this.is_subject(e)||this.is_subject_children(e)||this.has_subject(e)||this.is_goal(e)||this.is_goal_children(e)||this.has_goal(e))},filter_goals:function(e){return _.filter(e,(function(e){return!(!e.has("et_pb_ab_goal")||"on"!==e.get("et_pb_ab_goal"))}))},filter_subjects:function(e){return _.filter(e,(function(e){return!(!e.has("et_pb_ab_subject")||"on"!==e.get("et_pb_ab_subject"))}))},filter_models_by_cids:function(t,i){return i=_.isUndefined(i)?$.models:i,_.filter(i,(function(i){return-1!==e.inArray(i.get("parent"),t)}))},pluck_cids_from_models:function(e){var t=[];return _.each(e,(function(e){t.push(e.get("cid"))})),t},has_goal:function(e){var t="function"==typeof e.get&&e.get("cid"),i=!1;return this.is_active()&&!1!==t&&_.each(k.getChildrenViews(t),(function(e){"on"===e.model.get("et_pb_ab_goal")&&(i=!0)})),i},has_subject:function(e){var t="function"==typeof e.get&&e.get("cid"),i=!1;return this.is_active()&&_.each(k.getChildrenViews(t),(function(e){"on"===e.model.get("et_pb_ab_subject")&&(i=!0)})),i},has_unremovable_subject:function(e){var t,i,o,n,a,s,l=e.get("cid"),d=e.get("type"),r=[],c=[];if(this.is_active()){if("section"===d){if(t=$.where({parent:l}),i=this.filter_subjects(t),this.count_subjects()-i.length<2)return!0;if(r=this.pluck_cids_from_models(t),!_.isUndefined(e.get("et_pb_specialty"))&&"on"===e.get("et_pb_specialty")){o=this.filter_models_by_cids(r);var p=this.filter_subjects(o);if(this.count_subjects()-p.length<2)return!0;r=this.pluck_cids_from_models(o)}}if("row"!==d&&"row_inner"!==d||(r=[l]),("section"===d||"row_inner"===d||"row"===d)&&(n=this.filter_models_by_cids(r),c=this.pluck_cids_from_models(n),a=this.filter_models_by_cids(c),s=this.filter_subjects(a),this.count_subjects()-s.length<2))return!0}return!1},subjects:function(){var e=$.where({et_pb_ab_subject:"on"});return e},subject_ids:function(){var e=this.subjects(),t=[];return e.length>0&&_.each(e,(function(e){e.has("et_pb_ab_subject_id")&&t.push(e.get("et_pb_ab_subject_id"))})),t},count_subjects:function(){return this.subjects().length},get_subject_id:function(){if(0===this.count_subjects())return 0;var e=this.subjects(),t=[];return _.each(e,(function(e){e.has("et_pb_ab_subject_id")?t.push(parseInt(e.get("et_pb_ab_subject_id"))):t.push(0)})),(Math.max.apply(Math,t)+1).toString()},set_subject:function(t,i){var o=this;if("removed"!==t.model.get("component_status")){if("exists"!==et_pb_options.ab_db_status)return setTimeout((function(){o.set_subject(t,"waiting")}),500),void v.trigger("et-pb-loading:started");void 0!==i&&"waiting"===i&&v.trigger("et-pb-loading:ended"),t.model.set("et_pb_ab_subject","on"),t.model.set("et_pb_ab_subject_id",o.get_subject_id()),t.$el.addClass("et_pb_ab_subject"),V.is_selecting_ab_testing_subject=!1,e("#et_pb_layout").removeClass("et_pb_select_ab_testing_subject"),J.count_subjects()<2&&(V.is_selecting_ab_testing_goal=!0,e("#et_pb_layout").addClass("et_pb_select_ab_testing_goal"),J.alert("select_ab_testing_goal")),V.saveAsShortcode()}},set_subject_rank_coloring:function(t){var i=et_pb_ab_js_options.subjects_rank,o=!!t.model.has("et_pb_ab_subject_id")&&"subject_".concat(t.model.get("et_pb_ab_subject_id")),n=t.model.get("type"),a=".et-pb-module-title";switch(n){case"section":a=".et-pb-section-title";break;case"row_inner":case"row":a=".et-pb-row-title"}!o||_.isUndefined(i[o])||_.isUndefined(i[o].rank)||_.isUndefined(i[o].percentage)||(t.$el.addClass("rank-".concat(i[o].rank)),t.$el.find(a).append(" (".concat(i[o].percentage,")"))),t.model.has("et_pb_ab_subject_id")&&("module"===n?(t.$el.find(".et-pb-ab-subject-id").remove(),t.$el.find(".et-pb-remove").after(e("<span />",{class:"et-pb-ab-subject-id"}).text(t.model.get("et_pb_ab_subject_id")))):(t.$el.find(".et-pb-ab-subject-id").remove(),t.$el.find(a).append(e("<span />",{class:"et-pb-ab-subject-id"}).text(t.model.get("et_pb_ab_subject_id")))))},set:function(t,i){if(this.is_selecting_subject()){if(!_.isUndefined(t.model.get("et_pb_global_parent")))return void J.alert("cannot_select_global_children_as_subject");(k.is_global(t.model)||k.is_global_children(t.model))&&k.removeGlobalAttributes(t,!0),this.set_subject(t),setTimeout((function(){V.disable_publish=!0,e("#publish").addClass("disabled")}),750)}else if(this.is_selecting_goal()){if(!_.isUndefined(t.model.get("et_pb_global_parent")))return void J.alert("cannot_select_global_children_as_goal");if("removed"===t.model.get("component_status"))return;if(this.has_subject(t.model))return void this.alert("cannot_select_subject_parent_as_goal");V.is_doing_combination=!0,(k.is_global(t.model)||k.is_global_children(t.model))&&k.removeGlobalAttributes(t,!0),t.model.set("et_pb_ab_goal","on"),t.$el.addClass("et_pb_ab_goal"),V.is_selecting_ab_testing_goal=!1,e("#et_pb_layout").removeClass("et_pb_select_ab_testing_goal"),e("#et_pb_ab_goal_module").val(t.options.model.attributes.module_type);var o=$.findWhere({et_pb_ab_subject:"on"}),n=!_.isUndefined(o.cid)&&k.getView(o.get("cid"));if(n){var a,l={model:n.model,view:n.$el,view_event:i};(a=new s.RightClickOptionsView(l,!0)).copy(i),a.pasteAfter(i),J.alert("configure_ab_testing_alternative"),this.update()}Ue(),setTimeout((function(){V.is_doing_combination=!1,V.allowHistorySaving("turnon","abtesting"),e("#et_pb_layout .et-pb-app-view-ab-stats-button").addClass("active"),delete V.disable_publish,e("#publish").removeClass("disabled")}),650)}else if(this.is_selecting_winner())if(t.options.model.has("et_pb_ab_subject")&&"on"===t.options.model.get("et_pb_ab_subject")){var d,r=$.where({et_pb_ab_subject:"on"});if(V.is_doing_combination=!0,V.is_selecting_ab_testing_winner=!1,_.each(r,(function(e){t.model.attributes.cid!==e.attributes.cid&&(n=k.getView(e.attributes.cid),"section"===(d=n.model.get("type"))?n.removeSection():"row"===d||"row_inner"===d?n.removeRow():"module"===d&&n.removeModule())})),t.model.unset("et_pb_ab_subject"),t.model.unset("et_pb_ab_subject_id"),t.model.has("et_pb_collapsed")&&"on"===t.model.get("et_pb_collapsed")&&t.model.unset("et_pb_collapsed"),k.is_temp_global(t.model)||k.is_temp_global_children(t.model))return void G("set_global_subject_winner",void 0,void 0,void 0,{view:t});this.turn_off_ab_testing_sequence()}else J.alert("select_ab_testing_winner_first")},turn_off_ab_testing_sequence:function(){et_pb_ab_js_options.subjects_rank={},Ue(),setTimeout((function(){V.is_doing_combination=!1,V.allowHistorySaving("turnoff","abtesting"),delete V.disable_publish,e("#publish").removeClass("disabled")}),650),e("#et_pb_layout").removeClass("et_pb_select_ab_testing_winner"),e("#et_pb_layout .et-pb-app-view-ab-stats-button").removeClass("active"),this.toggle_portability(!0),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_ab_clear_stats",et_pb_ab_nonce:et_pb_options.ab_testing_builder_nonce,et_pb_test_id:et_pb_ab_js_options.test_id},success:function(e){et_pb_ab_js_options.has_report=!1,V.ab_stats={}}})},update_saved_subject_ids:function(){var t=this.subject_ids().join();e("#et_pb_ab_subjects").val()!==t&&e("#et_pb_ab_subjects").val(t).addClass("et_pb_value_updated"),ne()},update_layout:function(){if(this.is_active()){setTimeout((function(){var t=e("#et_pb_layout");J.count_subjects()<3?t.addClass("et_pb_ab_disable_subject_removal"):t.removeClass("et_pb_ab_disable_subject_removal")}),100),e(".et_pb_section.et_pb_ab_subject").length&&(e(".et_pb_ab_subject_first").removeClass("et_pb_ab_subject_first"),e(".et_pb_ab_subject_last").removeClass("et_pb_ab_subject_last"),e(".et_pb_section").each((function(){var t=e(this);t.find(".et_pb_section.et_pb_ab_subject").first().addClass("et_pb_ab_subject_first"),t.find(".et_pb_section.et_pb_ab_subject").last().addClass("et_pb_ab_subject_last")})),e(".et_pb_section.et_pb_ab_subject").each((function(){var t=e(this);t.prev().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_first"),t.next().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_last")}))),e(".et_pb_row.et_pb_ab_subject").length&&(e(".et_pb_ab_subject_first").removeClass("et_pb_ab_subject_first"),e(".et_pb_ab_subject_last").removeClass("et_pb_ab_subject_last"),e(".et_pb_section").each((function(){var t=e(this);t.find(".et_pb_row.et_pb_ab_subject").first().addClass("et_pb_ab_subject_first"),t.find(".et_pb_row.et_pb_ab_subject").last().addClass("et_pb_ab_subject_last")})),e(".et_pb_row.et_pb_ab_subject").each((function(){var t=e(this);t.prev().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_first"),t.next().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_last")}))),(e(".et_pb_row.et_pb_ab_subject.et_pb_ab_no_permission").length||e(".et_pb_row.et_pb_ab_goal.et_pb_ab_no_permission").length)&&e(".et_pb_row.et_pb_ab_subject.et_pb_ab_no_permission, .et_pb_row.et_pb_ab_goal.et_pb_ab_no_permission").each((function(){e(this).closest(".et_pb_section").addClass("et_pb_ab_no_permission_parent")})),e(".et_pb_module_block.et_pb_ab_subject").length&&(e(".et_pb_ab_subject_first").removeClass("et_pb_ab_subject_first"),e(".et_pb_ab_subject_last").removeClass("et_pb_ab_subject_last"),e(".et-pb-column").each((function(){var t=e(this);t.find(".et_pb_module_block.et_pb_ab_subject").first().addClass("et_pb_ab_subject_first"),t.find(".et_pb_module_block.et_pb_ab_subject").last().addClass("et_pb_ab_subject_last")})),e(".et_pb_module_block.et_pb_ab_subject").each((function(){var t=e(this);t.prev().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_first"),t.next().hasClass("et_pb_ab_subject")||t.addClass("et_pb_ab_subject_last")}))),(e(".et_pb_module_block.et_pb_ab_subject.et_pb_ab_no_permission").length||e(".et_pb_module_block.et_pb_ab_goal.et_pb_ab_no_permission").length)&&e(".et_pb_module_block.et_pb_ab_subject.et_pb_ab_no_permission, .et_pb_module_block.et_pb_ab_goal.et_pb_ab_no_permission").each((function(){var t=e(this);t.closest(".et_pb_row").addClass("et_pb_ab_no_permission_parent"),t.closest(".et_pb_section").addClass("et_pb_ab_no_permission_parent")}));var t,i,o,n=!0;_.each(this.subjects(),(function(e){e.has("et_pb_collapsed")&&"off"!==e.get("et_pb_collapsed")||(n=!1)})),n&&(i=(t=e(".et_pb_ab_subject").first()).children(".et-pb-data-cid").attr("data-cid"),o=k.getView(i),t.length&&!_.isUndefined(o)&&(t.removeClass("et_pb_collapsed"),o.model.set("et_pb_collapsed","off")))}},update:function(){this.update_saved_subject_ids(),this.update_layout()},is_alert_valid:function(e){return!(!_.isUndefined(V.ab_last_visible_alert)&&V.ab_last_visible_alert===e)&&(V.ab_last_visible_alert=e,!0)},alert:function(e){this.is_alert_valid(e)&&G("ab_testing_alert",void 0,void 0,void 0,{id:e})},alert_yes_no:function(e){this.is_alert_valid(e)&&G("ab_testing_alert_yes_no",void 0,void 0,void 0,{id:e})},get_all_subjects_stats_settings:function(t){var i,o=e('.view-stats-tab[data-analysis="'.concat(t,'"]')),n=o.find(".et-pb-ab-view-stats-subjects-filter"),a=o.find(".et-pb-ab-view-stats-time-filter"),s=(o.find(".et-pb-options-tabs-links"),["first","second","third","fourth","fifth"]),l={subject_statuses:[],subject_ids:[],table:{thead:[],tbody:{},tfoot:[]}};a.find(".active").length||a.find('a[data-duration="'.concat(et_pb_ab_js_options.refresh_interval_duration,'"]')).addClass("active"),i=V.ab_stats[a.find(".active").attr("data-duration")],n.find("a").each((function(){var t=e(this),i=!t.hasClass("inactive"),o=!t.parent("li").hasClass("et-pb-no-data"),n=t.attr("data-subject-id");o&&l.subject_statuses.push(i),i&&o&&l.subject_ids.push(parseInt(n))}));for(var d=0;d<5;d++)l.table.thead[s[d]]=et_pb_ab_js_options.view_stats_thead_titles[t][d];return _.isUndefined(i)||(_.each(i.subjects_id,(function(o){var n="subject_".concat(o),a=$.findWhere({et_pb_ab_subject_id:o}),s=!(_.isUndefined(a)||!a.has("admin_label"))&&a.get("admin_label");s&&-1!==e.inArray(parseInt(o),l.subject_ids)&&(l.table.tbody[n]={first:o,second:s,third:i.subjects_totals[n][et_pb_ab_js_options.analysis_formula[t].denominator],fourth:i.subjects_totals[n][et_pb_ab_js_options.analysis_formula[t].numerator],fifth:"".concat(i.subjects_totals[n][t],"%")})})),l.table.tfoot={first:et_pb_ab_js_options.total_title,second:null,third:i.events_totals[et_pb_ab_js_options.analysis_formula[t].denominator],fourth:i.events_totals[et_pb_ab_js_options.analysis_formula[t].numerator],fifth:"".concat(i.events_totals[t],"%")}),l},switch_view_stats_tab:function(){var t=e(".et-pb-options-tabs-links"),i=e(".et-pb-ab-view-stats-content.has-data"),o=t.find("li.et-pb-options-tabs-links-active").attr("data-analysis");i.find(".view-stats-tab").removeClass("active"),i.find('.view-stats-tab[data-analysis="'.concat(o,'"]')).addClass("active")},display_stats_tabs:function(t){var i=this,o=_.template("<tr><th><%= first %></th><th><%= second %></th><th><%= third %></th><th><%= fourth %></th><th><%= fifth %></th></tr>"),n=_.template("<tr><td><%= first %></td><td><%= second %></td><td><%= third %></td><td><%= fourth %></td><td><%= fifth %></td></tr>"),a=_.template("<tr><td colspan='2'><%= first %></td></td><td><%= third %></td><td><%= fourth %></td><td><%= fifth %></td></tr>"),s=e(".et_pb_prompt_modal.et_pb_ab_view_stats"),l=$.findWhere({et_pb_ab_goal:"on"}).get("module_type"),d=e("#et_pb_ab_subjects").val().split(",");!_.isEmpty(t.subjects_totals)||et_pb_ab_js_options.has_report?(-1===e.inArray(l,et_pb_ab_js_options.have_conversions)?(e(".et_pb_options_tab_ab_stat_conversion, .view-stats-tab.tab-conversions").remove(),e(".et_pb_options_tab_ab_stat_clicks").addClass("et-pb-options-tabs-links-active")):"et_pb_shop"===l&&e(".et_pb_options_tab_ab_stat_conversion a").text(et_pb_ab_js_options.sales_title),"on"!==J.get_shortcode_tracking_status()&&e(".et_pb_options_tab_ab_stat_shortcode_conversions").remove(),s.find(".view-stats-tab").each((function(){var s,l,r,c,p=e(this),b=p.attr("data-analysis"),u=e("#ab-testing-stats-".concat(b)),g=e("#ab-testing-stats-pie-".concat(b)),h=e("#view-stats-table-".concat(b)),f=h.find("thead"),m=h.find("tbody"),w=h.find("tfoot"),y=p.find(".et-pb-ab-view-stats-subjects-filter"),k=p.find(".et-pb-ab-view-stats-time-filter"),C=p.find(".ab-testing-stats-pie-legends"),S=e(".et_pb_ab_view_stats .et-pb-options-tabs-links");t.dates;if(_.each(d,(function(t){"subject_".concat(t);var i=$.findWhere({et_pb_ab_subject_id:t}),o=!(_.isUndefined(i)||!i.has("admin_label"))&&i.get("admin_label");if(o){var n=e("<li />").append(e("<a />",{href:"#","data-subject-id":t}).text(o)),a=e("<li />",{"data-subject-id":t}).append(e("<a />",{href:"#"}).text(o)).prepend(e("<span />"));y.append(n),C.append(a)}})),_.isEmpty(t)||_.isUndefined(t)||!t){k.find('a[data-duration="'.concat(et_pb_ab_js_options.refresh_interval_duration,'"]')).addClass("active"),p.addClass("no-tab-data")}else{var x=i.draw_graphs(b,t,s,r,u,g,h,f,m,w,o,n,a,!0);s=x.line_chart,r=x.pie_chart,x.line_chart_data,x.pie_chart_data,l=x.line_chart_datasets,c=x.pie_chart_segments}y.on("click","a",(function(t){t.preventDefault();var _=e(this).attr("data-subject-id");e(this).toggleClass("inactive"),C.find('li[data-subject-id="'.concat(_,'"]')).toggleClass("inactive");var d=i.filter_stats_subject(b,s,r,l,c,h,f,m,w,o,n,a);s=d.line_chart,r=d.pie_chart})),C.on("click","a",(function(t){t.preventDefault();var i=e(this).parent("li").attr("data-subject-id");y.find('a[data-subject-id="'.concat(i,'"]')).trigger("click")})),S.on("click","a",(function(t){t.preventDefault(),e(this).hasClass("et-pb-ab-refresh-stats")||(S.find("li").removeClass("et-pb-options-tabs-links-active"),e(this).parent("li").addClass("et-pb-options-tabs-links-active"),i.switch_view_stats_tab())})),k.on("click","a",(function(d){d.preventDefault();var y=e(this),C=y.attr("data-duration");e(".et_pb_prompt_modal.et_pb_ab_view_stats");if(k.find("a").removeClass("active"),y.addClass("active"),_.isUndefined(V.ab_stats[C])||!V.ab_stats[C])v.trigger("et-pb-loading:started"),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_ab_builder_data",et_pb_ab_nonce:et_pb_options.ab_testing_builder_nonce,et_pb_ab_test_id:et_pb_ab_js_options.test_id,et_pb_ab_duration:C},success:function(e){if(p.removeClass("no-tab-data"),v.trigger("et-pb-loading:ended"),"false"!==e){e=JSON.parse(e),V.ab_stats[C]=e;var t=i.draw_graphs(b,e,s,r,u,g,h,f,m,w,o,n,a);s=t.line_chart,r=t.pie_chart,t.line_chart_data,t.pie_chart_data,l=t.line_chart_datasets,c=t.pie_chart_segments}else p.addClass("no-tab-data")}});else{p.removeClass("no-tab-data"),t=V.ab_stats[C];var S=i.draw_graphs(b,t,s,r,u,g,h,f,m,w,o,n,a);s=S.line_chart,r=S.pie_chart,S.line_chart_data,S.pie_chart_data,l=S.line_chart_datasets,c=S.pie_chart_segments}}))})),s.on("click",".et-pb-ab-refresh-stats",(function(){v.trigger("et-pb-loading:started"),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_ab_clear_cache",et_pb_ab_nonce:et_pb_options.ab_testing_builder_nonce,et_pb_test_id:et_pb_ab_js_options.test_id},success:function(t){V.ab_stats={},e(".et-pb-ab-view-stats-time-filter").find("a.active").trigger("click")}})})),s.addClass("et-pb-loaded").find(".et-pb-ab-view-stats-content.has-data, .et-pb-options-tabs-links").css({opacity:1}),i.switch_view_stats_tab()):(s.find(".et-pb-ab-view-stats-content.has-data, .et-pb-options-tabs-links").hide(),s.find(".et-pb-ab-view-stats-content.no-data").css({opacity:1,display:"block"}))},draw_graphs:function(t,i,o,n,a,s,l,d,r,c,p,b,u,g){var h={labels:i.dates,datasets:[]},f=[],m=a.closest(".view-stats-tab"),v=m.find(".et-pb-ab-view-stats-subjects-filter"),w=m.find(".ab-testing-stats-pie-legends");_.each(i.subjects_id,(function(e){var o="subject_".concat(e),n=$.findWhere({et_pb_ab_subject_id:e}),a=!_.isUndefined(n)&&!_.isUndefined(n.attributes.admin_label)&&n.attributes.admin_label,s=v.find('a[data-subject-id="'.concat(e,'"]')),l=w.find('li[data-subject-id="'.concat(e,'"] span'));a&&(_.isUndefined(s.attr("style"))&&s.css({backgroundColor:i.subjects_totals[o].color}),_.isUndefined(l.attr("style"))&&l.css({backgroundColor:i.subjects_totals[o].color}),h.datasets.push({subject_id:e,label:a,fillColor:"transparent",strokeColor:i.subjects_totals[o].color,pointColor:i.subjects_totals[o].color,pointStrokeColor:"#fff",data:_.values(i.subjects_analysis[o][t])}),f.push({value:i.subjects_totals[o][t],color:i.subjects_totals[o].color,label:"#".concat(e,": ").concat(a)}))})),v.find("li").removeClass("et-pb-no-data"),w.find("li").removeClass("et-pb-no-data"),_.each(e("#et_pb_ab_subjects").val().split(","),(function(t){-1===e.inArray(t,i.subjects_id)&&(v.find('a[data-subject-id="'.concat(t,'"]')).parent("li").addClass("et-pb-no-data"),w.find('li[data-subject-id="'.concat(t,'"]')).addClass("et-pb-no-data"))}));var y=this.get_all_subjects_stats_settings(t);if(d.empty().html(e(p(y.table.thead))),r.empty(),_.each(y.table.tbody,(function(t){r.append(e(b(t)))})),c.empty().html(e(u(y.table.tfoot))),_.size(y.table.tbody)>1){l.tablesorter();var k=l.find("thead th").first();k.hasClass(".headerSortDown")||setTimeout((function(){k.trigger("click")}),500)}_.isUndefined(o)||o.destroy(),a.closest(".view-stats-tab").addClass("et_pb_ab_visible_tab");var C,S=(o=new Chart(a.get(0).getContext("2d")).Line(h,{scaleFontSize:13,scaleFontColor:"#a1a9b1",scaleLabel:"<%=value%>%",scaleGridLineWidth:2,scaleLineWidth:2,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>%",multiTooltipTemplate:"<%= value %>%",datasetStrokeWidth:4,pointDotStrokeWidth:2,pointDotRadius:7})).datasets;if(_.isUndefined(n)||n.destroy(),s.is(":visible")&&(C=(n=new Chart(s.get(0).getContext("2d")).Pie(f,{animationEasing:"easeInCubic",animationSteps:50,tooltipTemplate:"<%if (label){%><%=label%><%}%>"})).segments),_.isUndefined(g)){var x=this.filter_stats_subject(t,o,n,S,C,l,d,r,c,p,b,u);o=x.line_chart,n=x.pie_chart}return a.closest(".view-stats-tab").removeClass("et_pb_ab_visible_tab"),{line_chart:o,pie_chart:n,line_chart_data:h,pie_chart_data:f,line_chart_datasets:S,pie_chart_segments:C}},filter_stats_subject:function(t,i,o,n,a,s,l,d,r,c,p,b){var u,g=this.get_all_subjects_stats_settings(t),h=_.compact(_.map(n,(function(e,t){return!!g.subject_statuses[t]&&e}))),f=_.compact(_.map(a,(function(e,t){return!!g.subject_statuses[t]&&e})));if(i.datasets=h,i.update(),l.empty(),d.empty(),r.empty(),l.html(e(c(g.table.thead))),_.each(g.table.tbody,(function(t){d.append(e(p(t)))})),(u=_.size(g.table.tbody))>1){s.tablesorter();var m=s.find("thead th").first();m.hasClass(".headerSortDown")||setTimeout((function(){m.trigger("click")}),500)}if(u>0){var v=_.pluck(g.table.tbody,"third"),w=_.pluck(g.table.tbody,"fourth"),y=_.map(_.pluck(g.table.tbody,"fifth"),(function(e){return parseFloat(e)})),k=_.reduce(v,(function(e,t){return e+t}),0),C=_.reduce(w,(function(e,t){return e+t}),0),S="".concat((_.reduce(y,(function(e,t){return e+t}),0)/_.size(y)).toFixed(2),"%");r.html(e(b({first:et_pb_ab_js_options.total_title,second:null,third:k,fourth:C,fifth:S})))}return o.segments=f,o.update(),{line_chart:i,pie_chart:o}},delete_post_meta:function(){this.toggle_status(!1),e("#et_pb_ab_subjects").val(""),ne()},subject_carousel:function(e){var t=k.getView(e),i=$.where({et_pb_ab_subject:"on"}),o=t.model.get("et_pb_collapsed"),n="on"===o?"off":"on";_.each(i,(function(e){var i=k.getView(e.attributes.cid);i.model.get("cid")===t.model.get("cid")?"on"===o&&i.model.set("et_pb_collapsed","off"):"on"===o?i.model.set("et_pb_collapsed","on"):i.model.set("et_pb_collapsed",n),"on"===i.model.get("et_pb_collapsed")?i.$el.addClass("et_pb_collapsed"):i.$el.removeClass("et_pb_collapsed")}))}};function K(){var t,i=e("body");e("#et_pb_fb_cta").removeClass("et_pb_ready"),ae("content",E.val()),window.wpActiveEditor="content","html"!==et_pb_options.wp_default_editor&&e("#content-tmce").trigger("click"),I.val("off"),L.hide(),A.text(A.data("builder")).toggleClass("et_pb_builder_is_used"),P.toggleClass("et_pb_post_body_hidden"),function(){var t=H.closest("#et_settings_meta_box").find(".et_pb_page_layout_settings");if(H.show().closest("#et_settings_meta_box").show(),H.closest("#et_settings_meta_box").find(".et_pb_side_nav_settings").hide(),H.closest("#et_settings_meta_box").find(".et_pb_single_title").hide(),D.length){D.show();var i=D.find('input[type="radio"]:checked').val();e(".et_divi_format_setting.et_divi_".concat(i,"_settings")).show()}if(t.length>0){var o=t.find("#et_pb_page_layout").val(),n=t.find('option[value="et_full_width_page"]');n.length>0&&n.hide(),"et_full_width_page"===o&&t.find("#et_pb_page_layout").val("et_no_sidebar")}"project"===et_pb_options.post_type&&H.closest("#et_settings_meta_box").find(".et_pb_project_nav").hide()}(),t=i.scrollTop(),i.scrollTop(t+1),v.trigger("et-deactivate-builder"),J.is_active()&&J.delete_post_meta(),e("form#post").append('<input type="hidden" name="et_pb_show_page_creation" value="off" />'),e(window).trigger("resize")}function G(t,o,a,s,l){var d,r=-1!==e.inArray(t,["save_template","reset_advanced_settings"])?" et_modal_on_top":"",c="reset_advanced_settings"===t?" et_modal_on_top_both_actions":"",p=e('<div class="et_pb_modal_overlay'.concat(r).concat(c,'" data-action="').concat(t,'"></div>')),b=e("#et-builder-prompt-modal-".concat(t)).length?e("#et-builder-prompt-modal-".concat(t)).html():e("#et-builder-prompt-modal").html(),u=_.template(e("#et-builder-prompt-modal-".concat(t,"-text")).html()),g=!0,h={};if(i(),e("body").addClass("et_pb_stop_scroll"),"save_template"===t){var f=void 0!==(x=k.getView(o.model.get("cid"))).model.get("parent")?k.getView(x.model.get("parent")):"",m=x.$el.find(".et_pb_global"),C=x.$el.is(".et_pb_global"),S=m.length?"has_global":"no_globals";h.is_global=void 0!==x.model.get("et_pb_global_module")&&""!==x.model.get("et_pb_global_module")?"global":"regular",h.is_global_child=""!==f&&(void 0!==f.model.get("et_pb_global_module")&&""!==f.model.get("et_pb_global_module")||void 0!==f.model.get("global_parent_cid")&&""!==f.model.get("global_parent_cid"))?"global":"regular",h.module_type=x.model.get("type")}if("delete_font"===t&&(h.font_name=o),_.isUndefined(l)||e.extend(h,l),p.append(b),p.find(".et_pb_prompt_modal").prepend(u(h)),"upload_font"===t&&(p.find('.et-core-portability-import-form input[type="file"]').on("change",(function(t){var i=e(this).get(0).files,o="",n=et_pb_options.supported_font_formats;_.isEmpty(i)||_.each(i,(function(e){var t=_.isUndefined(e.name)?"":e.name.toLowerCase();_.each(n,(function(e){".".concat(e);t.match("".concat(e,"$"))&&(o+='<div class="et-fb-font-files-list-item" data-file_format="'.concat(e,'" data-file_name="').concat(t,'"><span class="et-fb-font-files-list-item-remove"></span>').concat(t,"</div>"))}))})),""!==o&&(e(".et-font-uploader-selected-fonts").html(""),e(".et-font-uploader-selected-fonts").removeClass("et-font-uploader-hidden-field").append(o))})),p.find(".et-core-portability-import-form button").on("click",(function(t){t.preventDefault(),e(this).closest(".et-core-portability-import-form").find('input[type="file"]').trigger("click")})),p.on("click",".et-fb-font-files-list-item-remove",(function(t){e(t.target).closest(".et-fb-font-files-list-item").remove()})),p.find(".et-font-uploader-all-weights").on("change",(function(t){var i=e(this).prop("checked"),o=p.find(".et-font-uploader-weight-values");i?o.addClass("et-font-uploader-hidden-section"):o.removeClass("et-font-uploader-hidden-section")}))),"open_settings"===t&&(p.addClass("et_pb_builder_settings"),d='[et_pb_split_track id="'.concat(et_pb_ab_js_options.test_id,'" /]'),setTimeout((function(){e("#et_pb_ab_current_shortcode").val(d)}),100),p.find(".et_pb_prompt_field_list").each((function(){var t=e(this),i=t.attr("data-id"),o=t.attr("data-type"),n=(t.attr("data-autoload"),{et_pb_enable_ab_testing:"et_pb_use_ab_testing"}),a=e(void 0!==n[i]?"#".concat(n[i]):"#_".concat(i)).val();switch(o){case"yes_no_button":var s=t.find(".et_pb_yes_no_button_wrapper"),l=s.find(".et_pb_yes_no_button"),d=s.find("select");d.val(a),d.trigger("change"),l.on("click",(function(){var t=e(this);t.hasClass("et_pb_off_state")?(t.removeClass("et_pb_off_state").addClass("et_pb_on_state"),d.val("on")):(t.removeClass("et_pb_on_state").addClass("et_pb_off_state"),d.val("off")),d.trigger("change")})),d.on("change",(function(){var i=e(this).val();if("on"===i?l.removeClass("et_pb_off_state").addClass("et_pb_on_state"):l.removeClass("et_pb_on_state").addClass("et_pb_off_state"),""!==t.data("affects")){var o=t.attr("data-affects").split("|");_.each(o,(function(e){var o=p.find('.et_pb_prompt_field_list[data-id="'.concat(e,'"]')),n=o.attr("data-visibility-dependency");if(i===n&&t.hasClass("et-pb-visible"))o.addClass("et-pb-visible"),o.find("select").trigger("change");else if(o.removeClass("et-pb-visible"),""!==o.data("affects")){var a=o.data("affects").split("|");_.each(a,(function(e){p.find('.et_pb_prompt_field_list[data-id="'.concat(e,'"]')).removeClass("et-pb-visible")}))}}))}})),d.trigger("change");break;case"color-alpha":t.find(".input-colorpicker").val(a).wpColorPicker({width:313});break;case"colorpalette":var r=e(this),c=r.find(".input-colorpalette-colorpicker"),b=0,u=a.split("|");c.each((function(){var t=e(this),i=u[b];t.val(i).wpColorPicker({hide:!1,default:e(this).data("default-color"),width:313,palettes:!1,change:function(t,i){var o=e(this),n=o.attr("data-index"),a=p.find(".colorpalette-item-".concat(n)),s=i.color.toString();o.val(s),a.css({backgroundColor:s}),ne()}}),t.trigger("change"),t.siblings(".wp-picker-clear").on("click",(function(e){e.preventDefault(),t.wpColorPicker("color",i)})),t.closest(".wp-picker-container").find(".wp-color-result").attr("title",et_pb_options.select_text),t.closest(".wp-picker-container").on("click",".wp-color-result",(function(e){r.find(".colorpalette-colorpicker").removeClass("active")})),b++})),r.on("click",".colorpalette-item",(function(t){t.preventDefault();var i=e(this).attr("data-index");r.find(".colorpalette-colorpicker").removeClass("active"),r.find('.colorpalette-colorpicker[data-index="'.concat(i,'"]')).addClass("active")}));break;case"range":var g,h=t.find('input[type="range"]'),f=h.val(),m=h.attr("min"),v=h.attr("max"),w=h.parent("div"),y=e("<input />",{type:"number",step:1,class:"et-pb-range-input",min:m,max:v,value:f});h.val(a),w.append(y),g=w.find(".et-pb-range-input"),h.on("change input",(function(){var t=e(this).val();g.val(t)})),g.on("change keydown",(function(){var t=e(this).val();h.val(t)})),h.trigger("change");break;case"select":e(this).find("select").val(a);break;case"codemirror":case"textarea":e(this).find("textarea").val(a)}}))),"view_ab_stats"===t){if(e(".et-pb-ab-view-stats-content").length)return;v.trigger("et-pb-loading:started"),_.isUndefined(V.ab_stats)&&(V.ab_stats={}),_.isUndefined(V.ab_stats[et_pb_ab_js_options.refresh_interval_duration])?e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_ab_builder_data",et_pb_ab_nonce:et_pb_options.ab_testing_builder_nonce,et_pb_ab_test_id:et_pb_ab_js_options.test_id,et_pb_ab_duration:et_pb_ab_js_options.refresh_interval_duration},success:function(e){v.trigger("et-pb-loading:ended"),e=JSON.parse(e),V.ab_stats[et_pb_ab_js_options.refresh_interval_duration]=e,J.display_stats_tabs(e)}}):setTimeout((function(){v.trigger("et-pb-loading:ended"),J.display_stats_tabs(V.ab_stats[et_pb_ab_js_options.refresh_interval_duration])}),500)}if("ab_testing_alert_yes_no"!==t||_.isUndefined(l.id)||p.attr({"data-action":"".concat(t,"_").concat(l.id)}),e("body").append(p),"auto"===e(".et_pb_prompt_modal").css("bottom")&&(0,n.default)(p.find(".et_pb_prompt_modal"),".et_pb_prompt_buttons"),setTimeout((function(){p.find("select, input, textarea, radio").eq(0).trigger("focus")}),1),"rename_admin_label"===t){var x,j=p.find("input#et_pb_new_admin_label"),T=(x=k.getView(o)).model.get("admin_label").trim();""!==T&&j.val(T)}e(".et_pb_modal_overlay .et_pb_prompt_proceed").on("click",(function(t){t.preventDefault();var i=e(this).closest(".et_pb_modal_overlay");switch(i.data("action").trim()){case"deactivate_builder":K();break;case"clear_layout":V.removeAllSections(!0);break;case"rename_admin_label":var n=i.find("#et_pb_new_admin_label").val().trim(),d=k.getView(o);if(""==n)return void i.find("#et_pb_new_admin_label").trigger("focus");d.model.set("admin_label",n,{silent:!0}),d.renameModule(),V.allowHistorySaving("renamed","module",n),Ue();break;case"reset_advanced_settings":o.each((function(){Ce(e(this))}));break;case"save_layout":var r=i.find("#et_pb_new_layout_name").val().trim();if(""==r)return void i.find("#et_pb_new_layout_name").trigger("focus");e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_save_layout",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_layout_name:r,et_layout_content:ee("content"),et_layout_type:"layout",et_post_type:et_pb_options.post_type},success:function(e){"layout"!==et_pb_options.post_type?y=w():Le("not_predefined","","",et_pb_options.post_type,!0)}});break;case"save_template":var c=i.find("#et_pb_new_template_name").val().trim(),b=i.find(e("#et_pb_template_global")).is(":checked")?"global":"not_global",u=e(".et_pb_module_settings").data("module_type"),h="section"===u||"row"===u?u:"module",f=void 0!==a?a:"regular",v=o.model.get("cid"),x="",j="",T=i.find("#et_pb_new_cat_name").val(),U=C||void 0!==S&&"has_global"===S&&"global"===b?"ignore_global":"include_global",O="ignore_global"===U?"ignore_global_tabs":"",A=e(".et_pb_modal_settings_container"),M=e(".et_pb_modal_overlay");if(h="row_inner"===u?"row":h,""==c)return void i.find("#et_pb_new_template_name").trigger("focus");e(".layout_cats_container input").is(":checked")&&e(".layout_cats_container input").each((function(){var t=e(this);t.is(":checked")&&(j+=""!==j?",".concat(t.val()):t.val())})),"module"===h&&o.model.set("et_pb_saved_tabs","all",{silent:!0}),o.performSaving(),x=V.generateCompleteShortcode(v,h,U,O),"row_inner"===u&&(x=(x=x.replace(/et_pb_row_inner/g,"et_pb_row")).replace(/et_pb_column_inner/g,"et_pb_column")),A.addClass("et_pb_modal_closing"),M.addClass("et_pb_overlay_closing"),setTimeout((function(){"module"===h&&se("et_pb_content"),A.remove(),M.remove(),e("body").removeClass("et_pb_stop_scroll")}),600),e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_pb_save_layout",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_layout_name:c,et_layout_content:x,et_layout_scope:b,et_layout_type:h,et_module_width:f,et_columns_layout:s,et_selected_tabs:"all",et_module_type:u,et_layout_cats:j,et_layout_new_cat:T,et_post_type:et_pb_options.post_type},beforeSend:function(t){"global"===b&&(e("body").find(".et_pb_global_loading_overlay").length||e("body").append('<div class="et_pb_global_loading_overlay"></div>'))},success:function(t){"global"===b&&(V.collection.find((function(e){return e.get("cid")==v})).set("et_pb_global_module",t.post_id),"ignore_global"===U&&m.length&&m.each((function(){var t=e(this).data("cid");if(void 0!==t&&""!==t){var i=V.collection.find((function(e){return e.get("cid")==t}));i.unset("et_pb_global_module"),i.unset("et_pb_saved_tabs")}})),Ue(),setTimeout((function(){e("body").find(".et_pb_global_loading_overlay").remove()}),650));N={}}});break;case"open_settings":var L=p.find("#et_pb_enable_ab_testing"),E=p.find("#et_pb_ab_stats_refresh_interval").val(),D="on"===L.val(),I=p.find("#et_pb_enable_shortcode_tracking").val(),P=e("#_et_pb_ab_stats_refresh_interval"),R=e("#et_pb_enable_shortcode_tracking");p.find(".et_pb_prompt_field_list").each((function(){var t=e(this),i=t.attr("data-id"),o="1"===t.attr("data-autoload"),n=e("#_".concat(i)),a=[],s=n.val();o&&(t.hasClass("colorpalette")?(t.find(".input-colorpalette-colorpicker").each((function(){a.push(e(this).val())})),n.val(a.join("|")),s!==a.join("|")&&(n.addClass("et_pb_value_updated"),ne()),et_pb_options.page_color_palette=a.join("|")):(n.val(t.find("#".concat(i)).val()),s!==t.find("#".concat(i)).val()&&(n.addClass("et_pb_value_updated"),ne()),"et_pb_section_background_color"===n.attr("id")&&(et_pb_options.page_section_bg_color=t.find("#".concat(i)).val()),"et_pb_page_gutter_width"===n.attr("id")&&(et_pb_options.page_gutter_width=t.find("#".concat(i)).val())))})),J.toggle_status(D),P.val(E),R.val(I),et_pb_ab_js_options.refresh_interval_duration=_.isUndefined(et_pb_ab_js_options.refresh_interval_durations[E])?"day":et_pb_ab_js_options.refresh_interval_durations[E],J.is_active()?J.count_subjects()<2&&(V.disable_publish=!0,e("#publish").addClass("disabled"),J.check_create_db(),J.alert_yes_no("select_ab_testing_subject"),V.is_selecting_ab_testing_subject=!0,e("#et_pb_layout").addClass("et_pb_select_ab_testing_subject")):(V.is_selecting_ab_testing_subject=!1,J.count_subjects()>0&&G("turn_off_ab_testing")),V.saveAsShortcode();break;case"turn_off_ab_testing":var H,B=$.where({et_pb_ab_goal:"on"});_.each(B,(function(e){delete e.attributes.et_pb_ab_goal,_.isUndefined(e.attributes.et_pb_temp_global_module)&&_.isUndefined(e.attributes.et_pb_temp_global_parent)||(H=k.getView(e.attributes.cid),k.removeTemporaryGlobalAttributes(H,!0))})),V.disable_publish=!0,e("#publish").addClass("disabled"),V.is_selecting_ab_testing_winner=!0,e("#et_pb_layout").addClass("et_pb_select_ab_testing_winner");break;case"set_global_subject_winner":k.removeTemporaryGlobalAttributes(l.view),J.turn_off_ab_testing_sequence();break;case"ab_testing_alert":_.isUndefined(V.ab_last_visible_alert)||delete V.ab_last_visible_alert;break;case"view_ab_stats":J.toggle_status(!1),V.is_selecting_ab_testing_subject=!1,J.count_subjects()>0&&G("turn_off_ab_testing");break;case"delete_font":g=!1,e(this).hasClass("et-font-uploader-disabled")||q("remove",{font_name:o},i,e(this));break;case"upload_font":var z=p.find("#et-font-uploader-name").val(),F=p.find('.et-core-portability-import-form input[type="file"]').get(0).files,W=p.find(".et-font-uploader-all-weights").prop("checked")?"all":"",Y={},X="";if(p.find(".et-font-uploader-error").html(""),g=!1,"all"!==W){var Q=p.find(".et-font-uploader-weight-values input"),te=["100","200","300","400","500","600","700","800","900"],ie=[];e.each(Q,(function(t,i){e(i).prop("checked")&&ie.push(te[t])})),W=ie.join(",")}""===z&&(X+="".concat(et_pb_options.font_name_error,"\n")),_.isUndefined(F)&&(X+="".concat(et_pb_options.font_file_error,"\n")),""===W&&(X+="".concat(et_pb_options.font_weight_error,"\n")),""!==X?p.find(".et-font-uploader-error").html(X):(Y={font_name:z,font_weight:W,generic_family:"sans-serif",font_files:F},e(this).hasClass("et-font-uploader-disabled")||q("add",Y,i,e(this),o))}g&&Z(e(this))})),e(".et_pb_modal_overlay .et_pb_prompt_proceed_alternative").on("click",(function(t){switch(t.preventDefault(),e(this).closest(".et_pb_modal_overlay").data("action").trim()){case"set_global_subject_winner":k.removeTemporaryGlobalAttributes(l.view,!0),J.turn_off_ab_testing_sequence();break;case"ab_testing_alert_yes_no_select_ab_testing_subject":J.toggle_status(!1),J.toggle_portability(!0),V.disable_publish=!1,e("#publish").removeClass("disabled"),V.is_selecting_ab_testing_subject=!1,e("#et_pb_layout").removeClass("et_pb_select_ab_testing_subject"),delete V.ab_last_visible_alert}Z(e(this))})),e(".et_pb_modal_overlay .et_pb_prompt_dont_proceed").on("click",(function(t){switch(t.preventDefault(),e(this).closest(".et_pb_modal_overlay").data("action").trim()){case"ab_testing_alert":_.isUndefined(V.ab_last_visible_alert)||delete V.ab_last_visible_alert;break;case"turn_off_ab_testing":J.toggle_status(!0)}Z(e(this))}))}function q(t,i,o,n,a){var s={};"add"===t&&(s=JSON.stringify({font_weights:i.font_weight,generic_family:i.generic_family}));var l=new FormData,d={action:"et_pb_process_custom_font",et_pb_font_action:t,et_fb_upload_font_nonce:et_pb_options.upload_font_nonce,et_pb_font_name:i.font_name,et_pb_font_settings:s};_.each(i.font_files,(function(t,i){var o=e(".et-font-uploader-selected-fonts").find("[data-file_name='".concat(t.name.toLowerCase(),"']"));if(o.length>0){var n=o.data("file_format");d["et_pb_font_file_".concat(n)]=t}})),_.each(d,(function(e,t){l.append(t,e)})),e.ajax({type:"POST",url:et_pb_options.ajaxurl,contentType:!1,processData:!1,data:l,beforeSend:function(){o.append('<div id="et_pb_loading_animation"></div>'),n.addClass("et-font-uploader-disabled")},complete:function(){o.find("#et_pb_loading_animation").remove()},success:function(s){var l=JSON.parse(s);if(_.isEmpty(l.error)){if("remove"===t&&!_.isUndefined(et_pb_options.user_fonts[i.font_name])){delete et_pb_options.user_fonts[i.font_name];var d=".select-option-item-".concat(i.font_name.replace(/ /g,"_"));e(d).length>0&&e(d).each((function(){var t=e(this),o=t.hasClass("et_pb_selected_menu_item"),n=o?t.closest(".et-pb-option-container--font"):"";t.remove(),o&&($e(i.font_name,"remove"),ue(n,"default"),je(n,!1))}))}if("add"===t&&!_.isEmpty(l.updated_fonts)){et_pb_options.user_fonts=l.updated_fonts;var r=l.uploaded_font;if(!_.isUndefined(r)){var c=r.replace(/ /g,"_"),p=e(".et-pb-option-subgroup-uploaded .et-pb-option-subgroup-container"),b='<li class="select-option-item select-option-item-custom-font select-option-item-'.concat(c,'" data-value="').concat(r,'">').concat(r,'<span class="et-pb-user-font-marker"></span></li>');p.length>0&&p.append(b);var u=_.isUndefined(a)?"":e('[data-option_name="'.concat(a,'"]')).find('.select-option-item-custom-font[data-value="'.concat(r,'"]'));""!==u&&u.length>0&&u.trigger("click")}}Z(o)}else n.removeClass("et-font-uploader-disabled"),o.find(".et-font-uploader-error").html(l.error)}})}function Y(e){e.addClass("et_pb_animate_clone"),setTimeout((function(){e.length&&e.removeClass("et_pb_animate_clone")}),500)}function Z(t){var i=t.closest(".et_pb_modal_overlay"),o=e("body");o.removeClass("et_pb_stop_scroll"),o.removeClass("et_pb_advanced_menu_opened"),i.addClass("et_pb_modal_closing"),setTimeout((function(){i.remove()}),600)}function X(t,i){t.removeOverlay(),e(".et_pb_modal_settings_container").addClass("et_pb_modal_closing"),setTimeout((function(){t.remove(),"trigger_event"===i&&v.trigger("et-modal-view-removed")}),600)}function Q(){var t=H.closest("#et_settings_meta_box").find(".et_pb_page_layout_settings");if(R.filter(":visible").length>1?(t.hide(),H.find(".et_pb_side_nav_settings").show()):("post"!==et_pb_options.post_type&&"no"===et_pb_options.is_third_party_post_type&&t.hide(),H.closest("#et_settings_meta_box").find(".et_pb_side_nav_settings").show(),H.closest("#et_settings_meta_box").find(".et_pb_single_title").show()),t.length>0){t.find("#et_pb_page_layout").val();var i=t.find('option[value="et_full_width_page"]');i.length>0&&i.show()}if(D.length){D.hide();var o=D.find('input[type="radio"]:checked').val();e(".et_divi_format_setting.et_divi_".concat(o,"_settings")).hide()}"project"===et_pb_options.post_type&&H.closest("#et_settings_meta_box").find(".et_pb_project_nav").show()}function ee(t,i){var o;i=void 0!==i&&i;return o=void 0!==window.tinyMCE&&window.tinyMCE.get(t)&&!window.tinyMCE.get(t).isHidden()?window.tinyMCE.get(t).getContent():e("#".concat(t)).val(),i&&void 0!==window.tinyMCE&&(o=(o=o.replace(/<p>\[/g,"[")).replace(/\]<\/p>/g,"]")),o.trim()}function te(e){var t=e.replace(/et_pb_row /g,"et_pb_row_inner ").replace(/et_pb_row\]/g,"et_pb_row_inner]");return t=t.replace(/et_pb_column /g,"et_pb_column_inner ").replace(/et_pb_column\]/g,"et_pb_column_inner]")}function ie(){var e="tinymce";return"html"===getUserSetting("editor")&&(e="html"),e}function oe(e){return!(void 0===window.tinyMCE||!window.tinyMCE.get(e)||window.tinyMCE.get(e).isHidden())}function ne(){var t=e("#post_ID").val(),i="https:"===window.location.protocol;wpCookies.set("et-editor-available-post-".concat(t,"-bb"),"bb",1800,et_pb_options.cookie_path,!1,i),wpCookies.set("et-editing-post-".concat(t,"-bb"),"bb",300,et_pb_options.cookie_path,!1,i),wpCookies.remove("et-saving-post-".concat(t,"-bb"),et_pb_options.cookie_path,!1,i),wpCookies.remove("et-saved-post-".concat(t,"-bb"),et_pb_options.cookie_path,!1,i)}function ae(t,i,o){o=o||"",oe("content");var n=oe(t),a=i.trim();if("load_secondary_editor"===o&&(a=_.unescape(a)),void 0!==window.tinyMCE&&window.tinyMCE.get(t)&&n){var s=window.tinyMCE.get(t);"load_secondary_editor"===o&&(a=window.switchEditors.wpautop(a)),s.setContent(a,{format:"html"})}e("#".concat(t)).length&&e("#".concat(t)).val(a),W[t]||"content"===t||(void 0!==tinyMCEPreInit.mceInit[t]?quicktags({id:t}):quicktags(tinyMCEPreInit.qtInit[t]),QTags._buttonsInit(),W[t]=!0),wp.heartbeat&&wp.heartbeat.hasConnectionError()||(e("#publish").removeClass("disabled"),delete V.disable_publish)}function se(e){void 0!==window.tinyMCE&&(window.tinyMCE.execCommand("mceRemoveEditor",!1,e),void 0!==window.tinyMCE.get(e)&&window.tinyMCE.remove("#".concat(e)),W[e]=!1)}function le(t){t.length&&t.each((function(){e(this).trigger("change")}))}function _e(t){if(0!==t.length){var i=t.closest(".et-pb-options-toggle-container");if(0!==i.length){var o=!1;i.find(".et-pb-option").length>0&&i.find(".et-pb-option").each((function(){"none"!==e(this).css("display")&&(o=!0)})),o?i.removeClass("et-pb-options-toggle-empty"):i.addClass("et-pb-options-toggle-empty")}}}function de(e,t){var i=void 0===e.data("device")?"all":e.data("device");if("all"!==i&&"phone"!==i){var o,n,a=void 0!==t?t:e.val(),s=e.hasClass("et-pb-range-input")||e.hasClass("et-pb-range"),l=e.hasClass("et_custom_margin_main"),d=s?".et-pb-range-input":".et-pb-main-setting",r=e.siblings("".concat(d,".et_pb_setting_mobile_tablet")),c=e.siblings("".concat(d,".et_pb_setting_mobile_phone")),p=void 0===r.data("default")?"":r.data("default"),b=void 0===c.data("default")?"":c.data("default"),u=_.isNaN(parseFloat(a))?0:parseFloat(a),g=!1;s?(o=e.siblings(".et-pb-range.et_pb_setting_mobile_tablet"),n=e.siblings(".et-pb-range.et_pb_setting_mobile_phone")):e.hasClass("et_custom_margin_main")||(a=Se(a,!1,"")),"desktop"===i?("no"===r.data("has_saved_value")&&r.val()===p&&(r.val(a).trigger("change"),g=!0,s&&o.val(u)),r.data("default",a),s&&o.data("default",u),l&&xe(r)):g=!0,g&&("no"===c.data("has_saved_value")&&c.val()===b&&(c.val(a).trigger("change"),s&&n.val(u),l&&xe(c)),c.data("default",a),s&&n.data("default",u))}}function re(e){var t=e.find(".et-pb-main-setting.et_pb_setting_mobile_active"),i="".concat(t.val()),o=t.hasClass("et-pb-range"),n=void 0===t.data("default")?"":"".concat(t.data("default")),a=e.find(".et-pb-reset-setting");i!==(o&&""!==n?"".concat(parseFloat(n)):n)?a.addClass("et-pb-reset-icon-visible"):a.removeClass("et-pb-reset-icon-visible")}function ce(e,t){e.find(".et_pb_setting_mobile").removeClass("et_pb_setting_mobile_active"),e.find(".et_pb_setting_mobile_".concat(t)).addClass("et_pb_setting_mobile_active"),e.find(".et_pb_mobile_settings_tab").removeClass("et_pb_mobile_settings_active_tab"),e.find('.et_pb_mobile_settings_tab[data-settings_tab="'.concat(t,'"]')).addClass("et_pb_mobile_settings_active_tab"),re(e)}function pe(t,i){$.findWhere({cid:i});var o=t.find(".et-pb-options-tabs-links"),n=t.find(".et-pb-options-tab"),a=t.find(".et-pb-affects"),l=t.find(".et-pb-responsive-affects"),d=t.find(".et_custom_margin_main"),r=t.find(".et_custom_margin"),c=t.find(".et-pb-option--font"),b=t.find(".et_builder_font_style"),u=t.find(".et_builder_font_weight, .et_pb_font_line_style_select, .et-pb-font-line-color-value"),g=t.find(".et_pb_select_placeholder"),h=t.find("select.et-pb-text-align-select"),f=t.find(".et_builder_text_align"),m=t.find(".et_pb_multiple_buttons_wrapper input"),v=t.find(".et_builder_multiple_buttons_button"),w=t.find(".et-pb-range"),y=t.find(".et-pb-range-input"),k=t.find(".et-pb-options-tab-advanced").find(".et-pb-main-setting"),C=t.find(".et-pb-custom-color-picker"),S=t.find(".et-pb-choose-custom-color-button"),j=t.find(".et-pb-option-container--select_with_option_groups select"),T=t.find(".et_pb_yes_no_button_wrapper"),V=t.find(".et_pb_yes_no_button"),U=t.find(".et_pb_yes_no_button_wrapper select"),O=t.find(".et-pb-validate-unit"),A=t.find(".et_options_list:not(.et_conditional_logic)"),M=t.find(".et_conditional_logic"),L=t.find(".et_select_animation"),E=t.find(".et-preset-container"),D=t.find(".et-pb-option--background, .et-pb-option--background-field"),I=t.find("input.regular-text.et_pb_setting_mobile"),P="et_pb_hidden",R=t.find(".et-pb-options-tab-custom_css .et-pb-option"),H=t.find(".et-pb-mobile-settings-toggle"),N=t.find(".et_pb_mobile_settings_tabs"),B=t.find(".et_pb_checkboxes_wrapper"),z=B.find('input[type="checkbox"]'),F="section"===t.data("module_type")?t.find("#et_pb_background_color"):"",W=t.find("#et_pb_gutter_width"),J=t.find("#et_pb_google_api_key"),K=t.find(".et_pb_update_google_key"),q=t.find("#et_pb_field_id"),Y=t.find(".et_pb_contains_tabbed_subtoggle");function Z(e,t,i){var o=e.parents(".et_options_list_row");t&&(o=e.parent().find(".et_options_list_row").last());var n=o.clone();n.find(".et_options_list_checked").removeClass("et_options_list_checked"),i&&n.find("input[type=text]").val(""),n.insertAfter(o),n.find("input[type=text]").trigger("focus")}function X(t,i){var o=[];i.val(""),t.find("input[type=text]").each((function(){var t=e(this),i=t.prev(".et_options_list_checked").length>0,n={value:t.val(),checked:0};""!==n.value&&(i&&(n.checked=1),o.push(n))})),i.val(JSON.stringify(o))}function Q(t,i,o,n){var a=null;switch(t){case"checkbox":case"radio":case"select":var s;switch(t){case"checkbox":s=o.et_pb_checkbox_options;break;case"radio":s=o.et_pb_radio_options;break;case"select":s=o.et_pb_select_options}var l=function(e){""===e&&(e="[]");var t;return t=(t=(t=(t=e.replace(/%22/g,'"')).replace(/%91/g,"[")).replace(/%92/g,"\\")).replace(/%93/g,"]"),JSON.parse(t)}(s);a=e("<select></select>"),e.each(l,(function(t,o){var n=e('<option value="'.concat(o.value,'">').concat(o.value,"</option>"));a.append(n),""!==i&&a.val(i)}));break;default:a=e('<input type="text" value="'.concat(i,'" />'))}return a.addClass("et_conditional_logic_value"),a}function ee(t){var i=t.find("textarea"),o=[];t.find(".et_options_list_row").each((function(){var t=e(this),i=t.find(".et_conditional_logic_field").val(),n=t.find(".et_conditional_logic_condition").val(),a=t.find(".et_conditional_logic_value"),s=a.val(),l=t.find(".et_conditional_logic_field").find("option:selected").data("type"),d=!_.includes(["radio","select","checkbox"],l)&&s,r={field:i,condition:n,value:s};!1!==d&&t.attr("data-selected-value",d),o.push(r),a.prop("disabled",!1),_.includes(["is empty","is not empty"],n)&&a.prop("disabled",!0)})),i.val(JSON.stringify(o))}J.length&&(K.attr("href",et_pb_options.options_page_url),""===et_pb_options.google_api_key?(J.addClass("et_pb_hidden_field"),K.text(K.data("empty_text")).addClass("et_pb_no_field_visible")):J.val(et_pb_options.google_api_key)),""!==F&&""!==et_pb_options.page_section_bg_color&&(""===F.val()&&(F.val(et_pb_options.page_section_bg_color),F.trigger("change")),F.data("default",et_pb_options.page_section_bg_color)),W&&""!==et_pb_options.page_gutter_width&&(W.siblings(".et-pb-main-setting").data("default",et_pb_options.page_gutter_width),W.data("default",et_pb_options.page_gutter_width)),Y.length&&Y.each((function(){var t=e(this),i=t.find(".subtoggle_tabs_nav");if(!(i.length<1||i.find(".subtoggle_tabs_nav_item").length<1)){var o="".concat(100/i.find(".subtoggle_tabs_nav_item").length,"%");i.find(".subtoggle_tabs_nav_item").css({width:o}),e(i.find(".subtoggle_tabs_nav_item a")[0]).addClass("et-bb-active-sub-tab"),e(t.find(".et_pb_tabbed_subtoggle")[0]).addClass("et-bb-active-subtoggle"),i.find(".subtoggle_tabs_nav_item a").on("click",(function(i){i.preventDefault();var o=e(this),n=o.data("tab_id");t.find(".subtoggle_tabs_nav_item a").removeClass("et-bb-active-sub-tab"),o.addClass("et-bb-active-sub-tab"),t.find(".et_pb_tabbed_subtoggle").removeClass("et-bb-active-subtoggle"),t.find("[data-tab_id='".concat(n,"']")).addClass("et-bb-active-subtoggle")}))}})),N.length&&N.each((function(){var t=e(this).closest(".et-pb-option"),i=t.find(".et_pb_mobile_last_edited_field").val(),o=t.find(".et_pb_setting_mobile");if(o.length&&o.each((function(){var t=e(this),i=t.data("device"),o="desktop"!==i&&void 0!==t.data("has_saved_value")?t.data("has_saved_value"):"no",n=t.attr("type"),a="tablet"===i?t.siblings('input[type="'.concat(n,'"].et_pb_setting_mobile_desktop')).val():t.siblings('input[type="'.concat(n,'"].et_pb_setting_mobile_tablet')).val();"desktop"!==i&&("no"===o&&t.val(a),t.data("default",a))})),void 0!==i&&""!==i){var n=i.split("|");if(void 0===n[0]||"on"!==n[0])return;t.find(".et-pb-mobile-settings-toggle").addClass("et-pb-mobile-icon-visible et-pb-mobile-settings-active"),t.toggleClass("et_pb_has_mobile_settings"),void 0!==n[1]&&""!==n[1]&&ce(t,n[1])}})),H.on("click",(function(){var t=e(this),i=t.closest(".et-pb-option"),o=i.find(".et_pb_mobile_last_edited_field"),n=o.val(),a=""!==n?n.split("|"):[],s=void 0!==a[1]&&""!==a[1]?a[1]:"desktop",l=i.find(".et-pb-reset-setting");return t.toggleClass("et-pb-mobile-settings-active"),i.toggleClass("et_pb_has_mobile_settings"),ce(i,s),i.addClass("et_pb_animate_options"),setTimeout((function(){i.removeClass("et_pb_animate_options")}),500),i.hasClass("et_pb_has_mobile_settings")?(l.data("device",s),a[0]="on"):(l.data("device","all"),a[0]="off",ce(i,"desktop")),a[1]=void 0!==a[1]?a[1]:"",o.val("".concat(a[0],"|").concat(a[1])).trigger("et_pb_setting:change"),!1})),N.find("a").on("click",(function(){var t=e(this),i=t.closest(".et-pb-option-container"),o=t.data("settings_tab"),n=i.find(".et_pb_mobile_last_edited_field");return t.closest(".et_pb_mobile_settings_tabs").find("a").removeClass("et_pb_mobile_settings_active_tab"),t.addClass("et_pb_mobile_settings_active_tab"),i.find(".et_pb_setting_mobile").removeClass("et_pb_setting_mobile_active"),i.find(".et_pb_setting_mobile_".concat(o)).addClass("et_pb_setting_mobile_active"),i.find(".et-pb-reset-setting").data("device",o),n.val("on|".concat(o)),re(i),!1})),B.length&&B.each((function(){var t,i,o=e(this),n=o.find("input.et-pb-main-setting").val(),a=o.find('input[type="checkbox"]');""!==n&&(t=n.split("|"),i=0,a.each((function(){"on"===t[i]&&e(this).prop("checked",!0);i++})))})),z.on("click",(function(){var t,i,o=e(this),n=e(this).attr("class"),a=o.closest(".et_pb_checkboxes_wrapper"),s=a.find(".et_pb_disabled_option"),l=a.find('input[type="checkbox"]'),_=a.find("input.et-pb-main-setting"),d=!0===o.prop("checked")?"on":"off",r=0,c=[];l.each((function(){e(this).hasClass(n)&&(t=r),r++,c.push("")})),(i=""!==_.val()?_.val().split("|"):c)[t]=d,_.val(i.join("|")),s.length&&("on"===i[0]&&"on"===i[1]&&"on"===i[2]?s.val("on"):s.val("off"))})),I.on("input change",(function(){de(e(this))})),C.each((function(){var t=e(this),i=t.val(),o=t.closest(".et-pb-custom-color-container"),n=t.closest(".et-pb-options-tab"),a=o.siblings(".et-pb-choose-custom-color-button"),s=void 0!==t.data("old-option-ref")&&""!==t.data("old-option-ref")?t.data("old-option-ref"):"",l=""!==s?n.find(".et-pb-option-".concat(s)):"",_=""!==l&&l.length?l.find("input"):"",d=o.find(".et-pb-color-picker-hex"),r=ve(d).toLowerCase();if(""!==_&&(""===i&&""!==_.val()&&(i=_.val()),_.val("")),""===i||i===r)return!0;o.removeClass(P),a.addClass(P),d.wpColorPicker("color",i)})),S.on("click",(function(){var t=e(this),i=t.siblings(".et-pb-custom-color-container"),o=i.find(".et-pb-color-picker-hex"),n=i.find(".et-pb-custom-color-picker");return t.addClass(P),i.removeClass(P),i.find(".wp-color-result").trigger("click"),n.val(o.wpColorPicker("color")),!1})),j.each((function(){var t=e(this).siblings("input.et-pb-main-setting"),i=t.val().split("|"),o=i.length>1?i[0]:"",n=i.length>1?i[1]:i[0];""===o&&(o=e(this).find(":selected").parent().attr("label"),t.val("".concat(o,"|").concat(n)).trigger("change")),e(this).val(n),e(this).on("change",(function(){var i=e(this).find(":selected").parent().attr("label")||"";t.val("".concat(i,"|").concat(e(this).val())).trigger("change")}))})),T.each((function(){var t=e(this),i=t.find(".et_pb_yes_no_button");"on"===t.find("select").val()?(i.removeClass("et_pb_off_state"),i.addClass("et_pb_on_state")):(i.removeClass("et_pb_on_state"),i.addClass("et_pb_off_state"))})),A.each((function(){var t,i=e(this),o=i.find("textarea"),n=o.val();if(i.on("keydown","input[type=text]",(function(e){"Enter"===e.key&&e.stopPropagation()})),i.on("keyup","input[type=text]",(function(n){clearTimeout(t),"Enter"===n.key&&Z(e(this),!1,!0),t=setTimeout((function(){X(i,o)}),500)})),i.on("click",".et-pb-add-sortable-option",(function(t){t.preventDefault(),Z(e(this),!0,!0)})),i.on("click",".et_options_list_copy",(function(t){t.preventDefault(),Z(e(this))})),i.on("click",".et_options_list_remove",(function(t){if(t.preventDefault(),1===i.find(".et_options_list_row").length)return i.find(".et_options_list_row").first().find("input[type=text]").val(""),void X(i,o);e(this).parents(".et_options_list_row").remove(),X(i,o)})),i.on("click",".et_options_list_check",(function(t){t.preventDefault();var n=e(this);n.parent().hasClass("et_options_list_row_radio")&&i.find(".et_options_list_check").not(n).removeClass("et_options_list_checked"),n.toggleClass("et_options_list_checked"),X(i,o)})),!n){var a=parseInt(i.parents("[data-parent-cid]").attr("data-parent-cid")),s=$.findWhere({cid:a}),l=!_.isUndefined(s.attributes.et_pb_checkbox_checked)&&"on"===s.attributes.et_pb_checkbox_checked,d=_.isUndefined(s.attributes.et_pb_field_title)?"":s.attributes.et_pb_field_title;n=JSON.stringify([{value:d,checked:!0===l?1:0}]),o.val(n),"checkbox"===s.attributes.et_pb_field_type&&i.find(".et_options_list_row_checkbox").length>0&&setTimeout((function(){e("#et_pb_field_title").val("")}),0)}!function(t,i,o){if(""===o||_.isUndefined(o))return;var n=t.find(".et_options_list_row").first(),a=e("<div>").addClass("et_options_rows");try{o=JSON.parse(o)}catch(e){o=o.replace(/\{("value":")(.*?)(",)("checked":.,?.*?)\}/gi,(function(e,t,i,o,n){var a=i.replace(/(.)?(")/gi,(function(e,t,i){return"\\"!==t?"".concat(t,"\\").concat(i):e}));return"{".concat(t).concat(a).concat(o).concat(n,"}")})),o=JSON.parse(o)}for(var s=0;s<o.length;s++){var l=o[s],d=1===l.checked,r=n.clone();r.find("input[type=text]").val(l.value),r.find(".et_options_list_check").toggleClass("et_options_list_checked",d),r.appendTo(a)}a.insertAfter(n),n.remove()}(i,0,n),i.children(".et_options_rows").sortable({axis:"y",containment:"parent",update:function(){X(i,o),setTimeout((function(){e(".et_options_rows").children().css({position:"",top:"",left:""})}),700)}})})),M.each((function(){var t=e(this),i=t.find("textarea").val();i=""!==i?i:"[]",i=JSON.parse(i);var o=e(this).find(".et_options_list_row");if(1<i.length)for(var n=1;n<i.length;n++){var a=o.clone();t.find(".et_options_list_row").last().after(a)}setTimeout((function(){var o={},n=t.parents(".et_pb_modal_settings_container_step2"),a=n.data("parent-cid"),s=n.prev(".et_pb_modal_settings_container").find('ul.et-pb-sortable-options li:not([data-cid="'.concat(a,'"])')),l=t.find(".et_conditional_logic_field");s.each((function(){var t=e(this).data("cid"),i=$.findWhere({cid:t}).attributes,n=i.et_pb_field_id;if(""!==n){n=n.toLowerCase();var a=_.isUndefined(i.et_pb_field_type)?"input":i.et_pb_field_type,s=_.isUndefined(i.et_pb_field_title)?n:i.et_pb_field_title;s=""!==s.trim()?s:n;var d=e('<option data-type="'.concat(a,'" value="').concat(n,'">').concat(s,"</option>"));l.append(d),o[n]=i}}));var d="";for(var r in o)if(o.hasOwnProperty(r)){d=r;break}var c=o[d].et_pb_field_id.toLowerCase();0===i.length&&0!==o.length&&i.push({field:c,condition:"is",value:""});for(var p=0;p<i.length;p++){var b=i[p],u=t.find(".et_options_list_row").eq(p),g=(l=u.find(".et_conditional_logic_field")).next(".et_conditional_logic_condition"),h=o[c],f="input",m="",v=_.isUndefined(b.field)||_.isUndefined(o[b.field])?c:b.field,w=_.isUndefined(b.condition)?"is":b.condition;_.isUndefined(o[b.field])||(h=o[b.field],m=b.value,f=_.isUndefined(h.et_pb_field_type)?"input":h.et_pb_field_type),u.find(".et_conditional_logic_value").remove(),Q(f,m,h,t).insertAfter(g),l.val(v),g.val(w)}ee(t),t.on("change",".et_conditional_logic_field",(function(){var i=e(this),n=i.val(),a=i.next(".et_conditional_logic_condition"),s=i.parents(".et_options_list_row"),l=o[n],d="",r=_.isUndefined(l.et_pb_field_type)?"input":l.et_pb_field_type,c=s.attr("data-selected-value");c&&!_.includes(["radio","select","checkbox"],r)&&(d=c),s.find(".et_conditional_logic_value").remove(),Q(r,d,l,t).insertAfter(a),ee(t)})),t.on("change",".et_conditional_logic_condition, .et_conditional_logic_value",(function(){ee(t)})),t.on("click",".et-pb-add-sortable-option",(function(t){t.preventDefault(),function(e,t){if(0===t.length)return;var i=e.parents(".et_conditional_logic"),o=i.find(".et_options_list_row").last(),n=o.clone(),a=n.find(".et_conditional_logic_condition"),s="";for(var l in t)if(t.hasOwnProperty(l)){s=l;break}var d=t[s],r="",c=_.isUndefined(d.et_pb_field_type)?"input":d.et_pb_field_type;n.find(".et_conditional_logic_value").remove(),Q(c,r,d,i).insertAfter(a),a.val("is"),n.insertAfter(o),ee(i)}(e(this),o)})),t.on("click",".et_options_list_remove",(function(t){t.preventDefault(),function(e){var t=e.parent(".et_options_list_row"),i=t.parent(".et_conditional_logic");if(1===i.find(".et_options_list_row").length)return;t.remove(),ee(i)}(e(this))}))}),0)})),q.on("focusout",(function(){var t=e(this).val().replace(/\s+/g,"_"),i=q.parents(".et_pb_modal_settings_container_step2"),o=i.prev(".et_pb_modal_settings_container"),n=i.data("parent-cid"),a=o.find('ul.et-pb-sortable-options li:not([data-cid="'.concat(n,'"])')),s=[];if(a.each((function(){var t=e(this).data("cid"),i=$.findWhere({cid:t}).attributes;s.push(i)})),""===t){var l=$.findWhere({cid:n}),_=parseInt(l.attributes.module_order);t="Field_".concat(_+1)}for(;;){for(var d=!1,r=0;r<s.length;r++){if(s[r].et_pb_field_id.toLowerCase()===t.toLowerCase()){t="".concat(t,"_2"),d=!0;break}}if(!1===d)break}e(this).val(t)})),L.each((function(){var t=e(this),i=t.find('input[type="hidden"]'),o=i.val();t.find('.et_animation_button_title[data-value="'.concat(o,'"]')).parent().addClass("et_active_animation"),t.on("click",".et_animation_button a",(function(o){o.preventDefault();var n=e(this);if(!n.hasClass("et_active_animation")){var a=n.find(".et_animation_button_title").attr("data-value");a=a.trim(),t.find(".et_animation_button a").removeClass("et_active_animation"),n.addClass("et_active_animation"),i.val(a).trigger("change")}}))})),E.each((function(){var t=e(this),i=t.find('input[type="hidden"]'),o="et-preset-active",n=function(e,i){var o=t.closest(".et-pb-options-toggle-container").find("#et_pb_".concat(e));o.val(i),o.trigger("change")},a=function(){t.find(".et-preset").removeClass(o),t.find('.et-preset[data-value="'.concat(i.val(),'"]')).addClass(o)};t.on("click",".et-preset",(function(a){var s=e(this),l=s.attr("data-value").trim(),_={};if(a.preventDefault(),!s.hasClass(o)){t.find(".et-preset").removeClass(o),s.addClass(o),i.val(l).trigger("change");try{_=JSON.parse(s.attr("data-fields"))}catch(e){_=[]}e.each(_,n)}})),i.on("change",a),a()})),V.on("click",(function(){var t=e(this),i=t.closest(".et_pb_yes_no_button_wrapper").find("select");t.hasClass("et_pb_off_state")?(t.removeClass("et_pb_off_state"),t.addClass("et_pb_on_state"),i.val("on")):(t.removeClass("et_pb_on_state"),t.addClass("et_pb_off_state"),i.val("off")),i.trigger("change")})),U.on("change",(function(){var t=e(this),i=t.closest(".et_pb_yes_no_button_wrapper").find(".et_pb_yes_no_button");"on"===t.val()?(i.removeClass("et_pb_off_state"),i.addClass("et_pb_on_state")):(i.removeClass("et_pb_on_state"),i.addClass("et_pb_off_state"))})),D.length&&D.each((function(){var t=e(this),i=t.is(".et-pb-option--background"),o=i?".et-pb-option--background":".et-pb-option--background-field",n=t.find(".et-pb-option-container-inner").data("base_name"),a=i?"":"".concat(n,"_"),s=t.find(".et_pb_background-tab-navs li").length;t.find(".et_pb_background-tab").first().show(),t.find(".et_pb_background-tab-navs li").first().find("a").addClass("active"),4!==s&&t.find(".et_pb_background-tab-navs li").css({width:"".concat(100/s,"%")}),t.find(".et_pb_background-tab-navs").on("click","a",(function(t){t.preventDefault();var i=e(this),n=i.attr("data-tab"),a=i.closest(o);a.find(".et_pb_background-tab-navs a").removeClass("active"),i.addClass("active"),a.find(".et_pb_background-tab:visible").hide(),a.find('.et_pb_background-tab[data-tab="'.concat(n,'"]')).fadeIn(),a.find('.et_pb_background-tab[data-tab="'.concat(n,'"]')).find(".et-pb-affects").trigger("change"),v(i.closest(o),!1)}));var l=t.find(".et_pb_background-tab--gradient"),d=l.find(".et-pb-option-preview"),r=d.find(".et-pb-option-preview-button--add"),c=d.find(".et-pb-option-preview-button--swap"),b=d.find(".et-pb-option-preview-button--delete"),u=i?"use_background_color_gradient":"".concat(n,"_use_color_gradient"),g=l.find(".et_pb_background-option--".concat(u," .et_pb_yes_no_button")),h=l.find(".et_pb_background-option--".concat(u," select")),f=l.find(".et_pb_background-option--".concat(n,"_color_gradient_start .wp-color-picker")),m=ke(l,n);function v(t,i){t.find(".et_pb_background-tab").each((function(){var o=e(this),a=!1,s=o.attr("data-tab"),l=t.find('.et_pb_background-tab-nav[data-tab="'.concat(s,'"]'));switch(s){case"color":var d=o.find(".et_pb_background-option--use_background_color"),r=o.find(".et_pb_background-option--".concat(n,"_color"));d.length&&r.length?a="on"===d.find("select option:selected").val()&&""!==r.find(".et-pb-color-picker-hex").val():!d.length&&r.length&&(a=""!==r.find(".et-pb-color-picker-hex").val());break;case"gradient":"on"===o.find(".et_pb_background-option--".concat(u," select option:selected")).val()&&(a=!0);break;case"image":var c=o.find(".et_pb_background-option--".concat(n,"_image .et-pb-upload-field")).val()||o.find(".et_pb_background-option--background_url .et-pb-upload-field").val();_.isUndefined(c)||""===c||(a=!0);break;case"video":var p=o.find(".et_pb_background-option--".concat(n,"_video_mp4 .et-pb-upload-field")).val(),b=o.find(".et_pb_background-option--".concat(n,"_video_webm .et-pb-upload-field")).val();(!_.isUndefined(p)&&""!==p||!_.isUndefined(b)&&""!==b)&&(a=!0)}a?(l.addClass("et-pb-filled"),i&&(t.find(".et_pb_background-tab").removeAttr("style"),l.trigger("click"))):l.removeClass("et-pb-filled")}))}m&&(d.css({backgroundImage:m}),d.removeClass("et-pb-option-preview--empty")),d.on("click",(function(e){e.preventDefault(),e.stopPropagation(),d.hasClass("et-pb-option-preview--empty")?(g.removeClass("et_pb_off_state").addClass("et_pb_on_state"),h.val("on").trigger("change"),d.removeClass("et-pb-option-preview--empty")):f.wpColorPicker("open",!0)})),r.on("click",(function(e){e.stopPropagation(),g.removeClass("et_pb_off_state").addClass("et_pb_on_state"),h.val("on").trigger("change"),d.removeClass("et-pb-option-preview--empty")})),b.on("click",(function(e){e.stopPropagation(),g.removeClass("et_pb_on_state").addClass("et_pb_off_state"),h.val("off").trigger("change"),d.addClass("et-pb-option-preview--empty")})),c.on("click",(function(t){t.preventDefault(),t.stopPropagation();var i=e(this).closest(o),a=i.find(".et_pb_background-option--".concat(n,"_color_gradient_start .et-pb-color-picker-hex")),s=i.find(".et_pb_background-option--".concat(n,"_color_gradient_end .et-pb-color-picker-hex")),l=a.val(),_=s.val();a.val(_).trigger("change"),s.val(l).trigger("change")})),l.on("change input keyup",'select, input[type="text"], input[type="range"]',(function(){ye(e(this))})),v(t,!0);var w=t.find(".et-pb-option-container--background").attr("data-column-index"),y=void 0===w?"":"_".concat(w),k=["#et_pb_".concat(n,"_color").concat(y),"#et_pb_use_background_color","#et_pb_".concat(n,"_color_gradient_start").concat(y),"#et_pb_".concat(n,"_color_gradient_end").concat(y),"#et_pb_".concat(u).concat(y),"#et_pb_".concat(n,"_color_gradient_type").concat(y),"#et_pb_".concat(n,"_color_gradient_direction").concat(y),"#et_pb_".concat(n,"_color_gradient_direction_radial").concat(y),"#et_pb_".concat(n,"_color_gradient_start_position").concat(y),"#et_pb_".concat(n,"_color_gradient_end_position").concat(y),void 0===w?"#et_pb_bg_img".concat(y):"#et_pb_background_image","#et_pb_background_url","#et_pb_".concat(a,"parallax").concat(y),"#et_pb_".concat(a,"parallax_method").concat(y),"#et_pb_".concat(n,"_size").concat(y),"#et_pb_".concat(n,"_position").concat(y),"#et_pb_".concat(n,"_repeat").concat(y),"#et_pb_".concat(n,"_blend").concat(y),".et-pb-range"];t.find(k.join(", ")).on("change",(function(){p(t.find(".et_pb_background-tab--image .et-pb-upload-button"))})),setTimeout((function(){e("#et_pb_featured_placement").length&&e("#et_pb_featured_placement").on("change",(function(){p(t.find(".et_pb_background-tab--image .et-pb-upload-button"))})),e("#et_pb_featured_image").length&&e("#et_pb_featured_image").on("change",(function(){p(t.find(".et_pb_background-tab--image .et-pb-upload-button"))}))}),700)})),o.find("li a").on("click",(function(){var t=e(this),i=t.closest("li").index(),n=t.closest("ul"),a=n.siblings(".et-pb-options-tabs"),s="et-pb-options-tabs-links-active",l=n.find(".".concat(s)),_=l.index(),d=a.find(".et-pb-options-tab").eq(_),r=a.find(".et-pb-options-tab").eq(i);return _!==i&&(r.css({display:"none",opacity:0}),d.css({display:"block",opacity:1}).stop(!0,!0).animate({opacity:0},300,(function(){e(this).css("display","none"),r.css({display:"block",opacity:0}).stop(!0,!0).animate({opacity:1},300,(function(){var t=e(this);t.find(".et-pb-option:visible").length||r.hasClass("et-pb-options-tab-view_stats")?e(".et-pb-all-options-hidden").remove():t.append('<p class="et-pb-all-options-hidden">'.concat(et_pb_options.all_tab_options_hidden,"<p>")),o.trigger("et_pb_main_tab:changed")}))})),l.removeClass(s),n.find("li").eq(i).addClass(s),e(".et-pb-options-tabs").animate({scrollTop:0},400,"swing")),!1})),n.each((function(){var t=e(this).find(".et-pb-options-toggle-enabled"),i="et-pb-option-toggle-content-open",o="et-pb-option-toggle-content-closed",n="et-pb-option-toggle-content";t.find("h3").on("click",(function(){var s=e(this),l=s.siblings(".".concat(n)),_=s.closest(".et-pb-options-toggle-container"),d=t.filter(".".concat(i)),r=d.find(".".concat(n));_.hasClass(i)||(d.removeClass(i).addClass(o),r.slideToggle(300),_.removeClass(o).addClass(i),l.slideToggle(300,(function(){le(a)})))}))})),d.length&&(d.each((function(){xe(e(this))})),d.on("et_main_custom_margin:change",(function(){xe(e(this))}))),r.on("change",(function(){var t=e(this),i=void 0!==t.data("device")?t.data("device"):"all",o=t.closest(".et_margin_padding"),n=o.closest(".et-pb-option-container").find(".et-pb-mobile-settings-toggle"),a="all"===i?o.find(".et_custom_margin_main"):o.find(".et_custom_margin_main.et_pb_setting_mobile_".concat(i)),s="all"===i?".et_custom_margin":".et_custom_margin.et_pb_setting_mobile_".concat(i),l="",_=t.closest(".et-pb-option").data("option_name"),d={custom_padding:"padding",custom_margin:"margin"};o.find(s).each((function(){l+="".concat(Se(e(this).val(),e(this).hasClass("auto_important"),void 0,d[_]).trim(),"|")})),"|||"===(l=l.slice(0,-1))?l="":n.addClass("et-pb-mobile-icon-visible"),a.val(l).trigger("et_pb_setting:change"),de(a)})),b.on("click",(function(){var t=e(this),i=t.closest(".et_builder_font_styles"),o=t.data("button_name");t.closest(".et-pb-option-container--font");return t.toggleClass("et_font_style_active"),_.forEach([["uppercase","capitalize"],["underline","line_through"]],(function(e){-1!==_.indexOf(e,o)&&_.forEach(e,(function(e){e!==o&&i.find(".et_builder_".concat(e,"_font")).removeClass("et_font_style_active")}))})),ue(t.closest(".et-pb-option-container--font")),je(t.closest(".et-pb-option--font")),!1})),u.on("change",(function(){ue(e(this).closest(".et-pb-option-container--font"))})),c.on("click",".et-pb-settings-option-select li",(function(t){var i=e(this),o=i.closest(".et-pb-option--font"),n=o.find(".et-pb-settings-option-select-advanced"),a=i.data("value");if(!_.isUndefined(a)){if(e(t.target).closest(".et-pb-user-font-marker").length>0)return void G("delete_font",a);ue(o,a),ge(n),"default"!==a&&$e(a),je(o,!1)}})),c.on("click",".et-pb-font-upload-button",(function(t){G("upload_font",e(t.target).closest(".et-pb-option--font").data("option_name"))})),c.on("input",".et-pb-menu-filter",(function(){var t=e(this).val(),i=e(this).closest(".et-pb-settings-option-select-advanced"),o=i.find(".select-option-item");""!==t?i.addClass("et_pb_menu_search_active"):i.removeClass("et_pb_menu_search_active"),o.removeClass("et_pb_hidden_item");var n=_.filter(o,(function(i){return-1===e(i).text().toLowerCase().search(t.toLowerCase())}));e(n).addClass("et_pb_hidden_item")})),c.each((function(){je(e(this),!1,!0)})),g.on("click",(function(){var t=e(this),i=t.closest(".et-pb-select-font-outer"),o=i.find(".et-pb-settings-option-select-advanced"),n=o.find(".select-option-item"),a=i.find(".et-pb-menu-filter");o.addClass("et_pb_menu_active"),o.removeClass("et_pb_menu_search_active"),n.removeClass("et_pb_hidden_item"),a.val(""),o.animate({scrollTop:0},0);var s=t.offset(),l=e(window).height(),_=e(window).scrollTop(),d=500>l?l-50:500,r=s.top-_-20,c=l-r;c<d?r-=d-c+50:d=c-50,o.css({top:"".concat(r,"px"),maxHeight:"".concat(d,"px")}),e("body").addClass("et_pb_advanced_menu_opened")})),h.each((function(){var t=e(this),i=t.data("saved_value"),o=t.data("default"),n=""!==i?t.val():o,a=t.closest(".et-pb-option-container"),s=(a.find("select.et-pb-text-align-select"),""!==n&&a.find(".et_builder_".concat(n,"_text_align")));s&&s.addClass("et_text_align_active")})),h.on("change",(function(){var t=e(this),i=t.closest(".et-pb-option-container").find(".et_builder_text_align.et_text_align_active"),o=!!i.length&&i.data("value"),n=t.attr("data-default")===o?"":o;o&&(t.data("saved_value",n),t.val(o).trigger("et_pb_setting:change"))})),f.on("click",(function(){var t=e(this),i="et_text_align_active",o=t.closest(".et-pb-option-container"),n=t.hasClass(i),a=o.find(".et-pb-text-align-select"),s=a.attr("data-default");return o.find(".et_builder_text_align").removeClass(i),n?_.isUndefined(s)||""===s||o.find(".et_builder_".concat(s,"_text_align")).addClass(i):t.addClass(i),a.trigger("change"),!1})),m.each((function(){be(e(this))})),m.on("change",(function(){be(e(this))})),v.on("click",(function(){var t=e(this),i=t.closest(".et-pb-option-container").find("input"),o=i.data("default"),n=i.val(),a=_.isUndefined(n)||""===n?[]:n.split("|"),s=t.data("value"),l=n,d="yes"===i.data("multi");return"yes"===i.data("toggleable")&&t.hasClass("et_builder_multiple_buttons_button_active")?l=d?_.without(a,s).join("|"):o:(d&&a.push(s),l=d?a.join("|"):s),i.val(l).trigger("change"),!1})),w.on("input change",(function(){var t,i,o=e(this),n=void 0===o.data("device")?"all":o.data("device"),a=o.val(),s="all"===n?o.siblings(".et-pb-range-input"):o.siblings(".et-pb-range-input.et_pb_setting_mobile_".concat(n)),l=s.data("initial_value_set")||!1,_=s.data("unit")||"no_default_unit",d=Se(s.val().trim(),!1,_);if(isNaN(parseFloat(d))&&!l)return o.val(0),void s.data("initial_value_set",!0);t=parseFloat(d),""!==(i=(d+="").replace(t,"").trim())&&(a+=i),s.val(a).trigger("et_pb_setting:change"),de(o,a)})),w.length&&w.each((function(){var t=e(this),i=void 0===t.data("device")?"all":t.data("device"),o="all"===i?t.siblings(".et-pb-range-input"):t.siblings(".et-pb-range-input.et_pb_setting_mobile_".concat(i)),n=o.val().trim(),a=void 0!==t.data("default")&&"string"==typeof t.data("default")?t.data("default").trim():t.data("default"),s=void 0!==t.data("default_inherited")&&"string"==typeof t.data("default_inherited")?t.data("default_inherited").trim():t.data("default_inherited"),l=void 0!==s?s:a;if(""===n&&(""!==l&&(o.val(l),l=parseFloat(l)||0),t.val(l),n=l),"tablet"===i){var _=t.siblings(".et-pb-range-input.et_pb_setting_mobile_desktop").val();t.data("default",parseFloat(_)),o.data("default",_)}else if("phone"===i){var d=t.siblings(".et-pb-range-input.et_pb_setting_mobile_tablet").val();t.data("default",parseFloat(d)),o.data("default",d)}he(t,n,!0)})),y.on("keyup change",_.debounce((function(t){var i,o=e(this),n=void 0===o.data("device")?"all":o.data("device"),a=Se(fe(o,!0),!1,o.data("unit")||"no_default_unit"),s="all"===n?o.siblings(".et-pb-range"):o.siblings(".et-pb-range.et_pb_setting_mobile_".concat(n)),l=!1;i=parseFloat(a)||0,_.isUndefined(t.type)||"keyup"!==t.type||(l=!0),he(s,i,l),o.val(a),s.val(i).trigger("et_pb_setting:change"),de(o)}),700)),O.length&&O.each((function(){var t=e(this),i=Se(t.val().trim());t.val(i)})),k.length&&(k.on("change et_pb_setting:change et_main_custom_margin:change",(function(){var t=e(this),i=void 0===t.data("device")?"all":t.data("device"),o=t.closest(".et-pb-option-container"),n=o.find(".et-pb-reset-setting"),a=t.hasClass("et-pb-range"),s=t.hasClass("et-pb-font-select"),l=t.hasClass("et-presets")||t.hasClass("et_select_animation"),_=a&&"all"===i?t.siblings(".et-pb-range-input"):t;l&&(_=t.children("input"));var d=ve(_=a&&"all"!==i?t.siblings(".et-pb-range-input.et_pb_setting_mobile_".concat(i)):_).toLowerCase(),r="".concat(_.val());r=r.toLowerCase();var c=o.find(".et-pb-mobile-settings-toggle");if(s){var p=r.split("|"),b=d.split("|");n.each((function(){var t=e(this),i=0;t.hasClass("et_pb_reset_weight")&&(i=1),""!==p[i]&&b[i]!==p[i]?t.addClass("et-pb-reset-icon-visible"):t.removeClass("et-pb-reset-icon-visible")}))}else!_.hasClass("et_pb_setting_mobile")||_.hasClass("et_pb_setting_mobile_active")?we(_)?(n.removeClass("et-pb-reset-icon-visible"),c.hasClass("et-pb-mobile-settings-active")||c.removeClass("et-pb-mobile-icon-visible")):(setTimeout((function(){n.addClass("et-pb-reset-icon-visible")}),50),c.addClass("et-pb-mobile-icon-visible")):(r!==d&&!a||a&&r!=="".concat(d,"px")&&r!==d)&&c.addClass("et-pb-mobile-icon-visible")})),k.trigger("change"),t.find(".et-pb-main-settings .et_pb_options_tab_advanced a").append('<span class="et-pb-reset-settings"></span>'),t.find(".et-pb-reset-settings").on("click",(function(){G("reset_advanced_settings",k)}))),t.find(".et-pb-reset-setting").not(".et-pb-reset-skip").on("click",(function(){Ce(e(this))}));var te=t.data("module_type"),ie=e();if("section"===te&&(te="et_pb_section"),"row"===te&&(te="et_pb_row"),x(window.et_pb_module_field_dependencies,te)){var oe=function e(i){var o=[],n=ne[i].affects,a=t.find("#et_pb_".concat(i)),s=a.closest(".et-pb-option"),l=function(e){var t=[];return ne[e].show_if&&(t=_.keys(ne[e].show_if)),ne[e].show_if_not&&(t=_.union(t,_.keys(ne[e].show_if_not))),t}(i);_.forEach(l,(function(e){var n=t.find("#et_pb_".concat(e)).val(),a=ne[e].affects[i].show_if,s=ne[e].affects[i].show_if_not;o.push(function(e,t,i){var o=!1;return t&&i?(t=_.isArray(t)?_.includes(t,e):e===t,i=_.isArray(i)?!_.includes(i,e):e!==i,o=t&&i):t?o=_.isArray(t)?_.includes(t,e):e===t:i&&(o=_.isArray(i)?!_.includes(i,e):e!==i),o}(n,a,s))})),o=!_.includes(o,!1),s.toggle(o).addClass("et_pb_animate_affected");var d=o?"et-pb-option-field-shown":"et-pb-option-field-hidden";a.trigger(d),setTimeout((function(){s.removeClass("et_pb_animate_affected"),_e(a)}),500),_.isUndefined(n)||_.forEach(n,(function(t,i){e(i)}))},ne=window.et_pb_module_field_dependencies[te];_.forEach(ne,(function(e,i){if(!_.isUndefined(e.affects)){var o=t.find("#et_pb_".concat(i));ie=ie.add(o),o.on("change",(function(){_.forEach(e.affects,(function(e,t){oe(t)}))}))}}))}a.length&&a.on("change",(function(){var i=e(this),o=i.closest(".et-pb-option"),n=i.val(),a=(parseInt(n),_.map(i.data("affects").split(", "),(function(e){return-1!==e.indexOf("#et_pb_")?e:"#et_pb_".concat(e)})).join(", ")),s=t.find(a),l=i.closest(".et-pb-options-tab").index(),d=[],r=function t(a,s){s=!0===s;var r=e(a),c=r.closest(".et-pb-option"),p=c.hasClass("et-pb-new-depends"),b="text"===i.attr("type"),u=c.data("depends_show_if")||"on",g=b?"":c.data("depends_show_if_not"),h=!s&&(u===n||void 0!==g&&!_.contains(g.split(","),n)),f=r.closest(".et-pb-options-tab").index(),m=c.find(".et-pb-affects"),v=i.closest(".et_pb_background-template--use_color_gradient").length;if(!(r.hasClass("et_pb_field_processed")||b&&!i.is(":visible")||p)){l!==f||!h||"none"!==o.css("display")||i.is('[type="hidden"]')||v||(h=!1),c.toggle(h).addClass("et_pb_animate_affected");var w=r.is(":visible")?"et-pb-option-field-shown":"et-pb-option-field-hidden";if(r.trigger(w),setTimeout((function(){c.removeClass("et_pb_animate_affected"),_e(r)}),500),m.length){var y=_.map(m.data("affects").split(", "),(function(e){return-1!==e.indexOf("#et_pb_")?e:"#et_pb_".concat(e)})).join(", "),k=e(y);h?d.push(r):k.each((function(){t(this,!0),_e(e(this))})).removeClass("et_pb_field_processed")}r.addClass("et_pb_field_processed")}};s.each((function(){r(this)})).removeClass("et_pb_field_processed"),_.forEach(d,(function(e){e.trigger("change")})),e(".et_options_list:not(.et_conditional_logic)").each((function(){var t=e(this);if(0===t.find(".et_options_rows").length){var i=t.find("textarea");t.find(".et_options_list_row").wrapAll('<div class="et_options_rows" />'),t.find(".et_options_rows").sortable({axis:"y",containment:"parent",update:function(){X(t,i),setTimeout((function(){e(".et_options_rows").children().css({position:"",top:"",left:""})}),700)}})}}))})),setTimeout((function(){n.css({display:"block"}),(a=a.add(ie)).data("is_rendering_setting_view",!0),le(a),a.data("is_rendering_setting_view",!1),n.css({display:"none"}),Re()}),100),setTimeout((function(){e(".et-pb-option-toggle-content").length>0&&e(".et-pb-option-toggle-content").each((function(){""===e(this).text().trim()&&e(this).closest(".et-pb-options-toggle-container").addClass("et-pb-options-toggle-empty")}))}),100),l.length&&(l.on("et_pb_setting:change",(function(){var t=e(this),i=t.parent(),o=(i.children(".et-pb-responsive-affects"),t.data("responsive-desktop-name")),n=t.data("responsive-affects").split(","),a={desktop:i.find("#".concat(o)).val(),tablet:i.find("#".concat(o,"_tablet")).val(),phone:i.find("#".concat(o,"_phone")).val()},s=(t.closest(".et_pb_modal_settings_container_step2").length?i.find('input[id="data.'.concat(o,'_last_edited"]')):i.find("#".concat(o,"_last_edited"))).val(),l="string"==typeof s&&"on"===s.split("|")[0];_.forEach(n,(function(t){var i=e("#et_pb_".concat(t)).closest(".et-pb-option:not(.et_pb_background-option)"),o=_.isUndefined(i.data("depends_show_if_not"))?[]:i.data("depends_show_if_not").split(","),n=!0;n=l?!_.contains(o,a.desktop)||!_.contains(o,a.tablet)||!_.contains(o,a.phone):!_.contains(o,a.desktop),i.toggle(n),i.siblings().length<1&&i.closest(".et-pb-options-toggle-container").toggle(n)}))})),setTimeout((function(){l.each((function(){e(this).trigger("et_pb_setting:change")}))}))),t.find(".et-pb-options-tabs-links").on("et_pb_main_tab:changed",(function(){var t,o,n=e(".et-pb-options-tabs-links").find(".et_pb_options_tab_custom_css"),a=e(".et-pb-options-tab-custom_css").find(".et_pb_module_order_placeholder");n.hasClass("et-pb-options-tabs-links-active")&&(t=void 0!==(o=$.findWhere({cid:i})).attributes.module_order?o.attributes.module_order:"",a.length&&a.replaceWith(t))})),R.length&&R.on("focusin",(function(){var t=e(this).closest(".et-pb-option"),i=t.find("label > span"),o=t.siblings().find("label > span");i.length&&(i.removeClass("et_pb_hidden_css_selector"),i.css({display:"inline-block"}),i.addClass("et_pb_visible_css_selector")),o.length&&(o.removeClass("et_pb_visible_css_selector"),o.addClass("et_pb_hidden_css_selector"),setTimeout((function(){o.css({display:"none"}),o.removeClass("et_pb_hidden_css_selector")}),200))})),t.on("click",".et_pb_global_sync_switcher",(function(){var t=e(this);t.hasClass("et_pb_global_unsynced")?t.removeClass("et_pb_global_unsynced"):t.addClass("et_pb_global_unsynced")})),new s.Controls.BorderRadius(t),new s.Controls.BorderStyles(t),new s.Controls.TabbedControl(t.find("#et_pb_divider_settings").parent()),t.on("click",".et-pb-option-container .description a",(function(e){var t=e.target.href;_.isUndefined(t)||(e.preventDefault(),window.open(t,"_blank").focus())}))}function be(e){e.data("default");var t=e.val(),i=e.closest(".et-pb-option-container"),o=""===t?[]:t.split("|");i.find(".et_builder_multiple_buttons_button").removeClass("et_builder_multiple_buttons_button_active"),o.length>0&&(_.forEach(o,(function(e){var t=i.find(".et_builder_".concat(e,"_button"));t.length>0&&t.addClass("et_builder_multiple_buttons_button_active")})),e.trigger("et_pb_setting:change"))}function ue(e,t){var i=e.find("input.et-pb-font-select"),o=i.val().split("|"),n=e.find(".et_builder_font_weight").val(),a=e.find(".et_builder_font_styles"),s=e.find(".et-pb-font-line-color-value"),l=e.find(".et_pb_font_line_style_select"),d=a.find(".et_builder_italic_font"),r=a.find(".et_builder_uppercase_font"),c=a.find(".et_builder_underline_font"),p=a.find(".et_builder_capitalize_font"),b=a.find(".et_builder_line_through_font"),u="et_font_style_active",g=_.isUndefined(t)?o[0]:t,h="";h+="default"!==g?g.trim():"",h+="|","400"!==n&&(h+=n),h+="|",d.hasClass(u)&&(h+="on"),h+="|",r.hasClass(u)&&(h+="on"),h+="|",c.hasClass(u)&&(h+="on"),h+="|",p.hasClass(u)&&(h+="on"),h+="|",b.hasClass(u)&&(h+="on"),h+="|",""!==s.val()&&(h+=s.val()),h+="|","solid"!==l.val()&&(h+=l.val()),i.val(h).trigger("change")}function ge(t){t.closest(".et-pb-option--font").find(".et_pb_select_placeholder");t.removeClass("et_pb_menu_active"),e("body").removeClass("et_pb_advanced_menu_opened")}function he(e,t,i){var o=parseFloat(e.attr("max")),n=parseFloat(e.attr("min"));e.hasClass("et-pb-fixed-range")||((t=""!==t?parseFloat(t):0)>o&&(e.attr("max",t),e.val(t)),t<n&&(e.attr("min",t),e.val(t)),i&&"0.1"!==e.attr("step")&&t%1>0&&(e.attr("step","0.1"),e.val(t)))}function fe(e,t){var i,o=e.parent().find(".et-pb-range"),n=e.val(),a="string"==typeof n?n.trim():n,s=parseFloat(a),l=a.toString().replace(s,""),_=o.data("default");if(isNaN(s)&&(s=""),o.hasClass("et-pb-fixed-range")){var d=parseFloat(o.attr("max")),r=parseFloat(o.attr("min")),c=s<r;s>d?s=d:c&&(s=r)}return i=s.toString()+l||_,t&&i!==n&&e.val(i),i}function me(t){return e(t).hasClass("et-pb-color-picker-hex")?"default-color":"default"}function ve(e){var t,i=me(e);if(t=void 0!==e.data(i)?e.data(i):"",_.isArray(t)&&t.length>0){var o=e.closest(".et-pb-options-toggle-container").find("#et_pb_".concat(t[0]));t=(t[1]||{})["".concat(o.val())]}return t="".concat(t)}function we(e){var t=ve(e).toLowerCase(),i=_.isUndefined(s.Helpers.getSettingValue(e))?"":s.Helpers.getSettingValue(e).toString().toLowerCase(),o=e.hasClass("et-pb-range");return void 0===i||""===String(i)||(!(!e.is("select")||""!==t||0!==e.prop("selectedIndex"))||!(!_.isNull(i)&&i!==t&&!o||o&&i!=="".concat(t,"px")&&i!==t))}function ye(e){var t=e.closest(".et_pb_background-tab--gradient"),i=t.closest(".et-pb-option-container-inner").attr("data-base_name"),o=ke(t,i),n=t.find(".et-pb-option-preview");o?n.css({backgroundImage:o}):n.removeAttr("style")}function ke(e,t){var i="background"===(t=t||"background")?"use_background_color_gradient":"".concat(t,"_use_color_gradient"),o=e.find(".et_pb_background-option--".concat(i," select")),n=e.find(".et_pb_background-option--".concat(t,"_color_gradient_start .et-pb-color-picker-hex")),a=e.find(".et_pb_background-option--".concat(t,"_color_gradient_end .et-pb-color-picker-hex")),s=e.find(".et_pb_background-option--".concat(t,"_color_gradient_type select")),l=e.find(".et_pb_background-option--".concat(t,"_color_gradient_direction .et-pb-range-input")),d=e.find(".et_pb_background-option--".concat(t,"_color_gradient_direction_radial select")),r=e.find(".et_pb_background-option--".concat(t,"_color_gradient_start_position .et-pb-range-input")),c=e.find(".et_pb_background-option--".concat(t,"_color_gradient_end_position .et-pb-range-input")),p=e.find(".et_pb_background-option--".concat(t,"_color_gradient_stops .et-pb-settings-option-input"));if("on"!==o.val())return!1;var b,u,g={type:"linear",direction:"180deg",radialDirection:"center",stops:"#2b87da 0%|#29c4a9 100%",colorStart:"#2b87da",colorEnd:"#29c4a9",startPosition:"0%",endPosition:"100%"};switch(_.each({type:s.val(),direction:l.val(),radialDirection:d.val(),colorStart:n.val(),colorEnd:a.val(),startPosition:r.val(),endPosition:c.val(),stops:p.val()},(function(e,t){""===e||_.isUndefined(e)||(g[t]=e)})),g.type){case"conic":b="conic",u="from ".concat(g.direction," at ").concat(g.radialDirection);break;case"elliptical":b="radial",u="ellipse at ".concat(g.radialDirection);break;case"radial":case"circular":b="radial",u="circle at ".concat(g.radialDirection);break;default:b="linear",u=g.direction}return"".concat(b,"-gradient( ").concat(u,", ").concat(g.stops.replace(/\|/g,", ")," )")}function Ce(e){var t=e,i=t.closest(".et-pb-option-container"),o=i.closest(".et-pb-option"),n=void 0!==t.data("device")&&o.hasClass("et_pb_has_mobile_settings")?t.data("device"):"all",a="all"===n?i.find(".et-pb-main-setting"):i.find(".et-pb-main-setting.et_pb_setting_mobile_".concat(n)),s=ve(a);if(a.is(".et-pb-text-align-select"))return s?i.find(".et_builder_".concat(s,"_text_align")).addClass("et_text_align_active").siblings().removeClass("et_text_align_active"):i.find(".et_text_align_active").removeClass("et_text_align_active"),a.val(s).trigger("change").trigger("et_pb_setting:change"),t.hasClass("et-pb-reset-setting")||(t=i.find(".et-pb-reset-setting")),void t.removeClass("et-pb-reset-icon-visible");if(a.is("select")&&""===s)a.prop("selectedIndex",0).trigger("change");else if(a.hasClass("et-pb-custom-color-picker"))!function(e){var t=e.closest(".et-pb-custom-color-container"),i=t.siblings(".et-pb-choose-custom-color-button"),o=t.find(".et-pb-custom-color-picker"),n="et_pb_hidden";i.removeClass(n),t.addClass(n),o.val("")}(t);else{if(a.hasClass("et-pb-color-picker-hex"))return a.wpColorPicker("color",s),""===s&&i.find(".wp-picker-clear").trigger("click"),t.hasClass("et-pb-reset-setting")||(t=i.find(".et-pb-reset-setting")),void t.removeClass("et-pb-reset-icon-visible");if(a.hasClass("et-pb-font-select"))je(i,t.hasClass("et_pb_reset_weight")?"weight":"font");else a.hasClass("et-pb-range")&&(s=ve(a="all"===n?t.siblings(".et-pb-range-input"):t.siblings(".et-pb-range-input.et_pb_setting_mobile_".concat(n)))),a.val(s).trigger("et_pb_setting:change",["et_pb_reset_setting"]),a.data("has_saved_value","no"),a.hasClass("et_custom_margin_main")?a.trigger("et_main_custom_margin:change"):a.trigger("change"),a.hasClass("et_select_animation")&&(a.find(".et_animation_button > a.et_active_animation").removeClass("et_active_animation"),a.find(".et_animation_button").first().find("> a").addClass("et_active_animation")),a.hasClass("et-presets")&&a.find(".et-preset").removeClass("et-preset-active").first().addClass("et-preset-active")}}function Se(t,i,o,n){var a,s="!important",l=s.length,d=!1,r=(t=void 0===t?"":t).length;i=!_.isUndefined(i)&&i;if(""===t)return"";if(t.substr(0-l,l)===s&&(d=!0,r-=l,t=t.substr(0,r).trim()),!_.isUndefined(n)&&function(e,t){var i=et_pb_options.acceptable_css_string_values;return!_.isUndefined(i[e])&&_.contains(i[e],t)}(n,t))return c=t,d&&!i&&(c="".concat(c," ").concat(s)),c;if(-1!==e.inArray(t.substr(-3,3),["deg","rem"])){var c=parseFloat(t)+t.substr(-3,3);return d&&!i&&(c="".concat(c," ").concat(s)),c}if(-1!==e.inArray(t.substr(-2,2),["em","px","cm","mm","in","pt","pc","ex","vh","vw","ms"])){c=parseFloat(t)+t.substr(-2,2);return d&&!i&&(c="".concat(c," ").concat(s)),c}return-1!==e.inArray(t.substr(-1,1),["%","x"])?(c=parseFloat(t)+t.substr(-1,1),d&&!i&&(c="".concat(c," ").concat(s)),c):isNaN(parseFloat(t))?t:(a=parseFloat(t),(_.isUndefined(o)||"no_default_unit"!==o)&&(a+=o||"px"),a)}function xe(t){var i,o=t,n=void 0!==o.data("device")?o.data("device"):"all",a=o.val(),s=o.closest(".et_margin_padding"),l=s.closest(".et-pb-option-container").find(".et-pb-mobile-settings-toggle"),_="all"===n?s.find(".et_custom_margin"):s.find(".et_custom_margin.et_pb_setting_mobile_".concat(n)),d=!1;de(t),""!==a?(i=a.split("|"),_.length>i.length&&(i.splice(1,0,""),i.push("")),_.each((function(){var t=e(this),o=_.index(t),n=t.hasClass("auto_important"),a=t.closest(".et-pb-option").data("option_name"),s=Se(i[o],n,void 0,{custom_padding:"padding",custom_margin:"margin"}[a]);t.val(s).trigger("et_pb_setting:change"),""!==s&&(d=!0)})),d&&l.addClass("et-pb-mobile-icon-visible")):_.each((function(){e(this).val("")}))}function je(t,i,o){var n,a=t.closest(".et-pb-options-tab"),s=t.find(".et-pb-select-font-outer"),l=t.find("input.et-pb-font-select"),d=t.find(".et-pb-settings-option-select-advanced"),r=t.find(".et_builder_font_styles"),c=t.find(".et_pb_select_placeholder"),p=t.find(".et_builder_font_weight"),b=t.find(".et_pb_font_line_color"),u=t.find(".et_pb_font_line_style_select"),g=t.find(".et_pb_font_style_container"),h=r.find(".et_builder_italic_font"),f=r.find(".et_builder_uppercase_font"),m=r.find(".et_builder_underline_font"),v=r.find(".et_builder_capitalize_font"),w=r.find(".et_builder_line_through_font"),y="et_font_style_active",k=l.val().trim(),C=_.isUndefined(l.data("default"))?"||||||||":l.data("default"),S=void 0!==l.data("old-option-ref")&&""!==l.data("old-option-ref")?l.data("old-option-ref"):"",x=""!==S?a.find(".et-pb-option-".concat(S)):"",j=""!==x&&x.length?x.find("input"):"",$="default",T=function(e){var t=wpCookies.get("et-pb-recent-items-font_family");if(t=_.isUndefined(t)||_.isNull(t)?[]:t.split("|"),_.isEmpty(t))return[];var i=[];return _.each(t,(function(t){e.find(".select-option-item-".concat(t.replace(/ /g,"_"))).length>0&&i.push(t)})),i}(d),V="400",U=!1,O=!1;if(i){var A=C.split("|");n=""===k.replace(/\|/g,"")?A:k.split("|"),"weight"===i?n[1]=A[1]:n[0]=A[0],k=n.join("|")}if(o){var M=t.find(".et_pb_font_weight_container"),L=g.find("label"),E=M.find("label"),D=s.data("group_label");""===k.replace(/\|/g,"")&&(k=C),L.html("".concat(D," ").concat(L.html())),E.html("".concat(D," ").concat(E.html()));var I=t.find(".et-pb-reset-setting"),P=I.clone();s.append(I.addClass("et_pb_reset_font")),M.append(P.addClass("et_pb_reset_weight"))}if(""!==k?($=""!==(n=k.split("|"))[0]?n[0]:"default",c.html(_.escape($)),""!==n[1]&&(V="on"===n[1]?"700":n[1]),"on"===n[2]?h.addClass(y):h.removeClass(y),"on"===n[3]?f.addClass(y):f.removeClass(y),"on"===n[4]?(m.addClass(y),U=!0):m.removeClass(y),_.isUndefined(n[5])||"on"!==n[5]?v.removeClass(y):v.addClass(y),_.isUndefined(n[6])||"on"!==n[6]?w.removeClass(y):(w.addClass(y),O=!0),_.isUndefined(n[7])||""===n[7]||(b.find(".et-pb-custom-color-container").removeClass("et_pb_hidden"),b.find(".et-pb-custom-color-button").addClass("et_pb_hidden"),b.find(".et-pb-color-picker-hex-alpha").wpColorPicker("color",n[7])),_.isUndefined(n[8])||""===n[8]||u.val(n[8])):(c.html(_.escape($)),h.removeClass(y),f.removeClass(y),m.removeClass(y),v.removeClass(y),w.removeClass(y)),U||O){var R=s.data("group_label");t.find(".et_pb_font_line_settings .et_pb_font_line_color > label").each((function(){var t=e(this),i=U?t.data("underline_label"):t.data("strikethrough_label");t.html("".concat(R," ").concat(i))})),t.find(".et_pb_font_line_settings").removeClass("et_pb_hidden"),t.find(".et-pb-option-container").addClass("et_pb_fonts_long")}else t.find(".et_pb_font_line_settings").addClass("et_pb_hidden"),t.find(".et-pb-option-container").removeClass("et_pb_fonts_long");var H=function(e){var t=et_pb_options.google_fonts,i=et_pb_options.user_fonts,o=!_.isUndefined(i[e])&&i[e],n=_.keys(et_pb_options.supported_font_weights);if("default"===e.toLowerCase())return["300","400","600","700","800"];o||(o=!_.isUndefined(t[e])&&t[e]);if(!o||_.isUndefined(o.styles))return n;return _.intersection(_.union(["400","700"],o.styles.split(",")),n)}($);p.find("option").removeClass("et_pb_unsupported_option"),p.find("option").each((function(){var t=e(this);-1===_.indexOf(H,t.val())&&(t.addClass("et_pb_unsupported_option"),V===t.val()&&(V="400"))})),p.find('option[value="'.concat(V,'"]')).prop("selected",!0);var N=d.find(".select-option-item-".concat($.replace(/ /g,"_")));d.find(".et_pb_selected_menu_item").removeClass("et_pb_selected_menu_item"),N.addClass("et_pb_selected_menu_item"),d.find(".et_pb_selected_item_container").html(_.escape(N.text())),_.isEmpty(T)?d.find(".et-pb-recent-fonts").addClass("et_pb_hidden_subgroup"):(d.find(".et-pb-recent-fonts").removeClass("et_pb_hidden_subgroup"),d.find(".et-pb-recent-fonts ul").html(""),_.each(T,(function(e){var t='<li class="select-option-item select-option-item-recent-font select-option-item-'.concat(e.replace(/ /g,"_"),'" data-value="').concat(e,'">').concat(e,"</li>");d.find(".et-pb-recent-fonts ul").append(t)}))),j.length&&""!==j.val()&&("on"!==n[3]&&"on"===j.val()&&(f.addClass(y),n[3]="on",l.val(n.join("|")).trigger("change")),j.val("")),i&&l.val(n.join("|")).trigger("et_pb_setting:change")}function $e(e,t){if("default"!==e){var i=wpCookies.get("et-pb-recent-items-font_family");if(i=_.isUndefined(i)||_.isNull(i)?[]:i.split("|"),"remove"===t){if(-1===_.indexOf(i,e))return;delete i[e]}else{if(-1!==_.indexOf(i,e))return;i.length>=3&&(i=i.slice(0,2)),i=_.union([e],i)}var o="https:"===window.location.protocol;wpCookies.set("et-pb-recent-items-font_family",i.join("|"),31536e6,et_pb_options.cookie_path,!1,o)}}function Te(t){t.$(".et-pb-color-picker-hex:visible").each((function(){e(this).closest(".wp-picker-container").find(".wp-color-result").trigger("click")}))}function Ve(){et_pb_options.debug&&window.console&&(2===arguments.length?console.log(arguments[0],arguments[1]):console.log(arguments[0]))}function Ue(t,i){V.saveAsShortcode(),setTimeout((function(){var o=e("#et_pb_layout"),n=o.innerHeight();o.css({height:"".concat(n,"px")});var a=ee("content",!0);if(V.removeAllSections(),V.$el.find(".et_pb_section").remove(),V.createLayoutFromContent(Oe(a),"","",{is_reinit:"reinit",migrate_global_modules:i}),o.css({height:"auto"}),J.update(),t){var s=_.filter($.models,(function(e){return"module"!==e.attributes.type&&void 0!==e.attributes.et_pb_global_module&&""!==e.attributes.et_pb_global_module}));0!==s.length&&_.each(s,(function(e){Ie(e.attributes.cid)}))}}),600)}function Oe(e){if(-1!==e.indexOf("[et_pb_")||"1"===et_pb_options.is_divi_library&&"module"===et_pb_options.layout_type)if(-1===e.indexOf("et_pb_row")&&-1===e.indexOf("et_pb_section")){var t=-1===e.indexOf("et_pb_fullwidth")?"regular":"fullwidth";-1===e.indexOf("et_pb_fullwidth_module_placeholder")&&-1===e.indexOf("et_pb_module_placeholder")||(e=""),e="regular"===t?'[et_pb_section template_type="module" skip_module="true"][et_pb_row template_type="module" skip_module="true"][et_pb_column type="4_4"]'.concat(e,"[/et_pb_column][/et_pb_row][/et_pb_section]"):'[et_pb_section fullwidth="on" template_type="module" skip_module="true"]'.concat(e,"[/et_pb_section]")}else-1===e.indexOf("et_pb_section")&&(e='[et_pb_section template_type="row" skip_module="true"]'.concat(e,"[/et_pb_section]"));return e}function Ae(t,i,o,n,a,l,_,d){i=""===i?"not_global":i;if(void 0!==N["".concat(o,"_").concat(i,"_").concat(a,"_").concat(l)]){var r=new s.SavedTemplates(N["".concat(o,"_").concat(i,"_").concat(a,"_").concat(l)]),c=new s.TemplatesView({collection:r,category:_});n.append(c.render().el),"include_global"===t&&"not_global"===i?Ae("include_global","global",o,n,a,l,_):(v.trigger("et-pb-loading:ended"),n.prepend(Me(_)),e("#et_pb_select_category").data("attr",{include_global:t,is_global:"",layout_type:o,append_to:n,module_width:a,specialty_cols:l}))}else e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_pb_get_saved_templates",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_is_global:i,et_post_type:et_pb_options.post_type,et_layout_type:o,et_module_width:a,et_specialty_columns:l},beforeSend:function(){v.trigger("et-pb-loading:started")},complete:function(){("include_global"!==t||"include_global"===t&&"global"===i)&&(v.trigger("et-pb-loading:ended"),n.prepend(Me(_)),e("#et_pb_select_category").data("attr",{include_global:t,is_global:"",layout_type:o,append_to:n,module_width:a,specialty_cols:l}))},success:function(e){var r="";if(void 0!==e.error)("include_global"===t&&"global"===i&&"success"!==d||"include_global"!==t)&&(n.append("<ul><li>".concat(e.error,"</li></ul>")),r="fail");else{var c=new s.SavedTemplates(e),p=new s.TemplatesView({collection:c});N["".concat(o,"_").concat(i,"_").concat(a,"_").concat(l)]=e,n.append(p.render().el),r="success"}"include_global"===t&&"not_global"===i&&Ae("include_global","global",o,n,a,l,_,r)}})}function Me(t){var i=JSON.parse(et_pb_options.layout_categories),o='<select id="et_pb_select_category">',n="all"===t||""===t?" selected":"";return o+='<option value="all"'.concat(n,">").concat(et_pb_options.all_cat_text,"</option>"),e.isEmptyObject(i)||e.each(i,(function(i,a){e.isEmptyObject(a)||(n=t===a.slug?" selected":"",o+='<option value="'.concat(a.slug,'"').concat(n,">").concat(a.name,"</option>"))})),o+="</select>"}function Le(t,i,o,n,a){void 0===N["".concat(t,"_layouts")]||a?e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_show_all_layouts",et_layouts_built_for_post_type:n,et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_load_layouts_type:t},beforeSend:function(){a||v.trigger("et-pb-loading:started")},complete:function(){a||v.trigger("et-pb-loading:ended")},success:function(e){a||o.find(".et-pb-main-settings.".concat(i)).append(e),N["".concat(t,"_layouts")]=e}}):o.find(".et-pb-main-settings.".concat(i)).append(N["".concat(t,"_layouts")])}function Ee(t,i,o){if(!t.hasClass("et-pb-options-tabs-links-active")){var n=void 0!==t.closest(".et-pb-options-tabs-links").data("specialty_columns")?t.closest(".et-pb-options-tabs-links").data("specialty_columns"):0;e(".et-pb-options-tabs-links li").removeClass("et-pb-options-tabs-links-active"),t.addClass("et-pb-options-tabs-links-active"),e(".et-pb-main-settings.active-container").css({display:"block",opacity:1}).stop(!0,!0).animate({opacity:0},300,(function(){e(this).css("display","none"),e(this).removeClass("active-container"),e(".".concat(t.data("open_tab"))).addClass("active-container").css({display:"block",opacity:0}).stop(!0,!0).animate({opacity:1},300)})),void 0!==t.data("content_loaded")||t.hasClass("et-pb-new-module")||"layout"===i||(Ae("include_global","",i,e(".".concat(t.data("open_tab"))),o,n,"all"),t.data("content_loaded","true"))}}function De(t,i){var o=et_pb_options.template_post_id;e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_add_template_meta",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_meta_value:i,et_custom_field:t,et_post_id:o}})}function Ie(t){var i=k.getView(t),o=i.model.get("et_pb_global_module"),n=i.model.get("type"),a="row_inner"===n?"row":n,s=V.generateCompleteShortcode(t,a,"ignore_global",!1,!0),l=_.isEmpty(h[o])?[]:h[o];void 0!==o&&""!==o&&("row_inner"===n&&(s=(s=s.replace(/et_pb_row_inner/g,"et_pb_row")).replace(/et_pb_column_inner/g,"et_pb_column")),e.ajax({type:"POST",url:et_pb_options.ajaxurl,data:{action:"et_pb_update_layout",et_admin_load_nonce:et_pb_options.et_admin_load_nonce,et_layout_content:s,et_template_post_id:o,et_layout_type:n,et_unsynced_options:JSON.stringify(l)}}))}function Pe(e){for(var t=e,i="";!_.isUndefined(t.model.get("parent"))&&""===i;)t=k.getView(t.model.get("parent")),i=""!==i||_.isUndefined(t.model.get("et_pb_global_module"))?i:t.model.get("cid");return i}function Re(){var t=e(".et_pb_modal_settings_container");t.find(".et-pb-options-tabs .et-pb-options-tab:first-child").css({display:"block",opacity:1}),e(".et_pb_modal_settings_container").hasClass("et_pb_hide_general_tab")?(t.find(".et-pb-options-tabs-links li").removeClass("et-pb-options-tabs-links-active"),t.find(".et-pb-options-tabs .et-pb-options-tab").css({display:"none",opacity:0}),t.hasClass("et_pb_hide_advanced_tab")?(t.find(".et-pb-options-tabs-links li.et_pb_options_tab_custom_css").addClass("et-pb-options-tabs-links-active"),t.find(".et-pb-options-tabs .et-pb-options-tab.et-pb-options-tab-custom_css").css({display:"block",opacity:1})):(t.find(".et-pb-options-tabs-links li.et_pb_options_tab_advanced").addClass("et-pb-options-tabs-links-active"),t.find(".et-pb-options-tabs .et-pb-options-tab.et-pb-options-tab-advanced").css({display:"block",opacity:1}))):t.find(".et-pb-options-tabs .et-pb-options-tab.et-pb-options-tab-general").css({display:"block",opacity:1}),function(t){t.find(".et-pb-options-tab:visible").each((function(){var t=e(this);t.find(".et-pb-option:visible").length||t.append('<p class="et-pb-all-options-hidden">'.concat(et_pb_options.all_tab_options_hidden,"<p>"))}))}(t)}function He(){return e.ajax({type:"POST",url:et_pb_options.ajaxurl,dataType:"json",data:{action:"et_pb_current_user_can_lock",et_admin_load_nonce:et_pb_options.et_admin_load_nonce},beforeSend:function(){v.trigger("et-pb-loading:started")},complete:function(){v.trigger("et-pb-loading:ended")}})}function Ne(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}function Be(){return"object"===("undefined"==typeof YoastSEO?"undefined":a(YoastSEO))&&YoastSEO.hasOwnProperty("app")}function ze(){return 0<e(".et_pb_modal_overlay, .et-core-modal-overlay.et-core-active").length}function Fe(e){var t=!k.is_global_children(e),i=!!et_pb_options.et_builder_edit_global_library;return t||i}function We(e){if(_.isEmpty(e)||ze())return!1;var t={model:e.model,view:e.$el,view_event:event};return new s.RightClickOptionsView(t,!0)}function Je(t,i){if(0!==t.length){var o=t.find(".et-pb-option");if(t.find(".et-pb-option-advanced-module-settings").length>0){var n=Ke("et_pb_content_field",i)?" et_pb_global_unsynced":"";t.find(".et-pb-option-advanced-module-settings").append('<span class="et_pb_global_sync_switcher'.concat(n,'" data-option_name="et_pb_content_field" data-additional_options="none"></span>'))}0!==o.length&&_.each(o,(function(t){var o=_.includes(["content","raw_content"],e(t).data("option_name"))?"et_pb_content_field":e(t).data("option_name"),n=Ke(o,i)?" et_pb_global_unsynced":"",a=0!==e(t).find(".et_pb_mobile_settings_tabs").length?"mobile":"none";e(t).append('<span class="et_pb_global_sync_switcher'.concat(n,'" data-option_name="').concat(o,'" data-additional_options="').concat(a,'"></span>'))}))}}function Ke(e,t){return"legacy"===(_.isUndefined(h[t])?"legacy":"updated")?-1===f[t].indexOf(e):-1!==h[t].indexOf(e)}function Ge(e){var t=e.closest(".et-pb-option-container--background"),i=e.closest(".et_pb_background-option").attr("data-option_name"),o=e.closest(".et_pb_module_settings").attr("data-module_type"),n=t.closest(".et-pb-options-tabs").find("#et_pb_featured_placement").val();return _.contains(et_pb_options.et_builder_modules_featured_image_background,o)&&"background_image"===i&&"background"===n}function qe(e){return e=(e=(e=(e=e.replace(/<p>\[/g,"[")).replace(/\]<\/p>/g,"]")).replace(/\]<br \/>/g,"]")).replace(/<br \/>\n\[/g,"[")}O.remove(),M.hasClass("et_pb_builder_is_used")&&(L.show(),Q()),A.on("click",(function(t){t.preventDefault();var i,o=e(this),n=o.hasClass("et_pb_builder_is_used"),a=e("#et_pb_fb_cta");if(n)G("deactivate_builder");else{i=ee("content"),E.val(i);var s=getUserSetting("editor");"html"!==s&&(e("#content-html").trigger("click"),setUserSetting("editor",s)),V.reInitialize(),I.val("on"),L.show(),o.text(o.data("editor")),P.toggleClass("et_pb_post_body_hidden"),o.toggleClass("et_pb_builder_is_used"),v.trigger("et-activate-builder"),Q(),a.addClass("et_pb_ready"),e("form#post").append('<input type="hidden" name="et_pb_show_page_creation" value="on" />')}})),e("#et_pb_fb_cta").on("click",(function(t){t.preventDefault(),e("html").fadeOut(),e("form#post").append('<input type="hidden" name="et-fb-builder-redirect" value="'.concat(e(this).attr("href"),'" />')),A.hasClass("et_pb_builder_is_used")||(E.val(ee("content")),V.reInitialize(),I.val("on")),e(window).off("beforeunload").delay(500).queue((function(){var t=e("#save-action #save-post");0===t.length&&(t=e("#publishing-action #publish")),t.trigger("click")}))})).on("contextmenu",(function(){e.ajax({type:"POST",url:e("#post").attr("action"),data:e("#post").serializeArray()})})),function(){var t,i,o,n,s,l,d,r,c,p,b,u=e("#et_pb_last_post_modified"),g=u.val(),h=e("#post_ID").val(),f=void 0!==window.autosaveL10n&&window.autosaveL10n.blog_id,m=!1,w=!0,y=!1,k="https:"===window.location.protocol,C=wpCookies.get("wp-saving-post"),S=300,x=!1;!function(){var e=Math.random().toString(),t=!1;try{window.sessionStorage.setItem("wp-test",e),t=window.sessionStorage.getItem("wp-test")===e,window.sessionStorage.removeItem("wp-test")}catch(e){}p=t}();var j=function(e,t){var i=function(e){var t=!1;return e=e||"wp",p&&f&&(t=(t=sessionStorage.getItem("".concat(e,"-autosave-").concat(f)))?JSON.parse(t):{}),t}(t);if(!i||!h)return!1;if(e)i["post_".concat(h)]=e;else{if(!i.hasOwnProperty("post_".concat(h)))return!1;delete i["post_".concat(h)]}return function(e,t){var i;return t=t||"wp",!(!p||!f)&&(i="".concat(t,"-autosave-").concat(f),sessionStorage.setItem(i,JSON.stringify(e)),null!==sessionStorage.getItem(i))}(i,t)};function $(){wpCookies.get("et-saved-post-".concat(h,"-fb"))&&(j(!1,"wp"),wpCookies.get("et-editing-post-".concat(h,"-fb"))||wpCookies.remove("et-saved-post-".concat(h,"-fb"),et_pb_options.cookie_path,!1,k))}C==="".concat(h,"-saved")&&(wpCookies.set("et-saved-post-".concat(h,"-bb"),"bb",S,et_pb_options.cookie_path,!1,k),wpCookies.set("et-recommend-sync-post-".concat(h,"-bb"),"bb",30,et_pb_options.cookie_path,!1,k)),wpCookies.set("et-editor-available-post-".concat(h,"-bb"),"bb",1800,et_pb_options.cookie_path,!1,k),$(),i=function(){return"on"===e("#et_pb_use_builder").val()},b=function(e){e?(wpCookies.remove("et-saved-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k),wpCookies.set("et-saving-post-".concat(h,"-bb"),"bb",S,et_pb_options.cookie_path,!1,k)):(wpCookies.remove("et-saving-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k),wpCookies.set("et-saved-post-".concat(h,"-bb"),"bb",S,et_pb_options.cookie_path,!1,k))};var T,U=_.isUndefined(wp.autosave)?"":wp.autosave.getCompareString();l=function(){if(i()&&(w=!1,wpCookies.get("et-editing-post-".concat(h,"-bb")))){if(!function(){if(_.isUndefined(wp.heartbeat)||_.isUndefined(wp.autosave))return!1;var e=wp.autosave.getPostData("local"),t=wp.autosave.getCompareString(e);return void 0===T&&(T=U),t!==T&&(T=t,!0)}())return!1;setTimeout((function(){x||(y=!0,b(!0),_.isUndefined(wp.heartbeat)||_.isUndefined(wp.autosave)||wp.autosave.server.triggerSave())}),0)}},d=function(){if(!i())return!1;var t=e("#post_ID").val(),o="https:"===window.location.protocol;if(w=!0,!wpCookies.get("et-editing-post-".concat(t,"-fb")))return!1;if(_.isUndefined(wp.heartbeat)||_.isUndefined(wp.autosave))return!1;var n=0;if(!function e(){var i=wpCookies.get("et-syncing-post-".concat(t,"-fb")),o=wpCookies.get("et-syncing-post-".concat(t,"-bb"));return n>=5||!i&&!o?(v.trigger("et-pb-loading:ended"),!1):(v.trigger("et-pb-loading:started"),n++,setTimeout(e,1e3),!0)}()){wpCookies.set("et-syncing-post-".concat(t,"-bb"),"bb",30,et_pb_options.cookie_path,!1,o),Ve("external editor was in use!"),Ve("trigger preloader"),v.trigger("et-pb-loading:started"),wp.autosave.server.tempBlockSave();var a=0;!function e(){var i=!1;if(wpCookies.get("et-saved-post-".concat(t,"-fb"))&&(i=!0),a>30&&(i=!0),a++,!_.isUndefined(wp.heartbeat)&&!_.isUndefined(wp.autosave)){if(wp.autosave.server.tempBlockSave(),v.trigger("et-pb-loading:started"),i)return Ve("calling wp.heartbeat.connectNow()"),m=!0,$(),setTimeout((function(){wp.heartbeat.connectNow()}),500),wpCookies.remove("et-saving-post-".concat(t,"-fb"),et_pb_options.cookie_path,!1,o),wpCookies.remove("et-saved-post-".concat(t,"-fb"),et_pb_options.cookie_path,!1,o),wpCookies.remove("et-syncing-post-".concat(t,"-bb"),et_pb_options.cookie_path,!1,o),wpCookies.remove("et-editing-post-".concat(t,"-fb"),et_pb_options.cookie_path,!1,o),!0;setTimeout(e,500)}}()}},c=function(){w&&!document.hasFocus()?l():!w&&document.hasFocus()&&d()},void 0!==document.hidden?(o="hidden",s="visibilitychange",n="visibilityState"):void 0!==document.msHidden?(o="msHidden",s="msvisibilitychange",n="msVisibilityState"):void 0!==document.webkitHidden&&(o="webkitHidden",s="webkitvisibilitychange",n="webkitVisibilityState"),window.addEventListener("beforeunload",(function(e){x=!0,wpCookies.remove("et-editing-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k),wpCookies.remove("et-syncing-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k),wpCookies.remove("et-saving-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k),wpCookies.remove("et-editor-available-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k)})),o&&e(document).on("".concat(s,".fb-heartbeat"),(function(e){i()&&("hidden"===document[n]?(l(),window.clearInterval(r)):(d(),document.hasFocus&&(r=window.setInterval(c,1e3))))})),document.hasFocus&&(r=window.setInterval(c,1e3)),d(),setInterval((function(){var e=wpCookies.get("et-recommend-sync-post-".concat(h,"-fb")),t=wpCookies.get("et-saved-post-".concat(h,"-fb"));e&&t&&(_.isUndefined(wp.heartbeat)||wp.heartbeat.connectNow(),wpCookies.remove("et-recommend-sync-post-".concat(h,"-fb"),et_pb_options.cookie_path,!1,k))}),3e3),e(document).on("heartbeat-send.bb-heartbeat",(function(t,o){i()&&(o.et={last_post_modified:g,built_by:"bb",post_id:h,force_check:m,force_autosave:!m&&y},m=!1,y&&void 0===o.wp_autosave&&(o.wp_autosave=wp.autosave.getPostData(),o.wp_autosave.content=ee("content"),o.wp_autosave._wpnonce=e("#_wpnonce").val()||""),"object"===a(o.wp_autosave)&&(o.wp_autosave.builder_settings=_.mapObject(_.indexBy(e(".et_pb_page_settings input.et_pb_value_updated").serializeArray(),"name"),(function(e,t){return e.value})),o.wp_autosave.et_fb_autosave_nonce=et_pb_options.et_fb_autosave_nonce,e(".et_pb_page_settings input.et_pb_value_updated").removeClass("et_pb_value_updated")),y&&void 0!==o.wp_autosave&&(y=!1))})),e(document).on("heartbeat-tick.bb-heartbeat",(function(o,n){if(i()){if(!_.isEmpty(n.et)&&!_.isEmpty(n.et.builder_settings_autosave)){var a=e(".et_pb_modal_overlay.et_pb_builder_settings").length;_.each(n.et.builder_settings_autosave,(function(t,i){if(e("#_".concat(i)).val(t),"et_pb_section_background_color"===i&&(et_pb_options.page_section_bg_color=t),"et_pb_page_gutter_width"===i&&(et_pb_options.page_gutter_width=t),"et_pb_color_palette"===i&&(et_pb_options.page_color_palette=t),a){var o=e('.et_pb_modal_overlay.et_pb_builder_settings div[data-id="'.concat(i,'"]'));switch(o.attr("data-type")){case"range":o.find(".range, .et-pb-range-input").val(t);break;case"color-alpha":o.find(".input-colorpicker").wpColorPicker("color",t);break;case"textarea":o.find("textarea").val(t);break;case"colorpalette":var n=t.split("|");o.find(".input-colorpalette-colorpicker").each((function(t,i){if(!_.isUndefined(n[t])){var a=n[t];e(i).val(a).wpColorPicker("color",a),o.find(".colorpalette-item-".concat(t+1)).css({backgroundColor:a})}}));break;case"yes_no_button":o.find(".et_pb_yes_no_button_wrapper");var s=o.find(".et_pb_yes_no_button");o.find("select").find('option[value="'.concat(t,'"]')).prop("selected",!0),"on"===t?s.removeClass("et_pb_off_state").addClass("et_pb_on_state"):s.removeClass("et_pb_on_state").addClass("et_pb_off_state");break;default:o.find("input").val(t)}}}))}if(n.wp_autosave&&b(!1),void 0===n.et)return!1;if(void 0!==n.et.post_modified&&(g=n.et.post_modified),void 0!==n.et.post_content){Ve("ext changes occured"),t=n.et.post_content;var s=e(".et_pb_modal_settings_container");s.length&&"module_settings"===s.attr("data-open_view")&&s.find(".et-pb-modal-close").trigger("click"),O()}else v.trigger("et-pb-loading:ended")}}));var O=function(){if(u.val(g),i()&&""!=t){v.trigger("et-pb-loading:started");var o=t;ae("content",o,"updating_to_latest_fb_content"),setTimeout((function(){var t=e("#et_pb_layout"),i=t.innerHeight();t.css({height:"".concat(i,"px")}),V.removeAllSections(),V.$el.find(".et_pb_section").remove(),V.enable_history=!1,V.createLayoutFromContent(Oe(o),"","",{is_reinit:"reinit"}),J.is_active_based_on_models()?(J.toggle_status(!0),Ue()):J.toggle_status(!1),t.css({height:"auto"}),v.trigger("et-pb-loading:ended"),setTimeout((function(){wpCookies.remove("et-editing-post-".concat(h,"-bb"),et_pb_options.cookie_path,!1,k)}),500)}),500)}}}(),e(document).on("tinymce-editor-init.autosave",(function(t,i){"content"===i.id&&e(document).off("tinymce-editor-init.autosave")}));var Ye={key:"et_pb_clipboard_",set:function(e,t){Ne()?(localStorage.setItem("".concat(this.key,"type"),LZString.compressToUTF16(e)),localStorage.setItem("".concat(this.key,"content"),LZString.compressToUTF16(t))):alert(et_pb_options.localstorage_unavailability_alert)},get:function(e){if(Ne()){var t=LZString.decompressFromUTF16(localStorage.getItem("".concat(this.key,"type"))),i=LZString.decompressFromUTF16(localStorage.getItem("".concat(this.key,"content")));return(void 0===e||e===t)&&i}alert(et_pb_options.localstorage_unavailability_alert)}},Ze=_.debounce(Ue,2e3);if(e(window).on("keydown",(function(i){if("on"===e("#et_pb_use_builder").val()){if(ze()||e(".et_pb_prompt_modal").is(":visible")){var o=e(".et-pb-modal-save"),n=e(".et_pb_prompt_proceed"),a=e("#et_pb_main_container a, #et_pb_toggle_builder");switch(i.which){case 13:if(e(".et-pb-option-container textarea, #et_pb_address, #et_pb_pin_address, .et-pb-color-picker-hex-has-preview").is(":focus"))return void e(".et-pb-color-picker-hex-has-preview:focus").wpColorPicker("close");a.trigger("blur"),(o.length||n.length)&&(n.length?n.trigger("click"):void 0!==o[1]?o[1].trigger("click"):o.trigger("click"));break;case 27:I()}}if(83===i.keyCode&&i.metaKey&&i.shiftKey&&!i.altKey||83===i.keyCode&&i.ctrlKey&&i.shiftKey&&!i.altKey)return i.preventDefault(),I(),void e("#save-post").trigger("click");if(83===i.keyCode&&i.metaKey&&!i.altKey||83===i.keyCode&&i.ctrlKey&&!i.altKey)return i.preventDefault(),I(),void t("#publish").trigger("click");var l=e(i.target);if(_.isUndefined(l)||!(l.is("input, textarea")||l.attr("contenteditable")||l.hasClass("et_disable_single_key_shortcuts"))){if(90===i.keyCode&&i.metaKey&&i.shiftKey&&!i.altKey||90===i.keyCode&&i.ctrlKey&&i.shiftKey&&!i.altKey)return i.preventDefault(),V.redo(i),!1;if(90===i.keyCode&&i.metaKey&&!i.altKey||90===i.keyCode&&i.ctrlKey&&!i.altKey)return i.preventDefault(),V.undo(i),!1;if(79===i.keyCode){if(ze())return;i.preventDefault(),e(".et_pb_builder_settings").length||e("#et_pb_layout .et-pb-app-settings-button").trigger("click")}else if(80===i.keyCode){if(i.preventDefault(),i.metaKey||i.ctrlKey)return e(".et-pb-modal-preview-template").length&&e(".et-pb-modal-preview-template").trigger("click"),!1;if(ze())return;e("div[data-et-core-portability]").hasClass("et-core-active")||e("#et_pb_layout .et-pb-app-portability-button").trigger("click")}else if(72===i.keyCode){if(ze())return;i.preventDefault(),e("#et_pb_layout .et-pb-layout-buttons-history").trigger("click")}else if(9===i.keyCode&&i.shiftKey){if(e(".et-pb-options-tabs-links").length||e(".et-pb-preview-screensize-switcher").length){var d=!(!e(".et-pb-modal-preview-template").length||!e(".et-pb-modal-preview-template").hasClass("active")),r=e(d?".et-pb-preview-screensize-switcher":".et-pb-options-tabs-links").find("li"),c=r.length,p=r[0];r.each((function(t){var i=d?e(this).find("a"):e(this),o=d?"active":"et-pb-options-tabs-links-active";i.hasClass(o)&&t!==c-1&&(p=r[t+1])})),e(p).length&&e(p).find("a").trigger("click")}}else if(67===i.keyCode&&(i.metaKey||i.ctrlKey)){if(h=We(g)){if(g.$el.hasClass("et-pb-column"))return;h.copy(i)}}else if(86===i.keyCode&&(i.metaKey||i.ctrlKey)){if(h=We(g))(E=g.$el).hasClass("et-pb-column")||E.hasClass("et_pb_section_fullwidth")&&!Ye.get("et_pb_clipboard_section")&&!E.find(".et_pb_module_block").length?h.pasteColumn(i):h.pasteAfter(i)}else if(88===i.keyCode&&(i.metaKey||i.ctrlKey)){if(h=We(g)){if(g.$el.hasClass("et-pb-column"))return;h.copy(i);var b=g.$el.hasClass("et_pb_module_block")?g.$el.find(".et-pb-remove"):g.$el.find("> .et-pb-controls .et-pb-remove");b.length&&(b.trigger("click"),g={},Ue())}}else if(68===i.keyCode){if(h=We(g)){if(g.$el.hasClass("et-pb-column"))return;var u="disabled";void 0===h.model.attributes.et_pb_disabled||"on"!==h.model.attributes.et_pb_disabled?(h.model.attributes.et_pb_disabled="on",g.$el.addClass("et_pb_disabled")):(h.model.attributes.et_pb_disabled="off",g.$el.removeClass("et_pb_disabled"),u="enabled"),h.updateGlobalModule(),V.allowHistorySaving(u,h.history_noun),V.saveAsShortcode()}}else if(76===i.keyCode){var h;if(h=We(g)){if(g.$el.hasClass("et-pb-column"))return;void 0===h.model.attributes.et_pb_locked||"on"!==h.model.attributes.et_pb_locked?h.lock(i):h.unlockItem(i),Ue()}}else if(83===i.keyCode)i.preventDefault(),_.isEmpty(g)||e(".et_pb_modal_overlay").length||(m.s=!0);else if(49!==i.keyCode&&50!==i.keyCode&&51!==i.keyCode||!m.s)if(82===i.keyCode)_.isEmpty(g)||e(".et_pb_modal_overlay").length||(m.r=!0);else if(67!==i.keyCode||i.metaKey||i.ctrlKey)if(49!==i.keyCode&&50!==i.keyCode&&51!==i.keyCode&&52!==i.keyCode&&53!==i.keyCode&&54!==i.keyCode&&55!==i.keyCode&&56!==i.keyCode&&57!==i.keyCode&&48!==i.keyCode&&189!==i.keyCode||!m.r&&!m.c){if(49===i.keyCode||50===i.keyCode||51===i.keyCode||52===i.keyCode||53===i.keyCode||54===i.keyCode||55===i.keyCode||56===i.keyCode||57===i.keyCode||48===i.keyCode||189===i.keyCode){if(!e("ul.et-pb-column-layouts").length)return;var f=e("ul.et-pb-column-layouts li");C=0;switch(i.keyCode){case 49:C=0;break;case 50:C=1;break;case 51:C=2;break;case 52:C=3;break;case 53:C=4;break;case 54:C=5;break;case 55:C=6;break;case 56:C=7;break;case 57:C=8;break;case 48:C=9;break;case 189:C=10}f.length&&f[C]&&e(f[C]).trigger("click")}else if("?"===i.key||191===i.keyCode){var v="help"===e(".et_pb_modal_settings_container").attr("data-open_view");if(e(".et-pb-modal-close").length&&e(".et-pb-modal-close").trigger("click"),v)return;I();var w=new s.ModalView({attributes:{"data-open_view":"help"},view:this});e("body").append(w.render().el)}}else{var y=(E=g.$el).closest(".et_pb_row");if(y.length){var C="4_4";switch(i.keyCode){case 49:C="4_4";break;case 50:C="1_2,1_2";break;case 51:C="1_3,1_3,1_3";break;case 52:C="1_4,1_4,1_4,1_4";break;case 53:C="2_3,1_3";break;case 54:C="1_3,2_3";break;case 55:C="1_4,3_4";break;case 56:C="3_4,1_4";break;case 57:C="1_2,1_4,1_4";break;case 48:C="1_4,1_4,1_2";break;case 189:C="1_4,1_2,1_4"}var S=k.getView(y.find(".et-pb-row-content").data("cid"));if(void 0!==S){var x=!1,j=!1,$=k.getView(S.model.attributes.parent);if(void 0!==$&&"column"===$.model.attributes.type){var T=3===$.model.attributes.specialty_columns?[49,50,51]:[49,50];if(-1===e.inArray(i.keyCode,T))return}var U={};if(m.r){if("on"===S.model.get("et_pb_parent_locked"))return;if(J.is_active()&&!J.is_user_has_permission(S.model.get("cid"),"add_row"))return void J.alert("has_no_permission");V.allowHistorySaving("added","row"),j=!0;var O=k.generateNewId(),A=void 0!==S.model.get("et_pb_global_module")&&""!==S.model.get("et_pb_global_module")?S.model.get("et_pb_global_module"):"",M=""!==A?S.model.get("cid"):"";$.collection.add([{type:"row",module_type:"row",cid:O,parent:$.model.get("cid"),view:S,appendAfter:S.$el,et_pb_global_parent:A,global_parent_cid:M,admin_label:et_pb_options.noun.row}]),U=k.getView(O)}else{if(void 0!==S.model.attributes.et_pb_global_module&&""!==S.model.attributes.et_pb_global_module||"row"===et_pb_options.layout_type&&"global"===et_pb_options.is_global_template)return;U=S,x=!0}var L={layout:C,is_structure_change:x,layout_specialty:""};k.changeColumnStructure(U,L,!0,j)}}}else _.isEmpty(g)||e(".et_pb_modal_overlay").length||(m.c=!0);else{if(e(".et_pb_modal_overlay").length)return;var E,D=(E=g.$el).closest(".et_pb_section");if(D.length)switch(i.keyCode){case 49:D.find(".et-pb-section-add-main").trigger("click");break;case 50:D.find(".et-pb-section-add-specialty").trigger("click");break;case 51:D.find(".et-pb-section-add-fullwidth").trigger("click")}}}}function I(){var t=e(".et-pb-modal-close"),i=e(".et-core-modal-close");t.length&&(void 0!==t[1]?t[1].trigger("click"):t.trigger("click")),i.length&&i.trigger("click"),e("body").removeClass("et-core-nbfc")}})),e(window).on("keyup",(function(e){83===e.keyCode?m.s=!1:82===e.keyCode?m.r=!1:67===e.keyCode&&m.c&&(m.c=!1,Ze())})),e("body").on("mouseover",".et-pb-right-click-trigger-overlay, .et-pb-controls, .et_pb_module_block, .et-pb-insert-module, .et-pb-row-add",(function(t){var i=e(t.target),o=i.closest(".et_pb_module_block");if(!o.length)if(i.closest(".et-pb-insert-module").length||i.closest(".et-pb-row-add").length)o=i.closest("div"),i.closest(".et-pb-row-add").length&&(o=o.find(".et-pb-row-content"));else{var n=i.closest(".et-pb-right-click-trigger-overlay").length?i.closest(".et-pb-right-click-trigger-overlay"):i.closest(".et-pb-controls");if(!n.length)return void(g={});var a=n.closest(".et_pb_row");if(a.length)o=a.find(".et-pb-row-content");else o=n.closest(".et_pb_section").find(".et-pb-section-content")}if(o.length){var s=k.getView(o.data("cid"));g=s}})),e("body").on("dblclick",".et-pb-right-click-trigger-overlay, .et-pb-controls, .et_pb_module_block",(function(t){var i=e(t.target);if(!i.closest("a").length){var o=i.closest(".et_pb_module_block");if(o.length)o.find(".et-pb-settings").trigger("click");else{i.closest(".et-pb-controls").length&&i.closest(".et-pb-controls").find(".et-pb-settings").trigger("click");var n=i.closest(".et-pb-right-click-trigger-overlay");if(n.length){var a=n.closest(".et_pb_row");if(a.length)a.find("> .et-pb-controls .et-pb-settings").trigger("click");else n.closest(".et_pb_section").find("> .et-pb-controls .et-pb-settings").trigger("click")}}}})),"0"===et_pb_options.is_divi_library){var Xe=e("#et-builder-app-settings-button-template").html();e("#et_pb_layout").prepend(Xe),e("#et_pb_layout").on("click",".et-pb-app-view-ab-stats-button",(function(t){t.preventDefault(),J.is_selecting_subject()?J.alert("select_ab_testing_subject_first"):J.is_selecting_goal()?J.alert("select_ab_testing_goal_first"):J.is_selecting_winner()?J.alert("select_ab_testing_winner_first"):e("#et_pb_layout_controls .et-pb-layout-buttons-view-ab-stats").trigger("click")})),e("#et_pb_layout").on("click",".et-pb-app-portability-button.et-core-disabled",(function(e){e.preventDefault(),J.is_selecting_subject()?J.alert("select_ab_testing_subject_first"):J.is_selecting_goal()?J.alert("select_ab_testing_goal_first"):J.is_selecting_winner()?J.alert("select_ab_testing_winner_first"):J.is_active()&&J.alert("cannot_import_export_layout_has_ab_testing")})),e("#et_pb_layout").on("click",".et-pb-app-settings-button",(function(t){t.preventDefault(),J.is_selecting_subject()?J.alert("select_ab_testing_subject_first"):J.is_selecting_goal()?J.alert("select_ab_testing_goal_first"):J.is_selecting_winner()?J.alert("select_ab_testing_winner_first"):e("#et_pb_layout_controls .et-pb-layout-buttons-settings").trigger("click")}))}else e("#toplevel_page_et_divi_options, #toplevel_page_et_divi_options > a").addClass("wp-has-current-submenu wp-menu-open").removeClass("wp-not-current-submenu");if(Be()){var Qe=function(){YoastSEO.app.registerPlugin("ET_PB_Yoast_Content",{status:"ready"}),YoastSEO.app.registerModification("content",this.et_pb_update_content,"ET_PB_Yoast_Content",5)};Qe.prototype.et_pb_update_content=function(t){var i=F||et_pb_options.yoast_content;return e(".et-pb-yoast-loading").remove(),i},new Qe}e(window).on("resize",(function(){var t=e(".et_pb_prompt_modal.et_pb_auto_centerize_modal");t.length&&(t.removeAttr("style"),(0,n.default)(t,".et_pb_prompt_buttons"))})),e(window).on("load",(function(){setTimeout((function(){var t=e("#et_pb_toggle_builder"),i=e("#et_pb_fb_cta");t.addClass("et_pb_ready"),t.hasClass("et_pb_builder_is_used")&&i.addClass("et_pb_ready")}),250)})),e(window).on("mousedown",(function(t){var i=e(".et-pb-settings-option-select-advanced.et_pb_menu_active");e(t.target).closest(".et-pb-settings-option-select-advanced").length<1&&i.length>0&&ge(i)}))})),window.et_builder=window.et_builder||{},void 0!==window.YoastShortcodePlugin&&(window.YoastShortcodePlugin.prototype.bindElementEvents=function(){var e=document.getElementById("content")||!1,t=this;e&&(e.addEventListener("keydown",this.loadShortcodes.bind(this,this.declareReloaded.bind(this))),e.addEventListener("change",this.loadShortcodes.bind(this,this.declareReloaded.bind(this)))),"undefined"!=typeof tinyMCE&&"function"==typeof tinyMCE.on&&tinyMCE.on("addEditor",(function(e){e.editor.on("change",(function(){t.loadShortcodes.bind(t,t.declareReloaded.bind(t))()}))}))}),document.addEventListener("DOMContentLoaded",(function(){var t,i={tabs:{},padding:{},yes_no_button:{},multiple_buttons:{},font_buttons:{},text_align_buttons:{},select:{},font_line_styles:{},animation_buttons:{},user_fonts:et_pb_options.user_fonts,font_weights:et_pb_options.supported_font_weights,options_icons:et_pb_options.all_svg_icons,background_tabs_nav:{},background_gradient_buttons:{},option_preview_buttons:{}};function o(){var t=e(".et_pb_modal_settings_container");t.find("div.mce-fullscreen").length&&setTimeout((function(){var e=t.innerHeight(),i=t.find(".mce-toolbar-grp").innerHeight()||0;t.find("iframe").height(e-i)}),100)}window.et_builder_template_options=i,s.Events.on("et-advanced-module-settings:render",(function(t){var i,o=t.$el.find("#et_pb_category_id"),n=t.$el.find("#et_pb_category_name");o.length&&n.length&&(i=o.find("option:selected").text().trim(),n.val(i),o.on("change",(function(){i=e(this).find("option:selected").text().trim(),n.val(i)})))})),t={fonts_template:function(t){return _.template(e("#et-builder-google-fonts-options-items").html())(window.et_builder_template_options.user_fonts)},fonts_weight_template:function(t){return _.template(e("#et-builder-font-weight-items").html())(window.et_builder_template_options.font_weights)},font_icon_list_template:function(){return e("#et-builder-font-icon-list-items").html()},font_down_icon_list_template:function(){return e("#et-builder-font-down-icon-list-items").html()},preview_tabs_output:function(){return e("#et-builder-preview-icons-template").html()},settings_tabs_output:function(t){var i=_.template(e("#et-builder-options-tabs-links-template").html());return window.et_builder_template_options.tabs.options=e.extend({},t),i(window.et_builder_template_options.tabs)},mobile_tabs_output:function(){return e("#et-builder-mobile-options-tabs-template").html()},options_template_output:function(t,i,o){var n=_.template(e("#et-builder-".concat(t,"-option-template")).html());return window.et_builder_template_options[t].options=e.extend({},i),_.isUndefined(o)||(window.et_builder_template_options[t].data=e.extend({},o)),n(window.et_builder_template_options[t])},options_text_align_buttons_output:function(t,i){var o=_.template(e("#et-builder-text-align-buttons-option-template").html());return window.et_builder_template_options.text_align_buttons.options=e.extend({},t),window.et_builder_template_options.text_align_buttons.type=i,o(window.et_builder_template_options.text_align_buttons)}},e.extend(window.et_builder,t),e("body").on("click",".et_pb_module_settings .mce-i-fullscreen",(function(){o()})),e(window).on("resize",(function(){o()})),e("body.wp-admin").on("click",'.et-pb-modal-container .mce-widget.mce-btn[aria-label="Fullscreen"] button',(function(){setTimeout((function(){e(window).trigger("resize")}),50)})),e(document).on("click",".et-pb-dynamic-content-fb-switch",(function(t){t.preventDefault(),e("#et_pb_fb_cta").trigger("click")}))}))}).call(this,i(0),i(0))},19:function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(t,i){var o=e(window),n=e("#wpadminbar"),a=o.height(),s=t.outerHeight(),l=n.outerHeight(),_=0-s/2+l/2;s>a-l?t.css({top:"".concat(l+15,"px"),bottom:15,marginTop:0,minHeight:0}):t.css({top:"50%",marginTop:"".concat(_,"px")}),t.addClass("et_pb_auto_centerize_modal")};t.default=i}).call(this,i(0))}});library_scripts.js000064400000012643152336404310010324 0ustar00!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=145)}({0:function(t,e){t.exports=jQuery},1:function(t,e){var n=Array.isArray;t.exports=n},10:function(t,e){t.exports=function(t,e){for(var n=-1,o=null==t?0:t.length,r=Array(o);++n<o;)r[n]=e(t[n],n,t);return r}},12:function(t,e,n){var o=n(5),r=n(3);t.exports=function(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==o(t)}},145:function(t,e,n){"use strict";(function(t){var e=r(n(20)),o=r(n(51));function r(t){return t&&t.__esModule?t:{default:t}}t((function(){var n=window.location.href.split("edit.php")[1];if(!(0,e.default)(n)){var r=t("#toplevel_page_et_divi_library").find(".wp-submenu li");r.removeClass("current"),r.find("a").each((function(){var e=t(this),o=e.attr("href");-1!=="edit.php".concat(n).indexOf(o)&&e.closest("li").addClass("current")})),t("#toplevel_page_et_divi_library").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu"),t("a.toplevel_page_et_divi_library").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu wp-menu-open")}t("body").on("click",".add-new-h2, a.page-title-action",(function(){return t("body").addClass("et-core-nbfc").append(et_pb_new_template_options.modal_output),!1})),t("body").on("click",".et_pb_prompt_dont_proceed",(function(){var e=t(this).closest(".et_pb_modal_overlay");e.addClass("et_pb_modal_closing"),setTimeout((function(){t("body").removeClass("et-core-nbfc"),e.remove()}),600)})),t("body").on("change","#new_template_type",(function(){var e=t(this).val(),n=t(".et_module_tabs_options"),o=t("#et_pb_template_global"),r=o.closest("label");"module"===e||"fullwidth_module"===e?n.css("display","block"):n.css("display","none"),"layout"===e?(o.prop("checked",!1),r.css("display","none")):r.css("display","block")})),t("body").on("click",".et_pb_create_template:not(.clicked_button)",(function(){var n=t(this),r=n.closest(".et_pb_prompt_modal");if(""===r.find("#et_pb_new_template_name").val())r.find("#et_pb_new_template_name").trigger("focus");else{var i=[],a="";r.find("input, select").each((function(){var n=t(this);if(!(0,e.default)(n.attr("id"))&&""!==n.val()){if("checkbox"===n.attr("type")&&!n.is(":checked"))return;i.push({field_id:n.attr("id"),field_val:n.val()})}})),t(".layout_cats_container input").is(":checked")&&t(".layout_cats_container input").each((function(){var e=t(this);e.is(":checked")&&(a+=""!==a?",".concat(e.val()):e.val())})),i.push({field_id:"selected_cats",field_val:a}),n.addClass("clicked_button"),n.closest(".et_pb_prompt_buttons").find(".spinner").addClass("et_pb_visible_spinner"),t.ajax({type:"POST",url:et_pb_new_template_options.ajaxurl,dataType:"json",data:{action:"et_pb_add_new_layout",et_admin_load_nonce:et_pb_new_template_options.et_admin_load_nonce,et_layout_options:JSON.stringify(i)},success:function(t){(0,e.default)(t)||""===t||(window.location.href=(0,o.default)(t.edit_link))}})}}))}))}).call(this,n(0))},2:function(t,e,n){var o=n(32),r="object"==typeof self&&self&&self.Object===Object&&self,i=o||r||Function("return this")();t.exports=i},20:function(t,e){t.exports=function(t){return void 0===t}},21:function(t,e,n){var o=n(6),r=n(10),i=n(1),a=n(12),c=o?o.prototype:void 0,u=c?c.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return r(e,t)+"";if(a(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n}},3:function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},32:function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(52))},5:function(t,e,n){var o=n(6),r=n(53),i=n(54),a=o?o.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?r(t):i(t)}},51:function(t,e,n){var o=n(8),r=n(55),i=/&(?:amp|lt|gt|quot|#39);/g,a=RegExp(i.source);t.exports=function(t){return(t=o(t))&&a.test(t)?t.replace(i,r):t}},52:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},53:function(t,e,n){var o=n(6),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,c=o?o.toStringTag:void 0;t.exports=function(t){var e=i.call(t,c),n=t[c];try{t[c]=void 0;var o=!0}catch(t){}var r=a.call(t);return o&&(e?t[c]=n:delete t[c]),r}},54:function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},55:function(t,e,n){var o=n(56)({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});t.exports=o},56:function(t,e){t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},6:function(t,e,n){var o=n(2).Symbol;t.exports=o},8:function(t,e,n){var o=n(21);t.exports=function(t){return null==t?"":o(t)}}});