Version Description
Download this release
Release Info
Developer | pross |
Plugin | WordPress Page Builder – Beaver Builder |
Version | 2.5.5.5 |
Comparing to | |
See all releases |
Code changes from version 2.5.5.3 to 2.5.5.5
- changelog.txt +21 -2
- classes/class-fl-builder-compatibility.php +0 -48
- classes/class-fl-builder-loader.php +1 -1
- classes/class-fl-builder-model.php +10 -2
- fl-builder.php +1 -1
- includes/ui-js-config.php +1 -1
- includes/updater-config.php +1 -1
- js/fl-builder-layout.js +21 -3
- js/fl-builder-preview.js +1 -1
- js/fl-builder.min.js +1 -1
- json/fonts.json +67 -2
- modules/photo/includes/frontend.js.php +2 -1
- modules/photo/photo.php +1 -1
- modules/video/video.php +1 -1
- readme.txt +1 -1
changelog.txt
CHANGED
@@ -1,4 +1,23 @@
|
|
1 |
-
<h4>2.5.5.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<p><strong>Hot Fix</strong></p>
|
3 |
<ul>
|
4 |
<li>Sanitize photo captions when used in lightboxes</li>
|
@@ -1028,7 +1047,7 @@ Fixed default text still appearing even after being removed</li>
|
|
1028 |
<p><strong>Enhancements</strong></p>
|
1029 |
<ul>
|
1030 |
<li>Accessibility: Added title attribute setting for iframe in Map module.</li>
|
1031 |
-
<li>Accessibility: Added TAB
|
1032 |
<li>Accessibility: Improved accessibility of Tabs and Accordion modules.</li>
|
1033 |
<li>Accessibility: Added alt attribute to slideshow images.</li>
|
1034 |
<li>Accessibility: Always show label setting as it is also used for aria attribute in Menu module.</li>
|
1 |
+
<h4>2.5.5.5 - 09/06/2022</h4>
|
2 |
+
<p>strong>Hot Fix</strong></p>
|
3 |
+
<ul>
|
4 |
+
<li>Fix JS error with Photo module captions when new lines are used in the caption</li>
|
5 |
+
<li>Add new filter <code>fl_photocaptionregex</code> so users can adjust the regex for allowed characters in captions when displayed in the lightbox</li>
|
6 |
+
<li>Fix Fatal PHP Error with Posts Module when using TEC 6</li>
|
7 |
+
</ul>
|
8 |
+
|
9 |
+
<h4>2.5.5.4 - 08/23/2022</h4>
|
10 |
+
<p>strong>Hot Fix</strong></p>
|
11 |
+
<ul>
|
12 |
+
<li>Gallery Module: Fix caption now showing with the below photo position</li>
|
13 |
+
<li>Fix live preview not working with Row Shapes height</li>
|
14 |
+
<li>Menu Module: Fix tabbing through items not working properly with a mega menu</li>
|
15 |
+
<li>Video Module: Fix videos not showing when using GoDaddy's CDN</li>
|
16 |
+
<li>Tweak sanitization of photo captions when used in lightboxes to allow quotes and preserve capitalization</li>
|
17 |
+
<li>Add new filter <code>fl_user_has_unfiltered_html</code>. Users using the <code>fl_builder_ui_js_config</code> filter to allow unfiltered HTML for other roles should switch to this new dedicated filter. (<a href="https://docs.wpbeaverbuilder.com/beaver-builder/troubleshooting/common-issues/error-settings-not-saved/#filter-examples" target="_blank" rel="noopener">See our docs for how to use the new filter</a>)</li>
|
18 |
+
</ul>
|
19 |
+
|
20 |
+
<h4>2.5.5.3 - 08/09/2022</h4>
|
21 |
<p><strong>Hot Fix</strong></p>
|
22 |
<ul>
|
23 |
<li>Sanitize photo captions when used in lightboxes</li>
|
1047 |
<p><strong>Enhancements</strong></p>
|
1048 |
<ul>
|
1049 |
<li>Accessibility: Added title attribute setting for iframe in Map module.</li>
|
1050 |
+
<li>Accessibility: Added TAB functionality to Menu module.</li>
|
1051 |
<li>Accessibility: Improved accessibility of Tabs and Accordion modules.</li>
|
1052 |
<li>Accessibility: Added alt attribute to slideshow images.</li>
|
1053 |
<li>Accessibility: Always show label setting as it is also used for aria attribute in Menu module.</li>
|
classes/class-fl-builder-compatibility.php
CHANGED
@@ -48,7 +48,6 @@ final class FLBuilderCompatibility {
|
|
48 |
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'ee_remove_stylesheet' ), 99999 );
|
49 |
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'fix_woocommerce_products_filter' ), 12 );
|
50 |
add_action( 'pre_get_posts', array( __CLASS__, 'fix_woo_archive_loop' ), 99 );
|
51 |
-
add_action( 'pre_get_posts', array( __CLASS__, 'fix_tribe_events_hide_from_listings_archive' ) );
|
52 |
add_action( 'fl_builder_menu_module_before_render', array( __CLASS__, 'fix_menu_module_before_render' ) );
|
53 |
add_action( 'fl_builder_menu_module_after_render', array( __CLASS__, 'fix_menu_module_after_render' ) );
|
54 |
add_action( 'wp_before_admin_bar_render', array( __CLASS__, 'fix_dulicate_page' ), 11 );
|
@@ -81,7 +80,6 @@ final class FLBuilderCompatibility {
|
|
81 |
add_filter( 'fl_builder_loop_rewrite_rules', array( __CLASS__, 'fix_wpseo_category_pagination_rule' ) );
|
82 |
add_filter( 'fl_builder_loop_rewrite_rules', array( __CLASS__, 'fix_seopress_category_pagination_rule' ) );
|
83 |
add_filter( 'fl_builder_loop_rewrite_rules', array( __CLASS__, 'fix_polylang_pagination_rule' ) );
|
84 |
-
add_filter( 'fl_builder_loop_query_args', array( __CLASS__, 'fix_tribe_events_hide_from_listings' ) );
|
85 |
add_filter( 'tribe_events_rewrite_rules_custom', array( __CLASS__, 'fix_tribe_events_pagination_rule' ), 10, 3 );
|
86 |
add_filter( 'woocommerce_product_tabs', array( __CLASS__, 'fix_builder_on_empty_product_description' ) );
|
87 |
add_filter( 'aioseo_conflicting_shortcodes', array( __CLASS__, 'aioseo_conflicting_shortcodes' ) );
|
@@ -997,52 +995,6 @@ final class FLBuilderCompatibility {
|
|
997 |
|
998 |
return $rules;
|
999 |
}
|
1000 |
-
/**
|
1001 |
-
* Fix 'Hide From Event Listings' from the Event Options under the Event Edit Screen
|
1002 |
-
* not being picked up by the Posts Grid module such as when used in a Themer Archive Layout.
|
1003 |
-
*
|
1004 |
-
* @since 2.4.1
|
1005 |
-
*/
|
1006 |
-
public static function fix_tribe_events_hide_from_listings_archive( $query ) {
|
1007 |
-
if ( ! class_exists( 'Tribe__Events__Query' ) || ! class_exists( 'FLThemeBuilder' ) || is_admin() ) {
|
1008 |
-
return;
|
1009 |
-
}
|
1010 |
-
|
1011 |
-
if ( ( $query->is_main_query() && is_post_type_archive( 'tribe_events' ) ) || ( 'fl-theme-layout' === get_post_type() ) ) {
|
1012 |
-
$hide_upcoming_events = Tribe__Events__Query::getHideFromUpcomingEvents();
|
1013 |
-
$current_post_not_in = $query->get( 'post__not_in' );
|
1014 |
-
$query->set( 'post__not_in', array_merge( $current_post_not_in, $hide_upcoming_events ) );
|
1015 |
-
}
|
1016 |
-
}
|
1017 |
-
|
1018 |
-
/**
|
1019 |
-
* Fix 'Hide From Event Listings' from the Event Options under the Event Edit Screen
|
1020 |
-
* not being picked up by the Posts Grid module set to 'custom_query'.
|
1021 |
-
*
|
1022 |
-
* @since 2.4.1
|
1023 |
-
*/
|
1024 |
-
public static function fix_tribe_events_hide_from_listings( $args ) {
|
1025 |
-
if ( ! class_exists( 'Tribe__Events__Query' ) || is_admin() ) {
|
1026 |
-
return $args;
|
1027 |
-
}
|
1028 |
-
|
1029 |
-
if ( empty( $args['settings']->post_type ) || empty( $args['settings']->data_source ) ) {
|
1030 |
-
return $args;
|
1031 |
-
}
|
1032 |
-
|
1033 |
-
if ( 'tribe_events' !== $args['settings']->post_type || 'custom_query' !== $args['settings']->data_source ) {
|
1034 |
-
return $args;
|
1035 |
-
}
|
1036 |
-
|
1037 |
-
$hide_upcoming_events = Tribe__Events__Query::getHideFromUpcomingEvents();
|
1038 |
-
if ( isset( $args['post__not_in'] ) ) {
|
1039 |
-
$args['post__not_in'] = array_merge( $args['post__not_in'], $hide_upcoming_events );
|
1040 |
-
} else {
|
1041 |
-
$args['post__not_in'] = $hide_upcoming_events;
|
1042 |
-
}
|
1043 |
-
|
1044 |
-
return $args;
|
1045 |
-
}
|
1046 |
|
1047 |
/**
|
1048 |
* Only show the first instance of recurring TEC Events.
|
48 |
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'ee_remove_stylesheet' ), 99999 );
|
49 |
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'fix_woocommerce_products_filter' ), 12 );
|
50 |
add_action( 'pre_get_posts', array( __CLASS__, 'fix_woo_archive_loop' ), 99 );
|
|
|
51 |
add_action( 'fl_builder_menu_module_before_render', array( __CLASS__, 'fix_menu_module_before_render' ) );
|
52 |
add_action( 'fl_builder_menu_module_after_render', array( __CLASS__, 'fix_menu_module_after_render' ) );
|
53 |
add_action( 'wp_before_admin_bar_render', array( __CLASS__, 'fix_dulicate_page' ), 11 );
|
80 |
add_filter( 'fl_builder_loop_rewrite_rules', array( __CLASS__, 'fix_wpseo_category_pagination_rule' ) );
|
81 |
add_filter( 'fl_builder_loop_rewrite_rules', array( __CLASS__, 'fix_seopress_category_pagination_rule' ) );
|
82 |
add_filter( 'fl_builder_loop_rewrite_rules', array( __CLASS__, 'fix_polylang_pagination_rule' ) );
|
|
|
83 |
add_filter( 'tribe_events_rewrite_rules_custom', array( __CLASS__, 'fix_tribe_events_pagination_rule' ), 10, 3 );
|
84 |
add_filter( 'woocommerce_product_tabs', array( __CLASS__, 'fix_builder_on_empty_product_description' ) );
|
85 |
add_filter( 'aioseo_conflicting_shortcodes', array( __CLASS__, 'aioseo_conflicting_shortcodes' ) );
|
995 |
|
996 |
return $rules;
|
997 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
998 |
|
999 |
/**
|
1000 |
* Only show the first instance of recurring TEC Events.
|
classes/class-fl-builder-loader.php
CHANGED
@@ -48,7 +48,7 @@ if ( ! class_exists( 'FLBuilderLoader' ) ) {
|
|
48 |
* @return void
|
49 |
*/
|
50 |
static private function define_constants() {
|
51 |
-
define( 'FL_BUILDER_VERSION', '2.5.5.
|
52 |
define( 'FL_BUILDER_FILE', trailingslashit( dirname( dirname( __FILE__ ) ) ) . 'fl-builder.php' );
|
53 |
define( 'FL_BUILDER_DIR', plugin_dir_path( FL_BUILDER_FILE ) );
|
54 |
define( 'FL_BUILDER_URL', esc_url( plugins_url( '/', FL_BUILDER_FILE ) ) );
|
48 |
* @return void
|
49 |
*/
|
50 |
static private function define_constants() {
|
51 |
+
define( 'FL_BUILDER_VERSION', '2.5.5.5' );
|
52 |
define( 'FL_BUILDER_FILE', trailingslashit( dirname( dirname( __FILE__ ) ) ) . 'fl-builder.php' );
|
53 |
define( 'FL_BUILDER_DIR', plugin_dir_path( FL_BUILDER_FILE ) );
|
54 |
define( 'FL_BUILDER_URL', esc_url( plugins_url( '/', FL_BUILDER_FILE ) ) );
|
classes/class-fl-builder-model.php
CHANGED
@@ -4050,14 +4050,15 @@ final class FLBuilderModel {
|
|
4050 |
* @return void
|
4051 |
*/
|
4052 |
static public function save_settings( $node_id = null, $settings = null ) {
|
4053 |
-
$node
|
4054 |
-
if ( !
|
4055 |
return array(
|
4056 |
'node_id' => $node->node,
|
4057 |
'settings' => $node->settings,
|
4058 |
'layout' => FLBuilderAJAXLayout::render(),
|
4059 |
);
|
4060 |
}
|
|
|
4061 |
$new_settings = (object) array_merge( (array) $node->settings, (array) $settings );
|
4062 |
$template_post_id = self::is_node_global( $node );
|
4063 |
|
@@ -7024,6 +7025,13 @@ final class FLBuilderModel {
|
|
7024 |
return ( $prefix ) ? $prefix . '-' . $id : $id;
|
7025 |
}
|
7026 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7027 |
/**
|
7028 |
* @since 1.6.4.3
|
7029 |
* @deprecated 1.8
|
4050 |
* @return void
|
4051 |
*/
|
4052 |
static public function save_settings( $node_id = null, $settings = null ) {
|
4053 |
+
$node = self::get_node( $node_id );
|
4054 |
+
if ( ! FLBuilderModel::user_has_unfiltered_html() && true !== self::verify_settings( $settings ) ) {
|
4055 |
return array(
|
4056 |
'node_id' => $node->node,
|
4057 |
'settings' => $node->settings,
|
4058 |
'layout' => FLBuilderAJAXLayout::render(),
|
4059 |
);
|
4060 |
}
|
4061 |
+
|
4062 |
$new_settings = (object) array_merge( (array) $node->settings, (array) $settings );
|
4063 |
$template_post_id = self::is_node_global( $node );
|
4064 |
|
7025 |
return ( $prefix ) ? $prefix . '-' . $id : $id;
|
7026 |
}
|
7027 |
|
7028 |
+
/**
|
7029 |
+
* @since 2.6
|
7030 |
+
*/
|
7031 |
+
static public function user_has_unfiltered_html() {
|
7032 |
+
return apply_filters( 'fl_user_has_unfiltered_html', current_user_can( 'unfiltered_html' ) );
|
7033 |
+
}
|
7034 |
+
|
7035 |
/**
|
7036 |
* @since 1.6.4.3
|
7037 |
* @deprecated 1.8
|
fl-builder.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Beaver Builder Plugin (Lite Version)
|
4 |
* Plugin URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-uri
|
5 |
* Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
|
6 |
-
* Version: 2.5.5.
|
7 |
* Author: The Beaver Builder Team
|
8 |
* Author URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-author
|
9 |
* Copyright: (c) 2014 Beaver Builder
|
3 |
* Plugin Name: Beaver Builder Plugin (Lite Version)
|
4 |
* Plugin URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-uri
|
5 |
* Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
|
6 |
+
* Version: 2.5.5.5
|
7 |
* Author: The Beaver Builder Team
|
8 |
* Author URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-author
|
9 |
* Copyright: (c) 2014 Beaver Builder
|
includes/ui-js-config.php
CHANGED
@@ -98,7 +98,7 @@ echo 'FLBuilderConfig = ' . FLBuilderUtils::json_encode( apply_filt
|
|
98 |
'recentIcons' => apply_filters( 'fl_builder_recent_icons', get_option( 'fl_plugin_recent_icons', array() ) ),
|
99 |
'themerLayoutsUrl' => admin_url( '/edit.php?post_type=fl-theme-layout' ),
|
100 |
'userCaps' => array(
|
101 |
-
'unfiltered_html' =>
|
102 |
'global_unfiltered_html' => defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ? true : false,
|
103 |
),
|
104 |
/**
|
98 |
'recentIcons' => apply_filters( 'fl_builder_recent_icons', get_option( 'fl_plugin_recent_icons', array() ) ),
|
99 |
'themerLayoutsUrl' => admin_url( '/edit.php?post_type=fl-theme-layout' ),
|
100 |
'userCaps' => array(
|
101 |
+
'unfiltered_html' => FLBuilderModel::user_has_unfiltered_html(),
|
102 |
'global_unfiltered_html' => defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ? true : false,
|
103 |
),
|
104 |
/**
|
includes/updater-config.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
if ( class_exists( 'FLUpdater' ) ) {
|
4 |
FLUpdater::add_product(array(
|
5 |
'name' => 'Beaver Builder Plugin (Lite Version)',
|
6 |
-
'version' => '2.5.5.
|
7 |
'slug' => 'bb-plugin',
|
8 |
'type' => 'plugin',
|
9 |
));
|
3 |
if ( class_exists( 'FLUpdater' ) ) {
|
4 |
FLUpdater::add_product(array(
|
5 |
'name' => 'Beaver Builder Plugin (Lite Version)',
|
6 |
+
'version' => '2.5.5.5',
|
7 |
'slug' => 'bb-plugin',
|
8 |
'type' => 'plugin',
|
9 |
));
|
js/fl-builder-layout.js
CHANGED
@@ -1354,7 +1354,7 @@
|
|
1354 |
|
1355 |
/**
|
1356 |
* Init Row Shape Layer's height.
|
1357 |
-
*
|
1358 |
* @since 2.5.3
|
1359 |
* @access private
|
1360 |
* @method _initRowShapeLayerHeight
|
@@ -1363,7 +1363,7 @@
|
|
1363 |
FLBuilderLayout._adjustRowShapeLayerHeight();
|
1364 |
$( window ).on( 'resize', FLBuilderLayout._adjustRowShapeLayerHeight );
|
1365 |
},
|
1366 |
-
|
1367 |
/**
|
1368 |
* Adjust Row Shape Layer's height to fix to remove the fine line that appears on certain screen sizes.
|
1369 |
*
|
@@ -1373,7 +1373,7 @@
|
|
1373 |
*/
|
1374 |
_adjustRowShapeLayerHeight: function() {
|
1375 |
var rowShapeLayers = $('.fl-builder-shape-layer');
|
1376 |
-
|
1377 |
$( rowShapeLayers ).each(function (index) {
|
1378 |
var rowShapeLayer = $(this),
|
1379 |
shape = $(rowShapeLayer).find('svg'),
|
@@ -1384,6 +1384,24 @@
|
|
1384 |
$(shape).css('height', Math.ceil( height ) );
|
1385 |
}
|
1386 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1387 |
}
|
1388 |
};
|
1389 |
|
1354 |
|
1355 |
/**
|
1356 |
* Init Row Shape Layer's height.
|
1357 |
+
*
|
1358 |
* @since 2.5.3
|
1359 |
* @access private
|
1360 |
* @method _initRowShapeLayerHeight
|
1363 |
FLBuilderLayout._adjustRowShapeLayerHeight();
|
1364 |
$( window ).on( 'resize', FLBuilderLayout._adjustRowShapeLayerHeight );
|
1365 |
},
|
1366 |
+
|
1367 |
/**
|
1368 |
* Adjust Row Shape Layer's height to fix to remove the fine line that appears on certain screen sizes.
|
1369 |
*
|
1373 |
*/
|
1374 |
_adjustRowShapeLayerHeight: function() {
|
1375 |
var rowShapeLayers = $('.fl-builder-shape-layer');
|
1376 |
+
|
1377 |
$( rowShapeLayers ).each(function (index) {
|
1378 |
var rowShapeLayer = $(this),
|
1379 |
shape = $(rowShapeLayer).find('svg'),
|
1384 |
$(shape).css('height', Math.ceil( height ) );
|
1385 |
}
|
1386 |
});
|
1387 |
+
},
|
1388 |
+
_string_to_slug: function( str ) {
|
1389 |
+
str = str.replace(/^\s+|\s+$/g, ''); // trim
|
1390 |
+
// remove accents, swap ñ for n, etc
|
1391 |
+
var from = "àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·";
|
1392 |
+
var to = "aaaaeeeeiiiioooouuuuncescrzyuudtn-";
|
1393 |
+
for (var i=0, l=from.length ; i < l ; i++) {
|
1394 |
+
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
|
1395 |
+
}
|
1396 |
+
if ( 'undefined' == typeof window._fl_string_to_slug_regex ) {
|
1397 |
+
regex = new RegExp('[^a-zA-Z0-9\'":() !.,-_|]', 'g');
|
1398 |
+
} else {
|
1399 |
+
regex = new RegExp('[^' + window._fl_string_to_slug_regex + '\'":\(\) !.,-_|]', 'g');
|
1400 |
+
}
|
1401 |
+
str = str.replace(regex, '') // remove invalid chars
|
1402 |
+
.replace(/\s+/g, ' ') // collapse whitespace and replace by a space
|
1403 |
+
.replace( /\//g, '' ); // collapse all forward-slashes
|
1404 |
+
return str;
|
1405 |
}
|
1406 |
};
|
1407 |
|
js/fl-builder-preview.js
CHANGED
@@ -3186,7 +3186,7 @@
|
|
3186 |
break;
|
3187 |
}
|
3188 |
|
3189 |
-
this.updateCSSRule( shapeSelector, 'height', shapeProps.height );
|
3190 |
this.updateCSSRule( shapeSelector, 'top', shapeProps.top );
|
3191 |
this.updateCSSRule( shapeSelector, 'bottom', shapeProps.bottom );
|
3192 |
|
3186 |
break;
|
3187 |
}
|
3188 |
|
3189 |
+
this.updateCSSRule( shapeSelector, 'height', shapeProps.height + ' !important' );
|
3190 |
this.updateCSSRule( shapeSelector, 'top', shapeProps.top );
|
3191 |
this.updateCSSRule( shapeSelector, 'bottom', shapeProps.bottom );
|
3192 |
|
js/fl-builder.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var FLBuilderColorPicker;!function(u){var i=[],t=navigator.userAgent.toLowerCase(),l="Microsoft Internet Explorer"===navigator.appName,o=l?parseFloat(t.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,n=l&&o<10,s=!1,r=["-moz-","-webkit-","-o-","-ms-"];function a(e,t){return e="top"===e?"top":"left",t=Array.isArray(t)?t:Array.prototype.slice.call(arguments,1),"webkit"===s?(o=[],i="top"===(i=e)?"0% 0%,0% 100%,":"0% 100%,100% 100%,",l=d(l=t),u.each(l,function(e,t){o.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+i+o.join(",")+")"):r[s]+"linear-gradient("+e+", "+t.join(", ")+")";var i,l,o}function d(e){var n=[],s=[],t=[],i=e.length-1;return u.each(e,function(e,t){var i=t,l=!1,o=t.match(/1?[0-9]{1,2}%$/);o&&(i=t.replace(/\s?1?[0-9]{1,2}%$/,""),l=o.shift()),n.push(i),s.push(l)}),!1===s[0]&&(s[0]="0%"),!1===s[i]&&(s[i]="100%"),s=function e(t){var i,l,o,n,s=0,r=t.length-1,a=0,d=!1;if(t.length<=2||u.inArray(!1,t)<0)return t;for(;a<t.length-1;)d||!1!==t[a]?d&&!1!==t[a]&&(r=a,a=t.length):(s=a-1,d=!0),a++;l=r-s;n=parseInt(t[s].replace("%"),10);i=(parseFloat(t[r].replace("%"))-n)/l;a=s+1;o=1;for(;a<r;)t[a]=n+o*i+"%",o++,a++;return e(t)}(s),u.each(s,function(e){t[e]={color:n[e],stop:s[e]}}),t}flBuilderParseColorValue=function(e){var e=e.replace(/\s+/g,""),t=-1!==e.indexOf("rgba")?parseFloat(100*e.replace(/^.*,(.+)\)/,"$1")):100;return{value:e,alpha:t,rgba:t<100}},u.fn.flBuilderColorPickerGradient=function(){var e=arguments;return this.each(function(){n?function(e,l){var o,t,n,s,r;e="top"===e?"top":"left",l=Array.isArray(l)?l:Array.prototype.slice.call(arguments,1),o="top"===e?0:1,t=u(this),n=l.length-1,s='<div class="iris-ie-gradient-shim" style="position:absolute;'+(1==o?"height":"width")+":100%;"+(1==o?"left":"top")+":%start%;"+(1==o?"right":"bottom")+':%end%;filter:%filter%;" data-color:"%color%"></div>',r="","static"===t.css("position")&&t.css({position:"relative"}),l=d(l),u.each(l,function(e,t){var i;if(e===n)return!1;e=l[e+1],t.stop!==e.stop&&(i=100-parseFloat(e.stop)+"%",t.octoHex=new FLBuilderColor(t.color).toIEOctoHex(),e.octoHex=new FLBuilderColor(e.color).toIEOctoHex(),e="progid:DXImageTransform.Microsoft.Gradient(GradientType="+o+", StartColorStr='"+t.octoHex+"', EndColorStr='"+e.octoHex+"')",r+=s.replace("%start%",t.stop).replace("%end%",i).replace("%filter%",e))}),t.find(".iris-ie-gradient-shim").remove(),u(r).prependTo(t)}.apply(this,e):u(this).css("backgroundImage",a.apply(this,e))})},u.fn.flBuilderColorPickerRaninbowGradient=function(e,t){var i,l,o;for(e=e||"top",i="hsl(%h%,"+(t=u.extend({},{s:100,l:50},t)).s+"%,"+t.l+"%)",l=0,o=[];l<=360;)o.push(i.replace("%h%",l)),l+=30;return this.each(function(){u(this).flBuilderColorPickerGradient(e,o)})},(FLBuilderColorPicker=function(e){this._html='<div class="fl-color-picker-ui"><div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="javascript:void(0);"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div></div>';this.options=u.extend({},{elements:null,color:"",mode:"hsl",controls:{horiz:"s",vert:"l",strip:"h"},target:!1,width:200,presets:[],labels:{colorPresets:"Color Presets",colorPicker:"Color Picker",placeholder:"Paste color here...",removePresetConfirm:"Are you sure?",noneColorSelected:"None color selected.",alreadySaved:"%s is already a saved preset.",noPresets:"Add a color preset first.",presetAdded:"%s added to presets!"}},e),(!1==n||!0==n&&7<o)&&this._init()}).prototype={_html:"",_color:"",_currentElement:"",_inited:!1,_defaultHSLControls:{horiz:"s",vert:"l",strip:"h"},_defaultHSVControls:{horiz:"h",vert:"v",strip:"s"},_scale:{h:360,s:100,l:100,v:100},_init:function(){var e=this;u(e.options.elements);u("html").hasClass("fl-color-picker-init")?this._prepareColorFields():(this._color=new FLBuilderColor("#ff0000").setHSpace(e.options.mode),i=this.options.presets,!1===s&&function(){var i,l="backgroundImage";n?s="filter":(i=u('<div id="iris-gradtest" />'),u.each(r,function(e,t){if(i.css(l,t+"linear-gradient(top,#fff,#000)"),i.css(l).match("gradient"))return s=e,!1}),!1===s&&(i.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),i.css(this.bgImageString).match("gradient")&&(s="webkit")),i.remove())}(),e.picker=u(this._html).appendTo("body"),l?9===o?e.picker.addClass("iris-ie-9"):o<=8&&e.picker.addClass("iris-ie-lt9"):t.indexOf("compatible")<0&&t.indexOf("khtml")<0&&t.match(/mozilla/)&&e.picker.addClass("iris-mozilla"),e.controls={square:e.picker.find(".iris-square"),squareDrag:e.picker.find(".iris-square-value"),horiz:e.picker.find(".iris-square-horiz"),vert:e.picker.find(".iris-square-vert"),strip:e.picker.find(".iris-strip"),stripSlider:e.picker.find(".iris-strip .iris-slider-offset")},"hsv"===e.options.mode&&e._has("l",e.options.controls)?e.options.controls=e._defaultHSVControls:"hsl"===e.options.mode&&e._has("v",e.options.controls)&&(e.options.controls=e._defaultHSLControls),e.hue=e._color.h(),this._setTemplates(),this._ui=u(".fl-color-picker-ui"),this._iris=u(".iris-picker"),this._wrapper=u("body"),this._ui.prepend(this._hexHtml).append(this._presetsHtml),e.element=this._ui.find(".fl-color-picker-input"),e._initControls(),e.active="external",e._change(),e._addInputListeners(e.element),this._buildUI(),this._prepareColorFields(),this._pickerControls(),this._presetsControls(),this._buildAlphaUI(),u("html").addClass("fl-color-picker-init"))},_prepareColorFields:function(){var n=this;u(".fl-color-picker-value").each(function(){var e=u(this),t=e.val(),i=e.parent().find(".fl-color-picker-color"),l=flBuilderParseColorValue(t),o="";t&&(i.hasClass("fl-color-picker-alpha-enabled")&&l.rgba?o=e.val().toString():!i.hasClass("fl-color-picker-alpha-enabled")&&l.rgba?(l=(l=t.replace("rgba","rgb")).substr(0,l.lastIndexOf(","))+")",n._color._alpha=1,o=l,e.val(l)):o="#"+e.val().toString(),i.css({backgroundColor:o}))})},_setTemplates:function(){this._alphaHtml='<div class="fl-alpha-wrap"><div class="fl-alpha-slider"></div><div class="fl-alpha-slider-offset"></div><div class="fl-alpha-text"></div></div>',this._presetsHtml='<div class="fl-color-picker-presets"><div class="fl-color-picker-presets-toggle"><div class="fl-color-picker-presets-open-label fl-color-picker-active">'+this.options.labels.colorPresets+' <span class="fl-color-picker-icon-arrow-up"></span></div><div class="fl-color-picker-presets-close-label">'+this.options.labels.colorPicker+' <span class="fl-color-picker-icon-arrow-down"></span></div></div><ul class="fl-color-picker-presets-list"></ul></div>',this._hexHtml='<input type="text" class="fl-color-picker-input" placeholder="'+this.options.labels.placeholder+'"><div class="fl-color-picker-preset-add"></div>',this._presetsTpl='<li class="fl-color-picker-preset"><span class="fl-color-picker-preset-color"></span> <span class="fl-color-picker-preset-label"></span> <span class="fl-color-picker-preset-remove fl-color-picker-icon-remove"></span></li>',this._noPresetsTpl='<li class="fl-color-picker-no-preset"><span class="fl-color-picker-preset-label">'+this.options.labels.noPresets+"</span></li>"},_has:function(i,e){var l=!1;return u.each(e,function(e,t){if(i===t)return!(l=!0)}),l},_buildUI:function(){var i=this;i._presetsList=this._ui.find(".fl-color-picker-presets-list"),i._presetsList.html(""),0<this.options.presets.length?u.each(this.options.presets,function(e,t){i._addPresetView(t)}):i._presetsList.append(this._noPresetsTpl)},_addPresetView:function(e){var t=this._presetsList.find(".fl-color-picker-no-preset"),t=(0<t.length&&t.remove(),u(this._presetsTpl)),i=FLBuilderColor(e);t.attr("data-color",e).find(".fl-color-picker-preset-color").css({backgroundColor:i.toString()}).end().find(".fl-color-picker-preset-label").html(i.toString()),this._presetsList.append(t)},_addPresetFeedback:function(){this._ui.append('<div class="fl-color-picker-added"><div class="fl-color-picker-added-text"><div class="fl-color-picker-icon-check"></div> "'+this.options.labels.presetAdded.replace("%s",this._color.toString())+'"</div></div>'),this._ui.find(".fl-color-picker-added").hide().fadeIn(200).delay(2e3).fadeOut(200,function(){u(this).remove()})},_pickerControls:function(){var i=this;this._wrapper.on("click",".fl-color-picker-color",function(){var e=u(this);i._currentElement=e.parent().find(".fl-color-picker-value"),i._ui.position({my:"left top",at:"left bottom",of:e,collision:"flip",using:function(e,t){i._togglePicker(e)}})}).on("click",".fl-color-picker-clear",function(){var e=u(this);i._currentElement=e.parent().find(".fl-color-picker-value"),e.prev(".fl-color-picker-color").css({backgroundColor:"transparent"}).addClass("fl-color-picker-empty"),i._setColor(""),i.element.val(""),i._currentElement.val("").trigger("change")}),u(document).on("mousedown",function(e){0===u(e.target).closest(".fl-color-picker-ui").length&&(presets=i._ui.find(".fl-color-picker-presets"),presetsCloseLabel=presets.find(".fl-color-picker-presets-close-label"),presetsList=presets.find(".fl-color-picker-presets-list"),presetsCloseLabel.hasClass("fl-color-picker-active")&&0<(list=presetsList.find("li").find("span.fl-color-picker-preset-label")).length&&(presets=[],u.each(list,function(e,t){presets.push(u(t).text())}),u(FLBuilder.colorPicker).trigger("presetSorted",{presets:presets})),u(".fl-color-picker-ui.fl-color-picker-active").removeClass("fl-color-picker-active"))})},_presetsControls:function(){var i=this,e=i._ui.find(".fl-color-picker-preset-add"),l=i._ui.find(".fl-color-picker-presets"),o=l.find(".fl-color-picker-presets-open-label"),n=l.find(".fl-color-picker-presets-close-label"),s=l.find(".fl-color-picker-presets-list");e.off("click").on("click",function(){i._addPreset(i.element.val())}),s.css({height:i.element.innerHeight()+i._iris.innerHeight()+14+"px"}).hide(),s.sortable(),l.off("click").on("click",".fl-color-picker-presets-toggle",function(){n.hasClass("fl-color-picker-active")&&0<(list=s.find("li").find("span.fl-color-picker-preset-label")).length&&(l=[],u.each(list,function(e,t){l.push(u(t).text())}),u(FLBuilder.colorPicker).trigger("presetSorted",{presets:l})),o.toggleClass("fl-color-picker-active"),n.toggleClass("fl-color-picker-active"),s.slideToggle(500)}).on("click",".fl-color-picker-preset",function(e){var t=new FLBuilderColor(u(this).data("color").toString());i._setColor(t),i._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:t.toString()}).removeClass("fl-color-picker-empty"),o.toggleClass("fl-color-picker-active"),n.toggleClass("fl-color-picker-active"),s.slideToggle(500)}).on("click",".fl-color-picker-preset-remove",function(e){e.stopPropagation(),i._removePreset(u(this).parent().data("color"))})},_removePreset:function(e){var t;confirm(this.options.labels.removePresetConfirm)&&(e=e.toString(),-1<(t=i.indexOf(e))&&(i.splice(t,1),this.options.presets=i,this._presetsList.find('.fl-color-picker-preset[data-color="'+e+'"]').slideUp(function(){u(this).remove()})),i.length<1&&this._presetsList.append(this._noPresetsTpl),u(this).trigger("presetRemoved",{presets:i}))},_addPreset:function(e){if(!this._CheckValidColor(e))return alert(this.options.labels.noneColorSelected),!1;e=e.toString().replace(/^#/,"");""===e?alert(this.options.labels.noneColorSelected):-1<i.indexOf(e)?alert(this.options.labels.alreadySaved.replace("%s","#"+e)):(this._addPresetView(e),this._addPresetFeedback(),i.push(e),this.options.presets=i,u(this).trigger("presetAdded",{presets:i}))},_CheckValidColor:function(e){if(!e.match(/^#/)&&!e.match(/^rgb/)&&!e.match(/^hsl/))return!1;var t=document.getElementById("divValidColor");return t||((t=document.createElement("div")).id="divValidColor"),t.style.borderColor="",t.style.borderColor=e,0!=t.style.borderColor.length},_togglePicker:function(e){var t=this;this._ui.hasClass("fl-color-picker-active")?(this._ui.removeClass("fl-color-picker-active"),e&&setTimeout(function(){t._ui.css(e),t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200)):(e&&t._ui.css(e),setTimeout(function(){t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200))},_paint:function(){this._paintDimension("right","strip"),this._paintDimension("top","vert"),this._paintDimension("left","horiz")},_paintDimension:function(e,t){var i,l=this,o=l._color,n=l.options.mode,s=l._getHSpaceColor(),r=l.controls[t],a=l.options.controls;if(t!==l.active&&("square"!==l.active||"strip"===t))switch(a[t]){case"h":if("hsv"===n){switch(s=o.clone(),t){case"horiz":s[a.vert](100);break;case"vert":s[a.horiz](100);break;case"strip":s.setHSpace("hsl")}i=s.toHsl()}else i="strip"===t?{s:s.s,l:s.l}:{s:100,l:s.l};r.flBuilderColorPickerRaninbowGradient(e,i);break;case"s":"hsv"===n?"vert"===t?i=[o.clone().a(0).s(0).toCSS("rgba"),o.clone().a(1).s(0).toCSS("rgba")]:"strip"===t?i=[o.clone().s(100).toCSS("hsl"),o.clone().s(0).toCSS("hsl")]:"horiz"===t&&(i=["#fff","hsl("+s.h+",100%,50%)"]):i="vert"===t&&"h"===l.options.controls.horiz?["hsla(0, 0%, "+s.l+"%, 0)","hsla(0, 0%, "+s.l+"%, 1)"]:["hsl("+s.h+",0%,50%)","hsl("+s.h+",100%,50%)"],r.flBuilderColorPickerGradient(e,i);break;case"l":i="strip"===t?["hsl("+s.h+",100%,100%)","hsl("+s.h+", "+s.s+"%,50%)","hsl("+s.h+",100%,0%)"]:["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],r.flBuilderColorPickerGradient(e,i);break;case"v":i="strip"===t?[o.clone().v(100).toCSS(),o.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],r.flBuilderColorPickerGradient(e,i)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_dimensions:function(e){var t,i=this,l=i.options,o=i.controls.square,n=i.picker.find(".iris-strip"),s=l.border?l.width-20:l.width;if(e&&(o.css("width",""),n.css("width",""),i.picker.css({width:"",height:""})),e=s*(parseFloat("77.5%")/100),s=s*(parseFloat("12%")/100),t=l.border?20+e:e,o.width(e).height(e),n.height(e).width(s),i.picker.css({width:l.width,height:t}),!l.palettes)return i.picker.css("paddingBottom","")},_addInputListeners:function(o){function e(e){var t=new FLBuilderColor(o.val()),i=o.val().replace(/^#/,""),l=n._currentElement.hasClass("fl-color-picker-empty");if(o.removeClass("iris-error"),t.error)""!==i&&o.addClass("iris-error");else if(t.toString()!==n._color.toString()||""!==n._color.toString()&&l)if("keyup"===e.type)i.match(/^[0-9a-fA-F]{3}$/)||(n._setColor(i),n._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:FLBuilderColor(i).toString()}).removeClass("fl-color-picker-empty"),n._currentElement.val(i).trigger("change"));else if("paste"===e.type)return i=e.originalEvent.clipboardData.getData("text").replace(/^#/,""),hex=FLBuilderColor(i).toString(),n._setColor(i),o.val(hex),n._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:hex}).removeClass("fl-color-picker-empty"),n._currentElement.val(i).trigger("change"),!1}var n=this;o.on("change",e).on("keyup",n._debounce(e,100))},_initControls:function(){var n=this,s=n.controls,e=s.square,i=n.options.controls,l=n._scale[i.strip];s.stripSlider.slider({orientation:"horizontal",max:l,slide:function(e,t){n.active="strip","h"===i.strip&&(t.value=l-t.value),n._color[i.strip](t.value),n._change.apply(n,arguments)}}),s.squareDrag.draggable({containment:s.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(e,t){n._squareDrag(e,t)},start:function(){e.addClass("iris-dragging"),u(this).addClass("ui-state-focus")},stop:function(){e.removeClass("iris-dragging"),u(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(e){var t="ui-state-focus";e.preventDefault(),"mousedown"===e.type?(n.picker.find("."+t).removeClass(t).blur(),u(this).addClass(t).focus()):u(this).removeClass(t)}).on("keydown",function(e){var t=s.square,i=s.squareDrag,l=i.position(),o=2;switch(e.altKey&&(o*=10),e.keyCode){case 37:l.left-=o;break;case 38:l.top-=o;break;case 39:l.left+=o;break;case 40:l.top+=o;break;default:return!0}l.left=Math.max(0,Math.min(l.left,t.width())),l.top=Math.max(0,Math.min(l.top,t.height())),i.css(l),n._squareDrag(e,{position:l}),e.preventDefault()}),e.mousedown(function(e){var t;1===e.which&&u(e.target).is("div")&&(t=n.controls.square.offset(),t={top:e.pageY-t.top,left:e.pageX-t.left},e.preventDefault(),n._squareDrag(e,{position:t}),e.target=n.controls.squareDrag.get(0),n.controls.squareDrag.css(t).trigger(e))})},_squareDrag:function(e,t){var i=this,l=i.options.controls,o=i._squareDimensions(),n=Math.round((o.h-t.position.top)/o.h*i._scale[l.vert]),o=i._scale[l.horiz]-Math.round((o.w-t.position.left)/o.w*i._scale[l.horiz]);i._color[l.horiz](o)[l.vert](n),i.active="square",i._change.apply(i,arguments)},_setColor:function(e){var t=this,i=t.options.color;""===e?(e="#ff0000",t.default=!0):t.default=!1,(e=""+(t.options.color=e)).replace(/^#/,""),(e=new FLBuilderColor(e).setHSpace(t.options.mode)).error?t.options.color=i:(t._color=e,t.options.color=t._color.toString(),t.active="external",t._change())},_squareDimensions:function(e){var t=this.controls.square;return void 0!==e&&t.data("dimensions")?t.data("dimensions"):(this.controls.squareDrag,e={w:t.width(),h:t.height()},t.data("dimensions",e),e)},_isNonHueControl:function(e,t){return"square"===e&&"h"===this.options.controls.strip||"external"!==t&&("h"!==t||"strip"!==e)},_change:function(){var l=this,o=l.controls,n=l._getHSpaceColor(),e=["square","strip"],s=l.options.controls,t=s[l.active]||"external",i=l.hue;"strip"===l.active?e=[]:"external"!==l.active&&e.pop(),u.each(e,function(e,t){var i;if(t!==l.active)switch(t){case"strip":i="h"===s.strip?l._scale[s.strip]-n[s.strip]:n[s.strip],o.stripSlider.slider("value",i);break;case"square":i=l._squareDimensions(),i={left:n[s.horiz]/l._scale[s.horiz]*i.w,top:i.h-n[s.vert]/l._scale[s.vert]*i.h},l.controls.squareDrag.css(i)}}),n.h!==i&&l._isNonHueControl(l.active,t)&&l._color.h(i),l.hue=l._color.h(),l.options.color=l._color.toString(),l.element.is(":input")&&!l._color.error&&(l.element.removeClass("iris-error"),l.element.val()!==l._color.toString()&&(l.element.val(l._color.toString()),this._currentElement&&(!l.default||l.default&&"external"!==l.active?this._currentElement.val(l._color.toString().replace(/^#/,"")).parent().find(".fl-color-picker-color").css({backgroundColor:l._color.toString()}).removeClass("fl-color-picker-empty"):this._currentElement.val(""),l._wrapper.find(".fl-alpha-slider-offset").css("background-color",l._color.toString()),this._currentElement.trigger("change")))),l._paint(),l._inited=!0,l.active=!1},_debounce:function(o,n,s){var r,a;return function(){var e=this,t=arguments,i=function(){r=null,s||(a=o.apply(e,t))},l=s&&!r;return clearTimeout(r),r=setTimeout(i,n),a=l?o.apply(e,t):a}},_buildAlphaUI:function(){var t=this;t._wrapper.on("click",".fl-color-picker-color",function(){var e=u(this);t._currentElement.val();e.hasClass("fl-color-picker-alpha-enabled")?(t._ui.find(".fl-alpha-wrap").length<=0&&u(t._alphaHtml).insertAfter(t._iris),t.picker.addClass("fl-color-alpha-enabled"),t._pickerAlphaControls()):(t.picker.removeClass("fl-color-alpha-enabled"),t._ui.find(".fl-alpha-wrap").remove())})},_pickerAlphaControls:function(){var l=this,e=l._currentElement,t=flBuilderParseColorValue(e.val()),e=parseFloat(t.alpha/100),i=l._wrapper,o=l._ui.find(".fl-alpha-wrap"),n=o.find(".fl-alpha-slider"),s=o.find(".fl-alpha-text"),r=o.find(".fl-alpha-slider-offset");alphaHandle=o.find(".ui-slider-handle"),s.text(e<1?e:""),n.slider({orientation:"vertical",slide:function(e,t){var i=parseFloat(t.value/100);l._color._alpha=i,s.text(i<1?i:""),l._change.apply(l,arguments)},create:function(){r.css({backgroundColor:t.value}),i.on("click",".fl-color-picker-clear",function(){l._color._alpha=1,s.text(""),n.slider("value",100).trigger("slide")})},value:t.alpha,step:1,min:0,max:100})}}}(jQuery),!function(e,u){function n(e,t){return this instanceof n?this._init(e,t):new n(e,t)}n.fn=n.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var t="noop";switch(typeof e){case"object":return e.a!==u&&this.a(e.a),this[t=e.r!==u?"fromRgb":e.l!==u?"fromHsl":e.v!==u?"fromHsv":t](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){for(var e=new n(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"],i=t.length-1;0<=i;i--)e[t[i]]=this[t[i]];return e},setHSpace:function(e){return this._hSpace="hsv"===e?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,i=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,(e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,"")).match(i)&&e.match(/\)$/)){if((t=e.replace(/(\s|%)/g,"").replace(i,"").replace(/,?\);?$/,"").split(",")).length<3)return this._error();if(4===t.length&&(this.a(parseFloat(t.pop())),this.error))return this;for(var l=t.length-1;0<=l;l--)if(t[l]=parseInt(t[l],10),isNaN(t[l]))return this._error();return e.match(/^rgb/)?this.fromRgb({r:t[0],g:t[1],b:t[2]}):e.match(/^hsv/)?this.fromHsv({h:t[0],s:t[1],v:t[2]}):this.fromHsl({h:t[0],s:t[1],l:t[2]})}return this.fromHex(e)},fromRgb:function(e,t){return"object"!=typeof e||e.r===u||e.g===u||e.b===u?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),t))},fromHex:function(e){return 3===(e=e.replace(/^#/,"").replace(/^0x/,"")).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var t,i,l,o,n;return"object"!=typeof e||e.h===u||e.s===u||e.l===u?this._error():(this._hsl=e,this._hSpace="hsl",o=e.h/360,n=e.s/100,e=e.l/100,0==n?t=i=l=e:(t=this.hue2rgb(n=2*e-(e=e<.5?e*(1+n):e+n-e*n),e,o+1/3),i=this.hue2rgb(n,e,o),l=this.hue2rgb(n,e,o-1/3)),this.fromRgb({r:255*t,g:255*i,b:255*l},!0))},fromHsv:function(e){var t,i,l,o,n,s,r,a,d;if("object"!=typeof e||e.h===u||e.s===u||e.v===u)return this._error();switch(this._hsv=e,this._hSpace="hsv",s=e.h/360,t=e.s/100,r=(i=e.v/100)*(1-t),a=i*(1-(s=6*s-(e=Math.floor(6*s)))*t),d=i*(1-(1-s)*t),e%6){case 0:l=i,o=d,n=r;break;case 1:l=a,o=i,n=r;break;case 2:l=r,o=i,n=d;break;case 3:l=r,o=a,n=i;break;case 4:l=d,o=r,n=i;break;case 5:l=i,o=r,n=a}return this.fromRgb({r:255*l,g:255*o,b:255*n},!0)},fromInt:function(e,t){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),16777215<this._color?this._color=16777215:this._color<0&&(this._color=0),t===u&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,i){return i<0&&(i+=1),1<i&&--i,i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},toString:function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;0<=t;t--)e="0"+e;return"#"+e},toCSS:function(e,t){switch(e=e||"hex",t=parseFloat(t||this._alpha),e){case"rgb":case"rgba":var i=this.toRgb();return t<1?"rgba( "+i.r+", "+i.g+", "+i.b+", "+t+" )":"rgb( "+i.r+", "+i.g+", "+i.b+" )";case"hsl":case"hsla":i=this.toHsl();return t<1?"hsla( "+i.h+", "+i.s+"%, "+i.l+"%, "+t+" )":"hsl( "+i.h+", "+i.s+"%, "+i.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e,t=this.toRgb(),i=t.r/255,l=t.g/255,o=t.b/255,t=Math.max(i,l,o),n=Math.min(i,l,o),s=(t+n)/2;if(t===n)e=a=0;else{var r=t-n,a=.5<s?r/(2-t-n):r/(t+n);switch(t){case i:e=(l-o)/r+(l<o?6:0);break;case l:e=(o-i)/r+2;break;case o:e=(i-l)/r+4}e/=6}return{h:e=0===(e=Math.round(360*e))&&this._hsl.h!==e?this._hsl.h:e,s:a=0===(a=Math.round(100*a))&&this._hsl.s?this._hsl.s:a,l:Math.round(100*s)}},toHsv:function(){var e,t=this.toRgb(),i=t.r/255,l=t.g/255,o=t.b/255,t=Math.max(i,l,o),n=Math.min(i,l,o),s=t,r=t-n,a=0===t?0:r/t;if(t===n)e=a=0;else{switch(t){case i:e=(l-o)/r+(l<o?6:0);break;case l:e=(o-i)/r+2;break;case o:e=(i-l)/r+4}e/=6}return{h:e=0===(e=Math.round(360*e))&&this._hsv.h!==e?this._hsv.h:e,s:a=0===(a=Math.round(100*a))&&this._hsv.s?this._hsv.s:a,v:Math.round(100*s)}},toInt:function(){return this._color},toIEOctoHex:function(){var e=this.toString(),t=parseInt(255*this._alpha,10).toString(16);return"#"+(t=1===t.length?"0"+t:t)+e.replace(/^#/,"")},toLuminosity:function(){var e=this.toRgb();return.2126*Math.pow(e.r/255,2.2)+.7152*Math.pow(e.g/255,2.2)+.0722*Math.pow(e.b/255,2.2)},getDistanceLuminosityFrom:function(e){if(!(e instanceof n))throw"getDistanceLuminosityFrom requires a Color object";var t=this.toLuminosity(),e=e.toLuminosity();return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)},getMaxContrastColor:function(){var e=this.toLuminosity();return new n(.5<=e?"000000":"ffffff")},getReadableContrastingColor:function(e,t){if(!(e instanceof n))return this;var i=t===u?5:t,l=e.getDistanceLuminosityFrom(this),t=e.getMaxContrastColor();if(t.getDistanceLuminosityFrom(e)<=i)return t;if(i<=l)return this;for(var o=0===t.toInt()?-1:1;l<i&&(this.l(o,!0),l=this.getDistanceLuminosityFrom(e),0!==this._color&&16777215!==this._color););return this},a:function(e){if(e===u)return this._alpha;e=parseFloat(e);return isNaN(e)?this._error():(this._alpha=e,this)},darken:function(e){return this.l(-(e=e||5),!0)},lighten:function(e){return this.l(e=e||5,!0)},saturate:function(e){return this.s(e=e||15,!0)},desaturate:function(e){return this.s(-(e=e||15),!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(e){return this.h(180+30*(e=e||1),!0)},getAnalog:function(e){return this.h(30*(e=e||1),!0)},getTetrad:function(e){return this.h(60*(e=e||1),!0)},getTriad:function(e){return this.h(120*(e=e||1),!0)},_partial:function(l){var o=i[l];return function(e,t){var i=this._spaceFunc("to",o.space);return e===u?i[l]:(!0===t&&(e=i[l]+e),o.mod&&(e%=o.mod),o.range&&(e=e<o.range[0]?o.range[0]:e>o.range[1]?o.range[1]:e),i[l]=e,this._spaceFunc("from",o.space,i))}},_spaceFunc:function(e,t,i){t=t||this._hSpace;return this[e+t.charAt(0).toUpperCase()+t.substr(1)](i)}};var t,i={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(t in i)i.hasOwnProperty(t)&&(n.fn[t]=n.fn._partial(t));"object"==typeof exports?module.exports=n:(e.FLBuilderColor=n,e.Color=n)}(this),!function(s){(FLLightbox=function(e){this._init(e)}).closeParent=function(e){e=s(e).closest(".fl-lightbox-wrap").attr("data-instance-id");_.isUndefined(e)||FLLightbox._instances[e].close()},FLLightbox.getResizableControlClass=function(){var e=s(".fl-lightbox-resizable").eq(0),t="far fa-window-maximize";return t=e.length&&e.hasClass("fl-lightbox-width-full")?"far fa-window-minimize":t},FLLightbox.unbindAll=function(){for(var e in FLLightbox._instances)FLLightbox._instances[e]._unbind()},FLLightbox.bindAll=function(){for(var e in FLLightbox._instances)FLLightbox._instances[e]._bind()},FLLightbox.closeAll=function(){for(var e in FLLightbox._instances)FLLightbox._instances[e].close()},FLLightbox._instances={},FLLightbox.prototype={_id:null,_node:null,_visible:!1,_allowClosing:!0,_resizeTimer:null,_defaults:{className:"",destroyOnClose:!1,resizable:!1},open:function(e){var t=this._node.find(".fl-lightbox"),i=t.closest(".fl-builder-ui-pinned").length,l=this._getPositionSettings();!i&&l&&this._defaults.resizable&&t.css(l),this._bind(),this._node.show(),this._visible=!0,void 0!==e?this.setContent(e):this._resize(),this.trigger("open"),FLBuilder.triggerHook("didShowLightbox",this)},close:function(){var e=this._node.data("parent");this._allowClosing&&(this.trigger("beforeCloseLightbox"),this._unbind(),this._node.hide(),this._visible=!1,this.trigger("close"),FLBuilder.triggerHook("didHideLightbox"),this._defaults.resizable&&_.isUndefined(e)&&FLBuilder.triggerHook("didHideAllLightboxes"),this._defaults.destroyOnClose&&this.destroy())},disableClose:function(){this._allowClosing=!1},enableClose:function(){this._allowClosing=!0},setContent:function(e){this._node.find(".fl-lightbox-content").html(e),this._resize(),0==s(".fl-builder-content-panel-button").length&&s(".fl-builder-panel-drag-handle").show()},empty:function(){this._node.find(".fl-lightbox-content").empty()},on:function(e,t){this._node.on(e,t)},off:function(e,t){this._node.off(e,t)},trigger:function(e,t){this._node.trigger(e,t)},destroy:function(){this._node.empty(),this._node.remove(),FLLightbox._instances[this._id]="undefined";try{delete FLLightbox._instances[this._id]}catch(e){}},_init:function(e){var t=0,i=null;for(i in FLLightbox._instances)t++;this._defaults=s.extend({},this._defaults,e),this._id=(new Date).getTime()+t,(FLLightbox._instances[this._id]=this)._render(),this._resizable()},_render:function(){this._node=s('<div class="fl-lightbox-wrap" data-instance-id="'+this._id+'"><div class="fl-lightbox-mask"></div><div class="fl-lightbox"><div class="fl-lightbox-content-wrap"><div class="fl-lightbox-content"></div></div></div></div>'),this._node.addClass(this._defaults.className),s("body").append(this._node)},_bind:function(){s(window).on("resize.fl-lightbox-"+this._id,this._delayedResize.bind(this))},_unbind:function(){s(window).off("resize.fl-lightbox-"+this._id)},_resizable:function(){s("body");var e=this._node.find(".fl-lightbox-mask"),t=this._node.find(".fl-lightbox"),i=s(".fl-lightbox-resizable").eq(0);this._defaults.resizable?(e.hide(),t.addClass("fl-lightbox-resizable"),t.on("click",".fl-lightbox-resize-toggle",this._resizeClicked.bind(this)),t.draggable({cursor:"move",handle:".fl-lightbox-header"}).resizable({handles:"all",minHeight:500,minWidth:380,start:this._resizeStart.bind(this),stop:this._resizeStop.bind(this)}),i.length&&i.hasClass("fl-lightbox-width-full")?(t.addClass("fl-lightbox-width-full"),t.draggable("disable")):this._restorePosition()):e.show(),this._resize()},_delayedResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._resize.bind(this),250)},_resize:function(){var e=this._node.find(".fl-lightbox"),t=parseInt(this._node.css("padding-top")),i=parseInt(this._node.css("padding-bottom")),l=(parseInt(this._node.css("padding-left")),parseInt(this._node.css("padding-right")),e.height()),o=e.width(),n=s(window),t=n.height()-t-i,i=(n.width(),"0px");this._defaults.resizable?(o<600?e.addClass("fl-lightbox-width-slim"):e.removeClass("fl-lightbox-width-slim"),o<450?e.addClass("fl-lightbox-width-micro"):e.removeClass("fl-lightbox-width-micro"),this._resizeEditors()):(l<t&&(i=(t-l-46)/2+"px"),e.attr("style","").css("margin",i+" auto 0")),this.trigger("resized")},_resizeStart:function(){s("body").addClass("fl-builder-resizable-is-resizing"),s(".fl-builder-lightbox:visible").append('<div class="fl-builder-resizable-iframe-fix"></div>'),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()},_resizeStop:function(e,t){var i=s(".fl-lightbox-resizable:visible");parseInt(i.css("top"))<0&&i.css("top","0"),this._savePosition(),s("body").removeClass("fl-builder-resizable-is-resizing"),s(".fl-builder-resizable-iframe-fix").remove(),FLBuilder._bindOverlayEvents()},_resizeClicked:function(){s(".fl-lightbox-resizable").find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox").hasClass("fl-lightbox-width-full")?this._resizeExitFull():this._resizeEnterFull(),this._resize()},_resizeEnterFull:function(){var e=s(".fl-lightbox-resizable"),t=e.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");t.removeClass("fa-window-maximize").addClass("fa-window-minimize"),e.addClass("fl-lightbox-width-full"),e.draggable("disable"),e.resizable("disable")},_resizeExitFull:function(){var e=s(".fl-lightbox-resizable"),t=e.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");t.removeClass("fa-window-minimize").addClass("fa-window-maximize"),e.removeClass("fl-lightbox-width-full"),e.draggable("enable"),e.resizable("enable")},_resizeEditors:function(){s(".fl-lightbox-resizable").each(function(){var e=s(this),t=e.find(".fl-builder-settings-fields").height(),e=e.find(".mce-edit-area > iframe, textarea.wp-editor-area, .ace_editor"),i=null;t<350&&(t=350),e.each(function(){(i=s(this)).hasClass("ace_editor")?(i.height(t-60),i.closest(".fl-field").data("editor").resize()):i.closest(".mce-container-body").find(".mce-toolbar-grp .mce-toolbar.mce-last").is(":visible")?i.height(t-175):i.height(t-150)})})},_savePosition:function(){var e=this._node.find(".fl-lightbox"),t={width:e.width(),height:e.height(),top:parseInt(e.css("top"))<0?"0px":e.css("top"),left:e.css("left")};e.closest(".fl-builder-ui-pinned").length||(FLBuilderConfig.userSettings.lightbox=t,FLBuilder.ajax({action:"save_lightbox_position",data:t}))},_restorePosition:function(){var e=this._node.find(".fl-lightbox"),t=this._getPositionSettings();t?e.css(t):e.css({top:25,left:FLBuilderConfig.isRtl?"-25":25})},_getPositionSettings:function(){var e=FLBuilderConfig.userSettings.lightbox;if(!e)return!1;var t=window.innerHeight,i=parseInt(e.height),l=parseInt(e.top),o=parseInt(e.left),n=(parseInt(e.top),parseInt(e.width));return o+n+100>screen.width&&(e.left=screen.width-n-250),o<0&&(e.left=50),(t<i&&546<t||t<l+i)&&(t<i&&(e.height=t-50),e.top=0),e}}}(jQuery),!function(s){FLIconSelector={_content:null,_lightbox:null,_rendered:!1,_filterText:"",_liveFilterText:"",open:function(i){FLIconSelector._rendered||FLIconSelector._render(),null===FLIconSelector._content?(FLIconSelector._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),FLBuilder.ajax({action:"render_icon_selector"},FLIconSelector._getContentComplete)):(FLIconSelector._lightbox.open(),s(".fl-icons-filter-text-live").focus()),FLIconSelector._lightbox.on("icon-selected",function(e,t){FLIconSelector._lightbox.off("icon-selected"),FLIconSelector._lightbox.close(),i(t)})},_render:function(){FLIconSelector._lightbox=new FLLightbox({className:"fl-icon-selector"}),FLIconSelector._rendered=!0,FLBuilder.addHook("endEditingSession",function(){FLIconSelector._lightbox.close()})},_getContentComplete:function(e){e=FLBuilder._jsonParse(e);FLIconSelector._content=e.html,FLIconSelector._lightbox.setContent(e.html),s(".fl-icons-filter-text-live").on("keyup",s.debounce(1e3,FLIconSelector.livefilter)),s(".fl-icons-filter-text-live").focus(),s(".fl-icons-list i").on("click",FLIconSelector._select),s(".fl-icon-selector-cancel").on("click",s.proxy(FLIconSelector._lightbox.close,FLIconSelector._lightbox)),FLIconSelector.renderRecent()},renderRecent:function(){var e=FLBuilderConfig.recentIcons;if(e.length<1)return s(".fl-icons-section.recent h2.recent").hide(),!1;s(".fl-icons-section.recent h2.recent").show(),s(".fl-icons-section.recent").show(),s(".recent-icons").html(""),s.each(e,function(e,t){s(".recent-icons").append('<i class="'+t+'"></i>')}),s(".recent-icons").show(),s(".recent-icons i").on("click",FLIconSelector._select),recents=s(".recent-icons i"),s.each(recents,function(e,t){"none"==window.getComputedStyle(s(t)[0],":before").getPropertyValue("content")&&s(t).hide()})},livefilter:function(){var e=s(".fl-icons-filter-text-live").val();if(e===FLIconSelector._liveFilterText)return!1;s(".fl-icons-section.results").html(""),""===e?(FLIconSelector._liveFilterText="",s(".fl-icons-section").show(),FLIconSelector.renderRecent()):(s(".fl-icons-section.recent").hide(),s(".fl-icons-section.all-icons").hide(),s(".fl-icons-section.results").html('<i class="fas fa-spinner fa-spin"></i>'),FLIconSelector._liveFilterText=e,FLBuilder.ajax({action:"query_icons",text:e},FLIconSelector._query_result))},_query_result:function(e){var t=s(".fl-icons-section.results"),o="";if(!e||"[]"===e)return o="<h2>No Icons Found</h2>",FLIconSelector.renderRecent(),t.html(o),t.show(),!1;var e=FLBuilder._jsonParse(e),n="";s.each(e,function(e,l){o+="<h2>"+l.name+"</h2>",s.each(l.data,function(e,i){s.each(i.styles,function(e,t){switch(n="",t){case"solid":n="fas";break;case"regular":n="far";break;case"light":n="fal";break;case"duotone":n="fad";break;case"thin":n="fa-thin";break;case"brands":n="fa-brands fab";break;case"legacy":n=l.prefix}0<n.length&&(n+=" "),o+='<i class="'+n+i.tag+'" title="'+i.label+'"></i>'})})}),t.html(o),t.show(),s(".fl-icons-section.results i").on("click",FLIconSelector._select)},_filter:function(){var e=s(".fl-icons-filter-select").val(),t=s(".fl-icons-filter-text").val()||"";"all"==e?s(".fl-icons-section").show():(s(".fl-icons-section").hide(),s(".fl-"+e).show()),""!==(FLIconSelector._filterText=t)?s(".fl-icons-list i").each(FLIconSelector._filterIcon):s(".fl-icons-list i").show()},_filterIcon:function(){var e=s(this);-1==e.attr("class").indexOf(FLIconSelector._filterText)?e.hide():e.show()},_select:function(){var e=s(this).attr("class");FLBuilder.ajax({action:"recent_icons",icon:e},FLIconSelector._updateRecents),FLIconSelector._lightbox.trigger("icon-selected",e)},_updateRecents:function(e){FLBuilderConfig.recentIcons=FLBuilder._jsonParse(e)}}}(jQuery),!function(i){(FLStyleSheet=function(e){"object"==typeof e&&i.extend(this,e),this._createSheet()}).prototype={id:null,_sheet:null,_sheetElement:null,updateRule:function(e,t,i){for(var l=this._sheet.cssRules||this._sheet.rules,o=null,n=0;n<l.length;n++)l[n].selectorText.toLowerCase().replace(/\s/g,"")==e.toLowerCase().replace(/\s/g,"")&&(o=l[n]);if(o)if("object"==typeof t)for(n in t)this.setProperty(o,n,t[n]);else this.setProperty(o,t,i);else this.addRule(e,t,i)},setProperty:function(e,t,i){var l="";e.style.setProperty?(-1<i.indexOf("!important")&&(l="important",i=i.replace("!important","").trim()),e.style.setProperty(t,i,l)):e.style[this._toCamelCase(t)]=i},addRule:function(e,t,i){var l="",o="";if("object"==typeof t)for(o in t)l+=o+":"+t[o]+";";else l=t+":"+i+";";this._sheet.insertRule?this._sheet.insertRule(e+" { "+l+" }",this._sheet.cssRules.length):this._sheet.addRule(e,l)},destroy:function(){this._sheetElement&&(this._sheetElement.remove(),this._sheetElement=null),this._sheet&&(this._sheet=null)},disable:function(){this._sheet.disabled=!0},enable:function(){this._sheet.disabled=!1},_createSheet:function(){var e=this.id?' id="'+this.id+'"':"",t=this.className?' class="'+this.className+'"':"";this._sheet||(this._sheetElement=i('<style type="text/css"'+e+t+"></style>"),i("body").append(this._sheetElement),this._sheet=this._sheetElement[0].sheet)},_toCamelCase:function(e){return e.toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()})}}}(jQuery),!function(y){FLBuilder={preview:null,_actionsLightbox:null,_ajaxQueue:[],_ajaxRequest:null,_colResizeData:null,_colResizing:!1,_contentClass:!1,_dragEnabled:!1,_dragging:!1,_dragInitialScrollTop:0,_exitUrl:null,_layout:null,_layoutQueue:[],_layoutSettingsCSSCache:null,_layoutSettingsCSSTimeout:null,_lightbox:null,_lightboxScrollbarTimeout:null,_loadedModuleAssets:[],_moduleHelpers:{},_multiplePhotoSelector:null,_newColParent:null,_newColPosition:0,_newColGroupParent:null,_newColGroupPosition:0,_newModuleParent:null,_newModulePosition:0,_newRowPosition:0,_selectedTemplateId:null,_selectedTemplateType:null,_singlePhotoSelector:null,_singleVideoSelector:null,_multipleAudiosSelector:null,_codeDisabled:!1,_sandbox:{},_publishAndRemain:!1,_init:function(){FLBuilder._initJQueryReadyFix(),FLBuilder._initGlobalErrorHandling(),FLBuilder._initPostLock(),FLBuilder._initClassNames(),FLBuilder._initMediaUploader(),FLBuilder._initOverflowFix(),FLBuilder._initScrollbars(),FLBuilder._initLightboxes(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._initStrings(),FLBuilder._initSanityChecks(),FLBuilder._initTipTips(),FLBuilder._initTinyMCE(),FLBuilder._bindEvents(),FLBuilder._bindOverlayEvents(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._checkEnv(),FLBuilder.addHook("didInitUI",FLBuilder._showTourOrTemplates.bind(FLBuilder)),FLBuilder.addHook("endEditingSession",FLBuilder._doStats.bind(this)),FLBuilder.triggerHook("init")},_initJQueryReadyFix:function(){FLBuilderConfig.debug||(jQuery.fn.oldReady=jQuery.fn.ready,jQuery.fn.ready=function(e){return jQuery.fn.oldReady(function(){try{"function"==typeof e&&e(y)}catch(e){FLBuilder.logError(e)}})})},_initSanityChecks:function(){FLBuilderConfig.uploadPath&&"undefined"==typeof FLBuilderLayout&&(url='<a href="'+FLBuilderConfig.uploadUrl+'">wp-admin -> Settings -> Media</a>',FLBuilder.alert('<strong>Critcal Error</strong><p style="font-size:15px;">Please go to '+url+" and make sure uploads folder settings is blank</p>"),y(".fl-builder-alert-close").hide())},_initGlobalErrorHandling:function(){FLBuilderConfig.debug||(window.onerror=function(e,t,i,l,o){return FLBuilder.logGlobalError(e,t,i,l,o),!0})},_initPostLock:function(){void 0!==wp.heartbeat&&(wp.heartbeat.interval(30),wp.heartbeat.enqueue("fl_builder_post_lock",{post_id:FLBuilderConfig.postId}))},_initClassNames:function(){var e=y("html"),t=y("body");e.addClass("fl-builder-edit"),t.addClass("fl-builder"),FLBuilderConfig.simpleUi&&t.addClass("fl-builder-simple"),FLBuilder._contentClass=".fl-builder-content-"+FLBuilderConfig.postId,y(FLBuilder._contentClass).addClass("fl-builder-content-editing")},_initMediaUploader:function(){wp.media.model.settings.post.id=FLBuilderConfig.postId},_initOverflowFix:function(){y(FLBuilder._contentClass).parents().css("overflow","visible")},_initScrollbars:function(){var e=y(".fl-nanoscroller").nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"}).filter(".fl-builder-settings-fields"),t=e.find(".fl-nanoscroller-pane");t.length&&(t=t.get(0).style.display,e=e.find(".fl-nanoscroller-content"),"none"===t?e.removeClass("has-scrollbar"):e.addClass("has-scrollbar"))},_initSortables:function(){var e={appendTo:FLBuilder._contentClass,cursor:"move",cursorAt:{left:85,top:20},distance:1,helper:FLBuilder._blockDragHelper,start:FLBuilder._blockDragStart,sort:FLBuilder._blockDragSort,change:FLBuilder._blockDragChange,stop:FLBuilder._blockDragStop,placeholder:"fl-builder-drop-zone",tolerance:"intersect"},t="",i="",l="",l="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-content":"column"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-col-content":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col:not(.fl-builder-node-loading):not(.fl-node-global) .fl-col-content",i="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target",t=FLBuilderConfig.nestedColumns?l:"row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target";y(".fl-builder-rows").sortable(y.extend({},e,{connectWith:t,items:".fl-builder-block-row",stop:FLBuilder._rowDragStop})),y(".fl-builder-row-templates").sortable(y.extend({},e,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-row-template:not(.fl-builder-block-disabled)",stop:FLBuilder._nodeTemplateDragStop})),y(".fl-builder-saved-rows").sortable(y.extend({},e,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-saved-row",stop:FLBuilder._nodeTemplateDragStop})),y(".fl-builder-saved-columns").sortable(y.extend({},e,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:i,items:".fl-builder-block-saved-column",stop:FLBuilder._nodeTemplateDragStop})),y(".fl-builder-modules, .fl-builder-widgets").sortable(y.extend({},e,{connectWith:l,items:".fl-builder-block-module:not(.fl-builder-block-disabled)",stop:FLBuilder._moduleDragStop})),y(".fl-builder-module-templates").sortable(y.extend({},e,{connectWith:l,items:".fl-builder-block-module-template",stop:FLBuilder._nodeTemplateDragStop})),y(".fl-builder-saved-modules").sortable(y.extend({},e,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:l,items:".fl-builder-block-saved-module",stop:FLBuilder._nodeTemplateDragStop})),y(".fl-row-sortable-proxy").sortable(y.extend({},e,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",helper:FLBuilder._rowDragHelper,start:FLBuilder._rowDragStart,stop:FLBuilder._rowDragStop})),y(".fl-col-sortable-proxy").sortable(y.extend({},e,{connectWith:l,helper:FLBuilder._colDragHelper,start:FLBuilder._colDragStart,stop:FLBuilder._colDragStop})),y(FLBuilder._contentClass+" .fl-col-content").sortable(y.extend({},e,{connectWith:l,handle:".fl-module-sortable-proxy",helper:FLBuilder._moduleDragHelper,items:".fl-module, .fl-col-group",start:FLBuilder._moduleDragStart,stop:FLBuilder._moduleDragStop})),y(FLBuilder._contentClass+" .fl-row-drop-target").sortable(e),y(FLBuilder._contentClass+" .fl-col-group-drop-target").sortable(e),y(FLBuilder._contentClass+" .fl-col-drop-target").sortable(e)},_refreshSortables:function(){y(".ui-sortable").sortable("refresh")},_initStrings:function(){y.validator.messages.required=FLBuilderStrings.validateRequiredMessage},_bindEvents:function(){var e=FLBuilderLayout._isTouch();$excludedLinks=y(".fl-builder-bar a, .fl-builder--content-library-panel a, .fl-page-nav .nav a"),y("a").not($excludedLinks).on("click",FLBuilder._preventDefault),y(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),y("body").on("click",".fl-builder-content a",FLBuilder._preventDefault),y("body").on("mouseup","button.fl-builder-button",this._buttonMouseUp.bind(this)),y(document).on("heartbeat-tick",FLBuilder._initPostLock),y(window).on("beforeunload",FLBuilder._warnBeforeUnload),y("body").on("click touchend",".fl-builder-has-submenu",FLBuilder._submenuParentClicked),y("body").on("click touchend",".fl-builder-has-submenu a",FLBuilder._submenuChildClicked),y("body").on("mouseenter",".fl-builder-submenu",FLBuilder._submenuMouseenter),y("body").on("mouseleave",".fl-builder-submenu",FLBuilder._submenuMouseleave),y("body").on("mouseenter",".fl-builder-submenu .fl-builder-has-submenu",FLBuilder._submenuNestedParentMouseenter),y(".fl-builder-panel-actions .fl-builder-panel-close").on("click",FLBuilder._closePanel),y(".fl-builder-blocks-section-title").on("click",FLBuilder._blockSectionTitleClicked),y("body").on("mousedown",".fl-builder-node-template-actions",FLBuilder._stopPropagation),y("body").on("mousedown",".fl-builder-node-template-edit",FLBuilder._stopPropagation),y("body").on("mousedown",".fl-builder-node-template-delete",FLBuilder._stopPropagation),y("body").on("click",".fl-builder-node-template-edit",FLBuilder._editNodeTemplateClicked),y("body").on("click",".fl-builder-node-template-delete",FLBuilder._deleteNodeTemplateClicked),y("body").on("mousedown",".fl-builder-block:not(.fl-builder-block-disabled)",FLBuilder._blockDragInit),y("body").on("mouseup",FLBuilder._blockDragCancel),y("body").on("click",".fl-builder-actions .fl-builder-cancel-button",FLBuilder._cancelButtonClicked),y("body").on("click",".fl-builder-save-user-template-button",FLBuilder._saveUserTemplateClicked),y("body").on("click",".fl-builder-duplicate-layout-button",FLBuilder._duplicateLayoutClicked),y("body").on("click",".fl-builder-layout-settings-button",FLBuilder._layoutSettingsClicked),y("body").on("click",".fl-builder-layout-settings .fl-builder-settings-save",FLBuilder._saveLayoutSettingsClicked),y("body").on("click",".fl-builder-layout-settings .fl-builder-settings-cancel",FLBuilder._cancelLayoutSettingsClicked),y("body").on("click",".fl-builder-global-settings-button",FLBuilder._globalSettingsClicked),y("body").on("click",".fl-builder-global-settings .fl-builder-settings-save",FLBuilder._saveGlobalSettingsClicked),y("body").on("click",".fl-builder-global-settings .fl-builder-settings-cancel",FLBuilder._cancelLayoutSettingsClicked),y("body").on("click",".fl-user-template",FLBuilder._userTemplateClicked),y("body").on("click",".fl-user-template-edit",FLBuilder._editUserTemplateClicked),y("body").on("click",".fl-user-template-delete",FLBuilder._deleteUserTemplateClicked),y("body").on("click",".fl-builder-template-replace-button",FLBuilder._templateReplaceClicked),y("body").on("click",".fl-builder-template-append-button",FLBuilder._templateAppendClicked),y("body").on("click",".fl-builder-template-actions .fl-builder-cancel-button",FLBuilder._templateCancelClicked),y("body").on("click",".fl-builder-user-template-settings .fl-builder-settings-save",FLBuilder._saveUserTemplateSettings),y("body").on("click",".fl-builder-help-tour-button",FLBuilder._startHelpTour),y("body").on("click",".fl-builder-knowledge-base-button",FLBuilder._viewKnowledgeBaseClicked),y("body").on("click",".fl-builder-forums-button",FLBuilder._visitForumsClicked),y("body").on("click",".fl-builder-no-tour-button",FLBuilder._noTourButtonClicked),y("body").on("click",".fl-builder-yes-tour-button",FLBuilder._yesTourButtonClicked),y("body").on("click",".fl-builder-alert-close",FLBuilder._alertClose),y("body").on("contextmenu",".fl-block-overlay",FLBuilder._onContextmenu),y("body").on("click touchend",".fl-row-overlay .fl-block-remove",FLBuilder._deleteRowClicked),y("body").on("click touchend",".fl-row-overlay .fl-block-copy",FLBuilder._rowCopyClicked),y("body").on("mousedown",".fl-row-overlay .fl-block-move",FLBuilder._rowDragInit),y("body").on("touchstart",".fl-row-overlay .fl-block-move",FLBuilder._rowDragInitTouch),y("body").on("click touchend",".fl-row-overlay .fl-block-settings",FLBuilder._rowSettingsClicked),y("body").on("click",".fl-builder-row-settings .fl-builder-settings-save",FLBuilder._saveSettings),e?y("body").on("touchend",".fl-row-overlay",FLBuilder._rowSettingsClicked):y("body").on("click",".fl-row-overlay",FLBuilder._rowSettingsClicked),y("body").on("click touchend",".fl-block-col-submenu .fl-block-row-reset",FLBuilder._resetRowWidthClicked),y("body").on("mousedown",".fl-col-overlay .fl-block-move",FLBuilder._colDragInit),y("body").on("touchstart",".fl-col-overlay .fl-block-move",FLBuilder._colDragInitTouch),y("body").on("click touchend",".fl-block-col-copy",FLBuilder._copyColClicked),y("body").on("click touchend",".fl-col-overlay .fl-block-remove",FLBuilder._deleteColClicked),y("body").on("click touchend",".fl-col-overlay .fl-block-settings",FLBuilder._colSettingsClicked),y("body").on("click",".fl-builder-col-settings .fl-builder-settings-save",FLBuilder._saveSettings),e?y("body").on("touchend",".fl-col-overlay",FLBuilder._colSettingsClicked):y("body").on("click",".fl-col-overlay",FLBuilder._colSettingsClicked),y("body").on("mousedown",".fl-block-col-submenu .fl-block-col-move",FLBuilder._colDragInit),y("body").on("touchstart",".fl-block-col-submenu .fl-block-col-move",FLBuilder._colDragInitTouch),y("body").on("click touchend",".fl-block-col-submenu .fl-block-col-edit",FLBuilder._colSettingsClicked),y("body").on("click touchend",".fl-block-col-submenu .fl-block-col-delete",FLBuilder._deleteColClicked),y("body").on("click touchend",".fl-block-col-submenu .fl-block-col-reset",FLBuilder._resetColumnWidthsClicked),y("body").on("mouseenter",".fl-block-col-submenu li",FLBuilder._showColHighlightGuide),y("body").on("mouseleave",".fl-block-col-submenu li",FLBuilder._removeColHighlightGuides),y("body").on("mousedown",".fl-block-col-submenu .fl-block-col-move-parent",FLBuilder._colDragInit),y("body").on("touchstart",".fl-block-col-submenu .fl-block-col-move-parent",FLBuilder._colDragInitTouch),y("body").on("click touchend",".fl-block-col-submenu .fl-block-col-edit-parent",FLBuilder._colSettingsClicked),y("body").on("click touchend",".fl-module-overlay .fl-block-remove",FLBuilder._deleteModuleClicked),y("body").on("click touchend",".fl-module-overlay .fl-block-copy",FLBuilder._moduleCopyClicked),y("body").on("mousedown",".fl-module-overlay .fl-block-move",FLBuilder._moduleDragInit),y("body").on("touchstart",".fl-module-overlay .fl-block-move",FLBuilder._moduleDragInitTouch),y("body").on("click touchend",".fl-module-overlay .fl-block-settings",FLBuilder._moduleSettingsClicked),y("body").on("click",".fl-builder-module-settings .fl-builder-settings-save",FLBuilder._saveModuleClicked),y("body").on("click touchend",".fl-module-overlay .fl-block-col-settings",FLBuilder._colSettingsClicked),e?y("body").on("touchend",".fl-module-overlay",FLBuilder._moduleSettingsClicked):y("body").on("click",".fl-module-overlay",FLBuilder._moduleSettingsClicked),y("body").on("click",".fl-builder-settings-save-as",FLBuilder._showNodeTemplateSettings),y("body").on("click",".fl-builder-node-template-settings .fl-builder-settings-save",FLBuilder._saveNodeTemplate),y("body").on("click",".fl-builder-settings-tabs a",FLBuilder._settingsTabClicked),y("body").on("show",".fl-builder-settings-tabs a",FLBuilder._calculateSettingsTabsOverflow),y("body").on("hide",".fl-builder-settings-tabs a",FLBuilder._calculateSettingsTabsOverflow),y("body").on("click",".fl-builder-settings-cancel",FLBuilder._settingsCancelClicked),y("body").on("click",".fl-builder-settings-tabs-overflow-menu > a",FLBuilder._settingsTabsToOverflowMenuItemClicked.bind(this)),y("body").on("click",".fl-builder-settings-tabs-more",FLBuilder._toggleTabsOverflowMenu.bind(this)),y("body").on("click",".fl-builder-settings-tabs-overflow-click-mask",FLBuilder._hideTabsOverflowMenu.bind(this)),y("body").on("mouseover",".fl-help-tooltip-icon",FLBuilder._showHelpTooltip),y("body").on("mouseout",".fl-help-tooltip-icon",FLBuilder._hideHelpTooltip),y("body").on("click",".fl-builder-field-add",FLBuilder._addFieldClicked),y("body").on("click",".fl-builder-field-copy",FLBuilder._copyFieldClicked),y("body").on("click",".fl-builder-field-delete",FLBuilder._deleteFieldClicked),y("body").on("click",".fl-photo-field .fl-photo-select",FLBuilder._selectSinglePhoto),y("body").on("click",".fl-photo-field .fl-photo-edit",FLBuilder._selectSinglePhoto),y("body").on("click",".fl-photo-field .fl-photo-replace",FLBuilder._selectSinglePhoto),y("body").on("click",".fl-photo-field .fl-photo-remove",FLBuilder._singlePhotoRemoved),y("body").on("click",".fl-multiple-photos-field .fl-multiple-photos-select",FLBuilder._selectMultiplePhotos),y("body").on("click",".fl-multiple-photos-field .fl-multiple-photos-edit",FLBuilder._selectMultiplePhotos),y("body").on("click",".fl-multiple-photos-field .fl-multiple-photos-add",FLBuilder._selectMultiplePhotos),y("body").on("click",".fl-video-field .fl-video-select",FLBuilder._selectSingleVideo),y("body").on("click",".fl-video-field .fl-video-replace",FLBuilder._selectSingleVideo),y("body").on("click",".fl-video-field .fl-video-remove",FLBuilder._singleVideoRemoved),y("body").on("click",".fl-multiple-audios-field .fl-multiple-audios-select",FLBuilder._selectMultipleAudios),y("body").on("click",".fl-multiple-audios-field .fl-multiple-audios-edit",FLBuilder._selectMultipleAudios),y("body").on("click",".fl-multiple-audios-field .fl-multiple-audios-add",FLBuilder._selectMultipleAudios),y("body").on("click",".fl-icon-field .fl-icon-select",FLBuilder._selectIcon),y("body").on("click",".fl-icon-field .fl-icon-replace",FLBuilder._selectIcon),y("body").on("click",".fl-icon-field .fl-icon-remove",FLBuilder._removeIcon),y("body").on("click",".fl-form-field .fl-form-field-edit",FLBuilder._formFieldClicked),y("body").on("click",".fl-form-field-settings .fl-builder-settings-save",FLBuilder._saveFormFieldClicked),y("body").on("click",".fl-layout-field-option",FLBuilder._layoutFieldClicked),y("body").on("click",".fl-link-field-select",FLBuilder._linkFieldSelectClicked),y("body").on("click",".fl-link-field-search-cancel",FLBuilder._linkFieldSelectCancelClicked),y("body").on("change",".fl-loop-data-source-select select[name=data_source]",FLBuilder._loopDataSourceChange),y("body").on("change",".fl-custom-query select[name=post_type]",FLBuilder._customQueryPostTypeChange),y("body").on("change",".fl-text-field-add-value",FLBuilder._textFieldAddValueSelectChange),y("body").on("focus",".fl-field input[type=number]",FLBuilder._onNumberFieldFocus),y("body").on("blur",".fl-field input[type=number]",FLBuilder._onNumberFieldBlur),FLBuilder.addHook("didCompleteAJAX",FLBuilder._refreshSettingsPreviewReference),FLBuilder.addHook("didRenderLayoutComplete",FLBuilder._refreshSettingsPreviewReference)},_unbindEvents:function(){y("a").off("click",FLBuilder._preventDefault),y(".fl-page-nav .nav a").off("click",FLBuilder._headerLinkClicked),y("body").undelegate(".fl-builder-content a","click",FLBuilder._preventDefault)},_rebindEvents:function(){y("a").on("click",FLBuilder._preventDefault),y(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),y("body").on("click",".fl-builder-content a",FLBuilder._preventDefault)},_bindOverlayEvents:function(){var e=y(FLBuilder._contentClass);e.on("mouseenter touchstart",".fl-row",FLBuilder._rowMouseenter),e.on("mouseleave",".fl-row",FLBuilder._rowMouseleave),e.on("mouseleave",".fl-row-overlay",FLBuilder._rowMouseleave),e.on("mouseenter touchstart",".fl-col",FLBuilder._colMouseenter),e.on("mouseleave",".fl-col",FLBuilder._colMouseleave),e.on("mouseenter touchstart",".fl-module",FLBuilder._moduleMouseenter),e.on("mouseleave",".fl-module",FLBuilder._moduleMouseleave)},_destroyOverlayEvents:function(){var e=y(FLBuilder._contentClass);e.undelegate(".fl-row","mouseenter touchstart",FLBuilder._rowMouseenter),e.undelegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),e.undelegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),e.undelegate(".fl-col","mouseenter touchstart",FLBuilder._colMouseenter),e.undelegate(".fl-col","mouseleave",FLBuilder._colMouseleave),e.undelegate(".fl-module","mouseenter touchstart",FLBuilder._moduleMouseenter),e.undelegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_onContextmenu:function(e){y(this).hide()},_preventDefault:function(e){e.preventDefault()},_stopPropagation:function(e){e.stopPropagation()},_headerLinkClicked:function(e){var t=y(this).attr("href");this.hash||(e.preventDefault(),FLBuilderConfig.isUserTemplate||(FLBuilder._exitUrl=-1<t.indexOf("?")?t:t+"?fl_builder",FLBuilder.triggerHook("triggerDone")))},_warnBeforeUnload:function(){var e=0<y(".fl-builder-row-settings").length,t=0<y(".fl-builder-col-settings").length,i=0<y(".fl-builder-module-settings").length;if(e||t||i)return FLBuilderStrings.unloadWarning},_upgradeClicked:function(){window.open(FLBuilderConfig.upgradeUrl)},_toggleProModules:function(){var e=y(".fl-builder-blocks-pro-expand"),t=y(".fl-builder-blocks-pro-closed"),i=y(".fl-builder-blocks-pro-open");e.toggleClass("fl-builder-blocks-pro-expand-rotate"),t.length?(t.removeClass("fl-builder-blocks-pro-closed"),t.addClass("fl-builder-blocks-pro-open")):(i.removeClass("fl-builder-blocks-pro-open"),i.addClass("fl-builder-blocks-pro-closed"))},_showProMessage:function(e){var t,i;FLBuilderConfig.lite&&(t=new FLLightbox({className:"fl-builder-pro-lightbox",destroyOnClose:!0}),i=wp.template("fl-pro-lightbox"),t.open(i({feature:e})))},_initTipTips:function(){var e=y(".fl-tip:not(.fl-has-tip)");e.each(function(){var e=y(this);e.addClass("fl-has-tip"),null==e.attr("data-title")&&e.attr("data-title",e.attr("title"))}),FLBuilderLayout._isTouch()||e.tipTip({defaultPosition:"top",delay:300,maxWidth:"auto"})},_hideTipTips:function(){y("#tiptip_holder").stop().hide()},_submenuParentClicked:function(e){var t=y("body"),i=y(this),l=i.find(".fl-builder-submenu");i.hasClass("fl-builder-submenu-open")?(t.removeClass("fl-builder-submenu-open"),i.removeClass("fl-builder-submenu-open"),i.removeClass("fl-builder-submenu-right")):(i.offset().left+l.width()>y(window).width()&&i.addClass("fl-builder-submenu-right"),t.addClass("fl-builder-submenu-open"),i.addClass("fl-builder-submenu-open")),l.closest(".fl-row-overlay").addClass("fl-row-menu-active"),FLBuilder._hideTipTips(),e.preventDefault(),e.stopPropagation()},_submenuChildClicked:function(e){var t=y("body"),i=y(this).parents(".fl-builder-has-submenu");i.parents(".fl-builder-has-submenu").length||(t.removeClass("fl-builder-submenu-open"),i.removeClass("fl-builder-submenu-open"))},_submenuMouseenter:function(e){var t=y(this).data("timeout");void 0!==t&&clearTimeout(t)},_submenuMouseleave:function(e){var t=y("body"),i=y(this),l=setTimeout(function(){t.removeClass("fl-builder-submenu-open"),i.closest(".fl-builder-has-submenu").removeClass("fl-builder-submenu-open")},500);i.closest(".fl-row-overlay").removeClass("fl-row-menu-active"),i.data("timeout",l)},_submenuNestedParentMouseenter:function(e){var t=y(this),i=t.find(".fl-builder-submenu");t.width()+t.offset().left+i.width()>y(window).width()&&t.addClass("fl-builder-submenu-right")},_closeAllSubmenus:function(){y(".fl-builder-submenu-open").removeClass("fl-builder-submenu-open")},_buttonMouseUp:function(e){y(e.currentTarget).blur()},_closePanel:function(){FLBuilder.triggerHook("hideContentPanel")},_showPanel:function(){FLBuilder.triggerHook("showContentPanel")},_togglePanel:function(){FLBuilder.triggerHook("toggleContentPanel")},_blockSectionTitleClicked:function(){var e=y(this).parent();e.hasClass("fl-active")?e.removeClass("fl-active"):(y(".fl-builder-blocks-section").removeClass("fl-active"),e.addClass("fl-active")),FLBuilder._initScrollbars()},_publishLayout:function(e,t){if(FLBuilder._triggerSettingsSave(t,!0)){_.isUndefined(e)&&(e=!0);const i=FL.Builder.data.getLayoutActions();t=FLBuilder._onPublishComplete.bind(FLBuilder,e);i.saveLayout(!0,e,t)}},_publishButtonClicked:function(e){FLBuilder._publishLayout(e)},_onPublishComplete:function(e){e&&(FLBuilderConfig.shouldRefreshOnPublish?FLBuilder._exit():FLBuilder._exitWithoutRefresh()),y("#wp-admin-bar-fl-builder-frontend-edit-link .fl-builder-admin-bar-status-dot").css("color","#6bc373"),FLBuilder.triggerHook("didPublishLayout",{shouldExit:e})},_draftButtonClicked:function(){FLBuilder.showAjaxLoader();const e=FL.Builder.data.getLayoutActions();e.saveDraft()},_discardButtonClicked:function(){if(confirm(FLBuilderStrings.discardMessage)){FLBuilder.showAjaxLoader();const e=FL.Builder.data.getLayoutActions();e.discardDraft()}else FLBuilder.triggerHook("didCancelDiscard")},_cancelButtonClicked:function(){FLBuilder._exitUrl=null,FLBuilder._actionsLightbox.close()},_exit:function(){var e=window.location.href;try{var t=void 0!==window.opener.FLBuilder}catch(e){t=!1}FLBuilderConfig.isUserTemplate&&void 0!==window.opener&&window.opener?(t&&("undefined"==typeof FLBuilderGlobalNodeId?window.opener.FLBuilder._updateLayout():window.opener.FLBuilder._updateNode(FLBuilderGlobalNodeId)),window.close()):(e=FLBuilder._exitUrl||(e=(e=e.replace("?fl_builder&","?")).replace("?fl_builder","")).replace("&fl_builder",""),window.location.href=e)},_exitWithoutRefresh:function(){window.location.href;try{var t=void 0!==window.opener.FLBuilder}catch(e){t=!1}FLBuilderConfig.isUserTemplate&&t&&window.opener?(t&&("undefined"==typeof FLBuilderGlobalNodeId?window.opener.FLBuilder._updateLayout():window.opener.FLBuilder._updateNode(FLBuilderGlobalNodeId)),window.close()):FLBuilder.triggerHook("endEditingSession")},_duplicateLayoutClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"duplicate_post"},FLBuilder._duplicateLayoutComplete)},_duplicateLayoutComplete:function(e){var t=FLBuilderConfig.adminUrl;window.location.href=t+"post.php?post="+e+"&action=edit"},_layoutSettingsClicked:function(){FLBuilderSettingsForms.render({id:"layout",className:"fl-builder-layout-settings",settings:FLBuilderSettingsConfig.settings.layout},function(){FLBuilder._layoutSettingsInitCSS()})},_layoutSettingsInitCSS:function(){var e=y(".fl-builder-settings #fl-field-css textarea:not(.ace_text-input)");e.on("change",FLBuilder._layoutSettingsCSSChanged),FLBuilder._layoutSettingsCSSCache=e.val()},_layoutSettingsCSSChanged:function(){FLBuilder._layoutSettingsCSSTimeout&&clearTimeout(FLBuilder._layoutSettingsCSSTimeout),FLBuilder._layoutSettingsCSSTimeout=setTimeout(y.proxy(FLBuilder._layoutSettingsCSSDoChange,this),600)},_layoutSettingsCSSDoChange:function(){var e=y(".fl-builder-settings"),t=y(this);0<t.parents("#fl-field-css").find(".ace_error").length||((e.hasClass("fl-builder-layout-settings")?y("#fl-builder-layout-css"):y("#fl-builder-global-css")).html(t.val()),FLBuilder._layoutSettingsCSSTimeout=null)},_saveLayoutSettingsClicked:function(){for(var e=y(this).closest(".fl-builder-settings").serializeArray(),t={},i=0;i<e.length;i++)t[e[i].name]=e[i].value;FLBuilder.showAjaxLoader(),FLBuilder._lightbox.close(),FLBuilder._layoutSettingsCSSCache=null;const l=FL.Builder.data.getLayoutActions();l.saveLayoutSettings(t)},_cancelLayoutSettingsClicked:function(){(y(".fl-builder-settings").hasClass("fl-builder-layout-settings")?y("#fl-builder-layout-css"):y("#fl-builder-global-css")).html(FLBuilder._layoutSettingsCSSCache),FLBuilder._layoutSettingsCSSCache=null},_saveLayoutSettingsComplete:function(e){FLBuilder.triggerHook("didSaveLayoutSettingsComplete",e),FLBuilder._updateLayout()},_globalSettingsClicked:function(){FLBuilderSettingsForms.render({id:"global",className:"fl-builder-global-settings",settings:FLBuilderSettingsConfig.settings.global},function(){FLBuilder._layoutSettingsInitCSS()})},_saveGlobalSettingsClicked:function(){var e=y(this).closest(".fl-builder-settings"),t=e.validate().form(),e=FLBuilder._getSettings(e);if(t){FLBuilder.showAjaxLoader(),FLBuilder._layoutSettingsCSSCache=null;const i=FL.Builder.data.getLayoutActions();i.saveGlobalSettings(e),FLBuilder._lightbox.close()}},_saveGlobalSettingsComplete:function(e){FLBuilder.triggerHook("didSaveGlobalSettingsComplete",FLBuilder._jsonParse(e)),FLBuilder._updateLayout()},_initTemplateSelector:function(){0<y(FLBuilder._contentClass).find(".fl-row").length||FLBuilder.ContentPanel.show("modules")},_requestTemplateInsert:function(e,t){FLBuilder.layoutHasContent()?0==e?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate(0,!1,t)):(FLBuilder._selectedTemplateId=e,FLBuilder._selectedTemplateType=t,FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(e,!1,t)},_showTemplateActions:function(){var e=[];e[10]={key:"template-replace",label:FLBuilderStrings.templateReplace},e[20]={key:"template-append",label:FLBuilderStrings.templateAppend},FLBuilder._showActionsLightbox({className:"fl-builder-template-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_templateReplaceClicked:function(){confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!1,FLBuilder._selectedTemplateType))},_templateAppendClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!0,FLBuilder._selectedTemplateType)},_templateCancelClicked:function(){FLBuilder.triggerHook("showContentPanel")},_applyTemplate:function(e,t,i){t=void 0!==t&&t?"1":"0",i=void 0===i?"core":i,FLBuilder._lightbox.close(),FLBuilder.showAjaxLoader();const l=FL.Builder.data.getLayoutActions();l.applyTemplate(e,t,i),FLBuilder.triggerHook("didApplyTemplate")},_applyTemplateComplete:function(e){e=FLBuilder._jsonParse(e);FLBuilder._renderLayout(e.layout),FLBuilder.triggerHook("didApplyTemplateComplete",e.config)},_applyUserTemplateComplete:function(e){e=FLBuilder._jsonParse(e);null!==e.layout_css&&y("#fl-builder-layout-css").html(e.layout_css),FLBuilder._renderLayout(e.layout),FLBuilder.triggerHook("didApplyTemplateComplete",e.config)},_saveUserTemplateClicked:function(){FLBuilderConfig.lite?FLBuilder._showProMessage("Saving Templates"):FLBuilderSettingsForms.render({id:"user_template",className:"fl-builder-user-template-settings",rules:{name:{required:!0}}})},_saveUserTemplateSettings:function(){var e=y(this).closest(".fl-builder-settings"),t=e.validate().form(),e=FLBuilder._getSettings(e);if(t){const i=FL.Builder.data.getLayoutActions();i.saveUserTemplateSettings(e),FLBuilder._lightbox.close()}},_saveUserTemplateSettingsComplete:function(e){e&&(e=FLBuilder._jsonParse(e),FLBuilderConfig.contentItems.template.push(e),FLBuilder.triggerHook("contentItemsChanged"))},_userTemplateClicked:function(){var e=y(this).attr("data-id");0<y(FLBuilder._contentClass).children(".fl-row").length?"blank"==e?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate("blank",!1,"user")):(FLBuilder._selectedTemplateId=e,FLBuilder._selectedTemplateType="user",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(e,!1,"user")},_editUserTemplateClicked:function(e){e.preventDefault(),e.stopPropagation(),window.open(y(this).attr("href"))},_deleteUserTemplateClicked:function(e){var t=y(this).closest(".fl-user-template").attr("data-id"),i=(y(".fl-user-template[data-id="+t+"]"),null),l=null;if(confirm(FLBuilderStrings.deleteTemplate)){const o=FL.Builder.data.getLayoutActions();for(l in o.deleteUserTemplate(t),FLBuilderConfig.contentItems.template)FLBuilderConfig.contentItems.template[l].postId==t&&(i=l);_.isNull(i)||(FLBuilderConfig.contentItems.template.splice(i,1),FLBuilder.triggerHook("contentItemsChanged"))}e.stopPropagation()},_viewKnowledgeBaseClicked:function(){window.open(FLBuilderConfig.help.knowledge_base_url)},_visitForumsClicked:function(){window.open(FLBuilderConfig.help.forums_url)},_showTourOrTemplates:function(){FLBuilderConfig.simpleUi||FLBuilderConfig.isUserTemplate||(FLBuilderConfig.help.tour&&FLBuilderConfig.newUser?FLBuilder._showTourLightbox():FLBuilder._initTemplateSelector())},_doStats:function(){1==FLBuilderConfig.statsEnabled&&(args={"screen-width":screen.width,"screen-height":screen.height,"pixel-ratio":window.devicePixelRatio,"user-agent":window.navigator.userAgent,isrtl:FLBuilderConfig.isRtl},FLBuilder.ajax({action:"save_browser_stats",browser_data:args}))},_showTourLightbox:function(){var e=wp.template("fl-tour-lightbox");FLBuilder._actionsLightbox.open(e())},_noTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._initTemplateSelector()},_yesTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_startHelpTour:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_setupEmptyLayout:function(){var e=y(FLBuilder._contentClass);FLBuilderConfig.isUserTemplate&&"module"==FLBuilderConfig.userTemplateType||FLBuilderConfig.isUserTemplate&&"column"==FLBuilderConfig.userTemplateType||(e.removeClass("fl-builder-empty"),e.find(".fl-builder-empty-message").remove(),e.find(".fl-row, .fl-builder-block").length||(e.addClass("fl-builder-empty"),e.append('<span class="fl-builder-empty-message">'+FLBuilderStrings.emptyMessage+"</span>"),FLBuilder._initSortables()))},_updateNode:function(e,t){if(y(".fl-node-"+e).length){FLBuilder._showNodeLoading(e);const i=FL.Builder.data.getLayoutActions();i.renderNode(e,t)}},_updateLayout:function(){FLBuilder.showAjaxLoader();const e=FL.Builder.data.getLayoutActions();e.renderLayout(),e.fetchLayout()},_renderLayout:function(e,t){FLBuilder._layout?FLBuilder._layoutQueue.push({data:e,callback:t}):FLBuilder._layout=new FLBuilderAJAXLayout(e,t)},_renderLayoutComplete:function(){var e;FLBuilder._layout&&(FLBuilder._layout._complete(),FLBuilder._layout=null),FLBuilder._layoutQueue.length&&(e=FLBuilder._layoutQueue.shift(),FLBuilder._layout=new FLBuilderAJAXLayout(e.data,e.callback))},_resizeLayout:function(){y(window).trigger("resize"),"undefined"!=typeof YUI&&YUI().use("node-event-simulate",function(e){e.one(window).simulate("resize")})},layoutHasContent:function(){return 0<y(FLBuilder._contentClass).children(".fl-row").length},_initMediaElements:function(){var e={};void 0!==y.fn.mediaelementplayer&&("undefined"!=typeof _wpmejsSettings&&(e.pluginPath=_wpmejsSettings.pluginPath),y(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").mediaelementplayer(e))},_initDropTargets:function(){var e="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",t=y(FLBuilder._contentClass+" .fl-row"),i=null,l=y(FLBuilder._contentClass+" .fl-row"+e).find(".fl-col-group"),o=null,n=null,e="column"==FLBuilderConfig.userTemplateType?y(FLBuilder._contentClass+"> .fl-col").eq(0):null,s=0;for(y(".fl-col-drop-target").remove(),y(".fl-col-group-drop-target").remove(),y(".fl-row-drop-target").remove(),y(FLBuilder._contentClass).append('<div class="fl-drop-target fl-row-drop-target"></div>'),t.prepend('<div class="fl-drop-target fl-row-drop-target"></div>'),t.append('<div class="fl-drop-target fl-drop-target-last fl-row-drop-target fl-row-drop-target-last"></div>');s<t.length;s++)0===(i=t.eq(s)).find(".fl-col-group").length&&i.find(".fl-row-content").prepend('<div class="fl-drop-target fl-col-group-drop-target"></div>');for(e&&0===l.length&&(l=e.find(".fl-col-group"),e.append('<div class="fl-drop-target fl-col-drop-target"></div>'),e.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')),s=0;s<l.length;s++)n=(o=l.eq(s)).find("> .fl-col"),o.hasClass("fl-col-group-nested")||(o.append('<div class="fl-drop-target fl-col-group-drop-target"></div>'),o.append('<div class="fl-drop-target fl-drop-target-last fl-col-group-drop-target fl-col-group-drop-target-last"></div>')),n.append('<div class="fl-drop-target fl-col-drop-target"></div>'),n.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')},_blockDragHelper:function(e,t){var i=t.clone();return t.clone().insertAfter(t),i.addClass("fl-builder-block-drag-helper"),i},_blockDragInit:function(e){var t=y(e.currentTarget),i=null,l=y(window).scrollTop(),o=0;FLBuilder._dragEnabled=!0,FLBuilder._dragInitialScrollTop=l,0<t.closest("[data-node]").length?(i=t.closest("[data-node]")).addClass("fl-node-drag-init"):t.hasClass("fl-builder-block")&&y(".fl-row").each(function(){null===i&&0<y(this).offset().top-l&&(i=y(this))}),null!==i&&(o=i.offset().top-l),FLBuilder._highlightRowsAndColsForDrag(t),FLBuilder._adjustColHeightsForDrag(),FLBuilder._disableGlobalRows(),FLBuilder._disableGlobalCols(),FLBuilder._destroyOverlayEvents(),FLBuilder._initSortables(),y("body").addClass("fl-builder-dragging"),y(".fl-builder-empty-message").hide(),y(".fl-sortable-disabled").removeClass("fl-sortable-disabled"),"touchstart"===e.type||y(e.target).hasClass("fl-sortable-proxy-item ")||FLBuilder._removeAllOverlays(),0<o&&scrollTo(0,i.offset().top-o),FLBuilder.triggerHook("didInitDrag")},_blockDragStart:function(e,t){FLBuilder._dragging=!0,y(".fl-node-drag-init").removeClass("fl-node-drag-init"),FLBuilder.triggerHook("didStartDrag")},_blockDragSort:function(e,t){var i=t.placeholder.parent(),l=FLBuilderStrings.insert;FLBuilder._blockPreventSort(t.item,i)||(i.hasClass("fl-col-content")?l=t.item.hasClass("fl-builder-block-row")?t.item.find(".fl-builder-block-title").text():t.item.hasClass("fl-col-sortable-proxy-item")?FLBuilderStrings.column:t.item.hasClass("fl-builder-block-module")||t.item.hasClass("fl-builder-block-saved-module")||t.item.hasClass("fl-builder-block-module-template")?t.item.find(".fl-builder-block-title").text():t.item.attr("data-name"):i.hasClass("fl-col-drop-target")||i.hasClass("fl-col-group-drop-target")?l="":i.hasClass("fl-row-drop-target")&&(l=t.item.hasClass("fl-builder-block-row")||t.item.hasClass("fl-builder-block-saved-row")||t.item.hasClass("fl-builder-block-saved-column")?t.item.find(".fl-builder-block-title").text():t.item.hasClass("fl-row-sortable-proxy-item")?FLBuilderStrings.row:FLBuilderStrings.newRow),t.placeholder.html(l),t.item.hasClass("fl-node-global")||t.item.hasClass("fl-builder-block-global")||y(".fl-node-dragging").hasClass("fl-node-global")?t.placeholder.addClass("fl-builder-drop-zone-global"):t.placeholder.removeClass("fl-builder-drop-zone-global"))},_blockDragChange:function(e,t){t.placeholder.css("opacity","0"),t.placeholder.animate({opacity:"1"},100)},_blockPreventSort:function(e,t){var i=!1,l=e.hasClass("fl-builder-block-row"),o=e.hasClass("fl-col-sortable-proxy-item"),n=t.hasClass("fl-col-content"),s=t.hasClass("fl-col-drop-target"),r=t.parents(".fl-col-group:not(.fl-col-group-nested)"),a=t.parents(".fl-col-group-nested");return(l||o)&&n&&0<a.length&&(i=!0),n&&!t.find(".fl-module, .fl-col").length&&(l&&"1-col"==e.data("cols")||o)&&(i=!0),l&&n&&-1<y.inArray(e.data("cols"),["5-cols","6-cols"])&&(i=!0),o&&0<y(".fl-node-dragging").find(".fl-col-group-nested").length&&(n||s&&0<a.length)&&(i=!0),s&&0<r.length&&0===a.length&&11<r.find("> .fl-col:visible").length&&(i=!0),(i=s&&0<a.length&&3<a.find(".fl-col:visible").length?!0:i)&&t.addClass("fl-sortable-disabled"),i},_blockDragStop:function(e,t){var i=y(window).scrollTop(),t=t.item.parent(),l=null,l=t.hasClass("fl-drop-target")&&t.closest("[data-node]").length?(t=t.closest("[data-node]")).offset().top-i:t.offset().top-i;t.hasClass("fl-builder-blocks-section-content")&&FLBuilder._showPanel(),FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._removeEmptyRowAndColHighlights(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._enableGlobalCols(),FLBuilder._setupEmptyLayout(),y("body").removeClass("fl-builder-dragging"),scrollTo(0,t.offset().top-l),FLBuilder.triggerHook("didStopDrag")},_blockDragCancel:function(){FLBuilder._dragEnabled&&!FLBuilder._dragging&&(FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._removeEmptyRowAndColHighlights(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._setupEmptyLayout(),y("body").removeClass("fl-builder-dragging"),y(".fl-node-drag-init").removeClass("fl-node-drag-init"),y(".fl-node-dragging").removeClass("fl-node-dragging"),scrollTo(0,FLBuilder._dragInitialScrollTop))},_reorderNode:function(e,t){const i=FL.Builder.getActions();i.moveNode(e,t)},_reorderNodeComplete:function(e){var e=FLBuilder._jsonParse(e),t="didMove"+e.nodeType.charAt(0).toUpperCase()+e.nodeType.slice(1);FLBuilder.triggerHook("didMoveNode",e),FLBuilder.triggerHook(t,e)},_moveNode:function(e,t,i){const l=FL.Builder.getActions();l.moveNode(t,i,e)},_moveNodeComplete:function(e){const t=FLBuilder._jsonParse(e);e="didMove"+t.nodeType.charAt(0).toUpperCase()+t.nodeType.slice(1);FLBuilder.triggerHook("didMoveNode",t),FLBuilder.triggerHook(e,t)},_removeAllOverlays:function(){FLBuilder._removeRowOverlays(),FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._removeModuleOverlays(),FLBuilder._hideTipTips(),FLBuilder._closeAllSubmenus()},_appendOverlay:function(e,t){var i=0,l=null,o=e.hasClass("fl-row")?e.find("> .fl-row-content-wrap"):e.find("> .fl-node-content"),n=parseInt(o.css("margin-top"),10),o=parseInt(o.css("margin-bottom"),10);return e.append(t),e.addClass("fl-block-overlay-active"),FLBuilder._initTipTips(),l=e.find("> .fl-block-overlay"),n<0&&(i=parseInt(l.css("top"),10),i=isNaN(i)?0:i,l.css("top",n+i+"px")),o<0&&(i=parseInt(l.css("bottom"),10),i=isNaN(i)?0:i,l.css("bottom",o+i+"px")),l},_buildOverlayOverflowMenu:function(e){var t,i=e.find(".fl-block-overlay-header"),l=e.find(".fl-block-overlay-actions"),e=e.find(".fl-block-has-rules"),o=l.data("original"),n=null,s=0,r=null,a=0,d=[],u=[],c=[],h=wp.template("fl-overlay-overflow-menu");for(null!=o&&(l.after(o),l.remove(),l=o),l.data("original",l.clone()),t=Math.floor(l[0].getBoundingClientRect().width)-8,n=l.find(" > i, > span.fl-builder-has-submenu"),e.length&&t+e.outerWidth()>i.outerWidth()&&(s+=e.outerWidth());a<n.length;a++)r=n.eq(a),t<(s+=Math.floor(r[0].getBoundingClientRect().width))?(u.push(r),r.remove()):d.push(r);if(0<u.length){for(0<d.length&&u.unshift(d.pop().remove()),a=0;a<u.length;a++)u[a].is(".fl-builder-has-submenu")?c.push({type:"submenu",label:u[a].find(".fa, .fas, .far").data("title"),submenu:u[a].find(".fl-builder-submenu")[0].outerHTML}):c.push({type:"action",label:u[a].data("title"),className:u[a].removeClass(function(e,t){return t.replace(/fl-block-([^\s]+)/,"")}).attr("class")});l.append(h(c)),FLBuilder._initTipTips()}},_removeRowOverlays:function(){y(".fl-row").removeClass("fl-block-overlay-active"),y(".fl-row-overlay").remove(),y(".fl-module").removeClass("fl-module-adjust-height"),y("body").removeClass("fl-builder-row-resizing"),FLBuilder._closeAllSubmenus()},_disableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&y(".fl-row.fl-node-global").addClass("fl-node-disabled")},_disableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&y(".fl-row:not(.fl-node-global) .fl-col.fl-node-global").addClass("fl-node-disabled")},_enableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&y(".fl-node-disabled").removeClass("fl-node-disabled")},_enableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&y(".fl-node-disabled").removeClass("fl-node-disabled")},_rowMouseenter:function(){var e=y(this),t=e.attr("data-node"),i=e.offset().top,l=null,o=null,n=wp.template("fl-row-overlay"),s=FLBuilderResponsiveEditing._mode;e.closest(".fl-builder-node-loading").length||e.hasClass("fl-block-overlay-active")||(FLBuilder._removeRowOverlays(),o=FLBuilder._appendOverlay(e,n({node:t,global:e.hasClass("fl-node-global"),hasRules:e.hasClass("fl-node-has-rules"),rulesTextRow:e.attr("data-rules-text"),rulesTypeRow:e.attr("data-rules-type")})),e.find(".fl-node-content:visible").each(function(){var e=y(this).offset().top;l=null===l||e<l?e:l}),null!==l&&l<i&&o.css("top",l-i-30+"px"),("default"===s&&o.offset().top<43||"default"!==s&&0===e.index())&&o.addClass("fl-row-overlay-header-bottom"),e.find(".fl-module").each(function(){var e=y(this);e.outerHeight(!0)<20&&e.addClass("fl-module-adjust-height")}),FLBuilder._buildOverlayOverflowMenu(o))},_rowMouseleave:function(e){var t=y(e.target),e=y(e.toElement)||y(e.relatedTarget),i=e.hasClass("fl-row-overlay"),l=0<e.closest(".fl-row-overlay").length,o=e.is("#tiptip_holder"),e=0<e.closest("#tiptip_holder").length;t.closest(".fl-block-col-resize").length||i||l||o||e||FLBuilder._removeRowOverlays()},_rowDragHelper:function(){return y('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.row+"</div>")},_rowDragInit:function(e){var t=y(e.target),i=y(".fl-row-sortable-proxy-item");t.closest(".fl-row").addClass("fl-node-dragging"),FLBuilder._blockDragInit(e),e.target=i[0],i.trigger(e)},_rowDragInitTouch:function(t){var e=y(t.target),i=y(".fl-row-sortable-proxy-item"),l=e.closest(".fl-row"),o=!1;e.on("touchmove",function(e){o||(t.currentTarget=l[0],FLBuilder._rowDragInit(t),o=!0),i.trigger(e)}),e.on("touchend",function(e){i.trigger(e)})},_rowDragStart:function(e,t){var i=y(FLBuilder._contentClass+" .fl-row"),l=y(".fl-node-dragging");1===i.length&&y(FLBuilder._contentClass).addClass("fl-builder-empty"),l.hide(),FLBuilder._blockDragStart(e,t)},_rowDragStop:function(e,t){var i=t.item,l=i.parent(),o=null,n=0;if(FLBuilder._blockDragStop(e,t),l.hasClass("fl-builder-rows"))i.remove();else if(l.hasClass("fl-row-sortable-proxy"))y(".fl-node-dragging").removeClass("fl-node-dragging").show();else if(i.hasClass("fl-builder-block")){if(l.hasClass("fl-sortable-disabled"))return i.remove(),void FLBuilder._showPanel();l.hasClass("fl-col-content")?FLBuilder._addColGroup(i.closest(".fl-col").attr("data-node"),i.attr("data-cols"),l.find("> .fl-module, .fl-col-group, .fl-builder-block").index(i)):l.hasClass("fl-col-drop-target")?FLBuilder._addCols(l.closest(".fl-col"),l.hasClass("fl-col-drop-target-last")?"after":"before",i.attr("data-cols"),0<l.closest(".fl-col-group-nested").length):l.hasClass("fl-col-group-drop-target")?(e=i.closest(".fl-col-group"),n=i.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(e),FLBuilder._addColGroup(i.closest(".fl-row").attr("data-node"),i.attr("data-cols"),l.hasClass("fl-drop-target-last")?n+1:n)):(n=(o=i.closest(".fl-row")).length?y(FLBuilder._contentClass+" > .fl-row").index(o):0,FLBuilder._addRow(i.attr("data-cols"),l.hasClass("fl-drop-target-last")?n+1:n)),i.remove(),FLBuilder._showPanel(),y(".fl-builder-modules").siblings(".fl-builder-blocks-section-title").eq(0).trigger("click")}else o=y(".fl-node-dragging").removeClass("fl-node-dragging").show(),l.parent().hasClass("fl-builder-content")||(l.hasClass("fl-drop-target-last")?l.parent().after(o):l.parent().before(o),FLBuilder._reorderNode(o.attr("data-node"),o.index())),y(".fl-row-sortable-proxy").append(t.item)},_addRow:function(e,t,i){FLBuilder._showNodeLoadingPlaceholder(y(FLBuilder._contentClass),t),FLBuilder._newRowPosition=t;const l=FL.Builder.data.getLayoutActions();l.addRow(e,t,i)},_addRowComplete:function(e){var e="object"==typeof e?e:FLBuilder._jsonParse(e),t=y(FLBuilder._contentClass),i=y(e.html).data("node");e.nodeParent=t,e.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(e,function(){FLBuilder._removeNodeLoadingPlaceholder(y(".fl-node-"+i)),FLBuilder.triggerHook("didAddRow",i)})},_deleteRowClicked:function(e){var t=y(e.target).closest(".fl-row").data("node");FL.Builder.getActions().deleteNode(t),e.stopPropagation()},_deleteRow:function(e){var t=e.attr("data-node");const i=FL.Builder.data.getLayoutActions();i.deleteNode(t),e.empty(),e.remove(),FLBuilder._setupEmptyLayout(),FLBuilder._removeRowOverlays(),FLBuilder.triggerHook("didDeleteRow",t)},_rowCopyClicked:function(e){var t=y(this).closest(".fl-row").attr("data-node");FLBuilder._copyRow(t),e.stopPropagation()},_copyRow:function(t){var e=FLBuilder._getJQueryElement(t),i=e.clone(),l=y(".fl-builder-settings[data-node]"),o=l.attr("data-node"),n=o===t?e:e.find('[data-node="'+o+'"]'),s=null;l.length&&n.length&&(s=FLBuilder._getSettings(l),FLBuilderSettingsConfig.nodes[o]=s),i.addClass("fl-node-"+t+"-clone fl-builder-node-clone"),i.find(".fl-block-overlay").remove(),e.after(i),FLBuilder._showNodeLoading(t+"-clone");const r=i.get(0),a=(r.scrollIntoView({behavior:"smooth",block:"center"}),FL.Builder.data.getLayoutActions());a.copyRow(t,s,o,function(e){e=FLBuilder._jsonParse(e);e.nodeParent=y(FLBuilder._contentClass),e.nodePosition=y(FLBuilder._contentClass+" > .fl-row").index(i),e.duplicatedRow=t,e.onAddNewHTML=function(){i.remove()},FLBuilder._rowCopyComplete(e)})},_rowCopyComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateRow",{newNodeId:e.nodeId,oldNodeId:e.duplicatedRow})})},_rowSettingsClicked:function(e){var t=y(this),i=y(this).closest(".fl-row").attr("data-node"),l=0<t.closest(".fl-block-overlay-global").length;if(t.hasClass("fl-block-settings")||l&&"row"!=FLBuilderConfig.userTemplateType){const o=FL.Builder.data.getLayoutActions();o.displaySettings(i)}e.stopPropagation()},_showRowSettings:function(e,t){let i=null;t&&"row"!=FLBuilderConfig.userTemplateType?FLBuilderConfig.userCanEditGlobalTemplates&&((i=window.open(y('.fl-row[data-node="'+e+'"]').attr("data-template-url"))).FLBuilderGlobalNodeId=e):FLBuilderSettingsForms.render({id:"row",nodeId:e,className:"fl-builder-row-settings",attrs:'data-node="'+e+'"',buttons:t||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:t?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[e],preview:{type:"row"}},function(){y("#fl-field-width select").on("change",FLBuilder._rowWidthChanged),y("#fl-field-content_width select").on("change",FLBuilder._rowWidthChanged)})},_rowWidthChanged:function(){var e=y("#fl-field-width select").val(),t=y("#fl-field-content_width select").val(),i=y("#fl-field-max_content_width");"fixed"==e||"full"==e&&"fixed"==t?i.show():i.hide()},_resetRowWidthClicked:function(e){var t=y(this).closest(".fl-row"),i=t.attr("data-node"),l=t.find(".fl-row-content"),o=FLBuilderConfig.global.row_width+"px",n=y(".fl-builder-row-settings");t.hasClass("fl-row-fixed-width")&&t.css("max-width",o),l.css("max-width",o),n.length&&n.find("[name=max_content_width]").val("");const s=FL.Builder.data.getLayoutActions();s.resetRowWidth(i),FLBuilder._closeAllSubmenus(),FLBuilder.triggerHook("didResetRowWidth",i),e.stopPropagation()},_highlightEmptyCols:function(){var e="row"==FLBuilderConfig.userTemplateType||"column"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",e=(y(FLBuilder._contentClass+" .fl-row"+e),y(FLBuilder._contentClass+" .fl-col"+e));e.removeClass("fl-col-highlight").find(".fl-col-content").css("height",""),e.each(function(){var e=y(this);0===e.find(".fl-module, .fl-col").length&&e.addClass("fl-col-highlight")})},_highlightRowsAndColsForDrag:function(e){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)";"column"==FLBuilderConfig.userTemplateType&&(t=":not(:first)"),y(FLBuilder._contentClass+" .fl-row").addClass("fl-row-highlight"),e&&e.closest(".fl-row-overlay").length||y(FLBuilder._contentClass+" .fl-col"+t).addClass("fl-col-highlight")},_removeEmptyRowAndColHighlights:function(){y(".fl-row-highlight").removeClass("fl-row-highlight"),y(".fl-col-highlight").removeClass("fl-col-highlight")},_adjustColHeightsForDrag:function(){var e="row"==FLBuilderConfig.userTemplateType?"":".fl-row:not(.fl-node-global) ",t="column"==FLBuilderConfig.userTemplateType?"":".fl-col:not(.fl-node-global) ",i=y(FLBuilder._contentClass),l=i.find(e+".fl-col-group:not(.fl-col-group-nested) > "+t+"> .fl-col-content"),o=i.find(e+".fl-col-group-nested "+t+".fl-col-content"),n=0;for(y(".fl-node-drag-init").hide();n<o.length;n++)FLBuilder._adjustColHeightForDrag(o.eq(n));for(n=0;n<l.length;n++)FLBuilder._adjustColHeightForDrag(l.eq(n));y(".fl-node-drag-init").show()},_adjustColHeightForDrag:function(e){e.find(".fl-module:visible, .fl-col:visible").length&&e.height(e.height()+45)},_showColHighlightGuide:function(){var e=y(this),t=e.find("a"),i=e.closest(".fl-col"),l=i.parents(".fl-col"),o=y('<div class="fl-col-highlight-guide"></div>'),e=e.closest(".fl-block-overlay").offset().top;(i=t.hasClass("fl-block-col-move-parent")||t.hasClass("fl-block-col-edit-parent")?l:i).hasClass("fl-col-highlight")||(i.find("> .fl-col-content").append(o),i.addClass("fl-col-has-highlight-guide"),e<(t=o.offset().top)&&o.css("top",e-t+4+"px"))},_removeColHighlightGuides:function(){y(".fl-col-has-highlight-guide").removeClass("fl-col-has-highlight-guide"),y(".fl-col-highlight-guide").remove()},_colMouseenter:function(e){var t=y(this),i=t.closest(".fl-col-group"),l=(i.attr("data-node"),i.hasClass("fl-col-group-has-child-loading")),o=t.hasClass("fl-node-global"),n=0<t.parents(".fl-node-global").length,s=t.closest(".fl-col-group").find("> .fl-col").length,i=i.find("> .fl-col").index(t),r=0===i,i=s===i+1,a=0<t.find(".fl-col").length,d=0<t.find(".fl-module").length,u=t.parents(".fl-col"),c=u.closest(".fl-col-group"),h=0<u.length,f=void 0!==t.data("template-url"),g="column"==FLBuilderConfig.userTemplateType&&!h;numParentCols=h?c.find("> .fl-col").length:0,parentIndex=c.find("> .fl-col").index(u),parentFirst=h&&0===parentIndex,parentLast=h&&numParentCols===parentIndex+1,row=t.closest(".fl-row"),rowIsFixedWidth=!!row.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,userCanResizeRows=FLBuilderConfig.rowResize.userCanResizeRows,hasRules=t.hasClass("fl-node-has-rules"),template=wp.template("fl-col-overlay"),overlay=null,FLBuilderConfig.simpleUi&&!o||o&&n&&d&&!f||o&&"column"==FLBuilderConfig.userTemplateType&&d||!o&&0<t.find(".fl-module").length||0<t.find(".fl-builder-node-loading-placeholder").length||!d&&a||n&&a&&!f||t.closest(".fl-builder-node-loading").length||(t.hasClass("fl-block-overlay-active")||(FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),overlay=FLBuilder._appendOverlay(t,template({global:o,groupLoading:l,numCols:s,first:r,last:i,isRootCol:g,hasChildCols:a,hasParentCol:h,parentFirst:parentFirst,parentLast:parentLast,numParentCols:numParentCols,rowIsFixedWidth:rowIsFixedWidth,userCanResizeRows:userCanResizeRows,hasRules:hasRules})),FLBuilder._buildOverlayOverflowMenu(overlay),FLBuilder._initColDragResizing()),y("body").addClass("fl-block-overlay-muted"))},_colMouseleave:function(e){var t=y(this),i=y(e.target),e=y(e.toElement)||y(e.relatedTarget),l=0<t.find(".fl-module").length,t=(t.hasClass("fl-node-global"),void 0!==t.data("template-url")),o=e.is("#tiptip_holder"),e=0<e.closest("#tiptip_holder").length;i.closest(".fl-block-col-resize").length||o||e||l&&!t||(FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._closeAllSubmenus())},_removeColOverlays:function(){var e=y(".fl-col");e.removeClass("fl-block-overlay-active"),e.find(".fl-col-overlay").remove(),y("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_colDragHelper:function(){return y('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.column+"</div>")},_colDragInit:function(e){var t=y(e.target),i=y(".fl-col-sortable-proxy-item"),l=t.closest(".fl-col");(l=t.hasClass("fl-block-col-move-parent")?l.parents(".fl-col"):l).addClass("fl-node-dragging"),FLBuilder._blockDragInit(e),FLBuilder._removeColHighlightGuides(),e.target=i[0],i.trigger(e)},_colDragInitTouch:function(t){var e=y(t.target),i=y(".fl-col-sortable-proxy-item"),l=e.closest(".fl-col"),o=(e.closest(".fl-module"),!1);e.on("touchmove",function(e){o||(t.currentTarget=l[0],FLBuilder._colDragInit(t),o=!0),i.trigger(e)}),e.on("touchend",function(e){i.trigger(e)})},_colDragStart:function(e,t){var i=y(".fl-node-dragging");i.hide(),FLBuilder._resetColumnWidths(i.parent()),FLBuilder._blockDragStart(e,t)},_colDragStop:function(e,t){FLBuilder._blockDragStop(e,t);var e=y(".fl-node-dragging").removeClass("fl-node-dragging").show(),i=e.attr("data-node"),l=t.item.parent(),o=e.parent(),n=o.attr("data-node");newGroup=l.closest(".fl-col-group"),newGroupId=newGroup.attr("data-node"),newRow=l.closest(".fl-row"),position=0,l.closest('[data-node="'+i+'"]').length||l.hasClass("fl-sortable-disabled")||l.hasClass("fl-col-sortable-proxy")?FLBuilder._resetColumnWidths(o):l.hasClass("fl-col-content")?(e.remove(),0===o.find(".fl-col").length&&o.remove(),position=l.find("> .fl-module, .fl-col-group, .fl-col-sortable-proxy-item").index(t.item),FLBuilder._addColGroup(l.closest(".fl-col").attr("data-node"),i,position)):l.hasClass("fl-col-drop-target")?(l.hasClass("fl-col-drop-target-last")?l.parent().after(e):l.parent().before(e),FLBuilder._resetColumnWidths(newGroup),FL.Builder.data.getLayoutActions(),n==newGroupId?FL.Builder.getActions().moveNode(i,e.index()):FL.Builder.getActions().moveNode(i,e.index(),newGroupId,[n,newGroupId]),FLBuilder._resizeLayout()):l.hasClass("fl-col-group-drop-target")?(e.remove(),0===o.find(".fl-col").length&&o.remove(),position=newRow.find(".fl-row-content > .fl-col-group").index(newGroup),position=l.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addColGroup(newRow.attr("data-node"),i,position)):l.hasClass("fl-row-drop-target")&&(e.remove(),position=l.closest(".fl-builder-content").find(".fl-row").index(newRow),position=l.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addRow(i,position)),0===o.find(".fl-col").length&&o.remove(),y(".fl-col-sortable-proxy").append(t.item),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._closeAllSubmenus()},_colSettingsClicked:function(e){var t=y(this),i=t.closest(".fl-col"),l=i.attr("data-node"),o=0<t.parent().find("ul.fl-builder-submenu").length,n=0<t.closest(".fl-block-overlay-global").length;t.closest(".fl-block-overlay-global").hasClass("fl-col-overlay"),"column"!=FLBuilderConfig.userTemplateType&&i.attr("data-template-url");if(!FLBuilder._colResizing&&(!n||FLBuilderConfig.userCanEditGlobalTemplates)&&(!o||t.hasClass("fl-col-overlay"))){t.hasClass("fl-block-col-edit-parent")&&(l=i.parents(".fl-col").attr("data-node"));const s=FL.Builder.data.getLayoutActions();s.displaySettings(l),e.stopPropagation()}},_showColSettings:function(t,e,i){if(e&&i&&"row"!==FLBuilderConfig.userTemplateType){if(FLBuilderConfig.userCanEditGlobalTemplates){let e=window.open(y('.fl-col[data-node="'+t+'"]').attr("data-template-url"));e.FLBuilderGlobalNodeId=t}}else FLBuilderSettingsForms.render({id:"col",nodeId:t,className:"fl-builder-col-settings",attrs:'data-node="'+t+'"',buttons:e||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:e?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[t],preview:{type:"col"}},function(){0===y(".fl-col.fl-node-"+t).siblings(".fl-col").length&&y("#fl-field-equal_height, #fl-field-content_alignment").hide()})},_copyColClicked:function(e){var t=y(this).closest(".fl-col").attr("data-node");FLBuilder._copyColumn(t),e.stopPropagation()},_copyColumn:function(t){var e=FLBuilder._getJQueryElement(t),i=e.clone(),l=e.parent(),o=y(".fl-builder-settings[data-node]"),n=o.attr("data-node"),s=n===t?e:e.find('[data-node="'+n+'"]'),r=null;o.length&&s.length&&(r=FLBuilder._getSettings(o),FLBuilderSettingsConfig.nodes[n]=r),i.addClass("fl-node-"+t+"-clone fl-builder-node-clone"),i.find(".fl-block-overlay").remove(),e.after(i),FLBuilder._showNodeLoading(t+"-clone"),FLBuilder._resetColumnWidths(l);const a=FL.Builder.data.getLayoutActions();a.copyColumn(t,r,n,function(e){e=FLBuilder._jsonParse(e);e.nodeParent=l,e.nodePosition=i.index(),e.duplicatedColumn=t,e.onAddNewHTML=function(){i.remove()},FLBuilder._copyColComplete(e)})},_copyColComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder._resetColumnWidths(e.nodeParent),FLBuilder.triggerHook("didDuplicateColumn",{newNodeId:e.nodeId,oldNodeId:e.duplicatedColumn})})},_deleteColClicked:function(e){var t=y(e.target).closest(".fl-col").data("node");FL.Builder.getActions().deleteNode(t),e.stopPropagation(),FLBuilder.triggerHook("col-deleted")},_getColToDelete:function(e){var t=e.closest(".fl-col-group"),i=e.parents(".fl-col"),l=0<i.length,o=i.find("> .fl-col-content > .fl-module, > .fl-col-content > .fl-col-group"),n=e.siblings(".fl-col");return l&&1===o.length&&(0===n.length?e=i:1!==n.length||n.find(".fl-module").length||(e=t)),e},_deleteCol:function(e){var t=e.attr("data-node"),i=e.closest(".fl-row"),l=e.closest(".fl-col-group"),o=0;if(e.remove(),rowCols=i.find(".fl-row-content > .fl-col-group > .fl-col"),groupCols=l.find(" > .fl-col"),0===rowCols.length&&"row"!=FLBuilderConfig.userTemplateType&&"column"!=FLBuilderConfig.userTemplateType)FLBuilder._deleteRow(i);else{0===groupCols.length?l.remove():(o=6===groupCols.length?16.65:7===groupCols.length?14.28:Math.round(100/groupCols.length*100)/100,groupCols.css("width",o+"%"),FLBuilder.triggerHook("didResetColumnWidths",{cols:groupCols}));const n=FL.Builder.data.getLayoutActions();n.deleteColumn(t,o),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder.triggerHook("didDeleteColumn",t)}},_addCols:function(e,t,i,l,o){var n=e.closest(".fl-col-group"),s=n.find(".fl-col").index(e),e=e.attr("data-node");i=void 0===i?"1-col":i,l=(l=void 0!==l&&l)?1:0,"after"==t&&s++,FLBuilder._showNodeLoadingPlaceholder(n,s),FLBuilder._removeAllOverlays();const r=FL.Builder.data.getLayoutActions();r.addColumns(e,t,i,l,o)},_addColsComplete:function(e){var t="object"==typeof e?e:FLBuilder._jsonParse(e);t.nodeParent=FLBuilder._newColParent,t.nodePosition=FLBuilder._newColPosition,FLBuilder._renderLayout(t,function(){FLBuilder._removeNodeLoadingPlaceholder(y(".fl-node-"+t.nodeId)),FLBuilder.triggerHook("didAddColumn",t.nodeId),FLBuilder.triggerHook("didResetColumnWidths",{cols:y(".fl-node-"+t.nodeId).find("> .fl-col")})})},_addColGroup:function(e,t,i,l){var o=y(".fl-node-"+e);FLBuilder._newColGroupPosition=i,o.hasClass("fl-col")?FLBuilder._newColGroupParent=o.find(" > .fl-col-content"):FLBuilder._newColGroupParent=o.find(".fl-row-content"),FLBuilder._showNodeLoadingPlaceholder(FLBuilder._newColGroupParent,i);const n=FL.Builder.data.getLayoutActions();n.addColumnGroup(e,t,i,l)},_addColGroupComplete:function(e){var t=FLBuilder._jsonParse(e),e=y(t.html),i=e.data("node");e.find(".fl-col").data("node");t.nodeParent=FLBuilder._newColGroupParent,t.nodePosition=FLBuilder._newColGroupPosition,FLBuilder._renderLayout(t,function(){t.nodeParent.hasClass("fl-col-content")&&t.nodeParent.parents(".fl-col").addClass("fl-col-has-cols"),FLBuilder._removeNodeLoadingPlaceholder(y(".fl-node-"+i)),FLBuilder.triggerHook("didAddColumnGroup",i)})},_initColDragResizing:function(){y(".fl-block-col-resize").not(".fl-block-row-resize").draggable({axis:"x",start:FLBuilder._colDragResizeStart,drag:FLBuilder._colDragResize,stop:FLBuilder._colDragResizeStop})},_colDragResizeStart:function(e,t){for(var i=y(t.helper),l="",o=i.hasClass("fl-block-col-resize-parent"),n=o?i.closest(".fl-col").parents(".fl-col"):null,s=o?n.parents(".fl-col-group"):i.closest(".fl-col-group"),r=s.find("> .fl-col"),a=o?n:i.closest(".fl-col"),o=a.attr("data-node"),n=y("[data-node="+o+"] #fl-field-size input"),d=null,u=100,c=0,o=null,h=null,f=(d=i.hasClass("fl-block-col-resize-e")?(l="e",a.nextAll(".fl-col").first()):(l="w",a.prevAll(".fl-col").first())).attr("data-node"),f=y("[data-node="+f+"] #fl-field-size input");c<r.length;c++)r.eq(c).data("node")!=a.data("node")&&r.eq(c).data("node")!=d.data("node")&&(u-=parseFloat(r.eq(c)[0].style.width));n.length?(o=n,h="col"):f.length&&(o=f,h="sibling"),FLBuilder._colResizeData={handle:i,feedbackLeft:i.find(".fl-block-col-resize-feedback-left"),feedbackRight:i.find(".fl-block-col-resize-feedback-right"),direction:l,groupWidth:s.outerWidth(),col:a,id:a.attr("data-node"),colWidth:parseFloat(a[0].style.width)/100,sibling:d,siblingId:d.attr("data-node"),offset:t.position.left,availWidth:u,setting:o,settingType:h,layoutActions:FL.Builder.data.getLayoutActions()},FLBuilder._colResizing=!0,y("body").addClass("fl-builder-col-resizing"),FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents(),FLBuilder.triggerHook("col-resize-start")},_colDragResize:function(e,t){var i=FLBuilder._colResizeData,l=FLBuilderConfig.isRtl?"w":"e",o=i.handle.closest(".fl-block-overlay"),t=(i.offset-t.position.left)/i.groupWidth,t=l==i.direction?100*(i.colWidth-t):100*(i.colWidth+t),n=Math.round(100*t)/100,t=i.availWidth-t,s=Math.round(100*t)/100,t=Math.round(100*(i.availWidth-8))/100;n<8?(n=8,s=t):s<8&&(n=t,s=8),requestAnimationFrame(()=>{l==i.direction?(i.feedbackLeft.html(n.toFixed(1)+"%").show(),i.feedbackRight.html(s.toFixed(1)+"%").show()):(i.feedbackLeft.html(s.toFixed(1)+"%").show(),i.feedbackRight.html(n.toFixed(1)+"%").show()),i.col.css("width",n+"%"),i.sibling.css("width",s+"%"),i.setting&&("col"===i.settingType?i.setting.val(parseFloat(i.col[0].style.width)):"sibling"===i.settingType&&i.setting.val(parseFloat(i.sibling[0].style.width))),i.layoutActions.resizeColumn(i.id,n,i.siblingId,s,!1)}),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder.triggerHook("col-resize-drag")},_colDragResizeStop:function(e,t){var i=FLBuilder._colResizeData,l=FLBuilder._colResizeData.handle.closest(".fl-block-overlay"),o=i.id,n=parseFloat(i.col[0].style.width),s=i.sibling.data("node"),i=parseFloat(i.sibling[0].style.width);FLBuilder._colResizeData.feedbackLeft.hide(),FLBuilder._colResizeData.feedbackRight.hide();const r=FL.Builder.data.getLayoutActions();r.resizeColumn(o,n,s,i),FLBuilder._buildOverlayOverflowMenu(l),FLBuilder._colResizeData=null,y("body").removeClass("fl-builder-col-resizing"),FLBuilder._bindOverlayEvents(),setTimeout(function(){FLBuilder._colResizing=!1},50),FLBuilder.triggerHook("col-resize-stop"),FLBuilder.triggerHook("didResizeColumn",{colId:o,colWidth:n,siblingId:s,siblingWidth:i})},_resetColumnWidthsClicked:function(e){var t=y(this),i=!!t.closest(".fl-row-overlay").length,l=null,o=[],n=null,s=0,r=y(".fl-builder-col-settings");(i?t.closest(".fl-row").find(".fl-row-content > .fl-col-group"):t.parents(".fl-col-group").last()).each(function(){for(l=y(this),n=l.find(".fl-col-group"),o.push(l.data("node")),FLBuilder._resetColumnWidths(l),s=0;s<n.length;s++)FLBuilder._resetColumnWidths(n.eq(s)),o.push(n.eq(s).data("node"))}),r.length&&(i=y(".fl-node-"+r.attr("data-node")),r.find("#fl-field-size input").val(parseFloat(i[0].style.width)));const a=FL.Builder.data.getLayoutActions();a.resetColWidths(o),FLBuilder.triggerHook("col-reset-widths"),FLBuilder._closeAllSubmenus(),e.stopPropagation()},_resetColumnWidths:function(e){var e=(e instanceof jQuery?e:y(e)).find(" > .fl-col:visible"),t=0,t=6===e.length?16.65:7===e.length?14.28:Math.round(100/e.length*100)/100;e.css("width",t+"%"),FLBuilder.triggerHook("didResetColumnWidths",{cols:e})},_moduleMouseenter:function(e){var t=y(this),i=(t.attr("data-node"),t.attr("data-name")),l=t.hasClass("fl-node-global"),o=0<t.parents(".fl-node-global").length,n=t.parents(".fl-col-group").last().hasClass("fl-col-group-has-child-loading"),s=t.closest(".fl-col-group").find("> .fl-col").length,r=t.closest(".fl-col"),a=0===r.index(),d=s===r.index()+1,u=r.parents(".fl-col"),c=0<u.length,h=c?u.closest(".fl-col-group").find("> .fl-col").length:0,f=c&&0===u.index(),u=c&&h===u.index()+1,g="column"==FLBuilderConfig.userTemplateType&&!c,p=t.closest(".fl-row"),m=p.hasClass("fl-node-global"),p=!!p.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,b=FLBuilderConfig.rowResize.userCanResizeRows,v=t.hasClass("fl-node-has-rules"),_=t.attr("data-rules-text"),L=t.attr("data-rules-type"),F=r.attr("data-rules-text"),w=r.attr("data-rules-type"),r=r.hasClass("fl-node-has-rules"),C=wp.template("fl-module-overlay");l&&o&&"row"!=FLBuilderConfig.userTemplateType&&m||l&&o&&"column"!=FLBuilderConfig.userTemplateType&&!m||t.closest(".fl-builder-node-loading").length||t.find(".fl-inline-editor:visible").length||(t.hasClass("fl-block-overlay-active")||(FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),o=FLBuilder._appendOverlay(t,C({global:l,moduleName:i,groupLoading:n,numCols:s,colFirst:a,colLast:d,isRootCol:g,hasParentCol:c,numParentCols:h,parentFirst:f,parentLast:u,rowIsFixedWidth:p,userCanResizeRows:b,hasRules:v,rulesTextModule:_,rulesTypeModule:L,rulesTextCol:F,rulesTypeCol:w,colHasRules:r})),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder._initColDragResizing()),y("body").addClass("fl-block-overlay-muted"))},_moduleMouseleave:function(e){y(this);var t=y(e.target),e=y(e.toElement)||y(e.relatedTarget),i=e.is("#tiptip_holder"),e=0<e.closest("#tiptip_holder").length;t.closest(".fl-block-col-resize").length||i||e||(FLBuilder._removeModuleOverlays(),FLBuilder._removeColHighlightGuides())},_removeModuleOverlays:function(){var e=y(".fl-module");e.removeClass("fl-block-overlay-active"),e.find(".fl-module-overlay").remove(),y("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_moduleDragHelper:function(e,t){return y('<div class="fl-builder-block-drag-helper">'+t.attr("data-name")+"</div>")},_moduleDragInit:function(e){var t=y(e.target).closest(".fl-module");FLBuilder._blockDragInit(e),t.append('<div class="fl-module-sortable-proxy"></div>'),e.target=t.find(".fl-module-sortable-proxy")[0],t.trigger(e)},_moduleDragInitTouch:function(t){var e=y(t.target),i=e.closest(".fl-module"),l=!1;e.on("touchmove",function(e){l||(t.currentTarget=i[0],FLBuilder._moduleDragInit(t),l=!0),e.target=i.find(".fl-module-sortable-proxy")[0],y(e.target).trigger(e)}),e.on("touchend",function(e){e.target=i.find(".fl-module-sortable-proxy")[0],y(e.target).trigger(e),e.stopPropagation(),i.find(".fl-module-sortable-proxy").remove()})},_moduleDragStart:function(e,t){y(t.item).data("original-position",t.item.index()),FLBuilder._removeRowOverlays(),FLBuilder._blockDragStart(e,t)},_moduleDragStop:function(e,t){FLBuilder._blockDragStop(e,t);var i=t.item,l=i.parent(),o=null,n=0,s=0;if(y(".fl-module-sortable-proxy").remove(),l.hasClass("fl-builder-modules")||l.hasClass("fl-builder-widgets"))i.remove();else{if(i.hasClass("fl-builder-block")){if(l.hasClass("fl-sortable-disabled"))return i.remove(),void FLBuilder._showPanel();l.hasClass("fl-row-drop-target")?(l=i.closest(".fl-builder-content"),s=0,o=i.closest(".fl-row"),n=l.find(".fl-row").index(o)):l.hasClass("fl-col-group-drop-target")?(s=(l=i.closest(".fl-row-content")).closest(".fl-row").attr("data-node"),o=i.closest(".fl-col-group"),n=l.find(" > .fl-col-group").index(o)):l.hasClass("fl-col-drop-target")?(s=(l=i.closest(".fl-col-group")).attr("data-node"),o=i.closest(".fl-col"),n=l.find(" > .fl-col").index(o)):(n=l.find("> .fl-module, .fl-col-group, .fl-builder-block").index(i),s=i.closest(".fl-col").attr("data-node")),i.closest(".fl-drop-target-last").length&&(n+=1),FLBuilder._addModule(l,s,i.attr("data-type"),n,i.attr("data-widget"),i.attr("data-alias")),i.remove()}else{if(l.hasClass("fl-sortable-disabled"))return y(e.target).append(t.item),y(e.target).children().eq(t.item.data("original-position")).before(t.item),void FLBuilder._highlightEmptyCols();l.hasClass("fl-row-drop-target")?(o=i.closest(".fl-row"),n=i.closest(".fl-builder-content").children(".fl-row").index(o),n=i.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addRow("1-col",n,i.attr("data-node")),i.remove()):l.hasClass("fl-col-group-drop-target")?(o=i.closest(".fl-col-group"),n=i.closest(".fl-row-content ").find(" > .fl-col-group").index(o),n=i.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addColGroup(i.closest(".fl-row").attr("data-node"),"1-col",n,i.attr("data-node")),i.remove()):l.hasClass("fl-col-drop-target")?(o=i.closest(".fl-col"),n=i.closest(".fl-col-drop-target-last").length?"after":"before",FLBuilder._addCols(o,n,"1-col",0<i.closest(".fl-col-group-nested").length,i.attr("data-node")),i.remove()):FLBuilder._reorderModule(i)}FLBuilder._resizeLayout()}},_reorderModule:function(e){var t=e.closest(".fl-col").attr("data-node"),i=e.attr("data-parent"),l=e.attr("data-node"),o=e.index();t==i?FLBuilder._reorderNode(l,o):(e.attr("data-parent",t),FLBuilder._moveNode(t,l,o))},_deleteModuleClicked:function(e){var t=y(e.target).closest(".fl-module").data("node");FL.Builder.getActions().deleteNode(t),e.stopPropagation()},_getJQueryElement:function(e){return y(FLBuilder._contentClass).find('[data-node="'+e+'"]')},_needsDeleteConfirmation:function(e){if("module"===e.type)return!0;const t=FLBuilder._getJQueryElement(e.node);return 0<t.find(".fl-module").length},_deleteModule:function(e){var t=e.closest(".fl-row"),i=e.attr("data-node");const l=FL.Builder.data.getLayoutActions();l.deleteNode(i),e.empty(),e.remove(),t.removeClass("fl-block-overlay-muted"),FLBuilder._highlightEmptyCols(),FLBuilder._removeAllOverlays(),FLBuilder.triggerHook("didDeleteModule",{nodeId:i,moduleType:e.attr("data-type")})},_moduleCopyClicked:function(e){var t=y(this).closest(".fl-module").data("node");const i=FL.Builder.getActions();i.copyNode(t),e.stopPropagation()},_copyModule:function(t){var e=FLBuilder._getJQueryElement(t),i=e.clone(),l=e.parent(),o=y(".fl-builder-module-settings[data-node="+t+"]"),n={};o.length&&(n=FLBuilder._getSettings(o),FLBuilderSettingsConfig.nodes[t]=n),i.addClass("fl-node-"+t+"-clone fl-builder-node-clone"),i.find(".fl-block-overlay").remove(),e.after(i),FLBuilder._showNodeLoading(t+"-clone");const s=i.get(0),r=(s.scrollIntoView({behavior:"smooth",block:"center"}),FL.Builder.data.getLayoutActions());r.copyModule(t,n,function(e){e=FLBuilder._jsonParse(e);e.nodeParent=l,e.nodePosition=l.find(" > .fl-col-group, > .fl-module").index(i),e.duplicatedModule=t,e.onAddNewHTML=function(){i.remove()},FLBuilder._moduleCopyComplete(e)})},_moduleCopyComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateModule",{newNodeId:e.nodeId,oldNodeId:e.duplicatedModule,moduleType:e.moduleType})})},_moduleSettingsClicked:function(e){var t=y(this),i=(t.closest(".fl-module").attr("data-type"),t.closest(".fl-module").attr("data-node")),t=(t.closest(".fl-col").attr("data-node"),0<t.closest(".fl-block-overlay-global").length);if(e.stopPropagation(),!FLBuilder._colResizing&&(!t||FLBuilderConfig.userCanEditGlobalTemplates)){const l=FL.Builder.getActions();l.openSettings(i)}},_showModuleSettings:function(e,t){var i,l,o;FLBuilderSettingsConfig.modules&&(i=FLBuilderSettingsConfig.modules[e.type],l=e.settings||FLBuilderSettingsConfig.nodes[e.nodeId],o=y("head"),-1===y.inArray(e.type,FLBuilder._loadedModuleAssets)&&(""!==i.assets.css&&o.append(i.assets.css),""!==i.assets.js&&o.append(i.assets.js),FLBuilder._loadedModuleAssets.push(e.type)),FLBuilderSettingsForms.render({type:"module",id:e.type,nodeId:e.nodeId,className:"fl-builder-module-settings fl-builder-"+e.type+"-settings",attrs:'data-node="'+e.nodeId+'" data-parent="'+e.parentId+'" data-type="'+e.type+'"',buttons:e.global||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:e.global?[FLBuilderStrings.global]:[],settings:l,legacy:e.legacy,helper:FLBuilder._moduleHelpers[e.type],rules:FLBuilder._moduleHelpers[e.type]?FLBuilder._moduleHelpers[e.type].rules:null,messages:FLBuilder._moduleHelpers[e.type]?FLBuilder._moduleHelpers[e.type].messages:null,hide:!(FLBuilderConfig.userCanEditGlobalTemplates||!e.global),preview:{type:"module",layout:e.layout,callback:function(){FLBuilder.triggerHook("didAddModule",{nodeId:e.nodeId,moduleType:l.type})}}},t))},_saveModuleClicked:function(){var e=y(this).closest(".fl-builder-settings"),t=e.attr("data-type"),t=(e.attr("data-node"),FLBuilder._moduleHelpers[t]),i=!0;void 0!==t&&(e.find("label.error").remove(),e.validate().hideErrors(),i=(i=e.validate().form())&&t.submit()),i?FLBuilder._saveSettings():FLBuilder._toggleSettingsTabErrors()},_addModule:function(e,t,i,l,o,n){FLBuilder._showNodeLoadingPlaceholder(e,l),e.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=e,FLBuilder._newModulePosition=l);const s=FL.Builder.data.getLayoutActions();s.addModule(i,t,l,{widget:void 0===o?"":o,alias:void 0===n?"":n,nodePreview:1})},_addModuleComplete:function(e){e=FLBuilder._jsonParse(e);e.layout&&(FLBuilder._newModuleParent&&FLBuilder._newModuleParent.find(".fl-builder-node-loading-placeholder").hide(),e.layout.nodeParent=FLBuilder._newModuleParent,e.layout.nodePosition=FLBuilder._newModulePosition),e.settings||(e.settings=FLBuilderSettingsConfig.defaults.modules[e.type]),y("form.fl-builder-settings").length||e.global?e.layout&&FLBuilder._renderLayout(e.layout):FLBuilder._showModuleSettings(e,function(){y(".fl-builder-module-settings").data("new-module","1")})},registerModuleHelper:function(e,t){FLBuilder._moduleHelpers[e]=y.extend({},{rules:{},init:function(){},submit:function(){return!0},preview:function(){}},t)},_registerModuleHelper:function(e,t){FLBuilder.registerModuleHelper(e,t)},_showNodeTemplateSettings:function(e){var t=y(".fl-builder-settings-lightbox .fl-builder-settings"),i=t.attr("data-node"),l=FLBuilderStrings.saveModule;if(t.hasClass("fl-builder-row-settings")?l=FLBuilderStrings.saveRow:t.hasClass("fl-builder-col-settings")&&(l=FLBuilderStrings.saveColumn),!FLBuilder._triggerSettingsSave(!1,!1,!1))return!1;FLBuilderSettingsForms.render({id:"node_template",nodeId:i,title:l,attrs:'data-node="'+i+'"',className:"fl-builder-node-template-settings",rules:{name:{required:!0}}},function(){FLBuilderConfig.userCanEditGlobalTemplates||y("#fl-field-global").hide()})},_saveNodeTemplate:function(){var e=y(".fl-builder-node-template-settings"),t=e.attr("data-node");if(e.validate().form()){FLBuilder._showNodeLoading(t);const i=FL.Builder.data.getLayoutActions();i.saveNodeTemplate(t,FLBuilder._getSettings(e)),FLBuilder._lightbox.close()}},_saveNodeTemplateComplete:function(e){var t,i=FLBuilder._jsonParse(e),l=y(".fl-builder-saved-"+i.type+"s"),o=l.find(".fl-builder-block"),n=null,s=i.name.toLowerCase(),r=0,a=wp.template("fl-node-template-block"),e={name:i.name,isGlobal:i.global,content:i.type,id:i.id,postID:i.postID,kind:"template",type:"user",link:i.link,category:{uncategorized:FLBuilderStrings.uncategorized}};if(FLBuilderConfig.contentItems.template.push(e),FLBuilder.triggerHook("contentItemsChanged"),i.layout&&(FLBuilder._renderLayout(i.layout),FLBuilder.triggerHook("didSaveGlobalNodeTemplate",i.config)),0===o.length)l.append(a(i));else for(;r<o.length;r++){if(t=(n=o.eq(r)).text().toLowerCase().trim(),0===r&&s<t){l.prepend(a(i));break}if(s<t){n.before(a(i));break}if(o.length-1===r){l.append(a(i));break}}l.find(".fl-builder-block-no-node-templates").remove()},_nodeTemplateDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var t=i.item,i=t.parent(),l=null,o=0,n=null,s="",r=null;if(i.hasClass("fl-builder-blocks-section-content"))t.remove();else{if(t.hasClass("fl-builder-block-saved-row")||t.hasClass("fl-builder-block-row-template"))o=(n=t.closest(".fl-row")).length?y(FLBuilder._contentClass+" .fl-row").index(n):0,o=i.hasClass("fl-drop-target-last")?o+1:o,l=null,s="render_new_row_template",r=FLBuilder._addRowComplete,FLBuilder._newRowPosition=o,FLBuilder._showNodeLoadingPlaceholder(y(FLBuilder._contentClass),o);else if(t.hasClass("fl-builder-block-saved-column")){if(n=t.closest(".fl-col"),colGroup=i.closest(".fl-col-group"),colGroupId=colGroup.attr("data-node"),s="render_new_col_template",r=FLBuilder._addColsComplete,i.hasClass("fl-sortable-disabled"))return t.remove(),void FLBuilder._showPanel();i.hasClass("fl-row-drop-target")?(n=t.closest(".fl-row"),l=0,i=y(FLBuilder._contentClass),o=n.length?i.find(".fl-row").index(n):0):i.hasClass("fl-col-group-drop-target")?(i=t.closest(".fl-row-content"),l=t.closest(".fl-row").attr("data-node"),o=t.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(t.closest(".fl-col-group"))):i.hasClass("fl-col-drop-target")&&(o=(i=t.closest(".fl-col-group")).children(".fl-col").index(t.closest(".fl-col")),l=i.attr("data-node")),t.closest(".fl-drop-target-last").length&&(o+=1),i.hasClass("fl-col-group")?FLBuilder._newColParent=null:FLBuilder._newColParent=i,FLBuilder._newColPosition=o,FLBuilder._showNodeLoadingPlaceholder(i,o)}else if(t.hasClass("fl-builder-block-saved-module")||t.hasClass("fl-builder-block-module-template")){if(s="render_new_module",r=FLBuilder._addModuleComplete,i.hasClass("fl-sortable-disabled"))return t.remove(),void FLBuilder._showPanel();i.hasClass("fl-row-drop-target")?(l=0,o=(i=t.closest(".fl-builder-content")).find(".fl-row").index(t.closest(".fl-row"))):i.hasClass("fl-col-group-drop-target")?(l=(i=t.closest(".fl-row-content")).closest(".fl-row").attr("data-node"),o=i.find(" > .fl-col-group").index(t.closest(".fl-col-group"))):l=i.hasClass("fl-col-drop-target")?(o=(i=t.closest(".fl-col-group")).children(".fl-col").index(t.closest(".fl-col")),i.attr("data-node")):(o=i.children(".fl-module, .fl-builder-block").index(t),t.closest(".fl-col").attr("data-node")),t.closest(".fl-drop-target-last").length&&(o+=1),i.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=i,FLBuilder._newModulePosition=o),FLBuilder._showNodeLoadingPlaceholder(i,o)}n=t.attr("data-id"),i=t.attr("data-type");let e="render_new_row_template"===s?"row":"render_new_col_template"===s?"column":"module";const a=FL.Builder.data.getLayoutActions();a.addNodeTemplate(e,n,i,l,o,function(e){var t;-1<s.indexOf("row")?(t=FLBuilder._jsonParse(e),FLBuilder.triggerHook("didApplyRowTemplateComplete",t.config),r(t.layout)):-1<s.indexOf("col")?(t=FLBuilder._jsonParse(e),FLBuilder.triggerHook("didApplyColTemplateComplete",t.config),r(t.layout)):r(e)}),t.remove()}},_editNodeTemplateClicked:function(e){e.preventDefault(),e.stopPropagation(),window.open(y(this).attr("href"))},_deleteNodeTemplateClicked:function(e){var e=y(e.target),t=e.closest(".fl-builder-blocks-section").find(".fl-builder-blocks-section-content"),i=t.find(".fl-builder-block"),e=e.closest(".fl-builder-block"),l=e.hasClass("fl-builder-block-global"),o=l?FLBuilderStrings.deleteGlobalTemplate:FLBuilderStrings.deleteTemplate,n=e.attr("data-id");if(confirm(o)){e.remove(),1===i.length&&(e.hasClass("fl-builder-block-saved-row")?t.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedRows+"</span>"):t.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedModules+"</span>")),e.hasClass("fl-builder-block-global")&&FLBuilder.showAjaxLoader();const s=FL.Builder.data.getLayoutActions();s.deleteNodeTemplate(n,l),o=_.findIndex(FLBuilderConfig.contentItems.template,{id:e.attr("data-id"),type:"user"}),FLBuilderConfig.contentItems.template.splice(o,1),FLBuilder.triggerHook("contentItemsChanged")}},_initSettingsForms:function(){FLBuilder._initSettingsSections(),FLBuilder._initButtonGroupFields(),FLBuilder._initCompoundFields(),FLBuilder._CodeFieldSSLCheck(),FLBuilder._initCodeFields(),FLBuilder._initColorPickers(),FLBuilder._initGradientPickers(),FLBuilder._initIconFields(),FLBuilder._initPhotoFields(),FLBuilder._initSelectFields(),FLBuilder._initEditorFields(),FLBuilder._initMultipleFields(),FLBuilder._initAutoSuggestFields(),FLBuilder._initLinkFields(),FLBuilder._initFontFields(),FLBuilder._initOrderingFields(),FLBuilder._initTimezoneFields(),FLBuilder._initDimensionFields(),FLBuilder._initFieldPopupSliders(),FLBuilder._initPresetFields(),FLBuilder._focusFirstSettingsControl(),FLBuilder._calculateSettingsTabsOverflow(),FLBuilder._lightbox._resizeEditors(),y(".fl-builder-settings-fields").css("visibility","visible"),y(".fl-builder-settings button").on("click",function(e){e.preventDefault()}),FLBuilder.triggerHook("settings-form-init")},_destroySettingsForms:function(){FLBuilder._destroyEditorFields()},_setSettingsFormContent:function(e){y(".fl-legacy-settings").remove(),y("body").append(e)},_settingsTabClicked:function(e){var t=y(this),i=t.closest(".fl-builder-settings"),t=t.attr("href").split("#").pop();FLBuilder._resetSettingsTabsState(),i.find(".fl-builder-settings-tab").removeClass("fl-active"),i.find("#"+t).addClass("fl-active"),i.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),i.find("a[href*="+t+"]").addClass("fl-active"),FLBuilderConfig.rememberTab?localStorage.setItem("fl-builder-settings-tab",t):localStorage.setItem("fl-builder-settings-tab",""),FLBuilder._focusFirstSettingsControl(),e.preventDefault()},_resetSettingsTabsState:function(){var e=y(".fl-lightbox:visible");FLBuilder._hideTabsOverflowMenu(),e.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),e.find(".fl-builder-settings-tabs-overflow-menu .fl-active").removeClass("fl-active"),e.find(".fl-contains-active").removeClass("fl-contains-active")},_calculateSettingsTabsOverflow:function(){var e=y(".fl-lightbox:visible"),t=e.outerWidth(),i=e.hasClass("fl-lightbox-width-slim"),l=e.find(".fl-builder-settings-tabs"),o=e.find(".fl-builder-settings-tabs-overflow-menu"),n=e.find(".fl-builder-settings-tabs-more"),l=l.find("a"),s=!1,r=t-60,a=0,d=i?16:30;o.html(""),FLBuilder._hideTabsOverflowMenu(),l.removeClass("fl-overflowed"),l.each(function(){if(!y(this).is(":visible"))return!0;var e,t,i;s||(e=y(this).textWidth()+d+12,r<=(a+=e)&&(s=!0)),s?(e=y(this).html(),i=y(this).attr("href"),t="",y(this).hasClass("fl-active")&&(t="fl-active"),y(this).hasClass("error")&&(t+=" error"),i=y('<a href="'+i+'" '+(t=""!==t?'class="'+t+'"':t)+">"+e+"</a>"),o.append(i),y(this).addClass("fl-overflowed")):y(this).removeClass("fl-overflowed")}),s?e.addClass("fl-lightbox-has-tab-overflow"):e.removeClass("fl-lightbox-has-tab-overflow"),0<o.find(".fl-active").length?n.addClass("fl-contains-active"):n.removeClass("fl-contains-active"),0<o.find(".error").length?n.addClass("fl-contains-errors"):n.removeClass("fl-contains-errors")},_settingsTabsToOverflowMenuItemClicked:function(e){var t=y(e.currentTarget),i=t.attr("href"),l=t.closest(".fl-lightbox-header-wrap").find(".fl-builder-settings-tabs"),i=l.find('a[href="'+i+'"]'),l=l.find(".fl-builder-settings-tabs-more");FLBuilder._resetSettingsTabsState(),i.trigger("click"),t.addClass("fl-active"),l.addClass("fl-contains-active"),FLBuilder._hideTabsOverflowMenu(),e.preventDefault()},_hasOverflowTabs:function(){return 0<y(".fl-lightbox:visible").find(".fl-builder-settings-tabs-overflow-menu a").length},_showTabsOverflowMenu:function(){var e;FLBuilder._hasOverflowTabs()&&((e=y(".fl-lightbox:visible")).find(".fl-builder-settings-tabs-overflow-menu").css("display","flex"),e.find(".fl-builder-settings-tabs-overflow-click-mask").show(),this.isShowingSettingsTabsOverflowMenu=!0)},_hideTabsOverflowMenu:function(){var e=y(".fl-lightbox:visible");e.find(".fl-builder-settings-tabs-overflow-menu").css("display","none"),e.find(".fl-builder-settings-tabs-overflow-click-mask").hide(),this.isShowingSettingsTabsOverflowMenu=!1},_toggleTabsOverflowMenu:function(e){FLBuilder.isShowingSettingsTabsOverflowMenu?FLBuilder._hideTabsOverflowMenu():FLBuilder._showTabsOverflowMenu(),e.stopPropagation()},_initSettingsSections:function(){y(".fl-builder-settings:visible").find(".fl-builder-settings-section").each(FLBuilder._initSection)},_settingsCancelClicked:function(e){var t=y(".fl-builder-lightbox[data-parent]"),i=y(".fl-builder-module-settings"),l=null,o=null,n=null,s="column"==FLBuilderConfig.userTemplateType;if(0<t.length)FLBuilder._closeNestedSettings();else{0<i.length&&void 0!==i.data("new-module")?(l=y(FLBuilder.preview.state.html),n=(o=y(".fl-node-"+i.data("node"))).closest(".fl-col"),0<l.find(".fl-node-"+n.data("node")).length||s?FLBuilder._deleteModule(o):FLBuilder._deleteCol(n)):FLBuilder.preview&&FLBuilder.preview.revert();const r=FL.Builder.data.getLayoutActions();r.cancelDisplaySettings(),FLBuilder.preview=null,FLLightbox.closeParent(this),FLBuilder.triggerHook("didCancelNodeSettings")}},_focusFirstSettingsControl:function(){var e=y(".fl-builder-settings:visible"),t=e.find(".fl-builder-settings-tab.fl-active"),e=e.data("node"),i=t.find(".fl-field").first(),l=i.find('input:not([type="hidden"]), textarea, select, button, a, .fl-editor-field').first();e&&y(".fl-node-"+e+" .fl-inline-editor").length||("undefined"!=typeof tinyMCE&&l.hasClass("fl-editor-field")?(t=l.find("textarea.wp-editor-area").attr("id"),tinyMCE.get(t).focus()):setTimeout(function(){l.focus().css("animation-name","fl-grab-attention")},300),i.css("animation-name","fl-grab-attention"),i.on("animationend",function(){i.css("animation-name","")}))},_initSettingsValidation:function(e,t){y(".fl-builder-settings").last().validate({ignore:".fl-ignore-validation",rules:e,messages:t=t||{},errorPlacement:FLBuilder._settingsErrorPlacement})},_settingsErrorPlacement:function(e,t){e.appendTo(t.parent())},_toggleSettingsTabErrors:function(){for(var e,t=y(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab"),l=null,o=0;o<i.length;o++)e=(l=i.eq(o)).find("label.error"),(tabLink=t.find(".fl-builder-settings-tabs a[href*="+l.attr("id")+"]")).find(".fl-error-icon").remove(),tabLink.removeClass("error"),0<e.length&&(tabLink.append('<span class="fl-error-icon"></span>'),tabLink.addClass("error"));FLBuilder._calculateSettingsTabsOverflow()},_getSettings:function(e){FLBuilder._updateEditorFields();for(var t,i,l=e.serializeArray(),o=0,n=0,s="",r=[],a=[],d={},o=0;o<l.length;o++)if(t=l[o].value.replace(/\r/gm,"").replace(/'/g,"'"),!(-1<l[o].name.indexOf("flrich")))if(-1<l[o].name.indexOf("[")){for(i=l[o].name.replace(/\[(.*)\]/,""),r=[],a=(s=l[o].name.replace(i,"")).match(/\[[^\]]*\]/g),n=0;n<a.length;n++)"[]"!=a[n]&&r.push(a[n].replace(/\[|\]/g,""));s.match(/\[\]\[[^\]]*\]\[[^\]]+\]/)||s.match(/\[\]\[[^\]]*\]\[\]\[[^\]]+\]/)?(void 0===d[i]&&(d[i]={}),void 0===d[i][r[0]]&&(d[i][r[0]]={}),d[i][r[0]][r[1]]=t):s.match(/\[\]\[[^\]]*\]\[\]/)?(void 0===d[i]&&(d[i]={}),void 0===d[i][r[0]]&&(d[i][r[0]]=[]),d[i][r[0]].push(t)):s.match(/\[\]\[[^\]]*\]/)?(void 0===d[i]&&(d[i]={}),d[i][r[0]]=t):s.match(/\[\]/)&&(void 0===d[i]&&(d[i]=[]),d[i].push(t))}else d[l[o].name]=t;for(s in d)if(void 0!==d["as_values_"+s]){d[s]=y.grep(d["as_values_"+s].split(","),function(e){return""!==e}).join(",");try{delete d["as_values_"+s]}catch(e){}}return y.each(e.find("[name]"),function(e,t){t=y(t).attr("name").replace(/\[(.*)\]/,"");t in d||(d[t]="")}),d=y.extend({},FLBuilder._getOriginalSettings(e),d)},_getSettingsJSONForHTML:function(e){return JSON.stringify(e).replace(/\'/g,"'").replace("<wbr />","<wbr>")},_getOriginalSettings:function(e,t){var i=e.find(".fl-builder-settings-json"),e=e.data("node"),l=FLBuilderSettingsConfig.nodes,o=null,n={};if(e&&l[e]?o=l[e]:i.length&&(o=FLBuilder._jsonParse(i.val().replace(/'/g,"'"))),o)for(key in o)(key.match(/[a-z0-9-_]+$/)&&y("#fl-field-"+key).length||t)&&(n[key]=o[key]);return n},_getSettingsForChangedCheck:function(e,t){var i=FLBuilder._getSettings(t);if(e){t=y(".fl-node-"+e);if(t.hasClass("fl-module")){t=t.data("type"),t=FLBuilderSettingsConfig.editables[t];if(t&&FLBuilderSettingsConfig.nodes[e])for(var l in t)i[l]=FLBuilderSettingsConfig.nodes[e][l]}}return i},_saveSettings:function(i){var e=y(".fl-builder-settings-lightbox .fl-builder-settings"),t=e.data("new-module"),l=e.attr("data-node"),o=FLBuilder._getSettings(e),n=FLBuilder.preview;function s(){FLBuilder._showNodeLoading(l),FLBuilderSettingsConfig.nodes[l]=o;const e=FL.Builder.data.getLayoutActions();var t=FLBuilder._saveSettingsComplete.bind(this,i,n);e.updateNodeSettings(l,o,t),FLBuilder.triggerHook("didSaveNodeSettings",{nodeId:l,settings:o}),FLBuilder._lightbox.close()}!FLBuilder.isUndefined(i)&&FLBuilder.isBoolean(i)||(i=!0),n&&!n._settingsHaveChanged()&&FLBuilder.isUndefined(t)?FLBuilder._lightbox.close():FLBuilderConfig.userCaps.unfiltered_html?s():(FLBuilderSettingsForms.showLightboxLoader(),FLBuilder.ajax({action:"verify_settings",settings:o},function(e){"true"===e?s():(msg='<p style="font-weight:bold;text-align:center;">'+FLBuilderStrings.noScriptWarn.heading+"</p>",FLBuilderConfig.userCaps.global_unfiltered_html?msg+="<p>"+FLBuilderStrings.noScriptWarn.global+"</p>":msg+="<p>"+FLBuilderStrings.noScriptWarn.message+"</p>",msg=(msg+='<p><div class="fl-diff"></div></p>')+"<p>"+FLBuilderStrings.noScriptWarn.footer+"</p>",FLBuilderSettingsForms.hideLightboxLoader(),FLBuilder.alert(msg),""!==(data=y.parseJSON(e)).diff&&(y(".fl-diff").html(data.diff),y(".fl-diff").prepend("<p>"+FLBuilderStrings.codeErrorDetected+"</p>"),y(".fl-diff .diff-deletedline").each(function(){(y(this).find("del").length<1?y(this).css("background-color","rgb(255, 192, 203, 0.7)").css("padding","10px"):y(this).find("del").css("background-color","rgb(255, 192, 203, 0.7)")).css("border","1px solid pink")}),console.log("============"),console.log("key: "+data.key),console.log("value: "+data.value),console.log("parsed: "+data.parsed),console.log("============")))}))},_saveSettingsComplete:function(e,t,i){function l(){t&&o.layout.partial&&o.layout.nodeId===t.nodeId&&!FLBuilder._publishAndRemain&&(t.clear(),t=null,FLBuilder._publishAndRemain=!1)}var o=FLBuilder._jsonParse(i),i=o.layout.nodeType,n=o.layout.moduleType,s="didSave"+i.charAt(0).toUpperCase()+i.slice(1)+"SettingsComplete";!0===e?FLBuilder._renderLayout(o.layout,l):l(),FLBuilder.triggerHook("didSaveNodeSettingsComplete",{nodeId:o.node_id,nodeType:i,moduleType:n,settings:o.settings}),FLBuilder.triggerHook(s,{nodeId:o.node_id,nodeType:i,moduleType:n,settings:o.settings})},_triggerSettingsSave:function(e,t,i){var l=FLBuilder._lightbox._node.find("form.fl-builder-settings"),o=FLBuilder._lightbox._node.data("instance-id"),o=FLLightbox._instances[o],n=y(".fl-lightbox-wrap[data-parent]:visible"),s=!0;return e=!_.isUndefined(e)&&e,t=!_.isUndefined(t)&&t,(i=_.isUndefined(i)?!e:i)||(FLBuilder._publishAndRemain=!0),l.length&&(n.length&&(n.find(".fl-builder-settings-save").trigger("click"),(n.find("label.error").length||y(".fl-builder-alert-lightbox:visible").length)&&(s=!1)),s&&!l.validate({ignore:".fl-ignore-validation"}).form()&&(s=!1),n=FLBuilderSettingsForms.settingsHaveChanged(),s&&n&&(e&&o.disableClose(),l.find(".fl-builder-settings-save").trigger("click"),e&&o.enableClose(),(l.find("label.error").length||y(".fl-builder-alert-lightbox:visible").length)&&(s=!1)),i?(FLBuilder._destroySettingsForms(),!n&&FLBuilder.preview&&(FLBuilder.preview.clear(),FLBuilder.preview=null)):FLBuilderSettingsForms.cacheCurrentSettings(),n||e||o.close()),s?FLBuilder.triggerHook("didTriggerSettingsSave"):(FLBuilder.triggerHook("didFailSettingsSave"),FLBuilder._toggleSettingsTabErrors(),t&&!y(".fl-builder-alert-lightbox:visible").length&&FLBuilder.alert(FLBuilderStrings.settingsHaveErrors)),s},_refreshSettingsPreviewReference:function(){FLBuilder.preview&&FLBuilder.preview._initElementsAndClasses()},_openNestedSettings:function(e){e.className&&-1===e.className.indexOf("fl-builder-settings-lightbox")&&(e.className+=" fl-builder-settings-lightbox"),e=y.extend({className:"fl-builder-lightbox fl-builder-settings-lightbox",destroyOnClose:!0,resizable:!0},e);var t=y(".fl-lightbox-wrap:visible"),i=t.find(".fl-lightbox"),e=new FLLightbox(e),l=e._node,o=l.find(".fl-lightbox");return t.hide(),l.attr("data-parent",t.attr("data-instance-id")),o.attr("style",i.attr("style")),e.on("resized",FLBuilder._calculateSettingsTabsOverflow),e.open('<div class="fl-builder-lightbox-loading"></div>'),e},_closeNestedSettings:function(){var e=y(".fl-builder-lightbox[data-parent]:visible"),t=e.find(".fl-lightbox"),i=e.attr("data-instance-id"),i=FLLightbox._instances[i],e=e.attr("data-parent"),l=y('[data-instance-id="'+e+'"]'),o=l.find(".fl-lightbox"),n=l.find("form"),s=FLLightbox._instances[e];i&&(i.on("close",function(){o.attr("style",t.attr("style")),l.show(),s._resize(),l.find("label.error").remove(),n.validate().hideErrors(),FLBuilder._toggleSettingsTabErrors(),FLBuilder._initMultipleFields()}),i.close())},_showHelpTooltip:function(){y(this).siblings(".fl-help-tooltip-text").fadeIn()},_hideHelpTooltip:function(){y(this).siblings(".fl-help-tooltip-text").fadeOut()},_initSection:function(){var e=y(this);e.find(".fl-builder-settings-section-header").on("click",function(){e.toggleClass("fl-builder-settings-section-collapsed")})},_initButtonGroupFields:function(){y(".fl-builder-settings:visible").find(".fl-button-group-field").each(FLBuilder._initButtonGroupField)},_initButtonGroupField:function(){var e=y(this),i=e.find(".fl-button-group-field-option"),l=e.find("input");i.on("click",function(){var e=y(this);"1"==e.attr("data-selected")?(e.attr("data-selected","0"),l.val("").trigger("change")):(i.attr("data-selected","0"),e.attr("data-selected","1"),l.val(e.data("value")).trigger("change"))}),l.on("change",function(e){var t=l.val(),t=i.filter('[data-value="'+t+'"]');i.attr("data-selected","0"),t.attr("data-selected","1")})},_initCompoundFields:function(){y(".fl-builder-settings:visible").find(".fl-compound-field").each(FLBuilder._initCompoundField)},_initCompoundField:function(){var e=y(this),t=e.find(".fl-compound-field-section"),i=e.find(".fl-compound-field-section-toggle"),e=e.find(".fl-compound-field-setting").has(".fl-dimension-field-units");t.each(function(){var e=y(this);e.find(".fl-compound-field-section-toggle").length||e.addClass("fl-compound-field-section-visible")}),i.on("click",function(){var e=y(this),t=e.closest(".fl-field"),e="."+e.closest(".fl-compound-field-section").attr("class").split(" ").join(".");t.find(e).toggleClass("fl-compound-field-section-visible")}),e.each(function(){var e=y(this),t=e.find(".fl-compound-field-label");t.length&&!e.find(".fl-shadow-field").length&&t.append('<i class="fl-dimension-field-link fl-tip dashicons dashicons-admin-links" title="Link Values"></i>')})},_initAutoSuggestFields:function(){var t,i=y(".fl-builder-settings:visible .fl-suggest-field"),e=null,l=null,o=[];i.each(function(){""!==(e=y(this)).attr("data-value")&&(FLBuilderSettingsForms.showFieldLoader(e),o.push({name:e.attr("name"),value:e.attr("data-value"),action:e.attr("data-action"),data:e.attr("data-action-data")}))}),o.length?FLBuilder.ajax({action:"get_autosuggest_values",fields:o},function(e){for(l in t=FLBuilder._jsonParse(e))y('.fl-suggest-field[name="'+l+'"]').attr("data-value",t[l]);i.each(FLBuilder._initAutoSuggestField)}):i.each(FLBuilder._initAutoSuggestField)},_initAutoSuggestField:function(){var e=y(this);e.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:e.data("action"),fl_as_action_data:e.data("action-data"),_wpnonce:FLBuilderConfig.ajaxNonce}),y.extend({},{asHtmlID:e.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:2,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,preFill:e.data("value"),queryParam:"fl_as_query",afterSelectionAdd:FLBuilder._updateAutoSuggestField,afterSelectionRemove:FLBuilder._updateAutoSuggestField,selectionLimit:e.data("limit"),canGenerateNewSelections:!1},e.data("args"))),FLBuilderSettingsForms.hideFieldLoader(e)},_updateAutoSuggestField:function(e,t,i){var l=this;y(this).siblings(".as-values").val(i.join(",")).trigger("change"),y(this).parents(".as-selections").sortable({items:":not(.as-original)",update:function(e,t){var i=[];set=l.parents(".as-selections").find("li.as-selection-item"),y.each(set,function(e,t){i.push(y(t).attr("data-value"))}),y(l).siblings(".as-values").val(i.join(",")).trigger("change")}})},_CodeFieldSSLCheck:function(){y("body").append('<div class="sg-test" style="display:none"><svg xmlns="http://www.w3.org/2000/svg"></svg></div>'),"https://www.w3.org/2000/svg"===y(".sg-test").find("svg").attr("xmlns")&&(FLBuilder._codeDisabled=!0),y(".sg-test").remove()},_initCodeFields:function(){FLBuilder._codeDisabled||y(".fl-builder-settings:visible").find(".fl-code-field").each(FLBuilder._initCodeField)},_initCodeField:function(){var e=y(this),n=e.closest(".fl-builder-settings"),t=e.find("textarea"),e=(t.attr("id"),t.data("editor")),i=t.data("wrap"),l=y("<div>",{position:"absolute",height:20*parseInt(t.attr("rows"),10)}),s=null,r=!(!n.hasClass("fl-builder-global-settings")&&!n.hasClass("fl-builder-layout-settings"));l.insertBefore(t),l.attr("contentEditable",!0),l.addClass("fl-ignore-validation"),t.css("display","none"),ace.require("ace/ext/language_tools"),(s=ace.edit(l[0])).$blockScrolling=1/0,s.getSession().setValue(t.val()),s.getSession().setMode("ace/mode/"+e),i&&s.getSession().setUseWrapMode(!0),s.setOptions(FLBuilderConfig.AceEditorSettings),s.getSession().on("change",function(e){t.val(s.getSession().getValue()).trigger("change")}),s.getSession().on("changeAnnotation",function(){for(var e=s.getSession().getAnnotations(),t=n.find(".fl-builder-settings-save"),i=n.find(".fl-builder-settings-error"),l=!1,o=0;o<e.length;o++)if(!(-1<e[o].text.indexOf("DOCTYPE")||-1<e[o].text.indexOf("Named entity expected")||-1<e[o].text.indexOf("@supports")||"error"!==e[o].type)){l=!0;break}val=s.getSession().getValue(),r&&l&&null!==val.match(/<\/iframe>|<\/script>/gm)&&(t.addClass("fl-builder-settings-error"),t.on("click",FLBuilder._showCodeFieldCriticalError)),l&&!t.hasClass("fl-builder-settings-error")&&i.length&&FLBuilderConfig.CheckCodeErrors&&(t.addClass("fl-builder-settings-error"),t.on("click",FLBuilder._showCodeFieldError)),l||(i.removeClass("fl-builder-settings-error"),i.off("click",FLBuilder._showCodeFieldError),i.off("click",FLBuilder._showCodeFieldCriticalError))}),t.closest(".fl-field").data("editor",s)},_showCodeFieldError:function(e){e.stopImmediatePropagation(),FLBuilder.confirm({message:FLBuilderStrings.codeError,cancel:function(){var e=y(".fl-builder-settings:visible .fl-builder-settings-save");e.removeClass("fl-builder-settings-error"),e.off("click",FLBuilder._showCodeFieldError),e.trigger("click")},strings:{ok:FLBuilderStrings.codeErrorFix,cancel:FLBuilderStrings.codeErrorIgnore}})},_showCodeFieldCriticalError:function(e){e.stopImmediatePropagation(),FLBuilder.alert(FLBuilderStrings.codeerrorhtml)},_initMultipleFields:function(){y(".fl-builder-settings:visible .fl-builder-field-multiples").each(function(){var e=y(this),t=null,i=0,l=FLBuilderConfig.isRtl?{left:10}:{right:10},o=e.attr("data-limit")||0,n=e.find("tr").length||0;for(0<parseInt(o)&&n-1>=parseInt(o)?(e.find(".fl-builder-field-copy").hide(),e.find(".fl-builder-field-add").fadeOut()):e.find(".fl-builder-field-copy, .fl-builder-field-add").show();i<e.length;i++)1===(t=e.eq(i).find(".fl-builder-field-multiple")).length?t.eq(0).find(".fl-builder-field-actions").addClass("fl-builder-field-actions-single"):t.find(".fl-builder-field-actions").removeClass("fl-builder-field-actions-single");y(".fl-builder-field-multiples").sortable({items:".fl-builder-field-multiple",cursor:"move",cursorAt:l,distance:5,opacity:.5,placeholder:"fl-builder-field-dd-zone",stop:FLBuilder._fieldDragStop,tolerance:"pointer",axis:"y"})})},_addFieldClicked:function(){var e=y(this),t=e.attr("data-field"),i=e.closest("tr").siblings("tr[data-field="+t+"]").last(),l=i.clone(),o=l.find(".fl-form-field"),n=null,s=parseInt(i.find("label span.fl-builder-field-index").html(),10)+1;l.find("th label span.fl-builder-field-index").html(s),l.find(".fl-form-field-preview-text").html(""),l.find(".fl-form-field-before").remove(),l.find(".fl-form-field-after").remove(),l.find("input, textarea, select").val(""),i.after(l),FLBuilder._initMultipleFields(),o.length?(n=o.find(".fl-form-field-edit").data("type"),o.find("input").val(JSON.stringify(FLBuilderSettingsConfig.defaults.forms[n]))):((n=(o=e.closest("form.fl-builder-settings")).data("type"))&&o.hasClass("fl-builder-module-settings")&&(s=FLBuilderSettingsConfig.defaults.modules[n][t][0],l.find("input, textarea, select").val(s)),FLBuilder._renumberFields(l.closest(".fl-field")))},_copyFieldClicked:function(){var e=y(this).closest("tr"),t=e.clone(),i=parseInt(e.find("label span.fl-builder-field-index").html(),10)+1;t.find("th label span.fl-builder-field-index").html(i),e.after(t),FLBuilder._renumberFields(e.parent()),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview()},_deleteFieldClicked:function(){var e=y(this).closest("tr"),t=e.parent();confirm(FLBuilderStrings.deleteFieldMessage)&&(e.remove(),FLBuilder._renumberFields(t),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview())},_renumberFields:function(e){e.find(".fl-builder-field-multiple").each(function(e,t){y(t).find("th label span.fl-builder-field-index").html(e+1),FLBuilder._renumberFieldAttr(t,"name",e),FLBuilder._renumberFieldAttr(t,"id",e),FLBuilder._renumberFieldAttr(t,"for",e)})},_renumberFieldAttr:function(e,l,o){y(e).find("["+l+"]").each(function(e,t){var i=(i=y(t).attr(l)).replace(/\[(\d+)\]/,"["+o+"]");y(t).attr(l,i)})},_fieldDragHelper:function(){return y('<div class="fl-builder-field-dd-helper"></div>')},_fieldDragStop:function(e,t){FLBuilder._renumberFields(t.item.parent()),FLBuilder.preview.delayPreview()},_initSelectFields:function(){var e=y(".fl-builder-settings:visible").find("select"),e=(e.on("change",FLBuilder._settingsSelectChanged),e.trigger("change"),e.on("change",FLBuilder._calculateSettingsTabsOverflow),y(".fl-builder-settings:visible").find(".fl-button-group-field input[type=hidden]"));e.on("change",FLBuilder._settingsSelectChanged),e.trigger("change"),e.on("change",FLBuilder._calculateSettingsTabsOverflow)},_settingsSelectChanged:function(){var e=y(this),t=e.attr("data-toggle"),i=e.attr("data-hide"),l=e.attr("data-trigger"),o=e.val(),n=0,s=FLBuilderResponsiveEditing._mode,r=e.closest(".fl-field-responsive-setting"),s="fl-field-responsive-setting-"+s;if(!r.length||e.parent().hasClass(s)){if(void 0!==t){for(n in t=FLBuilder._jsonParse(t))FLBuilder._settingsSelectToggle(t[n].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(t[n].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(t[n].tabs,"hide","a[href*=fl-builder-settings-tab-","]");void 0!==t[o]&&(FLBuilder._settingsSelectToggle(t[o].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(t[o].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(t[o].tabs,"show","a[href*=fl-builder-settings-tab-","]"))}if(void 0!==i){for(n in i=FLBuilder._jsonParse(i))FLBuilder._settingsSelectToggle(i[n].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(i[n].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[n].tabs,"show","a[href*=fl-builder-settings-tab-","]");void 0!==i[o]&&(FLBuilder._settingsSelectToggle(i[o].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(i[o].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[o].tabs,"hide","a[href*=fl-builder-settings-tab-","]"))}if(void 0!==l&&void 0!==(l=FLBuilder._jsonParse(l))[o]&&void 0!==l[o].fields)for(n=0;n<l[o].fields.length;n++)y("#fl-field-"+l[o].fields[n]).find("select").trigger("change")}},_settingsSelectToggle:function(e,t,i,l){var o=0;if(l=void 0===l?"":l,void 0!==e)for(;o<e.length;o++)y(".fl-builder-settings:visible").find(i+e[o]+l)[t](),y(i+e[o]+l).parent().find('.fl-field[data-type="code"]').each(function(){FLBuilder._codeDisabled||y(this).data("editor").resize()})},_initColorPickers:function(){var e=FLBuilderConfig.colorPresets||[];FLBuilder.colorPicker=new FLBuilderColorPicker({mode:"hsv",elements:".fl-color-picker .fl-color-picker-value",presets:e,labels:{colorPresets:FLBuilderStrings.colorPresets,colorPicker:FLBuilderStrings.colorPicker,placeholder:FLBuilderStrings.placeholder,removePresetConfirm:FLBuilderStrings.removePresetConfirm,noneColorSelected:FLBuilderStrings.noneColorSelected,alreadySaved:FLBuilderStrings.alreadySaved,noPresets:FLBuilderStrings.noPresets,presetAdded:FLBuilderStrings.presetAdded}}),y(FLBuilder.colorPicker).on("presetRemoved presetAdded presetSorted",function(e,t){FLBuilder.ajax({action:"save_color_presets",presets:t.presets})})},_initGradientPickers:function(){y(".fl-builder-settings:visible .fl-gradient-picker").each(FLBuilder._initGradientPicker)},_initGradientPicker:function(){var e=y(this),t=e.find(".fl-gradient-picker-type-select"),i=e.find(".fl-gradient-picker-angle-wrap"),l=e.find(".fl-gradient-picker-position");t.on("change",function(){"linear"===y(this).val()?(i.show(),l.hide()):(i.hide(),l.show())})},_initPhotoFields:function(){var e=y(".fl-builder-settings:visible").find(".fl-photo-field select");e.on("change",FLBuilder._toggleSettingsOnIconChange),e.trigger("change")},_initSinglePhotoSelector:function(){null===FLBuilder._singlePhotoSelector&&(FLBuilder._singlePhotoSelector=wp.media({title:FLBuilderStrings.selectPhoto,button:{text:FLBuilderStrings.selectPhoto},library:{type:FLBuilderConfig.uploadTypes.image},multiple:!1}),FLBuilder._singlePhotoSelector.on("open",FLBuilder._wpmedia_reset_errors),_wpPluploadSettings.defaults.multipart_params.fl_upload_type="photo")},_selectSinglePhoto:function(){FLBuilder._initSinglePhotoSelector(),FLBuilder._singlePhotoSelector.once("open",y.proxy(FLBuilder._singlePhotoOpened,this)),FLBuilder._singlePhotoSelector.once("select",y.proxy(FLBuilder._singlePhotoSelected,this)),FLBuilder._singlePhotoSelector.open()},_singlePhotoOpened:function(){var e=FLBuilder._singlePhotoSelector.state().get("selection"),t=y(this).closest(".fl-photo-field"),i=t.find("input[type=hidden]"),l=i.val(),o=null;y(this).hasClass("fl-photo-replace")?(e.reset(),t.addClass("fl-photo-empty"),i.val("")):""!==l?((o=wp.media.attachment(l)).fetch(),e.add(o?[o]:[])):e.reset()},_singlePhotoSelected:function(){var e=FLBuilder._singlePhotoSelector.state().get("selection").first().toJSON(),t=y(this).closest(".fl-photo-field"),i=t.find("input[type=hidden]"),l=t.find(".fl-photo-preview img"),o=t.find("select");e.url&&e.url.endsWith(".svg")&&(e.sizes={full:{url:e.url,filename:e.url.split("/").pop(),height:"",width:""}}),i.val(e.id),l.attr("src",FLBuilder._getPhotoSrc(e)),t.removeClass("fl-photo-empty").removeClass("fl-photo-no-attachment"),t.find("label.error").remove(),o.show(),o.html(FLBuilder._getPhotoSizeOptions(e,o.val())),o.trigger("change"),FLBuilderSettingsConfig.attachments[e.id]=e},_singlePhotoRemoved:function(){FLBuilder._initSinglePhotoSelector();var e=FLBuilder._singlePhotoSelector.state(),e=void 0!==e?e.get("selection"):null,t=y(this).closest(".fl-photo-field"),i=t.find("input[type=hidden]"),l=t.find("select");e&&e.reset(),t.addClass("fl-photo-empty"),i.val(""),l.html('<option value="" selected></option>'),l.trigger("change")},_getPhotoSrc:function(e){return(void 0===e.sizes?e:void 0!==e.sizes.thumbnail?e.sizes.thumbnail:e.sizes.full).url},_getPhotoSizeOptions:function(e,t){var i="",l=null,o=null,n=!1,s="",r="",a={full:FLBuilderStrings.fullSize,large:FLBuilderStrings.large,medium:FLBuilderStrings.medium,thumbnail:FLBuilderStrings.thumbnail};if(void 0===e.sizes||0===e.sizes.length)i+='<option value="'+e.url+'">'+FLBuilderStrings.fullSize+"</option>";else{for(sizecheck in t=t&&t.split(/[\\/]/).pop(),selectedverified=!1,e.sizes)if(e.sizes[sizecheck].url.split(/[\\/]/).pop()===t){selectedverified=!0;break}for(l in selectedverified||(t=!1),e.sizes)o="",s=void 0!==a[l]?a[l]:void 0!==FLBuilderConfig.customImageSizeTitles[l]?FLBuilderConfig.customImageSizeTitles[l]:"",t?t!==e.sizes[l].url.split(/[\\/]/).pop()||n||(o=' selected="selected"',n=!0):(void 0!==FLBuilderConfig.photomodulesize&&l===FLBuilderConfig.photomodulesize&&!n||l==FLBuilderConfig.defaultImageSize&&!n)&&(o=' selected="selected"',n=!0),e.sizes[l].width&&e.sizes[l].height&&(s=s&&s+" - ",r=e.sizes[l].width+" x "+e.sizes[l].height),i+='<option data-size="'+l+'" value="'+e.sizes[l].url+'"'+o+">"+s+r+"</option>"}return i},_selectMultiplePhotos:function(){var e=y(this).closest(".fl-multiple-photos-field").find("input[type=hidden]").val(),t=""===e?"":FLBuilder._jsonParse(e),e=wp.media.gallery.defaults.id,i='[gallery ids="-1"]',l=null,o=null,n=null,s=null,r=[];if("object"==typeof t){for(s in t)r.push(t[s]);i='[gallery ids="'+r.join()+'"]'}l=wp.shortcode.next("gallery",i).shortcode,_.isUndefined(l.get("id"))&&!_.isUndefined(e)&&l.set("id",e),o=wp.media.gallery.attachments(l),(n=new wp.media.model.Selection(o.models,{props:o.props.toJSON(),multiple:!0})).gallery=o.gallery,n.more().done(function(){n.length||FLBuilder._multiplePhotoSelector.setState("gallery-library"),n.props.set({query:!1}),n.unmirror(),n.props.unset("orderby")}),FLBuilder._multiplePhotoSelector&&FLBuilder._multiplePhotoSelector.dispose(),FLBuilder._multiplePhotoSelector=wp.media({frame:"post",state:y(this).hasClass("fl-multiple-photos-edit")?"gallery-edit":"gallery-library",title:wp.media.view.l10n.editGalleryTitle,editing:!0,multiple:!0,selection:n}).open(),y(FLBuilder._multiplePhotoSelector.views.view.el).addClass("fl-multiple-photos-lightbox"),FLBuilder._multiplePhotoSelector.once("update",y.proxy(FLBuilder._multiplePhotosSelected,this))},_multiplePhotosSelected:function(e){for(var t=y(this).closest(".fl-multiple-photos-field"),i=t.find("input[type=hidden]"),l=t.find(".fl-multiple-photos-count"),o=[],n=0;n<e.models.length;n++)o.push(e.models[n].id);1==o.length?l.html("1 "+FLBuilderStrings.photoSelected):l.html(o.length+" "+FLBuilderStrings.photosSelected),t.removeClass("fl-multiple-photos-empty"),t.find("label.error").remove(),i.val(JSON.stringify(o)).trigger("change")},_initSingleVideoSelector:function(){var e;null===FLBuilder._singleVideoSelector&&(e=_wpPluploadSettings.defaults.filters.mime_types[0].extensions,_wpPluploadSettings.defaults.multipart_params.fl_upload_type="video",_wpPluploadSettings.defaults.filters.mime_types[0].extensions=FLBuilderConfig.uploadTypes.videoTypes,FLBuilder._singleVideoSelector=wp.media({title:FLBuilderStrings.selectVideo,button:{text:FLBuilderStrings.selectVideo},library:{type:["video/mp4","video/webm"]},multiple:!1}),FLBuilder._singleVideoSelector.on("open",FLBuilder._wpmedia_reset_errors),FLBuilder._singleVideoSelector.on("close",function(){_wpPluploadSettings.defaults.filters.mime_types[0].extensions=e}))},_selectSingleVideo:function(){FLBuilder._initSingleVideoSelector(),FLBuilder._singleVideoSelector.once("select",y.proxy(FLBuilder._singleVideoSelected,this)),FLBuilder._singleVideoSelector.open()},_singleVideoSelected:function(){var e=FLBuilder._singleVideoSelector.state().get("selection").first().toJSON(),t=y(this).closest(".fl-video-field"),i=t.find(".fl-video-preview-img"),l=t.find(".fl-video-preview-filename"),o=t.find("input[type=hidden]");i.html('<span class="dashicons dashicons-media-video"></span>'),l.html(e.filename),t.removeClass("fl-video-empty"),t.find("label.error").remove(),o.val(e.id).trigger("change"),FLBuilderSettingsConfig.attachments[e.id]=e},_singleVideoRemoved:function(){FLBuilder._initSingleVideoSelector();var e=FLBuilder._singleVideoSelector.state(),e=void 0!==e?e.get("selection"):null,t=y(this).closest(".fl-video-field"),i=t.find(".fl-video-preview-img img"),l=t.find(".fl-video-preview-filename"),o=t.find("input[type=hidden]");e&&e.reset(),i.attr("src",""),l.html(""),t.addClass("fl-video-empty"),o.val("").trigger("change")},_selectMultipleAudios:function(){var e=y(this).closest(".fl-multiple-audios-field").find("input[type=hidden]").val(),e=""==e?'[playlist ids="-1"]':'[playlist ids="'+FLBuilder._jsonParse(e).join()+'"]',e=wp.shortcode.next("playlist",e).shortcode,t=wp.media.playlist.defaults.id,i=null,l=null;_.isUndefined(e.get("id"))&&!_.isUndefined(t)&&e.set("id",t),i=wp.media.playlist.attachments(e),(l=new wp.media.model.Selection(i.models,{props:i.props.toJSON(),multiple:!0})).playlist=i.playlist,l.more().done(function(){l.props.set({query:!1}),l.unmirror(),l.props.unset("orderby")}),FLBuilder._multipleAudiosSelector&&FLBuilder._multipleAudiosSelector.dispose(),FLBuilder._multipleAudiosSelector=wp.media({frame:"post",state:y(this).hasClass("fl-multiple-audios-edit")?"playlist-edit":"playlist-library",title:wp.media.view.l10n.editPlaylistTitle,editing:!0,multiple:!0,selection:l}).open(),FLBuilder._multipleAudiosSelector.content.get("view").sidebar.unset("playlist"),FLBuilder._multipleAudiosSelector.on("content:render:browse",function(e){e&&e.sidebar.on("ready",function(){e.sidebar.unset("playlist")})}),FLBuilder._multipleAudiosSelector.once("update",y.proxy(FLBuilder._multipleAudiosSelected,this))},_multipleAudiosSelected:function(e){for(var t=y(this).closest(".fl-multiple-audios-field"),i=t.find(".fl-multiple-audios-count"),l=t.find("input[type=hidden]"),o=[],n=0;n<e.models.length;n++)o.push(e.models[n].id);1==o.length?i.html("1 "+FLBuilderStrings.audioSelected):i.html(o.length+" "+FLBuilderStrings.audiosSelected),l.val(JSON.stringify(o)).trigger("change"),t.removeClass("fl-multiple-audios-empty"),t.find("label.error").remove()},_initIconFields:function(){var e=y(".fl-builder-settings:visible").find(".fl-icon-field input");e.on("change",FLBuilder._toggleSettingsOnIconChange),e.trigger("change")},_toggleSettingsOnIconChange:function(){var e=y(this),t=e.val(),e=e.attr("data-show");void 0!==e&&(e=FLBuilder._jsonParse(e),FLBuilder._settingsSelectToggle(e.fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(e.sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(e.tabs,"hide","a[href*=fl-builder-settings-tab-","]"),t&&(FLBuilder._settingsSelectToggle(e.fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(e.sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(e.tabs,"show","a[href*=fl-builder-settings-tab-","]"),FLBuilder._calculateSettingsTabsOverflow()))},_selectIcon:function(){var t=this;FLIconSelector.open(function(e){FLBuilder._iconSelected.apply(t,[e])})},_iconSelected:function(e){var t=y(this).closest(".fl-icon-field"),i=t.find("input[type=hidden]"),l=t.find("i"),o=l.attr("data-icon");i.val(e).trigger("change"),l.removeClass(o),l.addClass(e),l.attr("data-icon",e),t.removeClass("fl-icon-empty"),t.find("label.error").remove()},_removeIcon:function(){var e=y(this).closest(".fl-icon-field"),t=e.find("input[type=hidden]"),i=e.find("i");t.val("").trigger("change"),i.removeClass(),i.attr("data-icon",""),e.addClass("fl-icon-empty")},_formFieldClicked:function(){var e=y(this),t=e.closest(".fl-builder-settings"),i=e.attr("data-type"),l=e.siblings("input").val(),o=FLBuilder._moduleHelpers[i],n=(FLBuilderSettingsConfig.forms[i],FLBuilder._openNestedSettings({className:"fl-builder-lightbox fl-form-field-settings"}));""===l&&(l=JSON.stringify(FLBuilderSettingsConfig.forms[i])),FLBuilderSettingsForms.render({id:i,nodeId:t.attr("data-node"),nodeSettings:FLBuilder._getSettings(t),settings:FLBuilder._jsonParse(l.replace(/'/g,"'")),lightbox:n,rules:o?o.rules:null,helper:{init:function(){o&&o.init(),FLBuilder._initFormFieldSettingsPreview(n)}}},function(){e.attr("id","fl-"+n._node.attr("data-instance-id")),n._node.find("form.fl-builder-settings").attr("data-type",i),FLBuilderResponsiveEditing._switchAllSettingsToCurrentMode()})},_saveFormFieldClicked:function(){var e=y(this).closest(".fl-builder-settings");FLBuilder._saveFormFieldSettings(e)?FLBuilder._closeNestedSettings():FLBuilder._toggleSettingsTabErrors()},_initFormFieldSettingsPreview:function(e){var t=e._node.find(".fl-field"),e=e._node.find("textarea.wp-editor-area");t.find("input:not([type=hidden]), textarea").on("input",FLBuilder._previewFormFieldSettings),t.find("input[type=hidden], select").on("change",FLBuilder._previewFormFieldSettings),"undefined"!=typeof tinyMCE&&e.each(function(e,t){(t=tinyMCE.get(y(t).attr("id"))).on("change",FLBuilder._previewFormFieldSettings),t.on("keyup",FLBuilder._previewFormFieldSettings)})},_previewFormFieldSettings:function(){var e=this.formElement||this,t=y(e).closest(".fl-builder-settings"),e=t.data("timeout");e&&clearTimeout(e),e=setTimeout(function(){FLBuilder._saveFormFieldSettings(t)},1e3),t.data("timeout",e)},_saveFormFieldSettings:function(e){var t=e.closest(".fl-lightbox-wrap").attr("data-instance-id"),i=e.attr("data-type"),l=FLBuilder._getSettings(e),i=FLBuilder._moduleHelpers[i],t=y(".fl-builder-settings #fl-"+t),o=t.parent().attr("data-preview-text"),n=e.find("#fl-field-"+o),s=l[o],r=y('select[name="'+o+'"]'),a=document.createElement("div"),d=!0;return 0<r.length&&(s=r.find('option[value="'+l[o]+'"]').text()),void 0!==i&&(e.find("label.error").remove(),e.validate().hideErrors(),d=(d=e.validate().form())&&i.submit()),!!d&&(void 0!==o&&void 0!==s&&("icon"===n.data("type")?s='<i class="'+s+'"></i>':35<s.length&&(a.innerHTML=s,s=(a.textContent||a.innerText||"").replace(/^(.{35}[^\s]*).*/,"$1")+"..."),t.siblings(".fl-form-field-preview-text").html(s)),0<t.length&&(""!=(r=t.siblings("input").val().replace(/'/g,"'"))&&(l=y.extend(FLBuilder._jsonParse(r),l)),t.siblings("input").val(JSON.stringify(l)).trigger("change")),!0)},_layoutFieldClicked:function(){var e=y(this);e.siblings().removeClass("fl-layout-field-option-selected"),e.addClass("fl-layout-field-option-selected"),e.siblings("input").val(e.attr("data-value"))},_initLinkFields:function(){y(".fl-builder-settings:visible .fl-link-field").each(FLBuilder._initLinkField)},_initLinkField:function(){var e=y(this),t=e.find(".fl-link-field-search-input"),e=e.find(".fl-link-field-options-wrap input[type=checkbox]");t.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:"fl_as_links",_wpnonce:FLBuilderConfig.ajaxNonce}),{asHtmlID:t.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:3,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,queryParam:"fl_as_query",selectionLimit:1,afterSelectionAdd:FLBuilder._updateLinkField,formatList:function(e,t){return t.html(e.name+'<span class="type">['+e.type+"]</span>")}}),e.on("click",FLBuilder._linkFieldCheckboxClicked)},_updateLinkField:function(e,t,i){var e=e.closest(".fl-link-field"),l=e.find(".fl-link-field-search"),o=e.find(".fl-link-field-search-input");e.find(".fl-link-field-input").val(t.value).trigger("keyup"),o.autoSuggest("remove",t.value),l.hide()},_linkFieldSelectClicked:function(){var e=y(this).closest(".fl-link-field").find(".fl-link-field-search");e.show(),e.find("input").focus()},_linkFieldSelectCancelClicked:function(){var e=y(this);e.parent().hide(),e.closest(".fl-link-field").find("input.fl-link-field-input").focus()},_linkFieldCheckboxClicked:function(){var e=y(this),t=e.is(":checked"),i=e.siblings("input[type=hidden]"),l="",l=e.hasClass("fl-link-field-target-cb")?t?"_blank":"_self":t?"yes":"no";i.val(l)},_initFontFields:function(){y(".fl-builder-settings:visible .fl-font-field").each(FLBuilder._initFontField)},_initFontField:function(){var t,e=y(this),i=e.attr("data-value"),l=e.find(".fl-font-field-font"),e=e.find(".fl-font-field-weight");FLBuilderConfig.select2Enabled&&l.select2({width:"100%"}).on("select2:open",function(e){y(".select2-search__field").attr("placeholder",FLBuilderStrings.placeholderSelect2)}),l.on("change",function(){FLBuilder._getFontWeights(l)}),-1<i.indexOf("family")&&(i=FLBuilder._jsonParse(i),t=!1,fonts=FLBuilderFontFamilies,Object.keys(fonts.system).forEach(function(e){e===i.family&&(t=!0)}),Object.keys(fonts.google).forEach(function(e){e===i.family&&(t=!0)}),t||"Default"===i.family||(i={family:"Default",weight:"400"}),l.val(i.family),l.trigger("change"),e.find("option[value="+i.weight+"]").length&&e.val(i.weight))},_getFontWeights:function(e){var i=e.closest(".fl-font-field").find(".fl-font-field-weight"),l=e.val(),o=i.val(),n=FLBuilderConfig.FontWeights,t={},s=e.closest(".fl-font-field").find(".recent-fonts option");i.html(""),0<s.length&&!1==0<y(s).filter(function(e,t){return t.value===l}).length&&"Default"!==l&&e.closest(".fl-font-field").find(".recent-fonts").append(y("<option>",{value:l,text:l})),t=void 0!==FLBuilderFontFamilies.system[l]?FLBuilderFontFamilies.system[l].weights:(void 0!==FLBuilderFontFamilies.google[l]?FLBuilderFontFamilies.google:FLBuilderFontFamilies.default)[l],y.each(t,function(e,t){i.append('<option value="'+t+'"'+(o===t?" selected":"")+">"+n[t]+"</option>")})},_initTinyMCE:function(){"object"==typeof tinymce&&void 0!==tinymce.ui.FloatPanel&&(tinymce.ui.FloatPanel.zIndex=100100),y(".fl-builder-hidden-editor").each(FLBuilder._initEditorField)},_initEditorFields:function(){y(".fl-builder-settings:visible .fl-editor-field").each(FLBuilder._initEditorField)},_initEditorField:function(){var e=y(this),t=e.find("textarea"),i=e.attr("data-name"),i="flrich"+(new Date).getTime()+"_"+i,l=FLBuilderConfig.wp_editor,o=tinyMCEPreInit,n=Number(e.attr("data-buttons")),e=e.attr("data-rows"),s=null,r=null,l=l.replace(/flbuildereditor/g,i),o=FLBuilder._jsonParse(JSON.stringify(o).replace(/flbuildereditor/g,i));o=JSONfn.parse(JSONfn.stringify(o).replace(/flbuildereditor/g,i)),t.after(l).remove(),y("textarea#"+i).val(t.val()),void 0!==o.mceInit[i]&&((s=o.mceInit[i]).setup=function(e){e.on("SaveContent",function(e){e.content=e.content.replace(/<a href="(\.\.\/){1,2}/g,'<a href="'+FLBuilderConfig.homeUrl+"/"),e.content=e.content.replace(/src="(\.\.\/){1,2}/g,'src="'+FLBuilderConfig.homeUrl+"/")})},(r=tinymce.$("#wp-"+i+"-wrap")).find("textarea").attr("rows",e),r.find("textarea").attr("contentEditable",!0),n||r.find(".wp-media-buttons").remove(),!r.hasClass("tmce-active")&&o.qtInit.hasOwnProperty(i)||s.wp_skip_init||tinymce.init(s)),quicktags(o.qtInit[i]),window.wpActiveEditor=i},_reinitEditorFields:function(){y(".fl-lightbox-resizable:visible").length&&setTimeout(function(){var e,t;if("undefined"!=typeof tinymce){for(e=tinymce.editors.length-1;-1<e;e--)tinymce.editors[e].inline||(t=tinymce.editors[e].id,tinyMCE.execCommand("mceRemoveEditor",!0,t),tinyMCE.execCommand("mceAddEditor",!0,t));FLBuilder.preview&&FLBuilder.preview._initDefaultFieldPreviews(y('.fl-field[data-type="editor"]'))}},1)},_destroyEditorFields:function(){var e;if("undefined"!=typeof tinymce){for(e=tinymce.editors.length-1;-1<e;e--)tinymce.editors[e].inline||tinyMCE.execCommand("mceRemoveEditor",!0,tinymce.editors[e].id);y(".wplink-autocomplete").remove(),y(".ui-helper-hidden-accessible").remove()}},_updateEditorFields:function(){y(".fl-builder-settings:visible textarea.wp-editor-area").each(FLBuilder._updateEditorField)},_updateEditorField:function(){var e=y(this),t=e.closest(".fl-editor-field"),i=(e.closest(".fl-builder-settings"),e.closest(".wp-editor-wrap")),l=e.attr("id"),o=t.attr("data-name"),l="undefined"!=typeof tinymce&&tinymce.get(l),n=e.siblings('textarea[name="'+o+'"]'),t=t.data("wpautop");0===n.length&&(n=y('<textarea name="'+o+'"></textarea>').hide(),e.after(n)),t?l&&i.hasClass("tmce-active")?n.val(l.getContent()):"undefined"!=typeof switchEditors?n.val(switchEditors.wpautop(e.val())):n.val(e.val()):(l&&i.hasClass("tmce-active")&&l.save(),n.val(e.val()))},_loopDataSourceChange:function(){var e=y(this).val();y(".fl-loop-data-source").hide(),y('.fl-loop-data-source[data-source="'+e+'"]').show()},_customQueryPostTypeChange:function(){var e=y(this).val();y(".fl-custom-query-filter").hide(),y(".fl-custom-query-"+e+"-filter").show()},_initOrderingFields:function(){y(".fl-builder-settings:visible .fl-ordering-field-options").each(FLBuilder._initOrderingField)},_initOrderingField:function(){y(this).sortable({items:".fl-ordering-field-option",containment:"parent",tolerance:"pointer",stop:FLBuilder._updateOrderingField})},_updateOrderingField:function(e){var e=y(e.target),t=e.siblings("input[type=hidden]"),i=[];e.find(".fl-ordering-field-option").each(function(){i.push(y(this).attr("data-key"))}),t.val(JSON.stringify(i)).trigger("change")},_textFieldAddValueSelectChange:function(){var e=y(this),t=y('input[name="'+e.data("target")+'"]'),i=t.val(),l=e.val();-1==i.indexOf(l)&&(i=(i.trim()+" "+l.trim()).trim(),t.val(i).trigger("change").trigger("keyup")),e.val("")},_onNumberFieldFocus:function(e){var t=y(e.currentTarget);t.addClass("mousetrap"),Mousetrap.bind("up",function(){t.attr("step",1)}),Mousetrap.bind("down",function(){t.attr("step",1)}),Mousetrap.bind("shift+up",function(){t.attr("step",10)}),Mousetrap.bind("shift+down",function(){t.attr("step",10)})},_onNumberFieldBlur:function(e){y(e.currentTarget).attr("step","any").removeClass("mousetrap")},_initTimezoneFields:function(){y(".fl-builder-settings:visible .fl-field[data-type=timezone]").each(FLBuilder._initTimezoneField)},_initTimezoneField:function(){var e=y(this).find("select"),t=e.attr("data-value");e.find('option[value="'+t+'"]').prop("selected",!0)},_initDimensionFields:function(){var e=y(".fl-builder-settings:visible");e.find(".fl-field[data-type=dimension]").each(FLBuilder._initDimensionField),e.find(".fl-dimension-field-link").on("click",FLBuilder._dimensionFieldLinkClicked),FLBuilder.addHook("responsive-editing-switched",this._initResponsiveDimensionFieldLinking),e.find(".fl-compound-field-setting").has(".fl-dimension-field-link").each(FLBuilder._initDimensionFieldLinking)},_initDimensionField:function(){var e=y(this),t=e.find(".fl-field-label label"),e=e.find(".fl-field-control-wrapper"),i='<i class="fl-dimension-field-link fl-tip dashicons dashicons-admin-links" title="Link Values"></i>';t.append(i),e.prepend(i),FLBuilder._initTipTips(),FLBuilder._initDimensionFieldLinking.apply(this)},_initDimensionFieldLinking:function(){var e=y(this),t=e.find(".fl-dimension-field-link"),e=FLBuilder._getDimensionFieldLinkingInputs(e);FLBuilder._dimensionFieldInputsAreEqual(e)?(t.removeClass("dashicons-admin-links"),t.addClass("dashicons-editor-unlink"),e.off("input",FLBuilder._dimensionFieldLinkedValueChange),e.on("input",FLBuilder._dimensionFieldLinkedValueChange)):(t.addClass("dashicons-admin-links"),t.removeClass("dashicons-editor-unlink"))},_initResponsiveDimensionFieldLinking:function(){y(".fl-builder-settings:visible").find(".fl-field[data-type=dimension]").each(FLBuilder._initDimensionFieldLinking)},_dimensionFieldLinkClicked:function(){var e=y(this),t=e.closest(".fl-compound-field-setting"),t=t.length?t:e.closest(".fl-field"),e=t.find(".fl-dimension-field-link"),i=e.hasClass("dashicons-editor-unlink"),t=FLBuilder._getDimensionFieldLinkingInputs(t);e.toggleClass("dashicons-admin-links"),e.toggleClass("dashicons-editor-unlink"),i?t.off("input",FLBuilder._dimensionFieldLinkedValueChange):(t.val(t.eq(0).val()).trigger("input"),t.on("input",FLBuilder._dimensionFieldLinkedValueChange))},_dimensionFieldLinkedValueChange:function(){var e=y(this),t=e.attr("name"),t=e.closest(".fl-dimension-field-units").find('input:not([name="'+t+'"])');t.off("input",FLBuilder._dimensionFieldLinkedValueChange),t.val(e.val()).trigger("input"),t.on("input",FLBuilder._dimensionFieldLinkedValueChange)},_getDimensionFieldLinkingInputs:function(e){var t=!!e.find(".fl-field-responsive-setting").length,i=FLBuilderResponsiveEditing._mode;return t?e.find(".fl-field-responsive-setting-"+i+" input"):e.find(".fl-dimension-field-unit input")},_dimensionFieldInputsAreEqual:function(e){var t=e.eq(0).val();if(""===t)return!1;for(var i=1;i<4;i++)if(e.eq(i).val()!==t)return!1;return!0},_initFieldPopupSliders:function(){y(".fl-builder-settings:visible").find(".fl-field-popup-slider").each(FLBuilder._initFieldPopupSlider)},_initFieldPopupSlider:function(){var n=y("body"),s=y(this),r=s.find(".fl-field-popup-slider-input"),a=s.find(".fl-field-popup-slider-arrow"),e=s.data("input"),d=y('input[name="'+e+'"]');d.on("click",function(){r.hasClass("fl-field-popup-slider-init")||(r.slider({value:d.val(),slide:function(e,t){d.val(t.value).trigger("input")}}),d.on("input",function(){r.slider("value",y(this).val())}),r.addClass("fl-field-popup-slider-init"),r.find(".ui-slider-handle").removeAttr("tabindex")),FLBuilder._setFieldPopupSliderMinMax(r),FLBuilder._hideFieldPopupSliders(),n.on("mousedown",FLBuilder._hideFieldPopupSliders),d.addClass("fl-field-popup-slider-focus"),s.show();var e=y(".fl-builder-settings:visible .fl-builder-settings-tab.fl-active"),t=e.offset(),i=d.offset(),l=d.width(),o=s.offset();o.top+s.outerHeight()>t.top+e.outerHeight()&&s.addClass("fl-field-popup-slider-top"),a.css("left",2+i.left-o.left+l/2+"px")}),d.on("focus",function(){FLBuilder._hideFieldPopupSliders()})},_hideFieldPopupSliders:function(e){var e=e?y(e.target):null,t=y("body"),i=y(".fl-field-popup-slider:visible"),l=y(".fl-field-popup-slider-focus");if(e){if(e.closest(".fl-field-popup-slider").length)return;if(e.closest(".fl-field-popup-slider-focus").length)return}t.off("mousedown",FLBuilder._hideFieldPopupSliders),l.removeClass("fl-field-popup-slider-focus"),i.hide()},_setFieldPopupSliderMinMax:function(e){var t=e.parent(),i=t.parent().parent().find("select.fl-field-unit-select"),l=i.val(),t=t.data("slider"),o=0,n=100,s=1;""!==l&&"em"!==l&&"rem"!==l||(n=10,s=.1),"object"==typeof t&&(o=t.min?parseFloat(t.min):o,n=t.max?parseFloat(t.max):n,s=t.step?parseFloat(t.step):s,i.length&&t[l]&&(o=t[l].min?parseFloat(t[l].min):o,n=t[l].max?parseFloat(t[l].max):n,s=t[l].step?parseFloat(t[l].step):s)),e.slider({min:o,max:n,step:s})},_initPresetFields:function(){y(".fl-builder-settings:visible").find(".fl-preset-select-controls").each(FLBuilder._initPresetField)},_initPresetField:function(){var e=y(this),t=e.find("select"),i=e.data("presets"),e=e.data("prefix");t.on("change",FLBuilder._setFormPreset.bind(this,i,e))},_setFormPreset:function(e,t,i){var l=y(i.currentTarget).val();if(presetLists=FLBuilderConfig.presets,presets=presetLists[e],form=y(".fl-builder-settings:visible"),"undefined"!==presets&&"undefined"!==presets[l]){var o,n=presets[l].settings;for(o in n){var l=n[o],s=void 0!==t&&""!==t?form.find('[name="'+t+o+'"]'):form.find('[name="'+o+'"]');s.val(l).trigger("change").trigger("input")}}},ajax:function(t,i){if(!FLBuilder._ajaxRequest){for(var e in FLBuilder.triggerHook("didBeginAJAX",t),t)void 0===t[e]&&(t[e]=null);return(t._wpnonce=FLBuilderConfig.ajaxNonce,t.post_id=FLBuilderConfig.postId,t.fl_builder=1,t.safemode=FLBuilderConfig.safemode,t.fl_action=t.action,void 0!==t.settings&&(t.settings=FLBuilder._ajaxModSecFix(y.extend(!0,{},t.settings))),void 0!==t.node_settings&&(t.node_settings=FLBuilder._ajaxModSecFix(y.extend(!0,{},t.node_settings))),void 0!==t.node_preview&&(t.node_preview=FLBuilder._ajaxModSecFix(y.extend(!0,{},t.node_preview))),t.settings=FLBuilder._inputVarsCheck(t.settings),t.node_settings=FLBuilder._inputVarsCheck(t.node_settings),"error"===t.settings||"error"===t.node_settings)?0:(t={fl_builder_data:t},FLBuilder._ajaxRequest=y.post(FLBuilder._ajaxUrl(),t,function(e){void 0!==i&&i.call(this,e),FLBuilder.triggerHook("didCompleteAJAX",t)}).always(FLBuilder._ajaxComplete).fail(function(e,t,i){switch(msg=!1,e.status){case 403:case 409:msg="Something you entered has triggered a "+e.status+" error.<br /><br />This is nearly always due to mod_security settings from your hosting provider.",window.crash_vars.white_label||(msg+='<br /><br />See this <a target="_blank" style="color: #428bca;font-size:inherit" href="https://docs.wpbeaverbuilder.com/beaver-builder/troubleshooting/common-issues/403-forbidden-or-blocked-error">Knowledge Base</a> article for more info.</br />')}msg&&(console.log(e),console.log(i),FLBuilder.alert(msg))}),FLBuilder._ajaxRequest)}FLBuilder._ajaxQueue.push({data:t,callback:i})},_inputVarsCheck:function(e){var t=FLBuilderConfig.MaxInputVars||0;return void 0!==e&&0<t&&(count=y.map(e,function(e,t){return t}).length)>t?(FLBuilder.alert('<h1 style="font-size:2em;text-align:center">Critical Issue</h1><br />The number of settings being saved ('+count+") exceeds the PHP Max Input Vars setting ("+t+").<br />Please contact your host to have this value increased, the default is 1000."),console.log("Vars Count: "+count),console.log("Max Input: "+t),"error"):e},_ajaxComplete:function(){var e;FLBuilder._ajaxRequest=null,FLBuilder.hideAjaxLoader(),FLBuilder._ajaxQueue.length&&(e=FLBuilder._ajaxQueue.shift(),FLBuilder.ajax(e.data,e.callback))},_ajaxUrl:function(e){var t=FLBuilderConfig.shortlink,i=null;if(void 0!==e)for(i in e)t=(t+=-1<t.indexOf("?")?"&":"?")+i+"="+e[i];return t},showAjaxLoader:function(){0===y(".fl-builder-lightbox-loading").length&&y(".fl-builder-loading").show()},hideAjaxLoader:function(){y(".fl-builder-loading").hide()},_showNodeLoading:function(e){e=y(".fl-node-"+e);e.addClass("fl-builder-node-loading"),FLBuilder._removeAllOverlays(),FLBuilder.triggerHook("didStartNodeLoading",e)},_hideNodeLoading:function(e){y(".fl-node-"+e).removeClass("fl-builder-node-loading")},_showNodeLoadingPlaceholder:function(e,t){var i=y('<div class="fl-builder-node-loading-placeholder"></div>');y(".fl-builder-node-loading-placeholder").remove(),0===(siblings=e.hasClass("fl-builder-content")?e.find(" > .fl-row"):e.hasClass("fl-row-content")?e.find(" > .fl-col-group"):e.hasClass("fl-col-group")?(e.addClass("fl-col-group-has-child-loading"),e.find(" > .fl-col")):e.find(" > .fl-col-group, > .fl-module")).length||siblings.length==t?e.append(i):siblings.eq(t).before(i)},_removeNodeLoadingPlaceholder:function(e){var t=e.prev(".fl-builder-node-loading-placeholder"),e=e.next(".fl-builder-node-loading-placeholder");(t.length?t:e).remove()},_ajaxModSecFix:function(e){if(FLBuilderConfig.modSecFix&&"undefined"!=typeof btoa)if("string"==typeof e)e=FLBuilder._btoa(e);else for(var t in e)"string"==(type=typeof e[t])||"number"==type?e[t]=FLBuilder._btoa(e[t]):"object"==type&&(e[t]=FLBuilder._ajaxModSecFix(e[t]));return e},_btoa:function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))},_wpmedia_reset_errors:function(){y(".upload-error").remove(),y(".media-uploader-status").removeClass("errors").hide()},_initLightboxes:function(){FLBuilder._lightbox=new FLLightbox({className:"fl-builder-lightbox fl-builder-settings-lightbox",resizable:!0}),FLBuilder._lightbox.on("resized",FLBuilder._calculateSettingsTabsOverflow),FLBuilder._lightbox.on("close",FLBuilder._lightboxClosed),FLBuilder._lightbox.on("beforeCloseLightbox",FLBuilder._destroyEditorFields),FLBuilder._actionsLightbox=new FLLightbox({className:"fl-builder-actions-lightbox"})},_showLightbox:function(e){e=e||'<div class="fl-builder-lightbox-loading"></div>',FLBuilder._lightbox.open(e),FLBuilder._initLightboxScrollbars()},_setLightboxContent:function(e){FLBuilder._lightbox.setContent(e)},_initLightboxScrollbars:function(){FLBuilder._initScrollbars(),clearTimeout(FLBuilder._lightboxScrollbarTimeout),FLBuilder._lightboxScrollbarTimeout=setTimeout(FLBuilder._initLightboxScrollbars,500)},_lightboxClosed:function(){FLBuilder.triggerHook("settings-lightbox-closed"),FLBuilder._lightbox.empty(),clearTimeout(FLBuilder._lightboxScrollbarTimeout),FLBuilder._lightboxScrollbarTimeout=null},_showActionsLightbox:function(e){var t=wp.template("fl-actions-lightbox");FLBuilder.triggerHook("actions-lightbox-settings",e),FLBuilder._actionsLightbox.open(t(e))},_checkEnv:function(){"svg"===FLBuilderConfig.fontAwesome&&FLBuilder.alert(FLBuilderStrings.fontAwesome)},alert:function(e){var t=new FLLightbox({className:"fl-builder-alert-lightbox",destroyOnClose:!0}),i=wp.template("fl-alert-lightbox");t.open(i({message:e}))},crashMessage:function(e){FLLightbox.closeAll();var t=new FLLightbox({className:"fl-builder-alert-lightbox fl-builder-crash-lightbox",destroyOnClose:!0}),i=wp.template("fl-crash-lightbox"),l=window.crash_vars.product,o=window.crash_vars.white_label,n=window.crash_vars.labeled_txt;message=l+" has detected a plugin conflict that is preventing the page from saving.<p>( In technical terms there’s probably a PHP error in Ajax. )</p>",info="<p>If you contact Beaver Builder Support, we need to know what the error is in the JavaScript console in your browser.</p>",info+="<div><div style='width:49%;float:left;'><p>MacOS Users:<br />Chrome: View > Developer > JavaScript Console<br />Firefox: Tools > Web Developer > Browser Console<br />Safari: Develop > Show JavaScript console</p></div><div style='width:49%;float:right;'><p>Windows Users:<br />Chrome: Settings > More Tools > Developer > Console<br />Firefox: Menu/Settings > Web Developer > Web Console<br />Edge: Settings and More > More Tools > Console</p></div></div><p style='display:inline-block;'>Copy the errors you find there and submit them with your Support ticket. It saves us having to ask you that as a second step.<br /><br />If you want to troubleshoot further, you can check our <a class='link' target='_blank' href='https://docs.wpbeaverbuilder.com/beaver-builder/troubleshooting/debugging/known-beaver-builder-incompatibilities'>Knowledge Base</a> for plugins we know to be incompatible. Then deactivate your plugins one by one while you try to save the page in the Beaver Builder editor. When the page saves normally, you have identified the plugin causing the conflict. <a class='link' target='_blank' href='https://www.wpbeaverbuilder.com/beaver-builder-support/'>Contact Support</a> if you need further help.</p>",FLBuilderConfig.MaxInputVars<=3e3&&(info+="<br /><br />The PHP config value max_input_vars is only set to "+FLBuilderConfig.MaxInputVars+'. If you are using 3rd party addons this could very likely be the cause of this error. [<a class="link" href="https://docs.wpbeaverbuilder.com/beaver-builder/troubleshooting/common-issues/exceeds-php-max-input-vars">doc link</a>].'),o&&(info=n),t.open(i({message:message,info:info,debug:!1}))},_alertClose:function(){FLLightbox.closeParent(this)},confirm:function(e){var t={message:"",ok:function(){},cancel:function(){},strings:{ok:FLBuilderStrings.ok,cancel:FLBuilderStrings.cancel}},t=y.extend({},t,void 0===e?{}:e);lightbox=new FLLightbox({className:"fl-builder-confirm-lightbox fl-builder-alert-lightbox",destroyOnClose:!0}),template=wp.template("fl-confirm-lightbox"),lightbox.open(template(t)),lightbox._node.find(".fl-builder-confirm-ok").on("click",t.ok),lightbox._node.find(".fl-builder-confirm-cancel").on("click",t.cancel)},triggerHook:function(e,t){y("body").trigger("fl-builder."+e,t)},addHook:function(e,t){y("body").on("fl-builder."+e,t)},removeHook:function(e,t){y("body").off("fl-builder."+e,t)},log:function(e){void 0!==window.console&&void 0!==window.console.log&&console.log(e)},logError:function(e,t){var i=null;void 0!==e&&(void 0!==e.stack?i=e.stack:void 0!==e.message&&(i=e.message),i&&(FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(i),void 0!==t&&t&&(FLBuilder.log("Debug Info"),console.log(t)),y.each(window.crash_vars.vars,function(e,t){console.log(e+": "+t)}),FLBuilder.log("************************************************************************"),void 0!==t&&t&&(i=t+"\n"+i),FLBuilder.crashMessage(i)))},logGlobalError:function(e,t,i,l,o){FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(FLBuilderStrings.globalErrorMessage.replace("{message}",e).replace("{line}",i).replace("{file}",t)),void 0!==o&&void 0!==o.stack&&FLBuilder.log(o.stack),FLBuilder.log("************************************************************************")},_jsonParse:function(t){try{t=JSON.parse(t)}catch(e){FLBuilder.logError(e,FLBuilder._parseError(t))}return t},_parseError:function(e){return e.indexOf("</head>")?"AJAX returned HTML page instead of data. (Possible 404 or max_input_vars)":!!((php=e.match(/^<.*/gm)||!1)&&0<php.length)&&(i="",y.each(php,function(e,t){i+=t}),y(i).text());var i},isUndefined:function(e){return void 0===e},isBoolean:function(e){return!0===e||!1===e},getSandbox:function(e){return e in this._sandbox&&this._sandbox[e]},setSandbox:function(e,t){this._sandbox[e]=t},deleteSandbox:function(e){delete this._sandbox[e]}},y(function(){FLBuilder._init()})}(jQuery),!function(n){(FLBuilderAJAXLayout=function(e,t){this._data=n.extend({},this._defaults,"string"==typeof e?FLBuilder._jsonParse(e):e),this._callback=t,this._post=FLBuilderConfig.postId,this._head=n("head").eq(0),this._body=n("body").eq(0),this._data.css&&("inline"===FLBuilderConfig.enqueueMethod?(this._oldCss=n("#fl-builder-layout-"+this._post+"-inline-css"),this._newCss=n('<style id="fl-builder-layout-'+this._post+'-inline-css" type="text/css">'+this._data.css+"</style>")):(this._loader=n('<img src="'+this._data.css+'" />'),this._oldCss=n('link[href*="/cache/'+this._post+'-layout"]'),this._newCss=n('<link rel="stylesheet" id="fl-builder-layout-'+this._post+'-css" href="'+this._data.css+'" />'))),this._data.partial?(this._data.js&&(this._oldJs=n("#fl-builder-partial-refresh-js"),this._newJs=n('<script type="text/javascript" id="fl-builder-partial-refresh-js">'+this._data.js+"<\/script>")),this._data.nodeId&&(this._data.oldNodeId?(this._oldScriptsStyles=n('.fl-builder-node-scripts-styles[data-node="'+this._data.oldNodeId+'"]'),this._content=n(".fl-node-"+this._data.oldNodeId)):(this._oldScriptsStyles=n('.fl-builder-node-scripts-styles[data-node="'+this._data.nodeId+'"]'),this._content=n(".fl-node-"+this._data.nodeId).eq(0)))):("inline"===FLBuilderConfig.enqueueMethod?(this._oldJs=n("#fl-builder-layout-"+this._post+"-inline-js"),this._newJs=n('<script id="fl-builder-layout-'+this._post+'-inline-js">'+this._data.js+"<\/script>")):(this._oldJs=n('script[src*="/cache/'+this._post+'"]'),this._newJs=n('<script src="'+this._data.js+'"><\/script>')),this._oldScriptsStyles=n(".fl-builder-layout-scripts-styles"),this._content=n(FLBuilder._contentClass)),this._init()}).prototype={_defaults:{partial:!1,nodeId:null,nodeType:null,nodeParent:null,nodePosition:null,oldNodeId:null,html:null,scriptsStyles:null,css:null,js:null},_data:null,_callback:function(){},_post:null,_head:null,_body:null,_loader:null,_oldCss:null,_newCss:null,_oldJs:null,_newJs:null,_oldScriptsStyles:null,_content:null,_init:function(){this._body.height(this._body.height()),this._data.css?"inline"===FLBuilderConfig.enqueueMethod?(this._addNewCSS(),this._finish()):"onload"in document.createElement("link")?(this._newCss.on("load",n.proxy(this._finish,this)),this._addNewCSS()):(this._loader.on("error",n.proxy(this._loadNewCSSFallbackComplete,this)),this._body.append(this._loader)):this._finish()},_loadNewCSSFallbackComplete:function(){this._loader.remove(),this._addNewCSS(),setTimeout(n.proxy(this._finish,this),250)},_addNewCSS:function(){0<this._oldCss.length?this._oldCss.after(this._newCss):this._head.append(this._newCss)},_finish:function(){this._removeOldContentAndAssets(),this._cleanNewHTML(),this._cleanNewAssets(),this._addNewHTML(),this._addNewScriptsStyles(),this._addNewJS(),n(FLBuilder._contentClass).trigger("fl-builder.layout-rendered"),FLBuilder.hideAjaxLoader()},_removeOldContentAndAssets:function(){this._content&&this._content.empty(),this._oldCss&&this._oldCss.remove(),this._oldJs&&this._oldJs.remove(),this._oldScriptsStyles&&this._oldScriptsStyles.remove()},_cleanNewHTML:function(){var e,t,i,l;this._data.scriptsStyles&&(e=n("<div>"+this._data.html+"</div>"),t="fl-row",i=this._data.scriptsStyles,l="",this._data.partial&&(t="column-group"==this._data.nodeType?"fl-col-group":"column"==this._data.nodeType?"fl-col":"fl-"+this._data.nodeType),e.find("> *, script").each(function(){n(this).hasClass(t)||"application/json"==n(this).attr("type")||(l=n(this).remove(),i+=l[0].outerHTML)}),""!==i&&(i=this._data.partial?'<div class="fl-builder-node-scripts-styles" data-node="'+this._data.nodeId+'">'+i+"<div>":'<div class="fl-builder-node-scripts-styles">'+i+"<div>"),this._data.html=e.html(),this._data.scriptsStyles=i)},_addNewHTML:function(){var e;this._data.partial?this._data.nodeParent?(0===(e=(e=this._data.nodeParent.hasClass("fl-builder-content")?this._data.nodeParent.find(" > .fl-row"):this._data.nodeParent.hasClass("fl-row-content")?this._data.nodeParent.find(" > .fl-col-group"):this._data.nodeParent.hasClass("fl-col-group")?this._data.nodeParent.find(" > .fl-col"):this._data.nodeParent.find(" > .fl-col-group, > .fl-module")).filter(":not(.fl-builder-node-clone)")).length||this._data.nodePosition>=e.length?this._data.nodeParent.append(this._data.html):e.eq(this._data.nodePosition).before(this._data.html),this._data.nodeId&&FLBuilder._removeNodeLoadingPlaceholder(n(".fl-node-"+this._data.nodeId))):(this._content.after(this._data.html),this._content.remove()):this._content.append(this._data.html),FLBuilder.preview&&this._data.nodeId&&this._data.nodeId!=FLBuilder.preview.nodeId&&((e=n(FLBuilder.preview.classes.node)).closest(".fl-node-"+this._data.nodeId).length&&e.html(FLBuilder.preview.elements.node.html())),this._data.onAddNewHTML&&this._data.onAddNewHTML()},_cleanNewAssets:function(){var e=this;this._data.html=this._removeDuplicateAssets(this._data.html),this._data.scriptsStyles&&""!==this._data.scriptsStyles&&(this._data.scriptsStyles=this._removeDuplicateAssets(this._data.scriptsStyles)),this._data.partial?n(".fl-builder-node-scripts-styles").each(function(){-1<e._data.html.indexOf("fl-node-"+n(this).data("node"))&&n(this).remove()}):(n("#fl-builder-partial-refresh-js").remove(),n(".fl-builder-node-scripts-styles").remove())},_removeDuplicateAssets:function(e){var e=n("<div>"+e+"</div>"),t="",i="",l=window.location,o=l.protocol+"//"+l.hostname+(l.port?":"+l.port:"");return e.find("script").each(function(){void 0!==(t=n(this).attr("src"))&&(t=t.replace(o,""),0<n('script[src*="'+t+'"]').length&&n(this).remove())}),e.find("link").each(function(){void 0!==(i=n(this).attr("href"))&&(i=i.replace(o,""),0<n('link[href*="'+i+'"]').length&&n(this).remove())}),e.html()},_addNewScriptsStyles:function(){this._data.scriptsStyles&&""!==this._data.scriptsStyles&&this._body.append(this._data.scriptsStyles)},_addNewJS:function(){setTimeout(n.proxy(function(){this._newJs&&this._head.append(this._newJs),FLBuilder.triggerHook("didRenderLayoutJSComplete")},this),50)},_complete:function(){FLBuilder._dragging?(FLBuilder._highlightRowsAndColsForDrag(),FLBuilder._refreshSortables()):(FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._resizeLayout()),FLBuilder._initMediaElements(),FLBuilderLayout.init(),FLBuilderResponsiveEditing.refreshPreview(this._callback),FLBuilder.triggerHook("didRenderLayoutComplete"),this._body.height("auto")}}}(jQuery),!function(h){(FLBuilderPreview=function(e){this.id=(new Date).getTime(),this.type=e.type,this._saveState(),e.layout?FLBuilder._renderLayout(e.layout,function(){this._init(),e.callback&&e.callback()}.bind(this)):this._init()})._fontsList={},FLBuilderPreview.getFormattedSelector=function(e,t){for(var i="",l=t.split(","),o=0;o<l.length;o++)-1<l[o].indexOf("{node}")?i+=l[o].replace("{node}",e):-1<l[o].indexOf("{node_id}")?i+=l[o].replace(/{node_id}/g,this.nodeId):i+=e+" "+l[o],o!=l.length-1&&(i+=", ");return i},FLBuilderPreview.prototype={id:"",type:"",nodeId:null,classes:{},elements:{},state:null,_savedSettings:null,_styleSheet:null,_styleSheetMedium:null,_styleSheetResponsive:null,_timeout:null,_loaderTimeout:null,_lastClassName:null,_xhr:null,_init:function(){switch(this.nodeId=h(".fl-builder-settings").data("node"),this._saveSettings(),this._initElementsAndClasses(),this._createSheets(),this._initResponsivePreviews(),this._initDefaultFieldPreviews(),this.type){case"row":this._initRow();break;case"col":this._initColumn();break;case"module":this._initModule()}FLBuilder.triggerHook("preview-init",this)},_saveSettings:function(){var e=h(".fl-builder-settings-lightbox .fl-builder-settings");this._savedSettings=FLBuilder._getSettingsForChangedCheck(this.nodeId,e)},_settingsHaveChanged:function(){var e=h(".fl-builder-settings-lightbox .fl-builder-settings"),e=FLBuilder._getSettings(e);return JSON.stringify(this._savedSettings)!=JSON.stringify(e)},_initElementsAndClasses:function(){var e="row"==this.type?".fl-row-content-wrap":".fl-"+this.type+"-content";h.extend(this.classes,{settings:".fl-builder-"+this.type+"-settings",settingsHeader:".fl-builder-"+this.type+"-settings .fl-lightbox-header",node:FLBuilder._contentClass+" .fl-node-"+this.nodeId,content:FLBuilder._contentClass+" .fl-node-"+this.nodeId+" > "+e}),h.extend(this.elements,{settings:h(this.classes.settings),settingsHeader:h(this.classes.settingsHeader),node:h(this.classes.node),content:h(this.classes.content)})},_createSheets:function(){this._destroySheets(),this._styleSheet||(this._styleSheet=new FLStyleSheet({id:"fl-builder-preview",className:"fl-builder-preview-style"})),this._styleSheetMedium||(this._styleSheetMedium=new FLStyleSheet({id:"fl-builder-preview-medium",className:"fl-builder-preview-style"}),this._styleSheetMedium.disable()),this._styleSheetResponsive||(this._styleSheetResponsive=new FLStyleSheet({id:"fl-builder-preview-responsive",className:"fl-builder-preview-style"}),this._styleSheetResponsive.disable())},_destroySheets:function(){this._styleSheet&&(this._styleSheet.destroy(),this._styleSheet=null),this._styleSheetMedium&&(this._styleSheetMedium.destroy(),this._styleSheetMedium=null),this._styleSheetResponsive&&(this._styleSheetResponsive.destroy(),this._styleSheetResponsive=null)},_disableStyles:function(){var e=FLBuilderResponsiveEditing._mode,t=FLBuilderConfig.global,i=this.elements.node;"responsive"===e?(FLBuilderSimulateMediaQuery.disableStyles(t.responsive_breakpoint),this._styleSheetResponsive.disable()):"medium"===e?(FLBuilderSimulateMediaQuery.disableStyles(t.medium_breakpoint),this._styleSheetMedium.disable()):i.removeClass(function(e,t){return(t.match(/fl-node-[^\s]*/g)||[]).join(" ")})},_enableStyles:function(){var e=FLBuilderResponsiveEditing._mode,t=this.elements.node;"responsive"===e?(FLBuilderSimulateMediaQuery.enableStyles(),this._styleSheetResponsive.enable()):"medium"===e?(FLBuilderSimulateMediaQuery.enableStyles(),this._styleSheetMedium.enable()):t.addClass("fl-node-"+t.data("node"))},_getDefaultValue:function(e,t){var i="",e=h(e),l=e.closest("[data-node]");return"width"===t?i="auto":-1===h.inArray(t,["line-height","font-weight"])&&l.length&&(this._disableStyles(),i=e.css(t),this._enableStyles()),i},updateCSSRule:function(e,t,i,l){var o=FLBuilderResponsiveEditing._mode,n="";""!==i&&"null"!==i||(i=this._getDefaultValue(e,t)),l?(n="string"==typeof l?this.toUpperCaseWords(l):"default"===o?"":this.toUpperCaseWords(o),this["_styleSheet"+n].updateRule(e,t,i)):this._styleSheet.updateRule(e,t,i)},delay:function(e,t){this._cancelDelay(),this._timeout=setTimeout(t,e)},_cancelDelay:function(){null!==this._timeout&&clearTimeout(this._timeout)},hexToRgb:function(e){e=parseInt(e,16);return[e>>16&255,e>>8&255,255&e]},hexOrRgb:function(e){return e=e.indexOf("rgb")<0&&e.indexOf("#")<0?"#"+e:e},parseFloat:function(e){return isNaN(parseFloat(e))?0:parseFloat(e)},_initResponsivePreviews:function(){var e=".preview-"+this.id;FLBuilder.addHook("responsive-editing-switched"+e,h.proxy(this._responsiveEditingSwitched,this)),FLBuilder.addHook("responsive-editing-before-preview-fields"+e,h.proxy(this._responsiveEditingPreviewFields,this))},_destroyResponsivePreviews:function(){var e=".preview-"+this.id;FLBuilder.removeHook("responsive-editing-switched"+e),FLBuilder.removeHook("responsive-editing-before-preview-fields"+e)},_responsiveEditingSwitched:function(e,t){"default"==t?(this._styleSheetMedium.disable(),this._styleSheetResponsive.disable()):"medium"==t?(this._styleSheetMedium.enable(),this._styleSheetResponsive.disable()):"responsive"==t&&(this._styleSheetMedium.enable(),this._styleSheetResponsive.enable())},_responsiveEditingPreviewFields:function(e,t){"medium"===t&&"col"===this.type&&this.elements.node[0].style.width&&(size=parseFloat(this.elements.node[0].style.width),this.elements.size.val(size))},updateResponsiveCSSRule:function(e,t,i){this.updateCSSRule(e,t,i,!0)},_saveState:function(){var e=FLBuilderConfig.postId,t=h('link[href*="/cache/'+e+'"]').attr("href"),e=h('script[src*="/cache/'+e+'"]').attr("src"),i=h(FLBuilder._contentClass).html();this.state={css:t,js:e,html:i}},preview:function(){var e=h(".fl-builder-settings-lightbox .fl-builder-settings"),t=e.attr("data-node"),e=FLBuilder._getSettings(e);if(FLBuilder._showNodeLoading(t),this._cancelPreview(),"error"===(e=FLBuilder._inputVarsCheck(e)))return 0;this._xhr=FLBuilder.ajax({action:"render_layout",node_id:t,node_preview:e},h.proxy(this._renderPreview,this))},delayPreview:function(e){var t=void 0===e?[]:h(e.target).closest("tr").find("th"),i=h(".fl-builder-widget-settings .fl-builder-settings-title"),l=h(".fl-builder-settings .fl-lightbox-header"),e=FLBuilderLayoutConfig.paths.pluginUrl+"img/ajax-loader-small.svg",o=h('<img class="fl-builder-preview-loader" src="'+e+'" />');this.delay(1e3,h.proxy(this.preview,this)),this._loaderTimeout=setTimeout(function(){h(".fl-builder-preview-loader").remove(),0<t.length?t.append(o):0<i.length?i.append(o):0<l.length&&l.append(o)},1500)},_cancelPreview:function(){this._xhr&&(this._xhr.abort(),this._xhr=null)},_renderPreview:function(e){this._xhr=null,FLBuilder._renderLayout(e,h.proxy(this._renderPreviewComplete,this))},_renderPreviewComplete:function(){this._createSheets(),this._initElementsAndClasses(),this._initDefaultFieldPreviews(),null!==this._loaderTimeout&&clearTimeout(this._loaderTimeout),h(".fl-builder-preview-loader").remove(),h(FLBuilder._contentClass).trigger("fl-builder.preview-rendered")},revert:function(){var e=this.nodeId;this._settingsHaveChanged()?("col"===this.type&&(e=this.elements.node.closest(".fl-col-group").data("node")),FLBuilder._updateNode(e,function(){this.clear()}.bind(this))):this.clear()},cancel:function(){this._cancelDelay(),this._cancelPreview()},clear:function(){this.cancel(),this._destroySheets(),this._destroyResponsivePreviews()},_initNodeTextColor:function(){h.extend(this.elements,{textColor:h(this.classes.settings+" input[name=text_color]"),linkColor:h(this.classes.settings+" input[name=link_color]"),hoverColor:h(this.classes.settings+" input[name=hover_color]"),headingColor:h(this.classes.settings+" input[name=heading_color]")}),this.elements.textColor.on("change",h.proxy(this._textColorChange,this)),this.elements.linkColor.on("change",h.proxy(this._textColorChange,this)),this.elements.hoverColor.on("change",h.proxy(this._textColorChange,this)),this.elements.headingColor.on("change",h.proxy(this._textColorChange,this))},_textColorChange:function(e){var t=this.elements.textColor.val(),i=this.elements.linkColor.val(),l=this.elements.hoverColor.val(),o=this.elements.headingColor.val(),i=""===i?t:i,l=""===l?t:l,o=""===o?t:o;t&&t.indexOf("rgb")<0&&(t="#"+t),i&&i.indexOf("rgb")<0&&(i="#"+i),l&&l.indexOf("rgb")<0&&(l="#"+l),o&&o.indexOf("rgb")<0&&(o="#"+o),this.delay(50,h.proxy(function(){""===t?this.updateCSSRule(this.classes.node,"color",""):this.updateCSSRule(this.classes.node,"color",t),""===i?this.updateCSSRule(this.classes.node+" a","color",""):this.updateCSSRule(this.classes.node+" a","color",i),""===l?this.updateCSSRule(this.classes.node+" a:hover","color",""):this.updateCSSRule(this.classes.node+" a:hover","color",l),""===o?(this.updateCSSRule(this.classes.node+" h1","color",""),this.updateCSSRule(this.classes.node+" h2","color",""),this.updateCSSRule(this.classes.node+" h3","color",""),this.updateCSSRule(this.classes.node+" h4","color",""),this.updateCSSRule(this.classes.node+" h5","color",""),this.updateCSSRule(this.classes.node+" h6","color",""),this.updateCSSRule(this.classes.node+" h1 a","color",""),this.updateCSSRule(this.classes.node+" h2 a","color",""),this.updateCSSRule(this.classes.node+" h3 a","color",""),this.updateCSSRule(this.classes.node+" h4 a","color",""),this.updateCSSRule(this.classes.node+" h5 a","color",""),this.updateCSSRule(this.classes.node+" h6 a","color","")):(this.updateCSSRule(this.classes.node+" h1","color",o),this.updateCSSRule(this.classes.node+" h2","color",o),this.updateCSSRule(this.classes.node+" h3","color",o),this.updateCSSRule(this.classes.node+" h4","color",o),this.updateCSSRule(this.classes.node+" h5","color",o),this.updateCSSRule(this.classes.node+" h6","color",o),this.updateCSSRule(this.classes.node+" h1 a","color",o),this.updateCSSRule(this.classes.node+" h2 a","color",o),this.updateCSSRule(this.classes.node+" h3 a","color",o),this.updateCSSRule(this.classes.node+" h4 a","color",o),this.updateCSSRule(this.classes.node+" h5 a","color",o),this.updateCSSRule(this.classes.node+" h6 a","color",o))},this))},_initNodeBg:function(){h.extend(this.elements,{bgType:h(this.classes.settings+" select[name=bg_type]"),bgColor:h(this.classes.settings+" input[name=bg_color]"),bgColorPicker:h(this.classes.settings+" .fl-picker-bg_color"),bgGradientType:h(this.classes.settings+" select.fl-gradient-picker-type-select"),bgVideoSource:h(this.classes.settings+" select[name=bg_video_source]"),bgVideo:h(this.classes.settings+" input[name=bg_video]"),bgVideoServiceUrl:h(this.classes.settings+" input[name=bg_video_service_url]"),bgVideoFallbackSrc:h(this.classes.settings+" select[name=bg_video_fallback_src]"),bgSlideshowSource:h(this.classes.settings+" select[name=ss_source]"),bgSlideshowPhotos:h(this.classes.settings+" input[name=ss_photos]"),bgSlideshowFeedUrl:h(this.classes.settings+" input[name=ss_feed_url]"),bgSlideshowSpeed:h(this.classes.settings+" input[name=ss_speed]"),bgSlideshowTrans:h(this.classes.settings+" select[name=ss_transition]"),bgSlideshowTransSpeed:h(this.classes.settings+" input[name=ss_transitionDuration]"),bgParallaxImageSrc:h(this.classes.settings+" select[name=bg_parallax_image_src]"),bgOverlayType:h(this.classes.settings+" select[name=bg_overlay_type]"),bgOverlayColor:h(this.classes.settings+" input[name=bg_overlay_color]"),bgOverlayGradient:h(this.classes.settings+" #fl-field-bg_overlay_gradient select")}),this.elements.bgType.on("change",h.proxy(this._bgTypeChange,this)),this.elements.bgColor.on("change",h.proxy(this._bgColorChange,this)),this.elements.bgVideoServiceUrl.on("change",h.proxy(this._bgVideoChange,this)),this.elements.bgSlideshowSource.on("change",h.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowPhotos.on("change",h.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowFeedUrl.on("keyup",h.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowSpeed.on("keyup",h.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTrans.on("change",h.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTransSpeed.on("keyup",h.proxy(this._bgSlideshowChange,this)),this.elements.bgParallaxImageSrc.on("change",h.proxy(this._bgParallaxChange,this)),this.elements.bgOverlayType.on("change",h.proxy(this._bgOverlayChange,this)),this.elements.bgOverlayColor.on("change",h.proxy(this._bgOverlayChange,this))},_bgTypeChange:function(e){var t=this.elements.bgType.val(),i=FLBuilderResponsiveEditing._mode;this.elements.node.removeClass("fl-row-bg-video"),this.elements.node.removeClass("fl-row-bg-slideshow"),this.elements.node.removeClass("fl-row-bg-parallax"),this.elements.node.find(".fl-bg-video").remove(),this.elements.node.find(".fl-bg-slideshow").remove(),this.elements.content.css("background-image",""),this.updateCSSRule(this.classes.content,"background-color","transparent"),this.updateCSSRule(this.classes.content,"background-image","none"),this.updateCSSRule(this.classes.content,"background-image","none","medium"),this.updateCSSRule(this.classes.content,"background-image","none","responsive"),"none"==t?this._bgOverlayClear():"color"==t?(this.elements.bgColor.trigger("change"),this._bgOverlayClear()):"gradient"==t?(this.elements.bgGradientType.trigger("change"),this._bgOverlayClear()):"photo"==t?(this.elements.bgColor.trigger("change"),this.elements.settings.find('[data-device="'+i+'"] select[name*="bg_"]').trigger("change")):"video"==t?(this.elements.bgColor.trigger("change"),this._bgVideoChange()):"slideshow"==t?(this.elements.bgColor.trigger("change"),this._bgSlideshowChange()):"parallax"==t&&(this.elements.bgColor.trigger("change"),this.elements.bgParallaxImageSrc.trigger("change"))},_bgColorChange:function(e){var t;""===this.elements.bgColor.val()?this.updateCSSRule(this.classes.content,"background-color","transparent"):(t=this.hexOrRgb(this.elements.bgColor.val()),this.delay(100,h.proxy(function(){this.updateCSSRule(this.classes.content,"background-color",t)},this)))},_bgVideoChange:function(e){var t=this.elements,i=t.bgVideoSource.val(),l=t.bgVideo.val(),t=t.bgVideoServiceUrl.val(),o=h("<script>");"video_service"==i&&""!=t?(/^(?:(?:(?:https?:)?\/\/)?(?:www.)?(?:youtu(?:be.com|.be))\/(?:watch\?v\=|v\/|embed\/)?([\w\-]+))/i.test(t)&&h('script[src*="youtube.com"').length<1?o.attr("src","https://www.youtube.com/iframe_api"):/^(http\:\/\/|https\:\/\/)?(www\.)?(vimeo\.com\/)([0-9]+)$/.test(t)&&h('script[src*="vimeo.com"').length<1&&o.attr("src","https://player.vimeo.com/api/player.js"),o.attr("type","text/javascript").appendTo("head"),this.delay(500,h.proxy(this.preview,this))):""!=l&&this.preview()},_bgSlideshowChange:function(e){var t=this.elements,i=t.bgSlideshowSource.val(),l=t.bgSlideshowPhotos.val(),o=t.bgSlideshowFeedUrl.val(),n=t.bgSlideshowSpeed.val(),t=t.bgSlideshowTransSpeed.val();"wordpress"==i&&""===l||"smugmug"==i&&""===o||isNaN(parseInt(n))||isNaN(parseInt(t))||this.delay(500,h.proxy(this.preview,this))},_bgParallaxChange:function(e){this.elements.bgParallaxImageSrc.val()&&this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgParallaxImageSrc.val()+")","background-repeat":"no-repeat","background-position":"center center","background-attachment":"fixed","background-size":"cover"})},_bgOverlayChange:function(e){var t,i=this.elements.bgOverlayType.val(),l=this.elements.bgOverlayColor.val();"color"===i?(""===l?(this.elements.node.removeClass("fl-row-bg-overlay"),this.elements.node.removeClass("fl-col-bg-overlay"),this.updateCSSRule(this.classes.content+"::after","background-color","transparent")):(t=this.hexOrRgb(this.elements.bgOverlayColor.val()),this.delay(100,h.proxy(function(){this._bgOverlayAddClasses(),this.updateCSSRule(this.classes.content+"::after","background-color",t)},this))),this.updateCSSRule(this.classes.content+"::after","background-image","none")):"gradient"===i?(this._bgOverlayAddClasses(),this.updateCSSRule(this.classes.content+"::after","background-color","transparent"),this.elements.bgOverlayGradient.trigger("change")):(this.elements.node.removeClass("fl-row-bg-overlay"),this.elements.node.removeClass("fl-col-bg-overlay"),this.updateCSSRule(this.classes.content+"::after","background-color","transparent"),this.updateCSSRule(this.classes.content+"::after","background-image","none"))},_bgOverlayAddClasses:function(){this.elements.node.hasClass("fl-col")?this.elements.node.addClass("fl-col-bg-overlay"):this.elements.node.addClass("fl-row-bg-overlay")},_bgOverlayClear:function(e){this.elements.bgOverlayColor.prev(".fl-color-picker-clear").trigger("click"),this.elements.bgOverlayType.val("color").trigger("change")},_initNodeClassName:function(){h.extend(this.elements,{className:h(this.classes.settings+" input[name=class]")}),this.elements.className.on("keyup",h.proxy(this._classNameChange,this)),this._lastClassName=this.elements.className.val()},_classNameChange:function(e){var t=this.elements.className.val();null!==this._lastClassName&&this.elements.node.removeClass(this._lastClassName),this.elements.node.addClass(t),this._lastClassName=t},_initNodeDimensions:function(e){for(var t,i={},l=["Top","Bottom","Left","Right"],o=["","Medium","Responsive"],n=this.classes.settings,s="",r=null,a=null,r=0;r<l.length;r++)for(a=0;a<o.length;a++)t=e+l[r]+o[a],s=e+"_"+l[r].toLowerCase(),""!=o[a]&&(s+="_"+o[a].toLowerCase()),i[t]=h(n+" input[name="+s+"]");h.extend(this.elements,i)},_initRow:function(){h.extend(this.elements,{width:h(this.classes.settings+" select[name=width]"),contentWidth:h(this.classes.settings+" select[name=content_width]"),maxContentWidth:h(this.classes.settings+" input[name=max_content_width]"),maxContentWidthUnit:h(this.classes.settings+" select[name=max_content_width_unit]"),height:h(this.classes.settings+" select[name=full_height]"),minHeight:h(this.classes.settings+" input[name=min_height]"),align:h(this.classes.settings+" select[name=content_alignment]")}),this.elements.width.on("change",h.proxy(this._rowWidthChange,this)),this.elements.contentWidth.on("change",h.proxy(this._rowContentWidthChange,this)),this.elements.maxContentWidth.on("input",h.proxy(this._rowMaxContentWidthChange,this)),this.elements.maxContentWidthUnit.on("change",h.proxy(this._rowMaxContentWidthChange,this)),this.elements.height.on("change",h.proxy(this._rowHeightChange,this)),this.elements.align.on("change",h.proxy(this._rowHeightChange,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeDimensions("border"),this._initNodeDimensions("margin"),this._initNodeDimensions("padding")},_rowWidthChange:function(e){FLBuilderConfig.global;var t=this.elements.node,i=this.elements.content.find(".fl-row-content");this.elements.maxContentWidth.val(),this.elements.maxContentWidthUnit.val();t.css("max-width","none"),i.css("max-width","none"),"full"==this.elements.width.val()?(t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width")),this._rowMaxContentWidthChange()},_rowContentWidthChange:function(e){FLBuilderConfig.global;var t=this.elements.node,i=this.elements.content.find(".fl-row-content");this.elements.maxContentWidth.val(),this.elements.maxContentWidthUnit.val();t.css("max-width","none"),i.css("max-width","none"),"full"==this.elements.contentWidth.val()?(i.removeClass("fl-row-fixed-width"),i.addClass("fl-row-full-width")):(i.removeClass("fl-row-full-width"),i.addClass("fl-row-fixed-width"),this._rowMaxContentWidthChange())},_rowMaxContentWidthChange:function(e){var t=FLBuilderConfig.global,i=this.elements.node,l=this.elements.content.find(".fl-row-content"),o=this.elements.maxContentWidth.val(),n=this.elements.maxContentWidthUnit.val();""==o?o=t.row_width+t.row_width_unit:o+=n,"fixed"===this.elements.width.val()&&i.css("max-width",o),l.css("max-width",o)},_rowHeightChange:function(e){var t=this.elements.node;this.elements.content;t.removeClass("fl-row-align-top"),t.removeClass("fl-row-align-center"),t.removeClass("fl-row-align-bottom"),t.removeClass("fl-row-full-height"),t.removeClass("fl-row-custom-height"),"full"==this.elements.height.val()?(t.addClass("fl-row-full-height"),t.addClass("fl-row-align-"+this.elements.align.val()),this.elements.minHeight.val("").trigger("input")):"custom"==this.elements.height.val()?(t.addClass("fl-row-custom-height"),t.addClass("fl-row-align-"+this.elements.align.val()),this.elements.minHeight.trigger("input")):this.elements.minHeight.val("").trigger("input")},_initColumn:function(){h.extend(this.elements,{size:h(this.classes.settings+" input[name=size]"),sizeMedium:h(this.classes.settings+" input[name=size_medium]"),sizeResponsive:h(this.classes.settings+" input[name=size_responsive]"),columnHeight:h(this.classes.settings+" select[name=equal_height]"),columnAlign:h(this.classes.settings+" select[name=content_alignment]"),responsiveOrder:h(this.classes.settings+" select[name=responsive_order]")}),this.elements.size.on("input",h.proxy(this._colSizeChange,this)),this.elements.sizeMedium.on("input",h.proxy(this._colSizeChange,this)),this.elements.sizeResponsive.on("input",h.proxy(this._colSizeChange,this)),this.elements.columnHeight.on("change",h.proxy(this._colHeightChange,this)),this.elements.columnAlign.on("change",h.proxy(this._colHeightChange,this)),this.elements.responsiveOrder.on("change",h.proxy(this._colResponsiveOrder,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeDimensions("border"),this._initNodeDimensions("margin"),this._initNodeDimensions("padding")},_colSizeChange:function(e){var e=h(e.target),t=92,i=parseFloat(e.val()),l=this.elements.node.closest(".fl-col-group"),o=this.elements.node.prev(".fl-col"),n=this.elements.node.next(".fl-col"),s=0===n.length?o:n,o=this.elements.node.siblings(".fl-col"),r=0,n=FLBuilderResponsiveEditing._mode;0!==o.length&&(isNaN(i)&&("medium"===n?i=this.elements.size.val():"responsive"===n&&(i=this.elements.sizeMedium.val()?this.elements.sizeMedium.val():"auto"),"auto"!==i&&isNaN(i)&&(i=8)),"default"===n?(o.each(function(){h(this).data("node")!=s.data("node")&&(t-=parseFloat(h(this)[0].style.width),r+=parseFloat(h(this)[0].style.width))}),t<(i=i<8?8:i)&&(i=t),this.elements.node.css("width",i+"%"),s.css("width",100-r-i+"%")):(100<i&&e.val(i=100),this.updateCSSRule(this.classes.node,{"max-width":("auto"===i?100:i)+"% !important",width:("auto"===i?i:i+"%")+" !important"},void 0,!0),"responsive"===n&&(e.val()?(this.updateCSSRule(this.classes.node,"float",FLBuilderConfig.isRtl?"right":"left",!0),this.updateCSSRule(this.classes.node,"clear","none",!0)):(this.updateCSSRule(this.classes.node,"float","none",!0),this.updateCSSRule(this.classes.node,"clear","both",!0)),e.val()||this._colsHaveCustomResponsiveWidth(o)?l.addClass("fl-col-group-custom-width"):l.removeClass("fl-col-group-custom-width"))))},_colsHaveCustomResponsiveWidth:function(e){var t=FLBuilderSettingsConfig.nodes,i=!1;return e.each(function(){var e=h(this).data("node");t[e]&&t[e].size_responsive&&(i=!0)}),i},_colHeightChange:function(){var e=this.elements.node.parent(".fl-col-group");e.removeClass("fl-col-group-align-top"),e.removeClass("fl-col-group-align-center"),e.removeClass("fl-col-group-align-bottom"),"yes"==this.elements.columnHeight.val()?(e.addClass("fl-col-group-equal-height"),e.addClass("fl-col-group-align-"+this.elements.columnAlign.val())):e.removeClass("fl-col-group-equal-height")},_colResponsiveOrder:function(){var e=this.elements.node.parent(".fl-col-group");"reversed"==this.elements.responsiveOrder.val()?e.addClass("fl-col-group-responsive-reversed"):e.removeClass("fl-col-group-responsive-reversed")},_initModule:function(){this._initNodeClassName(),this._initNodeDimensions("margin")},_initDefaultFieldPreviews:function(e){var t,i,e=FLBuilder.isUndefined(e)?this.elements.settings.find(".fl-field"):e,l=null,o=0;if(FLBuilderConfig.safemode)return!1;for(;o<e.length;o++)t=(l=e.eq(o)).data("type"),"refresh"==(i=l.data("preview")).type&&this._initFieldRefreshPreview(l),"text"==i.type&&this._initFieldTextPreview(l),"css"==i.type&&this._initFieldCSSPreview(l),"widget"==i.type&&this._initFieldWidgetPreview(l),"font"==i.type&&this._initFieldFontPreview(l),"attribute"==i.type&&this._initFieldAttributePreview(l),"animation"==i.type&&this._initFieldAnimationPreview(i,l),"callback"==i.type&&this._initFieldCallbackPreview(i,l,t,e),this._initFieldUnitSelect(l)},_initFieldCallbackPreview:function(e,t,i,l){var o,n=e.callback,s=h(".fl-builder-settings:visible"),r=s.data("node"),a=h(".fl-builder-content .fl-node-"+r);if(void 0!==FLBuilderPreviewCallbacks[n]?o=FLBuilderPreviewCallbacks[n]:void 0!==window[n]&&(o=window[n]),"function"==typeof o){var d={field:t,fields:l,type:i,preview:e,form:s,nodeID:r,node:a};switch(i){case"align":case"button-group":case"text":case"multiple-photos":case"video":case"icon":case"ordering":d.input=t.find("input"),d.getValue=function(){return d.input.val()};break;case"color":d.input=t.find("input.fl-color-picker-value"),d.getValues=function(){var e=d.input.val();FLBuilderPreview.formatColor(e)};break;case"textarea":case"code":d.textarea=t.find("textarea"),d.getValue=function(){return d.textarea.val()};break;case"select":case"photo-sizes":case"post-type":d.select=t.find("select"),d.getValue=function(){return d.select.val()};break;case"photo":d.input=t.find("input[type=hidden]"),d.sizeSelect=t.find("select"),d.getValues=function(){return{value:d.input.val(),size:d.sizeSelect.val()}};break;case"unit":d.input=t.find("input[type=number]"),d.unitSelect=t.find(".fl-field-unit-select"),d.getValues=function(){var e=d.input.val(),t=d.unitSelect.val();return{value:e,unit:t,formattedValue:e+t}};break;case"dimension":d.inputs=t.find("input[type=number]"),d.unitSelect=t.find(".fl-field-unit-select"),d.getValues=function(){var l={inputs:[],props:{},unit:d.unitSelect.val()};return d.inputs.each(function(e,t){var i=(t=h(t)).val(),t=t.data("unit");l.inputs.push(i),l.props[t]=i}),l};break;case"animation":d.input=t.find("input"),d.select=t.find("select"),d.getValues=function(){return{delay:d.input.val(),style:d.select.val()}};break;case"link":d.input=t.find(".fl-link-field-input-wrap input"),d.targetInput=t.find("input[name$=_target]"),d.noFollowInput=t.find("input[name$=_nofollow]"),d.getValues=function(){return{url:d.input.val(),target:d.targetInput.val(),noFollow:d.noFollowInput.val()}};break;case"shadow":d.colorInput=t.find("input.fl-color-picker-value"),d.inputs=t.find("input[type=number]"),d.getValues=function(){d.colorInput.val(),d.inputs[0].val(),d.inputs[1].val(),d.inputs[2].val(),d.inputs[3].val()};break;case"gradient":d.inputs=t.find("input"),d.select=t.find("select"),d.gradientInputs={},d.gradientInputs.type=t.find('select[name$="[type]"]'),d.gradientInputs.angle=t.find('input[name$="[angle]"]'),d.gradientInputs.position=t.find('select[name$="[position]"]'),d.gradientInputs.stops=[],t.find(".fl-gradient-picker-colors .fl-gradient-picker-color-row").each(function(e,t){t=h(t),d.gradientInputs.stops.push({color:t.find(".fl-gradient-picker-color input"),stop:t.find(".fl-gradient-picker-stop input")})}),d.getValues=function(){var e,t={type:d.gradientInputs.type.val(),angle:d.gradientInputs.angle.val(),position:d.gradientInputs.position.val(),stops:[]};for(e in d.gradientInputs.stops){var i=d.gradientInputs.stops[e];t.stops[e]={color:i.color.val(),stop:i.stop.val()}}return t};break;case"shape-transform":d.inputs=t.find("input"),d.getValues=function(){return{scaleXSign:d.inputs.eq(0).val(),scaleYSign:d.inputs.eq(1).val(),skewX:d.inputs.eq(2).val(),skewY:d.inputs.eq(3).val(),scaleX:d.inputs.eq(4).val(),rotate:d.inputs.eq(5).val(),scaleY:d.inputs.eq(6).val()}};break;default:d.input=t.find("input"),d.getValue=function(){return d.input.val()}}var u,n=t.find(".fl-field-responsive-toggle"),c=(d.responsiveToggle=!!n.length&&n,o=o.bind(this,d),{input:"change keyup input",inputs:"change keyup input",targetInput:"change keyup input",noFollowInput:"change keyup input",colorInput:"change input",textarea:"change keyup input",select:"change",sizeSelect:"change",unitSelect:"change"});for(u in c)void 0!==d[u]&&d[u].on(c[u],o)}},_initFieldRefreshPreview:function(e){var t=e.data("type"),i=e.data("preview"),l=h.proxy(this.delayPreview,this);switch(t){case"align":e.find("input").on("change",l);break;case"text":e.find("input[type=text]").on("keyup",l);break;case"textarea":e.find("textarea").on("keyup",l);break;case"select":e.find("select").on("change",l);break;case"color":e.find(".fl-color-picker-value").on("change",l);break;case"photo":e.find("select").on("change",l);break;case"multiple-photos":e.find("input").on("change",l);break;case"photo-sizes":e.find("select").on("change",l);break;case"video":case"multiple-audios":case"icon":e.find("input").on("change",l);break;case"form":e.on("change","input",l);break;case"editor":this._addTextEditorCallback(e,i);break;case"code":e.find("textarea").on("change",l);break;case"post-type":e.find("select").on("change",l);break;case"suggest":e.find(".as-values").on("change",l),e.find("select").on("change",l);break;case"unit":case"dimension":e.find("input[type=number]").on("input",l);break;case"ordering":e.find("input[type=hidden]").on("change",l);break;default:e.on("change",l)}},_initFieldTextPreview:function(e){var t=e.data("type"),i=e.data("preview"),l=h.proxy(this._previewText,this,i);switch(t){case"text":e.find("input[type=text]").on("keyup",l);break;case"unit":e.find("input[type=number]").on("keyup",l);break;case"textarea":e.find("textarea").on("keyup",l);break;case"code":e.find("textarea").on("change",l);break;case"editor":this._addTextEditorCallback(e,i)}},_previewText:function(e,t){var e=this._getPreviewSelector(this.classes.node,e.selector),e=h(e),i=h("<div>"+h(t.target).val()+"</div>");0<e.length?(i.find("script").remove(),e.html(i.html())):this.delayPreview(t)},_previewTextEditor:function(e,t,i){var e=this._getPreviewSelector(this.classes.node,e.selector),e=h(e),l="undefined"!=typeof tinyMCE?tinyMCE.get(t):null,t=h("#"+t),o="";0<e.length&&((o=l&&"none"==t.css("display")?h("<div>"+l.getContent()+"</div>"):"undefined"==typeof switchEditors||void 0===switchEditors.wpautop?h("<div>"+t.val()+"</div>"):h("<div>"+switchEditors.wpautop(t.val())+"</div>")).find("script").remove(),e.html(o.html()))},_addTextEditorCallback:function(e,t){var e=e.find("textarea.wp-editor-area").attr("id"),i=null;if("refresh"==t.type)i=h.proxy(this.delayPreview,this);else{if("text"!=t.type)return;i=h.proxy(this._previewTextEditor,this,t,e)}h("#"+e).on("keyup",i),"undefined"!=typeof tinyMCE&&((editor=tinyMCE.get(e)).on("change",i),editor.on("keyup",i))},_initFieldFontPreview:function(e){var t=e.data("type"),i=e.data("preview"),i=(i.id=e.attr("id"),h.proxy(this._previewFont,this,i));"font"==t&&e.find(".fl-font-field").on("change","select",i)},_previewFont:function(e,t){var t=h(t.delegateTarget),i=t.find(".fl-font-field-font"),l=h(i).find(":selected").parent().attr("label"),t=t.find(".fl-font-field-weight"),o=e.id+"-"+this.nodeId,n=this._getPreviewSelector(this.classes.node,e.selector),e=e.important?" !important":"",s="";"Google"!=l&&"Recently Used"!=l||this._buildFontStylesheet(o,i.val(),t.val()),s=i.val(),new RegExp("[0-9]").test(i.val())&&(s='"'+i.val()+'"'),this.updateCSSRule(n,"font-family","Default"===i.val()?"":s+e),this.updateCSSRule(n,"font-weight","default"===t.val()?"":t.val()+e)},_buildFontStylesheet:function(e,t,i){var l=FLBuilderConfig.googleFontsUrl,o="",n={},s={};n[t]=[i],FLBuilderPreview._fontsList[e]=n,Object.keys(FLBuilderPreview._fontsList).forEach(function(e){var i=FLBuilderPreview._fontsList[e];Object.keys(i).forEach(function(t){var e=i[t];s[t]=s[t]||[],e=e.filter(function(e){return s[t].indexOf(e)<0}),s[t]=s[t].concat(e)})}),h.each(s,function(e,t){o+="Molle"===e?e+":i|":e+":"+t.join()+"|"}),o=l+o.slice(0,-1).replace(" ","+"),h("#fl-builder-google-fonts-preview").length<1?h("<link>").attr("id","fl-builder-google-fonts-preview").attr("type","text/css").attr("rel","stylesheet").attr("href",o).appendTo("head"):h("#fl-builder-google-fonts-preview").attr("href",o)},_initFieldCSSPreview:function(e){var t=e.data("preview"),i=null;if(void 0!==t.rules)for(i in t.rules)this._initFieldCSSPreviewCallback(e,t.rules[i]);else this._initFieldCSSPreviewCallback(e,t)},_initFieldCSSPreviewCallback:function(e,t){switch(e.data("type")){case"align":e.find("input").on("change",h.proxy(this._previewCSS,this,t,e));break;case"border":e.find("select").on("change",h.proxy(this._previewBorderCSS,this,t,e)),e.find("input[type=number]").on("input",h.proxy(this._previewBorderCSS,this,t,e)),e.find("input[type=hidden]").on("change",h.proxy(this._previewBorderCSS,this,t,e));break;case"color":e.find(".fl-color-picker-value").on("change",h.proxy(this._previewColorCSS,this,t,e));break;case"dimension":e.find("input[type=number]").on("input",h.proxy(this._previewDimensionCSS,this,t,e));break;case"gradient":e.find("select").on("change",h.proxy(this._previewGradientCSS,this,t,e)),e.find(".fl-gradient-picker-angle").on("input",h.proxy(this._previewGradientCSS,this,t,e)),e.find(".fl-color-picker-value").on("change",h.proxy(this._previewGradientCSS,this,t,e)),e.find(".fl-gradient-picker-stop").on("input",h.proxy(this._previewGradientCSS,this,t,e));break;case"photo":case"select":e.find("select").on("change",h.proxy(this._previewCSS,this,t,e));break;case"shadow":e.find("input").on("input",h.proxy(this._previewShadowCSS,this,t,e)),e.find(".fl-color-picker-value").on("change",h.proxy(this._previewShadowCSS,this,t,e));break;case"text":e.find("input[type=text]").on("keyup",h.proxy(this._previewCSS,this,t,e));break;case"typography":e.find("select").on("change",h.proxy(this._previewTypographyCSS,this,t,e)),e.find("input[type=number]").on("input",h.proxy(this._previewTypographyCSS,this,t,e)),e.find("input[type=hidden]").on("change",h.proxy(this._previewTypographyCSS,this,t,e));break;case"unit":e.find("input[type=number]").on("input",h.proxy(this._previewCSS,this,t,e))}},_previewCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=e.property,t=this._getPreviewCSSUnit(e,t,i),i=h(i.target),n=i.val(),i=!!i.closest(".fl-field-responsive-setting").length,e=e.important&&""!==n?" !important":"";-1<o.indexOf("image")&&n?n="url("+n+")":"%"===t&&"opacity"===o?n=parseInt(n)/100:""!==n&&(n+=t),this.updateCSSRule(l,o,n+e,i)},_previewBorderCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=h(i.target),t=o.closest(".fl-field"),n=o.closest(".fl-compound-field-setting"),s=n.data("property"),r=o.val(),o=(n.find(".fl-field-unit-select"),!!o.closest(".fl-field-responsive-setting").length),a=e.important&&""!==r?" !important":"";"border-color"===(e.property=s)?this._previewColorCSS(e,t,i):"border-width"===s||"border-radius"===s?this._previewDimensionCSS(e,t,i):"box-shadow"===s?this._previewShadowCSS(e,n,i):("border-style"===s&&t.find(".fl-border-field-width input:visible").trigger("input"),this.updateCSSRule(l,s,r+a,o))},_previewColorCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),i=h(i.target),o=i.val(),i=!!i.closest(".fl-field-responsive-setting").length,n=e.important&&""!==o?" !important":"";""!==o&&o.indexOf("rgb")<0&&(o="#"+o),this.updateCSSRule(l,e.property,o+n,i)},_previewDimensionCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=e.property,n=t.attr("id").replace("fl-field-",""),s=h(i.target).data("unit"),i=this._getDimensionValue(e,t,s,i),t=!!t.find(".fl-field-responsive-setting").length,e=e.important&&""!==i?" !important":"",o="border-radius"===o?"border-"+s.replace("_","-")+"-radius":"border-width"===o?"border-"+s+"-width":o+"-"+s;this.updateCSSRule(l,o,i+e,t),"margin"!==n&&"padding"!==n&&"border"!==n||this.elements.node.find(".fl-bg-slideshow").length&&FLBuilder._resizeLayout()},_getDimensionValue:function(e,t,i,l){var o=h(l.target).val();return null===(o=o.toLowerCase().replace(/[^a-z0-9%.\-]/g,""))||""===o||isNaN(o)||(e=this._getPreviewCSSUnit(e,t,l),o=parseFloat(o)+(e||"px")),o},_getPreviewCSSUnit:function(e,t,i){var i=h(i.target),l=(FLBuilderResponsiveEditing._mode,!!i.closest(".fl-compound-field-setting").length),o=!!i.closest(".fl-field-responsive-setting").length,n=null;return(n=(l?i.closest(".fl-compound-field-setting"):o?i.closest(".fl-field-responsive-setting"):t).find(".fl-field-unit-select"))&&n.length?"SELECT"===n.prop("tagName")?n.val():n.text():e.unit||""},_initFieldUnitSelect:function(e){e.find(".fl-field-unit-select").on("change",function(){var e=h(this),t=e.closest(".fl-field-responsive-setting"),e=e.closest(".fl-field");(t.length?t:e).find("input").trigger("input")})},_previewGradientCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=t.find(".fl-gradient-picker-type-select").val(),n=t.find(".fl-gradient-picker-angle").val(),s=t.find(".fl-gradient-picker-position").val(),r=t.find(".fl-color-picker-value"),a=t.find(".fl-gradient-picker-stop input"),d=[],t="";r.each(function(e){var t=h(this).val(),e=a.eq(e).val();(t=""===t?"rgba(255,255,255,0)":t).indexOf("rgb")<0&&(t="#"+t),isNaN(e)&&(e=0),d.push(t+" "+e+"%")}),d=d.join(", "),t="linear"===o?"linear-gradient("+(n=isNaN(n)?0:n)+"deg, "+d+")":"radial-gradient(at "+s+", "+d+")",r=e.important&&""!==t?" !important":"",this.updateCSSRule(l,e.property,t+r)},_previewShadowCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=t.find(".fl-shadow-field-color input").val(),n=t.find(".fl-shadow-field-horizontal input").val(),s=t.find(".fl-shadow-field-vertical input").val(),r=t.find(".fl-shadow-field-blur input").val(),a=t.find(".fl-shadow-field-spread input").val(),t=!!t.find(".fl-shadow-field-spread input").length,i=!!h(i.target).closest(".fl-field-responsive-setting").length,d="",u="";""!==o&&(""===a&&(a=0),d=(d=(n=""===n?0:n)+"px ")+(s=""===s?0:s)+"px "+(r=""===r?0:r)+"px ",t&&(d+=a+"px "),d=d+(o=o.indexOf("rgb")<0?"#"+o:o)+u),u=e.important&&""!==d?" !important":"",this.updateCSSRule(l,e.property,d,i)},_previewTypographyCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=h(i.target),t=o.closest(".fl-field"),n=o.closest(".fl-compound-field-setting"),s=n.data("property"),r=o.val(),a=n.find(".fl-field-unit-select"),o=!!o.closest(".fl-field-responsive-setting").length,d=e.important&&""!==r?" !important":"";"font-family"===s?(e.id=t.attr("id"),this._previewFont(e,{delegateTarget:n})):"text-shadow"===s?(e.property="text-shadow",this._previewShadowCSS(e,n,i)):(a.length&&""!==r&&("vw"===a.val()?r="calc("+FLBuilderConfig.global.responsive_base_fontsize+"px + "+r+"vw)":r+="SELECT"===a.prop("tagName")?a.val():"px"),this.updateCSSRule(l,s,r+d,o))},_initFieldAttributePreview:function(e){var t=e.data("preview"),i=t.attribute,l=e.find("input"),e=(e.val(),window[t.format_callback]),t=this._getPreviewSelector(this.classes.node,t.selector),t=h(t),t=this._previewAttribute.bind(this,l,t,i,e);l.on("change",t),l.on("keyup",t),l.on("input",t)},_previewAttribute:function(e,t,l,o){var n=e.val();for("function"==typeof o&&(n=o(n)),i=0;i<t.length;i++)t[i].setAttribute(l,n)},_initFieldWidgetPreview:function(e){var t=h.proxy(this.delayPreview,this);e.find("input").on("keyup",t),e.find("input[type=checkbox]").on("click",t),e.find("textarea").on("keyup",t),e.find("select").on("change",t)},_initFieldAnimationPreview:function(e,t){t.find(".fl-animation-field-style select").on("change",h.proxy(this._previewAnimationField,this,e,t)),t.find(".fl-animation-field-duration input").on("input",h.proxy(this._previewAnimationField,this,e,t))},_previewAnimationField:function(e,t,i){var e=this._getPreviewSelector(this.classes.node,e.selector),l=h(e),e=t.find(".fl-animation-field-style select"),t=t.find(".fl-animation-field-duration input"),o=e[0].options;l.removeClass("fl-animated"),l.removeClass("fl-animation"),l.css("animation-duration","");for(var n=0;n<o.length;n++)l.removeClass("fl-"+o[n].value);""!==e.val()&&(l.addClass("fl-animation"),l.addClass("fl-"+e.val()),l.data("animation-delay",0),l.data("animation-duration",t.val())),FLBuilderLayout._doModuleAnimation.apply(l)},_getPreviewSelector:function(e,t){return FLBuilderPreview.getFormattedSelector.call(this,e,t)},toUpperCaseWords:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}},FLBuilderPreview.formatColor=function(e){return e=""!==e&&e.indexOf("rgb")<0&&e.indexOf("url")<0?"#"+e:e},FLBuilderPreviewCallbacks={previewShape:function(e,t){var i=e.preview.position,l=e.preview.prefix,e=e.form;yOrientation=e.find('input[name="'+(l+"transform[][scaleYSign]")+'"]'),"bottom"===i?yOrientation.val("invert"):yOrientation.val(""),yOrientation.trigger("change"),this.delayPreview()},previewShapeLayerSize:function(e,t){var i,l=e.getValues(),o=l.unit,n=l.props.width,s=l.props.height,l=l.props.top,r=e.preview.prefix,a=e.preview.position,d=this._getPreviewSelector(this.classes.node,".fl-builder-"+a+"-edge-layer"),u=d+" > *",c=e.form.find('[name="'+r+'align"]').val().split(" "),h=c[0],c=c[1],e=e.form.find('[name="'+r+'shape"]').val(),r=FLBuilderConfig.presets.shape[e];if(shapeProps={width:"100%",left:"auto",right:"auto",height:"auto",top:"auto",bottom:"auto"},n){shapeProps.width=n+o;var f=n/2+o;switch(c){case"left":shapeProps.left="0",shapeProps.right="auto";break;case"right":shapeProps.left="auto",shapeProps.right="0";break;case"center":shapeProps.left="calc( 50% - "+f+")",shapeProps.right="auto"}}switch(this.updateCSSRule(u,"width",shapeProps.width),this.updateCSSRule(u,"left",shapeProps.left),this.updateCSSRule(u,"right",shapeProps.right),i=s?s/2+o:n?n/r.data.viewBox.width*100/2+o:"",s&&(shapeProps.height=s+o),h){case"top":shapeProps.top="0",shapeProps.bottom="auto";break;case"bottom":shapeProps.top="auto",shapeProps.bottom="0";break;case"center":shapeProps.top="calc( 50% - "+i+")",shapeProps.bottom="auto"}this.updateCSSRule(u,"height",shapeProps.height),this.updateCSSRule(u,"top",shapeProps.top),this.updateCSSRule(u,"bottom",shapeProps.bottom),""===l?this.updateCSSRule(d,a,"0"):this.updateCSSRule(d,a,l+o)},previewShapeAlign:function(e,t){var i=e.preview.prefix;e.form.find('[name="'+i+'size_width"]').trigger("input")},previewShapeFillStyle:function(e,t){var i=e.input.val(),l=e.preview,o=e.preview.prefix,n="fl-row-"+e.nodeID+"-"+o+"-linear-gradient",s="fl-row-"+e.nodeID+"-"+o+"-radial-gradient",r="fl-row-"+e.nodeID+"-"+o+"-pattern",a=e.form;if(void 0!==i){var d=this._getPreviewSelector(this.classes.node,l.selector);switch(i){case"color":var u=a.find("[name="+o+"fill_color]").val();this.updateCSSRule(d,"fill",FLBuilderPreview.formatColor(u));break;case"gradient":u=a.find("#fl-field-"+o+"fill_gradient").find('select[name$="[type]"]').val();this.updateCSSRule(d,"fill","url(#"+("radial"===u?s:n)+")");break;case"pattern":this.updateCSSRule(d,"fill","url(#"+r+")")}}},previewShapeGradientFill:function(e,t){var i,l=e.getValues(),o=e.node,e=".fl-builder-"+e.preview.position+"-edge-layer",o=o.find(e+" "+l.type+"Gradient"),n="url(#"+o.attr("id")+")",e=this._getPreviewSelector(this.classes.node,e+" .fl-shape"),s=(this.updateCSSRule(e,"fill",n),o.find("stop"));for(i in l.stops){var r,a=l.stops[i],d=s.eq(i),u=a.color,a=a.stop,c=1;0===u.indexOf("rgba")&&(c=(r=u.substring(u.indexOf("(")+1,u.lastIndexOf(")")).split(/,\s*/)).pop(),u="rgb("+r.join(",")+")"),d.attr("stop-color",FLBuilderPreview.formatColor(u)),d.attr("stop-opacity",c),d.attr("offset",a+"%")}if("linear"===l.type&&void 0!==o[0]&&o[0].setAttribute("gradientTransform","rotate("+l.angle+" .5 .5 )"),"radial"===l.type){var h,f,e=(parts=l.position.split(" "))[0],n=parts[1];switch(e){case"top":case"left":h=0;break;case"center":h=.5;break;case"bottom":case"right":h=1}switch(n){case"top":case"left":f=0;break;case"center":f=.5;break;case"bottom":case"right":f=1}(e=.5)===h&&.5===f||(e=1),o.attr("cx",h),o.attr("cy",f),o.attr("r",e)}},previewShapeTransform:function(e,t){e.form;var i=e.preview,i=(i.prefix,this._getPreviewSelector(this.classes.node,i.selector)+" > *"),l=e.getValues(),o=[];Object.keys(l).map(function(e){var t=l[e],i="";switch(e){case"scaleXSign":case"scaleYSign":return;case"scaleX":case"scaleY":t&&""!==t&&0!==t||(t="1"),t="invert"===("scaleX"===e?l.scaleXSign:l.scaleYSign)?-Math.abs(t):Math.abs(t),o.push(e+"("+t+")");break;case"translateX":case"translateY":t&&o.push(e+"("+t+(i="px")+")");break;case"skewX":case"skewY":t&&o.push(e+"("+t+(i="deg")+")");break;case"rotate":i="deg",""!==t&&"0"!==t&&o.push("rotate("+t+i+")")}}),this.updateCSSRule(i,"transform",o.join(" "))}}}(jQuery),!function(u){var i={ignored:[],reparsed:[],width:null,callback:null,sheets:{},styles:[],queue:[],emPxValue:null,regex:{media:/@media[^{]*{([\s\S]+?})\s*}/gi,empty:/@media[^{]*{([^{}]*?)}/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)\}$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},ignore:function(e){Array.prototype.push.apply(this.ignored,e)},reparse:function(e){Array.prototype.push.apply(this.reparsed,e)},update:function(e,t){this.width=void 0===e?null:e,this.callback=void 0===t?null:t,l.update(),this.queueSheets()?this.runQueue():this.applyStyles()},queueSheets:function(){for(var e,t,i,l=null,o=null,n=null,s=!1,r=0,a=0;r<document.styleSheets.length;r++)if(l=(element=document.styleSheets[r].ownerNode).href,e=element.id,t=element.tagName.toLowerCase(),o=element.rel,i=element.media,n=l?l.split("?").shift():e||"style-"+r,s=!1,"style"===t||l&&o&&"stylesheet"===o.toLowerCase()){for(a=0;a<this.ignored.length;a++)if(-1<n.indexOf(this.ignored[a])){s=!0;break}if(!s){for(a=0;a<this.reparsed.length;a++)if(-1<n.indexOf(this.reparsed[a])){this.sheets[n]=null;break}void 0!==this.sheets[n]&&this.sheets[n]||this.queue.push({docSheet:document.styleSheets[r],element:u(element),key:n,tagName:t,href:l,id:e,media:i})}}return this.queue.length},runQueue:function(){var t;this.queue.length?"style"===(t=this.queue.shift()).tagName?(this.parse(t.element.html(),t),this.runQueue()):u.get(t.href,u.proxy(function(e){this.parse(e,t),this.runQueue()},this)).fail(this.runQueue.bind(this)):this.applyStyles()},parse:function(e,t){var i,l=this.regex,o=this.cleanStyles(e),n=o.match(l.media),s=n&&n.length||0,r=!s&&t.media,a=null,e="",d=0,u=0;for(n?e=o.replace(l.media,""):r&&"all"!=t.media?s=1:e=o,this.sheets[t.key]={docSheet:t.docSheet,element:t.element,key:t.key,tagName:t.tagName,href:t.href,id:t.id,all:e,queries:[]},d=0;d<s;d++)for(o=r?(a=t.media,this.convertURLs(o,t.href)):(a=n[d].match(l.findStyles)&&RegExp.$1,RegExp.$2&&this.convertURLs(RegExp.$2,t.href)),i=a.split(","),u=0;u<i.length;u++)"print"==((a=i[u]).split("(")[0].match(l.only)&&RegExp.$2)||a.replace(l.minmaxwh,"").match(l.other)||this.sheets[t.key].queries.push({minw:a.match(l.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:a.match(l.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),styles:o})},applyStyles:function(){var e=u("head"),t={all:"",queries:[]},i=null,l=null,o=null,n=null,s=null,r=null,a=null,d=!1;for(o in this.clearStyles(),this.sheets)if((l=this.sheets[o]).queries.length&&this.width){for(t.all+=l.all,s=0;s<l.queries.length;s++)r=(n=l.queries[s]).minw,a=n.maxw,d=!1,r&&(r=parseFloat(r)*(-1<r.indexOf("em")?this.getEmPxValue():1),this.width>=r&&(t.queries.push({media:"min",width:r,styles:n.styles}),d=!0)),a&&!d&&(a=parseFloat(a)*(-1<a.indexOf("em")?this.getEmPxValue():1),this.width<=a&&t.queries.push({media:"max",width:a,styles:n.styles}));l.docSheet.disabled=!0}for(""!==t.all&&(i=u('<style class="fl-builder-media-query" data-query="all"></style>'),this.styles.push(i),e.append(i),i.html(t.all)),s=0;s<t.queries.length;s++)n=t.queries[s],i=u('<style class="fl-builder-media-query" data-query="'+n.media+'" data-value="'+n.width+'"></style>'),this.styles.push(i),e.append(i),i.html(n.styles);this.callback&&(this.callback(),this.callback=null)},clearStyles:function(){var e=null,t=this.styles.slice(0);for(e in this.styles=[],this.sheets)this.sheets[e].docSheet.disabled=!1;for(var i=0;i<t.length;i++)t[i].empty(),t[i].remove()},disableStyles:function(e){for(var t,i,l=0;l<this.styles.length;l++)t=(i=this.styles[l]).attr("data-query"),i=parseInt(i.attr("data-value")),"max"===t&&!isNaN(i)&&i<=e&&(this.styles[l][0].sheet.disabled=!0)},enableStyles:function(){for(var e=0;e<this.styles.length;e++)this.styles[e][0].sheet.disabled=!1,this.styles[e][0].sheet.disabled=!0,this.styles[e][0].sheet.disabled=!1},cleanStyles:function(e){var t=this.regex;return e.replace(t.comments,"").replace(t.keyframes,"").replace(t.empty,"")},convertURLs:function(e,t){return t?((t=t.substring(0,t.lastIndexOf("/"))).length&&(t+="/"),e.replace(this.regex.urls,"$1"+t+"$2$3")):e},getEmPxValue:function(){if(this.emPxValue)return this.emPxValue;var e=window.document,t=e.documentElement,i=e.body,l=e.createElement("div"),o=t.style.fontSize,n=i&&i.style.fontSize,s=!1;return l.style.cssText="position:absolute;font-size:1em;width:1em",i||((i=s=e.createElement("body")).style.background="none"),t.style.fontSize="100%",i.style.fontSize="100%",i.appendChild(l),s&&t.insertBefore(i,t.firstChild),e=parseFloat(l.offsetWidth),s?t.removeChild(i):i.removeChild(l),t.style.fontSize=o,i.style.fontSize=n||"",this.emPxValue=e}},l={_functions:null,update:function(){if(!this._functions)for(var e in this._functions={},t)this._functions[e]=jQuery.fn[e];if(i.width)for(e in t)jQuery.fn[e]=t[e];else for(e in this._functions)jQuery.fn[e]=this._functions[e]}},t={width:function(e){return null!=e?l._functions.width.call(this,e):u.isWindow(this[0])?i.width:l._functions.width.call(this)}};FLBuilderSimulateMediaQuery={ignore:function(e){i.ignore(e)},reparse:function(e){i.reparse(e)},update:function(e,t){i.update(e,t)},disableStyles:function(e){i.disableStyles(e)},enableStyles:function(){i.enableStyles()}}}(jQuery),!function(d){FLBuilderResponsiveEditing={_mode:"default",refreshPreview:function(e){var t;d(".fl-responsive-preview").length&&"default"!==this._mode?("responsive"==this._mode?(t=320<=FLBuilderConfig.global.responsive_breakpoint?320:FLBuilderConfig.global.responsive_breakpoint,FLBuilderSimulateMediaQuery.update(t,e)):"medium"==this._mode&&(t=769<=FLBuilderConfig.global.medium_breakpoint?769:FLBuilderConfig.global.medium_breakpoint,FLBuilderSimulateMediaQuery.update(t,e)),FLBuilder._resizeLayout()):e&&e()},_init:function(){this._bind(),this._initMediaQueries()},_bind:function(){FLBuilder.addHook("endEditingSession",this._clearPreview),FLBuilder.addHook("didEnterRevisionPreview",this._clearPreview),FLBuilder.addHook("responsiveEditing",this._menuToggleClicked),FLBuilder.addHook("preview-init",this._switchAllSettingsToCurrentMode),FLBuilder.addHook("responsive-editing-switched",this._showSize),d("body").on("click",".fl-field-responsive-toggle",this._settingToggleClicked),d("body").on("click",".fl-responsive-preview-message button",this._previewToggleClicked)},_initMediaQueries:function(){FLBuilderSimulateMediaQuery.ignore([FLBuilderConfig.pluginUrl,FLBuilderConfig.relativePluginUrl]),ignorelist=d.map(FLBuilderConfig.responsiveIgnore,function(e,t){return[e]}),FLBuilderSimulateMediaQuery.ignore(ignorelist),FLBuilderSimulateMediaQuery.reparse([FLBuilderConfig.postId+"-layout-draft.css",FLBuilderConfig.postId+"-layout-draft-partial.css",FLBuilderConfig.postId+"-layout-preview.css",FLBuilderConfig.postId+"-layout-preview-partial.css",FLBuilderConfig.postId+"-inline-css","fl-builder-global-css","fl-builder-layout-css"])},_showSize:function(){var e=d(".fl-responsive-preview-message .size"),t="1"===FLBuilderConfig.global.responsive_preview?FLBuilderConfig.global.medium_breakpoint:769,i="1"===FLBuilderConfig.global.responsive_preview?FLBuilderConfig.global.responsive_breakpoint:360,l="";d(".fl-responsive-preview").hasClass("fl-preview-responsive")?l=FLBuilderStrings.mobile+" "+i+"px":d(".fl-responsive-preview").hasClass("fl-preview-medium")&&(l=FLBuilderStrings.medium+" "+t+"px"),e.html("").html(l)},_switchTo:function(e,t){var i=d("html"),l=d("body"),o=d(FLBuilder._contentClass),n=d(".fl-responsive-preview"),s=d(".fl-responsive-preview-mask"),r=d(".fl-content-placeholder"),a=null;if("default"==(FLBuilderResponsiveEditing._mode=e)){if(0===r.length)return;i.removeClass("fl-responsive-preview-enabled"),r.after(o),r.remove(),n.remove(),s.remove()}else 0===n.length?(i.addClass("fl-responsive-preview-enabled"),o.after('<div class="fl-content-placeholder"></div>'),l.prepend(wp.template("fl-responsive-preview")()),d(".fl-responsive-preview").addClass("fl-preview-"+e),d(".fl-responsive-preview-content").append(o)):(n.removeClass("fl-preview-responsive fl-preview-medium"),n.addClass("fl-preview-"+e));"responsive"==e?(a="1"!==FLBuilderConfig.global.responsive_preview&&360<=FLBuilderConfig.global.responsive_breakpoint?360:FLBuilderConfig.global.responsive_breakpoint,o.width(a),FLBuilderSimulateMediaQuery.update(a,t),FLBuilderResponsiveEditing._setMarginPaddingPlaceholders()):"medium"==e?(a="1"!==FLBuilderConfig.global.responsive_preview&&769<=FLBuilderConfig.global.medium_breakpoint?769:FLBuilderConfig.global.medium_breakpoint,o.width(a),FLBuilderSimulateMediaQuery.update(a,t),FLBuilderResponsiveEditing._setMarginPaddingPlaceholders()):(o.width(""),FLBuilderSimulateMediaQuery.update(null,t)),this._setContentBackgroundColor(),FLBuilder._resizeLayout(),this._previewFields(),FLBuilder.triggerHook("responsive-editing-switched",e)},_setContentBackgroundColor:function(){var e=d(FLBuilder._contentClass),t=d(".fl-responsive-preview"),i=d(".fl-content-placeholder").parents(),l="#fff",o=0;if(0===t.length)e.css("background-color","");else{for(;o<i.length&&"rgba(0, 0, 0, 0)"==(l=i.eq(o).css("background-color"));o++);e.css("background-color",l)}},_switchToAndScroll:function(i){var e=d(".fl-builder-settings").data("node"),t=void 0===e?void 0:d(".fl-node-"+e);FLBuilderResponsiveEditing._switchTo(i,function(){var e;void 0!==t&&t&&(d(window),(e=d(".fl-responsive-preview-content")).length?(e.scrollTop(0),e.scrollTop(t.offset().top-150)):d("html, body").scrollTop(t.offset().top-100)),d(".fl-row-bg-parallax").each(function(){var e=d(this),t=e.find("> .fl-row-content-wrap"),e={default:e.data("parallax-image"),medium:e.data("parallax-image-medium"),responsive:e.data("parallax-image-responsive")};void 0!==e[i]&&t.css("background-image","url("+e[i]+")")})})},_switchAllSettingsTo:function(e){var t="dashicons-desktop dashicons-tablet dashicons-smartphone";d(".fl-field-responsive-toggle").removeClass(t),d(".fl-field-responsive-setting").hide(),t="default"==e?"dashicons-desktop":"medium"==e?"dashicons-tablet":"dashicons-smartphone",d(".fl-field-responsive-toggle").addClass(t).data("mode",e),d(".fl-field-responsive-setting-"+e).css("display","inline-block")},_switchAllSettingsToCurrentMode:function(){var e=FLBuilderResponsiveEditing;e._switchAllSettingsTo(e._mode),FLBuilder.triggerHook("responsive-editing-switched",e._mode)},_setMarginPaddingPlaceholders:function(){var e="#fl-field-padding .fl-field-responsive-setting-default",e={values:{top:d(e+' input[ name="padding_top" ]').val(),right:d(e+' input[ name="padding_right" ]').val(),bottom:d(e+' input[ name="padding_bottom" ]').val(),left:d(e+' input[ name="padding_left" ]').val()},placeholders:{top:d(e+' input[ name="padding_top" ]').attr("placeholder"),right:d(e+' input[ name="padding_right" ]').attr("placeholder"),bottom:d(e+' input[ name="padding_bottom" ]').attr("placeholder"),left:d(e+' input[ name="padding_left" ]').attr("placeholder")}},t="#fl-field-padding .fl-field-responsive-setting-medium",i={values:{top:d(t+' input[ name="padding_top_medium" ]').val(),right:d(t+' input[ name="padding_right_medium" ]').val(),bottom:d(t+' input[ name="padding_bottom_medium" ]').val(),left:d(t+' input[ name="padding_left_medium" ]').val()},placeholders:{top:"",right:"",bottom:"",left:""}},l="#fl-field-padding .fl-field-responsive-setting-responsive",o=(d(t+' input[ name="padding_top_responsive" ]').val(),d(t+' input[ name="padding_right_responsive" ]').val(),d(t+' input[ name="padding_bottom_responsive" ]').val(),d(t+' input[ name="padding_left_responsive" ]').val(),"#fl-field-margin .fl-field-responsive-setting-default"),o={values:{top:d(o+' input[ name="margin_top" ]').val(),right:d(o+' input[ name="margin_right" ]').val(),bottom:d(o+' input[ name="margin_bottom" ]').val(),left:d(o+' input[ name="margin_left" ]').val()},placeholders:{top:d(o+' input[ name="margin_top" ]').attr("placeholder"),right:d(o+' input[ name="margin_right" ]').attr("placeholder"),bottom:d(o+' input[ name="margin_bottom" ]').attr("placeholder"),left:d(o+' input[ name="margin_left" ]').attr("placeholder")}},n="#fl-field-margin .fl-field-responsive-setting-medium",s={values:{top:d(n+' input[ name="margin_top_medium" ]').val(),right:d(n+' input[ name="margin_right_medium" ]').val(),bottom:d(n+' input[ name="margin_bottom_medium" ]').val(),left:d(n+' input[ name="margin_left_medium" ]').val()},placeholders:{top:o.values.top||o.placeholders.top,right:o.values.right||o.placeholders.right,bottom:o.values.bottom||o.placeholders.bottom,left:o.values.left||o.placeholders.left}},r="#fl-field-margin .fl-field-responsive-setting-responsive";d(r+' input[ name="margin_top_responsive" ]').val(),d(r+' input[ name="margin_right_responsive" ]').val(),d(r+' input[ name="margin_bottom_responsive" ]').val(),d(r+' input[ name="margin_left_responsive" ]').val();""!=e.values.top?d(t+' input[ name="padding_top_medium"] ').attr("placeholder",e.values.top):d(t+' input[ name="padding_top_medium"] ').attr("placeholder",e.placeholders.top),""!=e.values.right?d(t+' input[ name="padding_right_medium"] ').attr("placeholder",e.values.right):d(t+' input[ name="padding_right_medium"] ').attr("placeholder",e.placeholders.right),""!=e.values.bottom?d(t+' input[ name="padding_bottom_medium"] ').attr("placeholder",e.values.bottom):d(t+' input[ name="padding_bottom_medium"] ').attr("placeholder",e.placeholders.bottom),""!=e.values.left?d(t+' input[ name="padding_left_medium"] ').attr("placeholder",e.values.left):d(t+' input[ name="padding_left_medium"] ').attr("placeholder",e.placeholders.left),""!=i.values.top?d(l+' input[ name="padding_top_responsive"] ').attr("placeholder",i.values.top):""!=e.values.top?d(l+' input[ name="padding_top_responsive"] ').attr("placeholder",e.values.top):d(l+' input[ name="padding_top_responsive"] ').attr("placeholder",e.placeholders.top),""!=i.values.right?d(l+' input[ name="padding_right_responsive"] ').attr("placeholder",i.values.right):""!=e.values.right?d(l+' input[ name="padding_right_responsive"] ').attr("placeholder",e.values.right):d(l+' input[ name="padding_right_responsive"] ').attr("placeholder",e.placeholders.right),""!=i.values.bottom?d(l+' input[ name="padding_bottom_responsive"] ').attr("placeholder",i.values.bottom):""!=e.values.bottom?d(l+' input[ name="padding_bottom_responsive"] ').attr("placeholder",e.values.bottom):d(l+' input[ name="padding_bottom_responsive"] ').attr("placeholder",e.placeholders.bottom),""!=i.values.left?d(l+' input[ name="padding_left_responsive"] ').attr("placeholder",i.values.left):""!=e.values.left?d(l+' input[ name="padding_left_responsive"] ').attr("placeholder",e.values.left):d(l+' input[ name="padding_left_responsive"] ').attr("placeholder",e.placeholders.left),""!=o.values.top?d(n+' input[ name="margin_top_medium" ]').attr("placeholder",o.values.top):d(n+' input[ name="margin_top_medium" ]').attr("placeholder",o.placeholders.top),""!=o.values.right?d(n+' input[ name="margin_right_medium" ]').attr("placeholder",o.values.right):d(n+' input[ name="margin_right_medium" ]').attr("placeholder",o.placeholders.right),""!=o.values.bottom?d(n+' input[ name="margin_bottom_medium" ]').attr("placeholder",o.values.bottom):d(n+' input[ name="margin_bottom_medium" ]').attr("placeholder",o.placeholders.bottom),""!=o.values.left?d(n+' input[ name="margin_left_medium" ]').attr("placeholder",o.values.left):d(n+' input[ name="margin_left_medium" ]').attr("placeholder",o.placeholders.left),""!=s.values.top?d(r+' input[ name="margin_top_responsive" ]').attr("placeholder",s.values.top):""!=o.values.top?d(r+' input[ name="margin_top_responsive" ]').attr("placeholder",o.values.top):d(r+' input[ name="margin_top_responsive" ]').attr("placeholder",o.placeholders.top),""!=s.values.right?d(r+' input[ name="margin_right_responsive" ]').attr("placeholder",s.values.right):""!=o.values.right?d(r+' input[ name="margin_right_responsive" ]').attr("placeholder",o.values.right):d(r+' input[ name="margin_right_responsive" ]').attr("placeholder",o.placeholders.right),""!=s.values.bottom?d(r+' input[ name="margin_bottom_responsive" ]').attr("placeholder",s.values.bottom):""!=o.values.bottom?d(r+' input[ name="margin_bottom_responsive" ]').attr("placeholder",o.values.bottom):d(r+' input[ name="margin_bottom_responsive" ]').attr("placeholder",o.placeholders.bottom),""!=s.values.left?d(r+' input[ name="margin_left_responsive" ]').attr("placeholder",s.values.left):""!=o.values.left?d(r+' input[ name="margin_left_responsive" ]').attr("placeholder",o.values.left):d(r+' input[ name="margin_left_responsive" ]').attr("placeholder",o.placeholders.left)},_settingToggleClicked:function(){var e=d(this),t="default"==(t=e.data("mode"))?"medium":"medium"==t?"responsive":"default";FLBuilderResponsiveEditing._switchAllSettingsTo(t),FLBuilderResponsiveEditing._switchToAndScroll(t),e.siblings(".fl-field-responsive-setting:visible").find("input").focus()},_menuToggleClicked:function(){var e="default"==(e=FLBuilderResponsiveEditing._mode)?"medium":"medium"==e?"responsive":"default";FLBuilder.MainMenu.hide(),FLBuilderResponsiveEditing._switchAllSettingsTo(e),FLBuilderResponsiveEditing._switchToAndScroll(e)},_previewToggleClicked:function(){var e=d(this).data("mode");FLBuilderResponsiveEditing._switchAllSettingsTo(e),FLBuilderResponsiveEditing._switchToAndScroll(e)},_clearPreview:function(){FLBuilderResponsiveEditing._switchToAndScroll("default")},_previewFields:function(){var o=FLBuilderResponsiveEditing._mode,e=d(".fl-builder-settings:visible");0!==e.length&&void 0!==e.attr("data-node")&&(FLBuilder.triggerHook("responsive-editing-before-preview-fields",o),e.find(".fl-builder-settings-tab").each(function(){var e=d(this);e.css("display","block"),e.find(".fl-field-responsive-setting-"+o+":visible").each(function(){var e=d(this),t=e.closest(".fl-field"),i=t.data("type"),l=t.data("preview"),t=t.find(".fl-field-connection-visible").length;"refresh"!=l.type&&(t?"photo"===i&&"default"!==o&&e.find(".fl-photo-remove").trigger("click"):(e.find("input").trigger("keyup"),e.find("select").trigger("change")))}),e.css("display","")}),FLBuilder.triggerHook("responsive-editing-after-preview-fields",o))}},d(function(){FLBuilderResponsiveEditing._init()})}(jQuery),!function(n){FLBuilderResponsivePreview={enter:function(){this.render()},exit:function(){this.destroy()},switchTo:function(e){var t=FLBuilderConfig.global,i=n("#fl-builder-preview-frame"),l="100%";"responsive"==e?(l="1"!==t.responsive_preview&&360<=t.responsive_breakpoint?360:t.responsive_breakpoint,i.width(l)):"medium"==e&&(l="1"!==t.responsive_preview&&769<=t.medium_breakpoint?769:t.medium_breakpoint,i.width(l)),i.width(l)},render:function(){var e=n("body"),t=FLBuilderConfig.previewUrl,i=n("#fl-builder-preview-mask, #fl-builder-preview-frame"),l=n('<div id="fl-builder-preview-mask"></div>'),t=n('<iframe id="fl-builder-preview-frame" src="'+t+'"></iframe>');i.remove(),e.append(l),e.append(t),e.css("overflow","hidden")},_showSize:function(e){var t=n(".fl-builder--preview-actions .size"),i="1"===FLBuilderConfig.global.responsive_preview?FLBuilderConfig.global.medium_breakpoint:769,l="1"===FLBuilderConfig.global.responsive_preview?FLBuilderConfig.global.responsive_breakpoint:360,o="";"responsive"===e?o=FLBuilderStrings.mobile+" "+l+"px":"medium"===e&&(o=FLBuilderStrings.medium+" "+i+"px"),t.html("").html(o)},destroy:function(){n("#fl-builder-preview-mask, #fl-builder-preview-frame").remove(),n("body").css("overflow","visible"),n(".fl-builder--preview-actions .size").html("")}}}(jQuery),!function(d){var u={init:function(){var e=d("body");e.on("change",".fl-builder-service-select",this._serviceChange),e.on("click",".fl-builder-service-connect-button",this._connectClicked),e.on("change",".fl-builder-service-account-select",this._accountChange),e.on("click",".fl-builder-service-account-delete",this._accountDeleteClicked),e.on("change",".fl-builder-campaign-monitor-client-select",this._campaignMonitorClientChange),e.on("change",".fl-builder-mailchimp-list-select",this._mailChimpListChange),e.on("change",".fl-builder-activecampaign-list_type-select",this._activeCampaignChange)},_startSettingsLoading:function(e){var t=d(".fl-builder-settings"),e=e.closest(".fl-builder-service-settings"),i=d(".fl-builder-service-error");t.append('<div class="fl-builder-loading"></div>'),e.addClass("fl-builder-service-settings-loading"),i.remove()},_finishSettingsLoading:function(){var e=d(".fl-builder-settings"),t=d(".fl-builder-service-settings-loading");e.find(".fl-builder-loading").remove(),t.removeClass("fl-builder-service-settings-loading")},_serviceChange:function(){var e=d(".fl-builder-settings").data("node"),t=d(this),i=t.closest("tr"),l=t.val();i.siblings("tr.fl-builder-service-account-row").remove(),i.siblings("tr.fl-builder-service-connect-row").remove(),i.siblings("tr.fl-builder-service-field-row").remove(),d(".fl-builder-service-error").remove(),""!==l&&(u._startSettingsLoading(t),FLBuilder.ajax({action:"render_service_settings",node_id:e,service:l},u._serviceChangeComplete))},_serviceChangeComplete:function(e){var e=FLBuilder._jsonParse(e),t=d(".fl-builder-service-settings-loading");t.find(".fl-builder-service-select-row").after(e.html),u._addAccountDelete(t),u._finishSettingsLoading()},_connectClicked:function(){for(var e,t=d(".fl-builder-settings").data("node"),i=d(this).closest(".fl-builder-service-settings"),l=i.find(".fl-builder-service-select"),o=i.find(".fl-builder-service-connect-row"),n=i.find(".fl-builder-service-connect-input"),s=null,r=0,a={action:"connect_service",node_id:t,service:l.val(),fields:{}};r<n.length;r++)e=(s=n.eq(r)).attr("name"),a.fields[e]=s.val();o.hide(),u._startSettingsLoading(l),FLBuilder.ajax(a,u._connectComplete)},_connectComplete:function(e){var e=FLBuilder._jsonParse(e),t=d(".fl-builder-service-settings-loading"),i=t.find(".fl-builder-service-select-row"),l=t.find(".fl-builder-service-select"),o=t.find(".fl-builder-service-account-row"),n=t.find(".fl-builder-service-account-select"),s=t.find(".fl-builder-service-connect-row");e.error?(s.show(),(0===n.length?l:n).after('<div class="fl-builder-service-error">'+e.error+"</div>")):(s.remove(),o.remove(),i.after(e.html)),u._addAccountDelete(t),u._finishSettingsLoading()},_accountChange:function(){var e=d(".fl-builder-settings").data("node"),t=d(this).closest(".fl-builder-service-settings"),i=t.find(".fl-builder-service-select"),l=t.find(".fl-builder-service-account-select"),o=t.find(".fl-builder-service-connect-row"),n=t.find("tr.fl-builder-service-field-row"),s=d(".fl-builder-service-error"),l=l.val(),r=null;o.remove(),n.remove(),s.remove(),"add_new_account"==l?r={action:"render_service_settings",node_id:e,service:i.val(),add_new:!0}:""!==l&&(r={action:"render_service_fields",node_id:e,service:i.val(),account:l}),r&&(u._startSettingsLoading(i),FLBuilder.ajax(r,u._accountChangeComplete)),u._addAccountDelete(t)},_accountChangeComplete:function(e){e=FLBuilder._jsonParse(e);d(".fl-builder-service-settings-loading").find(".fl-builder-service-account-row").after(e.html),u._finishSettingsLoading()},_addAccountDelete:function(e){var t=e.find(".fl-builder-service-account-select");0<t.length&&(e.find(".fl-builder-service-account-delete").remove(),""!==t.val()&&"add_new_account"!=t.val()&&t.after('<a href="javascript:void(0);" class="fl-builder-service-account-delete">'+FLBuilderStrings.deleteAccount+"</a>"))},_accountDeleteClicked:function(){var e=d(this).closest(".fl-builder-service-settings"),t=e.find(".fl-builder-service-select"),e=e.find(".fl-builder-service-account-select");confirm(FLBuilderStrings.deleteAccountWarning)&&(FLBuilder.ajax({action:"delete_service_account",service:t.val(),account:e.val()},u._accountDeleteComplete),u._startSettingsLoading(e))},_accountDeleteComplete:function(){var e=d(".fl-builder-service-settings-loading").find(".fl-builder-service-select");u._finishSettingsLoading(),e.trigger("change")},_campaignMonitorClientChange:function(){var e=d(".fl-builder-settings").data("node"),t=d(this).closest(".fl-builder-service-settings"),i=t.find(".fl-builder-service-select"),l=t.find(".fl-builder-service-account-select"),o=d(this),t=t.find(".fl-builder-service-list-select"),o=o.val();0!==t.length&&t.closest("tr").remove(),""!==o&&(u._startSettingsLoading(i),FLBuilder.ajax({action:"render_service_fields",node_id:e,service:i.val(),account:l.val(),client:o},u._campaignMonitorClientChangeComplete))},_campaignMonitorClientChangeComplete:function(e){e=FLBuilder._jsonParse(e);d(".fl-builder-service-settings-loading").find(".fl-builder-campaign-monitor-client-select").closest("tr").after(e.html),u._finishSettingsLoading()},_mailChimpListChange:function(){var e=d(".fl-builder-settings").data("node"),t=d(this).closest(".fl-builder-service-settings"),i=t.find(".fl-builder-service-select"),l=t.find(".fl-builder-service-account-select"),t=t.find(".fl-builder-service-list-select");d(".fl-builder-mailchimp-group-select").closest("tr").remove(),""!==t.val()&&(u._startSettingsLoading(i),FLBuilder.ajax({action:"render_service_fields",node_id:e,service:i.val(),account:l.val(),list_id:t.val()},u._mailChimpListChangeComplete))},_mailChimpListChangeComplete:function(e){e=FLBuilder._jsonParse(e);d(".fl-builder-service-settings-loading").find(".fl-builder-service-list-select").closest("tr").after(e.html),u._finishSettingsLoading()},_activeCampaignChange:function(){var e=d(".fl-builder-settings").data("node"),t=d(this).closest(".fl-builder-service-settings"),i=t.find(".fl-builder-service-select"),l=t.find(".fl-builder-service-account-select"),o=t.find(".fl-builder-service-list-select");list_type=t.find('select[name="list_type"]'),0!==o.length&&o.closest("tr").remove(),""!==list_type.val()&&(u._startSettingsLoading(i),FLBuilder.ajax({action:"render_service_fields",node_id:e,service:i.val(),account:l.val(),list_type:list_type.val()},u._activeCampaignTypeChangeComplete))},_activeCampaignTypeChangeComplete:function(e){e=FLBuilder._jsonParse(e);d(".fl-builder-service-settings-loading").find(".fl-builder-service-field-row").after(e.html),u._finishSettingsLoading()}};d(function(){u.init()})}(jQuery),!function(t){FLBuilderTour={_tour:null,start:function(){FLBuilderTour._tour?FLBuilderTour._tour.restart():(FLBuilderTour._tour=new Tour(FLBuilderTour._config()),FLBuilderTour._tour.init()),FLBuilder._triggerSettingsSave(!1,!0)&&FLBuilderTour._tour.start()},_config:function(){var e={storage:!1,onStart:FLBuilderTour._onStart,onPrev:FLBuilderTour._onPrev,onNext:FLBuilderTour._onNext,onEnd:FLBuilderTour._onEnd,template:'<div class="popover" role="tooltip"> <i class="fas fa-times" data-role="end"></i> <div class="arrow"></div> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="next">'+FLBuilderStrings.tourNext+"</button> </div> </div>",steps:[{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourTemplatesTitle,content:FLBuilderStrings.tourTemplates,onShow:function(){FLBuilder.ContentPanel.show("templates")}},{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourAddRowsTitle,content:FLBuilderStrings.tourAddRows,onShow:function(){FLBuilder.ContentPanel.show("rows")}},{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourAddContentTitle,content:FLBuilderStrings.tourAddContent,onShow:function(){FLBuilder.ContentPanel.show("modules")}},{animation:!1,element:".fl-row.fl-builder-tour-demo-content",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),t(".fl-row.fl-builder-tour-demo-content").trigger("mouseenter"),t(".fl-row.fl-builder-tour-demo-content .fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-row.fl-builder-tour-demo-content .fl-module-overlay .fl-block-overlay-actions",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent2,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),t(".fl-row.fl-builder-tour-demo-content").trigger("mouseenter"),t(".fl-row.fl-builder-tour-demo-content .fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-builder-content-panel-button",placement:"bottom",title:FLBuilderStrings.tourAddContentButtonTitle,content:FLBuilderStrings.tourAddContentButton,onShow:function(){FLBuilderTour._dimSection("body"),t(".fl-row").eq(0).trigger("mouseleave"),t(".fl-module").eq(0).trigger("mouseleave")}},{animation:!1,element:".fl-builder-bar-title",placement:"bottom",title:FLBuilderStrings.tourToolsButtonTitle,content:FLBuilderStrings.tourToolsButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-done-button",placement:"bottom",title:FLBuilderStrings.tourDoneButtonTitle,content:FLBuilderStrings.tourDoneButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,orphan:!0,backdrop:!0,title:FLBuilderStrings.tourFinishedTitle,content:FLBuilderStrings.tourFinished,template:'<div class="popover" role="tooltip"> <div class="arrow"></div> <i class="fas fa-times" data-role="end"></i> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="end">'+FLBuilderStrings.tourEnd+"</button> </div> </div>"}]};return"disabled"!=FLBuilderConfig.enabledTemplates&&"fl-builder-template"!=FLBuilderConfig.postType||e.steps.shift(),e},_onStart:function(){var e=t("body");e.scrollTop(0),e.append('<div class="fl-builder-tour-mask"></div>'),"module"!=FLBuilderConfig.userTemplateType&&(0===t(".fl-row").length?(t(".fl-builder-content").append('<div class="fl-builder-tour-demo-content fl-builder-tour-placeholder-content fl-row fl-row-full-width fl-row-bg-none"> <div class="fl-row-content-wrap"> <div class="fl-row-content fl-row-fixed-width fl-node-content"> <div class="fl-col-group"> <div class="fl-col" style="width: 100%;"> <div class="fl-col-content fl-node-content"> <div class="fl-module fl-module-rich-text" data-type="rich-text" data-name="Text Editor"> <div class="fl-module-content fl-node-content"> <div class="fl-rich-text"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus pellentesque ut lorem non cursus. Sed mauris nunc, porttitor iaculis lorem a, sollicitudin lacinia sapien. Proin euismod orci lacus, et sollicitudin leo posuere ac. In hac habitasse platea dictumst. Maecenas elit magna, consequat in turpis suscipit, ultrices rhoncus arcu. Phasellus finibus sapien nec elit tempus venenatis. Maecenas tincidunt sapien non libero maximus, in aliquam felis tincidunt. Mauris mollis ultricies facilisis. Duis condimentum dignissim tortor sit amet facilisis. Aenean gravida lacus eu risus molestie egestas. Donec ut dolor dictum, fringilla metus malesuada, viverra nunc. Maecenas ut purus ac justo aliquet lacinia. Cras vestibulum elementum tincidunt. Maecenas mattis tortor neque, consectetur dignissim neque tempor nec.</p> </div> </div> </div> </div> </div> </div> </div> </div></div>'),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols()):t(".fl-row").eq(0).addClass("fl-builder-tour-demo-content"))},_onPrev:function(){t(".fl-builder-tour-dimmed").remove()},_onNext:function(){t(".fl-builder-tour-dimmed").remove()},_onEnd:function(){t("body").off("fl-builder.template-selector-loaded"),t(".fl-builder-tour-mask").remove(),t(".fl-builder-tour-dimmed").remove(),t(".fl-builder-tour-placeholder-content").remove(),t(".fl-builder-tour-demo-content").removeClass("fl-builder-tour-demo-content"),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._showPanel(),FLBuilder._initTemplateSelector()},_dimSection:function(e){t(e).find(".fl-builder-tour-dimmed").remove(),t(e).append('<div class="fl-builder-tour-dimmed"></div>')}}}(jQuery),!function(r,o){String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(t=t||0,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var i=this.toString(),i=(("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>i.length)&&(t=i.length),t-=e.length,i.indexOf(e,t));return-1!==i&&i===t}),r.fn.textWidth=function(e,t){return r.fn.textWidth.fakeEl||(r.fn.textWidth.fakeEl=r("<span>").hide().appendTo(document.body)),r.fn.textWidth.fakeEl.text(e||this.val()||this.text()).css("font",t||this.css("font")),r.fn.textWidth.fakeEl.width()},FLExtendableObject={create:function(e){var t=Object.create(this),t=r.extend(t,e);return r(this).trigger("onCreate"),t}},r.fn.switchClass=function(o,e){return this.each(function(){return r(this).removeClass(function(e,t){var i=[],l=t.split(" ");for(e in l)l[e].startsWith(o)&&i.push(l[e]);return i.join(" ")}),r(this).addClass(o+e)})};var e={init:function(){o.addHook("cancelTask",this.onCancelTask.bind(this)),o.addHook("showSavedMessage",this.onSaveShortcut.bind(this)),o.addHook("goToNextTab",this.onNextPrevTabShortcut.bind(this,"next")),o.addHook("goToPrevTab",this.onNextPrevTabShortcut.bind(this,"prev")),o.addHook("endEditingSession",this.onEndEditingSession.bind(this)),o.addHook("restartEditingSession",this.onRestartEditingSession.bind(this)),this.setDefaultKeyboardShortcuts()},addShortcut:function(e,t,i){e=r.proxy(this,"onTriggerKey",e);i?Mousetrap.bindGlobal(t,e):Mousetrap.bind(t,e)},reset:function(){Mousetrap.reset()},setDefaultKeyboardShortcuts:function(){for(var e in this.reset(),FLBuilderConfig.keyboardShortcuts){var t=FLBuilderConfig.keyboardShortcuts[e].keyCode,i=FLBuilderConfig.keyboardShortcuts[e].isGlobal;this.addShortcut(e,t,i)}},onTriggerKey:function(e,t){o.triggerHook(e),t.preventDefault?t.preventDefault():t.returnValue=!1},onCancelTask:function(){i.isPreviewing?i.endPreview():t.isShowing?t.hide():o.ContentPanel.isShowing&&o.ContentPanel.hide()},pause:function(){Mousetrap.pause()},unpause:function(){Mousetrap.unpause()},onEndEditingSession:function(){const e=FL.Builder.data.getSystemActions();e.setIsEditing(!1),document.documentElement.classList.remove("fl-builder-assistant-visible"),this.reset(),this.addShortcut("restartEditingSession","mod+e")},onRestartEditingSession:function(){const e=FL.Builder.data.getSystemActions();e.setIsEditing(!0),"assistant"===FL.Builder.data.getSystemState().currentPanel&&document.documentElement.classList.add("fl-builder-assistant-visible"),this.reset(),this.setDefaultKeyboardShortcuts()},onSaveShortcut:function(){var e;e=o.SaveManager.layoutNeedsPublish()?FLBuilderStrings.savedStatus.hasAlreadySaved:FLBuilderStrings.savedStatus.nothingToSave,o.SaveManager.showStatusMessage(e),setTimeout(function(){o.SaveManager.resetStatusMessage()},2e3)},onNextPrevTabShortcut:function(e,t){var i=r(".fl-lightbox:visible"),l=i.find(".fl-builder-settings-tabs a");0<i.length&&(i=l.filter("a.fl-active"),("next"==e?i.is(l.last())?l.first():i.next("a"):i.is(l.first())?l.last():i.prev("a")).trigger("click")),o._calculateSettingsTabsOverflow(),t.preventDefault()}},t=FLExtendableObject.create({isShowing:!1,init:function(){this.$el=r(".fl-builder-publish-actions"),this.$defaultBarButtons=r(".fl-builder-bar-actions"),this.$clickAwayMask=r(".fl-builder-publish-actions-click-away-mask"),this.$doneBtn=this.$defaultBarButtons.find(".fl-builder-done-button"),this.$doneBtn.on("click",this.onDoneTriggered.bind(this)),this.$actions=this.$el.find(".fl-builder-button"),this.$actions.on("click touchend",this.onActionClicked.bind(this)),o.addHook("triggerDone",this.onDoneTriggered.bind(this));var e=this.hide.bind(this);o.addHook("cancelPublishActions",e),o.addHook("endEditingSession",e),this.$clickAwayMask.on("click",e)},onDoneTriggered:function(){o.SaveManager.layoutNeedsPublish()?this.show():FLBuilderConfig.shouldRefreshOnPublish?o._exit():o._exitWithoutRefresh()},show:function(){this.isShowing||o._triggerSettingsSave(!1,!0)&&(this.$el.removeClass("is-hidden"),this.$defaultBarButtons.css("opacity","0"),this.$clickAwayMask.show(),this.isShowing=!0,o.triggerHook("didShowPublishActions"))},hide:function(){this.isShowing&&(this.$el.addClass("is-hidden"),this.$defaultBarButtons.css("opacity","1"),this.$clickAwayMask.hide(),this.isShowing=!1)},onActionClicked:function(e){e=r(e.currentTarget).data("action");switch(e){case"dismiss":this.hide();break;case"discard":this.hide(),i.muteToolbar(),o._discardButtonClicked();break;case"publish":this.hide(),i.muteToolbar(),o._publishButtonClicked(),o._destroyOverlayEvents();break;default:this.hide(),i.muteToolbar(),o._draftButtonClicked()}o.triggerHook(e+"ButtonClicked")}}),i={isPreviewing:!1,init:function(){this.$el=r("body"),this.$mainToolbar=r(".fl-builder-bar"),this.$mainToolbarContent=this.$mainToolbar.find(".fl-builder-bar-content"),this.$wpAdminBar=r("#wpadminbar"),this.$endPreviewBtn=r(".fl-builder--preview-actions .end-preview-btn"),o.addHook("endEditingSession",this.endEditingSession.bind(this)),o.addHook("previewLayout",this.togglePreview.bind(this)),this.$endPreviewBtn.on("click",this.endPreview.bind(this)),this.$deviceIcons=r(".fl-builder--preview-actions i"),this.$deviceIcons.on("click",this.onDeviceIconClick.bind(this));this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a, #wp-admin-bar-fl-theme-builder-frontend-edit-link > a").on("click",this.onClickPageBuilderToolbarLink.bind(this)),r("#wpadminbar a").attr("tabindex","-1");var e=this.restartEditingSession.bind(this);o.addHook("restartEditingSession",e),o.addHook("didHideAllLightboxes",this.unmuteToolbar.bind(this)),o.addHook("didCancelDiscard",this.unmuteToolbar.bind(this)),o.addHook("didEnterRevisionPreview",this.hide.bind(this)),o.addHook("didExitRevisionPreview",this.show.bind(this)),o.addHook("didPublishLayout",this.onPublish.bind(this)),o.addHook("didPublishLayout",this.onPublishCacheClear.bind(this))},endEditingSession:function(){o._destroyOverlayEvents(),o._removeAllOverlays(),o._removeEmptyRowAndColHighlights(),o._removeColHighlightGuides(),o._unbindEvents(),r("html").removeClass("fl-builder-edit").addClass("fl-builder-show-admin-bar"),r("body").removeClass("fl-builder-edit"),r("#wpadminbar a").attr("tabindex",null),r(o._contentClass).removeClass("fl-builder-content-editing"),this.hideMainToolbar(),o.ContentPanel.hide(),FLBuilderLayout.init()},restartEditingSession:function(e){o._initTemplateSelector(),o._bindOverlayEvents(),o._highlightEmptyCols(),o._rebindEvents(),r("html").addClass("fl-builder-edit").removeClass("fl-builder-show-admin-bar"),r("body").addClass("fl-builder-edit"),r("#wpadminbar a").attr("tabindex","-1"),r(o._contentClass).addClass("fl-builder-content-editing"),this.showMainToolbar(),e.preventDefault()},onClickPageBuilderToolbarLink:function(e){o.triggerHook("restartEditingSession"),e.preventDefault()},onPublish:function(){this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a span").css("color","#6bc373")},onPublishCacheClear:function(){o.ajax({action:"clear_cache_for_layout"},function(e){console.log(e)})},hide:function(){r("html").hasClass("fl-builder-edit")&&(o._unbindEvents(),o._destroyOverlayEvents(),o._removeAllOverlays(),r("html").removeClass("fl-builder-edit"),r("body").removeClass("admin-bar"),this.hideMainToolbar(),o.ContentPanel.hide(),FLBuilderLayout.init(),o.triggerHook("didHideEditingUI"))},show:function(){r("html").hasClass("fl-builder-edit")||(o._rebindEvents(),o._bindOverlayEvents(),this.showMainToolbar(),FLBuilderResponsiveEditing._switchTo("default"),r("html").addClass("fl-builder-edit"),r("body").addClass("admin-bar"),o.triggerHook("didShowEditingUI"))},beginPreview:function(){o._triggerSettingsSave(!1,!0)&&(this.isPreviewing=!0,this.hide(),r("html").addClass("fl-builder-preview"),r("html, body").removeClass("fl-builder-edit"),o._removeEmptyRowAndColHighlights(),o._removeColHighlightGuides(),o.triggerHook("didBeginPreview"),FLBuilderResponsivePreview.enter())},endPreview:function(){this.isPreviewing=!1,this.show(),o._highlightEmptyCols(),FLBuilderResponsivePreview.exit(),r("html").removeClass("fl-builder-preview"),r("html, body").addClass("fl-builder-edit")},togglePreview:function(){this.isPreviewing?this.endPreview():this.beginPreview()},hideMainToolbar:function(){this.$mainToolbar.addClass("is-hidden"),r("html").removeClass("fl-builder-is-showing-toolbar")},showMainToolbar:function(){this.unmuteToolbar(),this.$mainToolbar.removeClass("is-hidden"),r("html").addClass("fl-builder-is-showing-toolbar")},onDeviceIconClick:function(e){e=r(e.target).data("mode");FLBuilderResponsivePreview.switchTo(e),FLBuilderResponsivePreview._showSize(e)},muteToolbar:function(){this.$mainToolbarContent.addClass("is-muted"),o._hideTipTips()},unmuteToolbar:function(){this.$mainToolbarContent.removeClass("is-muted")}},l={isEditing:!0,init:function(){history.pushState&&(o.addHook("endEditingSession",this.onLeaveBuilder.bind(this)),o.addHook("restartEditingSession",this.onEnterBuilder.bind(this)))},onEnterBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.editUrl);const e=FL.Builder.data.getSystemActions();e.setIsEditing(!0),this.isEditing=!0},onLeaveBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.url);const e=FL.Builder.data.getSystemActions();e.setIsEditing(!1),this.isEditing=!1}},n={$row:null,$rowContent:null,row:null,drag:{},init:function(){var e;this.userCanResize()&&((e=r(o._contentClass)).on("mouseenter touchstart",".fl-row",this.onDragHandleHover.bind(this)),e.on("mousedown touchstart",".fl-block-row-resize",this.onDragHandleDown.bind(this)))},userCanResize:function(){return FLBuilderConfig.rowResize.userCanResizeRows},onDragHandleHover:function(e){var t,i,l,o,n,s;this.drag.isDragging||(t=this,i=r(e.target).closest(".fl-row"),l=i.data("node"),o=r(".fl-builder-row-settings[data-node="+l+"]"),n=o.find("[name=max_content_width_unit]"),s="px",t.onSettingsReady(l,function(e){n.length?s=n.val():void 0!==e&&(s=e.max_content_width_unit),t.$row=i,t.$rowContent=t.$row.find(".fl-row-content"),t.row={node:l,form:o,unit:s,isFixedWidth:t.$row.hasClass("fl-row-fixed-width"),parentWidth:("vw"===s?r(window):t.$row.parent()).width()},t.drag={edge:null,isDragging:!1,originalPosition:null,originalWidth:null,calculatedWidth:null,operation:null},t.row.isFixedWidth?t.drag.originalWidth=t.$row.width():t.drag.originalWidth=t.$rowContent.width(),t.dragInit()}))},onSettingsReady:function(e,t){var i=void 0!==FLBuilderSettingsConfig.nodes?FLBuilderSettingsConfig.nodes:null;null!==i&&void 0!==i[e]?(t(i[e]),null!=n._mouseEnterTimeout&&(clearTimeout(n._mouseEnterTimeout),n._mouseEnterTimeout=null)):(clearTimeout(n._mouseEnterTimeout),n._mouseEnterTimeout=setTimeout(this.onSettingsReady.bind(this),350,e,t))},onDragHandleDown:function(){r("body").addClass("fl-builder-row-resizing"),null!=n._mouseEnterTimeout&&(clearTimeout(n._mouseEnterTimeout),n._mouseEnterTimeout=null)},dragInit:function(e){this.$row.find(".fl-block-row-resize").draggable({axis:"x",start:this.dragStart.bind(this),drag:this.dragging.bind(this),stop:this.dragStop.bind(this)})},dragStart:function(e,t){var i=r("body"),t=r(t.helper);this.drag.isDragging=!0,this.row.isFixedWidth?this.drag.originalWidth=this.$row.width():this.drag.originalWidth=this.$rowContent.width(),t.hasClass("fl-block-col-resize-e")&&(this.drag.edge="e",this.$feedback=t.find(".fl-block-col-resize-feedback-left")),t.hasClass("fl-block-col-resize-w")&&(this.drag.edge="w",this.$feedback=t.find(".fl-block-col-resize-feedback-right")),i.addClass("fl-builder-row-resizing"),o._colResizing=!0,o._destroyOverlayEvents(),o._closePanel()},dragging:function(e,t){var i=t.position.left,t=t.originalPosition.left,l=this.drag.originalWidth,o=this.drag.edge,n=FLBuilderConfig.rowResize.minAllowedWidth,s=FLBuilderConfig.rowResize.maxAllowedWidth;FLBuilderConfig.isRtl&&(o="w"==o?"e":"w"),this.drag.operation=i<t?"w"===o?"+":"-":"e"===o?"+":"-",o=Math.abs(t-i),"+"===this.drag.operation?this.drag.calculatedWidth=l+2*o:this.drag.calculatedWidth=l-2*o,!1!==n&&this.drag.calculatedWidth<n&&(this.drag.calculatedWidth=n),!1!==s&&this.drag.calculatedWidth>s&&(this.drag.calculatedWidth=s),this.row.isFixedWidth&&this.$row.css("max-width",this.drag.calculatedWidth+"px"),this.$rowContent.css("max-width",this.drag.calculatedWidth+"px"),"px"!==this.row.unit&&(this.drag.calculatedWidth=Math.round(this.drag.calculatedWidth/this.row.parentWidth*100)),_.isUndefined(this.$feedback)||this.$feedback.html(this.drag.calculatedWidth+this.row.unit).show(),this.row.form.length&&this.row.form.find("[name=max_content_width]").val(this.drag.calculatedWidth),requestAnimationFrame(()=>{const e=FL.Builder.data.getLayoutActions();e.resizeRowContent(this.row.node,this.drag.calculatedWidth,!1)})},dragStop:function(e,t){this.drag.isDragging=!1,_.isUndefined(this.$feedback)||this.$feedback.hide();const i=FL.Builder.data.getLayoutActions();i.resizeRowContent(this.row.node,this.drag.calculatedWidth),o._bindOverlayEvents(),r("body").removeClass("fl-builder-row-resizing"),r(".fl-block-overlay").each(function(){o._buildOverlayOverflowMenu(r(this))}),setTimeout(function(){o._colResizing=!1},50),o.triggerHook("didResizeRow",{rowId:this.row.node,rowWidth:this.drag.calculatedWidth})}},s={templateName:"fl-toolbar",init:function(){this.template=wp.template(this.templateName),this.render(),this.initTipTips(),this.$el.find(".fl-builder-content-panel-button").on("click",o._togglePanel),this.$el.find(".fl-builder-buy-button").on("click",o._upgradeClicked),this.$el.find(".fl-builder-upgrade-button").on("click",o._upgradeClicked),this.$el.find("#fl-builder-toggle-notifications").on("click",this.onNotificationsButtonClicked.bind(this)),o.addHook("notificationsLoaded",this.onNotificationsLoaded.bind(this))},render:function(e){e=r(this.template(e));this.$el=e,this.el=e.get(0),i.$mainToolbar=this.$el,r("body").prepend(e),r("html").addClass("fl-builder-is-showing-toolbar")},initTipTips:function(){r(".fl-builder--saving-indicator").tipTip({defaultPosition:"bottom",edgeOffset:14}),r(".fl-builder-publish-actions .fl-builder-button-group .fl-builder-button").tipTip({defaultPosition:"bottom",edgeOffset:6})},onNotificationsButtonClicked:function(){o.triggerHook("toggleNotifications")},onNotificationsLoaded:function(){r("body").removeClass("fl-builder-has-new-notifications");o.ajax({action:"fl_builder_notifications",read:!0})}};r(function(){o.ContentPanel.init(),FLBuilderConfig.simpleUi||o.MainMenu.init(),FLBuilderConfig.showToolbar?(s.init(),o.ContentPanel.alignPanelArrow()):r("html").addClass("fl-builder-no-toolbar"),e.init(),i.init(),l.init(),n.init(),t.init(),o.triggerHook("didInitUI")})}(jQuery,FLBuilder),!function(o,n){var s=FLExtendableObject.create({templateName:"fl-main-menu-panel-view",name:"Untitled View",isShowing:!1,isRootView:!1,items:{},init:function(){this.template=wp.template(this.templateName)},render:function(){return this.template(this)},bindEvents:function(){this.$items=this.$el.find(".fl-builder--menu-item")},show:function(){this.$el.addClass("is-showing"),this.isShowing=!0},hide:function(){this.$el.removeClass("is-showing"),this.isShowing=!1},transitionIn:function(e){requestAnimationFrame(this.show.bind(this))},transitionOut:function(e){this.hide()}}),e=FLExtendableObject.create({templateName:"fl-main-menu-panel",template:null,menu:null,views:{},viewNavigationStack:[],isShowing:!1,shouldShowTabs:!1,init:function(){for(var e in this.template=wp.template(this.templateName),o("body").prepend(this.template(this)),this.$el=o(".fl-builder--main-menu-panel"),this.$el.find(".fl-builder--main-menu-panel-views").html(""),FLBuilderConfig.mainMenu)this.renderPanel(e);o("body").on("click",".fl-builder--main-menu-panel .pop-view",this.goToPreviousView.bind(this)),this.$tabs=this.$el.find(".fl-builder--tabs > span"),this.$tabs.on("click",this.onItemClick.bind(this)),this.$barTitle=o(".fl-builder-bar-title"),o("body").on("click",".fl-builder-bar-title",this.toggle.bind(this));var t=this.hide.bind(this);n.addHook("didShowPublishActions",t),n.addHook("didBeginSearch",t),n.addHook("didBeginPreview",t),n.addHook("didShowContentPanel",t),n.addHook("endEditingSession",t),n.addHook("didFocusSearchBox",t),n.addHook("didEnterRevisionPreview",t),n.addHook("didFailSettingsSave",t),n.addHook("showKeyboardShortcuts",t),this.$mask=o(".fl-builder--main-menu-panel-mask"),this.$mask.on("click",t),i.init(),l.init()},renderPanel:function(e){var t,i=this.views[e],l=FLBuilderConfig.mainMenu[e];l.handle=e,(l=s.create(l)).init(),t=o(l.render()),l.$el=t,o(".fl-builder--main-menu-panel-views").append(t),l.bindEvents(),l.$el.find(".fl-builder--menu-item").on("click",this.onItemClick.bind(this)),void 0!==i&&(i.$el.remove(),i.isShowing&&(this.currentView=l).show()),l.isRootView&&(this.rootView=l,this.currentView=l),this.views[e]=l},show:function(){this.isShowing||(this.$el.addClass("is-showing"),this.$barTitle.addClass("is-showing-menu"),this.currentView.transitionIn(),this.isShowing=!0,this.$mask.show(),n.triggerHook("didOpenMainMenu"))},hide:function(){this.isShowing&&(this.$el.removeClass("is-showing"),this.$barTitle.removeClass("is-showing-menu"),this.isShowing=!1,this.resetViews(),this.$mask.hide())},toggle:function(){this.isShowing?this.hide():this.show()},onItemClick:function(e){var t=o(e.currentTarget);switch(t.data("type")){case"view":var i=t.data("view");this.goToView(i);break;case"event":i=t.data("event");n.triggerHook(i,t)}},goToView:function(e){var t=this.currentView,e=this.views[e];t.transitionOut(),e.transitionIn(),this.currentView=e,this.viewNavigationStack.push(t)},goToPreviousView:function(){var e=this.currentView,t=this.viewNavigationStack.pop();e.transitionOut(!0),t.transitionIn(!0),this.currentView=t,o(".fl-builder-bar-title-caret").focus()},resetViews:function(){this.currentView!=this.rootView&&(this.currentView.hide(),this.rootView.show(),this.currentView=this.rootView,this.viewNavigationStack=[])}}),i=(n.MainMenu=e,{init:function(){var e;n.addHook("saveTemplate",this.saveTemplate.bind(this)),n.addHook("saveCoreTemplate",this.saveCoreTemplate.bind(this)),n.addHook("duplicateLayout",this.duplicateLayout.bind(this)),n.addHook("showLayoutSettings",this.showLayoutSettings.bind(this)),n.addHook("showGlobalSettings",this.showGlobalSettings.bind(this)),n.addHook("toggleUISkin",this.toggleUISkin.bind(this)),n.addHook("clearLayoutCache",this.clearLayoutCache.bind(this)),n.addHook("launchThemerLayouts",this.launchThemerLayouts.bind(this)),"FL"in window&&"Builder"in FL&&(e=FL.Builder.data.getSystemActions(),n.addHook("showKeyboardShortcuts",function(){e.setShouldShowShortcuts(!0)}))},saveTemplate:function(){n._saveUserTemplateClicked(),e.hide()},saveCoreTemplate:function(){FLBuilderCoreTemplatesAdmin._saveClicked(),e.hide()},duplicateLayout:function(){n._duplicateLayoutClicked(),e.hide()},showGlobalSettings:function(){n._globalSettingsClicked(),e.hide()},showLayoutSettings:function(){n._layoutSettingsClicked(),e.hide()},clearLayoutCache:function(){n.ajax({action:"clear_cache"},function(){location.href=FLBuilderConfig.editUrl}),n.showAjaxLoader(),e.hide()},toggleUISkin:function(e){o('a[data-event="toggleUISkin"]');var t,i,l=o("body");l.hasClass("fl-builder-ui-skin--light")&&(t="light",i="dark"),l.hasClass("fl-builder-ui-skin--dark")&&(t="dark",i="light"),l.removeClass("fl-builder-ui-skin--"+t).addClass("fl-builder-ui-skin--"+i),l.removeClass("fluid-color-scheme-"+t).addClass("fluid-color-scheme-"+i),"Builder"in FL&&"data"in FL.Builder&&FL.Builder.data.getSystemActions().setColorScheme(i),n.ajax({action:"save_ui_skin",skin_name:i})},launchThemerLayouts:function(){FLBuilderConfig.lite?n._showProMessage("Themer Layouts"):window.open(FLBuilderConfig.themerLayoutsUrl),e.hide()}}),l={init:function(){n.addHook("beginTour",this.onStartTourClicked.bind(this))},onStartTourClicked:function(){FLBuilderTour.start(),e.hide()}}}(jQuery,FLBuilder),!function(n,o){var s=FLExtendableObject.create({handle:"",name:"",panel:null,shouldShowTabItem:!0,isShowing:!1,views:{},activeView:null,defaultView:null,categorySelector:null,init:function(e){this.categorySelector=i.create({handle:"selector-"+this.handle,tab:this,items:[]}),this.categorySelector.init(),n(this.categorySelector).on("categorySelected",this.onViewSelected.bind(this));var t;e.views;this.initViews(e.views),0===Object.keys(this.views).length&&this.addView(t={handle:"noViews",name:"No Views",templateName:"fl-content-panel-no-view"}),this.activeView||(e=Object.keys(this.views)[0],t=this.views[e],this.activeView=t),this.defaultView=this.activeView,n(this.panel).on("afterRender",this.renderView.bind(this,this.activeView)),n(this.panel).on("onShow onShowTab",this.initScroller.bind(this)),o.addHook("contentItemsChanged",this.onLibraryDataChanged.bind(this))},initViews:function(e){for(var t in e){t=e[t];this.categorySelector.addItem(t),"separator"!==t.type&&this.addView(t)}},addView:function(e){var t=l;switch(this.handle){case"modules":t=r;break;case"rows":t=a;break;case"templates":t=d;break;case"saved":t=u;break;default:t=l}var e=(t=_.isNull(this.viewController)||_.isUndefined(this.viewController)?t:window[this.viewController]).create(e),i=e.handle;e.init(),(this.views[i]=e).isShowing&&(this.activeView=e)},renderView:function(e){var t;this.$el=this.panel.$el.find('.fl-builder--panel-view[data-tab="'+this.handle+'"]'),e=_.isObject(e)?e:this.views[e],_.isObject(e)&&_.isFunction(e.render)&&(t=e.render(),this.$el.find(".fl-nanoscroller-content").html(t),this.activeView=e,o._initSortables(),this===this.panel.activeTab&&this.renderGroupSelector(),this.initScroller(),this.$el.find(".fl-nanoscroller-content").scrollTop(0))},initScroller:function(){this.$el.nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"})},show:function(){n(this.activeView).trigger("onBeforeShow"),this.renderGroupSelector(),this.isShowing=!0,this.$el.addClass("is-showing"),this.$el.find(".fl-nanoscroller-content").scrollTop(0)},hide:function(){this.isShowing=!1,this.$el.removeClass("is-showing"),this.activeView!==this.defaultView&&this.renderView(this.defaultView),_.isObject(this.categorySelector)&&this.categorySelector.close()},renderGroupSelector:function(){var e,t=this.panel.$groupSelect,i=this.panel.$el.find(".fl-builder-panel-search");this.isSearchEnabled?i.show():i.hide(),1<Object.keys(this.views).length&&!_.isUndefined(this.categorySelector)?(e=this.categorySelector.render(),this.panel.$el.find(".fl-builder-content-group-select"),t.html(e),t.show(),this.panel.$el.removeClass("single-view")):(t.hide(),i.hide(),this.panel.$el.addClass("single-view"))},onViewSelected:function(e,t){this.renderView(t),this.categorySelector.close()},onLibraryDataChanged:function(){this.renderView(this.activeView)}}),l=FLExtendableObject.create({templateName:"",name:"",handle:"",query:null,init:function(){this.template=wp.template(this.templateName),n(this).on("afterRender",this.bindEvents.bind(this)),n(this).trigger("afterInit")},filterTemplateData:function(e){return _.isNull(this.query)||_.isUndefined(this.query)||(e.queryResults=o.Search.byQuery(this.query)),e},render:function(){n(this).trigger("beforeRender");var e=this.filterTemplateData(this),e=n(this.template(e));return this.$el=e,n(this).trigger("afterRender"),e},bindEvents:function(){},transitionIn:function(){},transitionOut:function(){}}),r=l.create({templateName:"fl-content-panel-modules-view",bindEvents:function(){this.$sections=this.$el,this.$items=this.$el.find(".fl-builder-block, .fl-builder-blocks-section-title")}}),a=l.create({templateName:"fl-content-panel-row-templates-view",bindEvents:function(){this.$items=this.$el.find(".fl-builder-block, .fl-builder-blocks-section-title")}}),d=l.create({templateName:"fl-content-panel-templates-view",bindEvents:function(){this.$items=this.$el.find(".fl-builder--template-collection-item"),this.$items.on("click",this.onTemplateClick.bind(this)),this.$userTemplateSections=n(".fl-user-templates"),this.$userTemplates=this.$el.find(".fl-user-template, .fl-builder--save-new-user-template"),this.$saveNewTemplateInput=this.$el.find('.fl-save-control input[name="template-name"]'),this.$saveNewTemplateCat=this.$el.find('.fl-save-control input[name="template-category"]'),this.$saveNewTemplateBtn=this.$el.find(".fl-save-control button"),this.$saveNewMask=this.$el.find(".fl-save-control-mask"),this.$saveNewTemplateInput.on("focus",this.onSaveInputFocus.bind(this)),this.$saveNewTemplateInput.on("keyup",this.onSaveInputKeyup.bind(this)),this.$saveNewTemplateBtn.on("click",this.onSaveButtonClick.bind(this)),this.$saveNewMask.on("click",this.resetSaveInput.bind(this))},onSaveInputFocus:function(){this.resetSaveInput(),this.$saveNewMask.show()},resetSaveInput:function(){this.$saveNewTemplateInput.val(""),this.$saveNewTemplateBtn.hide(),this.$saveNewMask.hide()},onSaveInputKeyup:function(e){var e=n(e.currentTarget),t=e.val(),e=e.siblings("button");""!==t?e.show():e.hide()},onSaveButtonClick:function(e){var e=n(e.currentTarget),t=e.siblings('input[name="template-name"]').val(),e=e.siblings('input[name="template-category"]').val();""!==t&&o.ajax({action:"save_user_template",settings:{name:t,category:e}},o._saveUserTemplateSettingsComplete)},onTemplateClick:function(e){var e=n(e.currentTarget),t=e.data("id"),i=e.data("type"),l=e.data("premium");FLBuilderConfig.lite&&l?o._showProMessage(e.find(".fl-builder--template-name").text()):o._requestTemplateInsert(t,i)}}),u=l.create({templateName:"fl-content-panel-saved-view",filterTemplateData:function(e){return e.queryResults=o.Search.byQuery({kind:"template",type:"user",content:["module","column","row"]}),e}}),i=FLExtendableObject.create({templateName:"fl-content-panel-category-selector",template:null,tab:null,isOpen:!1,items:{},init:function(){this.template=wp.template(this.templateName),n(this).on("afterRender",this.bindEvents.bind(this)),n(this.tab.panel).on("didShowSearchControls",this.close.bind(this))},render:function(){this.close();var e=n(this.template(this));return this.$el=e,n(this).trigger("afterRender"),e},bindEvents:function(){this.$selectorTitle=this.$el.find(".fl-builder--selector-display"),this.$selectorTitle.on("click",this.toggleOpenClose.bind(this)),this.$categories=this.$el.find(".fl-builder--selector-menu .fl-builder--menu-item"),this.$categories.on("click",this.onCategoryClick.bind(this))},addItem:function(e){var t=_.isUndefined(e.handle)?_.uniqueId("sep_"):e.handle;this.items[t]=e},open:function(){this.isOpen||(this.$el.addClass("is-showing"),this.isOpen=!0)},close:function(){this.isOpen&&(this.$el.removeClass("is-showing"),this.isOpen=!1,this.$selectorTitle.find("button").focus())},toggleOpenClose:function(){this.isOpen?this.close():this.open()},onCategoryClick:function(e){var t,e=n(e.target),i=e.data("view");e.hasClass("fl-has-children")?((t=n('[data-parent="'+i+'"]')).is(":visible")?(this.items[i].hasChildrenOpen=!1,e.removeClass("fl-has-children-showing"),t.hide()):(this.items[i].hasChildrenOpen=!0,e.addClass("fl-has-children-showing"),t.show()),e.blur()):n(this).trigger("categorySelected",i)}});o.ContentPanel=FLExtendableObject.create({templateName:"fl-content-panel-base",template:null,tabs:{},activeTab:null,isShowing:!1,init:function(){if(FLBuilderConfig.panelData){var e,t=FLBuilderConfig.panelData.tabs;for(e in t){var i=t[e],l=s.create(i);l.panel=this,l.views={},l.init(i),(this.tabs[e]=l).isShowing&&(this.activeTab=l),this.activeTab||(i=Object.keys(this.tabs)[0],(l=this.tabs[i]).isShowing=!0,this.activeTab=l)}this.template=wp.template(this.templateName),this.render(),this.renderSearchResults=wp.template("fl-search-results-panel"),this.renderNoResults=wp.template("fl-search-no-results"),o.triggerHook("contentPanelDidInit")}},render:function(){n("body").prepend(this.template(this)),this.$el=n(".fl-builder--content-library-panel"),this.bindEvents(),this.$groupSelect=this.$el.find(".fl-builder-content-group-select"),n(this).trigger("afterRender")},bindEvents:function(){this.$tabs=this.$el.find(".fl-builder--tabs [data-tab]"),this.$tabs.on("mouseup",this.onTabItemMouseUp.bind(this)),this.$tabs.on("click",this.onTabItemClick.bind(this)),this.$search=this.$el.find(".fl-builder-panel-search"),this.$searchBtn=this.$search.find(".fl-builder-toggle-panel-search"),this.$searchInput=this.$search.find('input[name="search-term"]'),this.$searchBtn.on("click",this.onSearchButtonClicked.bind(this)),this.$search.find(".fl-builder-dismiss-panel-search").on("click",this.onDismissButtonClicked.bind(this)),this.$searchInput.on("keyup",this.onSearchTermChanged.bind(this)),this.$searchPanel=this.$el.find(".fl-builder--search-results-panel"),o.addHook("showContentPanel",this.show.bind(this)),o.addHook("showModules",this.show.bind(this,"modules")),o.addHook("showRows",this.show.bind(this,"rows")),o.addHook("showTemplates",this.show.bind(this,"templates")),o.addHook("showSaved",this.show.bind(this,"saved")),o.addHook("showSearch",this.goToSearch.bind(this));var e=this.hide.bind(this),e=(o.addHook("hideContentPanel",e),o.addHook("didShowLightbox",e),o.addHook("didShowPublishActions",e),o.addHook("didBeginSearch",e),o.addHook("didInitDrag",e),o.addHook("didOpenMainMenu",e),o.addHook("didApplyTemplate",e),this.toggleShowHide.bind(this));o.addHook("toggleContentPanel",e),o.addHook("didStopDrag",this.hideSearchControls.bind(this))},alignPanelArrow:function(){var e,t=this.$el,i=this.$el.find(".fl-builder--panel-arrow"),l=n(".fl-builder-content-panel-button"),o=this.$el.css("animation-duration");0!=l.length&&(this.$el.css("animation-duration","0s"),this.show(),t=t[0].getBoundingClientRect(),e=i[0].getBoundingClientRect(),this.hide(),this.$el.css("animation-duration",o),o=(l=(o=l[0].getBoundingClientRect()).x+o.width/2)<t.x?20:l-t.x-e.width/2,i.css({right:"auto",left:o+"px"}))},show:function(e){if("module"!==FLBuilderConfig.userTemplateType&&!FLBuilderConfig.simpleUi&&(o.triggerHook("willShowContentPanel"),void 0!==e&&this.showTab(e),!this.isShowing&&o._triggerSettingsSave(!1,!0)&&(n("body").addClass("fl-builder-content-panel-is-showing"),this.isShowing=!0,n(this).trigger("onShow"),o.triggerHook("didShowContentPanel"),"Builder"in FL&&"data"in FL.Builder))){const t=FL.Builder.data.getSystemActions();t.hideCurrentPanel()}},hide:function(){!this.isShowing||this.$el.hasClass("fl-builder-ui-pinned")||(n("body").removeClass("fl-builder-content-panel-is-showing"),this.isShowing=!1,n(this).trigger("onHide"),o.triggerHook("didHideContentPanel"))},toggleShowHide:function(){this.isShowing?this.hide():this.show()},showTab:function(e){e=this.tabs[e];_.isObject(e)&&(_.isObject(this.activeTab)&&(this.activeTab.hide(),this.$tabs.filter(".is-showing").removeClass("is-showing")),this.hideSearchControls(),e.show(),this.$tabs.filter('[data-tab="'+e.handle+'"]').addClass("is-showing"),this.activeTab=e,n(this).trigger("onShowTab"))},goToSearch:function(){this.show("modules"),this.$el.find(".fl-builder-toggle-panel-search").trigger("click")},onTabItemMouseUp:function(e){n(e.currentTarget).blur()},onTabItemClick:function(e){e=n(e.target).data("tab");this.showTab(e)},onSearchButtonClicked:function(){this.showSearchControls()},onDismissButtonClicked:function(){this.hideSearchControls(),this.$searchBtn.focus()},showSearchControls:function(){this.$search.addClass("is-showing-input"),this.$search.find('input[name="search-term"]').focus(),n(".fl-builder--selector-display-label").attr("tabindex",-1),this.$searchBtn.attr("tabindex",-1),n(this).trigger("didShowSearchControls")},hideSearchControls:function(){this.$search.removeClass("is-showing-input"),this.clearSearchInput(),this.hideSearchResults(),n(".fl-builder--selector-display-label").attr("tabindex",null),this.$searchBtn.attr("tabindex",null)},onSearchTermChanged:function(e){var t=this.$searchInput.val();""!==t&&""!=(t=o.Search.byTerm(t)).term?this.showSearchResults(t):this.hideSearchResults()},clearSearchInput:function(){this.$searchInput.val(""),this.hideSearchResults()},showSearchResults:function(e){var t;0<e.total?(t=n(this.renderSearchResults(e)),this.$searchPanel.html(t),o._initSortables()):(t=n(this.renderNoResults(e)),this.$searchPanel.html(t)),n("body").addClass("fl-builder-search-results-panel-is-showing")},hideSearchResults:function(){n("body").removeClass("fl-builder-search-results-panel-is-showing")}})}(jQuery,FLBuilder),!function(c){FLBuilderSettingsForms={config:null,settings:null,legacyXhr:null,init:function(){this.bind()},bind:function(){FLBuilder.addHook("didDeleteRow",this.closeOnDeleteNode),FLBuilder.addHook("didDeleteColumn",this.closeOnDeleteNode),FLBuilder.addHook("didDeleteModule",this.closeOnDeleteNode)},render:function(e,t){var i=FLBuilderSettingsConfig.forms,l=FLBuilderSettingsConfig.modules;if(e.nodeId&&!e.settings)this.loadNodeSettings(e,t);else if(t=void 0===t?function(){}:t,(e=c.extend({type:"general",id:null,nodeId:null,className:"",attrs:"",title:"",badges:[],tabs:[],activeTab:null,buttons:[],settings:{},legacy:null,rules:null,preview:null,helper:null,messages:null},e)).id){if("general"===e.type&&void 0!==i[e.id])e=c.extend(!0,e,i[e.id]);else{if("module"!==e.type||void 0===l[e.id])return;e=c.extend(!0,e,l[e.id])}this.config=e,this.renderLightbox(e)&&(e.legacy||!this.renderLegacySettings(e,t)?this.renderComplete(e,t):this.showLightboxLoader());i=FL.Builder.data.getSystemState().currentPanel;if(null!==i&&"outline"!==i){const o=FL.Builder.data.getSystemActions();o.hideCurrentPanel()}}},cacheCurrentSettings:function(){var e=c(".fl-builder-settings:visible");e.closest(".fl-lightbox-wrap[data-parent]").length||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,e),FLBuilder.preview&&(FLBuilder.preview._savedSettings=this.settings))},loadNodeSettings:function(t,i){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"get_node_settings",node_id:t.nodeId},function(e){t.settings=FLBuilder._jsonParse(e),FLBuilderSettingsConfig.nodes[t.nodeId]=t.settings,FLBuilderSettingsForms.render(t,i),FLBuilder.hideAjaxLoader()})},renderLightbox:function(e){var t=wp.template("fl-builder-settings"),i=FLBuilder._lightbox._node.find("form.fl-builder-settings"),l=(c(".fl-lightbox-wrap[data-parent]"),localStorage.getItem("fl-builder-settings-tab"));if(e.nodeId&&e.nodeId===i.data("node")&&!e.lightbox)return FLBuilder._focusFirstSettingsControl(),!1;if(e.hide)return!0;if(l)for(var o in e.tabs)o===l.replace("fl-builder-settings-tab-","")&&(e.activeTab=o);if(e.activeTab||(e.activeTab=Object.keys(e.tabs).shift()),e.lightbox)e.lightbox.setContent(t(e));else{if(!FLBuilder._triggerSettingsSave(!0,!0))return!1;FLBuilder.preview&&FLBuilder.preview.cancel(),FLBuilder._closePanel(),FLBuilder._showLightbox(t(e))}return!0},renderComplete:function(e,t){setTimeout(function(){e.legacy&&this.renderLegacySettingsComplete(e.legacy),t(),FLBuilder._initSettingsForms(),e.rules&&FLBuilder._initSettingsValidation(e.rules,e.messages),e.preview&&(FLBuilder.preview=new FLBuilderPreview(e.preview)),e.helper&&e.helper.init(),this.cacheCurrentSettings()}.bind(this),1)},renderFields:function(e,t){var i,l,o=wp.template("fl-builder-settings-row"),n="",s=null,r=null,a=null,d=["align","border","dimension","unit","photo","select","typography"],t=t||this.config.settings,u=FLBuilderConfig.global;for(s in e)l=!!(i=e[s]).multiple,supportsResponsive=-1<c.inArray(i.type,d),r=_.isUndefined(t[s])?"":t[s],i.type&&(_.isUndefined(t[s])&&i.default&&(r=i.default),a=i.responsive&&u.responsive_enabled&&!l&&supportsResponsive?i.responsive:null,n+=o({field:i,name:s,rootName:s,value:r,preview:JSON.stringify(i.preview||{type:"refresh"}),responsive:a,rowClass:i.row_class?" "+i.row_class:"",isMultiple:l,supportsMultiple:"editor"!==i.type&&"service"!==i.type,settings:t,globalSettings:u,template:c("#tmpl-fl-builder-field-"+i.type)}));return n},renderField:function(e){return wp.template("fl-builder-field")(e)},renderSectionTemplate:function(e,t){return wp.template(e.template.id)({section:e,settings:t})},renderTabTemplate:function(e,t){return wp.template(e.template.id)({tab:e,settings:t})},renderLegacySettings:function(t,i){var e=c(".fl-builder-settings:visible"),l=null,o=!1,n={tabs:[],sections:[],fields:[],settings:null,node_id:null};return e.find(".fl-legacy-field").each(function(){l=c(this),n.fields.push(l.attr("data-field")),FLBuilderSettingsForms.showFieldLoader(l),o=!0}),e.find(".fl-legacy-settings-section").each(function(){l=c(this),n.sections.push({tab:l.attr("data-tab"),section:l.attr("data-section")}),o=!0}),e.find(".fl-legacy-settings-tab").each(function(){l=c(this),n.tabs.push(l.attr("data-tab")),o=!0}),e.attr("data-node")?n.node_id=e.attr("data-node"):n.settings=FLBuilder._getOriginalSettings(e,!0),this.legacyXhr&&(this.legacyXhr.abort(),this.legacyXhr=null),this.legacyXhr=FLBuilder.ajax(c.extend(this.getLegacyVars(),{action:"render_legacy_settings",data:n,form:e.attr("data-form-id"),group:e.attr("data-form-group"),lightbox:e.closest(".fl-builder-lightbox").attr("data-instance-id")}),function(e){FLBuilderSettingsForms.renderLegacySettingsComplete(e),o&&FLBuilderSettingsForms.renderComplete(t,i),FLBuilderSettingsForms.hideLightboxLoader()}),o},renderLegacySettingsComplete:function(e){var i="object"==typeof e?e:FLBuilder._jsonParse(e),e=null,t=null,l="",o=null,n=null;if(i.lightbox?t=(e=c(".fl-builder-lightbox[data-instance-id="+i.lightbox+"]")).length?e.find(".fl-builder-settings"):null:e=(t=c(".fl-builder-settings:visible")).closest(".fl-builder-lightbox"),t&&t.length){for(l in i.fields)(o=c("#fl-field-"+l).attr("id","")).after(i.fields[l]).remove();for(l in i.extras)o=c("#fl-field-"+l).find(".fl-field-control-wrapper"),i.extras[l].multiple?o.each(function(e,t){e in i.extras[l].before&&""!=i.extras[l].before[e]&&c(this).prepend('<div class="fl-form-field-before">'+i.extras[l].before[e]+"</div>"),e in i.extras[l].after&&""!=i.extras[l].after[e]&&c(this).append('<div class="fl-form-field-after">'+i.extras[l].after[e]+"</div>")}):(""!=i.extras[l].before&&o.prepend('<div class="fl-form-field-before">'+i.extras[l].before+"</div>"),""!=i.extras[l].after&&o.append('<div class="fl-form-field-after">'+i.extras[l].after+"</div>"));for(n in i.sections)for(l in i.sections[n])c("#fl-builder-settings-section-"+l).html(i.sections[n][l]);for(l in i.tabs)(n=c("#fl-builder-settings-tab-"+l)).html(i.tabs[l]);e.data("parent")||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,t),FLBuilder.preview&&(this.settings=c.extend(this.settings,FLBuilder.preview._savedSettings),FLBuilder.preview._savedSettings=this.settings)),_.isUndefined(window.FLThemeBuilderFieldConnections)||FLThemeBuilderFieldConnections._initSettingsForms(),this.legacyXhr=null}},getLegacyVars:function(){var e=c(".fl-builder-settings:visible"),t=e.closest(".fl-builder-lightbox").attr("data-parent"),i={};return t&&(e=(t=c(".fl-builder-lightbox[data-instance-id="+t+"]")).find("form.fl-builder-settings"),t=FLBuilder._getSettings(e),(e=e.attr("data-node"))&&(i.node_id=e,i.node_settings=t)),i},settingsHaveChanged:function(){var e=FLBuilder._lightbox._node.find("form.fl-builder-settings"),e=FLBuilder._getSettings(e);return!!this.settings&&JSON.stringify(this.settings)!=JSON.stringify(e)},closeOnDeleteNode:function(e){var t=c(".fl-builder-settings[data-node]"),i=FLBuilder._contentClass+" .fl-node-"+t.data("node");t.length&&!c(i).length&&FLLightbox.closeAll()},showLightboxLoader:function(){c(".fl-builder-settings:visible").append('<div class="fl-builder-loading"></div>')},hideLightboxLoader:function(e){c(".fl-builder-settings:visible .fl-builder-loading").remove()},showFieldLoader:function(e){e.closest(".fl-field-control").find(".fl-field-control-wrapper").hide().after('<div class="fl-field-loader">'+FLBuilderStrings.fieldLoading+"</div>")},hideFieldLoader:function(e){var t=e.closest(".fl-field");e.closest(".fl-field-control").find(".fl-field-control-wrapper").show(),t.find(".fl-field-loader").remove()}},FLBuilderSettingsConfig="undefined"==typeof FLBuilderSettingsConfig?{}:FLBuilderSettingsConfig,c.extend(FLBuilderSettingsConfig,{init:function(){FLBuilder.addHook("didSaveNodeSettings",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveNodeSettingsComplete",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveLayoutSettingsComplete",this.updateOnSaveLayoutSettings.bind(this)),FLBuilder.addHook("didSaveGlobalSettingsComplete",this.updateOnSaveGlobalSettings.bind(this)),FLBuilder.addHook("didSaveGlobalSettingsComplete",this.reload),FLBuilder.addHook("didAddRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddColumnGroup",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didResizeRow",this.updateOnRowResize.bind(this)),FLBuilder.addHook("didResizeColumn",this.updateOnColumnResize.bind(this)),FLBuilder.addHook("didResetRowWidth",this.updateOnResetRowWidth.bind(this)),FLBuilder.addHook("didResetColumnWidths",this.updateOnResetColumnWidths.bind(this)),FLBuilder.addHook("didApplyTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didApplyRowTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didApplyColTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didSaveGlobalNodeTemplate",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didRestoreRevisionComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didRestoreHistoryComplete",this.updateOnHistoryRestored.bind(this))},reload:function(){var e=FLBuilderConfig.editUrl+"&fl_builder_load_settings_config=core";c('script[src*="fl_builder_load_settings_config=core"]').remove(),c("head").append('<script src="'+e+'"><\/script>')},updateOnSaveGlobalSettings:function(e,t){this.settings.global=t,FLBuilderConfig.global=t},updateOnSaveLayoutSettings:function(e,t){this.settings.layout=t},updateOnNodeEvent:function(){var e=arguments[0];-1<e.namespace.indexOf("didAdd")?this.addNode("object"==typeof arguments[1]?arguments[1].nodeId:arguments[1]):-1<e.namespace.indexOf("didSaveNodeSettings")?this.updateNode(arguments[1].nodeId,arguments[1].settings):-1<e.namespace.indexOf("didDelete")?this.deleteNodes("object"==typeof arguments[1]?arguments[1].nodeId:arguments[1]):-1<e.namespace.indexOf("didDuplicate")&&this.duplicateNode(arguments[1].oldNodeId,arguments[1].newNodeId)},updateOnRowResize:function(e,t){this.nodes[t.rowId].max_content_width=t.rowWidth},updateOnResetRowWidth:function(e,t){this.nodes[t].max_content_width=""},updateOnColumnResize:function(e,t){this.nodes[t.colId].size=t.colWidth,this.nodes[t.siblingId].size=t.siblingWidth},updateOnResetColumnWidths:function(e,t){var i=this;t.cols.each(function(){var e=c(this),t=e.attr("data-node");i.nodes[t]&&(i.nodes[t].size=parseFloat(e[0].style.width))})},updateOnApplyTemplate:function(e,t){this.nodes=t.nodes,this.attachments=t.attachments},updateOnHistoryRestored:function(e,t){this.nodes=t.config.nodes,this.attachments=t.config.attachments,this.settings.layout=t.settings.layout,this.settings.global=t.settings.global,FLBuilderConfig.global=t.settings.global},addNode:function(e,t){var i=c(".fl-node-"+e),l=i.hasClass("fl-row"),o=i.hasClass("fl-col"),n=i.hasClass("fl-col-group"),s=i.hasClass("fl-module"),r=this;this.nodes[e]||(t||(l?t=c.extend({},this.defaults.row):o?t=c.extend({},this.defaults.column):s&&(t=c.extend({},this.defaults.modules[i.attr("data-type")])),l||n?i.find(".fl-col").each(function(){var e=c(this),t=c.extend({},r.defaults.column);t.size=parseFloat(e[0].style.width),r.addNode(e.attr("data-node"),t)}):s&&(r.addNode(i.closest(".fl-row").attr("data-node")),r.addNode(i.closest(".fl-col").attr("data-node")),r.updateOnResetColumnWidths(null,{cols:i.closest(".fl-col-group").find("> .fl-col")}))),t&&(this.nodes[e]=t))},updateNode:function(e,i){var t=c(".fl-node-"+e),l=this;t.hasClass("fl-col")&&t.closest(".fl-col-group").find("> .fl-col").each(function(){var e=c(this),t=e.attr("data-node");l.nodes[t].size=parseFloat(e[0].style.width),l.nodes[t].equal_height=i.equal_height,l.nodes[t].content_alignment=i.content_alignment,l.nodes[t].responsive_order=i.responsive_order}),this.nodes[e]=i},duplicateNode:function(t,i){var e=c(".fl-node-"+i).find("[data-node]"),l=c(".fl-node-"+t).find("[data-node]"),o=this;this.nodes[i]=this.nodes[t],e.each(function(e){t=l.eq(e).attr("data-node"),i=c(this).attr("data-node"),o.nodes[t]&&(o.nodes[i]=o.nodes[t])})},deleteNodes:function(){var e="",t=c(FLBuilder._contentClass).html();if(t)for(e in this.nodes)-1===t.indexOf(e)&&(this.nodes[e]=null,delete this.nodes[e])}}),c(function(){FLBuilderSettingsConfig.init(),FLBuilderSettingsForms.init()})}(jQuery),!function(c){FLBuilderSettingsCopyPaste={init:function(){FLBuilder.addHook("settings-form-init",this.initExportButton),FLBuilder.addHook("settings-form-init",this.initImportButton)},initExportButton:function(){new ClipboardJS("button.module-export-all",{text:function(e){var t=c(".fl-builder-module-settings").data("node"),t=c(".fl-builder-module-settings[data-node="+t+"]"),i=c(".fl-builder-module-settings").data("type"),t=FLBuilder._getSettings(t),i="/// {type:"+i+"} "+(new Date).toDateString()+" ///",l=c("button.module-export-all"),o=l.attr("title");return l.text(FLBuilderStrings.module_import.copied),setTimeout(function(){l.text(o)},1e3),i+"\n"+JSON.stringify(t)}}),new ClipboardJS("button.module-export-style",{text:function(e){var t,i=c(".fl-builder-module-settings").data("node"),l=c(".fl-builder-module-settings[data-node="+i+"]"),i=c(".fl-builder-module-settings").data("type"),o=FLBuilder._getSettings(l),i="/// {type:"+i+"} "+(new Date).toDateString()+" ///",n=c("button.module-export-style"),s=n.attr("title"),r={};for(t in o){var a=l.find('[name="'+t+'"]'),d=l.find('[name*="'+t+'["]'),u=!1;a.length?u=a.closest(".fl-field").data("is-style"):d.length&&(u=d.closest(".fl-field").data("is-style")),u&&(r[t]=o[t])}return n.text(FLBuilderStrings.module_import.copied),setTimeout(function(){n.text(s)},1e3),i+"\n"+JSON.stringify(r)}})},initImportButton:function(){c("button.module-import-apply").click(function(){var e=c(".fl-builder-settings-lightbox .fl-builder-settings"),t=c(".module-import-input").val(),i=t.match(/\/\/\/\s\{type:([_a-z0-9-]+)/i),l=!1,o=c(".fl-builder-module-settings").data("type"),n=c(".fl-builder-settings-lightbox .module-import-error");if(n.hide(),!(l=i&&void 0!==i[1]?i[1]:l)||l!==o)return n.html(FLBuilderStrings.module_import.type).show(),!1;i=t.replace(/\/\/\/.+\/\/\//,"");try{var s=JSON.parse(i)}catch(e){s=!1;return n.html(FLBuilderStrings.module_import.error).show(),!1}if(s){l=e.attr("data-node"),o=c.extend({},FLBuilderSettingsConfig.nodes[l],s);FLBuilderSettingsConfig.nodes[l]=o;const r=FL.Builder.data.getLayoutActions();t=FLBuilder._saveSettingsComplete.bind(this,!0,null);r.updateNodeSettings(l,o,t),FLBuilder.triggerHook("didSaveNodeSettings",{nodeId:l,settings:o}),FLBuilder._lightbox.close()}})}},c(function(){FLBuilderSettingsCopyPaste.init()})}(jQuery),!function(a){var e={minWidth:320,maxWidth:600,minHeight:400,init:function(){this.initPanel(),this.pinOrUnpin(),this.bind()},bind:function(){var e=a(window),t=a("body");e.on("resize",_.throttle(this.windowResize.bind(this),250)),t.on("click",".fl-builder-ui-pinned-collapse",this.collapse),t.on("click",".fl-builder--content-library-panel .fl-builder--tabs",this.closeLightboxOnPanelClick),FLBuilder.addHook("didShowLightbox",this.pinLightboxOnOpen.bind(this)),FLBuilder.addHook("didHideAllLightboxes",this.pinnedLightboxClosed.bind(this)),FLBuilder.addHook("endEditingSession",this.hide.bind(this)),FLBuilder.addHook("didHideEditingUI",this.hide.bind(this)),FLBuilder.addHook("publishButtonClicked",this.hide.bind(this)),FLBuilder.addHook("restartEditingSession",this.show.bind(this)),FLBuilder.addHook("didShowEditingUI",this.show.bind(this)),FLBuilder.addHook("didShowLightbox",this.uncollapse.bind(this)),FLBuilder.addHook("willShowContentPanel",this.uncollapse.bind(this)),FLBuilder.addHook("willShowContentPanel",this.closeLightboxOnPanelClick.bind(this))},isPinned:function(){return a(".fl-builder--content-library-panel").hasClass("fl-builder-ui-pinned")},pin:function(e,t){this.pinPanel(e),this.pinLightboxes(),t&&this.savePosition(),FLBuilder._resizeLayout(),FLBuilder.triggerHook("didPinContentPanel")},unpin:function(e){this.unpinLightboxes(),this.unpinPanel(),e&&this.savePosition(),FLBuilder._resizeLayout(),FLBuilder.triggerHook("didUnpinContentPanel")},pinOrUnpin:function(){var e=a(".fl-builder--content-library-panel"),t=this.isPinned();e.hasClass("fl-builder-ui-pinned-hidden")||(window.innerWidth<=this.maxWidth?(t&&this.unpin(!1),this.disableDragAndResize()):(t||this.restorePosition(),this.enableDragAndResize()))},show:function(){var e=a(".fl-builder--content-library-panel");e.hasClass("fl-builder-ui-pinned-hidden")&&(e.removeClass("fl-builder-ui-pinned-hidden"),e.show(),this.restorePosition())},hide:function(){var e=a("body"),t=a(".fl-builder--content-library-panel");this.isPinned()&&(this.uncollapse(),t.addClass("fl-builder-ui-pinned-hidden"),t.hide(),e.css("margin",""),FLBuilder._resizeLayout())},collapse:function(){var e=a(this).find("i:visible"),t=a("body"),i=e.data("toggle"),e=e.data("position"),l=a(".fl-builder--content-library-panel"),o=l.outerWidth();"hide"===i?(l.css(e,"-"+o+"px"),t.css("margin-"+e,""),t.addClass("fl-builder-ui-pinned-is-collapsed")):(l.css(e,"0px"),t.css("margin-"+e,o+"px"),t.removeClass("fl-builder-ui-pinned-is-collapsed"))},uncollapse:function(){this.isCollapsed()&&a(".fl-builder-ui-pinned-collapse:visible").trigger("click")},isCollapsed:function(){return a("body").hasClass("fl-builder-ui-pinned-is-collapsed")},initPanel:function(){var e=a(".fl-builder--content-library-panel"),t=0==a(".fl-builder-content-panel-button").length?".fl-builder--tabs, .fl-lightbox-header":".fl-builder--tabs";e.draggable({cursor:"move",handle:t,cancel:".fl-builder--tabs button",scroll:!1,drag:this.drag.bind(this),stop:this.dragStop.bind(this),start:this.dragStart.bind(this)}).resizable({handles:"e, w",minHeight:this.minHeight,minWidth:this.minWidth,maxWidth:this.maxWidth,start:this.resizeStart.bind(this),stop:this.resizeStop.bind(this)}),e.addClass("fl-builder-ui-pinned-container"),e.find(".ui-resizable-e, .ui-resizable-w").hide()},pinPanel:function(e){var t=a(".fl-builder--content-library-panel"),i=t.outerWidth(),l=a("body"),o=a(".fl-responsive-preview, .fl-responsive-preview-mask"),n=a(FLBuilder._contentClass).parentsUntil("body").last();l.addClass("fl-builder-ui-is-pinned fl-builder-ui-is-pinned-"+e),l.addClass("fl-builder-content-panel-is-showing"),l.css("margin-"+e,i+"px"),o.css("margin-"+e,i+"px"),n.addClass("fl-builder-ui-pinned-content-transform"),t.addClass("fl-builder-ui-pinned fl-builder-ui-pinned-"+e),t.find(".ui-resizable-"+("left"===e?"e":"w")).show(),t.on("resize",_.throttle(this.resize.bind(this),250)),t.attr("style",""),FLBuilder.ContentPanel.isShowing=!0,0==a(".fl-builder-content-panel-button").length&&a(".fl-builder-panel-drag-handle").show()},unpinPanel:function(){var e=a(".fl-builder--content-library-panel"),t=e.find(".fl-builder--panel-content .is-showing").data("tab"),i=a("body"),l=a(".fl-responsive-preview, .fl-responsive-preview-mask"),o=a(FLBuilder._contentClass).parentsUntil("body").last();i.css("margin-left",""),i.css("margin-right",""),i.removeClass("fl-builder-ui-is-pinned"),i.removeClass("fl-builder-ui-is-pinned-left"),i.removeClass("fl-builder-ui-is-pinned-right"),l.css("margin-left",""),l.css("margin-right",""),o.removeClass("fl-lightbox-content-transform"),e.removeClass("fl-builder-ui-pinned"),e.removeClass("fl-builder-ui-pinned-left"),e.removeClass("fl-builder-ui-pinned-right"),e.find(".ui-resizable-handle").hide(),e.off("resize"),e.attr("style",""),e.find(".fl-builder--tabs [data-tab="+t+"]").addClass("is-showing")},pinLightboxes:function(){var e=this;a(".fl-lightbox-resizable").each(function(){e.pinLightbox(a(this))}),FLBuilder._reinitEditorFields()},pinLightbox:function(e){var t=a(".fl-builder--content-library-panel"),i=e.closest(".fl-lightbox-wrap");i.closest(".fl-builder-ui-pinned").length||(t.append(i),e.attr("style",""),e.draggable("disable"),e.resizable("disable")),e.is(":visible")&&t.find(".fl-builder--tabs .is-showing").removeClass("is-showing")},pinLightboxOnOpen:function(e,t){t=t._node.find(".fl-lightbox-resizable");t.length&&(t.hasClass("fl-builder-ui-pinning-initialized")||(t.draggable("option","start",this.dragStart.bind(this)),t.draggable("option","drag",this.drag.bind(this)),t.draggable("option","stop",this.dragStop.bind(this)),t.addClass("fl-builder-ui-pinning-initialized")),this.isPinned()&&this.pinLightbox(t),FLBuilder.addHook("responsive-editing-switched",this.resize))},pinnedLightboxClosed:function(){var e=a(".fl-builder--content-library-panel");tab=null,this.isPinned()&&(tab=e.find(".fl-builder--panel-content .is-showing").data("tab"),e.find(".fl-builder--tabs [data-tab="+tab+"]").addClass("is-showing")),a(".fl-lightbox").removeClass("fl-lightbox-prevent-animation")},unpinLightboxes:function(){var o=a("body"),n=a(".fl-builder--content-library-panel");n.find(".fl-lightbox-wrap").each(function(){var e,t,i=a(this),l=i.find(".fl-lightbox");l.draggable("enable"),l.resizable("enable"),l.find(".ui-resizable-handle").show(),o.append(i),l.is(":visible")?(e=parseInt(n.css("top"))-parseInt(i.css("top"))-parseInt(i.css("padding-top")),t=parseInt(n.css("left"))-parseInt(i.css("padding-left")),i=parseInt(n.css("right"))-parseInt(i.css("padding-right")),l.css("top",(e<0?0:e)+"px"),l.css(FLBuilderConfig.isRtl?"right":"left",(FLBuilderConfig.isRtl?i:t)+"px"),l.addClass("fl-lightbox-prevent-animation"),o.removeClass("fl-builder-content-panel-is-showing"),FLBuilder.ContentPanel.isShowing=!1):l.css({top:"25px",left:"25px"})}),FLBuilder._reinitEditorFields()},closeLightboxOnPanelClick:function(){FLBuilder._triggerSettingsSave(!1,!0)},windowResize:function(){this.pinOrUnpin()},resizeStart:function(){a("body").addClass("fl-builder-resizable-is-resizing"),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()},resize:function(){var e=a("body"),t=a(".fl-responsive-preview, .fl-responsive-preview-mask"),i=a(".fl-builder--content-library-panel"),l=i.outerWidth();i.is(":visible")?i.hasClass("fl-builder-ui-pinned-left")?(e.css("margin-left",l+"px"),t.css("margin-left",l+"px")):i.hasClass("fl-builder-ui-pinned-right")&&(e.css("margin-right",l+"px"),t.css("margin-right",l+"px")):e.css("margin","")},resizeStop:function(){a("body").removeClass("fl-builder-resizable-is-resizing"),FLBuilder._bindOverlayEvents(),FLBuilder._resizeLayout(),this.savePosition()},dragStart:function(e,t){var i=a("body"),e=(a(e.target),a(".fl-builder-bar-actions"));a(".fl-lightbox-resizable:visible").length||e.addClass("fl-builder-content-panel-pin-zone"),i.addClass("fl-builder-draggable-is-dragging"),i.append('<div class="fl-builder-ui-pin-zone fl-builder-ui-pin-zone-left"></div>'),i.append('<div class="fl-builder-ui-pin-zone fl-builder-ui-pin-zone-right"></div>'),FLBuilder._destroyOverlayEvents()},drag:function(e,t){var i=a("body"),l=a(".fl-responsive-preview"),o=a(window),l=(l.length?l:o).width(),o=o.scrollTop(),n=a(".fl-builder--content-library-panel").offset().top,s=a(".fl-builder-bar-actions"),r=a(e.target);r.hasClass("fl-builder--content-library-panel")&&(e.clientX<l-75&&n-o<46?s.addClass("fl-builder-content-panel-pin-zone-hover"):s.removeClass("fl-builder-content-panel-pin-zone-hover")),r.hasClass("fl-builder-ui-pinned")?this.unpinPanel():e.clientX<75?i.addClass("fl-builder-ui-show-pin-zone fl-builder-ui-show-pin-zone-left"):e.clientX>l-75?i.addClass("fl-builder-ui-show-pin-zone fl-builder-ui-show-pin-zone-right"):(i.removeClass("fl-builder-ui-show-pin-zone"),i.removeClass("fl-builder-ui-show-pin-zone-left"),i.removeClass("fl-builder-ui-show-pin-zone-right"))},dragStop:function(e,t){a(window);var i=a("body"),l=a(".fl-builder-bar-actions"),o=a(".fl-builder-ui-pin-zone"),n=a(".fl-builder--content-library-panel"),s=a(".fl-lightbox-resizable:visible");a(e.target);i.removeClass("fl-builder-draggable-is-dragging"),l.removeClass("fl-builder-content-panel-pin-zone"),l.removeClass("fl-builder-content-panel-pin-zone-hover"),o.remove(),s.length&&parseInt(s.css("top"))<0&&s.css("top","0"),i.hasClass("fl-builder-ui-show-pin-zone")?(i.hasClass("fl-builder-ui-show-pin-zone-left")?this.pin("left",!0):this.pin("right",!0),i.removeClass("fl-builder-ui-show-pin-zone"),i.removeClass("fl-builder-ui-show-pin-zone-left"),i.removeClass("fl-builder-ui-show-pin-zone-right")):n.find(".fl-lightbox").length?(this.unpin(!0),"module"!==FLBuilderConfig.userTemplateType&&!FLBuilderConfig.simpleUi||n.hide()):(n.attr("style",""),this.savePosition()),FLBuilder._bindOverlayEvents()},disableDragAndResize:function(){var e=a(".fl-builder--content-library-panel"),t=a(".fl-lightbox-resizable");e.draggable("disable"),e.resizable("disable"),t.draggable("disable"),t.resizable("disable")},enableDragAndResize:function(){var e=a(".fl-builder--content-library-panel"),t=a(".fl-lightbox-resizable:not(.fl-lightbox-width-full)");e.draggable("enable"),e.resizable("enable"),this.isPinned()||(t.draggable("enable"),t.resizable("enable"))},savePosition:function(){var e=a(".fl-builder--content-library-panel"),t=a(".fl-lightbox-resizable:visible"),i={pinned:{width:e.outerWidth(),position:null}};e.hasClass("fl-builder-ui-pinned-left")?i.pinned.position="left":e.hasClass("fl-builder-ui-pinned-right")?i.pinned.position="right":t.length&&(i.lightbox={width:t.width(),height:t.height(),top:parseInt(t.css("top"))<0?"0px":t.css("top"),left:t.css("left")}),FLBuilderConfig.userSettings.pinned=i.pinned,i.lightbox&&(FLBuilderConfig.userSettings.lightbox=i.lightbox),FLBuilder.ajax({action:"save_pinned_ui_position",data:i})},restorePosition:function(){var e=a(".fl-builder--content-library-panel"),t=FLBuilderConfig.userSettings.pinned;t&&t.position&&(e.css("width",t.width+"px"),this.pin(t.position,!1),e.css("width",t.width+"px"))}};a(function(){e.init()})}(jQuery),!function(r){var i={init:function(){this.setupMainMenuData(),r(".fl-builder--revision-actions select").on("change",this.selectChanged),r(".fl-cancel-revision-preview").on("click",this.exitPreview.bind(this)),r(".fl-apply-revision-preview").on("click",this.applyClicked.bind(this)),FLBuilder.addHook("revisionItemClicked",this.itemClicked.bind(this)),FLBuilder.addHook("didPublishLayout",this.refreshItems.bind(this))},setupMainMenuData:function(){var e,t,i=FLBuilderConfig.revisions.posts,l=FLBuilderConfig.revisions.authors,o=wp.template("fl-revision-list-item"),n=r(".fl-builder--revision-actions select"),s=0;if(FLBuilderConfig.mainMenu.revisions.items=[],n.html(""),0===i.length)FLBuilderConfig.mainMenu.revisions.items.push({eventName:"noRevisionsMessage",type:"event",label:wp.template("fl-no-revisions-message")()});else for(;s<i.length;s++)e=FLBuilderStrings.revisionDate.replace("%s",i[s].date.diff),e+=" ("+i[s].date.published+")",t=FLBuilderStrings.revisionAuthor.replace("%s",l[i[s].author].name),FLBuilderConfig.mainMenu.revisions.items.push({eventName:"revisionItemClicked",type:"event",label:o({id:i[s].id,date:e,author:t,avatar:l[i[s].author].avatar})}),n.append('<option value="'+i[s].id+'">'+e+"</option>");void 0!==FLBuilder.MainMenu&&FLBuilder.MainMenu.renderPanel("revisions")},refreshItems:function(){FLBuilder.ajax({action:"refresh_revision_items"},this.refreshItemsComplete.bind(this))},refreshItemsComplete:function(e){FLBuilderConfig.revisions=FLBuilder._jsonParse(e),this.setupMainMenuData()},itemClicked:function(e,t){t=r(t).find(".fl-revision-list-item").attr("data-revision-id");FLBuilder._triggerSettingsSave(!1,!0)&&(r(".fl-builder--revision-actions select").val(t),this.preview(t))},selectChanged:function(e){i.preview(r(this).val())},applyClicked:function(e){var t=r(".fl-builder--revision-actions select").val();i.restore(t)},preview:function(e){r(".fl-builder--revision-actions").css("display","flex"),FLBuilder.triggerHook("didEnterRevisionPreview"),FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"render_revision_preview",revision_id:e},this.previewRenderComplete.bind(this))},previewRenderComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()})},exitPreview:function(){r(".fl-builder--revision-actions").hide(),FLBuilder.triggerHook("didExitRevisionPreview"),FLBuilder._bindOverlayEvents(),FLBuilder._updateLayout()},restore:function(e){r(".fl-builder--revision-actions").hide(),FLBuilder.triggerHook("didExitRevisionPreview"),FLBuilder.showAjaxLoader(),FLBuilder._bindOverlayEvents(),FLBuilder.ajax({action:"restore_revision",revision_id:e},i.restoreComplete)},restoreComplete:function(e){e=FLBuilder._jsonParse(e);FLBuilder._renderLayout(e.layout),FLBuilder.triggerHook("didRestoreRevisionComplete",e.config),void 0!==(settings=e.settings).css&&null!==settings.css&&(FLBuilderSettingsConfig.settings.layout.css=settings.css),void 0!==settings.js&&null!==settings.js&&(FLBuilderSettingsConfig.settings.layout.js=settings.js)}};r(function(){i.init()})}(jQuery),!function(){var t={query:function(e){var t,i={},l={library:{}};if(e=this.normalizeQuery(e),_.isNull(e.kind))i=FLBuilderConfig.contentItems;else for(var o in e.kind)i[o=e.kind[o]]=FLBuilderConfig.contentItems[o];return t=this.findMatches(e,i),l.library=this.formatResults(t,e),l},normalizeQuery:function(e){return e=_.extend({kind:null,type:null,category:null,group:null,enabled:!0,global:null,searchTerm:null,categorized:!1},e),_.isString(e.kind)&&(e.kind=[e.kind]),e},findMatches:function(e,t){var i,l,o,n,s={},r=null,a=null;for(r in t)for(a in i=t[r],s[r]={items:[]},i)if(l=i[a],_.isUndefined(e.category)||_.isNull(e.category)||this.matchesCategory(l.category,e.category)){switch(r){case"template":if(!(_.isUndefined(e.content)||_.isNull(e.content)||(o=_.includes(e.content,l.content),n=e.content===l.content,o||n)))continue;if(!_.isUndefined(e.type)&&!_.isNull(e.type)&&e.type!==l.type)continue;if(!_.isNull(e.group)){var d=e.group,u=l.group;if(_.isString(d)&&(d=[d]),_.isString(u)&&(u=[u]),_.isEmpty(d)||_.isEmpty(u))continue;var c=!1;for(a in d){var h=d[a];_.includes(u,h)&&(c=!0)}if(!c)continue}break;case"module":if(!_.isNull(e.group)){if(!1===e.group&&0<l.group.length)continue;if(!1!==e.group&&!_.includes(l.group,e.group))continue}}(_.isUndefined(e.searchTerm)||_.isNull(e.searchTerm)||this.matchesSearchTerm(l,e.searchTerm))&&s[r].items.push(l)}return s},matchesCategory:function(e,t){var i,l,o,n;if(e===t)return!0;for(l in t=_.isString(t)?[t]:t){if(i=t[l],_.isString(e)&&e===i)return!0;if(_.isArray(e))for(o in e)if(e[o]===i)return!0;if(_.isObject(e))for(n in e)if(e[n]===i||n===i)return!0}return!1},matchesSearchTerm:function(e,t){var i=t.toLowerCase();return!(_.isUndefined(e.slug)||!e.slug.toLowerCase().includes(i))||(!(_.isUndefined(e.name)||!e.name.toLowerCase().includes(i))||(!(!_.isString(e.category)||!e.category.toLowerCase().includes(i))||(!(_.isUndefined(e.description)||!e.description.toLowerCase().includes(i))||(!(_.isUndefined(e.id_base)||!e.id_base.includes(t))||(!(!e.isWidget||!"widget".includes(i))||!(_.isUndefined(e.editor_export)||!"module".includes(i)))))))},formatResults:function(e,t){if(t.categorized)for(type in e){var i=e[type].items;e[type].categorized=this.groupBy(i,"category")}return e},groupBy:function(e,i){var o,n,s={};return _.forEach(e,function(l,e,t){o=l[i],_.isNull(o)||_.isUndefined(o)||_.isString(o)&&""===l[o]||(_.isString(o)&&(s[o]=s[o]||[],s[o].push(l)),_.isArray(o)&&(n=o,_.forEach(n,function(e,t,i){s[e]=s[e]||[],s[e].push(l)})),_.isObject(o)&&(n=o,_.forEach(n,function(e,t,i){s[e]=s[e]||[],s[e].push(l)})))}),s},search:function(e){var t=this.query({searchTerm:e}),i={total:0,term:e,sections:{}};if(!_.isUndefined(t.library.module.items)){var l,o={};for(l in t.library.module.items){var n=t.library.module.items[l],s=n.group[0],r=n.category;n.name;_.isUndefined(o[s])&&(o[s]={}),_.isUndefined(o[s][r])&&(o[s][r]=[]),o[s][r].push(n)}i.grouped=o}for(l in t.library){var a=t.library[l];!_.isUndefined(a.items)&&0<a.items.length&&(i.sections[l]={name:FLBuilderStrings.typeLabels[l],handle:l,type:"",items:a.items},i.total+=a.items.length)}return i}};FLBuilder.Search={byQuery:function(e){return t.query(e)},byTerm:function(e){return t.search(e)}}}(jQuery),!function(i,l){var o={layoutNeedsPublish:!1,defaultIndicatorMessage:"",defaultTooltipMessage:"",messages:null,init:function(){this.messages=FLBuilderStrings.savedStatus,this.$savingIndicator=i(".fl-builder--saving-indicator"),l.addHook("didBeginAJAX",this.onLayoutSaving.bind(this)),l.addHook("didCompleteAJAX",this.onLayoutSaved.bind(this)),l.addHook("didPublishLayout",this.onLayoutPublished.bind(this)),l.addHook("publishAndRemain",this.onPublishAndRemain.bind(this)),l.addHook("didShowLightbox",this.setLayoutNeedsPublish.bind(this)),!FLBuilderConfig.layoutHasDraftedChanges&&FLBuilderConfig.builderEnabled||(this.setLayoutNeedsPublish(),this.resetStatusMessage())},setLayoutNeedsPublish:function(){this.layoutNeedsPublish||(this.layoutNeedsPublish=!0,i("body").addClass("fl-builder--layout-has-drafted-changes"))},onLayoutSaving:function(e,t){this.isPublishingLayout(t.action)?this.showStatusMessage(this.messages.publishing,this.messages.publishingTooltip):this.isUpdatingLayout(t.action)&&(this.setLayoutNeedsPublish(),this.showStatusMessage(this.messages.saving,this.messages.savingTooltip))},isPublishingLayout:function(e){return"save_layout"==e},isUpdatingLayout:function(e){return!this.isPublishingLayout()&&(e.startsWith("render")?!!e.startsWith("render_new"):!e.startsWith("duplicate")&&(!e.startsWith("refresh")&&("save_ui_skin"!=e&&("save_lightbox_position"!=e&&("save_pinned_ui_position"!=e&&("fl_builder_notifications"!=e&&!(-1<e.indexOf("history"))))))))},onLayoutSaved:function(e,t){var i;this.isUpdatingLayout(t.fl_builder_data.action)&&(this.showStatusMessage(this.messages.saved,this.messages.savedTooltip),i=this,setTimeout(function(){i.resetStatusMessage()},2e3))},onLayoutPublished:function(){this.layoutNeedsPublish=!1,i("body").removeClass("fl-builder--layout-has-drafted-changes"),this.resetStatusMessage()},showStatusMessage:function(e,t){this.$savingIndicator.html(e),l.isUndefined(t)||(this.$savingIndicator.attr("title",t),i(".fl-builder--saving-indicator").tipTip({defaultPosition:"bottom",edgeOffset:14}))},resetStatusMessage:function(){this.layoutNeedsPublish?(this.defaultIndicatorMessage=this.messages.edited+'<i class="fas fa-question-circle"></i>',this.defaultTooltipMessage=this.messages.editedTooltip):(this.defaultIndicatorMessage="",this.defaultTooltipMessage=""),this.showStatusMessage(this.defaultIndicatorMessage,this.defaultTooltipMessage)},onPublishAndRemain:function(){var e;l.MainMenu.hide(),this.layoutNeedsPublish||FLBuilderSettingsForms.settingsHaveChanged()?l._publishLayout(!1,!0):(this.showStatusMessage(this.messages.noChanges),e=this,setTimeout(function(){e.resetStatusMessage()},2e3))}};l.SaveManager={layoutNeedsPublish:function(){return o.layoutNeedsPublish},showStatusMessage:function(e,t){o.showStatusMessage(e,t)},resetStatusMessage:function(){o.resetStatusMessage()}},i(function(){o.init()})}(jQuery,FLBuilder),!function(o){FLBuilderHistoryManager={states:[],position:0,rendering:!1,init:function(){var e=FLBuilderConfig.history,l=this;this.states=e.states,this.position=parseInt(e.position),this.setupMainMenuData(),o.each(e.hooks,function(e,i){FLBuilder.addHook(e,function(e,t){l.saveCurrentState(i,t)})}),FLBuilder.addHook("didPublishLayout",this.clearStatesOnPublish.bind(this)),FLBuilder.addHook("restartEditingSession",this.saveCurrentStateOnRestartSession.bind(this)),FLBuilder.addHook("historyItemClicked",this.itemClicked.bind(this)),FLBuilder.addHook("undo",this.onUndo.bind(this)),FLBuilder.addHook("redo",this.onRedo.bind(this))},saveCurrentState:function(e,t){var i=null;void 0!==(t=void 0===t?{}:t).moduleType&&t.moduleType&&(i=t.moduleType);const l=FL.Builder.data.getLayoutActions();l.saveHistoryState(e,i)},saveCurrentStateOnRestartSession:function(e){this.states.length||this.saveCurrentState("draft_created")},clearStatesOnPublish:function(e,t){this.states=[],this.position=0,this.setupMainMenuData();const i=FL.Builder.data.getLayoutActions();i.clearHistoryStates(FLBuilderConfig.postId,t.shouldExit)},renderState:function(e){var t=this;if(!this.rendering&&this.states.length&&!o(".fl-builder-settings:visible").length){var i=setTimeout(FLBuilder.showAjaxLoader,2e3);this.rendering=!0;const l=FL.Builder.data.getLayoutActions();l.renderHistoryState(e,function(e){e=JSON.parse(e);e.error||(t.position=parseInt(e.position),FLBuilder.triggerHook("didRestoreHistoryComplete",e),FLBuilder._renderLayout(e.layout),t.setupMainMenuData()),clearTimeout(i),t.rendering=!1})}},onUndo:function(){const e=FL.Builder.data.getLayoutActions();e.undo()},onRedo:function(){const e=FL.Builder.data.getLayoutActions();e.redo()},setupMainMenuData:function(){var e=FLBuilderConfig.history.labels,t="";FLBuilderConfig.mainMenu.history.items=[];for(var i=this.states.length-1;0<=i;i--)"string"==typeof this.states[i]?t=e[this.states[i]]||this.states[i]:(t=e[this.states[i].label]||this.states[i].label,(this.states[i].moduleType||-1<this.states[i].label.indexOf("module"))&&(t=t.replace("%s",this.getModuleName(this.states[i].moduleType)))),FLBuilderConfig.mainMenu.history.items.push({eventName:"historyItemClicked",type:"event",label:wp.template("fl-history-list-item")({label:t,current:i===this.position?1:0,position:i})});FLBuilderConfig.history.enabled||FLBuilderConfig.mainMenu.history.items.push({eventName:"historyItemClicked",type:"event",label:wp.template("fl-history-list-item")({label:FLBuilderConfig.history.labels.history_disabled,current:0,position:0})}),void 0!==FLBuilder.MainMenu&&FLBuilder.MainMenu.renderPanel("history")},getModuleName:function(e){var t=FLBuilderConfig.contentItems.module,i=0;if("widget"===e)return FLBuilderStrings.widget;for(;i<t.length;i++)if(void 0!==t[i].slug&&e===t[i].slug)return t[i].name;return FLBuilderStrings.module},itemClicked:function(e,t){var t=o(t).find(".fl-history-list-item"),i=t.attr("data-position"),l=o(".fl-history-list-item[data-current=1]");o(".fl-builder-settings:visible").length&&(FLBuilder._closeNestedSettings(),FLBuilder._lightbox.close()),l.attr("data-current",0),t.attr("data-current",1),this.renderState(i)}},o(function(){FLBuilderHistoryManager.init()})}(jQuery),!function(exports){"use strict";exports.stringify=function(e){return JSON.stringify(e,function(e,t){var i;return t instanceof Function||"function"==typeof t?(i=t.toString()).length<8||"function"!==i.substring(0,8)?"_NuFrRa_"+i:i:t instanceof RegExp?"_PxEgEr_"+t:t})},exports.parse=function(str,date2obj){var iso8061=!!date2obj&&/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/;return JSON.parse(str,function(key,value){var prefix;return"string"!=typeof value?value:value.length<8?value:(prefix=value.substring(0,8),iso8061&&value.match(iso8061)?new Date(value):"function"===prefix?eval("("+value+")"):"_PxEgEr_"===prefix||"_NuFrRa_"===prefix?eval(value.slice(8)):value)})},exports.clone=function(e,t){return exports.parse(exports.stringify(e),t)}}("undefined"==typeof exports?window.JSONfn={}:exports);
|
1 |
+
var FLBuilderColorPicker;!function(u){var i=[],t=navigator.userAgent.toLowerCase(),l="Microsoft Internet Explorer"===navigator.appName,o=l?parseFloat(t.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,n=l&&o<10,s=!1,r=["-moz-","-webkit-","-o-","-ms-"];function a(e,t){return e="top"===e?"top":"left",t=Array.isArray(t)?t:Array.prototype.slice.call(arguments,1),"webkit"===s?(o=[],i="top"===(i=e)?"0% 0%,0% 100%,":"0% 100%,100% 100%,",l=d(l=t),u.each(l,function(e,t){o.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+i+o.join(",")+")"):r[s]+"linear-gradient("+e+", "+t.join(", ")+")";var i,l,o}function d(e){var n=[],s=[],t=[],i=e.length-1;return u.each(e,function(e,t){var i=t,l=!1,o=t.match(/1?[0-9]{1,2}%$/);o&&(i=t.replace(/\s?1?[0-9]{1,2}%$/,""),l=o.shift()),n.push(i),s.push(l)}),!1===s[0]&&(s[0]="0%"),!1===s[i]&&(s[i]="100%"),s=function e(t){var i,l,o,n,s=0,r=t.length-1,a=0,d=!1;if(t.length<=2||u.inArray(!1,t)<0)return t;for(;a<t.length-1;)d||!1!==t[a]?d&&!1!==t[a]&&(r=a,a=t.length):(s=a-1,d=!0),a++;l=r-s;n=parseInt(t[s].replace("%"),10);i=(parseFloat(t[r].replace("%"))-n)/l;a=s+1;o=1;for(;a<r;)t[a]=n+o*i+"%",o++,a++;return e(t)}(s),u.each(s,function(e){t[e]={color:n[e],stop:s[e]}}),t}flBuilderParseColorValue=function(e){var e=e.replace(/\s+/g,""),t=-1!==e.indexOf("rgba")?parseFloat(100*e.replace(/^.*,(.+)\)/,"$1")):100;return{value:e,alpha:t,rgba:t<100}},u.fn.flBuilderColorPickerGradient=function(){var e=arguments;return this.each(function(){n?function(e,l){var o,t,n,s,r;e="top"===e?"top":"left",l=Array.isArray(l)?l:Array.prototype.slice.call(arguments,1),o="top"===e?0:1,t=u(this),n=l.length-1,s='<div class="iris-ie-gradient-shim" style="position:absolute;'+(1==o?"height":"width")+":100%;"+(1==o?"left":"top")+":%start%;"+(1==o?"right":"bottom")+':%end%;filter:%filter%;" data-color:"%color%"></div>',r="","static"===t.css("position")&&t.css({position:"relative"}),l=d(l),u.each(l,function(e,t){var i;if(e===n)return!1;e=l[e+1],t.stop!==e.stop&&(i=100-parseFloat(e.stop)+"%",t.octoHex=new FLBuilderColor(t.color).toIEOctoHex(),e.octoHex=new FLBuilderColor(e.color).toIEOctoHex(),e="progid:DXImageTransform.Microsoft.Gradient(GradientType="+o+", StartColorStr='"+t.octoHex+"', EndColorStr='"+e.octoHex+"')",r+=s.replace("%start%",t.stop).replace("%end%",i).replace("%filter%",e))}),t.find(".iris-ie-gradient-shim").remove(),u(r).prependTo(t)}.apply(this,e):u(this).css("backgroundImage",a.apply(this,e))})},u.fn.flBuilderColorPickerRaninbowGradient=function(e,t){var i,l,o;for(e=e||"top",i="hsl(%h%,"+(t=u.extend({},{s:100,l:50},t)).s+"%,"+t.l+"%)",l=0,o=[];l<=360;)o.push(i.replace("%h%",l)),l+=30;return this.each(function(){u(this).flBuilderColorPickerGradient(e,o)})},(FLBuilderColorPicker=function(e){this._html='<div class="fl-color-picker-ui"><div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="javascript:void(0);"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div></div>';this.options=u.extend({},{elements:null,color:"",mode:"hsl",controls:{horiz:"s",vert:"l",strip:"h"},target:!1,width:200,presets:[],labels:{colorPresets:"Color Presets",colorPicker:"Color Picker",placeholder:"Paste color here...",removePresetConfirm:"Are you sure?",noneColorSelected:"None color selected.",alreadySaved:"%s is already a saved preset.",noPresets:"Add a color preset first.",presetAdded:"%s added to presets!"}},e),(!1==n||!0==n&&7<o)&&this._init()}).prototype={_html:"",_color:"",_currentElement:"",_inited:!1,_defaultHSLControls:{horiz:"s",vert:"l",strip:"h"},_defaultHSVControls:{horiz:"h",vert:"v",strip:"s"},_scale:{h:360,s:100,l:100,v:100},_init:function(){var e=this;u(e.options.elements);u("html").hasClass("fl-color-picker-init")?this._prepareColorFields():(this._color=new FLBuilderColor("#ff0000").setHSpace(e.options.mode),i=this.options.presets,!1===s&&function(){var i,l="backgroundImage";n?s="filter":(i=u('<div id="iris-gradtest" />'),u.each(r,function(e,t){if(i.css(l,t+"linear-gradient(top,#fff,#000)"),i.css(l).match("gradient"))return s=e,!1}),!1===s&&(i.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),i.css(this.bgImageString).match("gradient")&&(s="webkit")),i.remove())}(),e.picker=u(this._html).appendTo("body"),l?9===o?e.picker.addClass("iris-ie-9"):o<=8&&e.picker.addClass("iris-ie-lt9"):t.indexOf("compatible")<0&&t.indexOf("khtml")<0&&t.match(/mozilla/)&&e.picker.addClass("iris-mozilla"),e.controls={square:e.picker.find(".iris-square"),squareDrag:e.picker.find(".iris-square-value"),horiz:e.picker.find(".iris-square-horiz"),vert:e.picker.find(".iris-square-vert"),strip:e.picker.find(".iris-strip"),stripSlider:e.picker.find(".iris-strip .iris-slider-offset")},"hsv"===e.options.mode&&e._has("l",e.options.controls)?e.options.controls=e._defaultHSVControls:"hsl"===e.options.mode&&e._has("v",e.options.controls)&&(e.options.controls=e._defaultHSLControls),e.hue=e._color.h(),this._setTemplates(),this._ui=u(".fl-color-picker-ui"),this._iris=u(".iris-picker"),this._wrapper=u("body"),this._ui.prepend(this._hexHtml).append(this._presetsHtml),e.element=this._ui.find(".fl-color-picker-input"),e._initControls(),e.active="external",e._change(),e._addInputListeners(e.element),this._buildUI(),this._prepareColorFields(),this._pickerControls(),this._presetsControls(),this._buildAlphaUI(),u("html").addClass("fl-color-picker-init"))},_prepareColorFields:function(){var n=this;u(".fl-color-picker-value").each(function(){var e=u(this),t=e.val(),i=e.parent().find(".fl-color-picker-color"),l=flBuilderParseColorValue(t),o="";t&&(i.hasClass("fl-color-picker-alpha-enabled")&&l.rgba?o=e.val().toString():!i.hasClass("fl-color-picker-alpha-enabled")&&l.rgba?(l=(l=t.replace("rgba","rgb")).substr(0,l.lastIndexOf(","))+")",n._color._alpha=1,o=l,e.val(l)):o="#"+e.val().toString(),i.css({backgroundColor:o}))})},_setTemplates:function(){this._alphaHtml='<div class="fl-alpha-wrap"><div class="fl-alpha-slider"></div><div class="fl-alpha-slider-offset"></div><div class="fl-alpha-text"></div></div>',this._presetsHtml='<div class="fl-color-picker-presets"><div class="fl-color-picker-presets-toggle"><div class="fl-color-picker-presets-open-label fl-color-picker-active">'+this.options.labels.colorPresets+' <span class="fl-color-picker-icon-arrow-up"></span></div><div class="fl-color-picker-presets-close-label">'+this.options.labels.colorPicker+' <span class="fl-color-picker-icon-arrow-down"></span></div></div><ul class="fl-color-picker-presets-list"></ul></div>',this._hexHtml='<input type="text" class="fl-color-picker-input" placeholder="'+this.options.labels.placeholder+'"><div class="fl-color-picker-preset-add"></div>',this._presetsTpl='<li class="fl-color-picker-preset"><span class="fl-color-picker-preset-color"></span> <span class="fl-color-picker-preset-label"></span> <span class="fl-color-picker-preset-remove fl-color-picker-icon-remove"></span></li>',this._noPresetsTpl='<li class="fl-color-picker-no-preset"><span class="fl-color-picker-preset-label">'+this.options.labels.noPresets+"</span></li>"},_has:function(i,e){var l=!1;return u.each(e,function(e,t){if(i===t)return!(l=!0)}),l},_buildUI:function(){var i=this;i._presetsList=this._ui.find(".fl-color-picker-presets-list"),i._presetsList.html(""),0<this.options.presets.length?u.each(this.options.presets,function(e,t){i._addPresetView(t)}):i._presetsList.append(this._noPresetsTpl)},_addPresetView:function(e){var t=this._presetsList.find(".fl-color-picker-no-preset"),t=(0<t.length&&t.remove(),u(this._presetsTpl)),i=FLBuilderColor(e);t.attr("data-color",e).find(".fl-color-picker-preset-color").css({backgroundColor:i.toString()}).end().find(".fl-color-picker-preset-label").html(i.toString()),this._presetsList.append(t)},_addPresetFeedback:function(){this._ui.append('<div class="fl-color-picker-added"><div class="fl-color-picker-added-text"><div class="fl-color-picker-icon-check"></div> "'+this.options.labels.presetAdded.replace("%s",this._color.toString())+'"</div></div>'),this._ui.find(".fl-color-picker-added").hide().fadeIn(200).delay(2e3).fadeOut(200,function(){u(this).remove()})},_pickerControls:function(){var i=this;this._wrapper.on("click",".fl-color-picker-color",function(){var e=u(this);i._currentElement=e.parent().find(".fl-color-picker-value"),i._ui.position({my:"left top",at:"left bottom",of:e,collision:"flip",using:function(e,t){i._togglePicker(e)}})}).on("click",".fl-color-picker-clear",function(){var e=u(this);i._currentElement=e.parent().find(".fl-color-picker-value"),e.prev(".fl-color-picker-color").css({backgroundColor:"transparent"}).addClass("fl-color-picker-empty"),i._setColor(""),i.element.val(""),i._currentElement.val("").trigger("change")}),u(document).on("mousedown",function(e){0===u(e.target).closest(".fl-color-picker-ui").length&&(presets=i._ui.find(".fl-color-picker-presets"),presetsCloseLabel=presets.find(".fl-color-picker-presets-close-label"),presetsList=presets.find(".fl-color-picker-presets-list"),presetsCloseLabel.hasClass("fl-color-picker-active")&&0<(list=presetsList.find("li").find("span.fl-color-picker-preset-label")).length&&(presets=[],u.each(list,function(e,t){presets.push(u(t).text())}),u(FLBuilder.colorPicker).trigger("presetSorted",{presets:presets})),u(".fl-color-picker-ui.fl-color-picker-active").removeClass("fl-color-picker-active"))})},_presetsControls:function(){var i=this,e=i._ui.find(".fl-color-picker-preset-add"),l=i._ui.find(".fl-color-picker-presets"),o=l.find(".fl-color-picker-presets-open-label"),n=l.find(".fl-color-picker-presets-close-label"),s=l.find(".fl-color-picker-presets-list");e.off("click").on("click",function(){i._addPreset(i.element.val())}),s.css({height:i.element.innerHeight()+i._iris.innerHeight()+14+"px"}).hide(),s.sortable(),l.off("click").on("click",".fl-color-picker-presets-toggle",function(){n.hasClass("fl-color-picker-active")&&0<(list=s.find("li").find("span.fl-color-picker-preset-label")).length&&(l=[],u.each(list,function(e,t){l.push(u(t).text())}),u(FLBuilder.colorPicker).trigger("presetSorted",{presets:l})),o.toggleClass("fl-color-picker-active"),n.toggleClass("fl-color-picker-active"),s.slideToggle(500)}).on("click",".fl-color-picker-preset",function(e){var t=new FLBuilderColor(u(this).data("color").toString());i._setColor(t),i._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:t.toString()}).removeClass("fl-color-picker-empty"),o.toggleClass("fl-color-picker-active"),n.toggleClass("fl-color-picker-active"),s.slideToggle(500)}).on("click",".fl-color-picker-preset-remove",function(e){e.stopPropagation(),i._removePreset(u(this).parent().data("color"))})},_removePreset:function(e){var t;confirm(this.options.labels.removePresetConfirm)&&(e=e.toString(),-1<(t=i.indexOf(e))&&(i.splice(t,1),this.options.presets=i,this._presetsList.find('.fl-color-picker-preset[data-color="'+e+'"]').slideUp(function(){u(this).remove()})),i.length<1&&this._presetsList.append(this._noPresetsTpl),u(this).trigger("presetRemoved",{presets:i}))},_addPreset:function(e){if(!this._CheckValidColor(e))return alert(this.options.labels.noneColorSelected),!1;e=e.toString().replace(/^#/,"");""===e?alert(this.options.labels.noneColorSelected):-1<i.indexOf(e)?alert(this.options.labels.alreadySaved.replace("%s","#"+e)):(this._addPresetView(e),this._addPresetFeedback(),i.push(e),this.options.presets=i,u(this).trigger("presetAdded",{presets:i}))},_CheckValidColor:function(e){if(!e.match(/^#/)&&!e.match(/^rgb/)&&!e.match(/^hsl/))return!1;var t=document.getElementById("divValidColor");return t||((t=document.createElement("div")).id="divValidColor"),t.style.borderColor="",t.style.borderColor=e,0!=t.style.borderColor.length},_togglePicker:function(e){var t=this;this._ui.hasClass("fl-color-picker-active")?(this._ui.removeClass("fl-color-picker-active"),e&&setTimeout(function(){t._ui.css(e),t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200)):(e&&t._ui.css(e),setTimeout(function(){t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200))},_paint:function(){this._paintDimension("right","strip"),this._paintDimension("top","vert"),this._paintDimension("left","horiz")},_paintDimension:function(e,t){var i,l=this,o=l._color,n=l.options.mode,s=l._getHSpaceColor(),r=l.controls[t],a=l.options.controls;if(t!==l.active&&("square"!==l.active||"strip"===t))switch(a[t]){case"h":if("hsv"===n){switch(s=o.clone(),t){case"horiz":s[a.vert](100);break;case"vert":s[a.horiz](100);break;case"strip":s.setHSpace("hsl")}i=s.toHsl()}else i="strip"===t?{s:s.s,l:s.l}:{s:100,l:s.l};r.flBuilderColorPickerRaninbowGradient(e,i);break;case"s":"hsv"===n?"vert"===t?i=[o.clone().a(0).s(0).toCSS("rgba"),o.clone().a(1).s(0).toCSS("rgba")]:"strip"===t?i=[o.clone().s(100).toCSS("hsl"),o.clone().s(0).toCSS("hsl")]:"horiz"===t&&(i=["#fff","hsl("+s.h+",100%,50%)"]):i="vert"===t&&"h"===l.options.controls.horiz?["hsla(0, 0%, "+s.l+"%, 0)","hsla(0, 0%, "+s.l+"%, 1)"]:["hsl("+s.h+",0%,50%)","hsl("+s.h+",100%,50%)"],r.flBuilderColorPickerGradient(e,i);break;case"l":i="strip"===t?["hsl("+s.h+",100%,100%)","hsl("+s.h+", "+s.s+"%,50%)","hsl("+s.h+",100%,0%)"]:["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],r.flBuilderColorPickerGradient(e,i);break;case"v":i="strip"===t?[o.clone().v(100).toCSS(),o.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],r.flBuilderColorPickerGradient(e,i)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_dimensions:function(e){var t,i=this,l=i.options,o=i.controls.square,n=i.picker.find(".iris-strip"),s=l.border?l.width-20:l.width;if(e&&(o.css("width",""),n.css("width",""),i.picker.css({width:"",height:""})),e=s*(parseFloat("77.5%")/100),s=s*(parseFloat("12%")/100),t=l.border?20+e:e,o.width(e).height(e),n.height(e).width(s),i.picker.css({width:l.width,height:t}),!l.palettes)return i.picker.css("paddingBottom","")},_addInputListeners:function(o){function e(e){var t=new FLBuilderColor(o.val()),i=o.val().replace(/^#/,""),l=n._currentElement.hasClass("fl-color-picker-empty");if(o.removeClass("iris-error"),t.error)""!==i&&o.addClass("iris-error");else if(t.toString()!==n._color.toString()||""!==n._color.toString()&&l)if("keyup"===e.type)i.match(/^[0-9a-fA-F]{3}$/)||(n._setColor(i),n._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:FLBuilderColor(i).toString()}).removeClass("fl-color-picker-empty"),n._currentElement.val(i).trigger("change"));else if("paste"===e.type)return i=e.originalEvent.clipboardData.getData("text").replace(/^#/,""),hex=FLBuilderColor(i).toString(),n._setColor(i),o.val(hex),n._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:hex}).removeClass("fl-color-picker-empty"),n._currentElement.val(i).trigger("change"),!1}var n=this;o.on("change",e).on("keyup",n._debounce(e,100))},_initControls:function(){var n=this,s=n.controls,e=s.square,i=n.options.controls,l=n._scale[i.strip];s.stripSlider.slider({orientation:"horizontal",max:l,slide:function(e,t){n.active="strip","h"===i.strip&&(t.value=l-t.value),n._color[i.strip](t.value),n._change.apply(n,arguments)}}),s.squareDrag.draggable({containment:s.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(e,t){n._squareDrag(e,t)},start:function(){e.addClass("iris-dragging"),u(this).addClass("ui-state-focus")},stop:function(){e.removeClass("iris-dragging"),u(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(e){var t="ui-state-focus";e.preventDefault(),"mousedown"===e.type?(n.picker.find("."+t).removeClass(t).blur(),u(this).addClass(t).focus()):u(this).removeClass(t)}).on("keydown",function(e){var t=s.square,i=s.squareDrag,l=i.position(),o=2;switch(e.altKey&&(o*=10),e.keyCode){case 37:l.left-=o;break;case 38:l.top-=o;break;case 39:l.left+=o;break;case 40:l.top+=o;break;default:return!0}l.left=Math.max(0,Math.min(l.left,t.width())),l.top=Math.max(0,Math.min(l.top,t.height())),i.css(l),n._squareDrag(e,{position:l}),e.preventDefault()}),e.mousedown(function(e){var t;1===e.which&&u(e.target).is("div")&&(t=n.controls.square.offset(),t={top:e.pageY-t.top,left:e.pageX-t.left},e.preventDefault(),n._squareDrag(e,{position:t}),e.target=n.controls.squareDrag.get(0),n.controls.squareDrag.css(t).trigger(e))})},_squareDrag:function(e,t){var i=this,l=i.options.controls,o=i._squareDimensions(),n=Math.round((o.h-t.position.top)/o.h*i._scale[l.vert]),o=i._scale[l.horiz]-Math.round((o.w-t.position.left)/o.w*i._scale[l.horiz]);i._color[l.horiz](o)[l.vert](n),i.active="square",i._change.apply(i,arguments)},_setColor:function(e){var t=this,i=t.options.color;""===e?(e="#ff0000",t.default=!0):t.default=!1,(e=""+(t.options.color=e)).replace(/^#/,""),(e=new FLBuilderColor(e).setHSpace(t.options.mode)).error?t.options.color=i:(t._color=e,t.options.color=t._color.toString(),t.active="external",t._change())},_squareDimensions:function(e){var t=this.controls.square;return void 0!==e&&t.data("dimensions")?t.data("dimensions"):(this.controls.squareDrag,e={w:t.width(),h:t.height()},t.data("dimensions",e),e)},_isNonHueControl:function(e,t){return"square"===e&&"h"===this.options.controls.strip||"external"!==t&&("h"!==t||"strip"!==e)},_change:function(){var l=this,o=l.controls,n=l._getHSpaceColor(),e=["square","strip"],s=l.options.controls,t=s[l.active]||"external",i=l.hue;"strip"===l.active?e=[]:"external"!==l.active&&e.pop(),u.each(e,function(e,t){var i;if(t!==l.active)switch(t){case"strip":i="h"===s.strip?l._scale[s.strip]-n[s.strip]:n[s.strip],o.stripSlider.slider("value",i);break;case"square":i=l._squareDimensions(),i={left:n[s.horiz]/l._scale[s.horiz]*i.w,top:i.h-n[s.vert]/l._scale[s.vert]*i.h},l.controls.squareDrag.css(i)}}),n.h!==i&&l._isNonHueControl(l.active,t)&&l._color.h(i),l.hue=l._color.h(),l.options.color=l._color.toString(),l.element.is(":input")&&!l._color.error&&(l.element.removeClass("iris-error"),l.element.val()!==l._color.toString()&&(l.element.val(l._color.toString()),this._currentElement&&(!l.default||l.default&&"external"!==l.active?this._currentElement.val(l._color.toString().replace(/^#/,"")).parent().find(".fl-color-picker-color").css({backgroundColor:l._color.toString()}).removeClass("fl-color-picker-empty"):this._currentElement.val(""),l._wrapper.find(".fl-alpha-slider-offset").css("background-color",l._color.toString()),this._currentElement.trigger("change")))),l._paint(),l._inited=!0,l.active=!1},_debounce:function(o,n,s){var r,a;return function(){var e=this,t=arguments,i=function(){r=null,s||(a=o.apply(e,t))},l=s&&!r;return clearTimeout(r),r=setTimeout(i,n),a=l?o.apply(e,t):a}},_buildAlphaUI:function(){var t=this;t._wrapper.on("click",".fl-color-picker-color",function(){var e=u(this);t._currentElement.val();e.hasClass("fl-color-picker-alpha-enabled")?(t._ui.find(".fl-alpha-wrap").length<=0&&u(t._alphaHtml).insertAfter(t._iris),t.picker.addClass("fl-color-alpha-enabled"),t._pickerAlphaControls()):(t.picker.removeClass("fl-color-alpha-enabled"),t._ui.find(".fl-alpha-wrap").remove())})},_pickerAlphaControls:function(){var l=this,e=l._currentElement,t=flBuilderParseColorValue(e.val()),e=parseFloat(t.alpha/100),i=l._wrapper,o=l._ui.find(".fl-alpha-wrap"),n=o.find(".fl-alpha-slider"),s=o.find(".fl-alpha-text"),r=o.find(".fl-alpha-slider-offset");alphaHandle=o.find(".ui-slider-handle"),s.text(e<1?e:""),n.slider({orientation:"vertical",slide:function(e,t){var i=parseFloat(t.value/100);l._color._alpha=i,s.text(i<1?i:""),l._change.apply(l,arguments)},create:function(){r.css({backgroundColor:t.value}),i.on("click",".fl-color-picker-clear",function(){l._color._alpha=1,s.text(""),n.slider("value",100).trigger("slide")})},value:t.alpha,step:1,min:0,max:100})}}}(jQuery),!function(e,u){function n(e,t){return this instanceof n?this._init(e,t):new n(e,t)}n.fn=n.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var t="noop";switch(typeof e){case"object":return e.a!==u&&this.a(e.a),this[t=e.r!==u?"fromRgb":e.l!==u?"fromHsl":e.v!==u?"fromHsv":t](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){for(var e=new n(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"],i=t.length-1;0<=i;i--)e[t[i]]=this[t[i]];return e},setHSpace:function(e){return this._hSpace="hsv"===e?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,i=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,(e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,"")).match(i)&&e.match(/\)$/)){if((t=e.replace(/(\s|%)/g,"").replace(i,"").replace(/,?\);?$/,"").split(",")).length<3)return this._error();if(4===t.length&&(this.a(parseFloat(t.pop())),this.error))return this;for(var l=t.length-1;0<=l;l--)if(t[l]=parseInt(t[l],10),isNaN(t[l]))return this._error();return e.match(/^rgb/)?this.fromRgb({r:t[0],g:t[1],b:t[2]}):e.match(/^hsv/)?this.fromHsv({h:t[0],s:t[1],v:t[2]}):this.fromHsl({h:t[0],s:t[1],l:t[2]})}return this.fromHex(e)},fromRgb:function(e,t){return"object"!=typeof e||e.r===u||e.g===u||e.b===u?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),t))},fromHex:function(e){return 3===(e=e.replace(/^#/,"").replace(/^0x/,"")).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var t,i,l,o,n;return"object"!=typeof e||e.h===u||e.s===u||e.l===u?this._error():(this._hsl=e,this._hSpace="hsl",o=e.h/360,n=e.s/100,e=e.l/100,0==n?t=i=l=e:(t=this.hue2rgb(n=2*e-(e=e<.5?e*(1+n):e+n-e*n),e,o+1/3),i=this.hue2rgb(n,e,o),l=this.hue2rgb(n,e,o-1/3)),this.fromRgb({r:255*t,g:255*i,b:255*l},!0))},fromHsv:function(e){var t,i,l,o,n,s,r,a,d;if("object"!=typeof e||e.h===u||e.s===u||e.v===u)return this._error();switch(this._hsv=e,this._hSpace="hsv",s=e.h/360,t=e.s/100,r=(i=e.v/100)*(1-t),a=i*(1-(s=6*s-(e=Math.floor(6*s)))*t),d=i*(1-(1-s)*t),e%6){case 0:l=i,o=d,n=r;break;case 1:l=a,o=i,n=r;break;case 2:l=r,o=i,n=d;break;case 3:l=r,o=a,n=i;break;case 4:l=d,o=r,n=i;break;case 5:l=i,o=r,n=a}return this.fromRgb({r:255*l,g:255*o,b:255*n},!0)},fromInt:function(e,t){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),16777215<this._color?this._color=16777215:this._color<0&&(this._color=0),t===u&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,i){return i<0&&(i+=1),1<i&&--i,i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},toString:function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;0<=t;t--)e="0"+e;return"#"+e},toCSS:function(e,t){switch(e=e||"hex",t=parseFloat(t||this._alpha),e){case"rgb":case"rgba":var i=this.toRgb();return t<1?"rgba( "+i.r+", "+i.g+", "+i.b+", "+t+" )":"rgb( "+i.r+", "+i.g+", "+i.b+" )";case"hsl":case"hsla":i=this.toHsl();return t<1?"hsla( "+i.h+", "+i.s+"%, "+i.l+"%, "+t+" )":"hsl( "+i.h+", "+i.s+"%, "+i.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e,t=this.toRgb(),i=t.r/255,l=t.g/255,o=t.b/255,t=Math.max(i,l,o),n=Math.min(i,l,o),s=(t+n)/2;if(t===n)e=a=0;else{var r=t-n,a=.5<s?r/(2-t-n):r/(t+n);switch(t){case i:e=(l-o)/r+(l<o?6:0);break;case l:e=(o-i)/r+2;break;case o:e=(i-l)/r+4}e/=6}return{h:e=0===(e=Math.round(360*e))&&this._hsl.h!==e?this._hsl.h:e,s:a=0===(a=Math.round(100*a))&&this._hsl.s?this._hsl.s:a,l:Math.round(100*s)}},toHsv:function(){var e,t=this.toRgb(),i=t.r/255,l=t.g/255,o=t.b/255,t=Math.max(i,l,o),n=Math.min(i,l,o),s=t,r=t-n,a=0===t?0:r/t;if(t===n)e=a=0;else{switch(t){case i:e=(l-o)/r+(l<o?6:0);break;case l:e=(o-i)/r+2;break;case o:e=(i-l)/r+4}e/=6}return{h:e=0===(e=Math.round(360*e))&&this._hsv.h!==e?this._hsv.h:e,s:a=0===(a=Math.round(100*a))&&this._hsv.s?this._hsv.s:a,v:Math.round(100*s)}},toInt:function(){return this._color},toIEOctoHex:function(){var e=this.toString(),t=parseInt(255*this._alpha,10).toString(16);return"#"+(t=1===t.length?"0"+t:t)+e.replace(/^#/,"")},toLuminosity:function(){var e=this.toRgb();return.2126*Math.pow(e.r/255,2.2)+.7152*Math.pow(e.g/255,2.2)+.0722*Math.pow(e.b/255,2.2)},getDistanceLuminosityFrom:function(e){if(!(e instanceof n))throw"getDistanceLuminosityFrom requires a Color object";var t=this.toLuminosity(),e=e.toLuminosity();return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)},getMaxContrastColor:function(){var e=this.toLuminosity();return new n(.5<=e?"000000":"ffffff")},getReadableContrastingColor:function(e,t){if(!(e instanceof n))return this;var i=t===u?5:t,l=e.getDistanceLuminosityFrom(this),t=e.getMaxContrastColor();if(t.getDistanceLuminosityFrom(e)<=i)return t;if(i<=l)return this;for(var o=0===t.toInt()?-1:1;l<i&&(this.l(o,!0),l=this.getDistanceLuminosityFrom(e),0!==this._color&&16777215!==this._color););return this},a:function(e){if(e===u)return this._alpha;e=parseFloat(e);return isNaN(e)?this._error():(this._alpha=e,this)},darken:function(e){return this.l(-(e=e||5),!0)},lighten:function(e){return this.l(e=e||5,!0)},saturate:function(e){return this.s(e=e||15,!0)},desaturate:function(e){return this.s(-(e=e||15),!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(e){return this.h(180+30*(e=e||1),!0)},getAnalog:function(e){return this.h(30*(e=e||1),!0)},getTetrad:function(e){return this.h(60*(e=e||1),!0)},getTriad:function(e){return this.h(120*(e=e||1),!0)},_partial:function(l){var o=i[l];return function(e,t){var i=this._spaceFunc("to",o.space);return e===u?i[l]:(!0===t&&(e=i[l]+e),o.mod&&(e%=o.mod),o.range&&(e=e<o.range[0]?o.range[0]:e>o.range[1]?o.range[1]:e),i[l]=e,this._spaceFunc("from",o.space,i))}},_spaceFunc:function(e,t,i){t=t||this._hSpace;return this[e+t.charAt(0).toUpperCase()+t.substr(1)](i)}};var t,i={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(t in i)i.hasOwnProperty(t)&&(n.fn[t]=n.fn._partial(t));"object"==typeof exports?module.exports=n:(e.FLBuilderColor=n,e.Color=n)}(this),!function(s){(FLLightbox=function(e){this._init(e)}).closeParent=function(e){e=s(e).closest(".fl-lightbox-wrap").attr("data-instance-id");_.isUndefined(e)||FLLightbox._instances[e].close()},FLLightbox.getResizableControlClass=function(){var e=s(".fl-lightbox-resizable").eq(0),t="far fa-window-maximize";return t=e.length&&e.hasClass("fl-lightbox-width-full")?"far fa-window-minimize":t},FLLightbox.unbindAll=function(){for(var e in FLLightbox._instances)FLLightbox._instances[e]._unbind()},FLLightbox.bindAll=function(){for(var e in FLLightbox._instances)FLLightbox._instances[e]._bind()},FLLightbox.closeAll=function(){for(var e in FLLightbox._instances)FLLightbox._instances[e].close()},FLLightbox._instances={},FLLightbox.prototype={_id:null,_node:null,_visible:!1,_allowClosing:!0,_resizeTimer:null,_defaults:{className:"",destroyOnClose:!1,resizable:!1},open:function(e){var t=this._node.find(".fl-lightbox"),i=t.closest(".fl-builder-ui-pinned").length,l=this._getPositionSettings();!i&&l&&this._defaults.resizable&&t.css(l),this._bind(),this._node.show(),this._visible=!0,void 0!==e?this.setContent(e):this._resize(),this.trigger("open"),FLBuilder.triggerHook("didShowLightbox",this)},close:function(){var e=this._node.data("parent");this._allowClosing&&(this.trigger("beforeCloseLightbox"),this._unbind(),this._node.hide(),this._visible=!1,this.trigger("close"),FLBuilder.triggerHook("didHideLightbox"),this._defaults.resizable&&_.isUndefined(e)&&FLBuilder.triggerHook("didHideAllLightboxes"),this._defaults.destroyOnClose&&this.destroy())},disableClose:function(){this._allowClosing=!1},enableClose:function(){this._allowClosing=!0},setContent:function(e){this._node.find(".fl-lightbox-content").html(e),this._resize(),0==s(".fl-builder-content-panel-button").length&&s(".fl-builder-panel-drag-handle").show()},empty:function(){this._node.find(".fl-lightbox-content").empty()},on:function(e,t){this._node.on(e,t)},off:function(e,t){this._node.off(e,t)},trigger:function(e,t){this._node.trigger(e,t)},destroy:function(){this._node.empty(),this._node.remove(),FLLightbox._instances[this._id]="undefined";try{delete FLLightbox._instances[this._id]}catch(e){}},_init:function(e){var t=0,i=null;for(i in FLLightbox._instances)t++;this._defaults=s.extend({},this._defaults,e),this._id=(new Date).getTime()+t,(FLLightbox._instances[this._id]=this)._render(),this._resizable()},_render:function(){this._node=s('<div class="fl-lightbox-wrap" data-instance-id="'+this._id+'"><div class="fl-lightbox-mask"></div><div class="fl-lightbox"><div class="fl-lightbox-content-wrap"><div class="fl-lightbox-content"></div></div></div></div>'),this._node.addClass(this._defaults.className),s("body").append(this._node)},_bind:function(){s(window).on("resize.fl-lightbox-"+this._id,this._delayedResize.bind(this))},_unbind:function(){s(window).off("resize.fl-lightbox-"+this._id)},_resizable:function(){s("body");var e=this._node.find(".fl-lightbox-mask"),t=this._node.find(".fl-lightbox"),i=s(".fl-lightbox-resizable").eq(0);this._defaults.resizable?(e.hide(),t.addClass("fl-lightbox-resizable"),t.on("click",".fl-lightbox-resize-toggle",this._resizeClicked.bind(this)),t.draggable({cursor:"move",handle:".fl-lightbox-header"}).resizable({handles:"all",minHeight:500,minWidth:380,start:this._resizeStart.bind(this),stop:this._resizeStop.bind(this)}),i.length&&i.hasClass("fl-lightbox-width-full")?(t.addClass("fl-lightbox-width-full"),t.draggable("disable")):this._restorePosition()):e.show(),this._resize()},_delayedResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._resize.bind(this),250)},_resize:function(){var e=this._node.find(".fl-lightbox"),t=parseInt(this._node.css("padding-top")),i=parseInt(this._node.css("padding-bottom")),l=(parseInt(this._node.css("padding-left")),parseInt(this._node.css("padding-right")),e.height()),o=e.width(),n=s(window),t=n.height()-t-i,i=(n.width(),"0px");this._defaults.resizable?(o<600?e.addClass("fl-lightbox-width-slim"):e.removeClass("fl-lightbox-width-slim"),o<450?e.addClass("fl-lightbox-width-micro"):e.removeClass("fl-lightbox-width-micro"),this._resizeEditors()):(l<t&&(i=(t-l-46)/2+"px"),e.attr("style","").css("margin",i+" auto 0")),this.trigger("resized")},_resizeStart:function(){s("body").addClass("fl-builder-resizable-is-resizing"),s(".fl-builder-lightbox:visible").append('<div class="fl-builder-resizable-iframe-fix"></div>'),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()},_resizeStop:function(e,t){var i=s(".fl-lightbox-resizable:visible");parseInt(i.css("top"))<0&&i.css("top","0"),this._savePosition(),s("body").removeClass("fl-builder-resizable-is-resizing"),s(".fl-builder-resizable-iframe-fix").remove(),FLBuilder._bindOverlayEvents()},_resizeClicked:function(){s(".fl-lightbox-resizable").find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox").hasClass("fl-lightbox-width-full")?this._resizeExitFull():this._resizeEnterFull(),this._resize()},_resizeEnterFull:function(){var e=s(".fl-lightbox-resizable"),t=e.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");t.removeClass("fa-window-maximize").addClass("fa-window-minimize"),e.addClass("fl-lightbox-width-full"),e.draggable("disable"),e.resizable("disable")},_resizeExitFull:function(){var e=s(".fl-lightbox-resizable"),t=e.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");t.removeClass("fa-window-minimize").addClass("fa-window-maximize"),e.removeClass("fl-lightbox-width-full"),e.draggable("enable"),e.resizable("enable")},_resizeEditors:function(){s(".fl-lightbox-resizable").each(function(){var e=s(this),t=e.find(".fl-builder-settings-fields").height(),e=e.find(".mce-edit-area > iframe, textarea.wp-editor-area, .ace_editor"),i=null;t<350&&(t=350),e.each(function(){(i=s(this)).hasClass("ace_editor")?(i.height(t-60),i.closest(".fl-field").data("editor").resize()):i.closest(".mce-container-body").find(".mce-toolbar-grp .mce-toolbar.mce-last").is(":visible")?i.height(t-175):i.height(t-150)})})},_savePosition:function(){var e=this._node.find(".fl-lightbox"),t={width:e.width(),height:e.height(),top:parseInt(e.css("top"))<0?"0px":e.css("top"),left:e.css("left")};e.closest(".fl-builder-ui-pinned").length||(FLBuilderConfig.userSettings.lightbox=t,FLBuilder.ajax({action:"save_lightbox_position",data:t}))},_restorePosition:function(){var e=this._node.find(".fl-lightbox"),t=this._getPositionSettings();t?e.css(t):e.css({top:25,left:FLBuilderConfig.isRtl?"-25":25})},_getPositionSettings:function(){var e=FLBuilderConfig.userSettings.lightbox;if(!e)return!1;var t=window.innerHeight,i=parseInt(e.height),l=parseInt(e.top),o=parseInt(e.left),n=(parseInt(e.top),parseInt(e.width));return o+n+100>screen.width&&(e.left=screen.width-n-250),o<0&&(e.left=50),(t<i&&546<t||t<l+i)&&(t<i&&(e.height=t-50),e.top=0),e}}}(jQuery),!function(s){FLIconSelector={_content:null,_lightbox:null,_rendered:!1,_filterText:"",_liveFilterText:"",open:function(i){FLIconSelector._rendered||FLIconSelector._render(),null===FLIconSelector._content?(FLIconSelector._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),FLBuilder.ajax({action:"render_icon_selector"},FLIconSelector._getContentComplete)):(FLIconSelector._lightbox.open(),s(".fl-icons-filter-text-live").focus()),FLIconSelector._lightbox.on("icon-selected",function(e,t){FLIconSelector._lightbox.off("icon-selected"),FLIconSelector._lightbox.close(),i(t)})},_render:function(){FLIconSelector._lightbox=new FLLightbox({className:"fl-icon-selector"}),FLIconSelector._rendered=!0,FLBuilder.addHook("endEditingSession",function(){FLIconSelector._lightbox.close()})},_getContentComplete:function(e){e=FLBuilder._jsonParse(e);FLIconSelector._content=e.html,FLIconSelector._lightbox.setContent(e.html),s(".fl-icons-filter-text-live").on("keyup",s.debounce(1e3,FLIconSelector.livefilter)),s(".fl-icons-filter-text-live").focus(),s(".fl-icons-list i").on("click",FLIconSelector._select),s(".fl-icon-selector-cancel").on("click",s.proxy(FLIconSelector._lightbox.close,FLIconSelector._lightbox)),FLIconSelector.renderRecent()},renderRecent:function(){var e=FLBuilderConfig.recentIcons;if(e.length<1)return s(".fl-icons-section.recent h2.recent").hide(),!1;s(".fl-icons-section.recent h2.recent").show(),s(".fl-icons-section.recent").show(),s(".recent-icons").html(""),s.each(e,function(e,t){s(".recent-icons").append('<i class="'+t+'"></i>')}),s(".recent-icons").show(),s(".recent-icons i").on("click",FLIconSelector._select),recents=s(".recent-icons i"),s.each(recents,function(e,t){"none"==window.getComputedStyle(s(t)[0],":before").getPropertyValue("content")&&s(t).hide()})},livefilter:function(){var e=s(".fl-icons-filter-text-live").val();if(e===FLIconSelector._liveFilterText)return!1;s(".fl-icons-section.results").html(""),""===e?(FLIconSelector._liveFilterText="",s(".fl-icons-section").show(),FLIconSelector.renderRecent()):(s(".fl-icons-section.recent").hide(),s(".fl-icons-section.all-icons").hide(),s(".fl-icons-section.results").html('<i class="fas fa-spinner fa-spin"></i>'),FLIconSelector._liveFilterText=e,FLBuilder.ajax({action:"query_icons",text:e},FLIconSelector._query_result))},_query_result:function(e){var t=s(".fl-icons-section.results"),o="";if(!e||"[]"===e)return o="<h2>No Icons Found</h2>",FLIconSelector.renderRecent(),t.html(o),t.show(),!1;var e=FLBuilder._jsonParse(e),n="";s.each(e,function(e,l){o+="<h2>"+l.name+"</h2>",s.each(l.data,function(e,i){s.each(i.styles,function(e,t){switch(n="",t){case"solid":n="fas";break;case"regular":n="far";break;case"light":n="fal";break;case"duotone":n="fad";break;case"thin":n="fa-thin";break;case"brands":n="fa-brands fab";break;case"legacy":n=l.prefix}0<n.length&&(n+=" "),o+='<i class="'+n+i.tag+'" title="'+i.label+'"></i>'})})}),t.html(o),t.show(),s(".fl-icons-section.results i").on("click",FLIconSelector._select)},_filter:function(){var e=s(".fl-icons-filter-select").val(),t=s(".fl-icons-filter-text").val()||"";"all"==e?s(".fl-icons-section").show():(s(".fl-icons-section").hide(),s(".fl-"+e).show()),""!==(FLIconSelector._filterText=t)?s(".fl-icons-list i").each(FLIconSelector._filterIcon):s(".fl-icons-list i").show()},_filterIcon:function(){var e=s(this);-1==e.attr("class").indexOf(FLIconSelector._filterText)?e.hide():e.show()},_select:function(){var e=s(this).attr("class");FLBuilder.ajax({action:"recent_icons",icon:e},FLIconSelector._updateRecents),FLIconSelector._lightbox.trigger("icon-selected",e)},_updateRecents:function(e){FLBuilderConfig.recentIcons=FLBuilder._jsonParse(e)}}}(jQuery),!function(i){(FLStyleSheet=function(e){"object"==typeof e&&i.extend(this,e),this._createSheet()}).prototype={id:null,_sheet:null,_sheetElement:null,updateRule:function(e,t,i){for(var l=this._sheet.cssRules||this._sheet.rules,o=null,n=0;n<l.length;n++)l[n].selectorText.toLowerCase().replace(/\s/g,"")==e.toLowerCase().replace(/\s/g,"")&&(o=l[n]);if(o)if("object"==typeof t)for(n in t)this.setProperty(o,n,t[n]);else this.setProperty(o,t,i);else this.addRule(e,t,i)},setProperty:function(e,t,i){var l="";e.style.setProperty?(-1<i.indexOf("!important")&&(l="important",i=i.replace("!important","").trim()),e.style.setProperty(t,i,l)):e.style[this._toCamelCase(t)]=i},addRule:function(e,t,i){var l="",o="";if("object"==typeof t)for(o in t)l+=o+":"+t[o]+";";else l=t+":"+i+";";this._sheet.insertRule?this._sheet.insertRule(e+" { "+l+" }",this._sheet.cssRules.length):this._sheet.addRule(e,l)},destroy:function(){this._sheetElement&&(this._sheetElement.remove(),this._sheetElement=null),this._sheet&&(this._sheet=null)},disable:function(){this._sheet.disabled=!0},enable:function(){this._sheet.disabled=!1},_createSheet:function(){var e=this.id?' id="'+this.id+'"':"",t=this.className?' class="'+this.className+'"':"";this._sheet||(this._sheetElement=i('<style type="text/css"'+e+t+"></style>"),i("body").append(this._sheetElement),this._sheet=this._sheetElement[0].sheet)},_toCamelCase:function(e){return e.toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()})}}}(jQuery),!function(y){FLBuilder={preview:null,_actionsLightbox:null,_ajaxQueue:[],_ajaxRequest:null,_colResizeData:null,_colResizing:!1,_contentClass:!1,_dragEnabled:!1,_dragging:!1,_dragInitialScrollTop:0,_exitUrl:null,_layout:null,_layoutQueue:[],_layoutSettingsCSSCache:null,_layoutSettingsCSSTimeout:null,_lightbox:null,_lightboxScrollbarTimeout:null,_loadedModuleAssets:[],_moduleHelpers:{},_multiplePhotoSelector:null,_newColParent:null,_newColPosition:0,_newColGroupParent:null,_newColGroupPosition:0,_newModuleParent:null,_newModulePosition:0,_newRowPosition:0,_selectedTemplateId:null,_selectedTemplateType:null,_singlePhotoSelector:null,_singleVideoSelector:null,_multipleAudiosSelector:null,_codeDisabled:!1,_sandbox:{},_publishAndRemain:!1,_init:function(){FLBuilder._initJQueryReadyFix(),FLBuilder._initGlobalErrorHandling(),FLBuilder._initPostLock(),FLBuilder._initClassNames(),FLBuilder._initMediaUploader(),FLBuilder._initOverflowFix(),FLBuilder._initScrollbars(),FLBuilder._initLightboxes(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._initStrings(),FLBuilder._initSanityChecks(),FLBuilder._initTipTips(),FLBuilder._initTinyMCE(),FLBuilder._bindEvents(),FLBuilder._bindOverlayEvents(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._checkEnv(),FLBuilder.addHook("didInitUI",FLBuilder._showTourOrTemplates.bind(FLBuilder)),FLBuilder.addHook("endEditingSession",FLBuilder._doStats.bind(this)),FLBuilder.triggerHook("init")},_initJQueryReadyFix:function(){FLBuilderConfig.debug||(jQuery.fn.oldReady=jQuery.fn.ready,jQuery.fn.ready=function(e){return jQuery.fn.oldReady(function(){try{"function"==typeof e&&e(y)}catch(e){FLBuilder.logError(e)}})})},_initSanityChecks:function(){FLBuilderConfig.uploadPath&&"undefined"==typeof FLBuilderLayout&&(url='<a href="'+FLBuilderConfig.uploadUrl+'">wp-admin -> Settings -> Media</a>',FLBuilder.alert('<strong>Critcal Error</strong><p style="font-size:15px;">Please go to '+url+" and make sure uploads folder settings is blank</p>"),y(".fl-builder-alert-close").hide())},_initGlobalErrorHandling:function(){FLBuilderConfig.debug||(window.onerror=function(e,t,i,l,o){return FLBuilder.logGlobalError(e,t,i,l,o),!0})},_initPostLock:function(){void 0!==wp.heartbeat&&(wp.heartbeat.interval(30),wp.heartbeat.enqueue("fl_builder_post_lock",{post_id:FLBuilderConfig.postId}))},_initClassNames:function(){var e=y("html"),t=y("body");e.addClass("fl-builder-edit"),t.addClass("fl-builder"),FLBuilderConfig.simpleUi&&t.addClass("fl-builder-simple"),FLBuilder._contentClass=".fl-builder-content-"+FLBuilderConfig.postId,y(FLBuilder._contentClass).addClass("fl-builder-content-editing")},_initMediaUploader:function(){wp.media.model.settings.post.id=FLBuilderConfig.postId},_initOverflowFix:function(){y(FLBuilder._contentClass).parents().css("overflow","visible")},_initScrollbars:function(){var e=y(".fl-nanoscroller").nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"}).filter(".fl-builder-settings-fields"),t=e.find(".fl-nanoscroller-pane");t.length&&(t=t.get(0).style.display,e=e.find(".fl-nanoscroller-content"),"none"===t?e.removeClass("has-scrollbar"):e.addClass("has-scrollbar"))},_initSortables:function(){var e={appendTo:FLBuilder._contentClass,cursor:"move",cursorAt:{left:85,top:20},distance:1,helper:FLBuilder._blockDragHelper,start:FLBuilder._blockDragStart,sort:FLBuilder._blockDragSort,change:FLBuilder._blockDragChange,stop:FLBuilder._blockDragStop,placeholder:"fl-builder-drop-zone",tolerance:"intersect"},t="",i="",l="",l="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-content":"column"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-col-content":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col:not(.fl-builder-node-loading):not(.fl-node-global) .fl-col-content",i="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target",t=FLBuilderConfig.nestedColumns?l:"row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-row:not(.fl-builder-node-loading) .fl-col-drop-target";y(".fl-builder-rows").sortable(y.extend({},e,{connectWith:t,items:".fl-builder-block-row",stop:FLBuilder._rowDragStop})),y(".fl-builder-row-templates").sortable(y.extend({},e,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-row-template:not(.fl-builder-block-disabled)",stop:FLBuilder._nodeTemplateDragStop})),y(".fl-builder-saved-rows").sortable(y.extend({},e,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-saved-row",stop:FLBuilder._nodeTemplateDragStop})),y(".fl-builder-saved-columns").sortable(y.extend({},e,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:i,items:".fl-builder-block-saved-column",stop:FLBuilder._nodeTemplateDragStop})),y(".fl-builder-modules, .fl-builder-widgets").sortable(y.extend({},e,{connectWith:l,items:".fl-builder-block-module:not(.fl-builder-block-disabled)",stop:FLBuilder._moduleDragStop})),y(".fl-builder-module-templates").sortable(y.extend({},e,{connectWith:l,items:".fl-builder-block-module-template",stop:FLBuilder._nodeTemplateDragStop})),y(".fl-builder-saved-modules").sortable(y.extend({},e,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:l,items:".fl-builder-block-saved-module",stop:FLBuilder._nodeTemplateDragStop})),y(".fl-row-sortable-proxy").sortable(y.extend({},e,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",helper:FLBuilder._rowDragHelper,start:FLBuilder._rowDragStart,stop:FLBuilder._rowDragStop})),y(".fl-col-sortable-proxy").sortable(y.extend({},e,{connectWith:l,helper:FLBuilder._colDragHelper,start:FLBuilder._colDragStart,stop:FLBuilder._colDragStop})),y(FLBuilder._contentClass+" .fl-col-content").sortable(y.extend({},e,{connectWith:l,handle:".fl-module-sortable-proxy",helper:FLBuilder._moduleDragHelper,items:".fl-module, .fl-col-group",start:FLBuilder._moduleDragStart,stop:FLBuilder._moduleDragStop})),y(FLBuilder._contentClass+" .fl-row-drop-target").sortable(e),y(FLBuilder._contentClass+" .fl-col-group-drop-target").sortable(e),y(FLBuilder._contentClass+" .fl-col-drop-target").sortable(e)},_refreshSortables:function(){y(".ui-sortable").sortable("refresh")},_initStrings:function(){y.validator.messages.required=FLBuilderStrings.validateRequiredMessage},_bindEvents:function(){var e=FLBuilderLayout._isTouch();$excludedLinks=y(".fl-builder-bar a, .fl-builder--content-library-panel a, .fl-page-nav .nav a"),y("a").not($excludedLinks).on("click",FLBuilder._preventDefault),y(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),y("body").on("click",".fl-builder-content a",FLBuilder._preventDefault),y("body").on("mouseup","button.fl-builder-button",this._buttonMouseUp.bind(this)),y(document).on("heartbeat-tick",FLBuilder._initPostLock),y(window).on("beforeunload",FLBuilder._warnBeforeUnload),y("body").on("click touchend",".fl-builder-has-submenu",FLBuilder._submenuParentClicked),y("body").on("click touchend",".fl-builder-has-submenu a",FLBuilder._submenuChildClicked),y("body").on("mouseenter",".fl-builder-submenu",FLBuilder._submenuMouseenter),y("body").on("mouseleave",".fl-builder-submenu",FLBuilder._submenuMouseleave),y("body").on("mouseenter",".fl-builder-submenu .fl-builder-has-submenu",FLBuilder._submenuNestedParentMouseenter),y(".fl-builder-panel-actions .fl-builder-panel-close").on("click",FLBuilder._closePanel),y(".fl-builder-blocks-section-title").on("click",FLBuilder._blockSectionTitleClicked),y("body").on("mousedown",".fl-builder-node-template-actions",FLBuilder._stopPropagation),y("body").on("mousedown",".fl-builder-node-template-edit",FLBuilder._stopPropagation),y("body").on("mousedown",".fl-builder-node-template-delete",FLBuilder._stopPropagation),y("body").on("click",".fl-builder-node-template-edit",FLBuilder._editNodeTemplateClicked),y("body").on("click",".fl-builder-node-template-delete",FLBuilder._deleteNodeTemplateClicked),y("body").on("mousedown",".fl-builder-block:not(.fl-builder-block-disabled)",FLBuilder._blockDragInit),y("body").on("mouseup",FLBuilder._blockDragCancel),y("body").on("click",".fl-builder-actions .fl-builder-cancel-button",FLBuilder._cancelButtonClicked),y("body").on("click",".fl-builder-save-user-template-button",FLBuilder._saveUserTemplateClicked),y("body").on("click",".fl-builder-duplicate-layout-button",FLBuilder._duplicateLayoutClicked),y("body").on("click",".fl-builder-layout-settings-button",FLBuilder._layoutSettingsClicked),y("body").on("click",".fl-builder-layout-settings .fl-builder-settings-save",FLBuilder._saveLayoutSettingsClicked),y("body").on("click",".fl-builder-layout-settings .fl-builder-settings-cancel",FLBuilder._cancelLayoutSettingsClicked),y("body").on("click",".fl-builder-global-settings-button",FLBuilder._globalSettingsClicked),y("body").on("click",".fl-builder-global-settings .fl-builder-settings-save",FLBuilder._saveGlobalSettingsClicked),y("body").on("click",".fl-builder-global-settings .fl-builder-settings-cancel",FLBuilder._cancelLayoutSettingsClicked),y("body").on("click",".fl-user-template",FLBuilder._userTemplateClicked),y("body").on("click",".fl-user-template-edit",FLBuilder._editUserTemplateClicked),y("body").on("click",".fl-user-template-delete",FLBuilder._deleteUserTemplateClicked),y("body").on("click",".fl-builder-template-replace-button",FLBuilder._templateReplaceClicked),y("body").on("click",".fl-builder-template-append-button",FLBuilder._templateAppendClicked),y("body").on("click",".fl-builder-template-actions .fl-builder-cancel-button",FLBuilder._templateCancelClicked),y("body").on("click",".fl-builder-user-template-settings .fl-builder-settings-save",FLBuilder._saveUserTemplateSettings),y("body").on("click",".fl-builder-help-tour-button",FLBuilder._startHelpTour),y("body").on("click",".fl-builder-knowledge-base-button",FLBuilder._viewKnowledgeBaseClicked),y("body").on("click",".fl-builder-forums-button",FLBuilder._visitForumsClicked),y("body").on("click",".fl-builder-no-tour-button",FLBuilder._noTourButtonClicked),y("body").on("click",".fl-builder-yes-tour-button",FLBuilder._yesTourButtonClicked),y("body").on("click",".fl-builder-alert-close",FLBuilder._alertClose),y("body").on("contextmenu",".fl-block-overlay",FLBuilder._onContextmenu),y("body").on("click touchend",".fl-row-overlay .fl-block-remove",FLBuilder._deleteRowClicked),y("body").on("click touchend",".fl-row-overlay .fl-block-copy",FLBuilder._rowCopyClicked),y("body").on("mousedown",".fl-row-overlay .fl-block-move",FLBuilder._rowDragInit),y("body").on("touchstart",".fl-row-overlay .fl-block-move",FLBuilder._rowDragInitTouch),y("body").on("click touchend",".fl-row-overlay .fl-block-settings",FLBuilder._rowSettingsClicked),y("body").on("click",".fl-builder-row-settings .fl-builder-settings-save",FLBuilder._saveSettings),e?y("body").on("touchend",".fl-row-overlay",FLBuilder._rowSettingsClicked):y("body").on("click",".fl-row-overlay",FLBuilder._rowSettingsClicked),y("body").on("click touchend",".fl-block-col-submenu .fl-block-row-reset",FLBuilder._resetRowWidthClicked),y("body").on("mousedown",".fl-col-overlay .fl-block-move",FLBuilder._colDragInit),y("body").on("touchstart",".fl-col-overlay .fl-block-move",FLBuilder._colDragInitTouch),y("body").on("click touchend",".fl-block-col-copy",FLBuilder._copyColClicked),y("body").on("click touchend",".fl-col-overlay .fl-block-remove",FLBuilder._deleteColClicked),y("body").on("click touchend",".fl-col-overlay .fl-block-settings",FLBuilder._colSettingsClicked),y("body").on("click",".fl-builder-col-settings .fl-builder-settings-save",FLBuilder._saveSettings),e?y("body").on("touchend",".fl-col-overlay",FLBuilder._colSettingsClicked):y("body").on("click",".fl-col-overlay",FLBuilder._colSettingsClicked),y("body").on("mousedown",".fl-block-col-submenu .fl-block-col-move",FLBuilder._colDragInit),y("body").on("touchstart",".fl-block-col-submenu .fl-block-col-move",FLBuilder._colDragInitTouch),y("body").on("click touchend",".fl-block-col-submenu .fl-block-col-edit",FLBuilder._colSettingsClicked),y("body").on("click touchend",".fl-block-col-submenu .fl-block-col-delete",FLBuilder._deleteColClicked),y("body").on("click touchend",".fl-block-col-submenu .fl-block-col-reset",FLBuilder._resetColumnWidthsClicked),y("body").on("mouseenter",".fl-block-col-submenu li",FLBuilder._showColHighlightGuide),y("body").on("mouseleave",".fl-block-col-submenu li",FLBuilder._removeColHighlightGuides),y("body").on("mousedown",".fl-block-col-submenu .fl-block-col-move-parent",FLBuilder._colDragInit),y("body").on("touchstart",".fl-block-col-submenu .fl-block-col-move-parent",FLBuilder._colDragInitTouch),y("body").on("click touchend",".fl-block-col-submenu .fl-block-col-edit-parent",FLBuilder._colSettingsClicked),y("body").on("click touchend",".fl-module-overlay .fl-block-remove",FLBuilder._deleteModuleClicked),y("body").on("click touchend",".fl-module-overlay .fl-block-copy",FLBuilder._moduleCopyClicked),y("body").on("mousedown",".fl-module-overlay .fl-block-move",FLBuilder._moduleDragInit),y("body").on("touchstart",".fl-module-overlay .fl-block-move",FLBuilder._moduleDragInitTouch),y("body").on("click touchend",".fl-module-overlay .fl-block-settings",FLBuilder._moduleSettingsClicked),y("body").on("click",".fl-builder-module-settings .fl-builder-settings-save",FLBuilder._saveModuleClicked),y("body").on("click touchend",".fl-module-overlay .fl-block-col-settings",FLBuilder._colSettingsClicked),e?y("body").on("touchend",".fl-module-overlay",FLBuilder._moduleSettingsClicked):y("body").on("click",".fl-module-overlay",FLBuilder._moduleSettingsClicked),y("body").on("click",".fl-builder-settings-save-as",FLBuilder._showNodeTemplateSettings),y("body").on("click",".fl-builder-node-template-settings .fl-builder-settings-save",FLBuilder._saveNodeTemplate),y("body").on("click",".fl-builder-settings-tabs a",FLBuilder._settingsTabClicked),y("body").on("show",".fl-builder-settings-tabs a",FLBuilder._calculateSettingsTabsOverflow),y("body").on("hide",".fl-builder-settings-tabs a",FLBuilder._calculateSettingsTabsOverflow),y("body").on("click",".fl-builder-settings-cancel",FLBuilder._settingsCancelClicked),y("body").on("click",".fl-builder-settings-tabs-overflow-menu > a",FLBuilder._settingsTabsToOverflowMenuItemClicked.bind(this)),y("body").on("click",".fl-builder-settings-tabs-more",FLBuilder._toggleTabsOverflowMenu.bind(this)),y("body").on("click",".fl-builder-settings-tabs-overflow-click-mask",FLBuilder._hideTabsOverflowMenu.bind(this)),y("body").on("mouseover",".fl-help-tooltip-icon",FLBuilder._showHelpTooltip),y("body").on("mouseout",".fl-help-tooltip-icon",FLBuilder._hideHelpTooltip),y("body").on("click",".fl-builder-field-add",FLBuilder._addFieldClicked),y("body").on("click",".fl-builder-field-copy",FLBuilder._copyFieldClicked),y("body").on("click",".fl-builder-field-delete",FLBuilder._deleteFieldClicked),y("body").on("click",".fl-photo-field .fl-photo-select",FLBuilder._selectSinglePhoto),y("body").on("click",".fl-photo-field .fl-photo-edit",FLBuilder._selectSinglePhoto),y("body").on("click",".fl-photo-field .fl-photo-replace",FLBuilder._selectSinglePhoto),y("body").on("click",".fl-photo-field .fl-photo-remove",FLBuilder._singlePhotoRemoved),y("body").on("click",".fl-multiple-photos-field .fl-multiple-photos-select",FLBuilder._selectMultiplePhotos),y("body").on("click",".fl-multiple-photos-field .fl-multiple-photos-edit",FLBuilder._selectMultiplePhotos),y("body").on("click",".fl-multiple-photos-field .fl-multiple-photos-add",FLBuilder._selectMultiplePhotos),y("body").on("click",".fl-video-field .fl-video-select",FLBuilder._selectSingleVideo),y("body").on("click",".fl-video-field .fl-video-replace",FLBuilder._selectSingleVideo),y("body").on("click",".fl-video-field .fl-video-remove",FLBuilder._singleVideoRemoved),y("body").on("click",".fl-multiple-audios-field .fl-multiple-audios-select",FLBuilder._selectMultipleAudios),y("body").on("click",".fl-multiple-audios-field .fl-multiple-audios-edit",FLBuilder._selectMultipleAudios),y("body").on("click",".fl-multiple-audios-field .fl-multiple-audios-add",FLBuilder._selectMultipleAudios),y("body").on("click",".fl-icon-field .fl-icon-select",FLBuilder._selectIcon),y("body").on("click",".fl-icon-field .fl-icon-replace",FLBuilder._selectIcon),y("body").on("click",".fl-icon-field .fl-icon-remove",FLBuilder._removeIcon),y("body").on("click",".fl-form-field .fl-form-field-edit",FLBuilder._formFieldClicked),y("body").on("click",".fl-form-field-settings .fl-builder-settings-save",FLBuilder._saveFormFieldClicked),y("body").on("click",".fl-layout-field-option",FLBuilder._layoutFieldClicked),y("body").on("click",".fl-link-field-select",FLBuilder._linkFieldSelectClicked),y("body").on("click",".fl-link-field-search-cancel",FLBuilder._linkFieldSelectCancelClicked),y("body").on("change",".fl-loop-data-source-select select[name=data_source]",FLBuilder._loopDataSourceChange),y("body").on("change",".fl-custom-query select[name=post_type]",FLBuilder._customQueryPostTypeChange),y("body").on("change",".fl-text-field-add-value",FLBuilder._textFieldAddValueSelectChange),y("body").on("focus",".fl-field input[type=number]",FLBuilder._onNumberFieldFocus),y("body").on("blur",".fl-field input[type=number]",FLBuilder._onNumberFieldBlur),FLBuilder.addHook("didCompleteAJAX",FLBuilder._refreshSettingsPreviewReference),FLBuilder.addHook("didRenderLayoutComplete",FLBuilder._refreshSettingsPreviewReference)},_unbindEvents:function(){y("a").off("click",FLBuilder._preventDefault),y(".fl-page-nav .nav a").off("click",FLBuilder._headerLinkClicked),y("body").undelegate(".fl-builder-content a","click",FLBuilder._preventDefault)},_rebindEvents:function(){y("a").on("click",FLBuilder._preventDefault),y(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),y("body").on("click",".fl-builder-content a",FLBuilder._preventDefault)},_bindOverlayEvents:function(){var e=y(FLBuilder._contentClass);e.on("mouseenter touchstart",".fl-row",FLBuilder._rowMouseenter),e.on("mouseleave",".fl-row",FLBuilder._rowMouseleave),e.on("mouseleave",".fl-row-overlay",FLBuilder._rowMouseleave),e.on("mouseenter touchstart",".fl-col",FLBuilder._colMouseenter),e.on("mouseleave",".fl-col",FLBuilder._colMouseleave),e.on("mouseenter touchstart",".fl-module",FLBuilder._moduleMouseenter),e.on("mouseleave",".fl-module",FLBuilder._moduleMouseleave)},_destroyOverlayEvents:function(){var e=y(FLBuilder._contentClass);e.undelegate(".fl-row","mouseenter touchstart",FLBuilder._rowMouseenter),e.undelegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),e.undelegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),e.undelegate(".fl-col","mouseenter touchstart",FLBuilder._colMouseenter),e.undelegate(".fl-col","mouseleave",FLBuilder._colMouseleave),e.undelegate(".fl-module","mouseenter touchstart",FLBuilder._moduleMouseenter),e.undelegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_onContextmenu:function(e){y(this).hide()},_preventDefault:function(e){e.preventDefault()},_stopPropagation:function(e){e.stopPropagation()},_headerLinkClicked:function(e){var t=y(this).attr("href");this.hash||(e.preventDefault(),FLBuilderConfig.isUserTemplate||(FLBuilder._exitUrl=-1<t.indexOf("?")?t:t+"?fl_builder",FLBuilder.triggerHook("triggerDone")))},_warnBeforeUnload:function(){var e=0<y(".fl-builder-row-settings").length,t=0<y(".fl-builder-col-settings").length,i=0<y(".fl-builder-module-settings").length;if(e||t||i)return FLBuilderStrings.unloadWarning},_upgradeClicked:function(){window.open(FLBuilderConfig.upgradeUrl)},_toggleProModules:function(){var e=y(".fl-builder-blocks-pro-expand"),t=y(".fl-builder-blocks-pro-closed"),i=y(".fl-builder-blocks-pro-open");e.toggleClass("fl-builder-blocks-pro-expand-rotate"),t.length?(t.removeClass("fl-builder-blocks-pro-closed"),t.addClass("fl-builder-blocks-pro-open")):(i.removeClass("fl-builder-blocks-pro-open"),i.addClass("fl-builder-blocks-pro-closed"))},_showProMessage:function(e){var t,i;FLBuilderConfig.lite&&(t=new FLLightbox({className:"fl-builder-pro-lightbox",destroyOnClose:!0}),i=wp.template("fl-pro-lightbox"),t.open(i({feature:e})))},_initTipTips:function(){var e=y(".fl-tip:not(.fl-has-tip)");e.each(function(){var e=y(this);e.addClass("fl-has-tip"),null==e.attr("data-title")&&e.attr("data-title",e.attr("title"))}),FLBuilderLayout._isTouch()||e.tipTip({defaultPosition:"top",delay:300,maxWidth:"auto"})},_hideTipTips:function(){y("#tiptip_holder").stop().hide()},_submenuParentClicked:function(e){var t=y("body"),i=y(this),l=i.find(".fl-builder-submenu");i.hasClass("fl-builder-submenu-open")?(t.removeClass("fl-builder-submenu-open"),i.removeClass("fl-builder-submenu-open"),i.removeClass("fl-builder-submenu-right")):(i.offset().left+l.width()>y(window).width()&&i.addClass("fl-builder-submenu-right"),t.addClass("fl-builder-submenu-open"),i.addClass("fl-builder-submenu-open")),l.closest(".fl-row-overlay").addClass("fl-row-menu-active"),FLBuilder._hideTipTips(),e.preventDefault(),e.stopPropagation()},_submenuChildClicked:function(e){var t=y("body"),i=y(this).parents(".fl-builder-has-submenu");i.parents(".fl-builder-has-submenu").length||(t.removeClass("fl-builder-submenu-open"),i.removeClass("fl-builder-submenu-open"))},_submenuMouseenter:function(e){var t=y(this).data("timeout");void 0!==t&&clearTimeout(t)},_submenuMouseleave:function(e){var t=y("body"),i=y(this),l=setTimeout(function(){t.removeClass("fl-builder-submenu-open"),i.closest(".fl-builder-has-submenu").removeClass("fl-builder-submenu-open")},500);i.closest(".fl-row-overlay").removeClass("fl-row-menu-active"),i.data("timeout",l)},_submenuNestedParentMouseenter:function(e){var t=y(this),i=t.find(".fl-builder-submenu");t.width()+t.offset().left+i.width()>y(window).width()&&t.addClass("fl-builder-submenu-right")},_closeAllSubmenus:function(){y(".fl-builder-submenu-open").removeClass("fl-builder-submenu-open")},_buttonMouseUp:function(e){y(e.currentTarget).blur()},_closePanel:function(){FLBuilder.triggerHook("hideContentPanel")},_showPanel:function(){FLBuilder.triggerHook("showContentPanel")},_togglePanel:function(){FLBuilder.triggerHook("toggleContentPanel")},_blockSectionTitleClicked:function(){var e=y(this).parent();e.hasClass("fl-active")?e.removeClass("fl-active"):(y(".fl-builder-blocks-section").removeClass("fl-active"),e.addClass("fl-active")),FLBuilder._initScrollbars()},_publishLayout:function(e,t){if(FLBuilder._triggerSettingsSave(t,!0)){_.isUndefined(e)&&(e=!0);const i=FL.Builder.data.getLayoutActions();t=FLBuilder._onPublishComplete.bind(FLBuilder,e);i.saveLayout(!0,e,t)}},_publishButtonClicked:function(e){FLBuilder._publishLayout(e)},_onPublishComplete:function(e){e&&(FLBuilderConfig.shouldRefreshOnPublish?FLBuilder._exit():FLBuilder._exitWithoutRefresh()),y("#wp-admin-bar-fl-builder-frontend-edit-link .fl-builder-admin-bar-status-dot").css("color","#6bc373"),FLBuilder.triggerHook("didPublishLayout",{shouldExit:e})},_draftButtonClicked:function(){FLBuilder.showAjaxLoader();const e=FL.Builder.data.getLayoutActions();e.saveDraft()},_discardButtonClicked:function(){if(confirm(FLBuilderStrings.discardMessage)){FLBuilder.showAjaxLoader();const e=FL.Builder.data.getLayoutActions();e.discardDraft()}else FLBuilder.triggerHook("didCancelDiscard")},_cancelButtonClicked:function(){FLBuilder._exitUrl=null,FLBuilder._actionsLightbox.close()},_exit:function(){var e=window.location.href;try{var t=void 0!==window.opener.FLBuilder}catch(e){t=!1}FLBuilderConfig.isUserTemplate&&void 0!==window.opener&&window.opener?(t&&("undefined"==typeof FLBuilderGlobalNodeId?window.opener.FLBuilder._updateLayout():window.opener.FLBuilder._updateNode(FLBuilderGlobalNodeId)),window.close()):(e=FLBuilder._exitUrl||(e=(e=e.replace("?fl_builder&","?")).replace("?fl_builder","")).replace("&fl_builder",""),window.location.href=e)},_exitWithoutRefresh:function(){window.location.href;try{var t=void 0!==window.opener.FLBuilder}catch(e){t=!1}FLBuilderConfig.isUserTemplate&&t&&window.opener?(t&&("undefined"==typeof FLBuilderGlobalNodeId?window.opener.FLBuilder._updateLayout():window.opener.FLBuilder._updateNode(FLBuilderGlobalNodeId)),window.close()):FLBuilder.triggerHook("endEditingSession")},_duplicateLayoutClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"duplicate_post"},FLBuilder._duplicateLayoutComplete)},_duplicateLayoutComplete:function(e){var t=FLBuilderConfig.adminUrl;window.location.href=t+"post.php?post="+e+"&action=edit"},_layoutSettingsClicked:function(){FLBuilderSettingsForms.render({id:"layout",className:"fl-builder-layout-settings",settings:FLBuilderSettingsConfig.settings.layout},function(){FLBuilder._layoutSettingsInitCSS()})},_layoutSettingsInitCSS:function(){var e=y(".fl-builder-settings #fl-field-css textarea:not(.ace_text-input)");e.on("change",FLBuilder._layoutSettingsCSSChanged),FLBuilder._layoutSettingsCSSCache=e.val()},_layoutSettingsCSSChanged:function(){FLBuilder._layoutSettingsCSSTimeout&&clearTimeout(FLBuilder._layoutSettingsCSSTimeout),FLBuilder._layoutSettingsCSSTimeout=setTimeout(y.proxy(FLBuilder._layoutSettingsCSSDoChange,this),600)},_layoutSettingsCSSDoChange:function(){var e=y(".fl-builder-settings"),t=y(this);0<t.parents("#fl-field-css").find(".ace_error").length||((e.hasClass("fl-builder-layout-settings")?y("#fl-builder-layout-css"):y("#fl-builder-global-css")).html(t.val()),FLBuilder._layoutSettingsCSSTimeout=null)},_saveLayoutSettingsClicked:function(){for(var e=y(this).closest(".fl-builder-settings").serializeArray(),t={},i=0;i<e.length;i++)t[e[i].name]=e[i].value;FLBuilder.showAjaxLoader(),FLBuilder._lightbox.close(),FLBuilder._layoutSettingsCSSCache=null;const l=FL.Builder.data.getLayoutActions();l.saveLayoutSettings(t)},_cancelLayoutSettingsClicked:function(){(y(".fl-builder-settings").hasClass("fl-builder-layout-settings")?y("#fl-builder-layout-css"):y("#fl-builder-global-css")).html(FLBuilder._layoutSettingsCSSCache),FLBuilder._layoutSettingsCSSCache=null},_saveLayoutSettingsComplete:function(e){FLBuilder.triggerHook("didSaveLayoutSettingsComplete",e),FLBuilder._updateLayout()},_globalSettingsClicked:function(){FLBuilderSettingsForms.render({id:"global",className:"fl-builder-global-settings",settings:FLBuilderSettingsConfig.settings.global},function(){FLBuilder._layoutSettingsInitCSS()})},_saveGlobalSettingsClicked:function(){var e=y(this).closest(".fl-builder-settings"),t=e.validate().form(),e=FLBuilder._getSettings(e);if(t){FLBuilder.showAjaxLoader(),FLBuilder._layoutSettingsCSSCache=null;const i=FL.Builder.data.getLayoutActions();i.saveGlobalSettings(e),FLBuilder._lightbox.close()}},_saveGlobalSettingsComplete:function(e){FLBuilder.triggerHook("didSaveGlobalSettingsComplete",FLBuilder._jsonParse(e)),FLBuilder._updateLayout()},_initTemplateSelector:function(){0<y(FLBuilder._contentClass).find(".fl-row").length||FLBuilder.ContentPanel.show("modules")},_requestTemplateInsert:function(e,t){FLBuilder.layoutHasContent()?0==e?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate(0,!1,t)):(FLBuilder._selectedTemplateId=e,FLBuilder._selectedTemplateType=t,FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(e,!1,t)},_showTemplateActions:function(){var e=[];e[10]={key:"template-replace",label:FLBuilderStrings.templateReplace},e[20]={key:"template-append",label:FLBuilderStrings.templateAppend},FLBuilder._showActionsLightbox({className:"fl-builder-template-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_templateReplaceClicked:function(){confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!1,FLBuilder._selectedTemplateType))},_templateAppendClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!0,FLBuilder._selectedTemplateType)},_templateCancelClicked:function(){FLBuilder.triggerHook("showContentPanel")},_applyTemplate:function(e,t,i){t=void 0!==t&&t?"1":"0",i=void 0===i?"core":i,FLBuilder._lightbox.close(),FLBuilder.showAjaxLoader();const l=FL.Builder.data.getLayoutActions();l.applyTemplate(e,t,i),FLBuilder.triggerHook("didApplyTemplate")},_applyTemplateComplete:function(e){e=FLBuilder._jsonParse(e);FLBuilder._renderLayout(e.layout),FLBuilder.triggerHook("didApplyTemplateComplete",e.config)},_applyUserTemplateComplete:function(e){e=FLBuilder._jsonParse(e);null!==e.layout_css&&y("#fl-builder-layout-css").html(e.layout_css),FLBuilder._renderLayout(e.layout),FLBuilder.triggerHook("didApplyTemplateComplete",e.config)},_saveUserTemplateClicked:function(){FLBuilderConfig.lite?FLBuilder._showProMessage("Saving Templates"):FLBuilderSettingsForms.render({id:"user_template",className:"fl-builder-user-template-settings",rules:{name:{required:!0}}})},_saveUserTemplateSettings:function(){var e=y(this).closest(".fl-builder-settings"),t=e.validate().form(),e=FLBuilder._getSettings(e);if(t){const i=FL.Builder.data.getLayoutActions();i.saveUserTemplateSettings(e),FLBuilder._lightbox.close()}},_saveUserTemplateSettingsComplete:function(e){e&&(e=FLBuilder._jsonParse(e),FLBuilderConfig.contentItems.template.push(e),FLBuilder.triggerHook("contentItemsChanged"))},_userTemplateClicked:function(){var e=y(this).attr("data-id");0<y(FLBuilder._contentClass).children(".fl-row").length?"blank"==e?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate("blank",!1,"user")):(FLBuilder._selectedTemplateId=e,FLBuilder._selectedTemplateType="user",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(e,!1,"user")},_editUserTemplateClicked:function(e){e.preventDefault(),e.stopPropagation(),window.open(y(this).attr("href"))},_deleteUserTemplateClicked:function(e){var t=y(this).closest(".fl-user-template").attr("data-id"),i=(y(".fl-user-template[data-id="+t+"]"),null),l=null;if(confirm(FLBuilderStrings.deleteTemplate)){const o=FL.Builder.data.getLayoutActions();for(l in o.deleteUserTemplate(t),FLBuilderConfig.contentItems.template)FLBuilderConfig.contentItems.template[l].postId==t&&(i=l);_.isNull(i)||(FLBuilderConfig.contentItems.template.splice(i,1),FLBuilder.triggerHook("contentItemsChanged"))}e.stopPropagation()},_viewKnowledgeBaseClicked:function(){window.open(FLBuilderConfig.help.knowledge_base_url)},_visitForumsClicked:function(){window.open(FLBuilderConfig.help.forums_url)},_showTourOrTemplates:function(){FLBuilderConfig.simpleUi||FLBuilderConfig.isUserTemplate||(FLBuilderConfig.help.tour&&FLBuilderConfig.newUser?FLBuilder._showTourLightbox():FLBuilder._initTemplateSelector())},_doStats:function(){1==FLBuilderConfig.statsEnabled&&(args={"screen-width":screen.width,"screen-height":screen.height,"pixel-ratio":window.devicePixelRatio,"user-agent":window.navigator.userAgent,isrtl:FLBuilderConfig.isRtl},FLBuilder.ajax({action:"save_browser_stats",browser_data:args}))},_showTourLightbox:function(){var e=wp.template("fl-tour-lightbox");FLBuilder._actionsLightbox.open(e())},_noTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._initTemplateSelector()},_yesTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_startHelpTour:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_setupEmptyLayout:function(){var e=y(FLBuilder._contentClass);FLBuilderConfig.isUserTemplate&&"module"==FLBuilderConfig.userTemplateType||FLBuilderConfig.isUserTemplate&&"column"==FLBuilderConfig.userTemplateType||(e.removeClass("fl-builder-empty"),e.find(".fl-builder-empty-message").remove(),e.find(".fl-row, .fl-builder-block").length||(e.addClass("fl-builder-empty"),e.append('<span class="fl-builder-empty-message">'+FLBuilderStrings.emptyMessage+"</span>"),FLBuilder._initSortables()))},_updateNode:function(e,t){if(y(".fl-node-"+e).length){FLBuilder._showNodeLoading(e);const i=FL.Builder.data.getLayoutActions();i.renderNode(e,t)}},_updateLayout:function(){FLBuilder.showAjaxLoader();const e=FL.Builder.data.getLayoutActions();e.renderLayout(),e.fetchLayout()},_renderLayout:function(e,t){FLBuilder._layout?FLBuilder._layoutQueue.push({data:e,callback:t}):FLBuilder._layout=new FLBuilderAJAXLayout(e,t)},_renderLayoutComplete:function(){var e;FLBuilder._layout&&(FLBuilder._layout._complete(),FLBuilder._layout=null),FLBuilder._layoutQueue.length&&(e=FLBuilder._layoutQueue.shift(),FLBuilder._layout=new FLBuilderAJAXLayout(e.data,e.callback))},_resizeLayout:function(){y(window).trigger("resize"),"undefined"!=typeof YUI&&YUI().use("node-event-simulate",function(e){e.one(window).simulate("resize")})},layoutHasContent:function(){return 0<y(FLBuilder._contentClass).children(".fl-row").length},_initMediaElements:function(){var e={};void 0!==y.fn.mediaelementplayer&&("undefined"!=typeof _wpmejsSettings&&(e.pluginPath=_wpmejsSettings.pluginPath),y(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").mediaelementplayer(e))},_initDropTargets:function(){var e="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",t=y(FLBuilder._contentClass+" .fl-row"),i=null,l=y(FLBuilder._contentClass+" .fl-row"+e).find(".fl-col-group"),o=null,n=null,e="column"==FLBuilderConfig.userTemplateType?y(FLBuilder._contentClass+"> .fl-col").eq(0):null,s=0;for(y(".fl-col-drop-target").remove(),y(".fl-col-group-drop-target").remove(),y(".fl-row-drop-target").remove(),y(FLBuilder._contentClass).append('<div class="fl-drop-target fl-row-drop-target"></div>'),t.prepend('<div class="fl-drop-target fl-row-drop-target"></div>'),t.append('<div class="fl-drop-target fl-drop-target-last fl-row-drop-target fl-row-drop-target-last"></div>');s<t.length;s++)0===(i=t.eq(s)).find(".fl-col-group").length&&i.find(".fl-row-content").prepend('<div class="fl-drop-target fl-col-group-drop-target"></div>');for(e&&0===l.length&&(l=e.find(".fl-col-group"),e.append('<div class="fl-drop-target fl-col-drop-target"></div>'),e.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')),s=0;s<l.length;s++)n=(o=l.eq(s)).find("> .fl-col"),o.hasClass("fl-col-group-nested")||(o.append('<div class="fl-drop-target fl-col-group-drop-target"></div>'),o.append('<div class="fl-drop-target fl-drop-target-last fl-col-group-drop-target fl-col-group-drop-target-last"></div>')),n.append('<div class="fl-drop-target fl-col-drop-target"></div>'),n.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')},_blockDragHelper:function(e,t){var i=t.clone();return t.clone().insertAfter(t),i.addClass("fl-builder-block-drag-helper"),i},_blockDragInit:function(e){var t=y(e.currentTarget),i=null,l=y(window).scrollTop(),o=0;FLBuilder._dragEnabled=!0,FLBuilder._dragInitialScrollTop=l,0<t.closest("[data-node]").length?(i=t.closest("[data-node]")).addClass("fl-node-drag-init"):t.hasClass("fl-builder-block")&&y(".fl-row").each(function(){null===i&&0<y(this).offset().top-l&&(i=y(this))}),null!==i&&(o=i.offset().top-l),FLBuilder._highlightRowsAndColsForDrag(t),FLBuilder._adjustColHeightsForDrag(),FLBuilder._disableGlobalRows(),FLBuilder._disableGlobalCols(),FLBuilder._destroyOverlayEvents(),FLBuilder._initSortables(),y("body").addClass("fl-builder-dragging"),y(".fl-builder-empty-message").hide(),y(".fl-sortable-disabled").removeClass("fl-sortable-disabled"),"touchstart"===e.type||y(e.target).hasClass("fl-sortable-proxy-item ")||FLBuilder._removeAllOverlays(),0<o&&scrollTo(0,i.offset().top-o),FLBuilder.triggerHook("didInitDrag")},_blockDragStart:function(e,t){FLBuilder._dragging=!0,y(".fl-node-drag-init").removeClass("fl-node-drag-init"),FLBuilder.triggerHook("didStartDrag")},_blockDragSort:function(e,t){var i=t.placeholder.parent(),l=FLBuilderStrings.insert;FLBuilder._blockPreventSort(t.item,i)||(i.hasClass("fl-col-content")?l=t.item.hasClass("fl-builder-block-row")?t.item.find(".fl-builder-block-title").text():t.item.hasClass("fl-col-sortable-proxy-item")?FLBuilderStrings.column:t.item.hasClass("fl-builder-block-module")||t.item.hasClass("fl-builder-block-saved-module")||t.item.hasClass("fl-builder-block-module-template")?t.item.find(".fl-builder-block-title").text():t.item.attr("data-name"):i.hasClass("fl-col-drop-target")||i.hasClass("fl-col-group-drop-target")?l="":i.hasClass("fl-row-drop-target")&&(l=t.item.hasClass("fl-builder-block-row")||t.item.hasClass("fl-builder-block-saved-row")||t.item.hasClass("fl-builder-block-saved-column")?t.item.find(".fl-builder-block-title").text():t.item.hasClass("fl-row-sortable-proxy-item")?FLBuilderStrings.row:FLBuilderStrings.newRow),t.placeholder.html(l),t.item.hasClass("fl-node-global")||t.item.hasClass("fl-builder-block-global")||y(".fl-node-dragging").hasClass("fl-node-global")?t.placeholder.addClass("fl-builder-drop-zone-global"):t.placeholder.removeClass("fl-builder-drop-zone-global"))},_blockDragChange:function(e,t){t.placeholder.css("opacity","0"),t.placeholder.animate({opacity:"1"},100)},_blockPreventSort:function(e,t){var i=!1,l=e.hasClass("fl-builder-block-row"),o=e.hasClass("fl-col-sortable-proxy-item"),n=t.hasClass("fl-col-content"),s=t.hasClass("fl-col-drop-target"),r=t.parents(".fl-col-group:not(.fl-col-group-nested)"),a=t.parents(".fl-col-group-nested");return(l||o)&&n&&0<a.length&&(i=!0),n&&!t.find(".fl-module, .fl-col").length&&(l&&"1-col"==e.data("cols")||o)&&(i=!0),l&&n&&-1<y.inArray(e.data("cols"),["5-cols","6-cols"])&&(i=!0),o&&0<y(".fl-node-dragging").find(".fl-col-group-nested").length&&(n||s&&0<a.length)&&(i=!0),s&&0<r.length&&0===a.length&&11<r.find("> .fl-col:visible").length&&(i=!0),(i=s&&0<a.length&&3<a.find(".fl-col:visible").length?!0:i)&&t.addClass("fl-sortable-disabled"),i},_blockDragStop:function(e,t){var i=y(window).scrollTop(),t=t.item.parent(),l=null,l=t.hasClass("fl-drop-target")&&t.closest("[data-node]").length?(t=t.closest("[data-node]")).offset().top-i:t.offset().top-i;t.hasClass("fl-builder-blocks-section-content")&&FLBuilder._showPanel(),FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._removeEmptyRowAndColHighlights(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._enableGlobalCols(),FLBuilder._setupEmptyLayout(),y("body").removeClass("fl-builder-dragging"),scrollTo(0,t.offset().top-l),FLBuilder.triggerHook("didStopDrag")},_blockDragCancel:function(){FLBuilder._dragEnabled&&!FLBuilder._dragging&&(FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._removeEmptyRowAndColHighlights(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._setupEmptyLayout(),y("body").removeClass("fl-builder-dragging"),y(".fl-node-drag-init").removeClass("fl-node-drag-init"),y(".fl-node-dragging").removeClass("fl-node-dragging"),scrollTo(0,FLBuilder._dragInitialScrollTop))},_reorderNode:function(e,t){const i=FL.Builder.getActions();i.moveNode(e,t)},_reorderNodeComplete:function(e){var e=FLBuilder._jsonParse(e),t="didMove"+e.nodeType.charAt(0).toUpperCase()+e.nodeType.slice(1);FLBuilder.triggerHook("didMoveNode",e),FLBuilder.triggerHook(t,e)},_moveNode:function(e,t,i){const l=FL.Builder.getActions();l.moveNode(t,i,e)},_moveNodeComplete:function(e){const t=FLBuilder._jsonParse(e);e="didMove"+t.nodeType.charAt(0).toUpperCase()+t.nodeType.slice(1);FLBuilder.triggerHook("didMoveNode",t),FLBuilder.triggerHook(e,t)},_removeAllOverlays:function(){FLBuilder._removeRowOverlays(),FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._removeModuleOverlays(),FLBuilder._hideTipTips(),FLBuilder._closeAllSubmenus()},_appendOverlay:function(e,t){var i=0,l=null,o=e.hasClass("fl-row")?e.find("> .fl-row-content-wrap"):e.find("> .fl-node-content"),n=parseInt(o.css("margin-top"),10),o=parseInt(o.css("margin-bottom"),10);return e.append(t),e.addClass("fl-block-overlay-active"),FLBuilder._initTipTips(),l=e.find("> .fl-block-overlay"),n<0&&(i=parseInt(l.css("top"),10),i=isNaN(i)?0:i,l.css("top",n+i+"px")),o<0&&(i=parseInt(l.css("bottom"),10),i=isNaN(i)?0:i,l.css("bottom",o+i+"px")),l},_buildOverlayOverflowMenu:function(e){var t,i=e.find(".fl-block-overlay-header"),l=e.find(".fl-block-overlay-actions"),e=e.find(".fl-block-has-rules"),o=l.data("original"),n=null,s=0,r=null,a=0,d=[],u=[],c=[],h=wp.template("fl-overlay-overflow-menu");for(null!=o&&(l.after(o),l.remove(),l=o),l.data("original",l.clone()),t=Math.floor(l[0].getBoundingClientRect().width)-8,n=l.find(" > i, > span.fl-builder-has-submenu"),e.length&&t+e.outerWidth()>i.outerWidth()&&(s+=e.outerWidth());a<n.length;a++)r=n.eq(a),t<(s+=Math.floor(r[0].getBoundingClientRect().width))?(u.push(r),r.remove()):d.push(r);if(0<u.length){for(0<d.length&&u.unshift(d.pop().remove()),a=0;a<u.length;a++)u[a].is(".fl-builder-has-submenu")?c.push({type:"submenu",label:u[a].find(".fa, .fas, .far").data("title"),submenu:u[a].find(".fl-builder-submenu")[0].outerHTML}):c.push({type:"action",label:u[a].data("title"),className:u[a].removeClass(function(e,t){return t.replace(/fl-block-([^\s]+)/,"")}).attr("class")});l.append(h(c)),FLBuilder._initTipTips()}},_removeRowOverlays:function(){y(".fl-row").removeClass("fl-block-overlay-active"),y(".fl-row-overlay").remove(),y(".fl-module").removeClass("fl-module-adjust-height"),y("body").removeClass("fl-builder-row-resizing"),FLBuilder._closeAllSubmenus()},_disableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&y(".fl-row.fl-node-global").addClass("fl-node-disabled")},_disableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&y(".fl-row:not(.fl-node-global) .fl-col.fl-node-global").addClass("fl-node-disabled")},_enableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&y(".fl-node-disabled").removeClass("fl-node-disabled")},_enableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&y(".fl-node-disabled").removeClass("fl-node-disabled")},_rowMouseenter:function(){var e=y(this),t=e.attr("data-node"),i=e.offset().top,l=null,o=null,n=wp.template("fl-row-overlay"),s=FLBuilderResponsiveEditing._mode;e.closest(".fl-builder-node-loading").length||e.hasClass("fl-block-overlay-active")||(FLBuilder._removeRowOverlays(),o=FLBuilder._appendOverlay(e,n({node:t,global:e.hasClass("fl-node-global"),hasRules:e.hasClass("fl-node-has-rules"),rulesTextRow:e.attr("data-rules-text"),rulesTypeRow:e.attr("data-rules-type")})),e.find(".fl-node-content:visible").each(function(){var e=y(this).offset().top;l=null===l||e<l?e:l}),null!==l&&l<i&&o.css("top",l-i-30+"px"),("default"===s&&o.offset().top<43||"default"!==s&&0===e.index())&&o.addClass("fl-row-overlay-header-bottom"),e.find(".fl-module").each(function(){var e=y(this);e.outerHeight(!0)<20&&e.addClass("fl-module-adjust-height")}),FLBuilder._buildOverlayOverflowMenu(o))},_rowMouseleave:function(e){var t=y(e.target),e=y(e.toElement)||y(e.relatedTarget),i=e.hasClass("fl-row-overlay"),l=0<e.closest(".fl-row-overlay").length,o=e.is("#tiptip_holder"),e=0<e.closest("#tiptip_holder").length;t.closest(".fl-block-col-resize").length||i||l||o||e||FLBuilder._removeRowOverlays()},_rowDragHelper:function(){return y('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.row+"</div>")},_rowDragInit:function(e){var t=y(e.target),i=y(".fl-row-sortable-proxy-item");t.closest(".fl-row").addClass("fl-node-dragging"),FLBuilder._blockDragInit(e),e.target=i[0],i.trigger(e)},_rowDragInitTouch:function(t){var e=y(t.target),i=y(".fl-row-sortable-proxy-item"),l=e.closest(".fl-row"),o=!1;e.on("touchmove",function(e){o||(t.currentTarget=l[0],FLBuilder._rowDragInit(t),o=!0),i.trigger(e)}),e.on("touchend",function(e){i.trigger(e)})},_rowDragStart:function(e,t){var i=y(FLBuilder._contentClass+" .fl-row"),l=y(".fl-node-dragging");1===i.length&&y(FLBuilder._contentClass).addClass("fl-builder-empty"),l.hide(),FLBuilder._blockDragStart(e,t)},_rowDragStop:function(e,t){var i=t.item,l=i.parent(),o=null,n=0;if(FLBuilder._blockDragStop(e,t),l.hasClass("fl-builder-rows"))i.remove();else if(l.hasClass("fl-row-sortable-proxy"))y(".fl-node-dragging").removeClass("fl-node-dragging").show();else if(i.hasClass("fl-builder-block")){if(l.hasClass("fl-sortable-disabled"))return i.remove(),void FLBuilder._showPanel();l.hasClass("fl-col-content")?FLBuilder._addColGroup(i.closest(".fl-col").attr("data-node"),i.attr("data-cols"),l.find("> .fl-module, .fl-col-group, .fl-builder-block").index(i)):l.hasClass("fl-col-drop-target")?FLBuilder._addCols(l.closest(".fl-col"),l.hasClass("fl-col-drop-target-last")?"after":"before",i.attr("data-cols"),0<l.closest(".fl-col-group-nested").length):l.hasClass("fl-col-group-drop-target")?(e=i.closest(".fl-col-group"),n=i.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(e),FLBuilder._addColGroup(i.closest(".fl-row").attr("data-node"),i.attr("data-cols"),l.hasClass("fl-drop-target-last")?n+1:n)):(n=(o=i.closest(".fl-row")).length?y(FLBuilder._contentClass+" > .fl-row").index(o):0,FLBuilder._addRow(i.attr("data-cols"),l.hasClass("fl-drop-target-last")?n+1:n)),i.remove(),FLBuilder._showPanel(),y(".fl-builder-modules").siblings(".fl-builder-blocks-section-title").eq(0).trigger("click")}else o=y(".fl-node-dragging").removeClass("fl-node-dragging").show(),l.parent().hasClass("fl-builder-content")||(l.hasClass("fl-drop-target-last")?l.parent().after(o):l.parent().before(o),FLBuilder._reorderNode(o.attr("data-node"),o.index())),y(".fl-row-sortable-proxy").append(t.item)},_addRow:function(e,t,i){FLBuilder._showNodeLoadingPlaceholder(y(FLBuilder._contentClass),t),FLBuilder._newRowPosition=t;const l=FL.Builder.data.getLayoutActions();l.addRow(e,t,i)},_addRowComplete:function(e){var e="object"==typeof e?e:FLBuilder._jsonParse(e),t=y(FLBuilder._contentClass),i=y(e.html).data("node");e.nodeParent=t,e.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(e,function(){FLBuilder._removeNodeLoadingPlaceholder(y(".fl-node-"+i)),FLBuilder.triggerHook("didAddRow",i)})},_deleteRowClicked:function(e){var t=y(e.target).closest(".fl-row").data("node");FL.Builder.getActions().deleteNode(t),e.stopPropagation()},_deleteRow:function(e){var t=e.attr("data-node");const i=FL.Builder.data.getLayoutActions();i.deleteNode(t),e.empty(),e.remove(),FLBuilder._setupEmptyLayout(),FLBuilder._removeRowOverlays(),FLBuilder.triggerHook("didDeleteRow",t)},_rowCopyClicked:function(e){var t=y(this).closest(".fl-row").attr("data-node");FLBuilder._copyRow(t),e.stopPropagation()},_copyRow:function(t){var e=FLBuilder._getJQueryElement(t),i=e.clone(),l=y(".fl-builder-settings[data-node]"),o=l.attr("data-node"),n=o===t?e:e.find('[data-node="'+o+'"]'),s=null;l.length&&n.length&&(s=FLBuilder._getSettings(l),FLBuilderSettingsConfig.nodes[o]=s),i.addClass("fl-node-"+t+"-clone fl-builder-node-clone"),i.find(".fl-block-overlay").remove(),e.after(i),FLBuilder._showNodeLoading(t+"-clone");const r=i.get(0),a=(r.scrollIntoView({behavior:"smooth",block:"center"}),FL.Builder.data.getLayoutActions());a.copyRow(t,s,o,function(e){e=FLBuilder._jsonParse(e);e.nodeParent=y(FLBuilder._contentClass),e.nodePosition=y(FLBuilder._contentClass+" > .fl-row").index(i),e.duplicatedRow=t,e.onAddNewHTML=function(){i.remove()},FLBuilder._rowCopyComplete(e)})},_rowCopyComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateRow",{newNodeId:e.nodeId,oldNodeId:e.duplicatedRow})})},_rowSettingsClicked:function(e){var t=y(this),i=y(this).closest(".fl-row").attr("data-node"),l=0<t.closest(".fl-block-overlay-global").length;if(t.hasClass("fl-block-settings")||l&&"row"!=FLBuilderConfig.userTemplateType){const o=FL.Builder.data.getLayoutActions();o.displaySettings(i)}e.stopPropagation()},_showRowSettings:function(e,t){let i=null;t&&"row"!=FLBuilderConfig.userTemplateType?FLBuilderConfig.userCanEditGlobalTemplates&&((i=window.open(y('.fl-row[data-node="'+e+'"]').attr("data-template-url"))).FLBuilderGlobalNodeId=e):FLBuilderSettingsForms.render({id:"row",nodeId:e,className:"fl-builder-row-settings",attrs:'data-node="'+e+'"',buttons:t||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:t?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[e],preview:{type:"row"}},function(){y("#fl-field-width select").on("change",FLBuilder._rowWidthChanged),y("#fl-field-content_width select").on("change",FLBuilder._rowWidthChanged)})},_rowWidthChanged:function(){var e=y("#fl-field-width select").val(),t=y("#fl-field-content_width select").val(),i=y("#fl-field-max_content_width");"fixed"==e||"full"==e&&"fixed"==t?i.show():i.hide()},_resetRowWidthClicked:function(e){var t=y(this).closest(".fl-row"),i=t.attr("data-node"),l=t.find(".fl-row-content"),o=FLBuilderConfig.global.row_width+"px",n=y(".fl-builder-row-settings");t.hasClass("fl-row-fixed-width")&&t.css("max-width",o),l.css("max-width",o),n.length&&n.find("[name=max_content_width]").val("");const s=FL.Builder.data.getLayoutActions();s.resetRowWidth(i),FLBuilder._closeAllSubmenus(),FLBuilder.triggerHook("didResetRowWidth",i),e.stopPropagation()},_highlightEmptyCols:function(){var e="row"==FLBuilderConfig.userTemplateType||"column"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",e=(y(FLBuilder._contentClass+" .fl-row"+e),y(FLBuilder._contentClass+" .fl-col"+e));e.removeClass("fl-col-highlight").find(".fl-col-content").css("height",""),e.each(function(){var e=y(this);0===e.find(".fl-module, .fl-col").length&&e.addClass("fl-col-highlight")})},_highlightRowsAndColsForDrag:function(e){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)";"column"==FLBuilderConfig.userTemplateType&&(t=":not(:first)"),y(FLBuilder._contentClass+" .fl-row").addClass("fl-row-highlight"),e&&e.closest(".fl-row-overlay").length||y(FLBuilder._contentClass+" .fl-col"+t).addClass("fl-col-highlight")},_removeEmptyRowAndColHighlights:function(){y(".fl-row-highlight").removeClass("fl-row-highlight"),y(".fl-col-highlight").removeClass("fl-col-highlight")},_adjustColHeightsForDrag:function(){var e="row"==FLBuilderConfig.userTemplateType?"":".fl-row:not(.fl-node-global) ",t="column"==FLBuilderConfig.userTemplateType?"":".fl-col:not(.fl-node-global) ",i=y(FLBuilder._contentClass),l=i.find(e+".fl-col-group:not(.fl-col-group-nested) > "+t+"> .fl-col-content"),o=i.find(e+".fl-col-group-nested "+t+".fl-col-content"),n=0;for(y(".fl-node-drag-init").hide();n<o.length;n++)FLBuilder._adjustColHeightForDrag(o.eq(n));for(n=0;n<l.length;n++)FLBuilder._adjustColHeightForDrag(l.eq(n));y(".fl-node-drag-init").show()},_adjustColHeightForDrag:function(e){e.find(".fl-module:visible, .fl-col:visible").length&&e.height(e.height()+45)},_showColHighlightGuide:function(){var e=y(this),t=e.find("a"),i=e.closest(".fl-col"),l=i.parents(".fl-col"),o=y('<div class="fl-col-highlight-guide"></div>'),e=e.closest(".fl-block-overlay").offset().top;(i=t.hasClass("fl-block-col-move-parent")||t.hasClass("fl-block-col-edit-parent")?l:i).hasClass("fl-col-highlight")||(i.find("> .fl-col-content").append(o),i.addClass("fl-col-has-highlight-guide"),e<(t=o.offset().top)&&o.css("top",e-t+4+"px"))},_removeColHighlightGuides:function(){y(".fl-col-has-highlight-guide").removeClass("fl-col-has-highlight-guide"),y(".fl-col-highlight-guide").remove()},_colMouseenter:function(e){var t=y(this),i=t.closest(".fl-col-group"),l=(i.attr("data-node"),i.hasClass("fl-col-group-has-child-loading")),o=t.hasClass("fl-node-global"),n=0<t.parents(".fl-node-global").length,s=t.closest(".fl-col-group").find("> .fl-col").length,i=i.find("> .fl-col").index(t),r=0===i,i=s===i+1,a=0<t.find(".fl-col").length,d=0<t.find(".fl-module").length,u=t.parents(".fl-col"),c=u.closest(".fl-col-group"),h=0<u.length,f=void 0!==t.data("template-url"),g="column"==FLBuilderConfig.userTemplateType&&!h;numParentCols=h?c.find("> .fl-col").length:0,parentIndex=c.find("> .fl-col").index(u),parentFirst=h&&0===parentIndex,parentLast=h&&numParentCols===parentIndex+1,row=t.closest(".fl-row"),rowIsFixedWidth=!!row.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,userCanResizeRows=FLBuilderConfig.rowResize.userCanResizeRows,hasRules=t.hasClass("fl-node-has-rules"),template=wp.template("fl-col-overlay"),overlay=null,FLBuilderConfig.simpleUi&&!o||o&&n&&d&&!f||o&&"column"==FLBuilderConfig.userTemplateType&&d||!o&&0<t.find(".fl-module").length||0<t.find(".fl-builder-node-loading-placeholder").length||!d&&a||n&&a&&!f||t.closest(".fl-builder-node-loading").length||(t.hasClass("fl-block-overlay-active")||(FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),overlay=FLBuilder._appendOverlay(t,template({global:o,groupLoading:l,numCols:s,first:r,last:i,isRootCol:g,hasChildCols:a,hasParentCol:h,parentFirst:parentFirst,parentLast:parentLast,numParentCols:numParentCols,rowIsFixedWidth:rowIsFixedWidth,userCanResizeRows:userCanResizeRows,hasRules:hasRules})),FLBuilder._buildOverlayOverflowMenu(overlay),FLBuilder._initColDragResizing()),y("body").addClass("fl-block-overlay-muted"))},_colMouseleave:function(e){var t=y(this),i=y(e.target),e=y(e.toElement)||y(e.relatedTarget),l=0<t.find(".fl-module").length,t=(t.hasClass("fl-node-global"),void 0!==t.data("template-url")),o=e.is("#tiptip_holder"),e=0<e.closest("#tiptip_holder").length;i.closest(".fl-block-col-resize").length||o||e||l&&!t||(FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._closeAllSubmenus())},_removeColOverlays:function(){var e=y(".fl-col");e.removeClass("fl-block-overlay-active"),e.find(".fl-col-overlay").remove(),y("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_colDragHelper:function(){return y('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.column+"</div>")},_colDragInit:function(e){var t=y(e.target),i=y(".fl-col-sortable-proxy-item"),l=t.closest(".fl-col");(l=t.hasClass("fl-block-col-move-parent")?l.parents(".fl-col"):l).addClass("fl-node-dragging"),FLBuilder._blockDragInit(e),FLBuilder._removeColHighlightGuides(),e.target=i[0],i.trigger(e)},_colDragInitTouch:function(t){var e=y(t.target),i=y(".fl-col-sortable-proxy-item"),l=e.closest(".fl-col"),o=(e.closest(".fl-module"),!1);e.on("touchmove",function(e){o||(t.currentTarget=l[0],FLBuilder._colDragInit(t),o=!0),i.trigger(e)}),e.on("touchend",function(e){i.trigger(e)})},_colDragStart:function(e,t){var i=y(".fl-node-dragging");i.hide(),FLBuilder._resetColumnWidths(i.parent()),FLBuilder._blockDragStart(e,t)},_colDragStop:function(e,t){FLBuilder._blockDragStop(e,t);var e=y(".fl-node-dragging").removeClass("fl-node-dragging").show(),i=e.attr("data-node"),l=t.item.parent(),o=e.parent(),n=o.attr("data-node");newGroup=l.closest(".fl-col-group"),newGroupId=newGroup.attr("data-node"),newRow=l.closest(".fl-row"),position=0,l.closest('[data-node="'+i+'"]').length||l.hasClass("fl-sortable-disabled")||l.hasClass("fl-col-sortable-proxy")?FLBuilder._resetColumnWidths(o):l.hasClass("fl-col-content")?(e.remove(),0===o.find(".fl-col").length&&o.remove(),position=l.find("> .fl-module, .fl-col-group, .fl-col-sortable-proxy-item").index(t.item),FLBuilder._addColGroup(l.closest(".fl-col").attr("data-node"),i,position)):l.hasClass("fl-col-drop-target")?(l.hasClass("fl-col-drop-target-last")?l.parent().after(e):l.parent().before(e),FLBuilder._resetColumnWidths(newGroup),FL.Builder.data.getLayoutActions(),n==newGroupId?FL.Builder.getActions().moveNode(i,e.index()):FL.Builder.getActions().moveNode(i,e.index(),newGroupId,[n,newGroupId]),FLBuilder._resizeLayout()):l.hasClass("fl-col-group-drop-target")?(e.remove(),0===o.find(".fl-col").length&&o.remove(),position=newRow.find(".fl-row-content > .fl-col-group").index(newGroup),position=l.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addColGroup(newRow.attr("data-node"),i,position)):l.hasClass("fl-row-drop-target")&&(e.remove(),position=l.closest(".fl-builder-content").find(".fl-row").index(newRow),position=l.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addRow(i,position)),0===o.find(".fl-col").length&&o.remove(),y(".fl-col-sortable-proxy").append(t.item),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._closeAllSubmenus()},_colSettingsClicked:function(e){var t=y(this),i=t.closest(".fl-col"),l=i.attr("data-node"),o=0<t.parent().find("ul.fl-builder-submenu").length,n=0<t.closest(".fl-block-overlay-global").length;t.closest(".fl-block-overlay-global").hasClass("fl-col-overlay"),"column"!=FLBuilderConfig.userTemplateType&&i.attr("data-template-url");if(!FLBuilder._colResizing&&(!n||FLBuilderConfig.userCanEditGlobalTemplates)&&(!o||t.hasClass("fl-col-overlay"))){t.hasClass("fl-block-col-edit-parent")&&(l=i.parents(".fl-col").attr("data-node"));const s=FL.Builder.data.getLayoutActions();s.displaySettings(l),e.stopPropagation()}},_showColSettings:function(t,e,i){if(e&&i&&"row"!==FLBuilderConfig.userTemplateType){if(FLBuilderConfig.userCanEditGlobalTemplates){let e=window.open(y('.fl-col[data-node="'+t+'"]').attr("data-template-url"));e.FLBuilderGlobalNodeId=t}}else FLBuilderSettingsForms.render({id:"col",nodeId:t,className:"fl-builder-col-settings",attrs:'data-node="'+t+'"',buttons:e||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:e?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[t],preview:{type:"col"}},function(){0===y(".fl-col.fl-node-"+t).siblings(".fl-col").length&&y("#fl-field-equal_height, #fl-field-content_alignment").hide()})},_copyColClicked:function(e){var t=y(this).closest(".fl-col").attr("data-node");FLBuilder._copyColumn(t),e.stopPropagation()},_copyColumn:function(t){var e=FLBuilder._getJQueryElement(t),i=e.clone(),l=e.parent(),o=y(".fl-builder-settings[data-node]"),n=o.attr("data-node"),s=n===t?e:e.find('[data-node="'+n+'"]'),r=null;o.length&&s.length&&(r=FLBuilder._getSettings(o),FLBuilderSettingsConfig.nodes[n]=r),i.addClass("fl-node-"+t+"-clone fl-builder-node-clone"),i.find(".fl-block-overlay").remove(),e.after(i),FLBuilder._showNodeLoading(t+"-clone"),FLBuilder._resetColumnWidths(l);const a=FL.Builder.data.getLayoutActions();a.copyColumn(t,r,n,function(e){e=FLBuilder._jsonParse(e);e.nodeParent=l,e.nodePosition=i.index(),e.duplicatedColumn=t,e.onAddNewHTML=function(){i.remove()},FLBuilder._copyColComplete(e)})},_copyColComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder._resetColumnWidths(e.nodeParent),FLBuilder.triggerHook("didDuplicateColumn",{newNodeId:e.nodeId,oldNodeId:e.duplicatedColumn})})},_deleteColClicked:function(e){var t=y(e.target).closest(".fl-col").data("node");FL.Builder.getActions().deleteNode(t),e.stopPropagation(),FLBuilder.triggerHook("col-deleted")},_getColToDelete:function(e){var t=e.closest(".fl-col-group"),i=e.parents(".fl-col"),l=0<i.length,o=i.find("> .fl-col-content > .fl-module, > .fl-col-content > .fl-col-group"),n=e.siblings(".fl-col");return l&&1===o.length&&(0===n.length?e=i:1!==n.length||n.find(".fl-module").length||(e=t)),e},_deleteCol:function(e){var t=e.attr("data-node"),i=e.closest(".fl-row"),l=e.closest(".fl-col-group"),o=0;if(e.remove(),rowCols=i.find(".fl-row-content > .fl-col-group > .fl-col"),groupCols=l.find(" > .fl-col"),0===rowCols.length&&"row"!=FLBuilderConfig.userTemplateType&&"column"!=FLBuilderConfig.userTemplateType)FLBuilder._deleteRow(i);else{0===groupCols.length?l.remove():(o=6===groupCols.length?16.65:7===groupCols.length?14.28:Math.round(100/groupCols.length*100)/100,groupCols.css("width",o+"%"),FLBuilder.triggerHook("didResetColumnWidths",{cols:groupCols}));const n=FL.Builder.data.getLayoutActions();n.deleteColumn(t,o),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder.triggerHook("didDeleteColumn",t)}},_addCols:function(e,t,i,l,o){var n=e.closest(".fl-col-group"),s=n.find(".fl-col").index(e),e=e.attr("data-node");i=void 0===i?"1-col":i,l=(l=void 0!==l&&l)?1:0,"after"==t&&s++,FLBuilder._showNodeLoadingPlaceholder(n,s),FLBuilder._removeAllOverlays();const r=FL.Builder.data.getLayoutActions();r.addColumns(e,t,i,l,o)},_addColsComplete:function(e){var t="object"==typeof e?e:FLBuilder._jsonParse(e);t.nodeParent=FLBuilder._newColParent,t.nodePosition=FLBuilder._newColPosition,FLBuilder._renderLayout(t,function(){FLBuilder._removeNodeLoadingPlaceholder(y(".fl-node-"+t.nodeId)),FLBuilder.triggerHook("didAddColumn",t.nodeId),FLBuilder.triggerHook("didResetColumnWidths",{cols:y(".fl-node-"+t.nodeId).find("> .fl-col")})})},_addColGroup:function(e,t,i,l){var o=y(".fl-node-"+e);FLBuilder._newColGroupPosition=i,o.hasClass("fl-col")?FLBuilder._newColGroupParent=o.find(" > .fl-col-content"):FLBuilder._newColGroupParent=o.find(".fl-row-content"),FLBuilder._showNodeLoadingPlaceholder(FLBuilder._newColGroupParent,i);const n=FL.Builder.data.getLayoutActions();n.addColumnGroup(e,t,i,l)},_addColGroupComplete:function(e){var t=FLBuilder._jsonParse(e),e=y(t.html),i=e.data("node");e.find(".fl-col").data("node");t.nodeParent=FLBuilder._newColGroupParent,t.nodePosition=FLBuilder._newColGroupPosition,FLBuilder._renderLayout(t,function(){t.nodeParent.hasClass("fl-col-content")&&t.nodeParent.parents(".fl-col").addClass("fl-col-has-cols"),FLBuilder._removeNodeLoadingPlaceholder(y(".fl-node-"+i)),FLBuilder.triggerHook("didAddColumnGroup",i)})},_initColDragResizing:function(){y(".fl-block-col-resize").not(".fl-block-row-resize").draggable({axis:"x",start:FLBuilder._colDragResizeStart,drag:FLBuilder._colDragResize,stop:FLBuilder._colDragResizeStop})},_colDragResizeStart:function(e,t){for(var i=y(t.helper),l="",o=i.hasClass("fl-block-col-resize-parent"),n=o?i.closest(".fl-col").parents(".fl-col"):null,s=o?n.parents(".fl-col-group"):i.closest(".fl-col-group"),r=s.find("> .fl-col"),a=o?n:i.closest(".fl-col"),o=a.attr("data-node"),n=y("[data-node="+o+"] #fl-field-size input"),d=null,u=100,c=0,o=null,h=null,f=(d=i.hasClass("fl-block-col-resize-e")?(l="e",a.nextAll(".fl-col").first()):(l="w",a.prevAll(".fl-col").first())).attr("data-node"),f=y("[data-node="+f+"] #fl-field-size input");c<r.length;c++)r.eq(c).data("node")!=a.data("node")&&r.eq(c).data("node")!=d.data("node")&&(u-=parseFloat(r.eq(c)[0].style.width));n.length?(o=n,h="col"):f.length&&(o=f,h="sibling"),FLBuilder._colResizeData={handle:i,feedbackLeft:i.find(".fl-block-col-resize-feedback-left"),feedbackRight:i.find(".fl-block-col-resize-feedback-right"),direction:l,groupWidth:s.outerWidth(),col:a,id:a.attr("data-node"),colWidth:parseFloat(a[0].style.width)/100,sibling:d,siblingId:d.attr("data-node"),offset:t.position.left,availWidth:u,setting:o,settingType:h,layoutActions:FL.Builder.data.getLayoutActions()},FLBuilder._colResizing=!0,y("body").addClass("fl-builder-col-resizing"),FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents(),FLBuilder.triggerHook("col-resize-start")},_colDragResize:function(e,t){var i=FLBuilder._colResizeData,l=FLBuilderConfig.isRtl?"w":"e",o=i.handle.closest(".fl-block-overlay"),t=(i.offset-t.position.left)/i.groupWidth,t=l==i.direction?100*(i.colWidth-t):100*(i.colWidth+t),n=Math.round(100*t)/100,t=i.availWidth-t,s=Math.round(100*t)/100,t=Math.round(100*(i.availWidth-8))/100;n<8?(n=8,s=t):s<8&&(n=t,s=8),requestAnimationFrame(()=>{l==i.direction?(i.feedbackLeft.html(n.toFixed(1)+"%").show(),i.feedbackRight.html(s.toFixed(1)+"%").show()):(i.feedbackLeft.html(s.toFixed(1)+"%").show(),i.feedbackRight.html(n.toFixed(1)+"%").show()),i.col.css("width",n+"%"),i.sibling.css("width",s+"%"),i.setting&&("col"===i.settingType?i.setting.val(parseFloat(i.col[0].style.width)):"sibling"===i.settingType&&i.setting.val(parseFloat(i.sibling[0].style.width))),i.layoutActions.resizeColumn(i.id,n,i.siblingId,s,!1)}),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder.triggerHook("col-resize-drag")},_colDragResizeStop:function(e,t){var i=FLBuilder._colResizeData,l=FLBuilder._colResizeData.handle.closest(".fl-block-overlay"),o=i.id,n=parseFloat(i.col[0].style.width),s=i.sibling.data("node"),i=parseFloat(i.sibling[0].style.width);FLBuilder._colResizeData.feedbackLeft.hide(),FLBuilder._colResizeData.feedbackRight.hide();const r=FL.Builder.data.getLayoutActions();r.resizeColumn(o,n,s,i),FLBuilder._buildOverlayOverflowMenu(l),FLBuilder._colResizeData=null,y("body").removeClass("fl-builder-col-resizing"),FLBuilder._bindOverlayEvents(),setTimeout(function(){FLBuilder._colResizing=!1},50),FLBuilder.triggerHook("col-resize-stop"),FLBuilder.triggerHook("didResizeColumn",{colId:o,colWidth:n,siblingId:s,siblingWidth:i})},_resetColumnWidthsClicked:function(e){var t=y(this),i=!!t.closest(".fl-row-overlay").length,l=null,o=[],n=null,s=0,r=y(".fl-builder-col-settings");(i?t.closest(".fl-row").find(".fl-row-content > .fl-col-group"):t.parents(".fl-col-group").last()).each(function(){for(l=y(this),n=l.find(".fl-col-group"),o.push(l.data("node")),FLBuilder._resetColumnWidths(l),s=0;s<n.length;s++)FLBuilder._resetColumnWidths(n.eq(s)),o.push(n.eq(s).data("node"))}),r.length&&(i=y(".fl-node-"+r.attr("data-node")),r.find("#fl-field-size input").val(parseFloat(i[0].style.width)));const a=FL.Builder.data.getLayoutActions();a.resetColWidths(o),FLBuilder.triggerHook("col-reset-widths"),FLBuilder._closeAllSubmenus(),e.stopPropagation()},_resetColumnWidths:function(e){var e=(e instanceof jQuery?e:y(e)).find(" > .fl-col:visible"),t=0,t=6===e.length?16.65:7===e.length?14.28:Math.round(100/e.length*100)/100;e.css("width",t+"%"),FLBuilder.triggerHook("didResetColumnWidths",{cols:e})},_moduleMouseenter:function(e){var t=y(this),i=(t.attr("data-node"),t.attr("data-name")),l=t.hasClass("fl-node-global"),o=0<t.parents(".fl-node-global").length,n=t.parents(".fl-col-group").last().hasClass("fl-col-group-has-child-loading"),s=t.closest(".fl-col-group").find("> .fl-col").length,r=t.closest(".fl-col"),a=0===r.index(),d=s===r.index()+1,u=r.parents(".fl-col"),c=0<u.length,h=c?u.closest(".fl-col-group").find("> .fl-col").length:0,f=c&&0===u.index(),u=c&&h===u.index()+1,g="column"==FLBuilderConfig.userTemplateType&&!c,p=t.closest(".fl-row"),m=p.hasClass("fl-node-global"),p=!!p.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,b=FLBuilderConfig.rowResize.userCanResizeRows,v=t.hasClass("fl-node-has-rules"),_=t.attr("data-rules-text"),L=t.attr("data-rules-type"),F=r.attr("data-rules-text"),w=r.attr("data-rules-type"),r=r.hasClass("fl-node-has-rules"),C=wp.template("fl-module-overlay");l&&o&&"row"!=FLBuilderConfig.userTemplateType&&m||l&&o&&"column"!=FLBuilderConfig.userTemplateType&&!m||t.closest(".fl-builder-node-loading").length||t.find(".fl-inline-editor:visible").length||(t.hasClass("fl-block-overlay-active")||(FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),o=FLBuilder._appendOverlay(t,C({global:l,moduleName:i,groupLoading:n,numCols:s,colFirst:a,colLast:d,isRootCol:g,hasParentCol:c,numParentCols:h,parentFirst:f,parentLast:u,rowIsFixedWidth:p,userCanResizeRows:b,hasRules:v,rulesTextModule:_,rulesTypeModule:L,rulesTextCol:F,rulesTypeCol:w,colHasRules:r})),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder._initColDragResizing()),y("body").addClass("fl-block-overlay-muted"))},_moduleMouseleave:function(e){y(this);var t=y(e.target),e=y(e.toElement)||y(e.relatedTarget),i=e.is("#tiptip_holder"),e=0<e.closest("#tiptip_holder").length;t.closest(".fl-block-col-resize").length||i||e||(FLBuilder._removeModuleOverlays(),FLBuilder._removeColHighlightGuides())},_removeModuleOverlays:function(){var e=y(".fl-module");e.removeClass("fl-block-overlay-active"),e.find(".fl-module-overlay").remove(),y("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_moduleDragHelper:function(e,t){return y('<div class="fl-builder-block-drag-helper">'+t.attr("data-name")+"</div>")},_moduleDragInit:function(e){var t=y(e.target).closest(".fl-module");FLBuilder._blockDragInit(e),t.append('<div class="fl-module-sortable-proxy"></div>'),e.target=t.find(".fl-module-sortable-proxy")[0],t.trigger(e)},_moduleDragInitTouch:function(t){var e=y(t.target),i=e.closest(".fl-module"),l=!1;e.on("touchmove",function(e){l||(t.currentTarget=i[0],FLBuilder._moduleDragInit(t),l=!0),e.target=i.find(".fl-module-sortable-proxy")[0],y(e.target).trigger(e)}),e.on("touchend",function(e){e.target=i.find(".fl-module-sortable-proxy")[0],y(e.target).trigger(e),e.stopPropagation(),i.find(".fl-module-sortable-proxy").remove()})},_moduleDragStart:function(e,t){y(t.item).data("original-position",t.item.index()),FLBuilder._removeRowOverlays(),FLBuilder._blockDragStart(e,t)},_moduleDragStop:function(e,t){FLBuilder._blockDragStop(e,t);var i=t.item,l=i.parent(),o=null,n=0,s=0;if(y(".fl-module-sortable-proxy").remove(),l.hasClass("fl-builder-modules")||l.hasClass("fl-builder-widgets"))i.remove();else{if(i.hasClass("fl-builder-block")){if(l.hasClass("fl-sortable-disabled"))return i.remove(),void FLBuilder._showPanel();l.hasClass("fl-row-drop-target")?(l=i.closest(".fl-builder-content"),s=0,o=i.closest(".fl-row"),n=l.find(".fl-row").index(o)):l.hasClass("fl-col-group-drop-target")?(s=(l=i.closest(".fl-row-content")).closest(".fl-row").attr("data-node"),o=i.closest(".fl-col-group"),n=l.find(" > .fl-col-group").index(o)):l.hasClass("fl-col-drop-target")?(s=(l=i.closest(".fl-col-group")).attr("data-node"),o=i.closest(".fl-col"),n=l.find(" > .fl-col").index(o)):(n=l.find("> .fl-module, .fl-col-group, .fl-builder-block").index(i),s=i.closest(".fl-col").attr("data-node")),i.closest(".fl-drop-target-last").length&&(n+=1),FLBuilder._addModule(l,s,i.attr("data-type"),n,i.attr("data-widget"),i.attr("data-alias")),i.remove()}else{if(l.hasClass("fl-sortable-disabled"))return y(e.target).append(t.item),y(e.target).children().eq(t.item.data("original-position")).before(t.item),void FLBuilder._highlightEmptyCols();l.hasClass("fl-row-drop-target")?(o=i.closest(".fl-row"),n=i.closest(".fl-builder-content").children(".fl-row").index(o),n=i.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addRow("1-col",n,i.attr("data-node")),i.remove()):l.hasClass("fl-col-group-drop-target")?(o=i.closest(".fl-col-group"),n=i.closest(".fl-row-content ").find(" > .fl-col-group").index(o),n=i.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addColGroup(i.closest(".fl-row").attr("data-node"),"1-col",n,i.attr("data-node")),i.remove()):l.hasClass("fl-col-drop-target")?(o=i.closest(".fl-col"),n=i.closest(".fl-col-drop-target-last").length?"after":"before",FLBuilder._addCols(o,n,"1-col",0<i.closest(".fl-col-group-nested").length,i.attr("data-node")),i.remove()):FLBuilder._reorderModule(i)}FLBuilder._resizeLayout()}},_reorderModule:function(e){var t=e.closest(".fl-col").attr("data-node"),i=e.attr("data-parent"),l=e.attr("data-node"),o=e.index();t==i?FLBuilder._reorderNode(l,o):(e.attr("data-parent",t),FLBuilder._moveNode(t,l,o))},_deleteModuleClicked:function(e){var t=y(e.target).closest(".fl-module").data("node");FL.Builder.getActions().deleteNode(t),e.stopPropagation()},_getJQueryElement:function(e){return y(FLBuilder._contentClass).find('[data-node="'+e+'"]')},_needsDeleteConfirmation:function(e){if("module"===e.type)return!0;const t=FLBuilder._getJQueryElement(e.node);return 0<t.find(".fl-module").length},_deleteModule:function(e){var t=e.closest(".fl-row"),i=e.attr("data-node");const l=FL.Builder.data.getLayoutActions();l.deleteNode(i),e.empty(),e.remove(),t.removeClass("fl-block-overlay-muted"),FLBuilder._highlightEmptyCols(),FLBuilder._removeAllOverlays(),FLBuilder.triggerHook("didDeleteModule",{nodeId:i,moduleType:e.attr("data-type")})},_moduleCopyClicked:function(e){var t=y(this).closest(".fl-module").data("node");const i=FL.Builder.getActions();i.copyNode(t),e.stopPropagation()},_copyModule:function(t){var e=FLBuilder._getJQueryElement(t),i=e.clone(),l=e.parent(),o=y(".fl-builder-module-settings[data-node="+t+"]"),n={};o.length&&(n=FLBuilder._getSettings(o),FLBuilderSettingsConfig.nodes[t]=n),i.addClass("fl-node-"+t+"-clone fl-builder-node-clone"),i.find(".fl-block-overlay").remove(),e.after(i),FLBuilder._showNodeLoading(t+"-clone");const s=i.get(0),r=(s.scrollIntoView({behavior:"smooth",block:"center"}),FL.Builder.data.getLayoutActions());r.copyModule(t,n,function(e){e=FLBuilder._jsonParse(e);e.nodeParent=l,e.nodePosition=l.find(" > .fl-col-group, > .fl-module").index(i),e.duplicatedModule=t,e.onAddNewHTML=function(){i.remove()},FLBuilder._moduleCopyComplete(e)})},_moduleCopyComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateModule",{newNodeId:e.nodeId,oldNodeId:e.duplicatedModule,moduleType:e.moduleType})})},_moduleSettingsClicked:function(e){var t=y(this),i=(t.closest(".fl-module").attr("data-type"),t.closest(".fl-module").attr("data-node")),t=(t.closest(".fl-col").attr("data-node"),0<t.closest(".fl-block-overlay-global").length);if(e.stopPropagation(),!FLBuilder._colResizing&&(!t||FLBuilderConfig.userCanEditGlobalTemplates)){const l=FL.Builder.getActions();l.openSettings(i)}},_showModuleSettings:function(e,t){var i,l,o;FLBuilderSettingsConfig.modules&&(i=FLBuilderSettingsConfig.modules[e.type],l=e.settings||FLBuilderSettingsConfig.nodes[e.nodeId],o=y("head"),-1===y.inArray(e.type,FLBuilder._loadedModuleAssets)&&(""!==i.assets.css&&o.append(i.assets.css),""!==i.assets.js&&o.append(i.assets.js),FLBuilder._loadedModuleAssets.push(e.type)),FLBuilderSettingsForms.render({type:"module",id:e.type,nodeId:e.nodeId,className:"fl-builder-module-settings fl-builder-"+e.type+"-settings",attrs:'data-node="'+e.nodeId+'" data-parent="'+e.parentId+'" data-type="'+e.type+'"',buttons:e.global||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:e.global?[FLBuilderStrings.global]:[],settings:l,legacy:e.legacy,helper:FLBuilder._moduleHelpers[e.type],rules:FLBuilder._moduleHelpers[e.type]?FLBuilder._moduleHelpers[e.type].rules:null,messages:FLBuilder._moduleHelpers[e.type]?FLBuilder._moduleHelpers[e.type].messages:null,hide:!(FLBuilderConfig.userCanEditGlobalTemplates||!e.global),preview:{type:"module",layout:e.layout,callback:function(){FLBuilder.triggerHook("didAddModule",{nodeId:e.nodeId,moduleType:l.type})}}},t))},_saveModuleClicked:function(){var e=y(this).closest(".fl-builder-settings"),t=e.attr("data-type"),t=(e.attr("data-node"),FLBuilder._moduleHelpers[t]),i=!0;void 0!==t&&(e.find("label.error").remove(),e.validate().hideErrors(),i=(i=e.validate().form())&&t.submit()),i?FLBuilder._saveSettings():FLBuilder._toggleSettingsTabErrors()},_addModule:function(e,t,i,l,o,n){FLBuilder._showNodeLoadingPlaceholder(e,l),e.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=e,FLBuilder._newModulePosition=l);const s=FL.Builder.data.getLayoutActions();s.addModule(i,t,l,{widget:void 0===o?"":o,alias:void 0===n?"":n,nodePreview:1})},_addModuleComplete:function(e){e=FLBuilder._jsonParse(e);e.layout&&(FLBuilder._newModuleParent&&FLBuilder._newModuleParent.find(".fl-builder-node-loading-placeholder").hide(),e.layout.nodeParent=FLBuilder._newModuleParent,e.layout.nodePosition=FLBuilder._newModulePosition),e.settings||(e.settings=FLBuilderSettingsConfig.defaults.modules[e.type]),y("form.fl-builder-settings").length||e.global?e.layout&&FLBuilder._renderLayout(e.layout):FLBuilder._showModuleSettings(e,function(){y(".fl-builder-module-settings").data("new-module","1")})},registerModuleHelper:function(e,t){FLBuilder._moduleHelpers[e]=y.extend({},{rules:{},init:function(){},submit:function(){return!0},preview:function(){}},t)},_registerModuleHelper:function(e,t){FLBuilder.registerModuleHelper(e,t)},_showNodeTemplateSettings:function(e){var t=y(".fl-builder-settings-lightbox .fl-builder-settings"),i=t.attr("data-node"),l=FLBuilderStrings.saveModule;if(t.hasClass("fl-builder-row-settings")?l=FLBuilderStrings.saveRow:t.hasClass("fl-builder-col-settings")&&(l=FLBuilderStrings.saveColumn),!FLBuilder._triggerSettingsSave(!1,!1,!1))return!1;FLBuilderSettingsForms.render({id:"node_template",nodeId:i,title:l,attrs:'data-node="'+i+'"',className:"fl-builder-node-template-settings",rules:{name:{required:!0}}},function(){FLBuilderConfig.userCanEditGlobalTemplates||y("#fl-field-global").hide()})},_saveNodeTemplate:function(){var e=y(".fl-builder-node-template-settings"),t=e.attr("data-node");if(e.validate().form()){FLBuilder._showNodeLoading(t);const i=FL.Builder.data.getLayoutActions();i.saveNodeTemplate(t,FLBuilder._getSettings(e)),FLBuilder._lightbox.close()}},_saveNodeTemplateComplete:function(e){var t,i=FLBuilder._jsonParse(e),l=y(".fl-builder-saved-"+i.type+"s"),o=l.find(".fl-builder-block"),n=null,s=i.name.toLowerCase(),r=0,a=wp.template("fl-node-template-block"),e={name:i.name,isGlobal:i.global,content:i.type,id:i.id,postID:i.postID,kind:"template",type:"user",link:i.link,category:{uncategorized:FLBuilderStrings.uncategorized}};if(FLBuilderConfig.contentItems.template.push(e),FLBuilder.triggerHook("contentItemsChanged"),i.layout&&(FLBuilder._renderLayout(i.layout),FLBuilder.triggerHook("didSaveGlobalNodeTemplate",i.config)),0===o.length)l.append(a(i));else for(;r<o.length;r++){if(t=(n=o.eq(r)).text().toLowerCase().trim(),0===r&&s<t){l.prepend(a(i));break}if(s<t){n.before(a(i));break}if(o.length-1===r){l.append(a(i));break}}l.find(".fl-builder-block-no-node-templates").remove()},_nodeTemplateDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var t=i.item,i=t.parent(),l=null,o=0,n=null,s="",r=null;if(i.hasClass("fl-builder-blocks-section-content"))t.remove();else{if(t.hasClass("fl-builder-block-saved-row")||t.hasClass("fl-builder-block-row-template"))o=(n=t.closest(".fl-row")).length?y(FLBuilder._contentClass+" .fl-row").index(n):0,o=i.hasClass("fl-drop-target-last")?o+1:o,l=null,s="render_new_row_template",r=FLBuilder._addRowComplete,FLBuilder._newRowPosition=o,FLBuilder._showNodeLoadingPlaceholder(y(FLBuilder._contentClass),o);else if(t.hasClass("fl-builder-block-saved-column")){if(n=t.closest(".fl-col"),colGroup=i.closest(".fl-col-group"),colGroupId=colGroup.attr("data-node"),s="render_new_col_template",r=FLBuilder._addColsComplete,i.hasClass("fl-sortable-disabled"))return t.remove(),void FLBuilder._showPanel();i.hasClass("fl-row-drop-target")?(n=t.closest(".fl-row"),l=0,i=y(FLBuilder._contentClass),o=n.length?i.find(".fl-row").index(n):0):i.hasClass("fl-col-group-drop-target")?(i=t.closest(".fl-row-content"),l=t.closest(".fl-row").attr("data-node"),o=t.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(t.closest(".fl-col-group"))):i.hasClass("fl-col-drop-target")&&(o=(i=t.closest(".fl-col-group")).children(".fl-col").index(t.closest(".fl-col")),l=i.attr("data-node")),t.closest(".fl-drop-target-last").length&&(o+=1),i.hasClass("fl-col-group")?FLBuilder._newColParent=null:FLBuilder._newColParent=i,FLBuilder._newColPosition=o,FLBuilder._showNodeLoadingPlaceholder(i,o)}else if(t.hasClass("fl-builder-block-saved-module")||t.hasClass("fl-builder-block-module-template")){if(s="render_new_module",r=FLBuilder._addModuleComplete,i.hasClass("fl-sortable-disabled"))return t.remove(),void FLBuilder._showPanel();i.hasClass("fl-row-drop-target")?(l=0,o=(i=t.closest(".fl-builder-content")).find(".fl-row").index(t.closest(".fl-row"))):i.hasClass("fl-col-group-drop-target")?(l=(i=t.closest(".fl-row-content")).closest(".fl-row").attr("data-node"),o=i.find(" > .fl-col-group").index(t.closest(".fl-col-group"))):l=i.hasClass("fl-col-drop-target")?(o=(i=t.closest(".fl-col-group")).children(".fl-col").index(t.closest(".fl-col")),i.attr("data-node")):(o=i.children(".fl-module, .fl-builder-block").index(t),t.closest(".fl-col").attr("data-node")),t.closest(".fl-drop-target-last").length&&(o+=1),i.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=i,FLBuilder._newModulePosition=o),FLBuilder._showNodeLoadingPlaceholder(i,o)}n=t.attr("data-id"),i=t.attr("data-type");let e="render_new_row_template"===s?"row":"render_new_col_template"===s?"column":"module";const a=FL.Builder.data.getLayoutActions();a.addNodeTemplate(e,n,i,l,o,function(e){var t;-1<s.indexOf("row")?(t=FLBuilder._jsonParse(e),FLBuilder.triggerHook("didApplyRowTemplateComplete",t.config),r(t.layout)):-1<s.indexOf("col")?(t=FLBuilder._jsonParse(e),FLBuilder.triggerHook("didApplyColTemplateComplete",t.config),r(t.layout)):r(e)}),t.remove()}},_editNodeTemplateClicked:function(e){e.preventDefault(),e.stopPropagation(),window.open(y(this).attr("href"))},_deleteNodeTemplateClicked:function(e){var e=y(e.target),t=e.closest(".fl-builder-blocks-section").find(".fl-builder-blocks-section-content"),i=t.find(".fl-builder-block"),e=e.closest(".fl-builder-block"),l=e.hasClass("fl-builder-block-global"),o=l?FLBuilderStrings.deleteGlobalTemplate:FLBuilderStrings.deleteTemplate,n=e.attr("data-id");if(confirm(o)){e.remove(),1===i.length&&(e.hasClass("fl-builder-block-saved-row")?t.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedRows+"</span>"):t.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedModules+"</span>")),e.hasClass("fl-builder-block-global")&&FLBuilder.showAjaxLoader();const s=FL.Builder.data.getLayoutActions();s.deleteNodeTemplate(n,l),o=_.findIndex(FLBuilderConfig.contentItems.template,{id:e.attr("data-id"),type:"user"}),FLBuilderConfig.contentItems.template.splice(o,1),FLBuilder.triggerHook("contentItemsChanged")}},_initSettingsForms:function(){FLBuilder._initSettingsSections(),FLBuilder._initButtonGroupFields(),FLBuilder._initCompoundFields(),FLBuilder._CodeFieldSSLCheck(),FLBuilder._initCodeFields(),FLBuilder._initColorPickers(),FLBuilder._initGradientPickers(),FLBuilder._initIconFields(),FLBuilder._initPhotoFields(),FLBuilder._initSelectFields(),FLBuilder._initEditorFields(),FLBuilder._initMultipleFields(),FLBuilder._initAutoSuggestFields(),FLBuilder._initLinkFields(),FLBuilder._initFontFields(),FLBuilder._initOrderingFields(),FLBuilder._initTimezoneFields(),FLBuilder._initDimensionFields(),FLBuilder._initFieldPopupSliders(),FLBuilder._initPresetFields(),FLBuilder._focusFirstSettingsControl(),FLBuilder._calculateSettingsTabsOverflow(),FLBuilder._lightbox._resizeEditors(),y(".fl-builder-settings-fields").css("visibility","visible"),y(".fl-builder-settings button").on("click",function(e){e.preventDefault()}),FLBuilder.triggerHook("settings-form-init")},_destroySettingsForms:function(){FLBuilder._destroyEditorFields()},_setSettingsFormContent:function(e){y(".fl-legacy-settings").remove(),y("body").append(e)},_settingsTabClicked:function(e){var t=y(this),i=t.closest(".fl-builder-settings"),t=t.attr("href").split("#").pop();FLBuilder._resetSettingsTabsState(),i.find(".fl-builder-settings-tab").removeClass("fl-active"),i.find("#"+t).addClass("fl-active"),i.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),i.find("a[href*="+t+"]").addClass("fl-active"),FLBuilderConfig.rememberTab?localStorage.setItem("fl-builder-settings-tab",t):localStorage.setItem("fl-builder-settings-tab",""),FLBuilder._focusFirstSettingsControl(),e.preventDefault()},_resetSettingsTabsState:function(){var e=y(".fl-lightbox:visible");FLBuilder._hideTabsOverflowMenu(),e.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),e.find(".fl-builder-settings-tabs-overflow-menu .fl-active").removeClass("fl-active"),e.find(".fl-contains-active").removeClass("fl-contains-active")},_calculateSettingsTabsOverflow:function(){var e=y(".fl-lightbox:visible"),t=e.outerWidth(),i=e.hasClass("fl-lightbox-width-slim"),l=e.find(".fl-builder-settings-tabs"),o=e.find(".fl-builder-settings-tabs-overflow-menu"),n=e.find(".fl-builder-settings-tabs-more"),l=l.find("a"),s=!1,r=t-60,a=0,d=i?16:30;o.html(""),FLBuilder._hideTabsOverflowMenu(),l.removeClass("fl-overflowed"),l.each(function(){if(!y(this).is(":visible"))return!0;var e,t,i;s||(e=y(this).textWidth()+d+12,r<=(a+=e)&&(s=!0)),s?(e=y(this).html(),i=y(this).attr("href"),t="",y(this).hasClass("fl-active")&&(t="fl-active"),y(this).hasClass("error")&&(t+=" error"),i=y('<a href="'+i+'" '+(t=""!==t?'class="'+t+'"':t)+">"+e+"</a>"),o.append(i),y(this).addClass("fl-overflowed")):y(this).removeClass("fl-overflowed")}),s?e.addClass("fl-lightbox-has-tab-overflow"):e.removeClass("fl-lightbox-has-tab-overflow"),0<o.find(".fl-active").length?n.addClass("fl-contains-active"):n.removeClass("fl-contains-active"),0<o.find(".error").length?n.addClass("fl-contains-errors"):n.removeClass("fl-contains-errors")},_settingsTabsToOverflowMenuItemClicked:function(e){var t=y(e.currentTarget),i=t.attr("href"),l=t.closest(".fl-lightbox-header-wrap").find(".fl-builder-settings-tabs"),i=l.find('a[href="'+i+'"]'),l=l.find(".fl-builder-settings-tabs-more");FLBuilder._resetSettingsTabsState(),i.trigger("click"),t.addClass("fl-active"),l.addClass("fl-contains-active"),FLBuilder._hideTabsOverflowMenu(),e.preventDefault()},_hasOverflowTabs:function(){return 0<y(".fl-lightbox:visible").find(".fl-builder-settings-tabs-overflow-menu a").length},_showTabsOverflowMenu:function(){var e;FLBuilder._hasOverflowTabs()&&((e=y(".fl-lightbox:visible")).find(".fl-builder-settings-tabs-overflow-menu").css("display","flex"),e.find(".fl-builder-settings-tabs-overflow-click-mask").show(),this.isShowingSettingsTabsOverflowMenu=!0)},_hideTabsOverflowMenu:function(){var e=y(".fl-lightbox:visible");e.find(".fl-builder-settings-tabs-overflow-menu").css("display","none"),e.find(".fl-builder-settings-tabs-overflow-click-mask").hide(),this.isShowingSettingsTabsOverflowMenu=!1},_toggleTabsOverflowMenu:function(e){FLBuilder.isShowingSettingsTabsOverflowMenu?FLBuilder._hideTabsOverflowMenu():FLBuilder._showTabsOverflowMenu(),e.stopPropagation()},_initSettingsSections:function(){y(".fl-builder-settings:visible").find(".fl-builder-settings-section").each(FLBuilder._initSection)},_settingsCancelClicked:function(e){var t=y(".fl-builder-lightbox[data-parent]"),i=y(".fl-builder-module-settings"),l=null,o=null,n=null,s="column"==FLBuilderConfig.userTemplateType;if(0<t.length)FLBuilder._closeNestedSettings();else{0<i.length&&void 0!==i.data("new-module")?(l=y(FLBuilder.preview.state.html),n=(o=y(".fl-node-"+i.data("node"))).closest(".fl-col"),0<l.find(".fl-node-"+n.data("node")).length||s?FLBuilder._deleteModule(o):FLBuilder._deleteCol(n)):FLBuilder.preview&&FLBuilder.preview.revert();const r=FL.Builder.data.getLayoutActions();r.cancelDisplaySettings(),FLBuilder.preview=null,FLLightbox.closeParent(this),FLBuilder.triggerHook("didCancelNodeSettings")}},_focusFirstSettingsControl:function(){var e=y(".fl-builder-settings:visible"),t=e.find(".fl-builder-settings-tab.fl-active"),e=e.data("node"),i=t.find(".fl-field").first(),l=i.find('input:not([type="hidden"]), textarea, select, button, a, .fl-editor-field').first();e&&y(".fl-node-"+e+" .fl-inline-editor").length||("undefined"!=typeof tinyMCE&&l.hasClass("fl-editor-field")?(t=l.find("textarea.wp-editor-area").attr("id"),tinyMCE.get(t).focus()):setTimeout(function(){l.focus().css("animation-name","fl-grab-attention")},300),i.css("animation-name","fl-grab-attention"),i.on("animationend",function(){i.css("animation-name","")}))},_initSettingsValidation:function(e,t){y(".fl-builder-settings").last().validate({ignore:".fl-ignore-validation",rules:e,messages:t=t||{},errorPlacement:FLBuilder._settingsErrorPlacement})},_settingsErrorPlacement:function(e,t){e.appendTo(t.parent())},_toggleSettingsTabErrors:function(){for(var e,t=y(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab"),l=null,o=0;o<i.length;o++)e=(l=i.eq(o)).find("label.error"),(tabLink=t.find(".fl-builder-settings-tabs a[href*="+l.attr("id")+"]")).find(".fl-error-icon").remove(),tabLink.removeClass("error"),0<e.length&&(tabLink.append('<span class="fl-error-icon"></span>'),tabLink.addClass("error"));FLBuilder._calculateSettingsTabsOverflow()},_getSettings:function(e){FLBuilder._updateEditorFields();for(var t,i,l=e.serializeArray(),o=0,n=0,s="",r=[],a=[],d={},o=0;o<l.length;o++)if(t=l[o].value.replace(/\r/gm,"").replace(/'/g,"'"),!(-1<l[o].name.indexOf("flrich")))if(-1<l[o].name.indexOf("[")){for(i=l[o].name.replace(/\[(.*)\]/,""),r=[],a=(s=l[o].name.replace(i,"")).match(/\[[^\]]*\]/g),n=0;n<a.length;n++)"[]"!=a[n]&&r.push(a[n].replace(/\[|\]/g,""));s.match(/\[\]\[[^\]]*\]\[[^\]]+\]/)||s.match(/\[\]\[[^\]]*\]\[\]\[[^\]]+\]/)?(void 0===d[i]&&(d[i]={}),void 0===d[i][r[0]]&&(d[i][r[0]]={}),d[i][r[0]][r[1]]=t):s.match(/\[\]\[[^\]]*\]\[\]/)?(void 0===d[i]&&(d[i]={}),void 0===d[i][r[0]]&&(d[i][r[0]]=[]),d[i][r[0]].push(t)):s.match(/\[\]\[[^\]]*\]/)?(void 0===d[i]&&(d[i]={}),d[i][r[0]]=t):s.match(/\[\]/)&&(void 0===d[i]&&(d[i]=[]),d[i].push(t))}else d[l[o].name]=t;for(s in d)if(void 0!==d["as_values_"+s]){d[s]=y.grep(d["as_values_"+s].split(","),function(e){return""!==e}).join(",");try{delete d["as_values_"+s]}catch(e){}}return y.each(e.find("[name]"),function(e,t){t=y(t).attr("name").replace(/\[(.*)\]/,"");t in d||(d[t]="")}),d=y.extend({},FLBuilder._getOriginalSettings(e),d)},_getSettingsJSONForHTML:function(e){return JSON.stringify(e).replace(/\'/g,"'").replace("<wbr />","<wbr>")},_getOriginalSettings:function(e,t){var i=e.find(".fl-builder-settings-json"),e=e.data("node"),l=FLBuilderSettingsConfig.nodes,o=null,n={};if(e&&l[e]?o=l[e]:i.length&&(o=FLBuilder._jsonParse(i.val().replace(/'/g,"'"))),o)for(key in o)(key.match(/[a-z0-9-_]+$/)&&y("#fl-field-"+key).length||t)&&(n[key]=o[key]);return n},_getSettingsForChangedCheck:function(e,t){var i=FLBuilder._getSettings(t);if(e){t=y(".fl-node-"+e);if(t.hasClass("fl-module")){t=t.data("type"),t=FLBuilderSettingsConfig.editables[t];if(t&&FLBuilderSettingsConfig.nodes[e])for(var l in t)i[l]=FLBuilderSettingsConfig.nodes[e][l]}}return i},_saveSettings:function(i){var e=y(".fl-builder-settings-lightbox .fl-builder-settings"),t=e.data("new-module"),l=e.attr("data-node"),o=FLBuilder._getSettings(e),n=FLBuilder.preview;function s(){FLBuilder._showNodeLoading(l),FLBuilderSettingsConfig.nodes[l]=o;const e=FL.Builder.data.getLayoutActions();var t=FLBuilder._saveSettingsComplete.bind(this,i,n);e.updateNodeSettings(l,o,t),FLBuilder.triggerHook("didSaveNodeSettings",{nodeId:l,settings:o}),FLBuilder._lightbox.close()}!FLBuilder.isUndefined(i)&&FLBuilder.isBoolean(i)||(i=!0),n&&!n._settingsHaveChanged()&&FLBuilder.isUndefined(t)?FLBuilder._lightbox.close():FLBuilderConfig.userCaps.unfiltered_html?s():(FLBuilderSettingsForms.showLightboxLoader(),FLBuilder.ajax({action:"verify_settings",settings:o},function(e){"true"===e?s():(msg='<p style="font-weight:bold;text-align:center;">'+FLBuilderStrings.noScriptWarn.heading+"</p>",FLBuilderConfig.userCaps.global_unfiltered_html?msg+="<p>"+FLBuilderStrings.noScriptWarn.global+"</p>":msg+="<p>"+FLBuilderStrings.noScriptWarn.message+"</p>",msg=(msg+='<p><div class="fl-diff"></div></p>')+"<p>"+FLBuilderStrings.noScriptWarn.footer+"</p>",FLBuilderSettingsForms.hideLightboxLoader(),FLBuilder.alert(msg),""!==(data=y.parseJSON(e)).diff&&(y(".fl-diff").html(data.diff),y(".fl-diff").prepend("<p>"+FLBuilderStrings.codeErrorDetected+"</p>"),y(".fl-diff .diff-deletedline").each(function(){(y(this).find("del").length<1?y(this).css("background-color","rgb(255, 192, 203, 0.7)").css("padding","10px"):y(this).find("del").css("background-color","rgb(255, 192, 203, 0.7)")).css("border","1px solid pink")}),console.log("============"),console.log("key: "+data.key),console.log("value: "+data.value),console.log("parsed: "+data.parsed),console.log("============")))}))},_saveSettingsComplete:function(e,t,i){function l(){t&&o.layout.partial&&o.layout.nodeId===t.nodeId&&!FLBuilder._publishAndRemain&&(t.clear(),t=null,FLBuilder._publishAndRemain=!1)}var o=FLBuilder._jsonParse(i),i=o.layout.nodeType,n=o.layout.moduleType,s="didSave"+i.charAt(0).toUpperCase()+i.slice(1)+"SettingsComplete";!0===e?FLBuilder._renderLayout(o.layout,l):l(),FLBuilder.triggerHook("didSaveNodeSettingsComplete",{nodeId:o.node_id,nodeType:i,moduleType:n,settings:o.settings}),FLBuilder.triggerHook(s,{nodeId:o.node_id,nodeType:i,moduleType:n,settings:o.settings})},_triggerSettingsSave:function(e,t,i){var l=FLBuilder._lightbox._node.find("form.fl-builder-settings"),o=FLBuilder._lightbox._node.data("instance-id"),o=FLLightbox._instances[o],n=y(".fl-lightbox-wrap[data-parent]:visible"),s=!0;return e=!_.isUndefined(e)&&e,t=!_.isUndefined(t)&&t,(i=_.isUndefined(i)?!e:i)||(FLBuilder._publishAndRemain=!0),l.length&&(n.length&&(n.find(".fl-builder-settings-save").trigger("click"),(n.find("label.error").length||y(".fl-builder-alert-lightbox:visible").length)&&(s=!1)),s&&!l.validate({ignore:".fl-ignore-validation"}).form()&&(s=!1),n=FLBuilderSettingsForms.settingsHaveChanged(),s&&n&&(e&&o.disableClose(),l.find(".fl-builder-settings-save").trigger("click"),e&&o.enableClose(),(l.find("label.error").length||y(".fl-builder-alert-lightbox:visible").length)&&(s=!1)),i?(FLBuilder._destroySettingsForms(),!n&&FLBuilder.preview&&(FLBuilder.preview.clear(),FLBuilder.preview=null)):FLBuilderSettingsForms.cacheCurrentSettings(),n||e||o.close()),s?FLBuilder.triggerHook("didTriggerSettingsSave"):(FLBuilder.triggerHook("didFailSettingsSave"),FLBuilder._toggleSettingsTabErrors(),t&&!y(".fl-builder-alert-lightbox:visible").length&&FLBuilder.alert(FLBuilderStrings.settingsHaveErrors)),s},_refreshSettingsPreviewReference:function(){FLBuilder.preview&&FLBuilder.preview._initElementsAndClasses()},_openNestedSettings:function(e){e.className&&-1===e.className.indexOf("fl-builder-settings-lightbox")&&(e.className+=" fl-builder-settings-lightbox"),e=y.extend({className:"fl-builder-lightbox fl-builder-settings-lightbox",destroyOnClose:!0,resizable:!0},e);var t=y(".fl-lightbox-wrap:visible"),i=t.find(".fl-lightbox"),e=new FLLightbox(e),l=e._node,o=l.find(".fl-lightbox");return t.hide(),l.attr("data-parent",t.attr("data-instance-id")),o.attr("style",i.attr("style")),e.on("resized",FLBuilder._calculateSettingsTabsOverflow),e.open('<div class="fl-builder-lightbox-loading"></div>'),e},_closeNestedSettings:function(){var e=y(".fl-builder-lightbox[data-parent]:visible"),t=e.find(".fl-lightbox"),i=e.attr("data-instance-id"),i=FLLightbox._instances[i],e=e.attr("data-parent"),l=y('[data-instance-id="'+e+'"]'),o=l.find(".fl-lightbox"),n=l.find("form"),s=FLLightbox._instances[e];i&&(i.on("close",function(){o.attr("style",t.attr("style")),l.show(),s._resize(),l.find("label.error").remove(),n.validate().hideErrors(),FLBuilder._toggleSettingsTabErrors(),FLBuilder._initMultipleFields()}),i.close())},_showHelpTooltip:function(){y(this).siblings(".fl-help-tooltip-text").fadeIn()},_hideHelpTooltip:function(){y(this).siblings(".fl-help-tooltip-text").fadeOut()},_initSection:function(){var e=y(this);e.find(".fl-builder-settings-section-header").on("click",function(){e.toggleClass("fl-builder-settings-section-collapsed")})},_initButtonGroupFields:function(){y(".fl-builder-settings:visible").find(".fl-button-group-field").each(FLBuilder._initButtonGroupField)},_initButtonGroupField:function(){var e=y(this),i=e.find(".fl-button-group-field-option"),l=e.find("input");i.on("click",function(){var e=y(this);"1"==e.attr("data-selected")?(e.attr("data-selected","0"),l.val("").trigger("change")):(i.attr("data-selected","0"),e.attr("data-selected","1"),l.val(e.data("value")).trigger("change"))}),l.on("change",function(e){var t=l.val(),t=i.filter('[data-value="'+t+'"]');i.attr("data-selected","0"),t.attr("data-selected","1")})},_initCompoundFields:function(){y(".fl-builder-settings:visible").find(".fl-compound-field").each(FLBuilder._initCompoundField)},_initCompoundField:function(){var e=y(this),t=e.find(".fl-compound-field-section"),i=e.find(".fl-compound-field-section-toggle"),e=e.find(".fl-compound-field-setting").has(".fl-dimension-field-units");t.each(function(){var e=y(this);e.find(".fl-compound-field-section-toggle").length||e.addClass("fl-compound-field-section-visible")}),i.on("click",function(){var e=y(this),t=e.closest(".fl-field"),e="."+e.closest(".fl-compound-field-section").attr("class").split(" ").join(".");t.find(e).toggleClass("fl-compound-field-section-visible")}),e.each(function(){var e=y(this),t=e.find(".fl-compound-field-label");t.length&&!e.find(".fl-shadow-field").length&&t.append('<i class="fl-dimension-field-link fl-tip dashicons dashicons-admin-links" title="Link Values"></i>')})},_initAutoSuggestFields:function(){var t,i=y(".fl-builder-settings:visible .fl-suggest-field"),e=null,l=null,o=[];i.each(function(){""!==(e=y(this)).attr("data-value")&&(FLBuilderSettingsForms.showFieldLoader(e),o.push({name:e.attr("name"),value:e.attr("data-value"),action:e.attr("data-action"),data:e.attr("data-action-data")}))}),o.length?FLBuilder.ajax({action:"get_autosuggest_values",fields:o},function(e){for(l in t=FLBuilder._jsonParse(e))y('.fl-suggest-field[name="'+l+'"]').attr("data-value",t[l]);i.each(FLBuilder._initAutoSuggestField)}):i.each(FLBuilder._initAutoSuggestField)},_initAutoSuggestField:function(){var e=y(this);e.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:e.data("action"),fl_as_action_data:e.data("action-data"),_wpnonce:FLBuilderConfig.ajaxNonce}),y.extend({},{asHtmlID:e.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:2,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,preFill:e.data("value"),queryParam:"fl_as_query",afterSelectionAdd:FLBuilder._updateAutoSuggestField,afterSelectionRemove:FLBuilder._updateAutoSuggestField,selectionLimit:e.data("limit"),canGenerateNewSelections:!1},e.data("args"))),FLBuilderSettingsForms.hideFieldLoader(e)},_updateAutoSuggestField:function(e,t,i){var l=this;y(this).siblings(".as-values").val(i.join(",")).trigger("change"),y(this).parents(".as-selections").sortable({items:":not(.as-original)",update:function(e,t){var i=[];set=l.parents(".as-selections").find("li.as-selection-item"),y.each(set,function(e,t){i.push(y(t).attr("data-value"))}),y(l).siblings(".as-values").val(i.join(",")).trigger("change")}})},_CodeFieldSSLCheck:function(){y("body").append('<div class="sg-test" style="display:none"><svg xmlns="http://www.w3.org/2000/svg"></svg></div>'),"https://www.w3.org/2000/svg"===y(".sg-test").find("svg").attr("xmlns")&&(FLBuilder._codeDisabled=!0),y(".sg-test").remove()},_initCodeFields:function(){FLBuilder._codeDisabled||y(".fl-builder-settings:visible").find(".fl-code-field").each(FLBuilder._initCodeField)},_initCodeField:function(){var e=y(this),n=e.closest(".fl-builder-settings"),t=e.find("textarea"),e=(t.attr("id"),t.data("editor")),i=t.data("wrap"),l=y("<div>",{position:"absolute",height:20*parseInt(t.attr("rows"),10)}),s=null,r=!(!n.hasClass("fl-builder-global-settings")&&!n.hasClass("fl-builder-layout-settings"));l.insertBefore(t),l.attr("contentEditable",!0),l.addClass("fl-ignore-validation"),t.css("display","none"),ace.require("ace/ext/language_tools"),(s=ace.edit(l[0])).$blockScrolling=1/0,s.getSession().setValue(t.val()),s.getSession().setMode("ace/mode/"+e),i&&s.getSession().setUseWrapMode(!0),s.setOptions(FLBuilderConfig.AceEditorSettings),s.getSession().on("change",function(e){t.val(s.getSession().getValue()).trigger("change")}),s.getSession().on("changeAnnotation",function(){for(var e=s.getSession().getAnnotations(),t=n.find(".fl-builder-settings-save"),i=n.find(".fl-builder-settings-error"),l=!1,o=0;o<e.length;o++)if(!(-1<e[o].text.indexOf("DOCTYPE")||-1<e[o].text.indexOf("Named entity expected")||-1<e[o].text.indexOf("@supports")||"error"!==e[o].type)){l=!0;break}val=s.getSession().getValue(),r&&l&&null!==val.match(/<\/iframe>|<\/script>/gm)&&(t.addClass("fl-builder-settings-error"),t.on("click",FLBuilder._showCodeFieldCriticalError)),l&&!t.hasClass("fl-builder-settings-error")&&i.length&&FLBuilderConfig.CheckCodeErrors&&(t.addClass("fl-builder-settings-error"),t.on("click",FLBuilder._showCodeFieldError)),l||(i.removeClass("fl-builder-settings-error"),i.off("click",FLBuilder._showCodeFieldError),i.off("click",FLBuilder._showCodeFieldCriticalError))}),t.closest(".fl-field").data("editor",s)},_showCodeFieldError:function(e){e.stopImmediatePropagation(),FLBuilder.confirm({message:FLBuilderStrings.codeError,cancel:function(){var e=y(".fl-builder-settings:visible .fl-builder-settings-save");e.removeClass("fl-builder-settings-error"),e.off("click",FLBuilder._showCodeFieldError),e.trigger("click")},strings:{ok:FLBuilderStrings.codeErrorFix,cancel:FLBuilderStrings.codeErrorIgnore}})},_showCodeFieldCriticalError:function(e){e.stopImmediatePropagation(),FLBuilder.alert(FLBuilderStrings.codeerrorhtml)},_initMultipleFields:function(){y(".fl-builder-settings:visible .fl-builder-field-multiples").each(function(){var e=y(this),t=null,i=0,l=FLBuilderConfig.isRtl?{left:10}:{right:10},o=e.attr("data-limit")||0,n=e.find("tr").length||0;for(0<parseInt(o)&&n-1>=parseInt(o)?(e.find(".fl-builder-field-copy").hide(),e.find(".fl-builder-field-add").fadeOut()):e.find(".fl-builder-field-copy, .fl-builder-field-add").show();i<e.length;i++)1===(t=e.eq(i).find(".fl-builder-field-multiple")).length?t.eq(0).find(".fl-builder-field-actions").addClass("fl-builder-field-actions-single"):t.find(".fl-builder-field-actions").removeClass("fl-builder-field-actions-single");y(".fl-builder-field-multiples").sortable({items:".fl-builder-field-multiple",cursor:"move",cursorAt:l,distance:5,opacity:.5,placeholder:"fl-builder-field-dd-zone",stop:FLBuilder._fieldDragStop,tolerance:"pointer",axis:"y"})})},_addFieldClicked:function(){var e=y(this),t=e.attr("data-field"),i=e.closest("tr").siblings("tr[data-field="+t+"]").last(),l=i.clone(),o=l.find(".fl-form-field"),n=null,s=parseInt(i.find("label span.fl-builder-field-index").html(),10)+1;l.find("th label span.fl-builder-field-index").html(s),l.find(".fl-form-field-preview-text").html(""),l.find(".fl-form-field-before").remove(),l.find(".fl-form-field-after").remove(),l.find("input, textarea, select").val(""),i.after(l),FLBuilder._initMultipleFields(),o.length?(n=o.find(".fl-form-field-edit").data("type"),o.find("input").val(JSON.stringify(FLBuilderSettingsConfig.defaults.forms[n]))):((n=(o=e.closest("form.fl-builder-settings")).data("type"))&&o.hasClass("fl-builder-module-settings")&&(s=FLBuilderSettingsConfig.defaults.modules[n][t][0],l.find("input, textarea, select").val(s)),FLBuilder._renumberFields(l.closest(".fl-field")))},_copyFieldClicked:function(){var e=y(this).closest("tr"),t=e.clone(),i=parseInt(e.find("label span.fl-builder-field-index").html(),10)+1;t.find("th label span.fl-builder-field-index").html(i),e.after(t),FLBuilder._renumberFields(e.parent()),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview()},_deleteFieldClicked:function(){var e=y(this).closest("tr"),t=e.parent();confirm(FLBuilderStrings.deleteFieldMessage)&&(e.remove(),FLBuilder._renumberFields(t),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview())},_renumberFields:function(e){e.find(".fl-builder-field-multiple").each(function(e,t){y(t).find("th label span.fl-builder-field-index").html(e+1),FLBuilder._renumberFieldAttr(t,"name",e),FLBuilder._renumberFieldAttr(t,"id",e),FLBuilder._renumberFieldAttr(t,"for",e)})},_renumberFieldAttr:function(e,l,o){y(e).find("["+l+"]").each(function(e,t){var i=(i=y(t).attr(l)).replace(/\[(\d+)\]/,"["+o+"]");y(t).attr(l,i)})},_fieldDragHelper:function(){return y('<div class="fl-builder-field-dd-helper"></div>')},_fieldDragStop:function(e,t){FLBuilder._renumberFields(t.item.parent()),FLBuilder.preview.delayPreview()},_initSelectFields:function(){var e=y(".fl-builder-settings:visible").find("select"),e=(e.on("change",FLBuilder._settingsSelectChanged),e.trigger("change"),e.on("change",FLBuilder._calculateSettingsTabsOverflow),y(".fl-builder-settings:visible").find(".fl-button-group-field input[type=hidden]"));e.on("change",FLBuilder._settingsSelectChanged),e.trigger("change"),e.on("change",FLBuilder._calculateSettingsTabsOverflow)},_settingsSelectChanged:function(){var e=y(this),t=e.attr("data-toggle"),i=e.attr("data-hide"),l=e.attr("data-trigger"),o=e.val(),n=0,s=FLBuilderResponsiveEditing._mode,r=e.closest(".fl-field-responsive-setting"),s="fl-field-responsive-setting-"+s;if(!r.length||e.parent().hasClass(s)){if(void 0!==t){for(n in t=FLBuilder._jsonParse(t))FLBuilder._settingsSelectToggle(t[n].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(t[n].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(t[n].tabs,"hide","a[href*=fl-builder-settings-tab-","]");void 0!==t[o]&&(FLBuilder._settingsSelectToggle(t[o].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(t[o].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(t[o].tabs,"show","a[href*=fl-builder-settings-tab-","]"))}if(void 0!==i){for(n in i=FLBuilder._jsonParse(i))FLBuilder._settingsSelectToggle(i[n].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(i[n].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[n].tabs,"show","a[href*=fl-builder-settings-tab-","]");void 0!==i[o]&&(FLBuilder._settingsSelectToggle(i[o].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(i[o].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[o].tabs,"hide","a[href*=fl-builder-settings-tab-","]"))}if(void 0!==l&&void 0!==(l=FLBuilder._jsonParse(l))[o]&&void 0!==l[o].fields)for(n=0;n<l[o].fields.length;n++)y("#fl-field-"+l[o].fields[n]).find("select").trigger("change")}},_settingsSelectToggle:function(e,t,i,l){var o=0;if(l=void 0===l?"":l,void 0!==e)for(;o<e.length;o++)y(".fl-builder-settings:visible").find(i+e[o]+l)[t](),y(i+e[o]+l).parent().find('.fl-field[data-type="code"]').each(function(){FLBuilder._codeDisabled||y(this).data("editor").resize()})},_initColorPickers:function(){var e=FLBuilderConfig.colorPresets||[];FLBuilder.colorPicker=new FLBuilderColorPicker({mode:"hsv",elements:".fl-color-picker .fl-color-picker-value",presets:e,labels:{colorPresets:FLBuilderStrings.colorPresets,colorPicker:FLBuilderStrings.colorPicker,placeholder:FLBuilderStrings.placeholder,removePresetConfirm:FLBuilderStrings.removePresetConfirm,noneColorSelected:FLBuilderStrings.noneColorSelected,alreadySaved:FLBuilderStrings.alreadySaved,noPresets:FLBuilderStrings.noPresets,presetAdded:FLBuilderStrings.presetAdded}}),y(FLBuilder.colorPicker).on("presetRemoved presetAdded presetSorted",function(e,t){FLBuilder.ajax({action:"save_color_presets",presets:t.presets})})},_initGradientPickers:function(){y(".fl-builder-settings:visible .fl-gradient-picker").each(FLBuilder._initGradientPicker)},_initGradientPicker:function(){var e=y(this),t=e.find(".fl-gradient-picker-type-select"),i=e.find(".fl-gradient-picker-angle-wrap"),l=e.find(".fl-gradient-picker-position");t.on("change",function(){"linear"===y(this).val()?(i.show(),l.hide()):(i.hide(),l.show())})},_initPhotoFields:function(){var e=y(".fl-builder-settings:visible").find(".fl-photo-field select");e.on("change",FLBuilder._toggleSettingsOnIconChange),e.trigger("change")},_initSinglePhotoSelector:function(){null===FLBuilder._singlePhotoSelector&&(FLBuilder._singlePhotoSelector=wp.media({title:FLBuilderStrings.selectPhoto,button:{text:FLBuilderStrings.selectPhoto},library:{type:FLBuilderConfig.uploadTypes.image},multiple:!1}),FLBuilder._singlePhotoSelector.on("open",FLBuilder._wpmedia_reset_errors),_wpPluploadSettings.defaults.multipart_params.fl_upload_type="photo")},_selectSinglePhoto:function(){FLBuilder._initSinglePhotoSelector(),FLBuilder._singlePhotoSelector.once("open",y.proxy(FLBuilder._singlePhotoOpened,this)),FLBuilder._singlePhotoSelector.once("select",y.proxy(FLBuilder._singlePhotoSelected,this)),FLBuilder._singlePhotoSelector.open()},_singlePhotoOpened:function(){var e=FLBuilder._singlePhotoSelector.state().get("selection"),t=y(this).closest(".fl-photo-field"),i=t.find("input[type=hidden]"),l=i.val(),o=null;y(this).hasClass("fl-photo-replace")?(e.reset(),t.addClass("fl-photo-empty"),i.val("")):""!==l?((o=wp.media.attachment(l)).fetch(),e.add(o?[o]:[])):e.reset()},_singlePhotoSelected:function(){var e=FLBuilder._singlePhotoSelector.state().get("selection").first().toJSON(),t=y(this).closest(".fl-photo-field"),i=t.find("input[type=hidden]"),l=t.find(".fl-photo-preview img"),o=t.find("select");e.url&&e.url.endsWith(".svg")&&(e.sizes={full:{url:e.url,filename:e.url.split("/").pop(),height:"",width:""}}),i.val(e.id),l.attr("src",FLBuilder._getPhotoSrc(e)),t.removeClass("fl-photo-empty").removeClass("fl-photo-no-attachment"),t.find("label.error").remove(),o.show(),o.html(FLBuilder._getPhotoSizeOptions(e,o.val())),o.trigger("change"),FLBuilderSettingsConfig.attachments[e.id]=e},_singlePhotoRemoved:function(){FLBuilder._initSinglePhotoSelector();var e=FLBuilder._singlePhotoSelector.state(),e=void 0!==e?e.get("selection"):null,t=y(this).closest(".fl-photo-field"),i=t.find("input[type=hidden]"),l=t.find("select");e&&e.reset(),t.addClass("fl-photo-empty"),i.val(""),l.html('<option value="" selected></option>'),l.trigger("change")},_getPhotoSrc:function(e){return(void 0===e.sizes?e:void 0!==e.sizes.thumbnail?e.sizes.thumbnail:e.sizes.full).url},_getPhotoSizeOptions:function(e,t){var i="",l=null,o=null,n=!1,s="",r="",a={full:FLBuilderStrings.fullSize,large:FLBuilderStrings.large,medium:FLBuilderStrings.medium,thumbnail:FLBuilderStrings.thumbnail};if(void 0===e.sizes||0===e.sizes.length)i+='<option value="'+e.url+'">'+FLBuilderStrings.fullSize+"</option>";else{for(sizecheck in t=t&&t.split(/[\\/]/).pop(),selectedverified=!1,e.sizes)if(e.sizes[sizecheck].url.split(/[\\/]/).pop()===t){selectedverified=!0;break}for(l in selectedverified||(t=!1),e.sizes)o="",s=void 0!==a[l]?a[l]:void 0!==FLBuilderConfig.customImageSizeTitles[l]?FLBuilderConfig.customImageSizeTitles[l]:"",t?t!==e.sizes[l].url.split(/[\\/]/).pop()||n||(o=' selected="selected"',n=!0):(void 0!==FLBuilderConfig.photomodulesize&&l===FLBuilderConfig.photomodulesize&&!n||l==FLBuilderConfig.defaultImageSize&&!n)&&(o=' selected="selected"',n=!0),e.sizes[l].width&&e.sizes[l].height&&(s=s&&s+" - ",r=e.sizes[l].width+" x "+e.sizes[l].height),i+='<option data-size="'+l+'" value="'+e.sizes[l].url+'"'+o+">"+s+r+"</option>"}return i},_selectMultiplePhotos:function(){var e=y(this).closest(".fl-multiple-photos-field").find("input[type=hidden]").val(),t=""===e?"":FLBuilder._jsonParse(e),e=wp.media.gallery.defaults.id,i='[gallery ids="-1"]',l=null,o=null,n=null,s=null,r=[];if("object"==typeof t){for(s in t)r.push(t[s]);i='[gallery ids="'+r.join()+'"]'}l=wp.shortcode.next("gallery",i).shortcode,_.isUndefined(l.get("id"))&&!_.isUndefined(e)&&l.set("id",e),o=wp.media.gallery.attachments(l),(n=new wp.media.model.Selection(o.models,{props:o.props.toJSON(),multiple:!0})).gallery=o.gallery,n.more().done(function(){n.length||FLBuilder._multiplePhotoSelector.setState("gallery-library"),n.props.set({query:!1}),n.unmirror(),n.props.unset("orderby")}),FLBuilder._multiplePhotoSelector&&FLBuilder._multiplePhotoSelector.dispose(),FLBuilder._multiplePhotoSelector=wp.media({frame:"post",state:y(this).hasClass("fl-multiple-photos-edit")?"gallery-edit":"gallery-library",title:wp.media.view.l10n.editGalleryTitle,editing:!0,multiple:!0,selection:n}).open(),y(FLBuilder._multiplePhotoSelector.views.view.el).addClass("fl-multiple-photos-lightbox"),FLBuilder._multiplePhotoSelector.once("update",y.proxy(FLBuilder._multiplePhotosSelected,this))},_multiplePhotosSelected:function(e){for(var t=y(this).closest(".fl-multiple-photos-field"),i=t.find("input[type=hidden]"),l=t.find(".fl-multiple-photos-count"),o=[],n=0;n<e.models.length;n++)o.push(e.models[n].id);1==o.length?l.html("1 "+FLBuilderStrings.photoSelected):l.html(o.length+" "+FLBuilderStrings.photosSelected),t.removeClass("fl-multiple-photos-empty"),t.find("label.error").remove(),i.val(JSON.stringify(o)).trigger("change")},_initSingleVideoSelector:function(){var e;null===FLBuilder._singleVideoSelector&&(e=_wpPluploadSettings.defaults.filters.mime_types[0].extensions,_wpPluploadSettings.defaults.multipart_params.fl_upload_type="video",_wpPluploadSettings.defaults.filters.mime_types[0].extensions=FLBuilderConfig.uploadTypes.videoTypes,FLBuilder._singleVideoSelector=wp.media({title:FLBuilderStrings.selectVideo,button:{text:FLBuilderStrings.selectVideo},library:{type:["video/mp4","video/webm"]},multiple:!1}),FLBuilder._singleVideoSelector.on("open",FLBuilder._wpmedia_reset_errors),FLBuilder._singleVideoSelector.on("close",function(){_wpPluploadSettings.defaults.filters.mime_types[0].extensions=e}))},_selectSingleVideo:function(){FLBuilder._initSingleVideoSelector(),FLBuilder._singleVideoSelector.once("select",y.proxy(FLBuilder._singleVideoSelected,this)),FLBuilder._singleVideoSelector.open()},_singleVideoSelected:function(){var e=FLBuilder._singleVideoSelector.state().get("selection").first().toJSON(),t=y(this).closest(".fl-video-field"),i=t.find(".fl-video-preview-img"),l=t.find(".fl-video-preview-filename"),o=t.find("input[type=hidden]");i.html('<span class="dashicons dashicons-media-video"></span>'),l.html(e.filename),t.removeClass("fl-video-empty"),t.find("label.error").remove(),o.val(e.id).trigger("change"),FLBuilderSettingsConfig.attachments[e.id]=e},_singleVideoRemoved:function(){FLBuilder._initSingleVideoSelector();var e=FLBuilder._singleVideoSelector.state(),e=void 0!==e?e.get("selection"):null,t=y(this).closest(".fl-video-field"),i=t.find(".fl-video-preview-img img"),l=t.find(".fl-video-preview-filename"),o=t.find("input[type=hidden]");e&&e.reset(),i.attr("src",""),l.html(""),t.addClass("fl-video-empty"),o.val("").trigger("change")},_selectMultipleAudios:function(){var e=y(this).closest(".fl-multiple-audios-field").find("input[type=hidden]").val(),e=""==e?'[playlist ids="-1"]':'[playlist ids="'+FLBuilder._jsonParse(e).join()+'"]',e=wp.shortcode.next("playlist",e).shortcode,t=wp.media.playlist.defaults.id,i=null,l=null;_.isUndefined(e.get("id"))&&!_.isUndefined(t)&&e.set("id",t),i=wp.media.playlist.attachments(e),(l=new wp.media.model.Selection(i.models,{props:i.props.toJSON(),multiple:!0})).playlist=i.playlist,l.more().done(function(){l.props.set({query:!1}),l.unmirror(),l.props.unset("orderby")}),FLBuilder._multipleAudiosSelector&&FLBuilder._multipleAudiosSelector.dispose(),FLBuilder._multipleAudiosSelector=wp.media({frame:"post",state:y(this).hasClass("fl-multiple-audios-edit")?"playlist-edit":"playlist-library",title:wp.media.view.l10n.editPlaylistTitle,editing:!0,multiple:!0,selection:l}).open(),FLBuilder._multipleAudiosSelector.content.get("view").sidebar.unset("playlist"),FLBuilder._multipleAudiosSelector.on("content:render:browse",function(e){e&&e.sidebar.on("ready",function(){e.sidebar.unset("playlist")})}),FLBuilder._multipleAudiosSelector.once("update",y.proxy(FLBuilder._multipleAudiosSelected,this))},_multipleAudiosSelected:function(e){for(var t=y(this).closest(".fl-multiple-audios-field"),i=t.find(".fl-multiple-audios-count"),l=t.find("input[type=hidden]"),o=[],n=0;n<e.models.length;n++)o.push(e.models[n].id);1==o.length?i.html("1 "+FLBuilderStrings.audioSelected):i.html(o.length+" "+FLBuilderStrings.audiosSelected),l.val(JSON.stringify(o)).trigger("change"),t.removeClass("fl-multiple-audios-empty"),t.find("label.error").remove()},_initIconFields:function(){var e=y(".fl-builder-settings:visible").find(".fl-icon-field input");e.on("change",FLBuilder._toggleSettingsOnIconChange),e.trigger("change")},_toggleSettingsOnIconChange:function(){var e=y(this),t=e.val(),e=e.attr("data-show");void 0!==e&&(e=FLBuilder._jsonParse(e),FLBuilder._settingsSelectToggle(e.fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(e.sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(e.tabs,"hide","a[href*=fl-builder-settings-tab-","]"),t&&(FLBuilder._settingsSelectToggle(e.fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(e.sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(e.tabs,"show","a[href*=fl-builder-settings-tab-","]"),FLBuilder._calculateSettingsTabsOverflow()))},_selectIcon:function(){var t=this;FLIconSelector.open(function(e){FLBuilder._iconSelected.apply(t,[e])})},_iconSelected:function(e){var t=y(this).closest(".fl-icon-field"),i=t.find("input[type=hidden]"),l=t.find("i"),o=l.attr("data-icon");i.val(e).trigger("change"),l.removeClass(o),l.addClass(e),l.attr("data-icon",e),t.removeClass("fl-icon-empty"),t.find("label.error").remove()},_removeIcon:function(){var e=y(this).closest(".fl-icon-field"),t=e.find("input[type=hidden]"),i=e.find("i");t.val("").trigger("change"),i.removeClass(),i.attr("data-icon",""),e.addClass("fl-icon-empty")},_formFieldClicked:function(){var e=y(this),t=e.closest(".fl-builder-settings"),i=e.attr("data-type"),l=e.siblings("input").val(),o=FLBuilder._moduleHelpers[i],n=(FLBuilderSettingsConfig.forms[i],FLBuilder._openNestedSettings({className:"fl-builder-lightbox fl-form-field-settings"}));""===l&&(l=JSON.stringify(FLBuilderSettingsConfig.forms[i])),FLBuilderSettingsForms.render({id:i,nodeId:t.attr("data-node"),nodeSettings:FLBuilder._getSettings(t),settings:FLBuilder._jsonParse(l.replace(/'/g,"'")),lightbox:n,rules:o?o.rules:null,helper:{init:function(){o&&o.init(),FLBuilder._initFormFieldSettingsPreview(n)}}},function(){e.attr("id","fl-"+n._node.attr("data-instance-id")),n._node.find("form.fl-builder-settings").attr("data-type",i),FLBuilderResponsiveEditing._switchAllSettingsToCurrentMode()})},_saveFormFieldClicked:function(){var e=y(this).closest(".fl-builder-settings");FLBuilder._saveFormFieldSettings(e)?FLBuilder._closeNestedSettings():FLBuilder._toggleSettingsTabErrors()},_initFormFieldSettingsPreview:function(e){var t=e._node.find(".fl-field"),e=e._node.find("textarea.wp-editor-area");t.find("input:not([type=hidden]), textarea").on("input",FLBuilder._previewFormFieldSettings),t.find("input[type=hidden], select").on("change",FLBuilder._previewFormFieldSettings),"undefined"!=typeof tinyMCE&&e.each(function(e,t){(t=tinyMCE.get(y(t).attr("id"))).on("change",FLBuilder._previewFormFieldSettings),t.on("keyup",FLBuilder._previewFormFieldSettings)})},_previewFormFieldSettings:function(){var e=this.formElement||this,t=y(e).closest(".fl-builder-settings"),e=t.data("timeout");e&&clearTimeout(e),e=setTimeout(function(){FLBuilder._saveFormFieldSettings(t)},1e3),t.data("timeout",e)},_saveFormFieldSettings:function(e){var t=e.closest(".fl-lightbox-wrap").attr("data-instance-id"),i=e.attr("data-type"),l=FLBuilder._getSettings(e),i=FLBuilder._moduleHelpers[i],t=y(".fl-builder-settings #fl-"+t),o=t.parent().attr("data-preview-text"),n=e.find("#fl-field-"+o),s=l[o],r=y('select[name="'+o+'"]'),a=document.createElement("div"),d=!0;return 0<r.length&&(s=r.find('option[value="'+l[o]+'"]').text()),void 0!==i&&(e.find("label.error").remove(),e.validate().hideErrors(),d=(d=e.validate().form())&&i.submit()),!!d&&(void 0!==o&&void 0!==s&&("icon"===n.data("type")?s='<i class="'+s+'"></i>':35<s.length&&(a.innerHTML=s,s=(a.textContent||a.innerText||"").replace(/^(.{35}[^\s]*).*/,"$1")+"..."),t.siblings(".fl-form-field-preview-text").html(s)),0<t.length&&(""!=(r=t.siblings("input").val().replace(/'/g,"'"))&&(l=y.extend(FLBuilder._jsonParse(r),l)),t.siblings("input").val(JSON.stringify(l)).trigger("change")),!0)},_layoutFieldClicked:function(){var e=y(this);e.siblings().removeClass("fl-layout-field-option-selected"),e.addClass("fl-layout-field-option-selected"),e.siblings("input").val(e.attr("data-value"))},_initLinkFields:function(){y(".fl-builder-settings:visible .fl-link-field").each(FLBuilder._initLinkField)},_initLinkField:function(){var e=y(this),t=e.find(".fl-link-field-search-input"),e=e.find(".fl-link-field-options-wrap input[type=checkbox]");t.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:"fl_as_links",_wpnonce:FLBuilderConfig.ajaxNonce}),{asHtmlID:t.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:3,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,queryParam:"fl_as_query",selectionLimit:1,afterSelectionAdd:FLBuilder._updateLinkField,formatList:function(e,t){return t.html(e.name+'<span class="type">['+e.type+"]</span>")}}),e.on("click",FLBuilder._linkFieldCheckboxClicked)},_updateLinkField:function(e,t,i){var e=e.closest(".fl-link-field"),l=e.find(".fl-link-field-search"),o=e.find(".fl-link-field-search-input");e.find(".fl-link-field-input").val(t.value).trigger("keyup"),o.autoSuggest("remove",t.value),l.hide()},_linkFieldSelectClicked:function(){var e=y(this).closest(".fl-link-field").find(".fl-link-field-search");e.show(),e.find("input").focus()},_linkFieldSelectCancelClicked:function(){var e=y(this);e.parent().hide(),e.closest(".fl-link-field").find("input.fl-link-field-input").focus()},_linkFieldCheckboxClicked:function(){var e=y(this),t=e.is(":checked"),i=e.siblings("input[type=hidden]"),l="",l=e.hasClass("fl-link-field-target-cb")?t?"_blank":"_self":t?"yes":"no";i.val(l)},_initFontFields:function(){y(".fl-builder-settings:visible .fl-font-field").each(FLBuilder._initFontField)},_initFontField:function(){var t,e=y(this),i=e.attr("data-value"),l=e.find(".fl-font-field-font"),e=e.find(".fl-font-field-weight");FLBuilderConfig.select2Enabled&&l.select2({width:"100%"}).on("select2:open",function(e){y(".select2-search__field").attr("placeholder",FLBuilderStrings.placeholderSelect2)}),l.on("change",function(){FLBuilder._getFontWeights(l)}),-1<i.indexOf("family")&&(i=FLBuilder._jsonParse(i),t=!1,fonts=FLBuilderFontFamilies,Object.keys(fonts.system).forEach(function(e){e===i.family&&(t=!0)}),Object.keys(fonts.google).forEach(function(e){e===i.family&&(t=!0)}),t||"Default"===i.family||(i={family:"Default",weight:"400"}),l.val(i.family),l.trigger("change"),e.find("option[value="+i.weight+"]").length&&e.val(i.weight))},_getFontWeights:function(e){var i=e.closest(".fl-font-field").find(".fl-font-field-weight"),l=e.val(),o=i.val(),n=FLBuilderConfig.FontWeights,t={},s=e.closest(".fl-font-field").find(".recent-fonts option");i.html(""),0<s.length&&!1==0<y(s).filter(function(e,t){return t.value===l}).length&&"Default"!==l&&e.closest(".fl-font-field").find(".recent-fonts").append(y("<option>",{value:l,text:l})),t=void 0!==FLBuilderFontFamilies.system[l]?FLBuilderFontFamilies.system[l].weights:(void 0!==FLBuilderFontFamilies.google[l]?FLBuilderFontFamilies.google:FLBuilderFontFamilies.default)[l],y.each(t,function(e,t){i.append('<option value="'+t+'"'+(o===t?" selected":"")+">"+n[t]+"</option>")})},_initTinyMCE:function(){"object"==typeof tinymce&&void 0!==tinymce.ui.FloatPanel&&(tinymce.ui.FloatPanel.zIndex=100100),y(".fl-builder-hidden-editor").each(FLBuilder._initEditorField)},_initEditorFields:function(){y(".fl-builder-settings:visible .fl-editor-field").each(FLBuilder._initEditorField)},_initEditorField:function(){var e=y(this),t=e.find("textarea"),i=e.attr("data-name"),i="flrich"+(new Date).getTime()+"_"+i,l=FLBuilderConfig.wp_editor,o=tinyMCEPreInit,n=Number(e.attr("data-buttons")),e=e.attr("data-rows"),s=null,r=null,l=l.replace(/flbuildereditor/g,i),o=FLBuilder._jsonParse(JSON.stringify(o).replace(/flbuildereditor/g,i));o=JSONfn.parse(JSONfn.stringify(o).replace(/flbuildereditor/g,i)),t.after(l).remove(),y("textarea#"+i).val(t.val()),void 0!==o.mceInit[i]&&((s=o.mceInit[i]).setup=function(e){e.on("SaveContent",function(e){e.content=e.content.replace(/<a href="(\.\.\/){1,2}/g,'<a href="'+FLBuilderConfig.homeUrl+"/"),e.content=e.content.replace(/src="(\.\.\/){1,2}/g,'src="'+FLBuilderConfig.homeUrl+"/")})},(r=tinymce.$("#wp-"+i+"-wrap")).find("textarea").attr("rows",e),r.find("textarea").attr("contentEditable",!0),n||r.find(".wp-media-buttons").remove(),!r.hasClass("tmce-active")&&o.qtInit.hasOwnProperty(i)||s.wp_skip_init||tinymce.init(s)),quicktags(o.qtInit[i]),window.wpActiveEditor=i},_reinitEditorFields:function(){y(".fl-lightbox-resizable:visible").length&&setTimeout(function(){var e,t;if("undefined"!=typeof tinymce){for(e=tinymce.editors.length-1;-1<e;e--)tinymce.editors[e].inline||(t=tinymce.editors[e].id,tinyMCE.execCommand("mceRemoveEditor",!0,t),tinyMCE.execCommand("mceAddEditor",!0,t));FLBuilder.preview&&FLBuilder.preview._initDefaultFieldPreviews(y('.fl-field[data-type="editor"]'))}},1)},_destroyEditorFields:function(){var e;if("undefined"!=typeof tinymce){for(e=tinymce.editors.length-1;-1<e;e--)tinymce.editors[e].inline||tinyMCE.execCommand("mceRemoveEditor",!0,tinymce.editors[e].id);y(".wplink-autocomplete").remove(),y(".ui-helper-hidden-accessible").remove()}},_updateEditorFields:function(){y(".fl-builder-settings:visible textarea.wp-editor-area").each(FLBuilder._updateEditorField)},_updateEditorField:function(){var e=y(this),t=e.closest(".fl-editor-field"),i=(e.closest(".fl-builder-settings"),e.closest(".wp-editor-wrap")),l=e.attr("id"),o=t.attr("data-name"),l="undefined"!=typeof tinymce&&tinymce.get(l),n=e.siblings('textarea[name="'+o+'"]'),t=t.data("wpautop");0===n.length&&(n=y('<textarea name="'+o+'"></textarea>').hide(),e.after(n)),t?l&&i.hasClass("tmce-active")?n.val(l.getContent()):"undefined"!=typeof switchEditors?n.val(switchEditors.wpautop(e.val())):n.val(e.val()):(l&&i.hasClass("tmce-active")&&l.save(),n.val(e.val()))},_loopDataSourceChange:function(){var e=y(this).val();y(".fl-loop-data-source").hide(),y('.fl-loop-data-source[data-source="'+e+'"]').show()},_customQueryPostTypeChange:function(){var e=y(this).val();y(".fl-custom-query-filter").hide(),y(".fl-custom-query-"+e+"-filter").show()},_initOrderingFields:function(){y(".fl-builder-settings:visible .fl-ordering-field-options").each(FLBuilder._initOrderingField)},_initOrderingField:function(){y(this).sortable({items:".fl-ordering-field-option",containment:"parent",tolerance:"pointer",stop:FLBuilder._updateOrderingField})},_updateOrderingField:function(e){var e=y(e.target),t=e.siblings("input[type=hidden]"),i=[];e.find(".fl-ordering-field-option").each(function(){i.push(y(this).attr("data-key"))}),t.val(JSON.stringify(i)).trigger("change")},_textFieldAddValueSelectChange:function(){var e=y(this),t=y('input[name="'+e.data("target")+'"]'),i=t.val(),l=e.val();-1==i.indexOf(l)&&(i=(i.trim()+" "+l.trim()).trim(),t.val(i).trigger("change").trigger("keyup")),e.val("")},_onNumberFieldFocus:function(e){var t=y(e.currentTarget);t.addClass("mousetrap"),Mousetrap.bind("up",function(){t.attr("step",1)}),Mousetrap.bind("down",function(){t.attr("step",1)}),Mousetrap.bind("shift+up",function(){t.attr("step",10)}),Mousetrap.bind("shift+down",function(){t.attr("step",10)})},_onNumberFieldBlur:function(e){y(e.currentTarget).attr("step","any").removeClass("mousetrap")},_initTimezoneFields:function(){y(".fl-builder-settings:visible .fl-field[data-type=timezone]").each(FLBuilder._initTimezoneField)},_initTimezoneField:function(){var e=y(this).find("select"),t=e.attr("data-value");e.find('option[value="'+t+'"]').prop("selected",!0)},_initDimensionFields:function(){var e=y(".fl-builder-settings:visible");e.find(".fl-field[data-type=dimension]").each(FLBuilder._initDimensionField),e.find(".fl-dimension-field-link").on("click",FLBuilder._dimensionFieldLinkClicked),FLBuilder.addHook("responsive-editing-switched",this._initResponsiveDimensionFieldLinking),e.find(".fl-compound-field-setting").has(".fl-dimension-field-link").each(FLBuilder._initDimensionFieldLinking)},_initDimensionField:function(){var e=y(this),t=e.find(".fl-field-label label"),e=e.find(".fl-field-control-wrapper"),i='<i class="fl-dimension-field-link fl-tip dashicons dashicons-admin-links" title="Link Values"></i>';t.append(i),e.prepend(i),FLBuilder._initTipTips(),FLBuilder._initDimensionFieldLinking.apply(this)},_initDimensionFieldLinking:function(){var e=y(this),t=e.find(".fl-dimension-field-link"),e=FLBuilder._getDimensionFieldLinkingInputs(e);FLBuilder._dimensionFieldInputsAreEqual(e)?(t.removeClass("dashicons-admin-links"),t.addClass("dashicons-editor-unlink"),e.off("input",FLBuilder._dimensionFieldLinkedValueChange),e.on("input",FLBuilder._dimensionFieldLinkedValueChange)):(t.addClass("dashicons-admin-links"),t.removeClass("dashicons-editor-unlink"))},_initResponsiveDimensionFieldLinking:function(){y(".fl-builder-settings:visible").find(".fl-field[data-type=dimension]").each(FLBuilder._initDimensionFieldLinking)},_dimensionFieldLinkClicked:function(){var e=y(this),t=e.closest(".fl-compound-field-setting"),t=t.length?t:e.closest(".fl-field"),e=t.find(".fl-dimension-field-link"),i=e.hasClass("dashicons-editor-unlink"),t=FLBuilder._getDimensionFieldLinkingInputs(t);e.toggleClass("dashicons-admin-links"),e.toggleClass("dashicons-editor-unlink"),i?t.off("input",FLBuilder._dimensionFieldLinkedValueChange):(t.val(t.eq(0).val()).trigger("input"),t.on("input",FLBuilder._dimensionFieldLinkedValueChange))},_dimensionFieldLinkedValueChange:function(){var e=y(this),t=e.attr("name"),t=e.closest(".fl-dimension-field-units").find('input:not([name="'+t+'"])');t.off("input",FLBuilder._dimensionFieldLinkedValueChange),t.val(e.val()).trigger("input"),t.on("input",FLBuilder._dimensionFieldLinkedValueChange)},_getDimensionFieldLinkingInputs:function(e){var t=!!e.find(".fl-field-responsive-setting").length,i=FLBuilderResponsiveEditing._mode;return t?e.find(".fl-field-responsive-setting-"+i+" input"):e.find(".fl-dimension-field-unit input")},_dimensionFieldInputsAreEqual:function(e){var t=e.eq(0).val();if(""===t)return!1;for(var i=1;i<4;i++)if(e.eq(i).val()!==t)return!1;return!0},_initFieldPopupSliders:function(){y(".fl-builder-settings:visible").find(".fl-field-popup-slider").each(FLBuilder._initFieldPopupSlider)},_initFieldPopupSlider:function(){var n=y("body"),s=y(this),r=s.find(".fl-field-popup-slider-input"),a=s.find(".fl-field-popup-slider-arrow"),e=s.data("input"),d=y('input[name="'+e+'"]');d.on("click",function(){r.hasClass("fl-field-popup-slider-init")||(r.slider({value:d.val(),slide:function(e,t){d.val(t.value).trigger("input")}}),d.on("input",function(){r.slider("value",y(this).val())}),r.addClass("fl-field-popup-slider-init"),r.find(".ui-slider-handle").removeAttr("tabindex")),FLBuilder._setFieldPopupSliderMinMax(r),FLBuilder._hideFieldPopupSliders(),n.on("mousedown",FLBuilder._hideFieldPopupSliders),d.addClass("fl-field-popup-slider-focus"),s.show();var e=y(".fl-builder-settings:visible .fl-builder-settings-tab.fl-active"),t=e.offset(),i=d.offset(),l=d.width(),o=s.offset();o.top+s.outerHeight()>t.top+e.outerHeight()&&s.addClass("fl-field-popup-slider-top"),a.css("left",2+i.left-o.left+l/2+"px")}),d.on("focus",function(){FLBuilder._hideFieldPopupSliders()})},_hideFieldPopupSliders:function(e){var e=e?y(e.target):null,t=y("body"),i=y(".fl-field-popup-slider:visible"),l=y(".fl-field-popup-slider-focus");if(e){if(e.closest(".fl-field-popup-slider").length)return;if(e.closest(".fl-field-popup-slider-focus").length)return}t.off("mousedown",FLBuilder._hideFieldPopupSliders),l.removeClass("fl-field-popup-slider-focus"),i.hide()},_setFieldPopupSliderMinMax:function(e){var t=e.parent(),i=t.parent().parent().find("select.fl-field-unit-select"),l=i.val(),t=t.data("slider"),o=0,n=100,s=1;""!==l&&"em"!==l&&"rem"!==l||(n=10,s=.1),"object"==typeof t&&(o=t.min?parseFloat(t.min):o,n=t.max?parseFloat(t.max):n,s=t.step?parseFloat(t.step):s,i.length&&t[l]&&(o=t[l].min?parseFloat(t[l].min):o,n=t[l].max?parseFloat(t[l].max):n,s=t[l].step?parseFloat(t[l].step):s)),e.slider({min:o,max:n,step:s})},_initPresetFields:function(){y(".fl-builder-settings:visible").find(".fl-preset-select-controls").each(FLBuilder._initPresetField)},_initPresetField:function(){var e=y(this),t=e.find("select"),i=e.data("presets"),e=e.data("prefix");t.on("change",FLBuilder._setFormPreset.bind(this,i,e))},_setFormPreset:function(e,t,i){var l=y(i.currentTarget).val();if(presetLists=FLBuilderConfig.presets,presets=presetLists[e],form=y(".fl-builder-settings:visible"),"undefined"!==presets&&"undefined"!==presets[l]){var o,n=presets[l].settings;for(o in n){var l=n[o],s=void 0!==t&&""!==t?form.find('[name="'+t+o+'"]'):form.find('[name="'+o+'"]');s.val(l).trigger("change").trigger("input")}}},ajax:function(t,i){if(!FLBuilder._ajaxRequest){for(var e in FLBuilder.triggerHook("didBeginAJAX",t),t)void 0===t[e]&&(t[e]=null);return(t._wpnonce=FLBuilderConfig.ajaxNonce,t.post_id=FLBuilderConfig.postId,t.fl_builder=1,t.safemode=FLBuilderConfig.safemode,t.fl_action=t.action,void 0!==t.settings&&(t.settings=FLBuilder._ajaxModSecFix(y.extend(!0,{},t.settings))),void 0!==t.node_settings&&(t.node_settings=FLBuilder._ajaxModSecFix(y.extend(!0,{},t.node_settings))),void 0!==t.node_preview&&(t.node_preview=FLBuilder._ajaxModSecFix(y.extend(!0,{},t.node_preview))),t.settings=FLBuilder._inputVarsCheck(t.settings),t.node_settings=FLBuilder._inputVarsCheck(t.node_settings),"error"===t.settings||"error"===t.node_settings)?0:(t={fl_builder_data:t},FLBuilder._ajaxRequest=y.post(FLBuilder._ajaxUrl(),t,function(e){void 0!==i&&i.call(this,e),FLBuilder.triggerHook("didCompleteAJAX",t)}).always(FLBuilder._ajaxComplete).fail(function(e,t,i){switch(msg=!1,e.status){case 403:case 409:msg="Something you entered has triggered a "+e.status+" error.<br /><br />This is nearly always due to mod_security settings from your hosting provider.",window.crash_vars.white_label||(msg+='<br /><br />See this <a target="_blank" style="color: #428bca;font-size:inherit" href="https://docs.wpbeaverbuilder.com/beaver-builder/troubleshooting/common-issues/403-forbidden-or-blocked-error">Knowledge Base</a> article for more info.</br />')}msg&&(console.log(e),console.log(i),FLBuilder.alert(msg))}),FLBuilder._ajaxRequest)}FLBuilder._ajaxQueue.push({data:t,callback:i})},_inputVarsCheck:function(e){var t=FLBuilderConfig.MaxInputVars||0;return void 0!==e&&0<t&&(count=y.map(e,function(e,t){return t}).length)>t?(FLBuilder.alert('<h1 style="font-size:2em;text-align:center">Critical Issue</h1><br />The number of settings being saved ('+count+") exceeds the PHP Max Input Vars setting ("+t+").<br />Please contact your host to have this value increased, the default is 1000."),console.log("Vars Count: "+count),console.log("Max Input: "+t),"error"):e},_ajaxComplete:function(){var e;FLBuilder._ajaxRequest=null,FLBuilder.hideAjaxLoader(),FLBuilder._ajaxQueue.length&&(e=FLBuilder._ajaxQueue.shift(),FLBuilder.ajax(e.data,e.callback))},_ajaxUrl:function(e){var t=FLBuilderConfig.shortlink,i=null;if(void 0!==e)for(i in e)t=(t+=-1<t.indexOf("?")?"&":"?")+i+"="+e[i];return t},showAjaxLoader:function(){0===y(".fl-builder-lightbox-loading").length&&y(".fl-builder-loading").show()},hideAjaxLoader:function(){y(".fl-builder-loading").hide()},_showNodeLoading:function(e){e=y(".fl-node-"+e);e.addClass("fl-builder-node-loading"),FLBuilder._removeAllOverlays(),FLBuilder.triggerHook("didStartNodeLoading",e)},_hideNodeLoading:function(e){y(".fl-node-"+e).removeClass("fl-builder-node-loading")},_showNodeLoadingPlaceholder:function(e,t){var i=y('<div class="fl-builder-node-loading-placeholder"></div>');y(".fl-builder-node-loading-placeholder").remove(),0===(siblings=e.hasClass("fl-builder-content")?e.find(" > .fl-row"):e.hasClass("fl-row-content")?e.find(" > .fl-col-group"):e.hasClass("fl-col-group")?(e.addClass("fl-col-group-has-child-loading"),e.find(" > .fl-col")):e.find(" > .fl-col-group, > .fl-module")).length||siblings.length==t?e.append(i):siblings.eq(t).before(i)},_removeNodeLoadingPlaceholder:function(e){var t=e.prev(".fl-builder-node-loading-placeholder"),e=e.next(".fl-builder-node-loading-placeholder");(t.length?t:e).remove()},_ajaxModSecFix:function(e){if(FLBuilderConfig.modSecFix&&"undefined"!=typeof btoa)if("string"==typeof e)e=FLBuilder._btoa(e);else for(var t in e)"string"==(type=typeof e[t])||"number"==type?e[t]=FLBuilder._btoa(e[t]):"object"==type&&(e[t]=FLBuilder._ajaxModSecFix(e[t]));return e},_btoa:function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))},_wpmedia_reset_errors:function(){y(".upload-error").remove(),y(".media-uploader-status").removeClass("errors").hide()},_initLightboxes:function(){FLBuilder._lightbox=new FLLightbox({className:"fl-builder-lightbox fl-builder-settings-lightbox",resizable:!0}),FLBuilder._lightbox.on("resized",FLBuilder._calculateSettingsTabsOverflow),FLBuilder._lightbox.on("close",FLBuilder._lightboxClosed),FLBuilder._lightbox.on("beforeCloseLightbox",FLBuilder._destroyEditorFields),FLBuilder._actionsLightbox=new FLLightbox({className:"fl-builder-actions-lightbox"})},_showLightbox:function(e){e=e||'<div class="fl-builder-lightbox-loading"></div>',FLBuilder._lightbox.open(e),FLBuilder._initLightboxScrollbars()},_setLightboxContent:function(e){FLBuilder._lightbox.setContent(e)},_initLightboxScrollbars:function(){FLBuilder._initScrollbars(),clearTimeout(FLBuilder._lightboxScrollbarTimeout),FLBuilder._lightboxScrollbarTimeout=setTimeout(FLBuilder._initLightboxScrollbars,500)},_lightboxClosed:function(){FLBuilder.triggerHook("settings-lightbox-closed"),FLBuilder._lightbox.empty(),clearTimeout(FLBuilder._lightboxScrollbarTimeout),FLBuilder._lightboxScrollbarTimeout=null},_showActionsLightbox:function(e){var t=wp.template("fl-actions-lightbox");FLBuilder.triggerHook("actions-lightbox-settings",e),FLBuilder._actionsLightbox.open(t(e))},_checkEnv:function(){"svg"===FLBuilderConfig.fontAwesome&&FLBuilder.alert(FLBuilderStrings.fontAwesome)},alert:function(e){var t=new FLLightbox({className:"fl-builder-alert-lightbox",destroyOnClose:!0}),i=wp.template("fl-alert-lightbox");t.open(i({message:e}))},crashMessage:function(e){FLLightbox.closeAll();var t=new FLLightbox({className:"fl-builder-alert-lightbox fl-builder-crash-lightbox",destroyOnClose:!0}),i=wp.template("fl-crash-lightbox"),l=window.crash_vars.product,o=window.crash_vars.white_label,n=window.crash_vars.labeled_txt;message=l+" has detected a plugin conflict that is preventing the page from saving.<p>( In technical terms there’s probably a PHP error in Ajax. )</p>",info="<p>If you contact Beaver Builder Support, we need to know what the error is in the JavaScript console in your browser.</p>",info+="<div><div style='width:49%;float:left;'><p>MacOS Users:<br />Chrome: View > Developer > JavaScript Console<br />Firefox: Tools > Web Developer > Browser Console<br />Safari: Develop > Show JavaScript console</p></div><div style='width:49%;float:right;'><p>Windows Users:<br />Chrome: Settings > More Tools > Developer > Console<br />Firefox: Menu/Settings > Web Developer > Web Console<br />Edge: Settings and More > More Tools > Console</p></div></div><p style='display:inline-block;'>Copy the errors you find there and submit them with your Support ticket. It saves us having to ask you that as a second step.<br /><br />If you want to troubleshoot further, you can check our <a class='link' target='_blank' href='https://docs.wpbeaverbuilder.com/beaver-builder/troubleshooting/debugging/known-beaver-builder-incompatibilities'>Knowledge Base</a> for plugins we know to be incompatible. Then deactivate your plugins one by one while you try to save the page in the Beaver Builder editor. When the page saves normally, you have identified the plugin causing the conflict. <a class='link' target='_blank' href='https://www.wpbeaverbuilder.com/beaver-builder-support/'>Contact Support</a> if you need further help.</p>",FLBuilderConfig.MaxInputVars<=3e3&&(info+="<br /><br />The PHP config value max_input_vars is only set to "+FLBuilderConfig.MaxInputVars+'. If you are using 3rd party addons this could very likely be the cause of this error. [<a class="link" href="https://docs.wpbeaverbuilder.com/beaver-builder/troubleshooting/common-issues/exceeds-php-max-input-vars">doc link</a>].'),o&&(info=n),t.open(i({message:message,info:info,debug:!1}))},_alertClose:function(){FLLightbox.closeParent(this)},confirm:function(e){var t={message:"",ok:function(){},cancel:function(){},strings:{ok:FLBuilderStrings.ok,cancel:FLBuilderStrings.cancel}},t=y.extend({},t,void 0===e?{}:e);lightbox=new FLLightbox({className:"fl-builder-confirm-lightbox fl-builder-alert-lightbox",destroyOnClose:!0}),template=wp.template("fl-confirm-lightbox"),lightbox.open(template(t)),lightbox._node.find(".fl-builder-confirm-ok").on("click",t.ok),lightbox._node.find(".fl-builder-confirm-cancel").on("click",t.cancel)},triggerHook:function(e,t){y("body").trigger("fl-builder."+e,t)},addHook:function(e,t){y("body").on("fl-builder."+e,t)},removeHook:function(e,t){y("body").off("fl-builder."+e,t)},log:function(e){void 0!==window.console&&void 0!==window.console.log&&console.log(e)},logError:function(e,t){var i=null;void 0!==e&&(void 0!==e.stack?i=e.stack:void 0!==e.message&&(i=e.message),i&&(FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(i),void 0!==t&&t&&(FLBuilder.log("Debug Info"),console.log(t)),y.each(window.crash_vars.vars,function(e,t){console.log(e+": "+t)}),FLBuilder.log("************************************************************************"),void 0!==t&&t&&(i=t+"\n"+i),FLBuilder.crashMessage(i)))},logGlobalError:function(e,t,i,l,o){FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(FLBuilderStrings.globalErrorMessage.replace("{message}",e).replace("{line}",i).replace("{file}",t)),void 0!==o&&void 0!==o.stack&&FLBuilder.log(o.stack),FLBuilder.log("************************************************************************")},_jsonParse:function(t){try{t=JSON.parse(t)}catch(e){FLBuilder.logError(e,FLBuilder._parseError(t))}return t},_parseError:function(e){return e.indexOf("</head>")?"AJAX returned HTML page instead of data. (Possible 404 or max_input_vars)":!!((php=e.match(/^<.*/gm)||!1)&&0<php.length)&&(i="",y.each(php,function(e,t){i+=t}),y(i).text());var i},isUndefined:function(e){return void 0===e},isBoolean:function(e){return!0===e||!1===e},getSandbox:function(e){return e in this._sandbox&&this._sandbox[e]},setSandbox:function(e,t){this._sandbox[e]=t},deleteSandbox:function(e){delete this._sandbox[e]}},y(function(){FLBuilder._init()})}(jQuery),!function(n){(FLBuilderAJAXLayout=function(e,t){this._data=n.extend({},this._defaults,"string"==typeof e?FLBuilder._jsonParse(e):e),this._callback=t,this._post=FLBuilderConfig.postId,this._head=n("head").eq(0),this._body=n("body").eq(0),this._data.css&&("inline"===FLBuilderConfig.enqueueMethod?(this._oldCss=n("#fl-builder-layout-"+this._post+"-inline-css"),this._newCss=n('<style id="fl-builder-layout-'+this._post+'-inline-css" type="text/css">'+this._data.css+"</style>")):(this._loader=n('<img src="'+this._data.css+'" />'),this._oldCss=n('link[href*="/cache/'+this._post+'-layout"]'),this._newCss=n('<link rel="stylesheet" id="fl-builder-layout-'+this._post+'-css" href="'+this._data.css+'" />'))),this._data.partial?(this._data.js&&(this._oldJs=n("#fl-builder-partial-refresh-js"),this._newJs=n('<script type="text/javascript" id="fl-builder-partial-refresh-js">'+this._data.js+"<\/script>")),this._data.nodeId&&(this._data.oldNodeId?(this._oldScriptsStyles=n('.fl-builder-node-scripts-styles[data-node="'+this._data.oldNodeId+'"]'),this._content=n(".fl-node-"+this._data.oldNodeId)):(this._oldScriptsStyles=n('.fl-builder-node-scripts-styles[data-node="'+this._data.nodeId+'"]'),this._content=n(".fl-node-"+this._data.nodeId).eq(0)))):("inline"===FLBuilderConfig.enqueueMethod?(this._oldJs=n("#fl-builder-layout-"+this._post+"-inline-js"),this._newJs=n('<script id="fl-builder-layout-'+this._post+'-inline-js">'+this._data.js+"<\/script>")):(this._oldJs=n('script[src*="/cache/'+this._post+'"]'),this._newJs=n('<script src="'+this._data.js+'"><\/script>')),this._oldScriptsStyles=n(".fl-builder-layout-scripts-styles"),this._content=n(FLBuilder._contentClass)),this._init()}).prototype={_defaults:{partial:!1,nodeId:null,nodeType:null,nodeParent:null,nodePosition:null,oldNodeId:null,html:null,scriptsStyles:null,css:null,js:null},_data:null,_callback:function(){},_post:null,_head:null,_body:null,_loader:null,_oldCss:null,_newCss:null,_oldJs:null,_newJs:null,_oldScriptsStyles:null,_content:null,_init:function(){this._body.height(this._body.height()),this._data.css?"inline"===FLBuilderConfig.enqueueMethod?(this._addNewCSS(),this._finish()):"onload"in document.createElement("link")?(this._newCss.on("load",n.proxy(this._finish,this)),this._addNewCSS()):(this._loader.on("error",n.proxy(this._loadNewCSSFallbackComplete,this)),this._body.append(this._loader)):this._finish()},_loadNewCSSFallbackComplete:function(){this._loader.remove(),this._addNewCSS(),setTimeout(n.proxy(this._finish,this),250)},_addNewCSS:function(){0<this._oldCss.length?this._oldCss.after(this._newCss):this._head.append(this._newCss)},_finish:function(){this._removeOldContentAndAssets(),this._cleanNewHTML(),this._cleanNewAssets(),this._addNewHTML(),this._addNewScriptsStyles(),this._addNewJS(),n(FLBuilder._contentClass).trigger("fl-builder.layout-rendered"),FLBuilder.hideAjaxLoader()},_removeOldContentAndAssets:function(){this._content&&this._content.empty(),this._oldCss&&this._oldCss.remove(),this._oldJs&&this._oldJs.remove(),this._oldScriptsStyles&&this._oldScriptsStyles.remove()},_cleanNewHTML:function(){var e,t,i,l;this._data.scriptsStyles&&(e=n("<div>"+this._data.html+"</div>"),t="fl-row",i=this._data.scriptsStyles,l="",this._data.partial&&(t="column-group"==this._data.nodeType?"fl-col-group":"column"==this._data.nodeType?"fl-col":"fl-"+this._data.nodeType),e.find("> *, script").each(function(){n(this).hasClass(t)||"application/json"==n(this).attr("type")||(l=n(this).remove(),i+=l[0].outerHTML)}),""!==i&&(i=this._data.partial?'<div class="fl-builder-node-scripts-styles" data-node="'+this._data.nodeId+'">'+i+"<div>":'<div class="fl-builder-node-scripts-styles">'+i+"<div>"),this._data.html=e.html(),this._data.scriptsStyles=i)},_addNewHTML:function(){var e;this._data.partial?this._data.nodeParent?(0===(e=(e=this._data.nodeParent.hasClass("fl-builder-content")?this._data.nodeParent.find(" > .fl-row"):this._data.nodeParent.hasClass("fl-row-content")?this._data.nodeParent.find(" > .fl-col-group"):this._data.nodeParent.hasClass("fl-col-group")?this._data.nodeParent.find(" > .fl-col"):this._data.nodeParent.find(" > .fl-col-group, > .fl-module")).filter(":not(.fl-builder-node-clone)")).length||this._data.nodePosition>=e.length?this._data.nodeParent.append(this._data.html):e.eq(this._data.nodePosition).before(this._data.html),this._data.nodeId&&FLBuilder._removeNodeLoadingPlaceholder(n(".fl-node-"+this._data.nodeId))):(this._content.after(this._data.html),this._content.remove()):this._content.append(this._data.html),FLBuilder.preview&&this._data.nodeId&&this._data.nodeId!=FLBuilder.preview.nodeId&&((e=n(FLBuilder.preview.classes.node)).closest(".fl-node-"+this._data.nodeId).length&&e.html(FLBuilder.preview.elements.node.html())),this._data.onAddNewHTML&&this._data.onAddNewHTML()},_cleanNewAssets:function(){var e=this;this._data.html=this._removeDuplicateAssets(this._data.html),this._data.scriptsStyles&&""!==this._data.scriptsStyles&&(this._data.scriptsStyles=this._removeDuplicateAssets(this._data.scriptsStyles)),this._data.partial?n(".fl-builder-node-scripts-styles").each(function(){-1<e._data.html.indexOf("fl-node-"+n(this).data("node"))&&n(this).remove()}):(n("#fl-builder-partial-refresh-js").remove(),n(".fl-builder-node-scripts-styles").remove())},_removeDuplicateAssets:function(e){var e=n("<div>"+e+"</div>"),t="",i="",l=window.location,o=l.protocol+"//"+l.hostname+(l.port?":"+l.port:"");return e.find("script").each(function(){void 0!==(t=n(this).attr("src"))&&(t=t.replace(o,""),0<n('script[src*="'+t+'"]').length&&n(this).remove())}),e.find("link").each(function(){void 0!==(i=n(this).attr("href"))&&(i=i.replace(o,""),0<n('link[href*="'+i+'"]').length&&n(this).remove())}),e.html()},_addNewScriptsStyles:function(){this._data.scriptsStyles&&""!==this._data.scriptsStyles&&this._body.append(this._data.scriptsStyles)},_addNewJS:function(){setTimeout(n.proxy(function(){this._newJs&&this._head.append(this._newJs),FLBuilder.triggerHook("didRenderLayoutJSComplete")},this),50)},_complete:function(){FLBuilder._dragging?(FLBuilder._highlightRowsAndColsForDrag(),FLBuilder._refreshSortables()):(FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._resizeLayout()),FLBuilder._initMediaElements(),FLBuilderLayout.init(),FLBuilderResponsiveEditing.refreshPreview(this._callback),FLBuilder.triggerHook("didRenderLayoutComplete"),this._body.height("auto")}}}(jQuery),!function(h){(FLBuilderPreview=function(e){this.id=(new Date).getTime(),this.type=e.type,this._saveState(),e.layout?FLBuilder._renderLayout(e.layout,function(){this._init(),e.callback&&e.callback()}.bind(this)):this._init()})._fontsList={},FLBuilderPreview.getFormattedSelector=function(e,t){for(var i="",l=t.split(","),o=0;o<l.length;o++)-1<l[o].indexOf("{node}")?i+=l[o].replace("{node}",e):-1<l[o].indexOf("{node_id}")?i+=l[o].replace(/{node_id}/g,this.nodeId):i+=e+" "+l[o],o!=l.length-1&&(i+=", ");return i},FLBuilderPreview.prototype={id:"",type:"",nodeId:null,classes:{},elements:{},state:null,_savedSettings:null,_styleSheet:null,_styleSheetMedium:null,_styleSheetResponsive:null,_timeout:null,_loaderTimeout:null,_lastClassName:null,_xhr:null,_init:function(){switch(this.nodeId=h(".fl-builder-settings").data("node"),this._saveSettings(),this._initElementsAndClasses(),this._createSheets(),this._initResponsivePreviews(),this._initDefaultFieldPreviews(),this.type){case"row":this._initRow();break;case"col":this._initColumn();break;case"module":this._initModule()}FLBuilder.triggerHook("preview-init",this)},_saveSettings:function(){var e=h(".fl-builder-settings-lightbox .fl-builder-settings");this._savedSettings=FLBuilder._getSettingsForChangedCheck(this.nodeId,e)},_settingsHaveChanged:function(){var e=h(".fl-builder-settings-lightbox .fl-builder-settings"),e=FLBuilder._getSettings(e);return JSON.stringify(this._savedSettings)!=JSON.stringify(e)},_initElementsAndClasses:function(){var e="row"==this.type?".fl-row-content-wrap":".fl-"+this.type+"-content";h.extend(this.classes,{settings:".fl-builder-"+this.type+"-settings",settingsHeader:".fl-builder-"+this.type+"-settings .fl-lightbox-header",node:FLBuilder._contentClass+" .fl-node-"+this.nodeId,content:FLBuilder._contentClass+" .fl-node-"+this.nodeId+" > "+e}),h.extend(this.elements,{settings:h(this.classes.settings),settingsHeader:h(this.classes.settingsHeader),node:h(this.classes.node),content:h(this.classes.content)})},_createSheets:function(){this._destroySheets(),this._styleSheet||(this._styleSheet=new FLStyleSheet({id:"fl-builder-preview",className:"fl-builder-preview-style"})),this._styleSheetMedium||(this._styleSheetMedium=new FLStyleSheet({id:"fl-builder-preview-medium",className:"fl-builder-preview-style"}),this._styleSheetMedium.disable()),this._styleSheetResponsive||(this._styleSheetResponsive=new FLStyleSheet({id:"fl-builder-preview-responsive",className:"fl-builder-preview-style"}),this._styleSheetResponsive.disable())},_destroySheets:function(){this._styleSheet&&(this._styleSheet.destroy(),this._styleSheet=null),this._styleSheetMedium&&(this._styleSheetMedium.destroy(),this._styleSheetMedium=null),this._styleSheetResponsive&&(this._styleSheetResponsive.destroy(),this._styleSheetResponsive=null)},_disableStyles:function(){var e=FLBuilderResponsiveEditing._mode,t=FLBuilderConfig.global,i=this.elements.node;"responsive"===e?(FLBuilderSimulateMediaQuery.disableStyles(t.responsive_breakpoint),this._styleSheetResponsive.disable()):"medium"===e?(FLBuilderSimulateMediaQuery.disableStyles(t.medium_breakpoint),this._styleSheetMedium.disable()):i.removeClass(function(e,t){return(t.match(/fl-node-[^\s]*/g)||[]).join(" ")})},_enableStyles:function(){var e=FLBuilderResponsiveEditing._mode,t=this.elements.node;"responsive"===e?(FLBuilderSimulateMediaQuery.enableStyles(),this._styleSheetResponsive.enable()):"medium"===e?(FLBuilderSimulateMediaQuery.enableStyles(),this._styleSheetMedium.enable()):t.addClass("fl-node-"+t.data("node"))},_getDefaultValue:function(e,t){var i="",e=h(e),l=e.closest("[data-node]");return"width"===t?i="auto":-1===h.inArray(t,["line-height","font-weight"])&&l.length&&(this._disableStyles(),i=e.css(t),this._enableStyles()),i},updateCSSRule:function(e,t,i,l){var o=FLBuilderResponsiveEditing._mode,n="";""!==i&&"null"!==i||(i=this._getDefaultValue(e,t)),l?(n="string"==typeof l?this.toUpperCaseWords(l):"default"===o?"":this.toUpperCaseWords(o),this["_styleSheet"+n].updateRule(e,t,i)):this._styleSheet.updateRule(e,t,i)},delay:function(e,t){this._cancelDelay(),this._timeout=setTimeout(t,e)},_cancelDelay:function(){null!==this._timeout&&clearTimeout(this._timeout)},hexToRgb:function(e){e=parseInt(e,16);return[e>>16&255,e>>8&255,255&e]},hexOrRgb:function(e){return e=e.indexOf("rgb")<0&&e.indexOf("#")<0?"#"+e:e},parseFloat:function(e){return isNaN(parseFloat(e))?0:parseFloat(e)},_initResponsivePreviews:function(){var e=".preview-"+this.id;FLBuilder.addHook("responsive-editing-switched"+e,h.proxy(this._responsiveEditingSwitched,this)),FLBuilder.addHook("responsive-editing-before-preview-fields"+e,h.proxy(this._responsiveEditingPreviewFields,this))},_destroyResponsivePreviews:function(){var e=".preview-"+this.id;FLBuilder.removeHook("responsive-editing-switched"+e),FLBuilder.removeHook("responsive-editing-before-preview-fields"+e)},_responsiveEditingSwitched:function(e,t){"default"==t?(this._styleSheetMedium.disable(),this._styleSheetResponsive.disable()):"medium"==t?(this._styleSheetMedium.enable(),this._styleSheetResponsive.disable()):"responsive"==t&&(this._styleSheetMedium.enable(),this._styleSheetResponsive.enable())},_responsiveEditingPreviewFields:function(e,t){"medium"===t&&"col"===this.type&&this.elements.node[0].style.width&&(size=parseFloat(this.elements.node[0].style.width),this.elements.size.val(size))},updateResponsiveCSSRule:function(e,t,i){this.updateCSSRule(e,t,i,!0)},_saveState:function(){var e=FLBuilderConfig.postId,t=h('link[href*="/cache/'+e+'"]').attr("href"),e=h('script[src*="/cache/'+e+'"]').attr("src"),i=h(FLBuilder._contentClass).html();this.state={css:t,js:e,html:i}},preview:function(){var e=h(".fl-builder-settings-lightbox .fl-builder-settings"),t=e.attr("data-node"),e=FLBuilder._getSettings(e);if(FLBuilder._showNodeLoading(t),this._cancelPreview(),"error"===(e=FLBuilder._inputVarsCheck(e)))return 0;this._xhr=FLBuilder.ajax({action:"render_layout",node_id:t,node_preview:e},h.proxy(this._renderPreview,this))},delayPreview:function(e){var t=void 0===e?[]:h(e.target).closest("tr").find("th"),i=h(".fl-builder-widget-settings .fl-builder-settings-title"),l=h(".fl-builder-settings .fl-lightbox-header"),e=FLBuilderLayoutConfig.paths.pluginUrl+"img/ajax-loader-small.svg",o=h('<img class="fl-builder-preview-loader" src="'+e+'" />');this.delay(1e3,h.proxy(this.preview,this)),this._loaderTimeout=setTimeout(function(){h(".fl-builder-preview-loader").remove(),0<t.length?t.append(o):0<i.length?i.append(o):0<l.length&&l.append(o)},1500)},_cancelPreview:function(){this._xhr&&(this._xhr.abort(),this._xhr=null)},_renderPreview:function(e){this._xhr=null,FLBuilder._renderLayout(e,h.proxy(this._renderPreviewComplete,this))},_renderPreviewComplete:function(){this._createSheets(),this._initElementsAndClasses(),this._initDefaultFieldPreviews(),null!==this._loaderTimeout&&clearTimeout(this._loaderTimeout),h(".fl-builder-preview-loader").remove(),h(FLBuilder._contentClass).trigger("fl-builder.preview-rendered")},revert:function(){var e=this.nodeId;this._settingsHaveChanged()?("col"===this.type&&(e=this.elements.node.closest(".fl-col-group").data("node")),FLBuilder._updateNode(e,function(){this.clear()}.bind(this))):this.clear()},cancel:function(){this._cancelDelay(),this._cancelPreview()},clear:function(){this.cancel(),this._destroySheets(),this._destroyResponsivePreviews()},_initNodeTextColor:function(){h.extend(this.elements,{textColor:h(this.classes.settings+" input[name=text_color]"),linkColor:h(this.classes.settings+" input[name=link_color]"),hoverColor:h(this.classes.settings+" input[name=hover_color]"),headingColor:h(this.classes.settings+" input[name=heading_color]")}),this.elements.textColor.on("change",h.proxy(this._textColorChange,this)),this.elements.linkColor.on("change",h.proxy(this._textColorChange,this)),this.elements.hoverColor.on("change",h.proxy(this._textColorChange,this)),this.elements.headingColor.on("change",h.proxy(this._textColorChange,this))},_textColorChange:function(e){var t=this.elements.textColor.val(),i=this.elements.linkColor.val(),l=this.elements.hoverColor.val(),o=this.elements.headingColor.val(),i=""===i?t:i,l=""===l?t:l,o=""===o?t:o;t&&t.indexOf("rgb")<0&&(t="#"+t),i&&i.indexOf("rgb")<0&&(i="#"+i),l&&l.indexOf("rgb")<0&&(l="#"+l),o&&o.indexOf("rgb")<0&&(o="#"+o),this.delay(50,h.proxy(function(){""===t?this.updateCSSRule(this.classes.node,"color",""):this.updateCSSRule(this.classes.node,"color",t),""===i?this.updateCSSRule(this.classes.node+" a","color",""):this.updateCSSRule(this.classes.node+" a","color",i),""===l?this.updateCSSRule(this.classes.node+" a:hover","color",""):this.updateCSSRule(this.classes.node+" a:hover","color",l),""===o?(this.updateCSSRule(this.classes.node+" h1","color",""),this.updateCSSRule(this.classes.node+" h2","color",""),this.updateCSSRule(this.classes.node+" h3","color",""),this.updateCSSRule(this.classes.node+" h4","color",""),this.updateCSSRule(this.classes.node+" h5","color",""),this.updateCSSRule(this.classes.node+" h6","color",""),this.updateCSSRule(this.classes.node+" h1 a","color",""),this.updateCSSRule(this.classes.node+" h2 a","color",""),this.updateCSSRule(this.classes.node+" h3 a","color",""),this.updateCSSRule(this.classes.node+" h4 a","color",""),this.updateCSSRule(this.classes.node+" h5 a","color",""),this.updateCSSRule(this.classes.node+" h6 a","color","")):(this.updateCSSRule(this.classes.node+" h1","color",o),this.updateCSSRule(this.classes.node+" h2","color",o),this.updateCSSRule(this.classes.node+" h3","color",o),this.updateCSSRule(this.classes.node+" h4","color",o),this.updateCSSRule(this.classes.node+" h5","color",o),this.updateCSSRule(this.classes.node+" h6","color",o),this.updateCSSRule(this.classes.node+" h1 a","color",o),this.updateCSSRule(this.classes.node+" h2 a","color",o),this.updateCSSRule(this.classes.node+" h3 a","color",o),this.updateCSSRule(this.classes.node+" h4 a","color",o),this.updateCSSRule(this.classes.node+" h5 a","color",o),this.updateCSSRule(this.classes.node+" h6 a","color",o))},this))},_initNodeBg:function(){h.extend(this.elements,{bgType:h(this.classes.settings+" select[name=bg_type]"),bgColor:h(this.classes.settings+" input[name=bg_color]"),bgColorPicker:h(this.classes.settings+" .fl-picker-bg_color"),bgGradientType:h(this.classes.settings+" select.fl-gradient-picker-type-select"),bgVideoSource:h(this.classes.settings+" select[name=bg_video_source]"),bgVideo:h(this.classes.settings+" input[name=bg_video]"),bgVideoServiceUrl:h(this.classes.settings+" input[name=bg_video_service_url]"),bgVideoFallbackSrc:h(this.classes.settings+" select[name=bg_video_fallback_src]"),bgSlideshowSource:h(this.classes.settings+" select[name=ss_source]"),bgSlideshowPhotos:h(this.classes.settings+" input[name=ss_photos]"),bgSlideshowFeedUrl:h(this.classes.settings+" input[name=ss_feed_url]"),bgSlideshowSpeed:h(this.classes.settings+" input[name=ss_speed]"),bgSlideshowTrans:h(this.classes.settings+" select[name=ss_transition]"),bgSlideshowTransSpeed:h(this.classes.settings+" input[name=ss_transitionDuration]"),bgParallaxImageSrc:h(this.classes.settings+" select[name=bg_parallax_image_src]"),bgOverlayType:h(this.classes.settings+" select[name=bg_overlay_type]"),bgOverlayColor:h(this.classes.settings+" input[name=bg_overlay_color]"),bgOverlayGradient:h(this.classes.settings+" #fl-field-bg_overlay_gradient select")}),this.elements.bgType.on("change",h.proxy(this._bgTypeChange,this)),this.elements.bgColor.on("change",h.proxy(this._bgColorChange,this)),this.elements.bgVideoServiceUrl.on("change",h.proxy(this._bgVideoChange,this)),this.elements.bgSlideshowSource.on("change",h.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowPhotos.on("change",h.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowFeedUrl.on("keyup",h.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowSpeed.on("keyup",h.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTrans.on("change",h.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTransSpeed.on("keyup",h.proxy(this._bgSlideshowChange,this)),this.elements.bgParallaxImageSrc.on("change",h.proxy(this._bgParallaxChange,this)),this.elements.bgOverlayType.on("change",h.proxy(this._bgOverlayChange,this)),this.elements.bgOverlayColor.on("change",h.proxy(this._bgOverlayChange,this))},_bgTypeChange:function(e){var t=this.elements.bgType.val(),i=FLBuilderResponsiveEditing._mode;this.elements.node.removeClass("fl-row-bg-video"),this.elements.node.removeClass("fl-row-bg-slideshow"),this.elements.node.removeClass("fl-row-bg-parallax"),this.elements.node.find(".fl-bg-video").remove(),this.elements.node.find(".fl-bg-slideshow").remove(),this.elements.content.css("background-image",""),this.updateCSSRule(this.classes.content,"background-color","transparent"),this.updateCSSRule(this.classes.content,"background-image","none"),this.updateCSSRule(this.classes.content,"background-image","none","medium"),this.updateCSSRule(this.classes.content,"background-image","none","responsive"),"none"==t?this._bgOverlayClear():"color"==t?(this.elements.bgColor.trigger("change"),this._bgOverlayClear()):"gradient"==t?(this.elements.bgGradientType.trigger("change"),this._bgOverlayClear()):"photo"==t?(this.elements.bgColor.trigger("change"),this.elements.settings.find('[data-device="'+i+'"] select[name*="bg_"]').trigger("change")):"video"==t?(this.elements.bgColor.trigger("change"),this._bgVideoChange()):"slideshow"==t?(this.elements.bgColor.trigger("change"),this._bgSlideshowChange()):"parallax"==t&&(this.elements.bgColor.trigger("change"),this.elements.bgParallaxImageSrc.trigger("change"))},_bgColorChange:function(e){var t;""===this.elements.bgColor.val()?this.updateCSSRule(this.classes.content,"background-color","transparent"):(t=this.hexOrRgb(this.elements.bgColor.val()),this.delay(100,h.proxy(function(){this.updateCSSRule(this.classes.content,"background-color",t)},this)))},_bgVideoChange:function(e){var t=this.elements,i=t.bgVideoSource.val(),l=t.bgVideo.val(),t=t.bgVideoServiceUrl.val(),o=h("<script>");"video_service"==i&&""!=t?(/^(?:(?:(?:https?:)?\/\/)?(?:www.)?(?:youtu(?:be.com|.be))\/(?:watch\?v\=|v\/|embed\/)?([\w\-]+))/i.test(t)&&h('script[src*="youtube.com"').length<1?o.attr("src","https://www.youtube.com/iframe_api"):/^(http\:\/\/|https\:\/\/)?(www\.)?(vimeo\.com\/)([0-9]+)$/.test(t)&&h('script[src*="vimeo.com"').length<1&&o.attr("src","https://player.vimeo.com/api/player.js"),o.attr("type","text/javascript").appendTo("head"),this.delay(500,h.proxy(this.preview,this))):""!=l&&this.preview()},_bgSlideshowChange:function(e){var t=this.elements,i=t.bgSlideshowSource.val(),l=t.bgSlideshowPhotos.val(),o=t.bgSlideshowFeedUrl.val(),n=t.bgSlideshowSpeed.val(),t=t.bgSlideshowTransSpeed.val();"wordpress"==i&&""===l||"smugmug"==i&&""===o||isNaN(parseInt(n))||isNaN(parseInt(t))||this.delay(500,h.proxy(this.preview,this))},_bgParallaxChange:function(e){this.elements.bgParallaxImageSrc.val()&&this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgParallaxImageSrc.val()+")","background-repeat":"no-repeat","background-position":"center center","background-attachment":"fixed","background-size":"cover"})},_bgOverlayChange:function(e){var t,i=this.elements.bgOverlayType.val(),l=this.elements.bgOverlayColor.val();"color"===i?(""===l?(this.elements.node.removeClass("fl-row-bg-overlay"),this.elements.node.removeClass("fl-col-bg-overlay"),this.updateCSSRule(this.classes.content+"::after","background-color","transparent")):(t=this.hexOrRgb(this.elements.bgOverlayColor.val()),this.delay(100,h.proxy(function(){this._bgOverlayAddClasses(),this.updateCSSRule(this.classes.content+"::after","background-color",t)},this))),this.updateCSSRule(this.classes.content+"::after","background-image","none")):"gradient"===i?(this._bgOverlayAddClasses(),this.updateCSSRule(this.classes.content+"::after","background-color","transparent"),this.elements.bgOverlayGradient.trigger("change")):(this.elements.node.removeClass("fl-row-bg-overlay"),this.elements.node.removeClass("fl-col-bg-overlay"),this.updateCSSRule(this.classes.content+"::after","background-color","transparent"),this.updateCSSRule(this.classes.content+"::after","background-image","none"))},_bgOverlayAddClasses:function(){this.elements.node.hasClass("fl-col")?this.elements.node.addClass("fl-col-bg-overlay"):this.elements.node.addClass("fl-row-bg-overlay")},_bgOverlayClear:function(e){this.elements.bgOverlayColor.prev(".fl-color-picker-clear").trigger("click"),this.elements.bgOverlayType.val("color").trigger("change")},_initNodeClassName:function(){h.extend(this.elements,{className:h(this.classes.settings+" input[name=class]")}),this.elements.className.on("keyup",h.proxy(this._classNameChange,this)),this._lastClassName=this.elements.className.val()},_classNameChange:function(e){var t=this.elements.className.val();null!==this._lastClassName&&this.elements.node.removeClass(this._lastClassName),this.elements.node.addClass(t),this._lastClassName=t},_initNodeDimensions:function(e){for(var t,i={},l=["Top","Bottom","Left","Right"],o=["","Medium","Responsive"],n=this.classes.settings,s="",r=null,a=null,r=0;r<l.length;r++)for(a=0;a<o.length;a++)t=e+l[r]+o[a],s=e+"_"+l[r].toLowerCase(),""!=o[a]&&(s+="_"+o[a].toLowerCase()),i[t]=h(n+" input[name="+s+"]");h.extend(this.elements,i)},_initRow:function(){h.extend(this.elements,{width:h(this.classes.settings+" select[name=width]"),contentWidth:h(this.classes.settings+" select[name=content_width]"),maxContentWidth:h(this.classes.settings+" input[name=max_content_width]"),maxContentWidthUnit:h(this.classes.settings+" select[name=max_content_width_unit]"),height:h(this.classes.settings+" select[name=full_height]"),minHeight:h(this.classes.settings+" input[name=min_height]"),align:h(this.classes.settings+" select[name=content_alignment]")}),this.elements.width.on("change",h.proxy(this._rowWidthChange,this)),this.elements.contentWidth.on("change",h.proxy(this._rowContentWidthChange,this)),this.elements.maxContentWidth.on("input",h.proxy(this._rowMaxContentWidthChange,this)),this.elements.maxContentWidthUnit.on("change",h.proxy(this._rowMaxContentWidthChange,this)),this.elements.height.on("change",h.proxy(this._rowHeightChange,this)),this.elements.align.on("change",h.proxy(this._rowHeightChange,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeDimensions("border"),this._initNodeDimensions("margin"),this._initNodeDimensions("padding")},_rowWidthChange:function(e){FLBuilderConfig.global;var t=this.elements.node,i=this.elements.content.find(".fl-row-content");this.elements.maxContentWidth.val(),this.elements.maxContentWidthUnit.val();t.css("max-width","none"),i.css("max-width","none"),"full"==this.elements.width.val()?(t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width")),this._rowMaxContentWidthChange()},_rowContentWidthChange:function(e){FLBuilderConfig.global;var t=this.elements.node,i=this.elements.content.find(".fl-row-content");this.elements.maxContentWidth.val(),this.elements.maxContentWidthUnit.val();t.css("max-width","none"),i.css("max-width","none"),"full"==this.elements.contentWidth.val()?(i.removeClass("fl-row-fixed-width"),i.addClass("fl-row-full-width")):(i.removeClass("fl-row-full-width"),i.addClass("fl-row-fixed-width"),this._rowMaxContentWidthChange())},_rowMaxContentWidthChange:function(e){var t=FLBuilderConfig.global,i=this.elements.node,l=this.elements.content.find(".fl-row-content"),o=this.elements.maxContentWidth.val(),n=this.elements.maxContentWidthUnit.val();""==o?o=t.row_width+t.row_width_unit:o+=n,"fixed"===this.elements.width.val()&&i.css("max-width",o),l.css("max-width",o)},_rowHeightChange:function(e){var t=this.elements.node;this.elements.content;t.removeClass("fl-row-align-top"),t.removeClass("fl-row-align-center"),t.removeClass("fl-row-align-bottom"),t.removeClass("fl-row-full-height"),t.removeClass("fl-row-custom-height"),"full"==this.elements.height.val()?(t.addClass("fl-row-full-height"),t.addClass("fl-row-align-"+this.elements.align.val()),this.elements.minHeight.val("").trigger("input")):"custom"==this.elements.height.val()?(t.addClass("fl-row-custom-height"),t.addClass("fl-row-align-"+this.elements.align.val()),this.elements.minHeight.trigger("input")):this.elements.minHeight.val("").trigger("input")},_initColumn:function(){h.extend(this.elements,{size:h(this.classes.settings+" input[name=size]"),sizeMedium:h(this.classes.settings+" input[name=size_medium]"),sizeResponsive:h(this.classes.settings+" input[name=size_responsive]"),columnHeight:h(this.classes.settings+" select[name=equal_height]"),columnAlign:h(this.classes.settings+" select[name=content_alignment]"),responsiveOrder:h(this.classes.settings+" select[name=responsive_order]")}),this.elements.size.on("input",h.proxy(this._colSizeChange,this)),this.elements.sizeMedium.on("input",h.proxy(this._colSizeChange,this)),this.elements.sizeResponsive.on("input",h.proxy(this._colSizeChange,this)),this.elements.columnHeight.on("change",h.proxy(this._colHeightChange,this)),this.elements.columnAlign.on("change",h.proxy(this._colHeightChange,this)),this.elements.responsiveOrder.on("change",h.proxy(this._colResponsiveOrder,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeDimensions("border"),this._initNodeDimensions("margin"),this._initNodeDimensions("padding")},_colSizeChange:function(e){var e=h(e.target),t=92,i=parseFloat(e.val()),l=this.elements.node.closest(".fl-col-group"),o=this.elements.node.prev(".fl-col"),n=this.elements.node.next(".fl-col"),s=0===n.length?o:n,o=this.elements.node.siblings(".fl-col"),r=0,n=FLBuilderResponsiveEditing._mode;0!==o.length&&(isNaN(i)&&("medium"===n?i=this.elements.size.val():"responsive"===n&&(i=this.elements.sizeMedium.val()?this.elements.sizeMedium.val():"auto"),"auto"!==i&&isNaN(i)&&(i=8)),"default"===n?(o.each(function(){h(this).data("node")!=s.data("node")&&(t-=parseFloat(h(this)[0].style.width),r+=parseFloat(h(this)[0].style.width))}),t<(i=i<8?8:i)&&(i=t),this.elements.node.css("width",i+"%"),s.css("width",100-r-i+"%")):(100<i&&e.val(i=100),this.updateCSSRule(this.classes.node,{"max-width":("auto"===i?100:i)+"% !important",width:("auto"===i?i:i+"%")+" !important"},void 0,!0),"responsive"===n&&(e.val()?(this.updateCSSRule(this.classes.node,"float",FLBuilderConfig.isRtl?"right":"left",!0),this.updateCSSRule(this.classes.node,"clear","none",!0)):(this.updateCSSRule(this.classes.node,"float","none",!0),this.updateCSSRule(this.classes.node,"clear","both",!0)),e.val()||this._colsHaveCustomResponsiveWidth(o)?l.addClass("fl-col-group-custom-width"):l.removeClass("fl-col-group-custom-width"))))},_colsHaveCustomResponsiveWidth:function(e){var t=FLBuilderSettingsConfig.nodes,i=!1;return e.each(function(){var e=h(this).data("node");t[e]&&t[e].size_responsive&&(i=!0)}),i},_colHeightChange:function(){var e=this.elements.node.parent(".fl-col-group");e.removeClass("fl-col-group-align-top"),e.removeClass("fl-col-group-align-center"),e.removeClass("fl-col-group-align-bottom"),"yes"==this.elements.columnHeight.val()?(e.addClass("fl-col-group-equal-height"),e.addClass("fl-col-group-align-"+this.elements.columnAlign.val())):e.removeClass("fl-col-group-equal-height")},_colResponsiveOrder:function(){var e=this.elements.node.parent(".fl-col-group");"reversed"==this.elements.responsiveOrder.val()?e.addClass("fl-col-group-responsive-reversed"):e.removeClass("fl-col-group-responsive-reversed")},_initModule:function(){this._initNodeClassName(),this._initNodeDimensions("margin")},_initDefaultFieldPreviews:function(e){var t,i,e=FLBuilder.isUndefined(e)?this.elements.settings.find(".fl-field"):e,l=null,o=0;if(FLBuilderConfig.safemode)return!1;for(;o<e.length;o++)t=(l=e.eq(o)).data("type"),"refresh"==(i=l.data("preview")).type&&this._initFieldRefreshPreview(l),"text"==i.type&&this._initFieldTextPreview(l),"css"==i.type&&this._initFieldCSSPreview(l),"widget"==i.type&&this._initFieldWidgetPreview(l),"font"==i.type&&this._initFieldFontPreview(l),"attribute"==i.type&&this._initFieldAttributePreview(l),"animation"==i.type&&this._initFieldAnimationPreview(i,l),"callback"==i.type&&this._initFieldCallbackPreview(i,l,t,e),this._initFieldUnitSelect(l)},_initFieldCallbackPreview:function(e,t,i,l){var o,n=e.callback,s=h(".fl-builder-settings:visible"),r=s.data("node"),a=h(".fl-builder-content .fl-node-"+r);if(void 0!==FLBuilderPreviewCallbacks[n]?o=FLBuilderPreviewCallbacks[n]:void 0!==window[n]&&(o=window[n]),"function"==typeof o){var d={field:t,fields:l,type:i,preview:e,form:s,nodeID:r,node:a};switch(i){case"align":case"button-group":case"text":case"multiple-photos":case"video":case"icon":case"ordering":d.input=t.find("input"),d.getValue=function(){return d.input.val()};break;case"color":d.input=t.find("input.fl-color-picker-value"),d.getValues=function(){var e=d.input.val();FLBuilderPreview.formatColor(e)};break;case"textarea":case"code":d.textarea=t.find("textarea"),d.getValue=function(){return d.textarea.val()};break;case"select":case"photo-sizes":case"post-type":d.select=t.find("select"),d.getValue=function(){return d.select.val()};break;case"photo":d.input=t.find("input[type=hidden]"),d.sizeSelect=t.find("select"),d.getValues=function(){return{value:d.input.val(),size:d.sizeSelect.val()}};break;case"unit":d.input=t.find("input[type=number]"),d.unitSelect=t.find(".fl-field-unit-select"),d.getValues=function(){var e=d.input.val(),t=d.unitSelect.val();return{value:e,unit:t,formattedValue:e+t}};break;case"dimension":d.inputs=t.find("input[type=number]"),d.unitSelect=t.find(".fl-field-unit-select"),d.getValues=function(){var l={inputs:[],props:{},unit:d.unitSelect.val()};return d.inputs.each(function(e,t){var i=(t=h(t)).val(),t=t.data("unit");l.inputs.push(i),l.props[t]=i}),l};break;case"animation":d.input=t.find("input"),d.select=t.find("select"),d.getValues=function(){return{delay:d.input.val(),style:d.select.val()}};break;case"link":d.input=t.find(".fl-link-field-input-wrap input"),d.targetInput=t.find("input[name$=_target]"),d.noFollowInput=t.find("input[name$=_nofollow]"),d.getValues=function(){return{url:d.input.val(),target:d.targetInput.val(),noFollow:d.noFollowInput.val()}};break;case"shadow":d.colorInput=t.find("input.fl-color-picker-value"),d.inputs=t.find("input[type=number]"),d.getValues=function(){d.colorInput.val(),d.inputs[0].val(),d.inputs[1].val(),d.inputs[2].val(),d.inputs[3].val()};break;case"gradient":d.inputs=t.find("input"),d.select=t.find("select"),d.gradientInputs={},d.gradientInputs.type=t.find('select[name$="[type]"]'),d.gradientInputs.angle=t.find('input[name$="[angle]"]'),d.gradientInputs.position=t.find('select[name$="[position]"]'),d.gradientInputs.stops=[],t.find(".fl-gradient-picker-colors .fl-gradient-picker-color-row").each(function(e,t){t=h(t),d.gradientInputs.stops.push({color:t.find(".fl-gradient-picker-color input"),stop:t.find(".fl-gradient-picker-stop input")})}),d.getValues=function(){var e,t={type:d.gradientInputs.type.val(),angle:d.gradientInputs.angle.val(),position:d.gradientInputs.position.val(),stops:[]};for(e in d.gradientInputs.stops){var i=d.gradientInputs.stops[e];t.stops[e]={color:i.color.val(),stop:i.stop.val()}}return t};break;case"shape-transform":d.inputs=t.find("input"),d.getValues=function(){return{scaleXSign:d.inputs.eq(0).val(),scaleYSign:d.inputs.eq(1).val(),skewX:d.inputs.eq(2).val(),skewY:d.inputs.eq(3).val(),scaleX:d.inputs.eq(4).val(),rotate:d.inputs.eq(5).val(),scaleY:d.inputs.eq(6).val()}};break;default:d.input=t.find("input"),d.getValue=function(){return d.input.val()}}var u,n=t.find(".fl-field-responsive-toggle"),c=(d.responsiveToggle=!!n.length&&n,o=o.bind(this,d),{input:"change keyup input",inputs:"change keyup input",targetInput:"change keyup input",noFollowInput:"change keyup input",colorInput:"change input",textarea:"change keyup input",select:"change",sizeSelect:"change",unitSelect:"change"});for(u in c)void 0!==d[u]&&d[u].on(c[u],o)}},_initFieldRefreshPreview:function(e){var t=e.data("type"),i=e.data("preview"),l=h.proxy(this.delayPreview,this);switch(t){case"align":e.find("input").on("change",l);break;case"text":e.find("input[type=text]").on("keyup",l);break;case"textarea":e.find("textarea").on("keyup",l);break;case"select":e.find("select").on("change",l);break;case"color":e.find(".fl-color-picker-value").on("change",l);break;case"photo":e.find("select").on("change",l);break;case"multiple-photos":e.find("input").on("change",l);break;case"photo-sizes":e.find("select").on("change",l);break;case"video":case"multiple-audios":case"icon":e.find("input").on("change",l);break;case"form":e.on("change","input",l);break;case"editor":this._addTextEditorCallback(e,i);break;case"code":e.find("textarea").on("change",l);break;case"post-type":e.find("select").on("change",l);break;case"suggest":e.find(".as-values").on("change",l),e.find("select").on("change",l);break;case"unit":case"dimension":e.find("input[type=number]").on("input",l);break;case"ordering":e.find("input[type=hidden]").on("change",l);break;default:e.on("change",l)}},_initFieldTextPreview:function(e){var t=e.data("type"),i=e.data("preview"),l=h.proxy(this._previewText,this,i);switch(t){case"text":e.find("input[type=text]").on("keyup",l);break;case"unit":e.find("input[type=number]").on("keyup",l);break;case"textarea":e.find("textarea").on("keyup",l);break;case"code":e.find("textarea").on("change",l);break;case"editor":this._addTextEditorCallback(e,i)}},_previewText:function(e,t){var e=this._getPreviewSelector(this.classes.node,e.selector),e=h(e),i=h("<div>"+h(t.target).val()+"</div>");0<e.length?(i.find("script").remove(),e.html(i.html())):this.delayPreview(t)},_previewTextEditor:function(e,t,i){var e=this._getPreviewSelector(this.classes.node,e.selector),e=h(e),l="undefined"!=typeof tinyMCE?tinyMCE.get(t):null,t=h("#"+t),o="";0<e.length&&((o=l&&"none"==t.css("display")?h("<div>"+l.getContent()+"</div>"):"undefined"==typeof switchEditors||void 0===switchEditors.wpautop?h("<div>"+t.val()+"</div>"):h("<div>"+switchEditors.wpautop(t.val())+"</div>")).find("script").remove(),e.html(o.html()))},_addTextEditorCallback:function(e,t){var e=e.find("textarea.wp-editor-area").attr("id"),i=null;if("refresh"==t.type)i=h.proxy(this.delayPreview,this);else{if("text"!=t.type)return;i=h.proxy(this._previewTextEditor,this,t,e)}h("#"+e).on("keyup",i),"undefined"!=typeof tinyMCE&&((editor=tinyMCE.get(e)).on("change",i),editor.on("keyup",i))},_initFieldFontPreview:function(e){var t=e.data("type"),i=e.data("preview"),i=(i.id=e.attr("id"),h.proxy(this._previewFont,this,i));"font"==t&&e.find(".fl-font-field").on("change","select",i)},_previewFont:function(e,t){var t=h(t.delegateTarget),i=t.find(".fl-font-field-font"),l=h(i).find(":selected").parent().attr("label"),t=t.find(".fl-font-field-weight"),o=e.id+"-"+this.nodeId,n=this._getPreviewSelector(this.classes.node,e.selector),e=e.important?" !important":"",s="";"Google"!=l&&"Recently Used"!=l||this._buildFontStylesheet(o,i.val(),t.val()),s=i.val(),new RegExp("[0-9]").test(i.val())&&(s='"'+i.val()+'"'),this.updateCSSRule(n,"font-family","Default"===i.val()?"":s+e),this.updateCSSRule(n,"font-weight","default"===t.val()?"":t.val()+e)},_buildFontStylesheet:function(e,t,i){var l=FLBuilderConfig.googleFontsUrl,o="",n={},s={};n[t]=[i],FLBuilderPreview._fontsList[e]=n,Object.keys(FLBuilderPreview._fontsList).forEach(function(e){var i=FLBuilderPreview._fontsList[e];Object.keys(i).forEach(function(t){var e=i[t];s[t]=s[t]||[],e=e.filter(function(e){return s[t].indexOf(e)<0}),s[t]=s[t].concat(e)})}),h.each(s,function(e,t){o+="Molle"===e?e+":i|":e+":"+t.join()+"|"}),o=l+o.slice(0,-1).replace(" ","+"),h("#fl-builder-google-fonts-preview").length<1?h("<link>").attr("id","fl-builder-google-fonts-preview").attr("type","text/css").attr("rel","stylesheet").attr("href",o).appendTo("head"):h("#fl-builder-google-fonts-preview").attr("href",o)},_initFieldCSSPreview:function(e){var t=e.data("preview"),i=null;if(void 0!==t.rules)for(i in t.rules)this._initFieldCSSPreviewCallback(e,t.rules[i]);else this._initFieldCSSPreviewCallback(e,t)},_initFieldCSSPreviewCallback:function(e,t){switch(e.data("type")){case"align":e.find("input").on("change",h.proxy(this._previewCSS,this,t,e));break;case"border":e.find("select").on("change",h.proxy(this._previewBorderCSS,this,t,e)),e.find("input[type=number]").on("input",h.proxy(this._previewBorderCSS,this,t,e)),e.find("input[type=hidden]").on("change",h.proxy(this._previewBorderCSS,this,t,e));break;case"color":e.find(".fl-color-picker-value").on("change",h.proxy(this._previewColorCSS,this,t,e));break;case"dimension":e.find("input[type=number]").on("input",h.proxy(this._previewDimensionCSS,this,t,e));break;case"gradient":e.find("select").on("change",h.proxy(this._previewGradientCSS,this,t,e)),e.find(".fl-gradient-picker-angle").on("input",h.proxy(this._previewGradientCSS,this,t,e)),e.find(".fl-color-picker-value").on("change",h.proxy(this._previewGradientCSS,this,t,e)),e.find(".fl-gradient-picker-stop").on("input",h.proxy(this._previewGradientCSS,this,t,e));break;case"photo":case"select":e.find("select").on("change",h.proxy(this._previewCSS,this,t,e));break;case"shadow":e.find("input").on("input",h.proxy(this._previewShadowCSS,this,t,e)),e.find(".fl-color-picker-value").on("change",h.proxy(this._previewShadowCSS,this,t,e));break;case"text":e.find("input[type=text]").on("keyup",h.proxy(this._previewCSS,this,t,e));break;case"typography":e.find("select").on("change",h.proxy(this._previewTypographyCSS,this,t,e)),e.find("input[type=number]").on("input",h.proxy(this._previewTypographyCSS,this,t,e)),e.find("input[type=hidden]").on("change",h.proxy(this._previewTypographyCSS,this,t,e));break;case"unit":e.find("input[type=number]").on("input",h.proxy(this._previewCSS,this,t,e))}},_previewCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=e.property,t=this._getPreviewCSSUnit(e,t,i),i=h(i.target),n=i.val(),i=!!i.closest(".fl-field-responsive-setting").length,e=e.important&&""!==n?" !important":"";-1<o.indexOf("image")&&n?n="url("+n+")":"%"===t&&"opacity"===o?n=parseInt(n)/100:""!==n&&(n+=t),this.updateCSSRule(l,o,n+e,i)},_previewBorderCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=h(i.target),t=o.closest(".fl-field"),n=o.closest(".fl-compound-field-setting"),s=n.data("property"),r=o.val(),o=(n.find(".fl-field-unit-select"),!!o.closest(".fl-field-responsive-setting").length),a=e.important&&""!==r?" !important":"";"border-color"===(e.property=s)?this._previewColorCSS(e,t,i):"border-width"===s||"border-radius"===s?this._previewDimensionCSS(e,t,i):"box-shadow"===s?this._previewShadowCSS(e,n,i):("border-style"===s&&t.find(".fl-border-field-width input:visible").trigger("input"),this.updateCSSRule(l,s,r+a,o))},_previewColorCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),i=h(i.target),o=i.val(),i=!!i.closest(".fl-field-responsive-setting").length,n=e.important&&""!==o?" !important":"";""!==o&&o.indexOf("rgb")<0&&(o="#"+o),this.updateCSSRule(l,e.property,o+n,i)},_previewDimensionCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=e.property,n=t.attr("id").replace("fl-field-",""),s=h(i.target).data("unit"),i=this._getDimensionValue(e,t,s,i),t=!!t.find(".fl-field-responsive-setting").length,e=e.important&&""!==i?" !important":"",o="border-radius"===o?"border-"+s.replace("_","-")+"-radius":"border-width"===o?"border-"+s+"-width":o+"-"+s;this.updateCSSRule(l,o,i+e,t),"margin"!==n&&"padding"!==n&&"border"!==n||this.elements.node.find(".fl-bg-slideshow").length&&FLBuilder._resizeLayout()},_getDimensionValue:function(e,t,i,l){var o=h(l.target).val();return null===(o=o.toLowerCase().replace(/[^a-z0-9%.\-]/g,""))||""===o||isNaN(o)||(e=this._getPreviewCSSUnit(e,t,l),o=parseFloat(o)+(e||"px")),o},_getPreviewCSSUnit:function(e,t,i){var i=h(i.target),l=(FLBuilderResponsiveEditing._mode,!!i.closest(".fl-compound-field-setting").length),o=!!i.closest(".fl-field-responsive-setting").length,n=null;return(n=(l?i.closest(".fl-compound-field-setting"):o?i.closest(".fl-field-responsive-setting"):t).find(".fl-field-unit-select"))&&n.length?"SELECT"===n.prop("tagName")?n.val():n.text():e.unit||""},_initFieldUnitSelect:function(e){e.find(".fl-field-unit-select").on("change",function(){var e=h(this),t=e.closest(".fl-field-responsive-setting"),e=e.closest(".fl-field");(t.length?t:e).find("input").trigger("input")})},_previewGradientCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=t.find(".fl-gradient-picker-type-select").val(),n=t.find(".fl-gradient-picker-angle").val(),s=t.find(".fl-gradient-picker-position").val(),r=t.find(".fl-color-picker-value"),a=t.find(".fl-gradient-picker-stop input"),d=[],t="";r.each(function(e){var t=h(this).val(),e=a.eq(e).val();(t=""===t?"rgba(255,255,255,0)":t).indexOf("rgb")<0&&(t="#"+t),isNaN(e)&&(e=0),d.push(t+" "+e+"%")}),d=d.join(", "),t="linear"===o?"linear-gradient("+(n=isNaN(n)?0:n)+"deg, "+d+")":"radial-gradient(at "+s+", "+d+")",r=e.important&&""!==t?" !important":"",this.updateCSSRule(l,e.property,t+r)},_previewShadowCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=t.find(".fl-shadow-field-color input").val(),n=t.find(".fl-shadow-field-horizontal input").val(),s=t.find(".fl-shadow-field-vertical input").val(),r=t.find(".fl-shadow-field-blur input").val(),a=t.find(".fl-shadow-field-spread input").val(),t=!!t.find(".fl-shadow-field-spread input").length,i=!!h(i.target).closest(".fl-field-responsive-setting").length,d="",u="";""!==o&&(""===a&&(a=0),d=(d=(n=""===n?0:n)+"px ")+(s=""===s?0:s)+"px "+(r=""===r?0:r)+"px ",t&&(d+=a+"px "),d=d+(o=o.indexOf("rgb")<0?"#"+o:o)+u),u=e.important&&""!==d?" !important":"",this.updateCSSRule(l,e.property,d,i)},_previewTypographyCSS:function(e,t,i){var l=this._getPreviewSelector(this.classes.node,e.selector),o=h(i.target),t=o.closest(".fl-field"),n=o.closest(".fl-compound-field-setting"),s=n.data("property"),r=o.val(),a=n.find(".fl-field-unit-select"),o=!!o.closest(".fl-field-responsive-setting").length,d=e.important&&""!==r?" !important":"";"font-family"===s?(e.id=t.attr("id"),this._previewFont(e,{delegateTarget:n})):"text-shadow"===s?(e.property="text-shadow",this._previewShadowCSS(e,n,i)):(a.length&&""!==r&&("vw"===a.val()?r="calc("+FLBuilderConfig.global.responsive_base_fontsize+"px + "+r+"vw)":r+="SELECT"===a.prop("tagName")?a.val():"px"),this.updateCSSRule(l,s,r+d,o))},_initFieldAttributePreview:function(e){var t=e.data("preview"),i=t.attribute,l=e.find("input"),e=(e.val(),window[t.format_callback]),t=this._getPreviewSelector(this.classes.node,t.selector),t=h(t),t=this._previewAttribute.bind(this,l,t,i,e);l.on("change",t),l.on("keyup",t),l.on("input",t)},_previewAttribute:function(e,t,l,o){var n=e.val();for("function"==typeof o&&(n=o(n)),i=0;i<t.length;i++)t[i].setAttribute(l,n)},_initFieldWidgetPreview:function(e){var t=h.proxy(this.delayPreview,this);e.find("input").on("keyup",t),e.find("input[type=checkbox]").on("click",t),e.find("textarea").on("keyup",t),e.find("select").on("change",t)},_initFieldAnimationPreview:function(e,t){t.find(".fl-animation-field-style select").on("change",h.proxy(this._previewAnimationField,this,e,t)),t.find(".fl-animation-field-duration input").on("input",h.proxy(this._previewAnimationField,this,e,t))},_previewAnimationField:function(e,t,i){var e=this._getPreviewSelector(this.classes.node,e.selector),l=h(e),e=t.find(".fl-animation-field-style select"),t=t.find(".fl-animation-field-duration input"),o=e[0].options;l.removeClass("fl-animated"),l.removeClass("fl-animation"),l.css("animation-duration","");for(var n=0;n<o.length;n++)l.removeClass("fl-"+o[n].value);""!==e.val()&&(l.addClass("fl-animation"),l.addClass("fl-"+e.val()),l.data("animation-delay",0),l.data("animation-duration",t.val())),FLBuilderLayout._doModuleAnimation.apply(l)},_getPreviewSelector:function(e,t){return FLBuilderPreview.getFormattedSelector.call(this,e,t)},toUpperCaseWords:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}},FLBuilderPreview.formatColor=function(e){return e=""!==e&&e.indexOf("rgb")<0&&e.indexOf("url")<0?"#"+e:e},FLBuilderPreviewCallbacks={previewShape:function(e,t){var i=e.preview.position,l=e.preview.prefix,e=e.form;yOrientation=e.find('input[name="'+(l+"transform[][scaleYSign]")+'"]'),"bottom"===i?yOrientation.val("invert"):yOrientation.val(""),yOrientation.trigger("change"),this.delayPreview()},previewShapeLayerSize:function(e,t){var i,l=e.getValues(),o=l.unit,n=l.props.width,s=l.props.height,l=l.props.top,r=e.preview.prefix,a=e.preview.position,d=this._getPreviewSelector(this.classes.node,".fl-builder-"+a+"-edge-layer"),u=d+" > *",c=e.form.find('[name="'+r+'align"]').val().split(" "),h=c[0],c=c[1],e=e.form.find('[name="'+r+'shape"]').val(),r=FLBuilderConfig.presets.shape[e];if(shapeProps={width:"100%",left:"auto",right:"auto",height:"auto",top:"auto",bottom:"auto"},n){shapeProps.width=n+o;var f=n/2+o;switch(c){case"left":shapeProps.left="0",shapeProps.right="auto";break;case"right":shapeProps.left="auto",shapeProps.right="0";break;case"center":shapeProps.left="calc( 50% - "+f+")",shapeProps.right="auto"}}switch(this.updateCSSRule(u,"width",shapeProps.width),this.updateCSSRule(u,"left",shapeProps.left),this.updateCSSRule(u,"right",shapeProps.right),i=s?s/2+o:n?n/r.data.viewBox.width*100/2+o:"",s&&(shapeProps.height=s+o),h){case"top":shapeProps.top="0",shapeProps.bottom="auto";break;case"bottom":shapeProps.top="auto",shapeProps.bottom="0";break;case"center":shapeProps.top="calc( 50% - "+i+")",shapeProps.bottom="auto"}this.updateCSSRule(u,"height",shapeProps.height+" !important"),this.updateCSSRule(u,"top",shapeProps.top),this.updateCSSRule(u,"bottom",shapeProps.bottom),""===l?this.updateCSSRule(d,a,"0"):this.updateCSSRule(d,a,l+o)},previewShapeAlign:function(e,t){var i=e.preview.prefix;e.form.find('[name="'+i+'size_width"]').trigger("input")},previewShapeFillStyle:function(e,t){var i=e.input.val(),l=e.preview,o=e.preview.prefix,n="fl-row-"+e.nodeID+"-"+o+"-linear-gradient",s="fl-row-"+e.nodeID+"-"+o+"-radial-gradient",r="fl-row-"+e.nodeID+"-"+o+"-pattern",a=e.form;if(void 0!==i){var d=this._getPreviewSelector(this.classes.node,l.selector);switch(i){case"color":var u=a.find("[name="+o+"fill_color]").val();this.updateCSSRule(d,"fill",FLBuilderPreview.formatColor(u));break;case"gradient":u=a.find("#fl-field-"+o+"fill_gradient").find('select[name$="[type]"]').val();this.updateCSSRule(d,"fill","url(#"+("radial"===u?s:n)+")");break;case"pattern":this.updateCSSRule(d,"fill","url(#"+r+")")}}},previewShapeGradientFill:function(e,t){var i,l=e.getValues(),o=e.node,e=".fl-builder-"+e.preview.position+"-edge-layer",o=o.find(e+" "+l.type+"Gradient"),n="url(#"+o.attr("id")+")",e=this._getPreviewSelector(this.classes.node,e+" .fl-shape"),s=(this.updateCSSRule(e,"fill",n),o.find("stop"));for(i in l.stops){var r,a=l.stops[i],d=s.eq(i),u=a.color,a=a.stop,c=1;0===u.indexOf("rgba")&&(c=(r=u.substring(u.indexOf("(")+1,u.lastIndexOf(")")).split(/,\s*/)).pop(),u="rgb("+r.join(",")+")"),d.attr("stop-color",FLBuilderPreview.formatColor(u)),d.attr("stop-opacity",c),d.attr("offset",a+"%")}if("linear"===l.type&&void 0!==o[0]&&o[0].setAttribute("gradientTransform","rotate("+l.angle+" .5 .5 )"),"radial"===l.type){var h,f,e=(parts=l.position.split(" "))[0],n=parts[1];switch(e){case"top":case"left":h=0;break;case"center":h=.5;break;case"bottom":case"right":h=1}switch(n){case"top":case"left":f=0;break;case"center":f=.5;break;case"bottom":case"right":f=1}(e=.5)===h&&.5===f||(e=1),o.attr("cx",h),o.attr("cy",f),o.attr("r",e)}},previewShapeTransform:function(e,t){e.form;var i=e.preview,i=(i.prefix,this._getPreviewSelector(this.classes.node,i.selector)+" > *"),l=e.getValues(),o=[];Object.keys(l).map(function(e){var t=l[e],i="";switch(e){case"scaleXSign":case"scaleYSign":return;case"scaleX":case"scaleY":t&&""!==t&&0!==t||(t="1"),t="invert"===("scaleX"===e?l.scaleXSign:l.scaleYSign)?-Math.abs(t):Math.abs(t),o.push(e+"("+t+")");break;case"translateX":case"translateY":t&&o.push(e+"("+t+(i="px")+")");break;case"skewX":case"skewY":t&&o.push(e+"("+t+(i="deg")+")");break;case"rotate":i="deg",""!==t&&"0"!==t&&o.push("rotate("+t+i+")")}}),this.updateCSSRule(i,"transform",o.join(" "))}}}(jQuery),!function(u){var i={ignored:[],reparsed:[],width:null,callback:null,sheets:{},styles:[],queue:[],emPxValue:null,regex:{media:/@media[^{]*{([\s\S]+?})\s*}/gi,empty:/@media[^{]*{([^{}]*?)}/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)\}$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},ignore:function(e){Array.prototype.push.apply(this.ignored,e)},reparse:function(e){Array.prototype.push.apply(this.reparsed,e)},update:function(e,t){this.width=void 0===e?null:e,this.callback=void 0===t?null:t,l.update(),this.queueSheets()?this.runQueue():this.applyStyles()},queueSheets:function(){for(var e,t,i,l=null,o=null,n=null,s=!1,r=0,a=0;r<document.styleSheets.length;r++)if(l=(element=document.styleSheets[r].ownerNode).href,e=element.id,t=element.tagName.toLowerCase(),o=element.rel,i=element.media,n=l?l.split("?").shift():e||"style-"+r,s=!1,"style"===t||l&&o&&"stylesheet"===o.toLowerCase()){for(a=0;a<this.ignored.length;a++)if(-1<n.indexOf(this.ignored[a])){s=!0;break}if(!s){for(a=0;a<this.reparsed.length;a++)if(-1<n.indexOf(this.reparsed[a])){this.sheets[n]=null;break}void 0!==this.sheets[n]&&this.sheets[n]||this.queue.push({docSheet:document.styleSheets[r],element:u(element),key:n,tagName:t,href:l,id:e,media:i})}}return this.queue.length},runQueue:function(){var t;this.queue.length?"style"===(t=this.queue.shift()).tagName?(this.parse(t.element.html(),t),this.runQueue()):u.get(t.href,u.proxy(function(e){this.parse(e,t),this.runQueue()},this)).fail(this.runQueue.bind(this)):this.applyStyles()},parse:function(e,t){var i,l=this.regex,o=this.cleanStyles(e),n=o.match(l.media),s=n&&n.length||0,r=!s&&t.media,a=null,e="",d=0,u=0;for(n?e=o.replace(l.media,""):r&&"all"!=t.media?s=1:e=o,this.sheets[t.key]={docSheet:t.docSheet,element:t.element,key:t.key,tagName:t.tagName,href:t.href,id:t.id,all:e,queries:[]},d=0;d<s;d++)for(o=r?(a=t.media,this.convertURLs(o,t.href)):(a=n[d].match(l.findStyles)&&RegExp.$1,RegExp.$2&&this.convertURLs(RegExp.$2,t.href)),i=a.split(","),u=0;u<i.length;u++)"print"==((a=i[u]).split("(")[0].match(l.only)&&RegExp.$2)||a.replace(l.minmaxwh,"").match(l.other)||this.sheets[t.key].queries.push({minw:a.match(l.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:a.match(l.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),styles:o})},applyStyles:function(){var e=u("head"),t={all:"",queries:[]},i=null,l=null,o=null,n=null,s=null,r=null,a=null,d=!1;for(o in this.clearStyles(),this.sheets)if((l=this.sheets[o]).queries.length&&this.width){for(t.all+=l.all,s=0;s<l.queries.length;s++)r=(n=l.queries[s]).minw,a=n.maxw,d=!1,r&&(r=parseFloat(r)*(-1<r.indexOf("em")?this.getEmPxValue():1),this.width>=r&&(t.queries.push({media:"min",width:r,styles:n.styles}),d=!0)),a&&!d&&(a=parseFloat(a)*(-1<a.indexOf("em")?this.getEmPxValue():1),this.width<=a&&t.queries.push({media:"max",width:a,styles:n.styles}));l.docSheet.disabled=!0}for(""!==t.all&&(i=u('<style class="fl-builder-media-query" data-query="all"></style>'),this.styles.push(i),e.append(i),i.html(t.all)),s=0;s<t.queries.length;s++)n=t.queries[s],i=u('<style class="fl-builder-media-query" data-query="'+n.media+'" data-value="'+n.width+'"></style>'),this.styles.push(i),e.append(i),i.html(n.styles);this.callback&&(this.callback(),this.callback=null)},clearStyles:function(){var e=null,t=this.styles.slice(0);for(e in this.styles=[],this.sheets)this.sheets[e].docSheet.disabled=!1;for(var i=0;i<t.length;i++)t[i].empty(),t[i].remove()},disableStyles:function(e){for(var t,i,l=0;l<this.styles.length;l++)t=(i=this.styles[l]).attr("data-query"),i=parseInt(i.attr("data-value")),"max"===t&&!isNaN(i)&&i<=e&&(this.styles[l][0].sheet.disabled=!0)},enableStyles:function(){for(var e=0;e<this.styles.length;e++)this.styles[e][0].sheet.disabled=!1,this.styles[e][0].sheet.disabled=!0,this.styles[e][0].sheet.disabled=!1},cleanStyles:function(e){var t=this.regex;return e.replace(t.comments,"").replace(t.keyframes,"").replace(t.empty,"")},convertURLs:function(e,t){return t?((t=t.substring(0,t.lastIndexOf("/"))).length&&(t+="/"),e.replace(this.regex.urls,"$1"+t+"$2$3")):e},getEmPxValue:function(){if(this.emPxValue)return this.emPxValue;var e=window.document,t=e.documentElement,i=e.body,l=e.createElement("div"),o=t.style.fontSize,n=i&&i.style.fontSize,s=!1;return l.style.cssText="position:absolute;font-size:1em;width:1em",i||((i=s=e.createElement("body")).style.background="none"),t.style.fontSize="100%",i.style.fontSize="100%",i.appendChild(l),s&&t.insertBefore(i,t.firstChild),e=parseFloat(l.offsetWidth),s?t.removeChild(i):i.removeChild(l),t.style.fontSize=o,i.style.fontSize=n||"",this.emPxValue=e}},l={_functions:null,update:function(){if(!this._functions)for(var e in this._functions={},t)this._functions[e]=jQuery.fn[e];if(i.width)for(e in t)jQuery.fn[e]=t[e];else for(e in this._functions)jQuery.fn[e]=this._functions[e]}},t={width:function(e){return null!=e?l._functions.width.call(this,e):u.isWindow(this[0])?i.width:l._functions.width.call(this)}};FLBuilderSimulateMediaQuery={ignore:function(e){i.ignore(e)},reparse:function(e){i.reparse(e)},update:function(e,t){i.update(e,t)},disableStyles:function(e){i.disableStyles(e)},enableStyles:function(){i.enableStyles()}}}(jQuery),!function(d){FLBuilderResponsiveEditing={_mode:"default",refreshPreview:function(e){var t;d(".fl-responsive-preview").length&&"default"!==this._mode?("responsive"==this._mode?(t=320<=FLBuilderConfig.global.responsive_breakpoint?320:FLBuilderConfig.global.responsive_breakpoint,FLBuilderSimulateMediaQuery.update(t,e)):"medium"==this._mode&&(t=769<=FLBuilderConfig.global.medium_breakpoint?769:FLBuilderConfig.global.medium_breakpoint,FLBuilderSimulateMediaQuery.update(t,e)),FLBuilder._resizeLayout()):e&&e()},_init:function(){this._bind(),this._initMediaQueries()},_bind:function(){FLBuilder.addHook("endEditingSession",this._clearPreview),FLBuilder.addHook("didEnterRevisionPreview",this._clearPreview),FLBuilder.addHook("responsiveEditing",this._menuToggleClicked),FLBuilder.addHook("preview-init",this._switchAllSettingsToCurrentMode),FLBuilder.addHook("responsive-editing-switched",this._showSize),d("body").on("click",".fl-field-responsive-toggle",this._settingToggleClicked),d("body").on("click",".fl-responsive-preview-message button",this._previewToggleClicked)},_initMediaQueries:function(){FLBuilderSimulateMediaQuery.ignore([FLBuilderConfig.pluginUrl,FLBuilderConfig.relativePluginUrl]),ignorelist=d.map(FLBuilderConfig.responsiveIgnore,function(e,t){return[e]}),FLBuilderSimulateMediaQuery.ignore(ignorelist),FLBuilderSimulateMediaQuery.reparse([FLBuilderConfig.postId+"-layout-draft.css",FLBuilderConfig.postId+"-layout-draft-partial.css",FLBuilderConfig.postId+"-layout-preview.css",FLBuilderConfig.postId+"-layout-preview-partial.css",FLBuilderConfig.postId+"-inline-css","fl-builder-global-css","fl-builder-layout-css"])},_showSize:function(){var e=d(".fl-responsive-preview-message .size"),t="1"===FLBuilderConfig.global.responsive_preview?FLBuilderConfig.global.medium_breakpoint:769,i="1"===FLBuilderConfig.global.responsive_preview?FLBuilderConfig.global.responsive_breakpoint:360,l="";d(".fl-responsive-preview").hasClass("fl-preview-responsive")?l=FLBuilderStrings.mobile+" "+i+"px":d(".fl-responsive-preview").hasClass("fl-preview-medium")&&(l=FLBuilderStrings.medium+" "+t+"px"),e.html("").html(l)},_switchTo:function(e,t){var i=d("html"),l=d("body"),o=d(FLBuilder._contentClass),n=d(".fl-responsive-preview"),s=d(".fl-responsive-preview-mask"),r=d(".fl-content-placeholder"),a=null;if("default"==(FLBuilderResponsiveEditing._mode=e)){if(0===r.length)return;i.removeClass("fl-responsive-preview-enabled"),r.after(o),r.remove(),n.remove(),s.remove()}else 0===n.length?(i.addClass("fl-responsive-preview-enabled"),o.after('<div class="fl-content-placeholder"></div>'),l.prepend(wp.template("fl-responsive-preview")()),d(".fl-responsive-preview").addClass("fl-preview-"+e),d(".fl-responsive-preview-content").append(o)):(n.removeClass("fl-preview-responsive fl-preview-medium"),n.addClass("fl-preview-"+e));"responsive"==e?(a="1"!==FLBuilderConfig.global.responsive_preview&&360<=FLBuilderConfig.global.responsive_breakpoint?360:FLBuilderConfig.global.responsive_breakpoint,o.width(a),FLBuilderSimulateMediaQuery.update(a,t),FLBuilderResponsiveEditing._setMarginPaddingPlaceholders()):"medium"==e?(a="1"!==FLBuilderConfig.global.responsive_preview&&769<=FLBuilderConfig.global.medium_breakpoint?769:FLBuilderConfig.global.medium_breakpoint,o.width(a),FLBuilderSimulateMediaQuery.update(a,t),FLBuilderResponsiveEditing._setMarginPaddingPlaceholders()):(o.width(""),FLBuilderSimulateMediaQuery.update(null,t)),this._setContentBackgroundColor(),FLBuilder._resizeLayout(),this._previewFields(),FLBuilder.triggerHook("responsive-editing-switched",e)},_setContentBackgroundColor:function(){var e=d(FLBuilder._contentClass),t=d(".fl-responsive-preview"),i=d(".fl-content-placeholder").parents(),l="#fff",o=0;if(0===t.length)e.css("background-color","");else{for(;o<i.length&&"rgba(0, 0, 0, 0)"==(l=i.eq(o).css("background-color"));o++);e.css("background-color",l)}},_switchToAndScroll:function(i){var e=d(".fl-builder-settings").data("node"),t=void 0===e?void 0:d(".fl-node-"+e);FLBuilderResponsiveEditing._switchTo(i,function(){var e;void 0!==t&&t&&(d(window),(e=d(".fl-responsive-preview-content")).length?(e.scrollTop(0),e.scrollTop(t.offset().top-150)):d("html, body").scrollTop(t.offset().top-100)),d(".fl-row-bg-parallax").each(function(){var e=d(this),t=e.find("> .fl-row-content-wrap"),e={default:e.data("parallax-image"),medium:e.data("parallax-image-medium"),responsive:e.data("parallax-image-responsive")};void 0!==e[i]&&t.css("background-image","url("+e[i]+")")})})},_switchAllSettingsTo:function(e){var t="dashicons-desktop dashicons-tablet dashicons-smartphone";d(".fl-field-responsive-toggle").removeClass(t),d(".fl-field-responsive-setting").hide(),t="default"==e?"dashicons-desktop":"medium"==e?"dashicons-tablet":"dashicons-smartphone",d(".fl-field-responsive-toggle").addClass(t).data("mode",e),d(".fl-field-responsive-setting-"+e).css("display","inline-block")},_switchAllSettingsToCurrentMode:function(){var e=FLBuilderResponsiveEditing;e._switchAllSettingsTo(e._mode),FLBuilder.triggerHook("responsive-editing-switched",e._mode)},_setMarginPaddingPlaceholders:function(){var e="#fl-field-padding .fl-field-responsive-setting-default",e={values:{top:d(e+' input[ name="padding_top" ]').val(),right:d(e+' input[ name="padding_right" ]').val(),bottom:d(e+' input[ name="padding_bottom" ]').val(),left:d(e+' input[ name="padding_left" ]').val()},placeholders:{top:d(e+' input[ name="padding_top" ]').attr("placeholder"),right:d(e+' input[ name="padding_right" ]').attr("placeholder"),bottom:d(e+' input[ name="padding_bottom" ]').attr("placeholder"),left:d(e+' input[ name="padding_left" ]').attr("placeholder")}},t="#fl-field-padding .fl-field-responsive-setting-medium",i={values:{top:d(t+' input[ name="padding_top_medium" ]').val(),right:d(t+' input[ name="padding_right_medium" ]').val(),bottom:d(t+' input[ name="padding_bottom_medium" ]').val(),left:d(t+' input[ name="padding_left_medium" ]').val()},placeholders:{top:"",right:"",bottom:"",left:""}},l="#fl-field-padding .fl-field-responsive-setting-responsive",o=(d(t+' input[ name="padding_top_responsive" ]').val(),d(t+' input[ name="padding_right_responsive" ]').val(),d(t+' input[ name="padding_bottom_responsive" ]').val(),d(t+' input[ name="padding_left_responsive" ]').val(),"#fl-field-margin .fl-field-responsive-setting-default"),o={values:{top:d(o+' input[ name="margin_top" ]').val(),right:d(o+' input[ name="margin_right" ]').val(),bottom:d(o+' input[ name="margin_bottom" ]').val(),left:d(o+' input[ name="margin_left" ]').val()},placeholders:{top:d(o+' input[ name="margin_top" ]').attr("placeholder"),right:d(o+' input[ name="margin_right" ]').attr("placeholder"),bottom:d(o+' input[ name="margin_bottom" ]').attr("placeholder"),left:d(o+' input[ name="margin_left" ]').attr("placeholder")}},n="#fl-field-margin .fl-field-responsive-setting-medium",s={values:{top:d(n+' input[ name="margin_top_medium" ]').val(),right:d(n+' input[ name="margin_right_medium" ]').val(),bottom:d(n+' input[ name="margin_bottom_medium" ]').val(),left:d(n+' input[ name="margin_left_medium" ]').val()},placeholders:{top:o.values.top||o.placeholders.top,right:o.values.right||o.placeholders.right,bottom:o.values.bottom||o.placeholders.bottom,left:o.values.left||o.placeholders.left}},r="#fl-field-margin .fl-field-responsive-setting-responsive";d(r+' input[ name="margin_top_responsive" ]').val(),d(r+' input[ name="margin_right_responsive" ]').val(),d(r+' input[ name="margin_bottom_responsive" ]').val(),d(r+' input[ name="margin_left_responsive" ]').val();""!=e.values.top?d(t+' input[ name="padding_top_medium"] ').attr("placeholder",e.values.top):d(t+' input[ name="padding_top_medium"] ').attr("placeholder",e.placeholders.top),""!=e.values.right?d(t+' input[ name="padding_right_medium"] ').attr("placeholder",e.values.right):d(t+' input[ name="padding_right_medium"] ').attr("placeholder",e.placeholders.right),""!=e.values.bottom?d(t+' input[ name="padding_bottom_medium"] ').attr("placeholder",e.values.bottom):d(t+' input[ name="padding_bottom_medium"] ').attr("placeholder",e.placeholders.bottom),""!=e.values.left?d(t+' input[ name="padding_left_medium"] ').attr("placeholder",e.values.left):d(t+' input[ name="padding_left_medium"] ').attr("placeholder",e.placeholders.left),""!=i.values.top?d(l+' input[ name="padding_top_responsive"] ').attr("placeholder",i.values.top):""!=e.values.top?d(l+' input[ name="padding_top_responsive"] ').attr("placeholder",e.values.top):d(l+' input[ name="padding_top_responsive"] ').attr("placeholder",e.placeholders.top),""!=i.values.right?d(l+' input[ name="padding_right_responsive"] ').attr("placeholder",i.values.right):""!=e.values.right?d(l+' input[ name="padding_right_responsive"] ').attr("placeholder",e.values.right):d(l+' input[ name="padding_right_responsive"] ').attr("placeholder",e.placeholders.right),""!=i.values.bottom?d(l+' input[ name="padding_bottom_responsive"] ').attr("placeholder",i.values.bottom):""!=e.values.bottom?d(l+' input[ name="padding_bottom_responsive"] ').attr("placeholder",e.values.bottom):d(l+' input[ name="padding_bottom_responsive"] ').attr("placeholder",e.placeholders.bottom),""!=i.values.left?d(l+' input[ name="padding_left_responsive"] ').attr("placeholder",i.values.left):""!=e.values.left?d(l+' input[ name="padding_left_responsive"] ').attr("placeholder",e.values.left):d(l+' input[ name="padding_left_responsive"] ').attr("placeholder",e.placeholders.left),""!=o.values.top?d(n+' input[ name="margin_top_medium" ]').attr("placeholder",o.values.top):d(n+' input[ name="margin_top_medium" ]').attr("placeholder",o.placeholders.top),""!=o.values.right?d(n+' input[ name="margin_right_medium" ]').attr("placeholder",o.values.right):d(n+' input[ name="margin_right_medium" ]').attr("placeholder",o.placeholders.right),""!=o.values.bottom?d(n+' input[ name="margin_bottom_medium" ]').attr("placeholder",o.values.bottom):d(n+' input[ name="margin_bottom_medium" ]').attr("placeholder",o.placeholders.bottom),""!=o.values.left?d(n+' input[ name="margin_left_medium" ]').attr("placeholder",o.values.left):d(n+' input[ name="margin_left_medium" ]').attr("placeholder",o.placeholders.left),""!=s.values.top?d(r+' input[ name="margin_top_responsive" ]').attr("placeholder",s.values.top):""!=o.values.top?d(r+' input[ name="margin_top_responsive" ]').attr("placeholder",o.values.top):d(r+' input[ name="margin_top_responsive" ]').attr("placeholder",o.placeholders.top),""!=s.values.right?d(r+' input[ name="margin_right_responsive" ]').attr("placeholder",s.values.right):""!=o.values.right?d(r+' input[ name="margin_right_responsive" ]').attr("placeholder",o.values.right):d(r+' input[ name="margin_right_responsive" ]').attr("placeholder",o.placeholders.right),""!=s.values.bottom?d(r+' input[ name="margin_bottom_responsive" ]').attr("placeholder",s.values.bottom):""!=o.values.bottom?d(r+' input[ name="margin_bottom_responsive" ]').attr("placeholder",o.values.bottom):d(r+' input[ name="margin_bottom_responsive" ]').attr("placeholder",o.placeholders.bottom),""!=s.values.left?d(r+' input[ name="margin_left_responsive" ]').attr("placeholder",s.values.left):""!=o.values.left?d(r+' input[ name="margin_left_responsive" ]').attr("placeholder",o.values.left):d(r+' input[ name="margin_left_responsive" ]').attr("placeholder",o.placeholders.left)},_settingToggleClicked:function(){var e=d(this),t="default"==(t=e.data("mode"))?"medium":"medium"==t?"responsive":"default";FLBuilderResponsiveEditing._switchAllSettingsTo(t),FLBuilderResponsiveEditing._switchToAndScroll(t),e.siblings(".fl-field-responsive-setting:visible").find("input").focus()},_menuToggleClicked:function(){var e="default"==(e=FLBuilderResponsiveEditing._mode)?"medium":"medium"==e?"responsive":"default";FLBuilder.MainMenu.hide(),FLBuilderResponsiveEditing._switchAllSettingsTo(e),FLBuilderResponsiveEditing._switchToAndScroll(e)},_previewToggleClicked:function(){var e=d(this).data("mode");FLBuilderResponsiveEditing._switchAllSettingsTo(e),FLBuilderResponsiveEditing._switchToAndScroll(e)},_clearPreview:function(){FLBuilderResponsiveEditing._switchToAndScroll("default")},_previewFields:function(){var o=FLBuilderResponsiveEditing._mode,e=d(".fl-builder-settings:visible");0!==e.length&&void 0!==e.attr("data-node")&&(FLBuilder.triggerHook("responsive-editing-before-preview-fields",o),e.find(".fl-builder-settings-tab").each(function(){var e=d(this);e.css("display","block"),e.find(".fl-field-responsive-setting-"+o+":visible").each(function(){var e=d(this),t=e.closest(".fl-field"),i=t.data("type"),l=t.data("preview"),t=t.find(".fl-field-connection-visible").length;"refresh"!=l.type&&(t?"photo"===i&&"default"!==o&&e.find(".fl-photo-remove").trigger("click"):(e.find("input").trigger("keyup"),e.find("select").trigger("change")))}),e.css("display","")}),FLBuilder.triggerHook("responsive-editing-after-preview-fields",o))}},d(function(){FLBuilderResponsiveEditing._init()})}(jQuery),!function(n){FLBuilderResponsivePreview={enter:function(){this.render()},exit:function(){this.destroy()},switchTo:function(e){var t=FLBuilderConfig.global,i=n("#fl-builder-preview-frame"),l="100%";"responsive"==e?(l="1"!==t.responsive_preview&&360<=t.responsive_breakpoint?360:t.responsive_breakpoint,i.width(l)):"medium"==e&&(l="1"!==t.responsive_preview&&769<=t.medium_breakpoint?769:t.medium_breakpoint,i.width(l)),i.width(l)},render:function(){var e=n("body"),t=FLBuilderConfig.previewUrl,i=n("#fl-builder-preview-mask, #fl-builder-preview-frame"),l=n('<div id="fl-builder-preview-mask"></div>'),t=n('<iframe id="fl-builder-preview-frame" src="'+t+'"></iframe>');i.remove(),e.append(l),e.append(t),e.css("overflow","hidden")},_showSize:function(e){var t=n(".fl-builder--preview-actions .size"),i="1"===FLBuilderConfig.global.responsive_preview?FLBuilderConfig.global.medium_breakpoint:769,l="1"===FLBuilderConfig.global.responsive_preview?FLBuilderConfig.global.responsive_breakpoint:360,o="";"responsive"===e?o=FLBuilderStrings.mobile+" "+l+"px":"medium"===e&&(o=FLBuilderStrings.medium+" "+i+"px"),t.html("").html(o)},destroy:function(){n("#fl-builder-preview-mask, #fl-builder-preview-frame").remove(),n("body").css("overflow","visible"),n(".fl-builder--preview-actions .size").html("")}}}(jQuery),!function(d){var u={init:function(){var e=d("body");e.on("change",".fl-builder-service-select",this._serviceChange),e.on("click",".fl-builder-service-connect-button",this._connectClicked),e.on("change",".fl-builder-service-account-select",this._accountChange),e.on("click",".fl-builder-service-account-delete",this._accountDeleteClicked),e.on("change",".fl-builder-campaign-monitor-client-select",this._campaignMonitorClientChange),e.on("change",".fl-builder-mailchimp-list-select",this._mailChimpListChange),e.on("change",".fl-builder-activecampaign-list_type-select",this._activeCampaignChange)},_startSettingsLoading:function(e){var t=d(".fl-builder-settings"),e=e.closest(".fl-builder-service-settings"),i=d(".fl-builder-service-error");t.append('<div class="fl-builder-loading"></div>'),e.addClass("fl-builder-service-settings-loading"),i.remove()},_finishSettingsLoading:function(){var e=d(".fl-builder-settings"),t=d(".fl-builder-service-settings-loading");e.find(".fl-builder-loading").remove(),t.removeClass("fl-builder-service-settings-loading")},_serviceChange:function(){var e=d(".fl-builder-settings").data("node"),t=d(this),i=t.closest("tr"),l=t.val();i.siblings("tr.fl-builder-service-account-row").remove(),i.siblings("tr.fl-builder-service-connect-row").remove(),i.siblings("tr.fl-builder-service-field-row").remove(),d(".fl-builder-service-error").remove(),""!==l&&(u._startSettingsLoading(t),FLBuilder.ajax({action:"render_service_settings",node_id:e,service:l},u._serviceChangeComplete))},_serviceChangeComplete:function(e){var e=FLBuilder._jsonParse(e),t=d(".fl-builder-service-settings-loading");t.find(".fl-builder-service-select-row").after(e.html),u._addAccountDelete(t),u._finishSettingsLoading()},_connectClicked:function(){for(var e,t=d(".fl-builder-settings").data("node"),i=d(this).closest(".fl-builder-service-settings"),l=i.find(".fl-builder-service-select"),o=i.find(".fl-builder-service-connect-row"),n=i.find(".fl-builder-service-connect-input"),s=null,r=0,a={action:"connect_service",node_id:t,service:l.val(),fields:{}};r<n.length;r++)e=(s=n.eq(r)).attr("name"),a.fields[e]=s.val();o.hide(),u._startSettingsLoading(l),FLBuilder.ajax(a,u._connectComplete)},_connectComplete:function(e){var e=FLBuilder._jsonParse(e),t=d(".fl-builder-service-settings-loading"),i=t.find(".fl-builder-service-select-row"),l=t.find(".fl-builder-service-select"),o=t.find(".fl-builder-service-account-row"),n=t.find(".fl-builder-service-account-select"),s=t.find(".fl-builder-service-connect-row");e.error?(s.show(),(0===n.length?l:n).after('<div class="fl-builder-service-error">'+e.error+"</div>")):(s.remove(),o.remove(),i.after(e.html)),u._addAccountDelete(t),u._finishSettingsLoading()},_accountChange:function(){var e=d(".fl-builder-settings").data("node"),t=d(this).closest(".fl-builder-service-settings"),i=t.find(".fl-builder-service-select"),l=t.find(".fl-builder-service-account-select"),o=t.find(".fl-builder-service-connect-row"),n=t.find("tr.fl-builder-service-field-row"),s=d(".fl-builder-service-error"),l=l.val(),r=null;o.remove(),n.remove(),s.remove(),"add_new_account"==l?r={action:"render_service_settings",node_id:e,service:i.val(),add_new:!0}:""!==l&&(r={action:"render_service_fields",node_id:e,service:i.val(),account:l}),r&&(u._startSettingsLoading(i),FLBuilder.ajax(r,u._accountChangeComplete)),u._addAccountDelete(t)},_accountChangeComplete:function(e){e=FLBuilder._jsonParse(e);d(".fl-builder-service-settings-loading").find(".fl-builder-service-account-row").after(e.html),u._finishSettingsLoading()},_addAccountDelete:function(e){var t=e.find(".fl-builder-service-account-select");0<t.length&&(e.find(".fl-builder-service-account-delete").remove(),""!==t.val()&&"add_new_account"!=t.val()&&t.after('<a href="javascript:void(0);" class="fl-builder-service-account-delete">'+FLBuilderStrings.deleteAccount+"</a>"))},_accountDeleteClicked:function(){var e=d(this).closest(".fl-builder-service-settings"),t=e.find(".fl-builder-service-select"),e=e.find(".fl-builder-service-account-select");confirm(FLBuilderStrings.deleteAccountWarning)&&(FLBuilder.ajax({action:"delete_service_account",service:t.val(),account:e.val()},u._accountDeleteComplete),u._startSettingsLoading(e))},_accountDeleteComplete:function(){var e=d(".fl-builder-service-settings-loading").find(".fl-builder-service-select");u._finishSettingsLoading(),e.trigger("change")},_campaignMonitorClientChange:function(){var e=d(".fl-builder-settings").data("node"),t=d(this).closest(".fl-builder-service-settings"),i=t.find(".fl-builder-service-select"),l=t.find(".fl-builder-service-account-select"),o=d(this),t=t.find(".fl-builder-service-list-select"),o=o.val();0!==t.length&&t.closest("tr").remove(),""!==o&&(u._startSettingsLoading(i),FLBuilder.ajax({action:"render_service_fields",node_id:e,service:i.val(),account:l.val(),client:o},u._campaignMonitorClientChangeComplete))},_campaignMonitorClientChangeComplete:function(e){e=FLBuilder._jsonParse(e);d(".fl-builder-service-settings-loading").find(".fl-builder-campaign-monitor-client-select").closest("tr").after(e.html),u._finishSettingsLoading()},_mailChimpListChange:function(){var e=d(".fl-builder-settings").data("node"),t=d(this).closest(".fl-builder-service-settings"),i=t.find(".fl-builder-service-select"),l=t.find(".fl-builder-service-account-select"),t=t.find(".fl-builder-service-list-select");d(".fl-builder-mailchimp-group-select").closest("tr").remove(),""!==t.val()&&(u._startSettingsLoading(i),FLBuilder.ajax({action:"render_service_fields",node_id:e,service:i.val(),account:l.val(),list_id:t.val()},u._mailChimpListChangeComplete))},_mailChimpListChangeComplete:function(e){e=FLBuilder._jsonParse(e);d(".fl-builder-service-settings-loading").find(".fl-builder-service-list-select").closest("tr").after(e.html),u._finishSettingsLoading()},_activeCampaignChange:function(){var e=d(".fl-builder-settings").data("node"),t=d(this).closest(".fl-builder-service-settings"),i=t.find(".fl-builder-service-select"),l=t.find(".fl-builder-service-account-select"),o=t.find(".fl-builder-service-list-select");list_type=t.find('select[name="list_type"]'),0!==o.length&&o.closest("tr").remove(),""!==list_type.val()&&(u._startSettingsLoading(i),FLBuilder.ajax({action:"render_service_fields",node_id:e,service:i.val(),account:l.val(),list_type:list_type.val()},u._activeCampaignTypeChangeComplete))},_activeCampaignTypeChangeComplete:function(e){e=FLBuilder._jsonParse(e);d(".fl-builder-service-settings-loading").find(".fl-builder-service-field-row").after(e.html),u._finishSettingsLoading()}};d(function(){u.init()})}(jQuery),!function(t){FLBuilderTour={_tour:null,start:function(){FLBuilderTour._tour?FLBuilderTour._tour.restart():(FLBuilderTour._tour=new Tour(FLBuilderTour._config()),FLBuilderTour._tour.init()),FLBuilder._triggerSettingsSave(!1,!0)&&FLBuilderTour._tour.start()},_config:function(){var e={storage:!1,onStart:FLBuilderTour._onStart,onPrev:FLBuilderTour._onPrev,onNext:FLBuilderTour._onNext,onEnd:FLBuilderTour._onEnd,template:'<div class="popover" role="tooltip"> <i class="fas fa-times" data-role="end"></i> <div class="arrow"></div> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="next">'+FLBuilderStrings.tourNext+"</button> </div> </div>",steps:[{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourTemplatesTitle,content:FLBuilderStrings.tourTemplates,onShow:function(){FLBuilder.ContentPanel.show("templates")}},{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourAddRowsTitle,content:FLBuilderStrings.tourAddRows,onShow:function(){FLBuilder.ContentPanel.show("rows")}},{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourAddContentTitle,content:FLBuilderStrings.tourAddContent,onShow:function(){FLBuilder.ContentPanel.show("modules")}},{animation:!1,element:".fl-row.fl-builder-tour-demo-content",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),t(".fl-row.fl-builder-tour-demo-content").trigger("mouseenter"),t(".fl-row.fl-builder-tour-demo-content .fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-row.fl-builder-tour-demo-content .fl-module-overlay .fl-block-overlay-actions",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent2,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),t(".fl-row.fl-builder-tour-demo-content").trigger("mouseenter"),t(".fl-row.fl-builder-tour-demo-content .fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-builder-content-panel-button",placement:"bottom",title:FLBuilderStrings.tourAddContentButtonTitle,content:FLBuilderStrings.tourAddContentButton,onShow:function(){FLBuilderTour._dimSection("body"),t(".fl-row").eq(0).trigger("mouseleave"),t(".fl-module").eq(0).trigger("mouseleave")}},{animation:!1,element:".fl-builder-bar-title",placement:"bottom",title:FLBuilderStrings.tourToolsButtonTitle,content:FLBuilderStrings.tourToolsButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-done-button",placement:"bottom",title:FLBuilderStrings.tourDoneButtonTitle,content:FLBuilderStrings.tourDoneButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,orphan:!0,backdrop:!0,title:FLBuilderStrings.tourFinishedTitle,content:FLBuilderStrings.tourFinished,template:'<div class="popover" role="tooltip"> <div class="arrow"></div> <i class="fas fa-times" data-role="end"></i> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="end">'+FLBuilderStrings.tourEnd+"</button> </div> </div>"}]};return"disabled"!=FLBuilderConfig.enabledTemplates&&"fl-builder-template"!=FLBuilderConfig.postType||e.steps.shift(),e},_onStart:function(){var e=t("body");e.scrollTop(0),e.append('<div class="fl-builder-tour-mask"></div>'),"module"!=FLBuilderConfig.userTemplateType&&(0===t(".fl-row").length?(t(".fl-builder-content").append('<div class="fl-builder-tour-demo-content fl-builder-tour-placeholder-content fl-row fl-row-full-width fl-row-bg-none"> <div class="fl-row-content-wrap"> <div class="fl-row-content fl-row-fixed-width fl-node-content"> <div class="fl-col-group"> <div class="fl-col" style="width: 100%;"> <div class="fl-col-content fl-node-content"> <div class="fl-module fl-module-rich-text" data-type="rich-text" data-name="Text Editor"> <div class="fl-module-content fl-node-content"> <div class="fl-rich-text"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus pellentesque ut lorem non cursus. Sed mauris nunc, porttitor iaculis lorem a, sollicitudin lacinia sapien. Proin euismod orci lacus, et sollicitudin leo posuere ac. In hac habitasse platea dictumst. Maecenas elit magna, consequat in turpis suscipit, ultrices rhoncus arcu. Phasellus finibus sapien nec elit tempus venenatis. Maecenas tincidunt sapien non libero maximus, in aliquam felis tincidunt. Mauris mollis ultricies facilisis. Duis condimentum dignissim tortor sit amet facilisis. Aenean gravida lacus eu risus molestie egestas. Donec ut dolor dictum, fringilla metus malesuada, viverra nunc. Maecenas ut purus ac justo aliquet lacinia. Cras vestibulum elementum tincidunt. Maecenas mattis tortor neque, consectetur dignissim neque tempor nec.</p> </div> </div> </div> </div> </div> </div> </div> </div></div>'),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols()):t(".fl-row").eq(0).addClass("fl-builder-tour-demo-content"))},_onPrev:function(){t(".fl-builder-tour-dimmed").remove()},_onNext:function(){t(".fl-builder-tour-dimmed").remove()},_onEnd:function(){t("body").off("fl-builder.template-selector-loaded"),t(".fl-builder-tour-mask").remove(),t(".fl-builder-tour-dimmed").remove(),t(".fl-builder-tour-placeholder-content").remove(),t(".fl-builder-tour-demo-content").removeClass("fl-builder-tour-demo-content"),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._showPanel(),FLBuilder._initTemplateSelector()},_dimSection:function(e){t(e).find(".fl-builder-tour-dimmed").remove(),t(e).append('<div class="fl-builder-tour-dimmed"></div>')}}}(jQuery),!function(r,o){String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(t=t||0,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var i=this.toString(),i=(("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>i.length)&&(t=i.length),t-=e.length,i.indexOf(e,t));return-1!==i&&i===t}),r.fn.textWidth=function(e,t){return r.fn.textWidth.fakeEl||(r.fn.textWidth.fakeEl=r("<span>").hide().appendTo(document.body)),r.fn.textWidth.fakeEl.text(e||this.val()||this.text()).css("font",t||this.css("font")),r.fn.textWidth.fakeEl.width()},FLExtendableObject={create:function(e){var t=Object.create(this),t=r.extend(t,e);return r(this).trigger("onCreate"),t}},r.fn.switchClass=function(o,e){return this.each(function(){return r(this).removeClass(function(e,t){var i=[],l=t.split(" ");for(e in l)l[e].startsWith(o)&&i.push(l[e]);return i.join(" ")}),r(this).addClass(o+e)})};var e={init:function(){o.addHook("cancelTask",this.onCancelTask.bind(this)),o.addHook("showSavedMessage",this.onSaveShortcut.bind(this)),o.addHook("goToNextTab",this.onNextPrevTabShortcut.bind(this,"next")),o.addHook("goToPrevTab",this.onNextPrevTabShortcut.bind(this,"prev")),o.addHook("endEditingSession",this.onEndEditingSession.bind(this)),o.addHook("restartEditingSession",this.onRestartEditingSession.bind(this)),this.setDefaultKeyboardShortcuts()},addShortcut:function(e,t,i){e=r.proxy(this,"onTriggerKey",e);i?Mousetrap.bindGlobal(t,e):Mousetrap.bind(t,e)},reset:function(){Mousetrap.reset()},setDefaultKeyboardShortcuts:function(){for(var e in this.reset(),FLBuilderConfig.keyboardShortcuts){var t=FLBuilderConfig.keyboardShortcuts[e].keyCode,i=FLBuilderConfig.keyboardShortcuts[e].isGlobal;this.addShortcut(e,t,i)}},onTriggerKey:function(e,t){o.triggerHook(e),t.preventDefault?t.preventDefault():t.returnValue=!1},onCancelTask:function(){i.isPreviewing?i.endPreview():t.isShowing?t.hide():o.ContentPanel.isShowing&&o.ContentPanel.hide()},pause:function(){Mousetrap.pause()},unpause:function(){Mousetrap.unpause()},onEndEditingSession:function(){const e=FL.Builder.data.getSystemActions();e.setIsEditing(!1),document.documentElement.classList.remove("fl-builder-assistant-visible"),this.reset(),this.addShortcut("restartEditingSession","mod+e")},onRestartEditingSession:function(){const e=FL.Builder.data.getSystemActions();e.setIsEditing(!0),"assistant"===FL.Builder.data.getSystemState().currentPanel&&document.documentElement.classList.add("fl-builder-assistant-visible"),this.reset(),this.setDefaultKeyboardShortcuts()},onSaveShortcut:function(){var e;e=o.SaveManager.layoutNeedsPublish()?FLBuilderStrings.savedStatus.hasAlreadySaved:FLBuilderStrings.savedStatus.nothingToSave,o.SaveManager.showStatusMessage(e),setTimeout(function(){o.SaveManager.resetStatusMessage()},2e3)},onNextPrevTabShortcut:function(e,t){var i=r(".fl-lightbox:visible"),l=i.find(".fl-builder-settings-tabs a");0<i.length&&(i=l.filter("a.fl-active"),("next"==e?i.is(l.last())?l.first():i.next("a"):i.is(l.first())?l.last():i.prev("a")).trigger("click")),o._calculateSettingsTabsOverflow(),t.preventDefault()}},t=FLExtendableObject.create({isShowing:!1,init:function(){this.$el=r(".fl-builder-publish-actions"),this.$defaultBarButtons=r(".fl-builder-bar-actions"),this.$clickAwayMask=r(".fl-builder-publish-actions-click-away-mask"),this.$doneBtn=this.$defaultBarButtons.find(".fl-builder-done-button"),this.$doneBtn.on("click",this.onDoneTriggered.bind(this)),this.$actions=this.$el.find(".fl-builder-button"),this.$actions.on("click touchend",this.onActionClicked.bind(this)),o.addHook("triggerDone",this.onDoneTriggered.bind(this));var e=this.hide.bind(this);o.addHook("cancelPublishActions",e),o.addHook("endEditingSession",e),this.$clickAwayMask.on("click",e)},onDoneTriggered:function(){o.SaveManager.layoutNeedsPublish()?this.show():FLBuilderConfig.shouldRefreshOnPublish?o._exit():o._exitWithoutRefresh()},show:function(){this.isShowing||o._triggerSettingsSave(!1,!0)&&(this.$el.removeClass("is-hidden"),this.$defaultBarButtons.css("opacity","0"),this.$clickAwayMask.show(),this.isShowing=!0,o.triggerHook("didShowPublishActions"))},hide:function(){this.isShowing&&(this.$el.addClass("is-hidden"),this.$defaultBarButtons.css("opacity","1"),this.$clickAwayMask.hide(),this.isShowing=!1)},onActionClicked:function(e){e=r(e.currentTarget).data("action");switch(e){case"dismiss":this.hide();break;case"discard":this.hide(),i.muteToolbar(),o._discardButtonClicked();break;case"publish":this.hide(),i.muteToolbar(),o._publishButtonClicked(),o._destroyOverlayEvents();break;default:this.hide(),i.muteToolbar(),o._draftButtonClicked()}o.triggerHook(e+"ButtonClicked")}}),i={isPreviewing:!1,init:function(){this.$el=r("body"),this.$mainToolbar=r(".fl-builder-bar"),this.$mainToolbarContent=this.$mainToolbar.find(".fl-builder-bar-content"),this.$wpAdminBar=r("#wpadminbar"),this.$endPreviewBtn=r(".fl-builder--preview-actions .end-preview-btn"),o.addHook("endEditingSession",this.endEditingSession.bind(this)),o.addHook("previewLayout",this.togglePreview.bind(this)),this.$endPreviewBtn.on("click",this.endPreview.bind(this)),this.$deviceIcons=r(".fl-builder--preview-actions i"),this.$deviceIcons.on("click",this.onDeviceIconClick.bind(this));this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a, #wp-admin-bar-fl-theme-builder-frontend-edit-link > a").on("click",this.onClickPageBuilderToolbarLink.bind(this)),r("#wpadminbar a").attr("tabindex","-1");var e=this.restartEditingSession.bind(this);o.addHook("restartEditingSession",e),o.addHook("didHideAllLightboxes",this.unmuteToolbar.bind(this)),o.addHook("didCancelDiscard",this.unmuteToolbar.bind(this)),o.addHook("didEnterRevisionPreview",this.hide.bind(this)),o.addHook("didExitRevisionPreview",this.show.bind(this)),o.addHook("didPublishLayout",this.onPublish.bind(this)),o.addHook("didPublishLayout",this.onPublishCacheClear.bind(this))},endEditingSession:function(){o._destroyOverlayEvents(),o._removeAllOverlays(),o._removeEmptyRowAndColHighlights(),o._removeColHighlightGuides(),o._unbindEvents(),r("html").removeClass("fl-builder-edit").addClass("fl-builder-show-admin-bar"),r("body").removeClass("fl-builder-edit"),r("#wpadminbar a").attr("tabindex",null),r(o._contentClass).removeClass("fl-builder-content-editing"),this.hideMainToolbar(),o.ContentPanel.hide(),FLBuilderLayout.init()},restartEditingSession:function(e){o._initTemplateSelector(),o._bindOverlayEvents(),o._highlightEmptyCols(),o._rebindEvents(),r("html").addClass("fl-builder-edit").removeClass("fl-builder-show-admin-bar"),r("body").addClass("fl-builder-edit"),r("#wpadminbar a").attr("tabindex","-1"),r(o._contentClass).addClass("fl-builder-content-editing"),this.showMainToolbar(),e.preventDefault()},onClickPageBuilderToolbarLink:function(e){o.triggerHook("restartEditingSession"),e.preventDefault()},onPublish:function(){this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a span").css("color","#6bc373")},onPublishCacheClear:function(){o.ajax({action:"clear_cache_for_layout"},function(e){console.log(e)})},hide:function(){r("html").hasClass("fl-builder-edit")&&(o._unbindEvents(),o._destroyOverlayEvents(),o._removeAllOverlays(),r("html").removeClass("fl-builder-edit"),r("body").removeClass("admin-bar"),this.hideMainToolbar(),o.ContentPanel.hide(),FLBuilderLayout.init(),o.triggerHook("didHideEditingUI"))},show:function(){r("html").hasClass("fl-builder-edit")||(o._rebindEvents(),o._bindOverlayEvents(),this.showMainToolbar(),FLBuilderResponsiveEditing._switchTo("default"),r("html").addClass("fl-builder-edit"),r("body").addClass("admin-bar"),o.triggerHook("didShowEditingUI"))},beginPreview:function(){o._triggerSettingsSave(!1,!0)&&(this.isPreviewing=!0,this.hide(),r("html").addClass("fl-builder-preview"),r("html, body").removeClass("fl-builder-edit"),o._removeEmptyRowAndColHighlights(),o._removeColHighlightGuides(),o.triggerHook("didBeginPreview"),FLBuilderResponsivePreview.enter())},endPreview:function(){this.isPreviewing=!1,this.show(),o._highlightEmptyCols(),FLBuilderResponsivePreview.exit(),r("html").removeClass("fl-builder-preview"),r("html, body").addClass("fl-builder-edit")},togglePreview:function(){this.isPreviewing?this.endPreview():this.beginPreview()},hideMainToolbar:function(){this.$mainToolbar.addClass("is-hidden"),r("html").removeClass("fl-builder-is-showing-toolbar")},showMainToolbar:function(){this.unmuteToolbar(),this.$mainToolbar.removeClass("is-hidden"),r("html").addClass("fl-builder-is-showing-toolbar")},onDeviceIconClick:function(e){e=r(e.target).data("mode");FLBuilderResponsivePreview.switchTo(e),FLBuilderResponsivePreview._showSize(e)},muteToolbar:function(){this.$mainToolbarContent.addClass("is-muted"),o._hideTipTips()},unmuteToolbar:function(){this.$mainToolbarContent.removeClass("is-muted")}},l={isEditing:!0,init:function(){history.pushState&&(o.addHook("endEditingSession",this.onLeaveBuilder.bind(this)),o.addHook("restartEditingSession",this.onEnterBuilder.bind(this)))},onEnterBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.editUrl);const e=FL.Builder.data.getSystemActions();e.setIsEditing(!0),this.isEditing=!0},onLeaveBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.url);const e=FL.Builder.data.getSystemActions();e.setIsEditing(!1),this.isEditing=!1}},n={$row:null,$rowContent:null,row:null,drag:{},init:function(){var e;this.userCanResize()&&((e=r(o._contentClass)).on("mouseenter touchstart",".fl-row",this.onDragHandleHover.bind(this)),e.on("mousedown touchstart",".fl-block-row-resize",this.onDragHandleDown.bind(this)))},userCanResize:function(){return FLBuilderConfig.rowResize.userCanResizeRows},onDragHandleHover:function(e){var t,i,l,o,n,s;this.drag.isDragging||(t=this,i=r(e.target).closest(".fl-row"),l=i.data("node"),o=r(".fl-builder-row-settings[data-node="+l+"]"),n=o.find("[name=max_content_width_unit]"),s="px",t.onSettingsReady(l,function(e){n.length?s=n.val():void 0!==e&&(s=e.max_content_width_unit),t.$row=i,t.$rowContent=t.$row.find(".fl-row-content"),t.row={node:l,form:o,unit:s,isFixedWidth:t.$row.hasClass("fl-row-fixed-width"),parentWidth:("vw"===s?r(window):t.$row.parent()).width()},t.drag={edge:null,isDragging:!1,originalPosition:null,originalWidth:null,calculatedWidth:null,operation:null},t.row.isFixedWidth?t.drag.originalWidth=t.$row.width():t.drag.originalWidth=t.$rowContent.width(),t.dragInit()}))},onSettingsReady:function(e,t){var i=void 0!==FLBuilderSettingsConfig.nodes?FLBuilderSettingsConfig.nodes:null;null!==i&&void 0!==i[e]?(t(i[e]),null!=n._mouseEnterTimeout&&(clearTimeout(n._mouseEnterTimeout),n._mouseEnterTimeout=null)):(clearTimeout(n._mouseEnterTimeout),n._mouseEnterTimeout=setTimeout(this.onSettingsReady.bind(this),350,e,t))},onDragHandleDown:function(){r("body").addClass("fl-builder-row-resizing"),null!=n._mouseEnterTimeout&&(clearTimeout(n._mouseEnterTimeout),n._mouseEnterTimeout=null)},dragInit:function(e){this.$row.find(".fl-block-row-resize").draggable({axis:"x",start:this.dragStart.bind(this),drag:this.dragging.bind(this),stop:this.dragStop.bind(this)})},dragStart:function(e,t){var i=r("body"),t=r(t.helper);this.drag.isDragging=!0,this.row.isFixedWidth?this.drag.originalWidth=this.$row.width():this.drag.originalWidth=this.$rowContent.width(),t.hasClass("fl-block-col-resize-e")&&(this.drag.edge="e",this.$feedback=t.find(".fl-block-col-resize-feedback-left")),t.hasClass("fl-block-col-resize-w")&&(this.drag.edge="w",this.$feedback=t.find(".fl-block-col-resize-feedback-right")),i.addClass("fl-builder-row-resizing"),o._colResizing=!0,o._destroyOverlayEvents(),o._closePanel()},dragging:function(e,t){var i=t.position.left,t=t.originalPosition.left,l=this.drag.originalWidth,o=this.drag.edge,n=FLBuilderConfig.rowResize.minAllowedWidth,s=FLBuilderConfig.rowResize.maxAllowedWidth;FLBuilderConfig.isRtl&&(o="w"==o?"e":"w"),this.drag.operation=i<t?"w"===o?"+":"-":"e"===o?"+":"-",o=Math.abs(t-i),"+"===this.drag.operation?this.drag.calculatedWidth=l+2*o:this.drag.calculatedWidth=l-2*o,!1!==n&&this.drag.calculatedWidth<n&&(this.drag.calculatedWidth=n),!1!==s&&this.drag.calculatedWidth>s&&(this.drag.calculatedWidth=s),this.row.isFixedWidth&&this.$row.css("max-width",this.drag.calculatedWidth+"px"),this.$rowContent.css("max-width",this.drag.calculatedWidth+"px"),"px"!==this.row.unit&&(this.drag.calculatedWidth=Math.round(this.drag.calculatedWidth/this.row.parentWidth*100)),_.isUndefined(this.$feedback)||this.$feedback.html(this.drag.calculatedWidth+this.row.unit).show(),this.row.form.length&&this.row.form.find("[name=max_content_width]").val(this.drag.calculatedWidth),requestAnimationFrame(()=>{const e=FL.Builder.data.getLayoutActions();e.resizeRowContent(this.row.node,this.drag.calculatedWidth,!1)})},dragStop:function(e,t){this.drag.isDragging=!1,_.isUndefined(this.$feedback)||this.$feedback.hide();const i=FL.Builder.data.getLayoutActions();i.resizeRowContent(this.row.node,this.drag.calculatedWidth),o._bindOverlayEvents(),r("body").removeClass("fl-builder-row-resizing"),r(".fl-block-overlay").each(function(){o._buildOverlayOverflowMenu(r(this))}),setTimeout(function(){o._colResizing=!1},50),o.triggerHook("didResizeRow",{rowId:this.row.node,rowWidth:this.drag.calculatedWidth})}},s={templateName:"fl-toolbar",init:function(){this.template=wp.template(this.templateName),this.render(),this.initTipTips(),this.$el.find(".fl-builder-content-panel-button").on("click",o._togglePanel),this.$el.find(".fl-builder-buy-button").on("click",o._upgradeClicked),this.$el.find(".fl-builder-upgrade-button").on("click",o._upgradeClicked),this.$el.find("#fl-builder-toggle-notifications").on("click",this.onNotificationsButtonClicked.bind(this)),o.addHook("notificationsLoaded",this.onNotificationsLoaded.bind(this))},render:function(e){e=r(this.template(e));this.$el=e,this.el=e.get(0),i.$mainToolbar=this.$el,r("body").prepend(e),r("html").addClass("fl-builder-is-showing-toolbar")},initTipTips:function(){r(".fl-builder--saving-indicator").tipTip({defaultPosition:"bottom",edgeOffset:14}),r(".fl-builder-publish-actions .fl-builder-button-group .fl-builder-button").tipTip({defaultPosition:"bottom",edgeOffset:6})},onNotificationsButtonClicked:function(){o.triggerHook("toggleNotifications")},onNotificationsLoaded:function(){r("body").removeClass("fl-builder-has-new-notifications");o.ajax({action:"fl_builder_notifications",read:!0})}};r(function(){o.ContentPanel.init(),FLBuilderConfig.simpleUi||o.MainMenu.init(),FLBuilderConfig.showToolbar?(s.init(),o.ContentPanel.alignPanelArrow()):r("html").addClass("fl-builder-no-toolbar"),e.init(),i.init(),l.init(),n.init(),t.init(),o.triggerHook("didInitUI")})}(jQuery,FLBuilder),!function(o,n){var s=FLExtendableObject.create({templateName:"fl-main-menu-panel-view",name:"Untitled View",isShowing:!1,isRootView:!1,items:{},init:function(){this.template=wp.template(this.templateName)},render:function(){return this.template(this)},bindEvents:function(){this.$items=this.$el.find(".fl-builder--menu-item")},show:function(){this.$el.addClass("is-showing"),this.isShowing=!0},hide:function(){this.$el.removeClass("is-showing"),this.isShowing=!1},transitionIn:function(e){requestAnimationFrame(this.show.bind(this))},transitionOut:function(e){this.hide()}}),e=FLExtendableObject.create({templateName:"fl-main-menu-panel",template:null,menu:null,views:{},viewNavigationStack:[],isShowing:!1,shouldShowTabs:!1,init:function(){for(var e in this.template=wp.template(this.templateName),o("body").prepend(this.template(this)),this.$el=o(".fl-builder--main-menu-panel"),this.$el.find(".fl-builder--main-menu-panel-views").html(""),FLBuilderConfig.mainMenu)this.renderPanel(e);o("body").on("click",".fl-builder--main-menu-panel .pop-view",this.goToPreviousView.bind(this)),this.$tabs=this.$el.find(".fl-builder--tabs > span"),this.$tabs.on("click",this.onItemClick.bind(this)),this.$barTitle=o(".fl-builder-bar-title"),o("body").on("click",".fl-builder-bar-title",this.toggle.bind(this));var t=this.hide.bind(this);n.addHook("didShowPublishActions",t),n.addHook("didBeginSearch",t),n.addHook("didBeginPreview",t),n.addHook("didShowContentPanel",t),n.addHook("endEditingSession",t),n.addHook("didFocusSearchBox",t),n.addHook("didEnterRevisionPreview",t),n.addHook("didFailSettingsSave",t),n.addHook("showKeyboardShortcuts",t),this.$mask=o(".fl-builder--main-menu-panel-mask"),this.$mask.on("click",t),i.init(),l.init()},renderPanel:function(e){var t,i=this.views[e],l=FLBuilderConfig.mainMenu[e];l.handle=e,(l=s.create(l)).init(),t=o(l.render()),l.$el=t,o(".fl-builder--main-menu-panel-views").append(t),l.bindEvents(),l.$el.find(".fl-builder--menu-item").on("click",this.onItemClick.bind(this)),void 0!==i&&(i.$el.remove(),i.isShowing&&(this.currentView=l).show()),l.isRootView&&(this.rootView=l,this.currentView=l),this.views[e]=l},show:function(){this.isShowing||(this.$el.addClass("is-showing"),this.$barTitle.addClass("is-showing-menu"),this.currentView.transitionIn(),this.isShowing=!0,this.$mask.show(),n.triggerHook("didOpenMainMenu"))},hide:function(){this.isShowing&&(this.$el.removeClass("is-showing"),this.$barTitle.removeClass("is-showing-menu"),this.isShowing=!1,this.resetViews(),this.$mask.hide())},toggle:function(){this.isShowing?this.hide():this.show()},onItemClick:function(e){var t=o(e.currentTarget);switch(t.data("type")){case"view":var i=t.data("view");this.goToView(i);break;case"event":i=t.data("event");n.triggerHook(i,t)}},goToView:function(e){var t=this.currentView,e=this.views[e];t.transitionOut(),e.transitionIn(),this.currentView=e,this.viewNavigationStack.push(t)},goToPreviousView:function(){var e=this.currentView,t=this.viewNavigationStack.pop();e.transitionOut(!0),t.transitionIn(!0),this.currentView=t,o(".fl-builder-bar-title-caret").focus()},resetViews:function(){this.currentView!=this.rootView&&(this.currentView.hide(),this.rootView.show(),this.currentView=this.rootView,this.viewNavigationStack=[])}}),i=(n.MainMenu=e,{init:function(){var e;n.addHook("saveTemplate",this.saveTemplate.bind(this)),n.addHook("saveCoreTemplate",this.saveCoreTemplate.bind(this)),n.addHook("duplicateLayout",this.duplicateLayout.bind(this)),n.addHook("showLayoutSettings",this.showLayoutSettings.bind(this)),n.addHook("showGlobalSettings",this.showGlobalSettings.bind(this)),n.addHook("toggleUISkin",this.toggleUISkin.bind(this)),n.addHook("clearLayoutCache",this.clearLayoutCache.bind(this)),n.addHook("launchThemerLayouts",this.launchThemerLayouts.bind(this)),"FL"in window&&"Builder"in FL&&(e=FL.Builder.data.getSystemActions(),n.addHook("showKeyboardShortcuts",function(){e.setShouldShowShortcuts(!0)}))},saveTemplate:function(){n._saveUserTemplateClicked(),e.hide()},saveCoreTemplate:function(){FLBuilderCoreTemplatesAdmin._saveClicked(),e.hide()},duplicateLayout:function(){n._duplicateLayoutClicked(),e.hide()},showGlobalSettings:function(){n._globalSettingsClicked(),e.hide()},showLayoutSettings:function(){n._layoutSettingsClicked(),e.hide()},clearLayoutCache:function(){n.ajax({action:"clear_cache"},function(){location.href=FLBuilderConfig.editUrl}),n.showAjaxLoader(),e.hide()},toggleUISkin:function(e){o('a[data-event="toggleUISkin"]');var t,i,l=o("body");l.hasClass("fl-builder-ui-skin--light")&&(t="light",i="dark"),l.hasClass("fl-builder-ui-skin--dark")&&(t="dark",i="light"),l.removeClass("fl-builder-ui-skin--"+t).addClass("fl-builder-ui-skin--"+i),l.removeClass("fluid-color-scheme-"+t).addClass("fluid-color-scheme-"+i),"Builder"in FL&&"data"in FL.Builder&&FL.Builder.data.getSystemActions().setColorScheme(i),n.ajax({action:"save_ui_skin",skin_name:i})},launchThemerLayouts:function(){FLBuilderConfig.lite?n._showProMessage("Themer Layouts"):window.open(FLBuilderConfig.themerLayoutsUrl),e.hide()}}),l={init:function(){n.addHook("beginTour",this.onStartTourClicked.bind(this))},onStartTourClicked:function(){FLBuilderTour.start(),e.hide()}}}(jQuery,FLBuilder),!function(n,o){var s=FLExtendableObject.create({handle:"",name:"",panel:null,shouldShowTabItem:!0,isShowing:!1,views:{},activeView:null,defaultView:null,categorySelector:null,init:function(e){this.categorySelector=i.create({handle:"selector-"+this.handle,tab:this,items:[]}),this.categorySelector.init(),n(this.categorySelector).on("categorySelected",this.onViewSelected.bind(this));var t;e.views;this.initViews(e.views),0===Object.keys(this.views).length&&this.addView(t={handle:"noViews",name:"No Views",templateName:"fl-content-panel-no-view"}),this.activeView||(e=Object.keys(this.views)[0],t=this.views[e],this.activeView=t),this.defaultView=this.activeView,n(this.panel).on("afterRender",this.renderView.bind(this,this.activeView)),n(this.panel).on("onShow onShowTab",this.initScroller.bind(this)),o.addHook("contentItemsChanged",this.onLibraryDataChanged.bind(this))},initViews:function(e){for(var t in e){t=e[t];this.categorySelector.addItem(t),"separator"!==t.type&&this.addView(t)}},addView:function(e){var t=l;switch(this.handle){case"modules":t=r;break;case"rows":t=a;break;case"templates":t=d;break;case"saved":t=u;break;default:t=l}var e=(t=_.isNull(this.viewController)||_.isUndefined(this.viewController)?t:window[this.viewController]).create(e),i=e.handle;e.init(),(this.views[i]=e).isShowing&&(this.activeView=e)},renderView:function(e){var t;this.$el=this.panel.$el.find('.fl-builder--panel-view[data-tab="'+this.handle+'"]'),e=_.isObject(e)?e:this.views[e],_.isObject(e)&&_.isFunction(e.render)&&(t=e.render(),this.$el.find(".fl-nanoscroller-content").html(t),this.activeView=e,o._initSortables(),this===this.panel.activeTab&&this.renderGroupSelector(),this.initScroller(),this.$el.find(".fl-nanoscroller-content").scrollTop(0))},initScroller:function(){this.$el.nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"})},show:function(){n(this.activeView).trigger("onBeforeShow"),this.renderGroupSelector(),this.isShowing=!0,this.$el.addClass("is-showing"),this.$el.find(".fl-nanoscroller-content").scrollTop(0)},hide:function(){this.isShowing=!1,this.$el.removeClass("is-showing"),this.activeView!==this.defaultView&&this.renderView(this.defaultView),_.isObject(this.categorySelector)&&this.categorySelector.close()},renderGroupSelector:function(){var e,t=this.panel.$groupSelect,i=this.panel.$el.find(".fl-builder-panel-search");this.isSearchEnabled?i.show():i.hide(),1<Object.keys(this.views).length&&!_.isUndefined(this.categorySelector)?(e=this.categorySelector.render(),this.panel.$el.find(".fl-builder-content-group-select"),t.html(e),t.show(),this.panel.$el.removeClass("single-view")):(t.hide(),i.hide(),this.panel.$el.addClass("single-view"))},onViewSelected:function(e,t){this.renderView(t),this.categorySelector.close()},onLibraryDataChanged:function(){this.renderView(this.activeView)}}),l=FLExtendableObject.create({templateName:"",name:"",handle:"",query:null,init:function(){this.template=wp.template(this.templateName),n(this).on("afterRender",this.bindEvents.bind(this)),n(this).trigger("afterInit")},filterTemplateData:function(e){return _.isNull(this.query)||_.isUndefined(this.query)||(e.queryResults=o.Search.byQuery(this.query)),e},render:function(){n(this).trigger("beforeRender");var e=this.filterTemplateData(this),e=n(this.template(e));return this.$el=e,n(this).trigger("afterRender"),e},bindEvents:function(){},transitionIn:function(){},transitionOut:function(){}}),r=l.create({templateName:"fl-content-panel-modules-view",bindEvents:function(){this.$sections=this.$el,this.$items=this.$el.find(".fl-builder-block, .fl-builder-blocks-section-title")}}),a=l.create({templateName:"fl-content-panel-row-templates-view",bindEvents:function(){this.$items=this.$el.find(".fl-builder-block, .fl-builder-blocks-section-title")}}),d=l.create({templateName:"fl-content-panel-templates-view",bindEvents:function(){this.$items=this.$el.find(".fl-builder--template-collection-item"),this.$items.on("click",this.onTemplateClick.bind(this)),this.$userTemplateSections=n(".fl-user-templates"),this.$userTemplates=this.$el.find(".fl-user-template, .fl-builder--save-new-user-template"),this.$saveNewTemplateInput=this.$el.find('.fl-save-control input[name="template-name"]'),this.$saveNewTemplateCat=this.$el.find('.fl-save-control input[name="template-category"]'),this.$saveNewTemplateBtn=this.$el.find(".fl-save-control button"),this.$saveNewMask=this.$el.find(".fl-save-control-mask"),this.$saveNewTemplateInput.on("focus",this.onSaveInputFocus.bind(this)),this.$saveNewTemplateInput.on("keyup",this.onSaveInputKeyup.bind(this)),this.$saveNewTemplateBtn.on("click",this.onSaveButtonClick.bind(this)),this.$saveNewMask.on("click",this.resetSaveInput.bind(this))},onSaveInputFocus:function(){this.resetSaveInput(),this.$saveNewMask.show()},resetSaveInput:function(){this.$saveNewTemplateInput.val(""),this.$saveNewTemplateBtn.hide(),this.$saveNewMask.hide()},onSaveInputKeyup:function(e){var e=n(e.currentTarget),t=e.val(),e=e.siblings("button");""!==t?e.show():e.hide()},onSaveButtonClick:function(e){var e=n(e.currentTarget),t=e.siblings('input[name="template-name"]').val(),e=e.siblings('input[name="template-category"]').val();""!==t&&o.ajax({action:"save_user_template",settings:{name:t,category:e}},o._saveUserTemplateSettingsComplete)},onTemplateClick:function(e){var e=n(e.currentTarget),t=e.data("id"),i=e.data("type"),l=e.data("premium");FLBuilderConfig.lite&&l?o._showProMessage(e.find(".fl-builder--template-name").text()):o._requestTemplateInsert(t,i)}}),u=l.create({templateName:"fl-content-panel-saved-view",filterTemplateData:function(e){return e.queryResults=o.Search.byQuery({kind:"template",type:"user",content:["module","column","row"]}),e}}),i=FLExtendableObject.create({templateName:"fl-content-panel-category-selector",template:null,tab:null,isOpen:!1,items:{},init:function(){this.template=wp.template(this.templateName),n(this).on("afterRender",this.bindEvents.bind(this)),n(this.tab.panel).on("didShowSearchControls",this.close.bind(this))},render:function(){this.close();var e=n(this.template(this));return this.$el=e,n(this).trigger("afterRender"),e},bindEvents:function(){this.$selectorTitle=this.$el.find(".fl-builder--selector-display"),this.$selectorTitle.on("click",this.toggleOpenClose.bind(this)),this.$categories=this.$el.find(".fl-builder--selector-menu .fl-builder--menu-item"),this.$categories.on("click",this.onCategoryClick.bind(this))},addItem:function(e){var t=_.isUndefined(e.handle)?_.uniqueId("sep_"):e.handle;this.items[t]=e},open:function(){this.isOpen||(this.$el.addClass("is-showing"),this.isOpen=!0)},close:function(){this.isOpen&&(this.$el.removeClass("is-showing"),this.isOpen=!1,this.$selectorTitle.find("button").focus())},toggleOpenClose:function(){this.isOpen?this.close():this.open()},onCategoryClick:function(e){var t,e=n(e.target),i=e.data("view");e.hasClass("fl-has-children")?((t=n('[data-parent="'+i+'"]')).is(":visible")?(this.items[i].hasChildrenOpen=!1,e.removeClass("fl-has-children-showing"),t.hide()):(this.items[i].hasChildrenOpen=!0,e.addClass("fl-has-children-showing"),t.show()),e.blur()):n(this).trigger("categorySelected",i)}});o.ContentPanel=FLExtendableObject.create({templateName:"fl-content-panel-base",template:null,tabs:{},activeTab:null,isShowing:!1,init:function(){if(FLBuilderConfig.panelData){var e,t=FLBuilderConfig.panelData.tabs;for(e in t){var i=t[e],l=s.create(i);l.panel=this,l.views={},l.init(i),(this.tabs[e]=l).isShowing&&(this.activeTab=l),this.activeTab||(i=Object.keys(this.tabs)[0],(l=this.tabs[i]).isShowing=!0,this.activeTab=l)}this.template=wp.template(this.templateName),this.render(),this.renderSearchResults=wp.template("fl-search-results-panel"),this.renderNoResults=wp.template("fl-search-no-results"),o.triggerHook("contentPanelDidInit")}},render:function(){n("body").prepend(this.template(this)),this.$el=n(".fl-builder--content-library-panel"),this.bindEvents(),this.$groupSelect=this.$el.find(".fl-builder-content-group-select"),n(this).trigger("afterRender")},bindEvents:function(){this.$tabs=this.$el.find(".fl-builder--tabs [data-tab]"),this.$tabs.on("mouseup",this.onTabItemMouseUp.bind(this)),this.$tabs.on("click",this.onTabItemClick.bind(this)),this.$search=this.$el.find(".fl-builder-panel-search"),this.$searchBtn=this.$search.find(".fl-builder-toggle-panel-search"),this.$searchInput=this.$search.find('input[name="search-term"]'),this.$searchBtn.on("click",this.onSearchButtonClicked.bind(this)),this.$search.find(".fl-builder-dismiss-panel-search").on("click",this.onDismissButtonClicked.bind(this)),this.$searchInput.on("keyup",this.onSearchTermChanged.bind(this)),this.$searchPanel=this.$el.find(".fl-builder--search-results-panel"),o.addHook("showContentPanel",this.show.bind(this)),o.addHook("showModules",this.show.bind(this,"modules")),o.addHook("showRows",this.show.bind(this,"rows")),o.addHook("showTemplates",this.show.bind(this,"templates")),o.addHook("showSaved",this.show.bind(this,"saved")),o.addHook("showSearch",this.goToSearch.bind(this));var e=this.hide.bind(this),e=(o.addHook("hideContentPanel",e),o.addHook("didShowLightbox",e),o.addHook("didShowPublishActions",e),o.addHook("didBeginSearch",e),o.addHook("didInitDrag",e),o.addHook("didOpenMainMenu",e),o.addHook("didApplyTemplate",e),this.toggleShowHide.bind(this));o.addHook("toggleContentPanel",e),o.addHook("didStopDrag",this.hideSearchControls.bind(this))},alignPanelArrow:function(){var e,t=this.$el,i=this.$el.find(".fl-builder--panel-arrow"),l=n(".fl-builder-content-panel-button"),o=this.$el.css("animation-duration");0!=l.length&&(this.$el.css("animation-duration","0s"),this.show(),t=t[0].getBoundingClientRect(),e=i[0].getBoundingClientRect(),this.hide(),this.$el.css("animation-duration",o),o=(l=(o=l[0].getBoundingClientRect()).x+o.width/2)<t.x?20:l-t.x-e.width/2,i.css({right:"auto",left:o+"px"}))},show:function(e){if("module"!==FLBuilderConfig.userTemplateType&&!FLBuilderConfig.simpleUi&&(o.triggerHook("willShowContentPanel"),void 0!==e&&this.showTab(e),!this.isShowing&&o._triggerSettingsSave(!1,!0)&&(n("body").addClass("fl-builder-content-panel-is-showing"),this.isShowing=!0,n(this).trigger("onShow"),o.triggerHook("didShowContentPanel"),"Builder"in FL&&"data"in FL.Builder))){const t=FL.Builder.data.getSystemActions();t.hideCurrentPanel()}},hide:function(){!this.isShowing||this.$el.hasClass("fl-builder-ui-pinned")||(n("body").removeClass("fl-builder-content-panel-is-showing"),this.isShowing=!1,n(this).trigger("onHide"),o.triggerHook("didHideContentPanel"))},toggleShowHide:function(){this.isShowing?this.hide():this.show()},showTab:function(e){e=this.tabs[e];_.isObject(e)&&(_.isObject(this.activeTab)&&(this.activeTab.hide(),this.$tabs.filter(".is-showing").removeClass("is-showing")),this.hideSearchControls(),e.show(),this.$tabs.filter('[data-tab="'+e.handle+'"]').addClass("is-showing"),this.activeTab=e,n(this).trigger("onShowTab"))},goToSearch:function(){this.show("modules"),this.$el.find(".fl-builder-toggle-panel-search").trigger("click")},onTabItemMouseUp:function(e){n(e.currentTarget).blur()},onTabItemClick:function(e){e=n(e.target).data("tab");this.showTab(e)},onSearchButtonClicked:function(){this.showSearchControls()},onDismissButtonClicked:function(){this.hideSearchControls(),this.$searchBtn.focus()},showSearchControls:function(){this.$search.addClass("is-showing-input"),this.$search.find('input[name="search-term"]').focus(),n(".fl-builder--selector-display-label").attr("tabindex",-1),this.$searchBtn.attr("tabindex",-1),n(this).trigger("didShowSearchControls")},hideSearchControls:function(){this.$search.removeClass("is-showing-input"),this.clearSearchInput(),this.hideSearchResults(),n(".fl-builder--selector-display-label").attr("tabindex",null),this.$searchBtn.attr("tabindex",null)},onSearchTermChanged:function(e){var t=this.$searchInput.val();""!==t&&""!=(t=o.Search.byTerm(t)).term?this.showSearchResults(t):this.hideSearchResults()},clearSearchInput:function(){this.$searchInput.val(""),this.hideSearchResults()},showSearchResults:function(e){var t;0<e.total?(t=n(this.renderSearchResults(e)),this.$searchPanel.html(t),o._initSortables()):(t=n(this.renderNoResults(e)),this.$searchPanel.html(t)),n("body").addClass("fl-builder-search-results-panel-is-showing")},hideSearchResults:function(){n("body").removeClass("fl-builder-search-results-panel-is-showing")}})}(jQuery,FLBuilder),!function(c){FLBuilderSettingsForms={config:null,settings:null,legacyXhr:null,init:function(){this.bind()},bind:function(){FLBuilder.addHook("didDeleteRow",this.closeOnDeleteNode),FLBuilder.addHook("didDeleteColumn",this.closeOnDeleteNode),FLBuilder.addHook("didDeleteModule",this.closeOnDeleteNode)},render:function(e,t){var i=FLBuilderSettingsConfig.forms,l=FLBuilderSettingsConfig.modules;if(e.nodeId&&!e.settings)this.loadNodeSettings(e,t);else if(t=void 0===t?function(){}:t,(e=c.extend({type:"general",id:null,nodeId:null,className:"",attrs:"",title:"",badges:[],tabs:[],activeTab:null,buttons:[],settings:{},legacy:null,rules:null,preview:null,helper:null,messages:null},e)).id){if("general"===e.type&&void 0!==i[e.id])e=c.extend(!0,e,i[e.id]);else{if("module"!==e.type||void 0===l[e.id])return;e=c.extend(!0,e,l[e.id])}this.config=e,this.renderLightbox(e)&&(e.legacy||!this.renderLegacySettings(e,t)?this.renderComplete(e,t):this.showLightboxLoader());i=FL.Builder.data.getSystemState().currentPanel;if(null!==i&&"outline"!==i){const o=FL.Builder.data.getSystemActions();o.hideCurrentPanel()}}},cacheCurrentSettings:function(){var e=c(".fl-builder-settings:visible");e.closest(".fl-lightbox-wrap[data-parent]").length||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,e),FLBuilder.preview&&(FLBuilder.preview._savedSettings=this.settings))},loadNodeSettings:function(t,i){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"get_node_settings",node_id:t.nodeId},function(e){t.settings=FLBuilder._jsonParse(e),FLBuilderSettingsConfig.nodes[t.nodeId]=t.settings,FLBuilderSettingsForms.render(t,i),FLBuilder.hideAjaxLoader()})},renderLightbox:function(e){var t=wp.template("fl-builder-settings"),i=FLBuilder._lightbox._node.find("form.fl-builder-settings"),l=(c(".fl-lightbox-wrap[data-parent]"),localStorage.getItem("fl-builder-settings-tab"));if(e.nodeId&&e.nodeId===i.data("node")&&!e.lightbox)return FLBuilder._focusFirstSettingsControl(),!1;if(e.hide)return!0;if(l)for(var o in e.tabs)o===l.replace("fl-builder-settings-tab-","")&&(e.activeTab=o);if(e.activeTab||(e.activeTab=Object.keys(e.tabs).shift()),e.lightbox)e.lightbox.setContent(t(e));else{if(!FLBuilder._triggerSettingsSave(!0,!0))return!1;FLBuilder.preview&&FLBuilder.preview.cancel(),FLBuilder._closePanel(),FLBuilder._showLightbox(t(e))}return!0},renderComplete:function(e,t){setTimeout(function(){e.legacy&&this.renderLegacySettingsComplete(e.legacy),t(),FLBuilder._initSettingsForms(),e.rules&&FLBuilder._initSettingsValidation(e.rules,e.messages),e.preview&&(FLBuilder.preview=new FLBuilderPreview(e.preview)),e.helper&&e.helper.init(),this.cacheCurrentSettings()}.bind(this),1)},renderFields:function(e,t){var i,l,o=wp.template("fl-builder-settings-row"),n="",s=null,r=null,a=null,d=["align","border","dimension","unit","photo","select","typography"],t=t||this.config.settings,u=FLBuilderConfig.global;for(s in e)l=!!(i=e[s]).multiple,supportsResponsive=-1<c.inArray(i.type,d),r=_.isUndefined(t[s])?"":t[s],i.type&&(_.isUndefined(t[s])&&i.default&&(r=i.default),a=i.responsive&&u.responsive_enabled&&!l&&supportsResponsive?i.responsive:null,n+=o({field:i,name:s,rootName:s,value:r,preview:JSON.stringify(i.preview||{type:"refresh"}),responsive:a,rowClass:i.row_class?" "+i.row_class:"",isMultiple:l,supportsMultiple:"editor"!==i.type&&"service"!==i.type,settings:t,globalSettings:u,template:c("#tmpl-fl-builder-field-"+i.type)}));return n},renderField:function(e){return wp.template("fl-builder-field")(e)},renderSectionTemplate:function(e,t){return wp.template(e.template.id)({section:e,settings:t})},renderTabTemplate:function(e,t){return wp.template(e.template.id)({tab:e,settings:t})},renderLegacySettings:function(t,i){var e=c(".fl-builder-settings:visible"),l=null,o=!1,n={tabs:[],sections:[],fields:[],settings:null,node_id:null};return e.find(".fl-legacy-field").each(function(){l=c(this),n.fields.push(l.attr("data-field")),FLBuilderSettingsForms.showFieldLoader(l),o=!0}),e.find(".fl-legacy-settings-section").each(function(){l=c(this),n.sections.push({tab:l.attr("data-tab"),section:l.attr("data-section")}),o=!0}),e.find(".fl-legacy-settings-tab").each(function(){l=c(this),n.tabs.push(l.attr("data-tab")),o=!0}),e.attr("data-node")?n.node_id=e.attr("data-node"):n.settings=FLBuilder._getOriginalSettings(e,!0),this.legacyXhr&&(this.legacyXhr.abort(),this.legacyXhr=null),this.legacyXhr=FLBuilder.ajax(c.extend(this.getLegacyVars(),{action:"render_legacy_settings",data:n,form:e.attr("data-form-id"),group:e.attr("data-form-group"),lightbox:e.closest(".fl-builder-lightbox").attr("data-instance-id")}),function(e){FLBuilderSettingsForms.renderLegacySettingsComplete(e),o&&FLBuilderSettingsForms.renderComplete(t,i),FLBuilderSettingsForms.hideLightboxLoader()}),o},renderLegacySettingsComplete:function(e){var i="object"==typeof e?e:FLBuilder._jsonParse(e),e=null,t=null,l="",o=null,n=null;if(i.lightbox?t=(e=c(".fl-builder-lightbox[data-instance-id="+i.lightbox+"]")).length?e.find(".fl-builder-settings"):null:e=(t=c(".fl-builder-settings:visible")).closest(".fl-builder-lightbox"),t&&t.length){for(l in i.fields)(o=c("#fl-field-"+l).attr("id","")).after(i.fields[l]).remove();for(l in i.extras)o=c("#fl-field-"+l).find(".fl-field-control-wrapper"),i.extras[l].multiple?o.each(function(e,t){e in i.extras[l].before&&""!=i.extras[l].before[e]&&c(this).prepend('<div class="fl-form-field-before">'+i.extras[l].before[e]+"</div>"),e in i.extras[l].after&&""!=i.extras[l].after[e]&&c(this).append('<div class="fl-form-field-after">'+i.extras[l].after[e]+"</div>")}):(""!=i.extras[l].before&&o.prepend('<div class="fl-form-field-before">'+i.extras[l].before+"</div>"),""!=i.extras[l].after&&o.append('<div class="fl-form-field-after">'+i.extras[l].after+"</div>"));for(n in i.sections)for(l in i.sections[n])c("#fl-builder-settings-section-"+l).html(i.sections[n][l]);for(l in i.tabs)(n=c("#fl-builder-settings-tab-"+l)).html(i.tabs[l]);e.data("parent")||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,t),FLBuilder.preview&&(this.settings=c.extend(this.settings,FLBuilder.preview._savedSettings),FLBuilder.preview._savedSettings=this.settings)),_.isUndefined(window.FLThemeBuilderFieldConnections)||FLThemeBuilderFieldConnections._initSettingsForms(),this.legacyXhr=null}},getLegacyVars:function(){var e=c(".fl-builder-settings:visible"),t=e.closest(".fl-builder-lightbox").attr("data-parent"),i={};return t&&(e=(t=c(".fl-builder-lightbox[data-instance-id="+t+"]")).find("form.fl-builder-settings"),t=FLBuilder._getSettings(e),(e=e.attr("data-node"))&&(i.node_id=e,i.node_settings=t)),i},settingsHaveChanged:function(){var e=FLBuilder._lightbox._node.find("form.fl-builder-settings"),e=FLBuilder._getSettings(e);return!!this.settings&&JSON.stringify(this.settings)!=JSON.stringify(e)},closeOnDeleteNode:function(e){var t=c(".fl-builder-settings[data-node]"),i=FLBuilder._contentClass+" .fl-node-"+t.data("node");t.length&&!c(i).length&&FLLightbox.closeAll()},showLightboxLoader:function(){c(".fl-builder-settings:visible").append('<div class="fl-builder-loading"></div>')},hideLightboxLoader:function(e){c(".fl-builder-settings:visible .fl-builder-loading").remove()},showFieldLoader:function(e){e.closest(".fl-field-control").find(".fl-field-control-wrapper").hide().after('<div class="fl-field-loader">'+FLBuilderStrings.fieldLoading+"</div>")},hideFieldLoader:function(e){var t=e.closest(".fl-field");e.closest(".fl-field-control").find(".fl-field-control-wrapper").show(),t.find(".fl-field-loader").remove()}},FLBuilderSettingsConfig="undefined"==typeof FLBuilderSettingsConfig?{}:FLBuilderSettingsConfig,c.extend(FLBuilderSettingsConfig,{init:function(){FLBuilder.addHook("didSaveNodeSettings",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveNodeSettingsComplete",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveLayoutSettingsComplete",this.updateOnSaveLayoutSettings.bind(this)),FLBuilder.addHook("didSaveGlobalSettingsComplete",this.updateOnSaveGlobalSettings.bind(this)),FLBuilder.addHook("didSaveGlobalSettingsComplete",this.reload),FLBuilder.addHook("didAddRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddColumnGroup",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didResizeRow",this.updateOnRowResize.bind(this)),FLBuilder.addHook("didResizeColumn",this.updateOnColumnResize.bind(this)),FLBuilder.addHook("didResetRowWidth",this.updateOnResetRowWidth.bind(this)),FLBuilder.addHook("didResetColumnWidths",this.updateOnResetColumnWidths.bind(this)),FLBuilder.addHook("didApplyTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didApplyRowTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didApplyColTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didSaveGlobalNodeTemplate",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didRestoreRevisionComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didRestoreHistoryComplete",this.updateOnHistoryRestored.bind(this))},reload:function(){var e=FLBuilderConfig.editUrl+"&fl_builder_load_settings_config=core";c('script[src*="fl_builder_load_settings_config=core"]').remove(),c("head").append('<script src="'+e+'"><\/script>')},updateOnSaveGlobalSettings:function(e,t){this.settings.global=t,FLBuilderConfig.global=t},updateOnSaveLayoutSettings:function(e,t){this.settings.layout=t},updateOnNodeEvent:function(){var e=arguments[0];-1<e.namespace.indexOf("didAdd")?this.addNode("object"==typeof arguments[1]?arguments[1].nodeId:arguments[1]):-1<e.namespace.indexOf("didSaveNodeSettings")?this.updateNode(arguments[1].nodeId,arguments[1].settings):-1<e.namespace.indexOf("didDelete")?this.deleteNodes("object"==typeof arguments[1]?arguments[1].nodeId:arguments[1]):-1<e.namespace.indexOf("didDuplicate")&&this.duplicateNode(arguments[1].oldNodeId,arguments[1].newNodeId)},updateOnRowResize:function(e,t){this.nodes[t.rowId].max_content_width=t.rowWidth},updateOnResetRowWidth:function(e,t){this.nodes[t].max_content_width=""},updateOnColumnResize:function(e,t){this.nodes[t.colId].size=t.colWidth,this.nodes[t.siblingId].size=t.siblingWidth},updateOnResetColumnWidths:function(e,t){var i=this;t.cols.each(function(){var e=c(this),t=e.attr("data-node");i.nodes[t]&&(i.nodes[t].size=parseFloat(e[0].style.width))})},updateOnApplyTemplate:function(e,t){this.nodes=t.nodes,this.attachments=t.attachments},updateOnHistoryRestored:function(e,t){this.nodes=t.config.nodes,this.attachments=t.config.attachments,this.settings.layout=t.settings.layout,this.settings.global=t.settings.global,FLBuilderConfig.global=t.settings.global},addNode:function(e,t){var i=c(".fl-node-"+e),l=i.hasClass("fl-row"),o=i.hasClass("fl-col"),n=i.hasClass("fl-col-group"),s=i.hasClass("fl-module"),r=this;this.nodes[e]||(t||(l?t=c.extend({},this.defaults.row):o?t=c.extend({},this.defaults.column):s&&(t=c.extend({},this.defaults.modules[i.attr("data-type")])),l||n?i.find(".fl-col").each(function(){var e=c(this),t=c.extend({},r.defaults.column);t.size=parseFloat(e[0].style.width),r.addNode(e.attr("data-node"),t)}):s&&(r.addNode(i.closest(".fl-row").attr("data-node")),r.addNode(i.closest(".fl-col").attr("data-node")),r.updateOnResetColumnWidths(null,{cols:i.closest(".fl-col-group").find("> .fl-col")}))),t&&(this.nodes[e]=t))},updateNode:function(e,i){var t=c(".fl-node-"+e),l=this;t.hasClass("fl-col")&&t.closest(".fl-col-group").find("> .fl-col").each(function(){var e=c(this),t=e.attr("data-node");l.nodes[t].size=parseFloat(e[0].style.width),l.nodes[t].equal_height=i.equal_height,l.nodes[t].content_alignment=i.content_alignment,l.nodes[t].responsive_order=i.responsive_order}),this.nodes[e]=i},duplicateNode:function(t,i){var e=c(".fl-node-"+i).find("[data-node]"),l=c(".fl-node-"+t).find("[data-node]"),o=this;this.nodes[i]=this.nodes[t],e.each(function(e){t=l.eq(e).attr("data-node"),i=c(this).attr("data-node"),o.nodes[t]&&(o.nodes[i]=o.nodes[t])})},deleteNodes:function(){var e="",t=c(FLBuilder._contentClass).html();if(t)for(e in this.nodes)-1===t.indexOf(e)&&(this.nodes[e]=null,delete this.nodes[e])}}),c(function(){FLBuilderSettingsConfig.init(),FLBuilderSettingsForms.init()})}(jQuery),!function(c){FLBuilderSettingsCopyPaste={init:function(){FLBuilder.addHook("settings-form-init",this.initExportButton),FLBuilder.addHook("settings-form-init",this.initImportButton)},initExportButton:function(){new ClipboardJS("button.module-export-all",{text:function(e){var t=c(".fl-builder-module-settings").data("node"),t=c(".fl-builder-module-settings[data-node="+t+"]"),i=c(".fl-builder-module-settings").data("type"),t=FLBuilder._getSettings(t),i="/// {type:"+i+"} "+(new Date).toDateString()+" ///",l=c("button.module-export-all"),o=l.attr("title");return l.text(FLBuilderStrings.module_import.copied),setTimeout(function(){l.text(o)},1e3),i+"\n"+JSON.stringify(t)}}),new ClipboardJS("button.module-export-style",{text:function(e){var t,i=c(".fl-builder-module-settings").data("node"),l=c(".fl-builder-module-settings[data-node="+i+"]"),i=c(".fl-builder-module-settings").data("type"),o=FLBuilder._getSettings(l),i="/// {type:"+i+"} "+(new Date).toDateString()+" ///",n=c("button.module-export-style"),s=n.attr("title"),r={};for(t in o){var a=l.find('[name="'+t+'"]'),d=l.find('[name*="'+t+'["]'),u=!1;a.length?u=a.closest(".fl-field").data("is-style"):d.length&&(u=d.closest(".fl-field").data("is-style")),u&&(r[t]=o[t])}return n.text(FLBuilderStrings.module_import.copied),setTimeout(function(){n.text(s)},1e3),i+"\n"+JSON.stringify(r)}})},initImportButton:function(){c("button.module-import-apply").click(function(){var e=c(".fl-builder-settings-lightbox .fl-builder-settings"),t=c(".module-import-input").val(),i=t.match(/\/\/\/\s\{type:([_a-z0-9-]+)/i),l=!1,o=c(".fl-builder-module-settings").data("type"),n=c(".fl-builder-settings-lightbox .module-import-error");if(n.hide(),!(l=i&&void 0!==i[1]?i[1]:l)||l!==o)return n.html(FLBuilderStrings.module_import.type).show(),!1;i=t.replace(/\/\/\/.+\/\/\//,"");try{var s=JSON.parse(i)}catch(e){s=!1;return n.html(FLBuilderStrings.module_import.error).show(),!1}if(s){l=e.attr("data-node"),o=c.extend({},FLBuilderSettingsConfig.nodes[l],s);FLBuilderSettingsConfig.nodes[l]=o;const r=FL.Builder.data.getLayoutActions();t=FLBuilder._saveSettingsComplete.bind(this,!0,null);r.updateNodeSettings(l,o,t),FLBuilder.triggerHook("didSaveNodeSettings",{nodeId:l,settings:o}),FLBuilder._lightbox.close()}})}},c(function(){FLBuilderSettingsCopyPaste.init()})}(jQuery),!function(a){var e={minWidth:320,maxWidth:600,minHeight:400,init:function(){this.initPanel(),this.pinOrUnpin(),this.bind()},bind:function(){var e=a(window),t=a("body");e.on("resize",_.throttle(this.windowResize.bind(this),250)),t.on("click",".fl-builder-ui-pinned-collapse",this.collapse),t.on("click",".fl-builder--content-library-panel .fl-builder--tabs",this.closeLightboxOnPanelClick),FLBuilder.addHook("didShowLightbox",this.pinLightboxOnOpen.bind(this)),FLBuilder.addHook("didHideAllLightboxes",this.pinnedLightboxClosed.bind(this)),FLBuilder.addHook("endEditingSession",this.hide.bind(this)),FLBuilder.addHook("didHideEditingUI",this.hide.bind(this)),FLBuilder.addHook("publishButtonClicked",this.hide.bind(this)),FLBuilder.addHook("restartEditingSession",this.show.bind(this)),FLBuilder.addHook("didShowEditingUI",this.show.bind(this)),FLBuilder.addHook("didShowLightbox",this.uncollapse.bind(this)),FLBuilder.addHook("willShowContentPanel",this.uncollapse.bind(this)),FLBuilder.addHook("willShowContentPanel",this.closeLightboxOnPanelClick.bind(this))},isPinned:function(){return a(".fl-builder--content-library-panel").hasClass("fl-builder-ui-pinned")},pin:function(e,t){this.pinPanel(e),this.pinLightboxes(),t&&this.savePosition(),FLBuilder._resizeLayout(),FLBuilder.triggerHook("didPinContentPanel")},unpin:function(e){this.unpinLightboxes(),this.unpinPanel(),e&&this.savePosition(),FLBuilder._resizeLayout(),FLBuilder.triggerHook("didUnpinContentPanel")},pinOrUnpin:function(){var e=a(".fl-builder--content-library-panel"),t=this.isPinned();e.hasClass("fl-builder-ui-pinned-hidden")||(window.innerWidth<=this.maxWidth?(t&&this.unpin(!1),this.disableDragAndResize()):(t||this.restorePosition(),this.enableDragAndResize()))},show:function(){var e=a(".fl-builder--content-library-panel");e.hasClass("fl-builder-ui-pinned-hidden")&&(e.removeClass("fl-builder-ui-pinned-hidden"),e.show(),this.restorePosition())},hide:function(){var e=a("body"),t=a(".fl-builder--content-library-panel");this.isPinned()&&(this.uncollapse(),t.addClass("fl-builder-ui-pinned-hidden"),t.hide(),e.css("margin",""),FLBuilder._resizeLayout())},collapse:function(){var e=a(this).find("i:visible"),t=a("body"),i=e.data("toggle"),e=e.data("position"),l=a(".fl-builder--content-library-panel"),o=l.outerWidth();"hide"===i?(l.css(e,"-"+o+"px"),t.css("margin-"+e,""),t.addClass("fl-builder-ui-pinned-is-collapsed")):(l.css(e,"0px"),t.css("margin-"+e,o+"px"),t.removeClass("fl-builder-ui-pinned-is-collapsed"))},uncollapse:function(){this.isCollapsed()&&a(".fl-builder-ui-pinned-collapse:visible").trigger("click")},isCollapsed:function(){return a("body").hasClass("fl-builder-ui-pinned-is-collapsed")},initPanel:function(){var e=a(".fl-builder--content-library-panel"),t=0==a(".fl-builder-content-panel-button").length?".fl-builder--tabs, .fl-lightbox-header":".fl-builder--tabs";e.draggable({cursor:"move",handle:t,cancel:".fl-builder--tabs button",scroll:!1,drag:this.drag.bind(this),stop:this.dragStop.bind(this),start:this.dragStart.bind(this)}).resizable({handles:"e, w",minHeight:this.minHeight,minWidth:this.minWidth,maxWidth:this.maxWidth,start:this.resizeStart.bind(this),stop:this.resizeStop.bind(this)}),e.addClass("fl-builder-ui-pinned-container"),e.find(".ui-resizable-e, .ui-resizable-w").hide()},pinPanel:function(e){var t=a(".fl-builder--content-library-panel"),i=t.outerWidth(),l=a("body"),o=a(".fl-responsive-preview, .fl-responsive-preview-mask"),n=a(FLBuilder._contentClass).parentsUntil("body").last();l.addClass("fl-builder-ui-is-pinned fl-builder-ui-is-pinned-"+e),l.addClass("fl-builder-content-panel-is-showing"),l.css("margin-"+e,i+"px"),o.css("margin-"+e,i+"px"),n.addClass("fl-builder-ui-pinned-content-transform"),t.addClass("fl-builder-ui-pinned fl-builder-ui-pinned-"+e),t.find(".ui-resizable-"+("left"===e?"e":"w")).show(),t.on("resize",_.throttle(this.resize.bind(this),250)),t.attr("style",""),FLBuilder.ContentPanel.isShowing=!0,0==a(".fl-builder-content-panel-button").length&&a(".fl-builder-panel-drag-handle").show()},unpinPanel:function(){var e=a(".fl-builder--content-library-panel"),t=e.find(".fl-builder--panel-content .is-showing").data("tab"),i=a("body"),l=a(".fl-responsive-preview, .fl-responsive-preview-mask"),o=a(FLBuilder._contentClass).parentsUntil("body").last();i.css("margin-left",""),i.css("margin-right",""),i.removeClass("fl-builder-ui-is-pinned"),i.removeClass("fl-builder-ui-is-pinned-left"),i.removeClass("fl-builder-ui-is-pinned-right"),l.css("margin-left",""),l.css("margin-right",""),o.removeClass("fl-lightbox-content-transform"),e.removeClass("fl-builder-ui-pinned"),e.removeClass("fl-builder-ui-pinned-left"),e.removeClass("fl-builder-ui-pinned-right"),e.find(".ui-resizable-handle").hide(),e.off("resize"),e.attr("style",""),e.find(".fl-builder--tabs [data-tab="+t+"]").addClass("is-showing")},pinLightboxes:function(){var e=this;a(".fl-lightbox-resizable").each(function(){e.pinLightbox(a(this))}),FLBuilder._reinitEditorFields()},pinLightbox:function(e){var t=a(".fl-builder--content-library-panel"),i=e.closest(".fl-lightbox-wrap");i.closest(".fl-builder-ui-pinned").length||(t.append(i),e.attr("style",""),e.draggable("disable"),e.resizable("disable")),e.is(":visible")&&t.find(".fl-builder--tabs .is-showing").removeClass("is-showing")},pinLightboxOnOpen:function(e,t){t=t._node.find(".fl-lightbox-resizable");t.length&&(t.hasClass("fl-builder-ui-pinning-initialized")||(t.draggable("option","start",this.dragStart.bind(this)),t.draggable("option","drag",this.drag.bind(this)),t.draggable("option","stop",this.dragStop.bind(this)),t.addClass("fl-builder-ui-pinning-initialized")),this.isPinned()&&this.pinLightbox(t),FLBuilder.addHook("responsive-editing-switched",this.resize))},pinnedLightboxClosed:function(){var e=a(".fl-builder--content-library-panel");tab=null,this.isPinned()&&(tab=e.find(".fl-builder--panel-content .is-showing").data("tab"),e.find(".fl-builder--tabs [data-tab="+tab+"]").addClass("is-showing")),a(".fl-lightbox").removeClass("fl-lightbox-prevent-animation")},unpinLightboxes:function(){var o=a("body"),n=a(".fl-builder--content-library-panel");n.find(".fl-lightbox-wrap").each(function(){var e,t,i=a(this),l=i.find(".fl-lightbox");l.draggable("enable"),l.resizable("enable"),l.find(".ui-resizable-handle").show(),o.append(i),l.is(":visible")?(e=parseInt(n.css("top"))-parseInt(i.css("top"))-parseInt(i.css("padding-top")),t=parseInt(n.css("left"))-parseInt(i.css("padding-left")),i=parseInt(n.css("right"))-parseInt(i.css("padding-right")),l.css("top",(e<0?0:e)+"px"),l.css(FLBuilderConfig.isRtl?"right":"left",(FLBuilderConfig.isRtl?i:t)+"px"),l.addClass("fl-lightbox-prevent-animation"),o.removeClass("fl-builder-content-panel-is-showing"),FLBuilder.ContentPanel.isShowing=!1):l.css({top:"25px",left:"25px"})}),FLBuilder._reinitEditorFields()},closeLightboxOnPanelClick:function(){FLBuilder._triggerSettingsSave(!1,!0)},windowResize:function(){this.pinOrUnpin()},resizeStart:function(){a("body").addClass("fl-builder-resizable-is-resizing"),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()},resize:function(){var e=a("body"),t=a(".fl-responsive-preview, .fl-responsive-preview-mask"),i=a(".fl-builder--content-library-panel"),l=i.outerWidth();i.is(":visible")?i.hasClass("fl-builder-ui-pinned-left")?(e.css("margin-left",l+"px"),t.css("margin-left",l+"px")):i.hasClass("fl-builder-ui-pinned-right")&&(e.css("margin-right",l+"px"),t.css("margin-right",l+"px")):e.css("margin","")},resizeStop:function(){a("body").removeClass("fl-builder-resizable-is-resizing"),FLBuilder._bindOverlayEvents(),FLBuilder._resizeLayout(),this.savePosition()},dragStart:function(e,t){var i=a("body"),e=(a(e.target),a(".fl-builder-bar-actions"));a(".fl-lightbox-resizable:visible").length||e.addClass("fl-builder-content-panel-pin-zone"),i.addClass("fl-builder-draggable-is-dragging"),i.append('<div class="fl-builder-ui-pin-zone fl-builder-ui-pin-zone-left"></div>'),i.append('<div class="fl-builder-ui-pin-zone fl-builder-ui-pin-zone-right"></div>'),FLBuilder._destroyOverlayEvents()},drag:function(e,t){var i=a("body"),l=a(".fl-responsive-preview"),o=a(window),l=(l.length?l:o).width(),o=o.scrollTop(),n=a(".fl-builder--content-library-panel").offset().top,s=a(".fl-builder-bar-actions"),r=a(e.target);r.hasClass("fl-builder--content-library-panel")&&(e.clientX<l-75&&n-o<46?s.addClass("fl-builder-content-panel-pin-zone-hover"):s.removeClass("fl-builder-content-panel-pin-zone-hover")),r.hasClass("fl-builder-ui-pinned")?this.unpinPanel():e.clientX<75?i.addClass("fl-builder-ui-show-pin-zone fl-builder-ui-show-pin-zone-left"):e.clientX>l-75?i.addClass("fl-builder-ui-show-pin-zone fl-builder-ui-show-pin-zone-right"):(i.removeClass("fl-builder-ui-show-pin-zone"),i.removeClass("fl-builder-ui-show-pin-zone-left"),i.removeClass("fl-builder-ui-show-pin-zone-right"))},dragStop:function(e,t){a(window);var i=a("body"),l=a(".fl-builder-bar-actions"),o=a(".fl-builder-ui-pin-zone"),n=a(".fl-builder--content-library-panel"),s=a(".fl-lightbox-resizable:visible");a(e.target);i.removeClass("fl-builder-draggable-is-dragging"),l.removeClass("fl-builder-content-panel-pin-zone"),l.removeClass("fl-builder-content-panel-pin-zone-hover"),o.remove(),s.length&&parseInt(s.css("top"))<0&&s.css("top","0"),i.hasClass("fl-builder-ui-show-pin-zone")?(i.hasClass("fl-builder-ui-show-pin-zone-left")?this.pin("left",!0):this.pin("right",!0),i.removeClass("fl-builder-ui-show-pin-zone"),i.removeClass("fl-builder-ui-show-pin-zone-left"),i.removeClass("fl-builder-ui-show-pin-zone-right")):n.find(".fl-lightbox").length?(this.unpin(!0),"module"!==FLBuilderConfig.userTemplateType&&!FLBuilderConfig.simpleUi||n.hide()):(n.attr("style",""),this.savePosition()),FLBuilder._bindOverlayEvents()},disableDragAndResize:function(){var e=a(".fl-builder--content-library-panel"),t=a(".fl-lightbox-resizable");e.draggable("disable"),e.resizable("disable"),t.draggable("disable"),t.resizable("disable")},enableDragAndResize:function(){var e=a(".fl-builder--content-library-panel"),t=a(".fl-lightbox-resizable:not(.fl-lightbox-width-full)");e.draggable("enable"),e.resizable("enable"),this.isPinned()||(t.draggable("enable"),t.resizable("enable"))},savePosition:function(){var e=a(".fl-builder--content-library-panel"),t=a(".fl-lightbox-resizable:visible"),i={pinned:{width:e.outerWidth(),position:null}};e.hasClass("fl-builder-ui-pinned-left")?i.pinned.position="left":e.hasClass("fl-builder-ui-pinned-right")?i.pinned.position="right":t.length&&(i.lightbox={width:t.width(),height:t.height(),top:parseInt(t.css("top"))<0?"0px":t.css("top"),left:t.css("left")}),FLBuilderConfig.userSettings.pinned=i.pinned,i.lightbox&&(FLBuilderConfig.userSettings.lightbox=i.lightbox),FLBuilder.ajax({action:"save_pinned_ui_position",data:i})},restorePosition:function(){var e=a(".fl-builder--content-library-panel"),t=FLBuilderConfig.userSettings.pinned;t&&t.position&&(e.css("width",t.width+"px"),this.pin(t.position,!1),e.css("width",t.width+"px"))}};a(function(){e.init()})}(jQuery),!function(r){var i={init:function(){this.setupMainMenuData(),r(".fl-builder--revision-actions select").on("change",this.selectChanged),r(".fl-cancel-revision-preview").on("click",this.exitPreview.bind(this)),r(".fl-apply-revision-preview").on("click",this.applyClicked.bind(this)),FLBuilder.addHook("revisionItemClicked",this.itemClicked.bind(this)),FLBuilder.addHook("didPublishLayout",this.refreshItems.bind(this))},setupMainMenuData:function(){var e,t,i=FLBuilderConfig.revisions.posts,l=FLBuilderConfig.revisions.authors,o=wp.template("fl-revision-list-item"),n=r(".fl-builder--revision-actions select"),s=0;if(FLBuilderConfig.mainMenu.revisions.items=[],n.html(""),0===i.length)FLBuilderConfig.mainMenu.revisions.items.push({eventName:"noRevisionsMessage",type:"event",label:wp.template("fl-no-revisions-message")()});else for(;s<i.length;s++)e=FLBuilderStrings.revisionDate.replace("%s",i[s].date.diff),e+=" ("+i[s].date.published+")",t=FLBuilderStrings.revisionAuthor.replace("%s",l[i[s].author].name),FLBuilderConfig.mainMenu.revisions.items.push({eventName:"revisionItemClicked",type:"event",label:o({id:i[s].id,date:e,author:t,avatar:l[i[s].author].avatar})}),n.append('<option value="'+i[s].id+'">'+e+"</option>");void 0!==FLBuilder.MainMenu&&FLBuilder.MainMenu.renderPanel("revisions")},refreshItems:function(){FLBuilder.ajax({action:"refresh_revision_items"},this.refreshItemsComplete.bind(this))},refreshItemsComplete:function(e){FLBuilderConfig.revisions=FLBuilder._jsonParse(e),this.setupMainMenuData()},itemClicked:function(e,t){t=r(t).find(".fl-revision-list-item").attr("data-revision-id");FLBuilder._triggerSettingsSave(!1,!0)&&(r(".fl-builder--revision-actions select").val(t),this.preview(t))},selectChanged:function(e){i.preview(r(this).val())},applyClicked:function(e){var t=r(".fl-builder--revision-actions select").val();i.restore(t)},preview:function(e){r(".fl-builder--revision-actions").css("display","flex"),FLBuilder.triggerHook("didEnterRevisionPreview"),FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"render_revision_preview",revision_id:e},this.previewRenderComplete.bind(this))},previewRenderComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()})},exitPreview:function(){r(".fl-builder--revision-actions").hide(),FLBuilder.triggerHook("didExitRevisionPreview"),FLBuilder._bindOverlayEvents(),FLBuilder._updateLayout()},restore:function(e){r(".fl-builder--revision-actions").hide(),FLBuilder.triggerHook("didExitRevisionPreview"),FLBuilder.showAjaxLoader(),FLBuilder._bindOverlayEvents(),FLBuilder.ajax({action:"restore_revision",revision_id:e},i.restoreComplete)},restoreComplete:function(e){e=FLBuilder._jsonParse(e);FLBuilder._renderLayout(e.layout),FLBuilder.triggerHook("didRestoreRevisionComplete",e.config),void 0!==(settings=e.settings).css&&null!==settings.css&&(FLBuilderSettingsConfig.settings.layout.css=settings.css),void 0!==settings.js&&null!==settings.js&&(FLBuilderSettingsConfig.settings.layout.js=settings.js)}};r(function(){i.init()})}(jQuery),!function(){var t={query:function(e){var t,i={},l={library:{}};if(e=this.normalizeQuery(e),_.isNull(e.kind))i=FLBuilderConfig.contentItems;else for(var o in e.kind)i[o=e.kind[o]]=FLBuilderConfig.contentItems[o];return t=this.findMatches(e,i),l.library=this.formatResults(t,e),l},normalizeQuery:function(e){return e=_.extend({kind:null,type:null,category:null,group:null,enabled:!0,global:null,searchTerm:null,categorized:!1},e),_.isString(e.kind)&&(e.kind=[e.kind]),e},findMatches:function(e,t){var i,l,o,n,s={},r=null,a=null;for(r in t)for(a in i=t[r],s[r]={items:[]},i)if(l=i[a],_.isUndefined(e.category)||_.isNull(e.category)||this.matchesCategory(l.category,e.category)){switch(r){case"template":if(!(_.isUndefined(e.content)||_.isNull(e.content)||(o=_.includes(e.content,l.content),n=e.content===l.content,o||n)))continue;if(!_.isUndefined(e.type)&&!_.isNull(e.type)&&e.type!==l.type)continue;if(!_.isNull(e.group)){var d=e.group,u=l.group;if(_.isString(d)&&(d=[d]),_.isString(u)&&(u=[u]),_.isEmpty(d)||_.isEmpty(u))continue;var c=!1;for(a in d){var h=d[a];_.includes(u,h)&&(c=!0)}if(!c)continue}break;case"module":if(!_.isNull(e.group)){if(!1===e.group&&0<l.group.length)continue;if(!1!==e.group&&!_.includes(l.group,e.group))continue}}(_.isUndefined(e.searchTerm)||_.isNull(e.searchTerm)||this.matchesSearchTerm(l,e.searchTerm))&&s[r].items.push(l)}return s},matchesCategory:function(e,t){var i,l,o,n;if(e===t)return!0;for(l in t=_.isString(t)?[t]:t){if(i=t[l],_.isString(e)&&e===i)return!0;if(_.isArray(e))for(o in e)if(e[o]===i)return!0;if(_.isObject(e))for(n in e)if(e[n]===i||n===i)return!0}return!1},matchesSearchTerm:function(e,t){var i=t.toLowerCase();return!(_.isUndefined(e.slug)||!e.slug.toLowerCase().includes(i))||(!(_.isUndefined(e.name)||!e.name.toLowerCase().includes(i))||(!(!_.isString(e.category)||!e.category.toLowerCase().includes(i))||(!(_.isUndefined(e.description)||!e.description.toLowerCase().includes(i))||(!(_.isUndefined(e.id_base)||!e.id_base.includes(t))||(!(!e.isWidget||!"widget".includes(i))||!(_.isUndefined(e.editor_export)||!"module".includes(i)))))))},formatResults:function(e,t){if(t.categorized)for(type in e){var i=e[type].items;e[type].categorized=this.groupBy(i,"category")}return e},groupBy:function(e,i){var o,n,s={};return _.forEach(e,function(l,e,t){o=l[i],_.isNull(o)||_.isUndefined(o)||_.isString(o)&&""===l[o]||(_.isString(o)&&(s[o]=s[o]||[],s[o].push(l)),_.isArray(o)&&(n=o,_.forEach(n,function(e,t,i){s[e]=s[e]||[],s[e].push(l)})),_.isObject(o)&&(n=o,_.forEach(n,function(e,t,i){s[e]=s[e]||[],s[e].push(l)})))}),s},search:function(e){var t=this.query({searchTerm:e}),i={total:0,term:e,sections:{}};if(!_.isUndefined(t.library.module.items)){var l,o={};for(l in t.library.module.items){var n=t.library.module.items[l],s=n.group[0],r=n.category;n.name;_.isUndefined(o[s])&&(o[s]={}),_.isUndefined(o[s][r])&&(o[s][r]=[]),o[s][r].push(n)}i.grouped=o}for(l in t.library){var a=t.library[l];!_.isUndefined(a.items)&&0<a.items.length&&(i.sections[l]={name:FLBuilderStrings.typeLabels[l],handle:l,type:"",items:a.items},i.total+=a.items.length)}return i}};FLBuilder.Search={byQuery:function(e){return t.query(e)},byTerm:function(e){return t.search(e)}}}(jQuery),!function(i,l){var o={layoutNeedsPublish:!1,defaultIndicatorMessage:"",defaultTooltipMessage:"",messages:null,init:function(){this.messages=FLBuilderStrings.savedStatus,this.$savingIndicator=i(".fl-builder--saving-indicator"),l.addHook("didBeginAJAX",this.onLayoutSaving.bind(this)),l.addHook("didCompleteAJAX",this.onLayoutSaved.bind(this)),l.addHook("didPublishLayout",this.onLayoutPublished.bind(this)),l.addHook("publishAndRemain",this.onPublishAndRemain.bind(this)),l.addHook("didShowLightbox",this.setLayoutNeedsPublish.bind(this)),!FLBuilderConfig.layoutHasDraftedChanges&&FLBuilderConfig.builderEnabled||(this.setLayoutNeedsPublish(),this.resetStatusMessage())},setLayoutNeedsPublish:function(){this.layoutNeedsPublish||(this.layoutNeedsPublish=!0,i("body").addClass("fl-builder--layout-has-drafted-changes"))},onLayoutSaving:function(e,t){this.isPublishingLayout(t.action)?this.showStatusMessage(this.messages.publishing,this.messages.publishingTooltip):this.isUpdatingLayout(t.action)&&(this.setLayoutNeedsPublish(),this.showStatusMessage(this.messages.saving,this.messages.savingTooltip))},isPublishingLayout:function(e){return"save_layout"==e},isUpdatingLayout:function(e){return!this.isPublishingLayout()&&(e.startsWith("render")?!!e.startsWith("render_new"):!e.startsWith("duplicate")&&(!e.startsWith("refresh")&&("save_ui_skin"!=e&&("save_lightbox_position"!=e&&("save_pinned_ui_position"!=e&&("fl_builder_notifications"!=e&&!(-1<e.indexOf("history"))))))))},onLayoutSaved:function(e,t){var i;this.isUpdatingLayout(t.fl_builder_data.action)&&(this.showStatusMessage(this.messages.saved,this.messages.savedTooltip),i=this,setTimeout(function(){i.resetStatusMessage()},2e3))},onLayoutPublished:function(){this.layoutNeedsPublish=!1,i("body").removeClass("fl-builder--layout-has-drafted-changes"),this.resetStatusMessage()},showStatusMessage:function(e,t){this.$savingIndicator.html(e),l.isUndefined(t)||(this.$savingIndicator.attr("title",t),i(".fl-builder--saving-indicator").tipTip({defaultPosition:"bottom",edgeOffset:14}))},resetStatusMessage:function(){this.layoutNeedsPublish?(this.defaultIndicatorMessage=this.messages.edited+'<i class="fas fa-question-circle"></i>',this.defaultTooltipMessage=this.messages.editedTooltip):(this.defaultIndicatorMessage="",this.defaultTooltipMessage=""),this.showStatusMessage(this.defaultIndicatorMessage,this.defaultTooltipMessage)},onPublishAndRemain:function(){var e;l.MainMenu.hide(),this.layoutNeedsPublish||FLBuilderSettingsForms.settingsHaveChanged()?l._publishLayout(!1,!0):(this.showStatusMessage(this.messages.noChanges),e=this,setTimeout(function(){e.resetStatusMessage()},2e3))}};l.SaveManager={layoutNeedsPublish:function(){return o.layoutNeedsPublish},showStatusMessage:function(e,t){o.showStatusMessage(e,t)},resetStatusMessage:function(){o.resetStatusMessage()}},i(function(){o.init()})}(jQuery,FLBuilder),!function(o){FLBuilderHistoryManager={states:[],position:0,rendering:!1,init:function(){var e=FLBuilderConfig.history,l=this;this.states=e.states,this.position=parseInt(e.position),this.setupMainMenuData(),o.each(e.hooks,function(e,i){FLBuilder.addHook(e,function(e,t){l.saveCurrentState(i,t)})}),FLBuilder.addHook("didPublishLayout",this.clearStatesOnPublish.bind(this)),FLBuilder.addHook("restartEditingSession",this.saveCurrentStateOnRestartSession.bind(this)),FLBuilder.addHook("historyItemClicked",this.itemClicked.bind(this)),FLBuilder.addHook("undo",this.onUndo.bind(this)),FLBuilder.addHook("redo",this.onRedo.bind(this))},saveCurrentState:function(e,t){var i=null;void 0!==(t=void 0===t?{}:t).moduleType&&t.moduleType&&(i=t.moduleType);const l=FL.Builder.data.getLayoutActions();l.saveHistoryState(e,i)},saveCurrentStateOnRestartSession:function(e){this.states.length||this.saveCurrentState("draft_created")},clearStatesOnPublish:function(e,t){this.states=[],this.position=0,this.setupMainMenuData();const i=FL.Builder.data.getLayoutActions();i.clearHistoryStates(FLBuilderConfig.postId,t.shouldExit)},renderState:function(e){var t=this;if(!this.rendering&&this.states.length&&!o(".fl-builder-settings:visible").length){var i=setTimeout(FLBuilder.showAjaxLoader,2e3);this.rendering=!0;const l=FL.Builder.data.getLayoutActions();l.renderHistoryState(e,function(e){e=JSON.parse(e);e.error||(t.position=parseInt(e.position),FLBuilder.triggerHook("didRestoreHistoryComplete",e),FLBuilder._renderLayout(e.layout),t.setupMainMenuData()),clearTimeout(i),t.rendering=!1})}},onUndo:function(){const e=FL.Builder.data.getLayoutActions();e.undo()},onRedo:function(){const e=FL.Builder.data.getLayoutActions();e.redo()},setupMainMenuData:function(){var e=FLBuilderConfig.history.labels,t="";FLBuilderConfig.mainMenu.history.items=[];for(var i=this.states.length-1;0<=i;i--)"string"==typeof this.states[i]?t=e[this.states[i]]||this.states[i]:(t=e[this.states[i].label]||this.states[i].label,(this.states[i].moduleType||-1<this.states[i].label.indexOf("module"))&&(t=t.replace("%s",this.getModuleName(this.states[i].moduleType)))),FLBuilderConfig.mainMenu.history.items.push({eventName:"historyItemClicked",type:"event",label:wp.template("fl-history-list-item")({label:t,current:i===this.position?1:0,position:i})});FLBuilderConfig.history.enabled||FLBuilderConfig.mainMenu.history.items.push({eventName:"historyItemClicked",type:"event",label:wp.template("fl-history-list-item")({label:FLBuilderConfig.history.labels.history_disabled,current:0,position:0})}),void 0!==FLBuilder.MainMenu&&FLBuilder.MainMenu.renderPanel("history")},getModuleName:function(e){var t=FLBuilderConfig.contentItems.module,i=0;if("widget"===e)return FLBuilderStrings.widget;for(;i<t.length;i++)if(void 0!==t[i].slug&&e===t[i].slug)return t[i].name;return FLBuilderStrings.module},itemClicked:function(e,t){var t=o(t).find(".fl-history-list-item"),i=t.attr("data-position"),l=o(".fl-history-list-item[data-current=1]");o(".fl-builder-settings:visible").length&&(FLBuilder._closeNestedSettings(),FLBuilder._lightbox.close()),l.attr("data-current",0),t.attr("data-current",1),this.renderState(i)}},o(function(){FLBuilderHistoryManager.init()})}(jQuery),!function(exports){"use strict";exports.stringify=function(e){return JSON.stringify(e,function(e,t){var i;return t instanceof Function||"function"==typeof t?(i=t.toString()).length<8||"function"!==i.substring(0,8)?"_NuFrRa_"+i:i:t instanceof RegExp?"_PxEgEr_"+t:t})},exports.parse=function(str,date2obj){var iso8061=!!date2obj&&/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/;return JSON.parse(str,function(key,value){var prefix;return"string"!=typeof value?value:value.length<8?value:(prefix=value.substring(0,8),iso8061&&value.match(iso8061)?new Date(value):"function"===prefix?eval("("+value+")"):"_PxEgEr_"===prefix||"_NuFrRa_"===prefix?eval(value.slice(8)):value)})},exports.clone=function(e,t){return exports.parse(exports.stringify(e),t)}}("undefined"==typeof exports?window.JSONfn={}:exports);
|
json/fonts.json
CHANGED
@@ -13,6 +13,11 @@
|
|
13 |
"variants": ["regular", "500", "600", "700", "800"],
|
14 |
"fallback": "serif"
|
15 |
}
|
|
|
|
|
|
|
|
|
|
|
16 |
}, {
|
17 |
"Abril Fatface": {
|
18 |
"variants": ["regular"],
|
@@ -198,11 +203,21 @@
|
|
198 |
"variants": ["100", "200", "300", "regular", "500", "600", "700", "800", "900", "100italic", "200italic", "300italic", "italic", "500italic", "600italic", "700italic", "800italic", "900italic"],
|
199 |
"fallback": "sans-serif"
|
200 |
}
|
|
|
|
|
|
|
|
|
|
|
201 |
}, {
|
202 |
"Alumni Sans Inline One": {
|
203 |
"variants": ["regular", "italic"],
|
204 |
"fallback": "sans-serif"
|
205 |
}
|
|
|
|
|
|
|
|
|
|
|
206 |
}, {
|
207 |
"Amarante": {
|
208 |
"variants": ["regular"],
|
@@ -1668,6 +1683,11 @@
|
|
1668 |
"variants": ["regular"],
|
1669 |
"fallback": "sans-serif"
|
1670 |
}
|
|
|
|
|
|
|
|
|
|
|
1671 |
}, {
|
1672 |
"Dynalight": {
|
1673 |
"variants": ["regular"],
|
@@ -1938,6 +1958,11 @@
|
|
1938 |
"variants": ["regular"],
|
1939 |
"fallback": "cursive"
|
1940 |
}
|
|
|
|
|
|
|
|
|
|
|
1941 |
}, {
|
1942 |
"Finger Paint": {
|
1943 |
"variants": ["regular"],
|
@@ -2080,7 +2105,7 @@
|
|
2080 |
}
|
2081 |
}, {
|
2082 |
"Fruktur": {
|
2083 |
-
"variants": ["regular"],
|
2084 |
"fallback": "sans-serif"
|
2085 |
}
|
2086 |
}, {
|
@@ -3925,7 +3950,7 @@
|
|
3925 |
}
|
3926 |
}, {
|
3927 |
"MuseoModerno": {
|
3928 |
-
"variants": ["100", "200", "300", "regular", "500", "600", "700", "800", "900"],
|
3929 |
"fallback": "sans-serif"
|
3930 |
}
|
3931 |
}, {
|
@@ -4883,6 +4908,11 @@
|
|
4883 |
"variants": ["100", "200", "300", "regular", "500", "600", "700", "800", "900"],
|
4884 |
"fallback": "serif"
|
4885 |
}
|
|
|
|
|
|
|
|
|
|
|
4886 |
}, {
|
4887 |
"Noto Serif Hebrew": {
|
4888 |
"variants": ["100", "200", "300", "regular", "500", "600", "700", "800", "900"],
|
@@ -5843,11 +5873,41 @@
|
|
5843 |
"variants": ["regular"],
|
5844 |
"fallback": "sans-serif"
|
5845 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5846 |
}, {
|
5847 |
"Rubik Glitch": {
|
5848 |
"variants": ["regular"],
|
5849 |
"fallback": "sans-serif"
|
5850 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5851 |
}, {
|
5852 |
"Rubik Microbe": {
|
5853 |
"variants": ["regular"],
|
@@ -6178,6 +6238,11 @@
|
|
6178 |
"variants": ["300", "regular", "500", "600", "700"],
|
6179 |
"fallback": "sans-serif"
|
6180 |
}
|
|
|
|
|
|
|
|
|
|
|
6181 |
}, {
|
6182 |
"Simonetta": {
|
6183 |
"variants": ["regular", "italic", "900", "900italic"],
|
13 |
"variants": ["regular", "500", "600", "700", "800"],
|
14 |
"fallback": "serif"
|
15 |
}
|
16 |
+
}, {
|
17 |
+
"Aboreto": {
|
18 |
+
"variants": ["regular"],
|
19 |
+
"fallback": "sans-serif"
|
20 |
+
}
|
21 |
}, {
|
22 |
"Abril Fatface": {
|
23 |
"variants": ["regular"],
|
203 |
"variants": ["100", "200", "300", "regular", "500", "600", "700", "800", "900", "100italic", "200italic", "300italic", "italic", "500italic", "600italic", "700italic", "800italic", "900italic"],
|
204 |
"fallback": "sans-serif"
|
205 |
}
|
206 |
+
}, {
|
207 |
+
"Alumni Sans Collegiate One": {
|
208 |
+
"variants": ["regular", "italic"],
|
209 |
+
"fallback": "sans-serif"
|
210 |
+
}
|
211 |
}, {
|
212 |
"Alumni Sans Inline One": {
|
213 |
"variants": ["regular", "italic"],
|
214 |
"fallback": "sans-serif"
|
215 |
}
|
216 |
+
}, {
|
217 |
+
"Alumni Sans Pinstripe": {
|
218 |
+
"variants": ["regular", "italic"],
|
219 |
+
"fallback": "sans-serif"
|
220 |
+
}
|
221 |
}, {
|
222 |
"Amarante": {
|
223 |
"variants": ["regular"],
|
1683 |
"variants": ["regular"],
|
1684 |
"fallback": "sans-serif"
|
1685 |
}
|
1686 |
+
}, {
|
1687 |
+
"DynaPuff": {
|
1688 |
+
"variants": ["regular", "500", "600", "700"],
|
1689 |
+
"fallback": "sans-serif"
|
1690 |
+
}
|
1691 |
}, {
|
1692 |
"Dynalight": {
|
1693 |
"variants": ["regular"],
|
1958 |
"variants": ["regular"],
|
1959 |
"fallback": "cursive"
|
1960 |
}
|
1961 |
+
}, {
|
1962 |
+
"Figtree": {
|
1963 |
+
"variants": ["300", "regular", "500", "600", "700", "800", "900"],
|
1964 |
+
"fallback": "sans-serif"
|
1965 |
+
}
|
1966 |
}, {
|
1967 |
"Finger Paint": {
|
1968 |
"variants": ["regular"],
|
2105 |
}
|
2106 |
}, {
|
2107 |
"Fruktur": {
|
2108 |
+
"variants": ["regular", "italic"],
|
2109 |
"fallback": "sans-serif"
|
2110 |
}
|
2111 |
}, {
|
3950 |
}
|
3951 |
}, {
|
3952 |
"MuseoModerno": {
|
3953 |
+
"variants": ["100", "200", "300", "regular", "500", "600", "700", "800", "900", "100italic", "200italic", "300italic", "italic", "500italic", "600italic", "700italic", "800italic", "900italic"],
|
3954 |
"fallback": "sans-serif"
|
3955 |
}
|
3956 |
}, {
|
4908 |
"variants": ["100", "200", "300", "regular", "500", "600", "700", "800", "900"],
|
4909 |
"fallback": "serif"
|
4910 |
}
|
4911 |
+
}, {
|
4912 |
+
"Noto Serif HK": {
|
4913 |
+
"variants": ["200", "300", "regular", "500", "600", "700", "800", "900"],
|
4914 |
+
"fallback": "serif"
|
4915 |
+
}
|
4916 |
}, {
|
4917 |
"Noto Serif Hebrew": {
|
4918 |
"variants": ["100", "200", "300", "regular", "500", "600", "700", "800", "900"],
|
5873 |
"variants": ["regular"],
|
5874 |
"fallback": "sans-serif"
|
5875 |
}
|
5876 |
+
}, {
|
5877 |
+
"Rubik Burned": {
|
5878 |
+
"variants": ["regular"],
|
5879 |
+
"fallback": "sans-serif"
|
5880 |
+
}
|
5881 |
+
}, {
|
5882 |
+
"Rubik Dirt": {
|
5883 |
+
"variants": ["regular"],
|
5884 |
+
"fallback": "sans-serif"
|
5885 |
+
}
|
5886 |
+
}, {
|
5887 |
+
"Rubik Distressed": {
|
5888 |
+
"variants": ["regular"],
|
5889 |
+
"fallback": "sans-serif"
|
5890 |
+
}
|
5891 |
}, {
|
5892 |
"Rubik Glitch": {
|
5893 |
"variants": ["regular"],
|
5894 |
"fallback": "sans-serif"
|
5895 |
}
|
5896 |
+
}, {
|
5897 |
+
"Rubik Iso": {
|
5898 |
+
"variants": ["regular"],
|
5899 |
+
"fallback": "sans-serif"
|
5900 |
+
}
|
5901 |
+
}, {
|
5902 |
+
"Rubik Marker Hatch": {
|
5903 |
+
"variants": ["regular"],
|
5904 |
+
"fallback": "sans-serif"
|
5905 |
+
}
|
5906 |
+
}, {
|
5907 |
+
"Rubik Maze": {
|
5908 |
+
"variants": ["regular"],
|
5909 |
+
"fallback": "sans-serif"
|
5910 |
+
}
|
5911 |
}, {
|
5912 |
"Rubik Microbe": {
|
5913 |
"variants": ["regular"],
|
6238 |
"variants": ["300", "regular", "500", "600", "700"],
|
6239 |
"fallback": "sans-serif"
|
6240 |
}
|
6241 |
+
}, {
|
6242 |
+
"Silkscreen": {
|
6243 |
+
"variants": ["regular", "700"],
|
6244 |
+
"fallback": "sans-serif"
|
6245 |
+
}
|
6246 |
}, {
|
6247 |
"Simonetta": {
|
6248 |
"variants": ["regular", "italic", "900", "900italic"],
|
modules/photo/includes/frontend.js.php
CHANGED
@@ -10,7 +10,7 @@ jQuery(function($) {
|
|
10 |
image: {
|
11 |
titleSrc: function(item) {
|
12 |
<?php if ( 'below' == $settings->show_caption || 'hover' == $settings->show_caption ) : ?>
|
13 |
-
return '<?php echo
|
14 |
<?php endif; ?>
|
15 |
}
|
16 |
},
|
@@ -34,4 +34,5 @@ jQuery(function($) {
|
|
34 |
} );
|
35 |
});
|
36 |
<?php endif; ?>
|
|
|
37 |
});
|
10 |
image: {
|
11 |
titleSrc: function(item) {
|
12 |
<?php if ( 'below' == $settings->show_caption || 'hover' == $settings->show_caption ) : ?>
|
13 |
+
return FLBuilderLayout._string_to_slug( '<?php echo str_replace( array( "\r", "\n" ), array( '', ' ' ), trim( addslashes( $module->get_caption() ) ) ); ?>' );
|
14 |
<?php endif; ?>
|
15 |
}
|
16 |
},
|
34 |
} );
|
35 |
});
|
36 |
<?php endif; ?>
|
37 |
+
window._fl_string_to_slug_regex = '<?php echo apply_filters( 'fl_photocaptionregex', 'a-zA-Z0-9' ); ?>';
|
38 |
});
|
modules/photo/photo.php
CHANGED
@@ -350,7 +350,7 @@ class FLPhotoModule extends FLBuilderModule {
|
|
350 |
$is_svg = ! empty( $photo->mime ) && 'image/svg+xml' === $photo->mime;
|
351 |
|
352 |
if ( $is_svg && isset( $photo->sizes ) ) {
|
353 |
-
if ( $photo->sizes->full->height && $photo->sizes->full->width ) {
|
354 |
$attrs .= 'height="' . $photo->sizes->full->height . '" width="' . $photo->sizes->full->width . '" ';
|
355 |
}
|
356 |
}
|
350 |
$is_svg = ! empty( $photo->mime ) && 'image/svg+xml' === $photo->mime;
|
351 |
|
352 |
if ( $is_svg && isset( $photo->sizes ) ) {
|
353 |
+
if ( isset( $photo->sizes->full->height ) && isset( $photo->sizes->full->width ) ) {
|
354 |
$attrs .= 'height="' . $photo->sizes->full->height . '" width="' . $photo->sizes->full->width . '" ';
|
355 |
}
|
356 |
}
|
modules/video/video.php
CHANGED
@@ -78,7 +78,7 @@ class FLVideoModule extends FLBuilderModule {
|
|
78 |
$video_sc = sprintf( '%s', __( 'Video not specified. Please select one to display.', 'fl-builder' ) );
|
79 |
|
80 |
if ( ! empty( $vid_data->url ) ) {
|
81 |
-
$video_sc = '[video ' . $vid_data->extension . '="' . $vid_data->url . '"' . $vid_data->video_webm . ' poster="' . $video_poster . '" ' . $vid_data->autoplay . $vid_data->loop . $preload . '][/video]';
|
82 |
}
|
83 |
|
84 |
if ( 'yes' === $this->settings->video_lightbox ) {
|
78 |
$video_sc = sprintf( '%s', __( 'Video not specified. Please select one to display.', 'fl-builder' ) );
|
79 |
|
80 |
if ( ! empty( $vid_data->url ) ) {
|
81 |
+
$video_sc = '[video ' . $vid_data->extension . '="' . preg_replace( '/\/?\?.*/', '', $vid_data->url ) . '"' . $vid_data->video_webm . ' poster="' . $video_poster . '" ' . $vid_data->autoplay . $vid_data->loop . $preload . '][/video]';
|
82 |
}
|
83 |
|
84 |
if ( 'yes' === $this->settings->video_lightbox ) {
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: page builder, beaver builder, landing page, front-end builder, drag and dr
|
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 6.0
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 2.5.5.
|
8 |
License: GPL2+
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 6.0
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 2.5.5.5
|
8 |
License: GPL2+
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|