Version Description
Download this release
Release Info
Developer | pross |
Plugin | WordPress Page Builder – Beaver Builder |
Version | 2.1.2.4 |
Comparing to | |
See all releases |
Code changes from version 2.1.2.2 to 2.1.2.4
- changelog.txt +24 -0
- classes/class-fl-builder-admin.php +28 -0
- classes/class-fl-builder-filesystem.php +4 -2
- classes/class-fl-builder-loader.php +1 -1
- classes/class-fl-builder-privacy.php +15 -2
- css/build/builder.bundle.css +16 -8
- css/build/builder.bundle.min.css +1 -1
- fl-builder.php +1 -1
- includes/ui-js-config.php +4 -2
- includes/updater-config.php +1 -1
- js/build/builder.bundle.js +79 -61
- js/build/builder.bundle.min.js +3 -3
- js/fl-builder-ui-pinned.js +4 -4
- js/fl-builder-ui.js +2 -0
- js/fl-builder.js +28 -1
- js/fl-builder.min.js +9 -9
- js/fl-color-picker.js +1 -1
- js/fl-lightbox.js +1 -1
- languages/en_GB.mo +0 -0
- languages/fi.mo +0 -0
- languages/fr_CA.mo +0 -0
- languages/fr_FR.mo +0 -0
- languages/it_IT.mo +0 -0
- languages/nb_NO.mo +0 -0
- languages/nl_NL.mo +0 -0
- languages/pl_PL.mo +0 -0
- languages/pt_BR.mo +0 -0
- languages/pt_PT.mo +0 -0
- languages/sk_SK.mo +0 -0
- languages/sl_SI.mo +0 -0
- languages/sv_SE.mo +0 -0
changelog.txt
CHANGED
@@ -1,3 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<h4>2.1.2.2 - 05/17/2018</h4>
|
2 |
<strong>Bug Fixes</strong>
|
3 |
<ul>
|
1 |
+
<h4>2.1.2.4 - 05/31/2018</h4>
|
2 |
+
<strong>Bug Fixes</strong>
|
3 |
+
<ul>
|
4 |
+
<li>Fixed module settings opening when clicking the column icon.</li>
|
5 |
+
</ul>
|
6 |
+
|
7 |
+
<h4>2.1.2.3 - 05/31/2018</h4>
|
8 |
+
<strong>Enhancements</strong>
|
9 |
+
<ul>
|
10 |
+
<li>Show warning message if plugin is installed in wrong folder as it breaks auto-updates.</li>
|
11 |
+
<li>Allow users to <em>Save With Errors</em> in the CSS/HTML code editor.</li>
|
12 |
+
</ul>
|
13 |
+
<strong>Bug Fixes</strong>
|
14 |
+
<ul>
|
15 |
+
<li>Fixed adjacent module settings opening when highlighting text with inline editing.</li>
|
16 |
+
<li>Fixed incorrect text showing after inline editing.</li>
|
17 |
+
<li>Fixed inline editing performance issues.</li>
|
18 |
+
<li>Fixed Contact Form Module field connections.</li>
|
19 |
+
<li>Fixed pinned content panel covering 2px of the content area.</li>
|
20 |
+
<li>Fixed UI lightboxes appearing in wrong positions.</li>
|
21 |
+
<li>Added link to change logs from wp-admin plugins page.</li>
|
22 |
+
<li>Fixed color picker position in responsive editing mode.</li>
|
23 |
+
</ul>
|
24 |
+
|
25 |
<h4>2.1.2.2 - 05/17/2018</h4>
|
26 |
<strong>Bug Fixes</strong>
|
27 |
<ul>
|
classes/class-fl-builder-admin.php
CHANGED
@@ -21,6 +21,7 @@ final class FLBuilderAdmin {
|
|
21 |
|
22 |
// Actions
|
23 |
add_action( 'admin_init', __CLASS__ . '::show_activate_notice' );
|
|
|
24 |
|
25 |
// Filters
|
26 |
add_filter( 'plugin_action_links_' . $basename, __CLASS__ . '::render_plugin_action_links' );
|
@@ -86,6 +87,24 @@ final class FLBuilderAdmin {
|
|
86 |
die( $message );
|
87 |
}
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
/**
|
90 |
* Sets the transient that triggers the activation notice
|
91 |
* or welcome page redirect.
|
@@ -185,6 +204,15 @@ final class FLBuilderAdmin {
|
|
185 |
$actions[] = '<a href="' . $url . '" style="color:#3db634;" target="_blank">' . _x( 'Upgrade', 'Plugin action link label.', 'fl-builder' ) . '</a>';
|
186 |
}
|
187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
return $actions;
|
189 |
}
|
190 |
|
21 |
|
22 |
// Actions
|
23 |
add_action( 'admin_init', __CLASS__ . '::show_activate_notice' );
|
24 |
+
add_action( 'admin_init', __CLASS__ . '::sanity_checks' );
|
25 |
|
26 |
// Filters
|
27 |
add_filter( 'plugin_action_links_' . $basename, __CLASS__ . '::render_plugin_action_links' );
|
87 |
die( $message );
|
88 |
}
|
89 |
|
90 |
+
/**
|
91 |
+
* @since 2.1.3
|
92 |
+
*/
|
93 |
+
static public function sanity_checks() {
|
94 |
+
|
95 |
+
if ( true !== FL_BUILDER_LITE ) {
|
96 |
+
// fetch the plugin install folder this should be bb-plugin
|
97 |
+
$folder = rtrim( FLBuilderModel::plugin_basename(), '/fl-builder.php' );
|
98 |
+
|
99 |
+
if ( 'bb-plugin' != $folder ) {
|
100 |
+
|
101 |
+
$error = sprintf( __( 'Install Error! We detected that Beaver Builder appears to be installed in a folder called <kbd>%s</kbd>.<br />For automatic updates to work the plugin must be installed in the folder <kbd>bb-plugin</kbd>.', 'fl-builder' ), $folder );
|
102 |
+
FLBuilderAdminSettings::add_error( $error );
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
}
|
107 |
+
|
108 |
/**
|
109 |
* Sets the transient that triggers the activation notice
|
110 |
* or welcome page redirect.
|
204 |
$actions[] = '<a href="' . $url . '" style="color:#3db634;" target="_blank">' . _x( 'Upgrade', 'Plugin action link label.', 'fl-builder' ) . '</a>';
|
205 |
}
|
206 |
|
207 |
+
if ( ! FLBuilderModel::is_white_labeled() ) {
|
208 |
+
$url = FLBuilderModel::get_store_url( 'change-logs', array(
|
209 |
+
'utm_medium' => 'bb-pro',
|
210 |
+
'utm_source' => 'plugins-admin-page',
|
211 |
+
'utm_campaign' => 'plugins-admin-changelog',
|
212 |
+
) );
|
213 |
+
$actions[] = '<a href="' . $url . '" target="_blank">' . _x( 'Change Log', 'Plugin action link label.', 'fl-builder' ) . '</a>';
|
214 |
+
}
|
215 |
+
|
216 |
return $actions;
|
217 |
}
|
218 |
|
classes/class-fl-builder-filesystem.php
CHANGED
@@ -133,12 +133,14 @@ class FL_Filesystem {
|
|
133 |
if ( ! $wp_filesystem || 'direct' != $wp_filesystem->method ) {
|
134 |
require_once ABSPATH . '/wp-admin/includes/file.php';
|
135 |
|
|
|
|
|
136 |
add_filter( 'filesystem_method', array( $this, 'filesystem_method' ) );
|
137 |
add_filter( 'request_filesystem_credentials', array( $this, 'request_filesystem_credentials' ) );
|
138 |
|
139 |
-
$creds = request_filesystem_credentials( site_url(), '', true,
|
140 |
|
141 |
-
WP_Filesystem( $creds );
|
142 |
|
143 |
remove_filter( 'filesystem_method', array( $this, 'filesystem_method' ) );
|
144 |
remove_filter( 'request_filesystem_credentials', array( $this, 'FLBuilderUtils::request_filesystem_credentials' ) );
|
133 |
if ( ! $wp_filesystem || 'direct' != $wp_filesystem->method ) {
|
134 |
require_once ABSPATH . '/wp-admin/includes/file.php';
|
135 |
|
136 |
+
$context = apply_filters( 'request_filesystem_credentials_context', false );
|
137 |
+
|
138 |
add_filter( 'filesystem_method', array( $this, 'filesystem_method' ) );
|
139 |
add_filter( 'request_filesystem_credentials', array( $this, 'request_filesystem_credentials' ) );
|
140 |
|
141 |
+
$creds = request_filesystem_credentials( site_url(), '', true, $context, null );
|
142 |
|
143 |
+
WP_Filesystem( $creds, $context );
|
144 |
|
145 |
remove_filter( 'filesystem_method', array( $this, 'filesystem_method' ) );
|
146 |
remove_filter( 'request_filesystem_credentials', array( $this, 'FLBuilderUtils::request_filesystem_credentials' ) );
|
classes/class-fl-builder-loader.php
CHANGED
@@ -46,7 +46,7 @@ if ( ! class_exists( 'FLBuilderLoader' ) ) {
|
|
46 |
* @return void
|
47 |
*/
|
48 |
static private function define_constants() {
|
49 |
-
define( 'FL_BUILDER_VERSION', '2.1.2.
|
50 |
define( 'FL_BUILDER_FILE', trailingslashit( dirname( dirname( __FILE__ ) ) ) . 'fl-builder.php' );
|
51 |
define( 'FL_BUILDER_DIR', plugin_dir_path( FL_BUILDER_FILE ) );
|
52 |
define( 'FL_BUILDER_URL', plugins_url( '/', FL_BUILDER_FILE ) );
|
46 |
* @return void
|
47 |
*/
|
48 |
static private function define_constants() {
|
49 |
+
define( 'FL_BUILDER_VERSION', '2.1.2.4' );
|
50 |
define( 'FL_BUILDER_FILE', trailingslashit( dirname( dirname( __FILE__ ) ) ) . 'fl-builder.php' );
|
51 |
define( 'FL_BUILDER_DIR', plugin_dir_path( FL_BUILDER_FILE ) );
|
52 |
define( 'FL_BUILDER_URL', plugins_url( '/', FL_BUILDER_FILE ) );
|
classes/class-fl-builder-privacy.php
CHANGED
@@ -31,12 +31,18 @@ final class FLBuilderPrivacy {
|
|
31 |
$data = array();
|
32 |
|
33 |
$user = get_user_by( 'email', $email );
|
34 |
-
$meta = get_user_meta( $user->ID, 'fl_builder_user_settings', true );
|
35 |
|
36 |
-
$result =
|
37 |
|
38 |
foreach ( $result as $key => $setting ) {
|
|
|
|
|
|
|
|
|
|
|
39 |
if ( ! is_array( $setting ) ) {
|
|
|
40 |
if ( '' == $setting ) {
|
41 |
$setting = 'false';
|
42 |
}
|
@@ -47,6 +53,13 @@ final class FLBuilderPrivacy {
|
|
47 |
}
|
48 |
}
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
$export_items[] = array(
|
51 |
'group_id' => 'bb-settings',
|
52 |
'group_label' => 'Beaver Builder Settings',
|
31 |
$data = array();
|
32 |
|
33 |
$user = get_user_by( 'email', $email );
|
34 |
+
$meta = (array) get_user_meta( $user->ID, 'fl_builder_user_settings', true );
|
35 |
|
36 |
+
$result = self::array_flatten( $meta );
|
37 |
|
38 |
foreach ( $result as $key => $setting ) {
|
39 |
+
|
40 |
+
if ( ! $key ) {
|
41 |
+
continue;
|
42 |
+
}
|
43 |
+
|
44 |
if ( ! is_array( $setting ) ) {
|
45 |
+
|
46 |
if ( '' == $setting ) {
|
47 |
$setting = 'false';
|
48 |
}
|
53 |
}
|
54 |
}
|
55 |
|
56 |
+
if ( empty( $data ) ) {
|
57 |
+
return array(
|
58 |
+
'data' => array(),
|
59 |
+
'done' => true,
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
$export_items[] = array(
|
64 |
'group_id' => 'bb-settings',
|
65 |
'group_label' => 'Beaver Builder Settings',
|
css/build/builder.bundle.css
CHANGED
@@ -1,23 +1,29 @@
|
|
1 |
.fl-editable {
|
2 |
position: relative;
|
3 |
-webkit-user-select: text; }
|
4 |
-
.fl-editable.fl-module {
|
5 |
-
cursor: pointer; }
|
6 |
-
.fl-editable .fl-block-overlay {
|
7 |
-
pointer-events: none; }
|
8 |
-
.fl-editable .fl-block-overlay-actions,
|
9 |
-
.fl-editable .fl-block-col-resize {
|
10 |
-
pointer-events: auto; }
|
11 |
.fl-editable .mce-content-body {
|
12 |
cursor: text; }
|
13 |
.fl-editable .mce-content-body * {
|
14 |
cursor: text; }
|
|
|
|
|
15 |
.fl-editable .mce-content-body:not(.mce-edit-focus) [data-mce-selected] {
|
16 |
background: none; }
|
17 |
-
.fl-editable .mce-
|
|
|
18 |
.fl-editable .mce-edit-focus {
|
19 |
outline: none !important; }
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
.fl-inline-editor {
|
22 |
border: 2px solid #00A0D2;
|
23 |
border-radius: 4px;
|
@@ -36,6 +42,8 @@
|
|
36 |
top: 4px; }
|
37 |
.fl-inline-editor.fl-inline-editor-no-toolbar > .mce-tinymce {
|
38 |
display: none; }
|
|
|
|
|
39 |
.fl-inline-editor > .mce-tinymce {
|
40 |
background: transparent;
|
41 |
border: none !important;
|
1 |
.fl-editable {
|
2 |
position: relative;
|
3 |
-webkit-user-select: text; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
.fl-editable .mce-content-body {
|
5 |
cursor: text; }
|
6 |
.fl-editable .mce-content-body * {
|
7 |
cursor: text; }
|
8 |
+
.fl-editable .mce-content-body:not(.mce-edit-focus):empty {
|
9 |
+
height: 0; }
|
10 |
.fl-editable .mce-content-body:not(.mce-edit-focus) [data-mce-selected] {
|
11 |
background: none; }
|
12 |
+
.fl-editable .mce-content-body,
|
13 |
+
.fl-editable .mce-content-body:focus,
|
14 |
.fl-editable .mce-edit-focus {
|
15 |
outline: none !important; }
|
16 |
|
17 |
+
.fl-editable-focused.fl-module {
|
18 |
+
cursor: pointer; }
|
19 |
+
|
20 |
+
.fl-editable-focused .fl-block-overlay {
|
21 |
+
pointer-events: none; }
|
22 |
+
|
23 |
+
.fl-editable-focused .fl-block-overlay-actions,
|
24 |
+
.fl-editable-focused .fl-block-col-resize {
|
25 |
+
pointer-events: auto; }
|
26 |
+
|
27 |
.fl-inline-editor {
|
28 |
border: 2px solid #00A0D2;
|
29 |
border-radius: 4px;
|
42 |
top: 4px; }
|
43 |
.fl-inline-editor.fl-inline-editor-no-toolbar > .mce-tinymce {
|
44 |
display: none; }
|
45 |
+
.fl-inline-editor > .mce-tinymce.fl-inline-editor-active-toolbar {
|
46 |
+
display: block !important; }
|
47 |
.fl-inline-editor > .mce-tinymce {
|
48 |
background: transparent;
|
49 |
border: none !important;
|
css/build/builder.bundle.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.fl-editable{position:relative;-webkit-user-select:text}.fl-editable.fl-
|
1 |
+
.fl-editable{position:relative;-webkit-user-select:text}.fl-editable .mce-content-body,.fl-editable .mce-content-body *{cursor:text}.fl-editable .mce-content-body:not(.mce-edit-focus):empty{height:0}.fl-editable .mce-content-body:not(.mce-edit-focus) [data-mce-selected]{background:none}.fl-editable .mce-content-body,.fl-editable .mce-content-body:focus,.fl-editable .mce-edit-focus{outline:none!important}.fl-editable-focused.fl-module{cursor:pointer}.fl-editable-focused .fl-block-overlay{pointer-events:none}.fl-editable-focused .fl-block-col-resize,.fl-editable-focused .fl-block-overlay-actions{pointer-events:auto}.fl-inline-editor{border:2px solid #00a0d2;border-radius:4px;display:none;overflow:hidden;pointer-events:none;position:absolute;top:-32px;right:4px;bottom:4px;left:4px;z-index:100008}.fl-inline-editor.fl-inline-editor-no-toolbar{top:4px}.fl-inline-editor.fl-inline-editor-no-toolbar>.mce-tinymce{display:none}.fl-inline-editor>.mce-tinymce.fl-inline-editor-active-toolbar{display:block!important}.fl-inline-editor>.mce-tinymce{background:transparent;border:none!important;overflow:hidden;pointer-events:auto;position:absolute;top:-2px!important;right:-2px!important;left:-2px!important;width:auto!important}.fl-inline-editor .mce-container-body,.fl-inline-editor .mce-tinymce,.fl-inline-editor .mce-toolbar-grp{height:32px!important;width:auto!important}.fl-inline-editor .mce-container-body{padding:0}.fl-inline-editor .mce-toolbar-grp{background:#00a0d2;border:none;border-top-left-radius:4px;border-bottom-right-radius:4px;width:auto!important;display:inline-block}.fl-inline-editor .mce-tinymce-inline .mce-flow-layout{white-space:normal}.fl-inline-editor .mce-btn-group{padding:0 3px}.fl-inline-editor .mce-btn-group:not(:first-child){border-color:hsla(0,0%,100%,.3)}.fl-inline-editor .mce-toolbar .mce-btn-group .mce-btn.mce-active,.fl-inline-editor .mce-toolbar .mce-btn-group .mce-btn.mce-active:focus,.fl-inline-editor .mce-toolbar .mce-btn-group .mce-btn.mce-active:hover,.fl-inline-editor .mce-toolbar .mce-btn-group .mce-btn:active,.fl-inline-editor .mce-toolbar .mce-btn-group .mce-btn:focus,.fl-inline-editor .mce-toolbar .mce-btn-group .mce-btn:hover{background:hsla(0,0%,100%,.2);border-color:hsla(0,0%,100%,.4);box-shadow:none}.fl-inline-editor .mce-toolbar .mce-btn button{padding:1px}.fl-inline-editor .mce-toolbar .mce-btn .mce-ico{color:hsla(0,0%,100%,.8)!important}.fl-inline-editor .mce-toolbar .mce-btn:hover .mce-ico{color:#fff!important}.fl-inline-editor .mce-panel .mce-btn i.mce-caret{border-top-color:hsla(0,0%,100%,.8)!important;border-bottom-color:hsla(0,0%,100%,.8)!important}.fl-inline-editor .mce-panel .mce-btn:hover i.mce-caret{border-top-color:#fff!important}.fl-heading-text.mce-content-body{display:block}.mce-tooltip{display:none!important}.fl-notifications-panel{position:fixed;top:48px;left:0;bottom:0;width:380px;background:#f5f7f9;color:#555;border-right:2px solid #d5dadd;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif!important;font-size:14px;z-index:999999;display:flex;flex-direction:column}.fl-notifications-panel .fl-nanoscroller .fl-nanoscroller-content{padding:0 15px}.fl-notifications-panel .fl-panel-title{flex:0 0 auto;padding:15px 30px;font-size:18px}.fl-notifications-panel .fl-builder-ui-post{flex:0 0 auto;display:flex;display:block;padding:15px;margin:15px 0;border-radius:4px;text-decoration:none;color:inherit}.fl-notifications-panel .fl-builder-ui-post:first-child{margin-top:0}.fl-notifications-panel .fl-builder-ui-post:hover{text-decoration:none;background:#fff;color:#000}.fl-notifications-panel .fl-builder-ui-post .fl-builder-ui-post-title{font-size:17px;line-height:1.4;margin-bottom:10px;color:#0089b4}.fl-notifications-panel .fl-builder-ui-post .fl-builder-ui-post-date{text-transform:uppercase;font-size:12px;font-weight:700;margin-bottom:10px}.fl-notifications-panel .fl-panel-loading-message{padding:0 15px;align-items:center;justify-content:center;display:flex;height:100%}.fl-builder-bar-spacer{flex:1 1 100%}#bell-active-dot{visibility:hidden}.fl-builder-has-new-notifications #bell-active-dot{visibility:visible}
|
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.1.2.
|
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.1.2.4
|
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
@@ -52,7 +52,7 @@ echo 'FLBuilderConfig = ' . json_encode( apply_filters('fl_builder_
|
|
52 |
'notifications' => FLBuilderNotifications::get_notifications(),
|
53 |
'isWhiteLabeled' => FLBuilderModel::is_white_labeled(),
|
54 |
'inlineEnabled' => FLBuilderModel::is_inline_enabled(),
|
55 |
-
'CheckCodeErrors'
|
56 |
|
57 |
) ) ) . ';';
|
58 |
|
@@ -70,7 +70,9 @@ echo 'FLBuilderStrings = ' . json_encode( apply_filters('fl_builder_
|
|
70 |
'changeTemplateMessage' => esc_attr__( 'Warning! Changing the template will replace your existing layout. Do you really want to do this?', 'fl-builder' ),
|
71 |
'colorPresets' => esc_attr__( 'Color Presets', 'fl-builder' ),
|
72 |
'colorPicker' => esc_attr__( 'Color Picker', 'fl-builder' ),
|
73 |
-
'codeError' => esc_attr__( '
|
|
|
|
|
74 |
'column' => esc_attr__( 'Column', 'fl-builder' ),
|
75 |
'contentSliderSelectLayout' => esc_attr__( 'Please select either a background layout or content layout before submitting.', 'fl-builder' ),
|
76 |
'countdownDateisInThePast' => esc_attr__( 'Error! Please enter a date that is in the future.', 'fl-builder' ),
|
52 |
'notifications' => FLBuilderNotifications::get_notifications(),
|
53 |
'isWhiteLabeled' => FLBuilderModel::is_white_labeled(),
|
54 |
'inlineEnabled' => FLBuilderModel::is_inline_enabled(),
|
55 |
+
'CheckCodeErrors' => FLBuilderModel::is_codechecking_enabled(),
|
56 |
|
57 |
) ) ) . ';';
|
58 |
|
70 |
'changeTemplateMessage' => esc_attr__( 'Warning! Changing the template will replace your existing layout. Do you really want to do this?', 'fl-builder' ),
|
71 |
'colorPresets' => esc_attr__( 'Color Presets', 'fl-builder' ),
|
72 |
'colorPicker' => esc_attr__( 'Color Picker', 'fl-builder' ),
|
73 |
+
'codeError' => esc_attr__( 'This code has errors. We recommend you fix them before saving.', 'fl-builder' ),
|
74 |
+
'codeErrorFix' => esc_attr__( 'Fix Errors', 'fl-builder' ),
|
75 |
+
'codeErrorIgnore' => esc_attr__( 'Save With Errors', 'fl-builder' ),
|
76 |
'column' => esc_attr__( 'Column', 'fl-builder' ),
|
77 |
'contentSliderSelectLayout' => esc_attr__( 'Please select either a background layout or content layout before submitting.', 'fl-builder' ),
|
78 |
'countdownDateisInThePast' => esc_attr__( 'Error! Please enter a date that is in the future.', 'fl-builder' ),
|
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.1.2.
|
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.1.2.4',
|
7 |
'slug' => 'bb-plugin',
|
8 |
'type' => 'plugin',
|
9 |
));
|
js/build/builder.bundle.js
CHANGED
@@ -19708,7 +19708,6 @@ var InlineEditor = function (_Component) {
|
|
19708 |
|
19709 |
if (FLBuilder) {
|
19710 |
// Setup actions
|
19711 |
-
FLBuilder.addHook('init', setupEditables);
|
19712 |
FLBuilder.addHook('settingsConfigLoaded', setupEditables);
|
19713 |
FLBuilder.addHook('restartEditingSession', setupEditables);
|
19714 |
|
@@ -19763,7 +19762,7 @@ var InlineEditor = function (_Component) {
|
|
19763 |
|
19764 |
module.append(overlay);
|
19765 |
module.addClass('fl-editable');
|
19766 |
-
module.
|
19767 |
module.on('mouseleave', this.onModuleMouseleave.bind(this));
|
19768 |
|
19769 |
var _loop = function _loop(key) {
|
@@ -19798,14 +19797,11 @@ var InlineEditor = function (_Component) {
|
|
19798 |
init_instance_callback: function init_instance_callback(editor) {
|
19799 |
_this3.onEditorInit(editor);
|
19800 |
/**
|
19801 |
-
*
|
19802 |
-
*
|
19803 |
-
*
|
19804 |
*/
|
19805 |
-
|
19806 |
-
editable.html(editableHTML);
|
19807 |
-
editable.addClass('fl-editable-has-dynamic-content');
|
19808 |
-
}
|
19809 |
}
|
19810 |
});
|
19811 |
};
|
@@ -19849,7 +19845,7 @@ var InlineEditor = function (_Component) {
|
|
19849 |
var extras = jQuery('.wplink-autocomplete, .ui-helper-hidden-accessible');
|
19850 |
|
19851 |
editables.removeAttr('contenteditable');
|
19852 |
-
modules.
|
19853 |
modules.off('mouseleave');
|
19854 |
modules.removeClass('fl-editable');
|
19855 |
overlays.remove();
|
@@ -19903,7 +19899,7 @@ var InlineEditor = function (_Component) {
|
|
19903 |
}, {
|
19904 |
key: 'getEditorEventVars',
|
19905 |
value: function getEditorEventVars(target) {
|
19906 |
-
var editable = jQuery(target);
|
19907 |
var editor = tinymce.get(editable.attr('id'));
|
19908 |
var field = editable.data('field');
|
19909 |
var module = editable.closest('.fl-module');
|
@@ -19918,8 +19914,8 @@ var InlineEditor = function (_Component) {
|
|
19918 |
editor.on('keyup', this.onEditorChange.bind(this));
|
19919 |
editor.on('undo', this.onEditorChange.bind(this));
|
19920 |
editor.on('redo', this.onEditorChange.bind(this));
|
19921 |
-
editor.on('blur', this.onEditorBlur.bind(this));
|
19922 |
editor.on('focus', this.onEditorFocus.bind(this));
|
|
|
19923 |
editor.on('mousedown', this.onEditorMousedown.bind(this));
|
19924 |
}
|
19925 |
}, {
|
@@ -19953,8 +19949,8 @@ var InlineEditor = function (_Component) {
|
|
19953 |
}
|
19954 |
}
|
19955 |
}, {
|
19956 |
-
key: '
|
19957 |
-
value: function
|
19958 |
var _getEditorEventVars2 = this.getEditorEventVars(e.target.bodyElement),
|
19959 |
editable = _getEditorEventVars2.editable,
|
19960 |
editor = _getEditorEventVars2.editor,
|
@@ -19963,47 +19959,46 @@ var InlineEditor = function (_Component) {
|
|
19963 |
nodeId = _getEditorEventVars2.nodeId;
|
19964 |
|
19965 |
var overlay = module.find('.fl-inline-editor');
|
19966 |
-
var
|
19967 |
-
var isClean = !field ? false : this.matchHTML(editor.getContent(), this.getFieldHTML(field, settings));
|
19968 |
|
19969 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19970 |
|
19971 |
-
if (
|
19972 |
-
|
19973 |
-
|
19974 |
-
|
19975 |
-
editable.html(editable.data('original'));
|
19976 |
}
|
|
|
|
|
|
|
|
|
19977 |
}
|
19978 |
}, {
|
19979 |
-
key: '
|
19980 |
-
value: function
|
19981 |
var _getEditorEventVars3 = this.getEditorEventVars(e.target.bodyElement),
|
19982 |
editable = _getEditorEventVars3.editable,
|
19983 |
editor = _getEditorEventVars3.editor,
|
19984 |
-
module = _getEditorEventVars3.module
|
19985 |
-
field = _getEditorEventVars3.field,
|
19986 |
-
nodeId = _getEditorEventVars3.nodeId;
|
19987 |
|
19988 |
var overlay = module.find('.fl-inline-editor');
|
19989 |
-
var
|
19990 |
-
|
19991 |
-
this.showEditorOverlay(module);
|
19992 |
|
19993 |
-
|
19994 |
-
|
19995 |
-
} else {
|
19996 |
-
overlay.addClass('fl-inline-editor-no-toolbar');
|
19997 |
-
}
|
19998 |
|
19999 |
-
if (
|
20000 |
-
editable.
|
20001 |
-
editable.
|
20002 |
-
editable.css('min-height', editable.height());
|
20003 |
-
editable.data('original', editable.html());
|
20004 |
-
editor.setContent(wp.editor.autop(settings[field.name]));
|
20005 |
-
editor.selection.select(editor.getBody(), true);
|
20006 |
-
editor.selection.collapse(false);
|
20007 |
}
|
20008 |
}
|
20009 |
}, {
|
@@ -20014,26 +20009,27 @@ var InlineEditor = function (_Component) {
|
|
20014 |
|
20015 |
this.showEditorOverlay(module);
|
20016 |
}
|
20017 |
-
}, {
|
20018 |
-
key: 'onModuleMouseup',
|
20019 |
-
value: function onModuleMouseup(e) {
|
20020 |
-
var module = jQuery(e.currentTarget);
|
20021 |
-
var editorId = module.find('.mce-content-body').first().attr('id');
|
20022 |
-
var overlay = jQuery(e.target).closest('.fl-module-overlay');
|
20023 |
-
|
20024 |
-
if (!overlay.length) {
|
20025 |
-
if (editorId && !module.find('.mce-edit-focus').length) {
|
20026 |
-
tinymce.get(editorId).focus();
|
20027 |
-
}
|
20028 |
-
this.showModuleSettings(module);
|
20029 |
-
}
|
20030 |
-
}
|
20031 |
}, {
|
20032 |
key: 'onEditorDrop',
|
20033 |
value: function onEditorDrop(e) {
|
20034 |
e.preventDefault();
|
20035 |
return false;
|
20036 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20037 |
}, {
|
20038 |
key: 'onModuleMouseleave',
|
20039 |
value: function onModuleMouseleave(e) {
|
@@ -20047,8 +20043,16 @@ var InlineEditor = function (_Component) {
|
|
20047 |
}, {
|
20048 |
key: 'showEditorOverlay',
|
20049 |
value: function showEditorOverlay(module) {
|
20050 |
-
module.find('.fl-inline-editor')
|
20051 |
this.hideNodeOverlays();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20052 |
}
|
20053 |
}, {
|
20054 |
key: 'hideEditorOverlays',
|
@@ -20079,9 +20083,23 @@ var InlineEditor = function (_Component) {
|
|
20079 |
}
|
20080 |
}
|
20081 |
}, {
|
20082 |
-
key: '
|
20083 |
-
value: function
|
20084 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20085 |
|
20086 |
if ('editor' === field.type && '' !== html) {
|
20087 |
return wp.editor.autop(html);
|
19708 |
|
19709 |
if (FLBuilder) {
|
19710 |
// Setup actions
|
|
|
19711 |
FLBuilder.addHook('settingsConfigLoaded', setupEditables);
|
19712 |
FLBuilder.addHook('restartEditingSession', setupEditables);
|
19713 |
|
19762 |
|
19763 |
module.append(overlay);
|
19764 |
module.addClass('fl-editable');
|
19765 |
+
module.delegate('.fl-block-overlay', 'click', this.onModuleOverlayClick.bind(this));
|
19766 |
module.on('mouseleave', this.onModuleMouseleave.bind(this));
|
19767 |
|
19768 |
var _loop = function _loop(key) {
|
19797 |
init_instance_callback: function init_instance_callback(editor) {
|
19798 |
_this3.onEditorInit(editor);
|
19799 |
/**
|
19800 |
+
* TinyMCE can change the editable's HTML which changes the visual
|
19801 |
+
* appearance. To prevent this from happening, we reinsert the original
|
19802 |
+
* HTML after the editable has been initialized.
|
19803 |
*/
|
19804 |
+
editable.html(editableHTML);
|
|
|
|
|
|
|
19805 |
}
|
19806 |
});
|
19807 |
};
|
19845 |
var extras = jQuery('.wplink-autocomplete, .ui-helper-hidden-accessible');
|
19846 |
|
19847 |
editables.removeAttr('contenteditable');
|
19848 |
+
modules.undelegate('.fl-block-overlay', 'click');
|
19849 |
modules.off('mouseleave');
|
19850 |
modules.removeClass('fl-editable');
|
19851 |
overlays.remove();
|
19899 |
}, {
|
19900 |
key: 'getEditorEventVars',
|
19901 |
value: function getEditorEventVars(target) {
|
19902 |
+
var editable = jQuery(target).closest('.mce-content-body');
|
19903 |
var editor = tinymce.get(editable.attr('id'));
|
19904 |
var field = editable.data('field');
|
19905 |
var module = editable.closest('.fl-module');
|
19914 |
editor.on('keyup', this.onEditorChange.bind(this));
|
19915 |
editor.on('undo', this.onEditorChange.bind(this));
|
19916 |
editor.on('redo', this.onEditorChange.bind(this));
|
|
|
19917 |
editor.on('focus', this.onEditorFocus.bind(this));
|
19918 |
+
editor.on('blur', this.onEditorBlur.bind(this));
|
19919 |
editor.on('mousedown', this.onEditorMousedown.bind(this));
|
19920 |
}
|
19921 |
}, {
|
19949 |
}
|
19950 |
}
|
19951 |
}, {
|
19952 |
+
key: 'onEditorFocus',
|
19953 |
+
value: function onEditorFocus(e) {
|
19954 |
var _getEditorEventVars2 = this.getEditorEventVars(e.target.bodyElement),
|
19955 |
editable = _getEditorEventVars2.editable,
|
19956 |
editor = _getEditorEventVars2.editor,
|
19959 |
nodeId = _getEditorEventVars2.nodeId;
|
19960 |
|
19961 |
var overlay = module.find('.fl-inline-editor');
|
19962 |
+
var settingHTML = this.getSettingHTML(nodeId, field);
|
|
|
19963 |
|
19964 |
+
if (!this.matchHTML(editor.getContent(), settingHTML)) {
|
19965 |
+
editable.data('original', {
|
19966 |
+
settingHTML: settingHTML,
|
19967 |
+
editableHTML: editable.html()
|
19968 |
+
});
|
19969 |
+
editable.css('min-height', editable.height());
|
19970 |
+
editor.setContent(settingHTML);
|
19971 |
+
editor.selection.select(editor.getBody(), true);
|
19972 |
+
editor.selection.collapse(false);
|
19973 |
+
}
|
19974 |
|
19975 |
+
if (editor.settings.toolbar) {
|
19976 |
+
overlay.removeClass('fl-inline-editor-no-toolbar');
|
19977 |
+
} else {
|
19978 |
+
overlay.addClass('fl-inline-editor-no-toolbar');
|
|
|
19979 |
}
|
19980 |
+
|
19981 |
+
module.addClass('fl-editable-focused');
|
19982 |
+
this.showEditorOverlay(module);
|
19983 |
+
this.showModuleSettings(module);
|
19984 |
}
|
19985 |
}, {
|
19986 |
+
key: 'onEditorBlur',
|
19987 |
+
value: function onEditorBlur(e) {
|
19988 |
var _getEditorEventVars3 = this.getEditorEventVars(e.target.bodyElement),
|
19989 |
editable = _getEditorEventVars3.editable,
|
19990 |
editor = _getEditorEventVars3.editor,
|
19991 |
+
module = _getEditorEventVars3.module;
|
|
|
|
|
19992 |
|
19993 |
var overlay = module.find('.fl-inline-editor');
|
19994 |
+
var original = editable.data('original');
|
|
|
|
|
19995 |
|
19996 |
+
overlay.removeClass('fl-inline-editor-no-toolbar');
|
19997 |
+
module.removeClass('fl-editable-focused');
|
|
|
|
|
|
|
19998 |
|
19999 |
+
if (original && this.matchHTML(editor.getContent(), original.settingHTML)) {
|
20000 |
+
editable.html(original.editableHTML);
|
20001 |
+
editable.css('min-height', '');
|
|
|
|
|
|
|
|
|
|
|
20002 |
}
|
20003 |
}
|
20004 |
}, {
|
20009 |
|
20010 |
this.showEditorOverlay(module);
|
20011 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20012 |
}, {
|
20013 |
key: 'onEditorDrop',
|
20014 |
value: function onEditorDrop(e) {
|
20015 |
e.preventDefault();
|
20016 |
return false;
|
20017 |
}
|
20018 |
+
}, {
|
20019 |
+
key: 'onModuleOverlayClick',
|
20020 |
+
value: function onModuleOverlayClick(e) {
|
20021 |
+
var actions = jQuery(e.target).closest('.fl-block-overlay-actions');
|
20022 |
+
var module = jQuery(e.currentTarget).closest('.fl-module');
|
20023 |
+
var editorId = module.find('.mce-content-body').first().attr('id');
|
20024 |
+
|
20025 |
+
if (actions.length) {
|
20026 |
+
return;
|
20027 |
+
}
|
20028 |
+
if (editorId) {
|
20029 |
+
tinymce.get(editorId).focus();
|
20030 |
+
module.addClass('fl-editable-focused');
|
20031 |
+
}
|
20032 |
+
}
|
20033 |
}, {
|
20034 |
key: 'onModuleMouseleave',
|
20035 |
value: function onModuleMouseleave(e) {
|
20043 |
}, {
|
20044 |
key: 'showEditorOverlay',
|
20045 |
value: function showEditorOverlay(module) {
|
20046 |
+
var overlay = module.find('.fl-inline-editor');
|
20047 |
this.hideNodeOverlays();
|
20048 |
+
this.hideEditorOverlays();
|
20049 |
+
overlay.show();
|
20050 |
+
|
20051 |
+
var active = jQuery('.fl-inline-editor-active-toolbar');
|
20052 |
+
active.removeClass('fl-inline-editor-active-toolbar');
|
20053 |
+
|
20054 |
+
var toolbar = overlay.find('> .mce-panel:visible');
|
20055 |
+
toolbar.addClass('fl-inline-editor-active-toolbar');
|
20056 |
}
|
20057 |
}, {
|
20058 |
key: 'hideEditorOverlays',
|
20083 |
}
|
20084 |
}
|
20085 |
}, {
|
20086 |
+
key: 'getSettingValue',
|
20087 |
+
value: function getSettingValue(nodeId, name) {
|
20088 |
+
var form = jQuery('.fl-builder-settings[data-node="' + nodeId + '"]');
|
20089 |
+
var settings = {};
|
20090 |
+
|
20091 |
+
if (form.length) {
|
20092 |
+
settings = FLBuilder._getSettings(form);
|
20093 |
+
} else {
|
20094 |
+
settings = FLBuilderSettingsConfig.nodes[nodeId];
|
20095 |
+
}
|
20096 |
+
|
20097 |
+
return settings[name];
|
20098 |
+
}
|
20099 |
+
}, {
|
20100 |
+
key: 'getSettingHTML',
|
20101 |
+
value: function getSettingHTML(nodeId, field) {
|
20102 |
+
var html = this.getSettingValue(nodeId, field.name);
|
20103 |
|
20104 |
if ('editor' === field.type && '' !== html) {
|
20105 |
return wp.editor.autop(html);
|
js/build/builder.bundle.min.js
CHANGED
@@ -3,7 +3,7 @@ object-assign
|
|
3 |
(c) Sindre Sorhus
|
4 |
@license MIT
|
5 |
*/
|
6 |
-
var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,u=r(e),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var s in n)i.call(n,s)&&(u[s]=n[s]);if(o){l=o(n);for(var
|
7 |
* react.production.min.js
|
8 |
*
|
9 |
* Copyright (c) 2013-present, Facebook, Inc.
|
@@ -11,7 +11,7 @@ var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.pr
|
|
11 |
* This source code is licensed under the MIT license found in the
|
12 |
* LICENSE file in the root directory of this source tree.
|
13 |
*/
|
14 |
-
var g=n(1),v=n(2),b=n(3),C=n(4),k="function"==typeof Symbol&&Symbol.for,w=k?Symbol.for("react.element"):60103,E=k?Symbol.for("react.portal"):60106,x=k?Symbol.for("react.fragment"):60107,_=k?Symbol.for("react.strict_mode"):60108,T=k?Symbol.for("react.provider"):60109,S=k?Symbol.for("react.context"):60110,P=k?Symbol.for("react.async_mode"):60111,N=k?Symbol.for("react.forward_ref"):60112,O="function"==typeof Symbol&&Symbol.iterator,I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};o.prototype.isReactComponent={},o.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&r("85"),this.updater.enqueueSetState(this,e,t,"setState")},o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},i.prototype=o.prototype;var F=a.prototype=new i;F.constructor=a,g(F,o.prototype),F.isPureReactComponent=!0;var M={current:null},D=Object.prototype.hasOwnProperty,R={key:!0,ref:!0,__self:!0,__source:!0},L=/\/+/g,U=[],j={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return y(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=s(null,null,t,n),null==e||f(e,"",h,t),d(t)},count:function(e){return null==e?0:f(e,"",C.thatReturnsNull,null)},toArray:function(e){var t=[];return y(e,t,null,C.thatReturnsArgument),t},only:function(e){return u(e)||r("143"),e}},createRef:function(){return{current:null}},Component:o,PureComponent:a,createContext:function(e,t){return void 0===t&&(t=null),e={$$typeof:S,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_changedBits:0,Provider:null,Consumer:null},e.Provider={$$typeof:T,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:N,render:e}},Fragment:x,StrictMode:_,unstable_AsyncMode:P,createElement:l,cloneElement:function(e,t,n){(null===e||void 0===e)&&r("267",e);var o=void 0,i=g({},e.props),a=e.key,l=e.ref,u=e._owner;if(null!=t){void 0!==t.ref&&(l=t.ref,u=M.current),void 0!==t.key&&(a=""+t.key);var c=void 0;e.type&&e.type.defaultProps&&(c=e.type.defaultProps);for(o in t)D.call(t,o)&&!R.hasOwnProperty(o)&&(i[o]=void 0===t[o]&&void 0!==c?c[o]:t[o])}if(1===(o=arguments.length-2))i.children=n;else if(1<o){c=Array(o);for(var s=0;s<o;s++)c[s]=arguments[s+2];i.children=c}return{$$typeof:w,type:e.type,key:a,ref:l,props:i,_owner:u}},createFactory:function(e){var t=l.bind(null,e);return t.type=e,t},isValidElement:u,version:"16.3.2",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:M,assign:g}},H=Object.freeze({default:j}),z=H&&j||H;e.exports=z.default?z.default:z},function(e,t,n){"use strict";function r(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),e.exports=n(8)},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="http://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);cn(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}function o(e,t,n,r,o,i,a,l,u){this._hasCaughtError=!1,this._caughtError=null;var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this._caughtError=e,this._hasCaughtError=!0}}function i(){if(vn._hasRethrowError){var e=vn._rethrowError;throw vn._rethrowError=null,vn._hasRethrowError=!1,e}}function a(){if(bn)for(var e in Cn){var t=Cn[e],n=bn.indexOf(e);if(-1<n||r("96",e),!kn[n]){t.extractEvents||r("97",e),kn[n]=t,n=t.eventTypes;for(var o in n){var i=void 0,a=n[o],u=t,c=o;wn.hasOwnProperty(c)&&r("99",c),wn[c]=a;var s=a.phasedRegistrationNames;if(s){for(i in s)s.hasOwnProperty(i)&&l(s[i],u,c);i=!0}else a.registrationName?(l(a.registrationName,u,c),i=!0):i=!1;i||r("98",o,e)}}}}function l(e,t,n){En[e]&&r("100",e),En[e]=t,xn[e]=t.eventTypes[n].dependencies}function u(e){bn&&r("101"),bn=Array.prototype.slice.call(e),a()}function c(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var o=e[t];Cn.hasOwnProperty(t)&&Cn[t]===o||(Cn[t]&&r("102",t),Cn[t]=o,n=!0)}n&&a()}function s(e,t,n,r){t=e.type||"unknown-event",e.currentTarget=Pn(r),vn.invokeGuardedCallbackAndCatchFirstError(t,n,void 0,e),e.currentTarget=null}function d(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function f(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}function p(e,t){if(e){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)s(e,t,n[o],r[o]);else n&&s(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function h(e){return p(e,!0)}function m(e){return p(e,!1)}function y(e,t){var n=e.stateNode;if(!n)return null;var o=Tn(n);if(!o)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(o=!o.disabled)||(e=e.type,o=!("button"===e||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}return e?null:(n&&"function"!=typeof n&&r("231",t,typeof n),n)}function g(e,t){null!==e&&(Nn=d(Nn,e)),e=Nn,Nn=null,e&&(t?f(e,h):f(e,m),Nn&&r("95"),vn.rethrowCaughtError())}function v(e,t,n,r){for(var o=null,i=0;i<kn.length;i++){var a=kn[i];a&&(a=a.extractEvents(e,t,n,r))&&(o=d(o,a))}g(o,!1)}function b(e){if(e[Mn])return e[Mn];for(;!e[Mn];){if(!e.parentNode)return null;e=e.parentNode}return e=e[Mn],5===e.tag||6===e.tag?e:null}function C(e){if(5===e.tag||6===e.tag)return e.stateNode;r("33")}function k(e){return e[Dn]||null}function w(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function E(e,t,n){for(var r=[];e;)r.push(e),e=w(e);for(e=r.length;0<e--;)t(r[e],"captured",n);for(e=0;e<r.length;e++)t(r[e],"bubbled",n)}function x(e,t,n){(t=y(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=d(n._dispatchListeners,t),n._dispatchInstances=d(n._dispatchInstances,e))}function _(e){e&&e.dispatchConfig.phasedRegistrationNames&&E(e._targetInst,x,e)}function T(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst;t=t?w(t):null,E(t,x,e)}}function S(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=y(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=d(n._dispatchListeners,t),n._dispatchInstances=d(n._dispatchInstances,e))}function P(e){e&&e.dispatchConfig.registrationName&&S(e._targetInst,null,e)}function N(e){f(e,_)}function O(e,t,n,r){if(n&&r)e:{for(var o=n,i=r,a=0,l=o;l;l=w(l))a++;l=0;for(var u=i;u;u=w(u))l++;for(;0<a-l;)o=w(o),a--;for(;0<l-a;)i=w(i),l--;for(;a--;){if(o===i||o===i.alternate)break e;o=w(o),i=w(i)}o=null}else o=null;for(i=o,o=[];n&&n!==i&&(null===(a=n.alternate)||a!==i);)o.push(n),n=w(n);for(n=[];r&&r!==i&&(null===(a=r.alternate)||a!==i);)n.push(r),r=w(r);for(r=0;r<o.length;r++)S(o[r],"bubbled",e);for(e=n.length;0<e--;)S(n[e],"captured",t)}function I(){return!Un&&dn.canUseDOM&&(Un="textContent"in document.documentElement?"textContent":"innerText"),Un}function F(){if(jn._fallbackText)return jn._fallbackText;var e,t,n=jn._startText,r=n.length,o=M(),i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return jn._fallbackText=o.slice(e,1<t?1-t:void 0),jn._fallbackText}function M(){return"value"in jn._root?jn._root.value:jn._root[I()]}function D(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface;for(var o in e)e.hasOwnProperty(o)&&((t=e[o])?this[o]=t(n):"target"===o?this.target=r:this[o]=n[o]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?pn.thatReturnsTrue:pn.thatReturnsFalse,this.isPropagationStopped=pn.thatReturnsFalse,this}function R(e,t,n,r){if(this.eventPool.length){var o=this.eventPool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}function L(e){e instanceof this||r("223"),e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function U(e){e.eventPool=[],e.getPooled=R,e.release=L}function j(e,t){switch(e){case"topKeyUp":return-1!==Vn.indexOf(t.keyCode);case"topKeyDown":return 229!==t.keyCode;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function H(e){return e=e.detail,"object"==typeof e&&"data"in e?e.data:null}function z(e,t){switch(e){case"topCompositionEnd":return H(t);case"topKeyPress":return 32!==t.which?null:(Yn=!0,qn);case"topTextInput":return e=t.data,e===qn&&Yn?null:e;default:return null}}function A(e,t){if(Xn)return"topCompositionEnd"===e||!Wn&&j(e,t)?(e=F(),jn._root=null,jn._startText=null,jn._fallbackText=null,Xn=!1,e):null;switch(e){case"topPaste":return null;case"topKeyPress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"topCompositionEnd":return $n?null:t.data;default:return null}}function B(e){if(e=Sn(e)){Jn&&"function"==typeof Jn.restoreControlledState||r("194");var t=Tn(e.stateNode);Jn.restoreControlledState(e.stateNode,e.type,t)}}function V(e){tr?nr?nr.push(e):nr=[e]:tr=e}function W(){return null!==tr||null!==nr}function Q(){if(tr){var e=tr,t=nr;if(nr=tr=null,B(e),t)for(e=0;e<t.length;e++)B(t[e])}}function K(e,t){return e(t)}function $(e,t,n){return e(t,n)}function q(){}function G(e,t){if(or)return e(t);or=!0;try{return K(e,t)}finally{or=!1,W()&&(q(),Q())}}function Y(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ir[e.type]:"textarea"===t}function X(e){return e=e.target||window,e.correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function Z(e,t){return!(!dn.canUseDOM||t&&!("addEventListener"in document))&&(e="on"+e,t=e in document,t||(t=document.createElement("div"),t.setAttribute(e,"return;"),t="function"==typeof t[e]),t)}function J(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ee(e){var t=J(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"function"==typeof n.get&&"function"==typeof n.set)return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.get.call(this)},set:function(e){r=""+e,n.set.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}function te(e){e._valueTracker||(e._valueTracker=ee(e))}function ne(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=J(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function re(e){return null===e||void 0===e?null:(e=vr&&e[vr]||e["@@iterator"],"function"==typeof e?e:null)}function oe(e){if("function"==typeof(e=e.type))return e.displayName||e.name;if("string"==typeof e)return e;switch(e){case fr:return"ReactFragment";case dr:return"ReactPortal";case cr:return"ReactCall";case sr:return"ReactReturn"}if("object"==typeof e&&null!==e)switch(e.$$typeof){case gr:return e=e.render.displayName||e.render.name||"",""!==e?"ForwardRef("+e+")":"ForwardRef"}return null}function ie(e){var t="";do{e:switch(e.tag){case 0:case 1:case 2:case 5:var n=e._debugOwner,r=e._debugSource,o=oe(e),i=null;n&&(i=oe(n)),n=r,o="\n in "+(o||"Unknown")+(n?" (at "+n.fileName.replace(/^.*[\\\/]/,"")+":"+n.lineNumber+")":i?" (created by "+i+")":"");break e;default:o=""}t+=o,e=e.return}while(e);return t}function ae(e){return!!kr.hasOwnProperty(e)||!Cr.hasOwnProperty(e)&&(br.test(e)?kr[e]=!0:(Cr[e]=!0,!1))}function le(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}function ue(e,t,n,r){if(null===t||void 0===t||le(e,t,n,r))return!0;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ce(e,t,n,r,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t}function se(e){return e[1].toUpperCase()}function de(e,t,n,r){var o=wr.hasOwnProperty(t)?wr[t]:null;(null!==o?0===o.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(ue(t,n,o,r)&&(n=null),r||null===o?ae(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(o=o.type,n=3===o||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function fe(e,t){var n=t.checked;return fn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function pe(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=ve(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function he(e,t){null!=(t=t.checked)&&de(e,"checked",t,!1)}function me(e,t){he(e,t);var n=ve(t.value);null!=n&&("number"===t.type?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n)),t.hasOwnProperty("value")?ge(e,t.type,n):t.hasOwnProperty("defaultValue")&&ge(e,t.type,ve(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ye(e,t){(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue"))&&(""===e.value&&(e.value=""+e._wrapperState.initialValue),e.defaultValue=""+e._wrapperState.initialValue),t=e.name,""!==t&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!e.defaultChecked,""!==t&&(e.name=t)}function ge(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ve(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function be(e,t,n){return e=D.getPooled(xr.change,e,t,n),e.type="change",V(n),N(e),e}function Ce(e){g(e,!1)}function ke(e){if(ne(C(e)))return e}function we(e,t){if("topChange"===e)return t}function Ee(){_r&&(_r.detachEvent("onpropertychange",xe),Tr=_r=null)}function xe(e){"value"===e.propertyName&&ke(Tr)&&(e=be(Tr,e,X(e)),G(Ce,e))}function _e(e,t,n){"topFocus"===e?(Ee(),_r=t,Tr=n,_r.attachEvent("onpropertychange",xe)):"topBlur"===e&&Ee()}function Te(e){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return ke(Tr)}function Se(e,t){if("topClick"===e)return ke(t)}function Pe(e,t){if("topInput"===e||"topChange"===e)return ke(t)}function Ne(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Or[e])&&!!t[e]}function Oe(){return Ne}function Ie(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!=(2&t.effectTag))return 1;for(;t.return;)if(t=t.return,0!=(2&t.effectTag))return 1}return 3===t.tag?2:3}function Fe(e){return!!(e=e._reactInternalFiber)&&2===Ie(e)}function Me(e){2!==Ie(e)&&r("188")}function De(e){var t=e.alternate;if(!t)return t=Ie(e),3===t&&r("188"),1===t?null:e;for(var n=e,o=t;;){var i=n.return,a=i?i.alternate:null;if(!i||!a)break;if(i.child===a.child){for(var l=i.child;l;){if(l===n)return Me(i),e;if(l===o)return Me(i),t;l=l.sibling}r("188")}if(n.return!==o.return)n=i,o=a;else{l=!1;for(var u=i.child;u;){if(u===n){l=!0,n=i,o=a;break}if(u===o){l=!0,o=i,n=a;break}u=u.sibling}if(!l){for(u=a.child;u;){if(u===n){l=!0,n=a,o=i;break}if(u===o){l=!0,o=a,n=i;break}u=u.sibling}l||r("189")}}n.alternate!==o&&r("190")}return 3!==n.tag&&r("188"),n.stateNode.current===n?e:t}function Re(e){if(!(e=De(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Le(e){if(!(e=De(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child&&4!==t.tag)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Ue(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function je(e,t){var n=e[0].toUpperCase()+e.slice(1),r="on"+n;n="top"+n,t={phasedRegistrationNames:{bubbled:r,captured:r+"Capture"},dependencies:[n],isInteractive:t},Wr[e]=t,Qr[n]=t}function He(e){var t=e.targetInst;do{if(!t){e.ancestors.push(t);break}var n;for(n=t;n.return;)n=n.return;if(!(n=3!==n.tag?null:n.stateNode.containerInfo))break;e.ancestors.push(t),t=b(n)}while(t);for(n=0;n<e.ancestors.length;n++)t=e.ancestors[n],v(e.topLevelType,t,e.nativeEvent,X(e.nativeEvent))}function ze(e){Gr=!!e}function Ae(e,t,n){if(!n)return null;e=($r(e)?Ve:We).bind(null,e),n.addEventListener(t,e,!1)}function Be(e,t,n){if(!n)return null;e=($r(e)?Ve:We).bind(null,e),n.addEventListener(t,e,!0)}function Ve(e,t){$(We,e,t)}function We(e,t){if(Gr){var n=X(t);if(n=b(n),null!==n&&"number"==typeof n.tag&&2!==Ie(n)&&(n=null),qr.length){var r=qr.pop();r.topLevelType=e,r.nativeEvent=t,r.targetInst=n,e=r}else e={topLevelType:e,nativeEvent:t,targetInst:n,ancestors:[]};try{G(He,e)}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>qr.length&&qr.push(e)}}}function Qe(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function Ke(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t,n=Xr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Jr)return Zr[e]=n[t];return e}function $e(e){return Object.prototype.hasOwnProperty.call(e,oo)||(e[oo]=ro++,no[e[oo]]={}),no[e[oo]]}function qe(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ge(e,t){var n=qe(e);e=0;for(var r;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=qe(n)}}function Ye(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)}function Xe(e,t){if(so||null==lo||lo!==hn())return null;var n=lo;return"selectionStart"in n&&Ye(n)?n={start:n.selectionStart,end:n.selectionEnd}:window.getSelection?(n=window.getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}):n=void 0,co&&mn(co,n)?null:(co=n,e=D.getPooled(ao.select,uo,e,t),e.type="select",e.target=lo,N(e),e)}function Ze(e,t,n,r){this.tag=e,this.key=n,this.stateNode=this.type=null,this.sibling=this.child=this.return=null,this.index=0,this.ref=null,this.pendingProps=t,this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.expirationTime=0,this.alternate=null}function Je(e,t,n){var r=e.alternate;return null===r?(r=new Ze(e.tag,t,e.key,e.mode),r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.expirationTime=n,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function et(e,t,n){var o=e.type,i=e.key;e=e.props;var a=void 0;if("function"==typeof o)a=o.prototype&&o.prototype.isReactComponent?2:0;else if("string"==typeof o)a=5;else switch(o){case fr:return tt(e.children,t,n,i);case yr:a=11,t|=3;break;case pr:a=11,t|=2;break;case cr:a=7;break;case sr:a=9;break;default:if("object"==typeof o&&null!==o)switch(o.$$typeof){case hr:a=13;break;case mr:a=12;break;case gr:a=14;break;default:if("number"==typeof o.tag)return t=o,t.pendingProps=e,t.expirationTime=n,t;r("130",null==o?o:typeof o,"")}else r("130",null==o?o:typeof o,"")}return t=new Ze(a,e,i,t),t.type=o,t.expirationTime=n,t}function tt(e,t,n,r){return e=new Ze(10,e,r,t),e.expirationTime=n,e}function nt(e,t,n){return e=new Ze(6,e,null,t),e.expirationTime=n,e}function rt(e,t,n){return t=new Ze(4,null!==e.children?e.children:[],e.key,t),t.expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ot(e){return function(t){try{return e(t)}catch(e){}}}function it(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);po=ot(function(e){return t.onCommitFiberRoot(n,e)}),ho=ot(function(e){return t.onCommitFiberUnmount(n,e)})}catch(e){}return!0}function at(e){"function"==typeof po&&po(e)}function lt(e){"function"==typeof ho&&ho(e)}function ut(e){return{baseState:e,expirationTime:0,first:null,last:null,callbackList:null,hasForceUpdate:!1,isInitialized:!1,capturedValues:null}}function ct(e,t){null===e.last?e.first=e.last=t:(e.last.next=t,e.last=t),(0===e.expirationTime||e.expirationTime>t.expirationTime)&&(e.expirationTime=t.expirationTime)}function st(e){mo=yo=null;var t=e.alternate,n=e.updateQueue;null===n&&(n=e.updateQueue=ut(null)),null!==t?null===(e=t.updateQueue)&&(e=t.updateQueue=ut(null)):e=null,mo=n,yo=e!==n?e:null}function dt(e,t){st(e),e=mo;var n=yo;null===n?ct(e,t):null===e.last||null===n.last?(ct(e,t),ct(n,t)):(ct(e,t),n.last=t)}function ft(e,t,n,r){return e=e.partialState,"function"==typeof e?e.call(t,n,r):e}function pt(e,t,n,r,o,i){null!==e&&e.updateQueue===n&&(n=t.updateQueue={baseState:n.baseState,expirationTime:n.expirationTime,first:n.first,last:n.last,isInitialized:n.isInitialized,capturedValues:n.capturedValues,callbackList:null,hasForceUpdate:!1}),n.expirationTime=0,n.isInitialized?e=n.baseState:(e=n.baseState=t.memoizedState,n.isInitialized=!0);for(var a=!0,l=n.first,u=!1;null!==l;){var c=l.expirationTime;if(c>i){var s=n.expirationTime;(0===s||s>c)&&(n.expirationTime=c),u||(u=!0,n.baseState=e)}else u||(n.first=l.next,null===n.first&&(n.last=null)),l.isReplace?(e=ft(l,r,e,o),a=!0):(c=ft(l,r,e,o))&&(e=a?fn({},e,c):fn(e,c),a=!1),l.isForced&&(n.hasForceUpdate=!0),null!==l.callback&&(c=n.callbackList,null===c&&(c=n.callbackList=[]),c.push(l)),null!==l.capturedValue&&(c=n.capturedValues,null===c?n.capturedValues=[l.capturedValue]:c.push(l.capturedValue));l=l.next}return null!==n.callbackList?t.effectTag|=32:null!==n.first||n.hasForceUpdate||null!==n.capturedValues||(t.updateQueue=null),u||(n.baseState=e),e}function ht(e,t){var n=e.callbackList;if(null!==n)for(e.callbackList=null,e=0;e<n.length;e++){var o=n[e],i=o.callback;o.callback=null,"function"!=typeof i&&r("191",i),i.call(t)}}function mt(e,t,n,r,o){function i(e,t,n,r,o,i){if(null===t||null!==e.updateQueue&&e.updateQueue.hasForceUpdate)return!0;var a=e.stateNode;return e=e.type,"function"==typeof a.shouldComponentUpdate?a.shouldComponentUpdate(n,o,i):!e.prototype||!e.prototype.isPureReactComponent||(!mn(t,n)||!mn(r,o))}function a(e,t){t.updater=h,e.stateNode=t,t._reactInternalFiber=e}function l(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&h.enqueueReplaceState(t,t.state,null)}function u(e,t,n,r){if(e=e.type,"function"==typeof e.getDerivedStateFromProps)return e.getDerivedStateFromProps.call(null,n,r)}var c=e.cacheContext,s=e.getMaskedContext,d=e.getUnmaskedContext,f=e.isContextConsumer,p=e.hasContextChanged,h={isMounted:Fe,enqueueSetState:function(e,r,o){e=e._reactInternalFiber,o=void 0===o?null:o;var i=n(e);dt(e,{expirationTime:i,partialState:r,callback:o,isReplace:!1,isForced:!1,capturedValue:null,next:null}),t(e,i)},enqueueReplaceState:function(e,r,o){e=e._reactInternalFiber,o=void 0===o?null:o;var i=n(e);dt(e,{expirationTime:i,partialState:r,callback:o,isReplace:!0,isForced:!1,capturedValue:null,next:null}),t(e,i)},enqueueForceUpdate:function(e,r){e=e._reactInternalFiber,r=void 0===r?null:r;var o=n(e);dt(e,{expirationTime:o,partialState:null,callback:r,isReplace:!1,isForced:!0,capturedValue:null,next:null}),t(e,o)}};return{adoptClassInstance:a,callGetDerivedStateFromProps:u,constructClassInstance:function(e,t){var n=e.type,r=d(e),o=f(e),i=o?s(e,r):gn;n=new n(t,i);var l=null!==n.state&&void 0!==n.state?n.state:null;return a(e,n),e.memoizedState=l,t=u(e,n,t,l),null!==t&&void 0!==t&&(e.memoizedState=fn({},e.memoizedState,t)),o&&c(e,r,i),n},mountClassInstance:function(e,t){var n=e.type,r=e.alternate,o=e.stateNode,i=e.pendingProps,a=d(e);o.props=i,o.state=e.memoizedState,o.refs=gn,o.context=s(e,a),"function"==typeof n.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(n=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),n!==o.state&&h.enqueueReplaceState(o,o.state,null),null!==(n=e.updateQueue)&&(o.state=pt(r,e,n,o,i,t))),"function"==typeof o.componentDidMount&&(e.effectTag|=4)},resumeMountClassInstance:function(e,t){var n=e.type,a=e.stateNode;a.props=e.memoizedProps,a.state=e.memoizedState;var c=e.memoizedProps,f=e.pendingProps,h=a.context,m=d(e);m=s(e,m),(n="function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(c!==f||h!==m)&&l(e,a,f,m),h=e.memoizedState,t=null!==e.updateQueue?pt(null,e,e.updateQueue,a,f,t):h;var y=void 0;if(c!==f&&(y=u(e,a,f,t)),null!==y&&void 0!==y){t=null===t||void 0===t?y:fn({},t,y);var g=e.updateQueue;null!==g&&(g.baseState=fn({},g.baseState,y))}return c!==f||h!==t||p()||null!==e.updateQueue&&e.updateQueue.hasForceUpdate?((c=i(e,c,f,h,t,m))?(n||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(e.effectTag|=4)):("function"==typeof a.componentDidMount&&(e.effectTag|=4),r(e,f),o(e,t)),a.props=f,a.state=t,a.context=m,c):("function"==typeof a.componentDidMount&&(e.effectTag|=4),!1)},updateClassInstance:function(e,t,n){var a=t.type,c=t.stateNode;c.props=t.memoizedProps,c.state=t.memoizedState;var f=t.memoizedProps,h=t.pendingProps,m=c.context,y=d(t);y=s(t,y),(a="function"==typeof a.getDerivedStateFromProps||"function"==typeof c.getSnapshotBeforeUpdate)||"function"!=typeof c.UNSAFE_componentWillReceiveProps&&"function"!=typeof c.componentWillReceiveProps||(f!==h||m!==y)&&l(t,c,h,y),m=t.memoizedState,n=null!==t.updateQueue?pt(e,t,t.updateQueue,c,h,n):m;var g=void 0;if(f!==h&&(g=u(t,c,h,n)),null!==g&&void 0!==g){n=null===n||void 0===n?g:fn({},n,g);var v=t.updateQueue;null!==v&&(v.baseState=fn({},v.baseState,g))}return f!==h||m!==n||p()||null!==t.updateQueue&&t.updateQueue.hasForceUpdate?((g=i(t,f,h,m,n,y))?(a||"function"!=typeof c.UNSAFE_componentWillUpdate&&"function"!=typeof c.componentWillUpdate||("function"==typeof c.componentWillUpdate&&c.componentWillUpdate(h,n,y),"function"==typeof c.UNSAFE_componentWillUpdate&&c.UNSAFE_componentWillUpdate(h,n,y)),"function"==typeof c.componentDidUpdate&&(t.effectTag|=4),"function"==typeof c.getSnapshotBeforeUpdate&&(t.effectTag|=2048)):("function"!=typeof c.componentDidUpdate||f===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=4),"function"!=typeof c.getSnapshotBeforeUpdate||f===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=2048),r(t,h),o(t,n)),c.props=h,c.state=n,c.context=y,g):("function"!=typeof c.componentDidUpdate||f===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=4),"function"!=typeof c.getSnapshotBeforeUpdate||f===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=2048),!1)}}}function yt(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){n=n._owner;var o=void 0;n&&(2!==n.tag&&r("110"),o=n.stateNode),o||r("147",e);var i=""+e;return null!==t&&null!==t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=o.refs===gn?o.refs={}:o.refs;null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}"string"!=typeof e&&r("148"),n._owner||r("254",e)}return e}function gt(e,t){"textarea"!==e.type&&r("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function vt(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t,n){return e=Je(e,t,n),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index,r<n?(t.effectTag=2,n):r):(t.effectTag=2,n):n}function l(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?(t=nt(n,e.mode,r),t.return=e,t):(t=i(t,n,r),t.return=e,t)}function c(e,t,n,r){return null!==t&&t.type===n.type?(r=i(t,n.props,r),r.ref=yt(e,t,n),r.return=e,r):(r=et(n,e.mode,r),r.ref=yt(e,t,n),r.return=e,r)}function s(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=rt(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[],r),t.return=e,t)}function d(e,t,n,r,o){return null===t||10!==t.tag?(t=tt(n,e.mode,r,o),t.return=e,t):(t=i(t,n,r),t.return=e,t)}function f(e,t,n){if("string"==typeof t||"number"==typeof t)return t=nt(""+t,e.mode,n),t.return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case ur:return n=et(t,e.mode,n),n.ref=yt(e,null,t),n.return=e,n;case dr:return t=rt(t,e.mode,n),t.return=e,t}if(go(t)||re(t))return t=tt(t,e.mode,n,null),t.return=e,t;gt(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==o?null:u(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case ur:return n.key===o?n.type===fr?d(e,t,n.props.children,r,o):c(e,t,n,r):null;case dr:return n.key===o?s(e,t,n,r):null}if(go(n)||re(n))return null!==o?null:d(e,t,n,r,null);gt(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r||"number"==typeof r)return e=e.get(n)||null,u(t,e,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case ur:return e=e.get(null===r.key?n:r.key)||null,r.type===fr?d(t,e,r.props.children,o,r.key):c(t,e,r,o);case dr:return e=e.get(null===r.key?n:r.key)||null,s(t,e,r,o)}if(go(r)||re(r))return e=e.get(n)||null,d(t,e,r,o,null);gt(t,r)}return null}function m(r,i,l,u){for(var c=null,s=null,d=i,m=i=0,y=null;null!==d&&m<l.length;m++){d.index>m?(y=d,d=null):y=d.sibling;var g=p(r,d,l[m],u);if(null===g){null===d&&(d=y);break}e&&d&&null===g.alternate&&t(r,d),i=a(g,i,m),null===s?c=g:s.sibling=g,s=g,d=y}if(m===l.length)return n(r,d),c;if(null===d){for(;m<l.length;m++)(d=f(r,l[m],u))&&(i=a(d,i,m),null===s?c=d:s.sibling=d,s=d);return c}for(d=o(r,d);m<l.length;m++)(y=h(d,r,m,l[m],u))&&(e&&null!==y.alternate&&d.delete(null===y.key?m:y.key),i=a(y,i,m),null===s?c=y:s.sibling=y,s=y);return e&&d.forEach(function(e){return t(r,e)}),c}function y(i,l,u,c){var s=re(u);"function"!=typeof s&&r("150"),null==(u=s.call(u))&&r("151");for(var d=s=null,m=l,y=l=0,g=null,v=u.next();null!==m&&!v.done;y++,v=u.next()){m.index>y?(g=m,m=null):g=m.sibling;var b=p(i,m,v.value,c);if(null===b){m||(m=g);break}e&&m&&null===b.alternate&&t(i,m),l=a(b,l,y),null===d?s=b:d.sibling=b,d=b,m=g}if(v.done)return n(i,m),s;if(null===m){for(;!v.done;y++,v=u.next())null!==(v=f(i,v.value,c))&&(l=a(v,l,y),null===d?s=v:d.sibling=v,d=v);return s}for(m=o(i,m);!v.done;y++,v=u.next())null!==(v=h(m,i,y,v.value,c))&&(e&&null!==v.alternate&&m.delete(null===v.key?y:v.key),l=a(v,l,y),null===d?s=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(i,e)}),s}return function(e,o,a,u){"object"==typeof a&&null!==a&&a.type===fr&&null===a.key&&(a=a.props.children);var c="object"==typeof a&&null!==a;if(c)switch(a.$$typeof){case ur:e:{var s=a.key;for(c=o;null!==c;){if(c.key===s){if(10===c.tag?a.type===fr:c.type===a.type){n(e,c.sibling),o=i(c,a.type===fr?a.props.children:a.props,u),o.ref=yt(e,c,a),o.return=e,e=o;break e}n(e,c);break}t(e,c),c=c.sibling}a.type===fr?(o=tt(a.props.children,e.mode,u,a.key),o.return=e,e=o):(u=et(a,e.mode,u),u.ref=yt(e,o,a),u.return=e,e=u)}return l(e);case dr:e:{for(c=a.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===a.containerInfo&&o.stateNode.implementation===a.implementation){n(e,o.sibling),o=i(o,a.children||[],u),o.return=e,e=o;break e}n(e,o);break}t(e,o),o=o.sibling}o=rt(a,e.mode,u),o.return=e,e=o}return l(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==o&&6===o.tag?(n(e,o.sibling),o=i(o,a,u),o.return=e,e=o):(n(e,o),o=nt(a,e.mode,u),o.return=e,e=o),l(e);if(go(a))return m(e,o,a,u);if(re(a))return y(e,o,a,u);if(c&>(e,a),void 0===a)switch(e.tag){case 2:case 1:u=e.type,r("152",u.displayName||u.name||"Component")}return n(e,o)}}function bt(e,t,n,o,i,a,l){function u(e,t,n){c(e,t,n,t.expirationTime)}function c(e,t,n,r){t.child=null===e?bo(t,null,n,r):vo(t,e.child,n,r)}function s(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function d(e,t,n,r,o,i){if(s(e,t),!n&&!o)return r&&T(t,!1),m(e,t);n=t.stateNode,ar.current=t;var a=o?null:n.render();return t.effectTag|=1,o&&(c(e,t,null,i),t.child=null),c(e,t,a,i),t.memoizedState=n.state,t.memoizedProps=n.props,r&&T(t,!0),t.child}function f(e){var t=e.stateNode;t.pendingContext?_(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_(e,t.context,!1),b(e,t.containerInfo)}function p(e,t,n,r){var o=e.child;for(null!==o&&(o.return=e);null!==o;){switch(o.tag){case 12:var i=0|o.stateNode;if(o.type===t&&0!=(i&n)){for(i=o;null!==i;){var a=i.alternate;if(0===i.expirationTime||i.expirationTime>r)i.expirationTime=r,null!==a&&(0===a.expirationTime||a.expirationTime>r)&&(a.expirationTime=r);else{if(null===a||!(0===a.expirationTime||a.expirationTime>r))break;a.expirationTime=r}i=i.return}i=null}else i=o.child;break;case 13:i=o.type===e.type?null:o.child;break;default:i=o.child}if(null!==i)i.return=o;else for(i=o;null!==i;){if(i===e){i=null;break}if(null!==(o=i.sibling)){i=o;break}i=i.return}o=i}}function h(e,t,n){var r=t.type._context,o=t.pendingProps,i=t.memoizedProps;if(!E()&&i===o)return t.stateNode=0,C(t),m(e,t);var a=o.value;if(t.memoizedProps=o,null===i)a=1073741823;else if(i.value===o.value){if(i.children===o.children)return t.stateNode=0,C(t),m(e,t);a=0}else{var l=i.value;if(l===a&&(0!==l||1/l==1/a)||l!==l&&a!==a){if(i.children===o.children)return t.stateNode=0,C(t),m(e,t);a=0}else if(a="function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,a):1073741823,0===(a|=0)){if(i.children===o.children)return t.stateNode=0,C(t),m(e,t)}else p(t,r,a,n)}return t.stateNode=a,C(t),u(e,t,o.children),t.child}function m(e,t){if(null!==e&&t.child!==e.child&&r("153"),null!==t.child){e=t.child;var n=Je(e,e.pendingProps,e.expirationTime);for(t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,n=n.sibling=Je(e,e.pendingProps,e.expirationTime),n.return=t;n.sibling=null}return t.child}var y=e.shouldSetTextContent,g=e.shouldDeprioritizeSubtree,v=t.pushHostContext,b=t.pushHostContainer,C=o.pushProvider,k=n.getMaskedContext,w=n.getUnmaskedContext,E=n.hasContextChanged,x=n.pushContextProvider,_=n.pushTopLevelContextObject,T=n.invalidateContextProvider,S=i.enterHydrationState,P=i.resetHydrationState,N=i.tryToClaimNextHydratableInstance;e=mt(n,a,l,function(e,t){e.memoizedProps=t},function(e,t){e.memoizedState=t});var O=e.adoptClassInstance,I=e.callGetDerivedStateFromProps,F=e.constructClassInstance,M=e.mountClassInstance,D=e.resumeMountClassInstance,R=e.updateClassInstance;return{beginWork:function(e,t,n){if(0===t.expirationTime||t.expirationTime>n){switch(t.tag){case 3:f(t);break;case 2:x(t);break;case 4:b(t,t.stateNode.containerInfo);break;case 13:C(t)}return null}switch(t.tag){case 0:null!==e&&r("155");var o=t.type,i=t.pendingProps,a=w(t);return a=k(t,a),o=o(i,a),t.effectTag|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(a=t.type,t.tag=2,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,"function"==typeof a.getDerivedStateFromProps&&null!==(i=I(t,o,i,t.memoizedState))&&void 0!==i&&(t.memoizedState=fn({},t.memoizedState,i)),i=x(t),O(t,o),M(t,n),e=d(e,t,!0,i,!1,n)):(t.tag=1,u(e,t,o),t.memoizedProps=i,e=t.child),e;case 1:return i=t.type,n=t.pendingProps,E()||t.memoizedProps!==n?(o=w(t),o=k(t,o),i=i(n,o),t.effectTag|=1,u(e,t,i),t.memoizedProps=n,e=t.child):e=m(e,t),e;case 2:i=x(t),null===e?null===t.stateNode?(F(t,t.pendingProps),M(t,n),o=!0):o=D(t,n):o=R(e,t,n),a=!1;var l=t.updateQueue;return null!==l&&null!==l.capturedValues&&(a=o=!0),d(e,t,o,i,a,n);case 3:e:if(f(t),null!==(o=t.updateQueue)){if(a=t.memoizedState,i=pt(e,t,o,null,null,n),t.memoizedState=i,null!==(o=t.updateQueue)&&null!==o.capturedValues)o=null;else{if(a===i){P(),e=m(e,t);break e}o=i.element}a=t.stateNode,(null===e||null===e.child)&&a.hydrate&&S(t)?(t.effectTag|=2,t.child=bo(t,null,o,n)):(P(),u(e,t,o)),t.memoizedState=i,e=t.child}else P(),e=m(e,t);return e;case 5:return v(t),null===e&&N(t),i=t.type,l=t.memoizedProps,o=t.pendingProps,a=null!==e?e.memoizedProps:null,E()||l!==o||((l=1&t.mode&&g(i,o))&&(t.expirationTime=1073741823),l&&1073741823===n)?(l=o.children,y(i,o)?l=null:a&&y(i,a)&&(t.effectTag|=16),s(e,t),1073741823!==n&&1&t.mode&&g(i,o)?(t.expirationTime=1073741823,t.memoizedProps=o,e=null):(u(e,t,l),t.memoizedProps=o,e=t.child)):e=m(e,t),e;case 6:return null===e&&N(t),t.memoizedProps=t.pendingProps,null;case 8:t.tag=7;case 7:return i=t.pendingProps,E()||t.memoizedProps!==i||(i=t.memoizedProps),o=i.children,t.stateNode=null===e?bo(t,t.stateNode,o,n):vo(t,e.stateNode,o,n),t.memoizedProps=i,t.stateNode;case 9:return null;case 4:return b(t,t.stateNode.containerInfo),i=t.pendingProps,E()||t.memoizedProps!==i?(null===e?t.child=vo(t,null,i,n):u(e,t,i),t.memoizedProps=i,e=t.child):e=m(e,t),e;case 14:return n=t.type.render,n=n(t.pendingProps,t.ref),u(e,t,n),t.memoizedProps=n,t.child;case 10:return n=t.pendingProps,E()||t.memoizedProps!==n?(u(e,t,n),t.memoizedProps=n,e=t.child):e=m(e,t),e;case 11:return n=t.pendingProps.children,E()||null!==n&&t.memoizedProps!==n?(u(e,t,n),t.memoizedProps=n,e=t.child):e=m(e,t),e;case 13:return h(e,t,n);case 12:e:{o=t.type,a=t.pendingProps,l=t.memoizedProps,i=o._currentValue;var c=o._changedBits;if(E()||0!==c||l!==a){t.memoizedProps=a;var _=a.unstable_observedBits;if(void 0!==_&&null!==_||(_=1073741823),t.stateNode=_,0!=(c&_))p(t,o,c,n);else if(l===a){e=m(e,t);break e}n=a.children,n=n(i),u(e,t,n),e=t.child}else e=m(e,t)}return e;default:r("156")}}}}function Ct(e,t,n,o,i){function a(e){e.effectTag|=4}var l=e.createInstance,u=e.createTextInstance,c=e.appendInitialChild,s=e.finalizeInitialChildren,d=e.prepareUpdate,f=e.persistence,p=t.getRootHostContainer,h=t.popHostContext,m=t.getHostContext,y=t.popHostContainer,g=n.popContextProvider,v=n.popTopLevelContextObject,b=o.popProvider,C=i.prepareToHydrateHostInstance,k=i.prepareToHydrateHostTextInstance,w=i.popHydrationState,E=void 0,x=void 0,_=void 0;return e.mutation?(E=function(){},x=function(e,t,n){(t.updateQueue=n)&&a(t)},_=function(e,t,n,r){n!==r&&a(t)}):r(f?"235":"236"),{completeWork:function(e,t,n){var o=t.pendingProps;switch(t.tag){case 1:return null;case 2:return g(t),e=t.stateNode,o=t.updateQueue,null!==o&&null!==o.capturedValues&&(t.effectTag&=-65,"function"==typeof e.componentDidCatch?t.effectTag|=256:o.capturedValues=null),null;case 3:return y(t),v(t),o=t.stateNode,o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null!==e&&null!==e.child||(w(t),t.effectTag&=-3),E(t),e=t.updateQueue,null!==e&&null!==e.capturedValues&&(t.effectTag|=256),null;case 5:h(t),n=p();var i=t.type;if(null!==e&&null!=t.stateNode){var f=e.memoizedProps,T=t.stateNode,S=m();T=d(T,i,f,o,n,S),x(e,t,T,i,f,o,n,S),e.ref!==t.ref&&(t.effectTag|=128)}else{if(!o)return null===t.stateNode&&r("166"),null;if(e=m(),w(t))C(t,n,e)&&a(t);else{f=l(i,o,n,e,t);e:for(S=t.child;null!==S;){if(5===S.tag||6===S.tag)c(f,S.stateNode);else if(4!==S.tag&&null!==S.child){S.child.return=S,S=S.child;continue}if(S===t)break;for(;null===S.sibling;){if(null===S.return||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}s(f,i,o,n,e)&&a(t),t.stateNode=f}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)_(e,t,e.memoizedProps,o);else{if("string"!=typeof o)return null===t.stateNode&&r("166"),null;e=p(),n=m(),w(t)?k(t)&&a(t):t.stateNode=u(o,e,n,t)}return null;case 7:(o=t.memoizedProps)||r("165"),t.tag=8,i=[];e:for((f=t.stateNode)&&(f.return=t);null!==f;){if(5===f.tag||6===f.tag||4===f.tag)r("247");else if(9===f.tag)i.push(f.pendingProps.value);else if(null!==f.child){f.child.return=f,f=f.child;continue}for(;null===f.sibling;){if(null===f.return||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}return f=o.handler,o=f(o.props,i),t.child=vo(t,null!==e?e.child:null,o,n),t.child;case 8:return t.tag=7,null;case 9:case 14:case 10:case 11:return null;case 4:return y(t),E(t),null;case 13:return b(t),null;case 12:return null;case 0:r("167");default:r("156")}}}}function kt(e,t,n,r,o){var i=e.popHostContainer,a=e.popHostContext,l=t.popContextProvider,u=t.popTopLevelContextObject,c=n.popProvider;return{throwException:function(e,t,n){t.effectTag|=512,t.firstEffect=t.lastEffect=null,t={value:n,source:t,stack:ie(t)};do{switch(e.tag){case 3:return st(e),e.updateQueue.capturedValues=[t],void(e.effectTag|=1024);case 2:if(n=e.stateNode,0==(64&e.effectTag)&&null!==n&&"function"==typeof n.componentDidCatch&&!o(n)){st(e),n=e.updateQueue;var r=n.capturedValues;return null===r?n.capturedValues=[t]:r.push(t),void(e.effectTag|=1024)}}e=e.return}while(null!==e)},unwindWork:function(e){switch(e.tag){case 2:l(e);var t=e.effectTag;return 1024&t?(e.effectTag=-1025&t|64,e):null;case 3:return i(e),u(e),t=e.effectTag,1024&t?(e.effectTag=-1025&t|64,e):null;case 5:return a(e),null;case 4:return i(e),null;case 13:return c(e),null;default:return null}},unwindInterruptedWork:function(e){switch(e.tag){case 2:l(e);break;case 3:i(e),u(e);break;case 5:a(e);break;case 4:i(e);break;case 13:c(e)}}}}function wt(e,t){var n=t.source;null===t.stack&&ie(n),null!==n&&oe(n),t=t.value,null!==e&&2===e.tag&&oe(e);try{t&&t.suppressReactErrorLogging||console.error(t)}catch(e){e&&e.suppressReactErrorLogging||console.error(e)}}function Et(e,t,n,o,i){function a(e){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){t(e,n)}else n.current=null}function l(e){switch("function"==typeof lt&<(e),e.tag){case 2:a(e);var n=e.stateNode;if("function"==typeof n.componentWillUnmount)try{n.props=e.memoizedProps,n.state=e.memoizedState,n.componentWillUnmount()}catch(n){t(e,n)}break;case 5:a(e);break;case 7:u(e.stateNode);break;case 4:f&&s(e)}}function u(e){for(var t=e;;)if(l(t),null===t.child||f&&4===t.tag){if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}else t.child.return=t,t=t.child}function c(e){return 5===e.tag||3===e.tag||4===e.tag}function s(e){for(var t=e,n=!1,o=void 0,i=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&r("160"),n.tag){case 5:o=n.stateNode,i=!1;break e;case 3:case 4:o=n.stateNode.containerInfo,i=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag)u(t),i?w(o,t.stateNode):k(o,t.stateNode);else if(4===t.tag?o=t.stateNode.containerInfo:l(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return,4===t.tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}var d=e.getPublicInstance,f=e.mutation;e=e.persistence,f||r(e?"235":"236");var p=f.commitMount,h=f.commitUpdate,m=f.resetTextContent,y=f.commitTextUpdate,g=f.appendChild,v=f.appendChildToContainer,b=f.insertBefore,C=f.insertInContainerBefore,k=f.removeChild,w=f.removeChildFromContainer;return{commitBeforeMutationLifeCycles:function(e,t){switch(t.tag){case 2:if(2048&t.effectTag&&null!==e){var n=e.memoizedProps,o=e.memoizedState;e=t.stateNode,e.props=t.memoizedProps,e.state=t.memoizedState,t=e.getSnapshotBeforeUpdate(n,o),e.__reactInternalSnapshotBeforeUpdate=t}break;case 3:case 5:case 6:case 4:break;default:r("163")}},commitResetTextContent:function(e){m(e.stateNode)},commitPlacement:function(e){e:{for(var t=e.return;null!==t;){if(c(t)){var n=t;break e}t=t.return}r("160"),n=void 0}var o=t=void 0;switch(n.tag){case 5:t=n.stateNode,o=!1;break;case 3:case 4:t=n.stateNode.containerInfo,o=!0;break;default:r("161")}16&n.effectTag&&(m(t),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||c(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var i=e;;){if(5===i.tag||6===i.tag)n?o?C(t,i.stateNode,n):b(t,i.stateNode,n):o?v(t,i.stateNode):g(t,i.stateNode);else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===e)break;for(;null===i.sibling;){if(null===i.return||i.return===e)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},commitDeletion:function(e){s(e),e.return=null,e.child=null,e.alternate&&(e.alternate.child=null,e.alternate.return=null)},commitWork:function(e,t){switch(t.tag){case 2:break;case 5:var n=t.stateNode;if(null!=n){var o=t.memoizedProps;e=null!==e?e.memoizedProps:o;var i=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&h(n,a,i,e,o,t)}break;case 6:null===t.stateNode&&r("162"),n=t.memoizedProps,y(t.stateNode,null!==e?e.memoizedProps:n,n);break;case 3:break;default:r("163")}},commitLifeCycles:function(e,t,n){switch(n.tag){case 2:if(e=n.stateNode,4&n.effectTag)if(null===t)e.props=n.memoizedProps,e.state=n.memoizedState,e.componentDidMount();else{var o=t.memoizedProps;t=t.memoizedState,e.props=n.memoizedProps,e.state=n.memoizedState,e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}n=n.updateQueue,null!==n&&ht(n,e);break;case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=d(n.child.stateNode);break;case 2:e=n.child.stateNode}ht(t,e)}break;case 5:e=n.stateNode,null===t&&4&n.effectTag&&p(e,n.type,n.memoizedProps,n);break;case 6:case 4:break;default:r("163")}},commitErrorLogging:function(e,t){switch(e.tag){case 2:var n=e.type;t=e.stateNode;var o=e.updateQueue;(null===o||null===o.capturedValues)&&r("264");var a=o.capturedValues;for(o.capturedValues=null,"function"!=typeof n.getDerivedStateFromCatch&&i(t),t.props=e.memoizedProps,t.state=e.memoizedState,n=0;n<a.length;n++){o=a[n];var l=o.value,u=o.stack;wt(e,o),t.componentDidCatch(l,{componentStack:null!==u?u:""})}break;case 3:for(n=e.updateQueue,(null===n||null===n.capturedValues)&&r("264"),a=n.capturedValues,n.capturedValues=null,n=0;n<a.length;n++)o=a[n],wt(e,o),t(o.value);break;default:r("265")}},commitAttachRef:function(e){var t=e.ref;if(null!==t){var n=e.stateNode;switch(e.tag){case 5:e=d(n);break;default:e=n}"function"==typeof t?t(e):t.current=e}},commitDetachRef:function(e){null!==(e=e.ref)&&("function"==typeof e?e(null):e.current=null)}}}function xt(e,t){function n(e){return e===Co&&r("174"),e}var o=e.getChildHostContext,i=e.getRootHostContext;e=t.createCursor;var a=t.push,l=t.pop,u=e(Co),c=e(Co),s=e(Co);return{getHostContext:function(){return n(u.current)},getRootHostContainer:function(){return n(s.current)},popHostContainer:function(e){l(u,e),l(c,e),l(s,e)},popHostContext:function(e){c.current===e&&(l(u,e),l(c,e))},pushHostContainer:function(e,t){a(s,t,e),a(c,e,e),a(u,Co,e),t=i(t),l(u,e),a(u,t,e)},pushHostContext:function(e){var t=n(s.current),r=n(u.current);t=o(r,e.type,t),r!==t&&(a(c,e,e),a(u,t,e))}}}function _t(e){function t(e,t){var n=new Ze(5,null,null,0);n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function n(e,t){switch(e.tag){case 5:return null!==(t=a(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=l(t,e.pendingProps))&&(e.stateNode=t,!0);default:return!1}}function o(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag;)e=e.return;f=e}var i=e.shouldSetTextContent;if(!(e=e.hydration))return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){r("175")},prepareToHydrateHostTextInstance:function(){r("176")},popHydrationState:function(){return!1}};var a=e.canHydrateInstance,l=e.canHydrateTextInstance,u=e.getNextHydratableSibling,c=e.getFirstHydratableChild,s=e.hydrateInstance,d=e.hydrateTextInstance,f=null,p=null,h=!1;return{enterHydrationState:function(e){return p=c(e.stateNode.containerInfo),f=e,h=!0},resetHydrationState:function(){p=f=null,h=!1},tryToClaimNextHydratableInstance:function(e){if(h){var r=p;if(r){if(!n(e,r)){if(!(r=u(r))||!n(e,r))return e.effectTag|=2,h=!1,void(f=e);t(f,p)}f=e,p=c(r)}else e.effectTag|=2,h=!1,f=e}},prepareToHydrateHostInstance:function(e,t,n){return t=s(e.stateNode,e.type,e.memoizedProps,t,n,e),e.updateQueue=t,null!==t},prepareToHydrateHostTextInstance:function(e){return d(e.stateNode,e.memoizedProps,e)},popHydrationState:function(e){if(e!==f)return!1;if(!h)return o(e),h=!0,!1;var n=e.type;if(5!==e.tag||"head"!==n&&"body"!==n&&!i(n,e.memoizedProps))for(n=p;n;)t(e,n),n=u(n);return o(e),p=f?u(e.stateNode):null,!0}}}function Tt(e){function t(e,t,n){e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n}function n(e){return 2===e.tag&&null!=e.type.childContextTypes}function o(e,t){var n=e.stateNode,o=e.type.childContextTypes;if("function"!=typeof n.getChildContext)return t;n=n.getChildContext();for(var i in n)i in o||r("108",oe(e)||"Unknown",i);return fn({},t,n)}var i=e.createCursor,a=e.push,l=e.pop,u=i(gn),c=i(!1),s=gn;return{getUnmaskedContext:function(e){return n(e)?s:u.current},cacheContext:t,getMaskedContext:function(e,n){var r=e.type.contextTypes;if(!r)return gn;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===n)return o.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in r)a[i]=n[i];return o&&t(e,n,a),a},hasContextChanged:function(){return c.current},isContextConsumer:function(e){return 2===e.tag&&null!=e.type.contextTypes},isContextProvider:n,popContextProvider:function(e){n(e)&&(l(c,e),l(u,e))},popTopLevelContextObject:function(e){l(c,e),l(u,e)},pushTopLevelContextObject:function(e,t,n){null!=u.cursor&&r("168"),a(u,t,e),a(c,n,e)},processChildContext:o,pushContextProvider:function(e){if(!n(e))return!1;var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||gn,s=u.current,a(u,t,e),a(c,c.current,e),!0},invalidateContextProvider:function(e,t){var n=e.stateNode;if(n||r("169"),t){var i=o(e,s);n.__reactInternalMemoizedMergedChildContext=i,l(c,e),l(u,e),a(u,i,e)}else l(c,e);a(c,t,e)},findCurrentUnmaskedContext:function(e){for(2!==Ie(e)||2!==e.tag?r("170"):void 0;3!==e.tag;){if(n(e))return e.stateNode.__reactInternalMemoizedMergedChildContext;(e=e.return)||r("171")}return e.stateNode.context}}}function St(e){var t=e.createCursor,n=e.push,r=e.pop,o=t(null),i=t(null),a=t(0);return{pushProvider:function(e){var t=e.type._context;n(a,t._changedBits,e),n(i,t._currentValue,e),n(o,e,e),t._currentValue=e.pendingProps.value,t._changedBits=e.stateNode},popProvider:function(e){var t=a.current,n=i.current;r(o,e),r(i,e),r(a,e),e=e.type._context,e._currentValue=n,e._changedBits=t}}}function Pt(){var e=[],t=-1;return{createCursor:function(e){return{current:e}},isEmpty:function(){return-1===t},pop:function(n){0>t||(n.current=e[t],e[t]=null,t--)},push:function(n,r){t++,e[t]=n.current,n.current=r},checkThatStackIsEmpty:function(){},resetStackAfterFatalErrorInDev:function(){}}}function Nt(e){function t(){if(null!==J)for(var e=J.return;null!==e;)F(e),e=e.return;ee=null,te=0,J=null,oe=!1}function n(e){return null!==ae&&ae.has(e)}function o(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0==(512&e.effectTag)){t=N(t,e,te);var o=e;if(1073741823===te||1073741823!==o.expirationTime){e:switch(o.tag){case 3:case 2:var i=o.updateQueue;i=null===i?0:i.expirationTime;break e;default:i=0}for(var a=o.child;null!==a;)0!==a.expirationTime&&(0===i||i>a.expirationTime)&&(i=a.expirationTime),a=a.sibling;o.expirationTime=i}if(null!==t)return t;if(null!==n&&0==(512&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1<e.effectTag&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e)),null!==r)return r;if(null===n){oe=!0;break}e=n}else{if(null!==(e=I(e)))return e.effectTag&=2559,e;if(null!==n&&(n.firstEffect=n.lastEffect=null,n.effectTag|=512),null!==r)return r;if(null===n)break;e=n}}return null}function i(e){var t=P(e.alternate,e,te);return null===t&&(t=o(e)),ar.current=null,t}function a(e,n,a){Z&&r("243"),Z=!0,n===te&&e===ee&&null!==J||(t(),ee=e,te=n,J=Je(ee.current,null,te),e.pendingCommitExpirationTime=0);for(var l=!1;;){try{if(a)for(;null!==J&&!w();)J=i(J);else for(;null!==J;)J=i(J)}catch(e){if(null===J){l=!0,E(e);break}a=J;var u=a.return;if(null===u){l=!0,E(e);break}O(u,a,e),J=o(a)}break}return Z=!1,l||null!==J?null:oe?(e.pendingCommitExpirationTime=n,e.current.alternate):void r("262")}function l(e,t,n,r){e={value:n,source:e,stack:ie(e)},dt(t,{expirationTime:r,partialState:null,callback:null,isReplace:!1,isForced:!1,capturedValue:e,next:null}),s(t,r)}function u(e,t){e:{Z&&!re&&r("263");for(var o=e.return;null!==o;){switch(o.tag){case 2:var i=o.stateNode;if("function"==typeof o.type.getDerivedStateFromCatch||"function"==typeof i.componentDidCatch&&!n(i)){l(e,o,t,1),e=void 0;break e}break;case 3:l(e,o,t,1),e=void 0;break e}o=o.return}3===e.tag&&l(e,e,t,1),e=void 0}return e}function c(e){return e=0!==X?X:Z?re?1:te:1&e.mode?ke?10*(1+((d()+15)/10|0)):25*(1+((d()+500)/25|0)):1,ke&&(0===he||e>he)&&(he=e),e}function s(e,n){e:{for(;null!==e;){if((0===e.expirationTime||e.expirationTime>n)&&(e.expirationTime=n),null!==e.alternate&&(0===e.alternate.expirationTime||e.alternate.expirationTime>n)&&(e.alternate.expirationTime=n),null===e.return){if(3!==e.tag){n=void 0;break e}var o=e.stateNode;!Z&&0!==te&&n<te&&t(),Z&&!re&&ee===o||h(o,n),xe>Ee&&r("185")}e=e.return}n=void 0}return n}function d(){return G=B()-$,q=2+(G/10|0)}function f(e,t,n,r,o){var i=X;X=1;try{return e(t,n,r,o)}finally{X=i}}function p(e){if(0!==ce){if(e>ce)return;W(se)}var t=B()-$;ce=e,se=V(y,{timeout:10*(e-2)-t})}function h(e,t){if(null===e.nextScheduledRoot)e.remainingExpirationTime=t,null===ue?(le=ue=e,e.nextScheduledRoot=e):(ue=ue.nextScheduledRoot=e,ue.nextScheduledRoot=le);else{var n=e.remainingExpirationTime;(0===n||t<n)&&(e.remainingExpirationTime=t)}de||(be?Ce&&(fe=e,pe=1,C(e,1,!1)):1===t?g():p(t))}function m(){var e=0,t=null;if(null!==ue)for(var n=ue,o=le;null!==o;){var i=o.remainingExpirationTime;if(0===i){if((null===n||null===ue)&&r("244"),o===o.nextScheduledRoot){le=ue=o.nextScheduledRoot=null;break}if(o===le)le=i=o.nextScheduledRoot,ue.nextScheduledRoot=i,o.nextScheduledRoot=null;else{if(o===ue){ue=n,ue.nextScheduledRoot=le,o.nextScheduledRoot=null;break}n.nextScheduledRoot=o.nextScheduledRoot,o.nextScheduledRoot=null}o=n.nextScheduledRoot}else{if((0===e||i<e)&&(e=i,t=o),o===ue)break;n=o,o=o.nextScheduledRoot}}n=fe,null!==n&&n===t&&1===e?xe++:xe=0,fe=t,pe=e}function y(e){v(0,!0,e)}function g(){v(1,!1,null)}function v(e,t,n){if(ve=n,m(),t)for(;null!==fe&&0!==pe&&(0===e||e>=pe)&&(!me||d()>=pe);)C(fe,pe,!me),m();else for(;null!==fe&&0!==pe&&(0===e||e>=pe);)C(fe,pe,!1),m();null!==ve&&(ce=0,se=-1),0!==pe&&p(pe),ve=null,me=!1,b()}function b(){if(xe=0,null!==we){var e=we;we=null;for(var t=0;t<e.length;t++){var n=e[t];try{n._onComplete()}catch(e){ye||(ye=!0,ge=e)}}}if(ye)throw e=ge,ge=null,ye=!1,e}function C(e,t,n){de&&r("245"),de=!0,n?(n=e.finishedWork,null!==n?k(e,n,t):(e.finishedWork=null,null!==(n=a(e,t,!0))&&(w()?e.finishedWork=n:k(e,n,t)))):(n=e.finishedWork,null!==n?k(e,n,t):(e.finishedWork=null,null!==(n=a(e,t,!1))&&k(e,n,t))),de=!1}function k(e,t,n){var o=e.firstBatch;if(null!==o&&o._expirationTime<=n&&(null===we?we=[o]:we.push(o),o._defer))return e.finishedWork=t,void(e.remainingExpirationTime=0);e.finishedWork=null,re=Z=!0,n=t.stateNode,n.current===t&&r("177"),o=n.pendingCommitExpirationTime,0===o&&r("261"),n.pendingCommitExpirationTime=0;var i=d();if(ar.current=null,1<t.effectTag)if(null!==t.lastEffect){t.lastEffect.nextEffect=t;var a=t.firstEffect}else a=t;else a=t.firstEffect;for(Q(n.containerInfo),ne=a;null!==ne;){var l=!1,c=void 0;try{for(;null!==ne;)2048&ne.effectTag&&M(ne.alternate,ne),ne=ne.nextEffect}catch(e){l=!0,c=e}l&&(null===ne&&r("178"),u(ne,c),null!==ne&&(ne=ne.nextEffect))}for(ne=a;null!==ne;){l=!1,c=void 0;try{for(;null!==ne;){var s=ne.effectTag;if(16&s&&D(ne),128&s){var f=ne.alternate;null!==f&&A(f)}switch(14&s){case 2:R(ne),ne.effectTag&=-3;break;case 6:R(ne),ne.effectTag&=-3,U(ne.alternate,ne);break;case 4:U(ne.alternate,ne);break;case 8:L(ne)}ne=ne.nextEffect}}catch(e){l=!0,c=e}l&&(null===ne&&r("178"),u(ne,c),null!==ne&&(ne=ne.nextEffect))}for(K(n.containerInfo),n.current=t,ne=a;null!==ne;){s=!1,f=void 0;try{for(a=n,l=i,c=o;null!==ne;){var p=ne.effectTag;36&p&&j(a,ne.alternate,ne,l,c),256&p&&H(ne,E),128&p&&z(ne);var h=ne.nextEffect;ne.nextEffect=null,ne=h}}catch(e){s=!0,f=e}s&&(null===ne&&r("178"),u(ne,f),null!==ne&&(ne=ne.nextEffect))}Z=re=!1,"function"==typeof at&&at(t.stateNode),t=n.current.expirationTime,0===t&&(ae=null),e.remainingExpirationTime=t}function w(){return!(null===ve||ve.timeRemaining()>_e)&&(me=!0)}function E(e){null===fe&&r("246"),fe.remainingExpirationTime=0,ye||(ye=!0,ge=e)}var x=Pt(),_=xt(e,x),T=Tt(x);x=St(x);var S=_t(e),P=bt(e,_,T,x,S,s,c).beginWork,N=Ct(e,_,T,x,S).completeWork;_=kt(_,T,x,s,n);var O=_.throwException,I=_.unwindWork,F=_.unwindInterruptedWork;_=Et(e,u,s,c,function(e){null===ae?ae=new Set([e]):ae.add(e)},d);var M=_.commitBeforeMutationLifeCycles,D=_.commitResetTextContent,R=_.commitPlacement,L=_.commitDeletion,U=_.commitWork,j=_.commitLifeCycles,H=_.commitErrorLogging,z=_.commitAttachRef,A=_.commitDetachRef,B=e.now,V=e.scheduleDeferredCallback,W=e.cancelDeferredCallback,Q=e.prepareForCommit,K=e.resetAfterCommit,$=B(),q=2,G=$,Y=0,X=0,Z=!1,J=null,ee=null,te=0,ne=null,re=!1,oe=!1,ae=null,le=null,ue=null,ce=0,se=-1,de=!1,fe=null,pe=0,he=0,me=!1,ye=!1,ge=null,ve=null,be=!1,Ce=!1,ke=!1,we=null,Ee=1e3,xe=0,_e=1;return{recalculateCurrentTime:d,computeExpirationForFiber:c,scheduleWork:s,requestWork:h,flushRoot:function(e,t){de&&r("253"),fe=e,pe=t,C(e,t,!1),g(),b()},batchedUpdates:function(e,t){var n=be;be=!0;try{return e(t)}finally{(be=n)||de||g()}},unbatchedUpdates:function(e,t){if(be&&!Ce){Ce=!0;try{return e(t)}finally{Ce=!1}}return e(t)},flushSync:function(e,t){de&&r("187");var n=be;be=!0;try{return f(e,t)}finally{be=n,g()}},flushControlled:function(e){var t=be;be=!0;try{f(e)}finally{(be=t)||de||v(1,!1,null)}},deferredUpdates:function(e){var t=X;X=25*(1+((d()+500)/25|0));try{return e()}finally{X=t}},syncUpdates:f,interactiveUpdates:function(e,t,n){if(ke)return e(t,n);be||de||0===he||(v(he,!1,null),he=0);var r=ke,o=be;be=ke=!0;try{return e(t,n)}finally{ke=r,(be=o)||de||g()}},flushInteractiveUpdates:function(){de||0===he||(v(he,!1,null),he=0)},computeUniqueAsyncExpiration:function(){var e=25*(1+((d()+500)/25|0));return e<=Y&&(e=Y+1),Y=e},legacyContext:T}}function Ot(e){function t(e,t,n,r,o,i){if(r=t.current,n){n=n._reactInternalFiber;var l=u(n);n=c(n)?s(n,l):l}else n=gn;return null===t.context?t.context=n:t.pendingContext=n,t=i,dt(r,{expirationTime:o,partialState:{element:e},callback:void 0===t?null:t,isReplace:!1,isForced:!1,capturedValue:null,next:null}),a(r,o),o}var n=e.getPublicInstance;e=Nt(e);var o=e.recalculateCurrentTime,i=e.computeExpirationForFiber,a=e.scheduleWork,l=e.legacyContext,u=l.findCurrentUnmaskedContext,c=l.isContextProvider,s=l.processChildContext;return{createContainer:function(e,t,n){return t=new Ze(3,null,null,t?3:0),e={current:t,containerInfo:e,pendingChildren:null,pendingCommitExpirationTime:0,finishedWork:null,context:null,pendingContext:null,hydrate:n,remainingExpirationTime:0,firstBatch:null,nextScheduledRoot:null},t.stateNode=e},updateContainer:function(e,n,r,a){var l=n.current,u=o();return l=i(l),t(e,n,r,u,l,a)},updateContainerAtExpirationTime:function(e,n,r,i,a){return t(e,n,r,o(),i,a)},flushRoot:e.flushRoot,requestWork:e.requestWork,computeUniqueAsyncExpiration:e.computeUniqueAsyncExpiration,batchedUpdates:e.batchedUpdates,unbatchedUpdates:e.unbatchedUpdates,deferredUpdates:e.deferredUpdates,syncUpdates:e.syncUpdates,interactiveUpdates:e.interactiveUpdates,flushInteractiveUpdates:e.flushInteractiveUpdates,flushControlled:e.flushControlled,flushSync:e.flushSync,getPublicRootInstance:function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return n(e.child.stateNode);default:return e.child.stateNode}},findHostInstance:function(e){var t=e._reactInternalFiber;return void 0===t&&("function"==typeof e.render?r("188"):r("268",Object.keys(e))),e=Re(t),null===e?null:e.stateNode},findHostInstanceWithNoPortals:function(e){return e=Le(e),null===e?null:e.stateNode},injectIntoDevTools:function(e){var t=e.findFiberByHostInstance;return it(fn({},e,{findHostInstanceByFiber:function(e){return e=Re(e),null===e?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null}}))}}}function It(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:dr,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Ft(e){var t="";return sn.Children.forEach(e,function(e){null==e||"string"!=typeof e&&"number"!=typeof e||(t+=e)}),t}function Mt(e,t){return e=fn({children:void 0},t),(t=Ft(t.children))&&(e.children=t),e}function Dt(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+n,t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function Rt(e,t){var n=t.value;e._wrapperState={initialValue:null!=n?n:t.defaultValue,wasMultiple:!!t.multiple}}function Lt(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),fn({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ut(e,t){var n=t.value;null==n&&(n=t.defaultValue,t=t.children,null!=t&&(null!=n&&r("92"),Array.isArray(t)&&(1>=t.length||r("93"),t=t[0]),n=""+t),null==n&&(n="")),e._wrapperState={initialValue:""+n}}function jt(e,t){var n=t.value;null!=n&&(n=""+n,n!==e.value&&(e.value=n),null==t.defaultValue&&(e.defaultValue=n)),null!=t.defaultValue&&(e.defaultValue=t.defaultValue)}function Ht(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}function zt(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function At(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?zt(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Vt(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=n,i=t[n];o=null==i||"boolean"==typeof i||""===i?"":r||"number"!=typeof i||0===i||Ao.hasOwnProperty(o)&&Ao[o]?(""+i).trim():i+"px","float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}function Wt(e,t,n){t&&(Vo[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e,n()),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",n()))}function Qt(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Kt(e,t){e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument;var n=$e(e);t=xn[t];for(var r=0;r<t.length;r++){var o=t[r];n.hasOwnProperty(o)&&n[o]||("topScroll"===o?Be("topScroll","scroll",e):"topFocus"===o||"topBlur"===o?(Be("topFocus","focus",e),Be("topBlur","blur",e),n.topBlur=!0,n.topFocus=!0):"topCancel"===o?(Z("cancel",!0)&&Be("topCancel","cancel",e),n.topCancel=!0):"topClose"===o?(Z("close",!0)&&Be("topClose","close",e),n.topClose=!0):eo.hasOwnProperty(o)&&Ae(o,eo[o],e),n[o]=!0)}}function $t(e,t,n,r){return n=9===n.nodeType?n:n.ownerDocument,r===jo.html&&(r=zt(e)),r===jo.html?"script"===e?(e=n.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):e="string"==typeof t.is?n.createElement(e,{is:t.is}):n.createElement(e):e=n.createElementNS(r,e),e}function qt(e,t){return(9===t.nodeType?t:t.ownerDocument).createTextNode(e)}function Gt(e,t,n,r){var o=Qt(t,n);switch(t){case"iframe":case"object":Ae("topLoad","load",e);var i=n;break;case"video":case"audio":for(i in to)to.hasOwnProperty(i)&&Ae(i,to[i],e);i=n;break;case"source":Ae("topError","error",e),i=n;break;case"img":case"image":case"link":Ae("topError","error",e),Ae("topLoad","load",e),i=n;break;case"form":Ae("topReset","reset",e),Ae("topSubmit","submit",e),i=n;break;case"details":Ae("topToggle","toggle",e),i=n;break;case"input":pe(e,n),i=fe(e,n),Ae("topInvalid","invalid",e),Kt(r,"onChange");break;case"option":i=Mt(e,n);break;case"select":Rt(e,n),i=fn({},n,{value:void 0}),Ae("topInvalid","invalid",e),Kt(r,"onChange");break;case"textarea":Ut(e,n),i=Lt(e,n),Ae("topInvalid","invalid",e),Kt(r,"onChange");break;default:i=n}Wt(t,i,Wo);var a,l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];"style"===a?Vt(e,u,Wo):"dangerouslySetInnerHTML"===a?null!=(u=u?u.__html:void 0)&&zo(e,u):"children"===a?"string"==typeof u?("textarea"!==t||""!==u)&&Bt(e,u):"number"==typeof u&&Bt(e,""+u):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(En.hasOwnProperty(a)?null!=u&&Kt(r,a):null!=u&&de(e,a,u,o))}switch(t){case"input":te(e),ye(e,n);break;case"textarea":te(e),Ht(e,n);break;case"option":null!=n.value&&e.setAttribute("value",n.value);break;case"select":e.multiple=!!n.multiple,t=n.value,null!=t?Dt(e,!!n.multiple,t,!1):null!=n.defaultValue&&Dt(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=pn)}}function Yt(e,t,n,r,o){var i=null;switch(t){case"input":n=fe(e,n),r=fe(e,r),i=[];break;case"option":n=Mt(e,n),r=Mt(e,r),i=[];break;case"select":n=fn({},n,{value:void 0}),r=fn({},r,{value:void 0}),i=[];break;case"textarea":n=Lt(e,n),r=Lt(e,r),i=[];break;default:"function"!=typeof n.onClick&&"function"==typeof r.onClick&&(e.onclick=pn)}Wt(t,r,Wo),t=e=void 0;var a=null;for(e in n)if(!r.hasOwnProperty(e)&&n.hasOwnProperty(e)&&null!=n[e])if("style"===e){var l=n[e];for(t in l)l.hasOwnProperty(t)&&(a||(a={}),a[t]="")}else"dangerouslySetInnerHTML"!==e&&"children"!==e&&"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&"autoFocus"!==e&&(En.hasOwnProperty(e)?i||(i=[]):(i=i||[]).push(e,null));for(e in r){var u=r[e];if(l=null!=n?n[e]:void 0,r.hasOwnProperty(e)&&u!==l&&(null!=u||null!=l))if("style"===e)if(l){for(t in l)!l.hasOwnProperty(t)||u&&u.hasOwnProperty(t)||(a||(a={}),a[t]="");for(t in u)u.hasOwnProperty(t)&&l[t]!==u[t]&&(a||(a={}),a[t]=u[t])}else a||(i||(i=[]),i.push(e,a)),a=u;else"dangerouslySetInnerHTML"===e?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(i=i||[]).push(e,""+u)):"children"===e?l===u||"string"!=typeof u&&"number"!=typeof u||(i=i||[]).push(e,""+u):"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&(En.hasOwnProperty(e)?(null!=u&&Kt(o,e),i||l===u||(i=[])):(i=i||[]).push(e,u))}return a&&(i=i||[]).push("style",a),i}function Xt(e,t,n,r,o){"input"===n&&"radio"===o.type&&null!=o.name&&he(e,o),Qt(n,r),r=Qt(n,o);for(var i=0;i<t.length;i+=2){var a=t[i],l=t[i+1];"style"===a?Vt(e,l,Wo):"dangerouslySetInnerHTML"===a?zo(e,l):"children"===a?Bt(e,l):de(e,a,l,r)}switch(n){case"input":me(e,o);break;case"textarea":jt(e,o);break;case"select":e._wrapperState.initialValue=void 0,t=e._wrapperState.wasMultiple,e._wrapperState.wasMultiple=!!o.multiple,n=o.value,null!=n?Dt(e,!!o.multiple,n,!1):t!==!!o.multiple&&(null!=o.defaultValue?Dt(e,!!o.multiple,o.defaultValue,!0):Dt(e,!!o.multiple,o.multiple?[]:"",!1))}}function Zt(e,t,n,r,o){switch(t){case"iframe":case"object":Ae("topLoad","load",e);break;case"video":case"audio":for(var i in to)to.hasOwnProperty(i)&&Ae(i,to[i],e);break;case"source":Ae("topError","error",e);break;case"img":case"image":case"link":Ae("topError","error",e),Ae("topLoad","load",e);break;case"form":Ae("topReset","reset",e),Ae("topSubmit","submit",e);break;case"details":Ae("topToggle","toggle",e);break;case"input":pe(e,n),Ae("topInvalid","invalid",e),Kt(o,"onChange");break;case"select":Rt(e,n),Ae("topInvalid","invalid",e),Kt(o,"onChange");break;case"textarea":Ut(e,n),Ae("topInvalid","invalid",e),Kt(o,"onChange")}Wt(t,n,Wo),r=null;for(var a in n)n.hasOwnProperty(a)&&(i=n[a],"children"===a?"string"==typeof i?e.textContent!==i&&(r=["children",i]):"number"==typeof i&&e.textContent!==""+i&&(r=["children",""+i]):En.hasOwnProperty(a)&&null!=i&&Kt(o,a));switch(t){case"input":te(e),ye(e,n);break;case"textarea":te(e),Ht(e,n);break;case"select":case"option":break;default:"function"==typeof n.onClick&&(e.onclick=pn)}return r}function Jt(e,t){return e.nodeValue!==t}function en(e){this._expirationTime=qo.computeUniqueAsyncExpiration(),this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function tn(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function nn(e,t,n){this._internalRoot=qo.createContainer(e,t,n)}function rn(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function on(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function an(e,t){if(t||(t=e?9===e.nodeType?e.documentElement:e.firstChild:null,t=!(!t||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new nn(e,!1,t)}function ln(e,t,n,o,i){rn(n)||r("200");var a=n._reactRootContainer;if(a){if("function"==typeof i){var l=i;i=function(){var e=qo.getPublicRootInstance(a._internalRoot);l.call(e)}}null!=e?a.legacy_renderSubtreeIntoContainer(e,t,i):a.render(t,i)}else{if(a=n._reactRootContainer=an(n,o),"function"==typeof i){var u=i;i=function(){var e=qo.getPublicRootInstance(a._internalRoot);u.call(e)}}qo.unbatchedUpdates(function(){null!=e?a.legacy_renderSubtreeIntoContainer(e,t,i):a.render(t,i)})}return qo.getPublicRootInstance(a._internalRoot)}function un(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return rn(t)||r("200"),It(e,t,null,n)}/** @license React v16.3.2
|
15 |
* react-dom.production.min.js
|
16 |
*
|
17 |
* Copyright (c) 2013-present, Facebook, Inc.
|
@@ -19,4 +19,4 @@ var g=n(1),v=n(2),b=n(3),C=n(4),k="function"==typeof Symbol&&Symbol.for,w=k?Symb
|
|
19 |
* This source code is licensed under the MIT license found in the
|
20 |
* LICENSE file in the root directory of this source tree.
|
21 |
*/
|
22 |
-
var cn=n(2),sn=n(0),dn=n(9),fn=n(1),pn=n(4),hn=n(10),mn=n(11),yn=n(12),gn=n(3);sn||r("227");var vn={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,invokeGuardedCallback:function(e,t,n,r,i,a,l,u,c){o.apply(vn,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,o,i,a,l,u){if(vn.invokeGuardedCallback.apply(this,arguments),vn.hasCaughtError()){var c=vn.clearCaughtError();vn._hasRethrowError||(vn._hasRethrowError=!0,vn._rethrowError=c)}},rethrowCaughtError:function(){return i.apply(vn,arguments)},hasCaughtError:function(){return vn._hasCaughtError},clearCaughtError:function(){if(vn._hasCaughtError){var e=vn._caughtError;return vn._caughtError=null,vn._hasCaughtError=!1,e}r("198")}},bn=null,Cn={},kn=[],wn={},En={},xn={},_n=Object.freeze({plugins:kn,eventNameDispatchConfigs:wn,registrationNameModules:En,registrationNameDependencies:xn,possibleRegistrationNames:null,injectEventPluginOrder:u,injectEventPluginsByName:c}),Tn=null,Sn=null,Pn=null,Nn=null,On={injectEventPluginOrder:u,injectEventPluginsByName:c},In=Object.freeze({injection:On,getListener:y,runEventsInBatch:g,runExtractedEventsInBatch:v}),Fn=Math.random().toString(36).slice(2),Mn="__reactInternalInstance$"+Fn,Dn="__reactEventHandlers$"+Fn,Rn=Object.freeze({precacheFiberNode:function(e,t){t[Mn]=e},getClosestInstanceFromNode:b,getInstanceFromNode:function(e){return e=e[Mn],!e||5!==e.tag&&6!==e.tag?null:e},getNodeFromInstance:C,getFiberCurrentPropsFromNode:k,updateFiberProps:function(e,t){e[Dn]=t}}),Ln=Object.freeze({accumulateTwoPhaseDispatches:N,accumulateTwoPhaseDispatchesSkipTarget:function(e){f(e,T)},accumulateEnterLeaveDispatches:O,accumulateDirectDispatches:function(e){f(e,P)}}),Un=null,jn={_root:null,_startText:null,_fallbackText:null},Hn="dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances".split(" "),zn={type:null,target:null,currentTarget:pn.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};fn(D.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=pn.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=pn.thatReturnsTrue)},persist:function(){this.isPersistent=pn.thatReturnsTrue},isPersistent:pn.thatReturnsFalse,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;for(t=0;t<Hn.length;t++)this[Hn[t]]=null}}),D.Interface=zn,D.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return fn(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=fn({},r.Interface,e),n.extend=r.extend,U(n),n},U(D);var An=D.extend({data:null}),Bn=D.extend({data:null}),Vn=[9,13,27,32],Wn=dn.canUseDOM&&"CompositionEvent"in window,Qn=null;dn.canUseDOM&&"documentMode"in document&&(Qn=document.documentMode);var Kn=dn.canUseDOM&&"TextEvent"in window&&!Qn,$n=dn.canUseDOM&&(!Wn||Qn&&8<Qn&&11>=Qn),qn=String.fromCharCode(32),Gn={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}},Yn=!1,Xn=!1,Zn={eventTypes:Gn,extractEvents:function(e,t,n,r){var o=void 0,i=void 0;if(Wn)e:{switch(e){case"topCompositionStart":o=Gn.compositionStart;break e;case"topCompositionEnd":o=Gn.compositionEnd;break e;case"topCompositionUpdate":o=Gn.compositionUpdate;break e}o=void 0}else Xn?j(e,n)&&(o=Gn.compositionEnd):"topKeyDown"===e&&229===n.keyCode&&(o=Gn.compositionStart);return o?($n&&(Xn||o!==Gn.compositionStart?o===Gn.compositionEnd&&Xn&&(i=F()):(jn._root=r,jn._startText=M(),Xn=!0)),o=An.getPooled(o,t,n,r),i?o.data=i:null!==(i=H(n))&&(o.data=i),N(o),i=o):i=null,(e=Kn?z(e,n):A(e,n))?(t=Bn.getPooled(Gn.beforeInput,t,n,r),t.data=e,N(t)):t=null,null===i?t:null===t?i:[i,t]}},Jn=null,er={injectFiberControlledHostComponent:function(e){Jn=e}},tr=null,nr=null,rr=Object.freeze({injection:er,enqueueStateRestore:V,needsStateRestore:W,restoreStateIfNeeded:Q}),or=!1,ir={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},ar=sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lr="function"==typeof Symbol&&Symbol.for,ur=lr?Symbol.for("react.element"):60103,cr=lr?Symbol.for("react.call"):60104,sr=lr?Symbol.for("react.return"):60105,dr=lr?Symbol.for("react.portal"):60106,fr=lr?Symbol.for("react.fragment"):60107,pr=lr?Symbol.for("react.strict_mode"):60108,hr=lr?Symbol.for("react.provider"):60109,mr=lr?Symbol.for("react.context"):60110,yr=lr?Symbol.for("react.async_mode"):60111,gr=lr?Symbol.for("react.forward_ref"):60112,vr="function"==typeof Symbol&&Symbol.iterator,br=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Cr={},kr={},wr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wr[e]=new ce(e,0,!1,e,null)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wr[t]=new ce(t,1,!1,e[1],null)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){wr[e]=new ce(e,2,!1,e.toLowerCase(),null)}),["autoReverse","externalResourcesRequired","preserveAlpha"].forEach(function(e){wr[e]=new ce(e,2,!1,e,null)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){wr[e]=new ce(e,3,!1,e.toLowerCase(),null)}),["checked","multiple","muted","selected"].forEach(function(e){wr[e]=new ce(e,3,!0,e.toLowerCase(),null)}),["capture","download"].forEach(function(e){wr[e]=new ce(e,4,!1,e.toLowerCase(),null)}),["cols","rows","size","span"].forEach(function(e){wr[e]=new ce(e,6,!1,e.toLowerCase(),null)}),["rowSpan","start"].forEach(function(e){wr[e]=new ce(e,5,!1,e.toLowerCase(),null)});var Er=/[\-:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Er,se);wr[t]=new ce(t,1,!1,e,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Er,se);wr[t]=new ce(t,1,!1,e,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Er,se);wr[t]=new ce(t,1,!1,e,"http://www.w3.org/XML/1998/namespace")}),wr.tabIndex=new ce("tabIndex",1,!1,"tabindex",null);var xr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange".split(" ")}},_r=null,Tr=null,Sr=!1;dn.canUseDOM&&(Sr=Z("input")&&(!document.documentMode||9<document.documentMode));var Pr={eventTypes:xr,_isInputEventSupported:Sr,extractEvents:function(e,t,n,r){var o=t?C(t):window,i=void 0,a=void 0,l=o.nodeName&&o.nodeName.toLowerCase();if("select"===l||"input"===l&&"file"===o.type?i=we:Y(o)?Sr?i=Pe:(i=Te,a=_e):(l=o.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(i=Se),i&&(i=i(e,t)))return be(i,n,r);a&&a(e,o,t),"topBlur"===e&&null!=t&&(e=t._wrapperState||o._wrapperState)&&e.controlled&&"number"===o.type&&ge(o,"number",o.value)}},Nr=D.extend({view:null,detail:null}),Or={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},Ir=Nr.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Oe,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)}}),Fr={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},Mr={eventTypes:Fr,extractEvents:function(e,t,n,r){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement)||"topMouseOut"!==e&&"topMouseOver"!==e)return null;var o=r.window===r?r:(o=r.ownerDocument)?o.defaultView||o.parentWindow:window;if("topMouseOut"===e?(e=t,t=(t=n.relatedTarget||n.toElement)?b(t):null):e=null,e===t)return null;var i=null==e?o:C(e);o=null==t?o:C(t);var a=Ir.getPooled(Fr.mouseLeave,e,n,r);return a.type="mouseleave",a.target=i,a.relatedTarget=o,n=Ir.getPooled(Fr.mouseEnter,t,n,r),n.type="mouseenter",n.target=o,n.relatedTarget=i,O(a,n,e,t),[a,n]}},Dr=D.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Rr=D.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lr=Nr.extend({relatedTarget:null}),Ur={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Hr=Nr.extend({key:function(e){if(e.key){var t=Ur[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?(e=Ue(e),13===e?"Enter":String.fromCharCode(e)):"keydown"===e.type||"keyup"===e.type?jr[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Oe,charCode:function(e){return"keypress"===e.type?Ue(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Ue(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),zr=Ir.extend({dataTransfer:null}),Ar=Nr.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Oe}),Br=D.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),Vr=Ir.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),Wr={},Qr={};"blur cancel click close contextMenu copy cut doubleClick dragEnd dragStart drop focus input invalid keyDown keyPress keyUp mouseDown mouseUp paste pause play rateChange reset seeked submit touchCancel touchEnd touchStart volumeChange".split(" ").forEach(function(e){je(e,!0)}),"abort animationEnd animationIteration animationStart canPlay canPlayThrough drag dragEnter dragExit dragLeave dragOver durationChange emptied encrypted ended error load loadedData loadedMetadata loadStart mouseMove mouseOut mouseOver playing progress scroll seeking stalled suspend timeUpdate toggle touchMove transitionEnd waiting wheel".split(" ").forEach(function(e){je(e,!1)});var Kr={eventTypes:Wr,isInteractiveTopLevelEventType:function(e){return void 0!==(e=Qr[e])&&!0===e.isInteractive},extractEvents:function(e,t,n,r){var o=Qr[e];if(!o)return null;switch(e){case"topKeyPress":if(0===Ue(n))return null;case"topKeyDown":case"topKeyUp":e=Hr;break;case"topBlur":case"topFocus":e=Lr;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":e=Ir;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":e=zr;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":e=Ar;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":e=Dr;break;case"topTransitionEnd":e=Br;break;case"topScroll":e=Nr;break;case"topWheel":e=Vr;break;case"topCopy":case"topCut":case"topPaste":e=Rr;break;default:e=D}return t=e.getPooled(o,t,n,r),N(t),t}},$r=Kr.isInteractiveTopLevelEventType,qr=[],Gr=!0,Yr=Object.freeze({get _enabled(){return Gr},setEnabled:ze,isEnabled:function(){return Gr},trapBubbledEvent:Ae,trapCapturedEvent:Be,dispatchEvent:We}),Xr={animationend:Qe("Animation","AnimationEnd"),animationiteration:Qe("Animation","AnimationIteration"),animationstart:Qe("Animation","AnimationStart"),transitionend:Qe("Transition","TransitionEnd")},Zr={},Jr={};dn.canUseDOM&&(Jr=document.createElement("div").style,"AnimationEvent"in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),"TransitionEvent"in window||delete Xr.transitionend.transition);var eo={topAnimationEnd:Ke("animationend"),topAnimationIteration:Ke("animationiteration"),topAnimationStart:Ke("animationstart"),topBlur:"blur",topCancel:"cancel",topChange:"change",topClick:"click",topClose:"close",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoad:"load",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topScroll:"scroll",topSelectionChange:"selectionchange",topTextInput:"textInput",topToggle:"toggle",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:Ke("transitionend"),topWheel:"wheel"},to={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},no={},ro=0,oo="_reactListenersID"+(""+Math.random()).slice(2),io=dn.canUseDOM&&"documentMode"in document&&11>=document.documentMode,ao={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}},lo=null,uo=null,co=null,so=!1,fo={eventTypes:ao,extractEvents:function(e,t,n,r){var o,i=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(o=!i)){e:{i=$e(i),o=xn.onSelect;for(var a=0;a<o.length;a++){var l=o[a];if(!i.hasOwnProperty(l)||!i[l]){i=!1;break e}}i=!0}o=!i}if(o)return null;switch(i=t?C(t):window,e){case"topFocus":(Y(i)||"true"===i.contentEditable)&&(lo=i,uo=t,co=null);break;case"topBlur":co=uo=lo=null;break;case"topMouseDown":so=!0;break;case"topContextMenu":case"topMouseUp":return so=!1,Xe(n,r);case"topSelectionChange":if(io)break;case"topKeyDown":case"topKeyUp":return Xe(n,r)}return null}};On.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin TapEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),Tn=Rn.getFiberCurrentPropsFromNode,Sn=Rn.getInstanceFromNode,Pn=Rn.getNodeFromInstance,On.injectEventPluginsByName({SimpleEventPlugin:Kr,EnterLeaveEventPlugin:Mr,ChangeEventPlugin:Pr,SelectEventPlugin:fo,BeforeInputEventPlugin:Zn});var po=null,ho=null;new Set;var mo=void 0,yo=void 0,go=Array.isArray,vo=vt(!0),bo=vt(!1),Co={},ko=Object.freeze({default:Ot}),wo=ko&&Ot||ko,Eo=wo.default?wo.default:wo,xo="object"==typeof performance&&"function"==typeof performance.now,_o=void 0;_o=xo?function(){return performance.now()}:function(){return Date.now()};var To=void 0,So=void 0;if(dn.canUseDOM)if("function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback){var Po=null,No=!1,Oo=-1,Io=!1,Fo=0,Mo=33,Do=33,Ro=void 0;Ro=xo?{didTimeout:!1,timeRemaining:function(){var e=Fo-performance.now();return 0<e?e:0}}:{didTimeout:!1,timeRemaining:function(){var e=Fo-Date.now();return 0<e?e:0}};var Lo="__reactIdleCallback$"+Math.random().toString(36).slice(2);window.addEventListener("message",function(e){if(e.source===window&&e.data===Lo){if(No=!1,e=_o(),0>=Fo-e){if(!(-1!==Oo&&Oo<=e))return void(Io||(Io=!0,requestAnimationFrame(Uo)));Ro.didTimeout=!0}else Ro.didTimeout=!1;Oo=-1,e=Po,Po=null,null!==e&&e(Ro)}},!1);var Uo=function(e){Io=!1;var t=e-Fo+Do;t<Do&&Mo<Do?(8>t&&(t=8),Do=t<Mo?Mo:t):Mo=t,Fo=e+Do,No||(No=!0,window.postMessage(Lo,"*"))};To=function(e,t){return Po=e,null!=t&&"number"==typeof t.timeout&&(Oo=_o()+t.timeout),Io||(Io=!0,requestAnimationFrame(Uo)),0},So=function(){Po=null,No=!1,Oo=-1}}else To=window.requestIdleCallback,So=window.cancelIdleCallback;else To=function(e){return setTimeout(function(){e({timeRemaining:function(){return 1/0},didTimeout:!1})})},So=function(e){clearTimeout(e)};var jo={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"},Ho=void 0,zo=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if(e.namespaceURI!==jo.svg||"innerHTML"in e)e.innerHTML=t;else{for(Ho=Ho||document.createElement("div"),Ho.innerHTML="<svg>"+t+"</svg>",t=Ho.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}),Ao={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Bo=["Webkit","ms","Moz","O"];Object.keys(Ao).forEach(function(e){Bo.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ao[t]=Ao[e]})});var Vo=fn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Wo=pn.thatReturns(""),Qo=Object.freeze({createElement:$t,createTextNode:qt,setInitialProperties:Gt,diffProperties:Yt,updateProperties:Xt,diffHydratedProperties:Zt,diffHydratedText:Jt,warnForUnmatchedText:function(){},warnForDeletedHydratableElement:function(){},warnForDeletedHydratableText:function(){},warnForInsertedHydratedElement:function(){},warnForInsertedHydratedText:function(){},restoreControlledState:function(e,t,n){switch(t){case"input":if(me(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var i=k(o);i||r("90"),ne(o),me(o,i)}}}break;case"textarea":jt(e,n);break;case"select":null!=(t=n.value)&&Dt(e,!!n.multiple,t,!1)}}});er.injectFiberControlledHostComponent(Qo);var Ko=null,$o=null;en.prototype.render=function(e){this._defer||r("250"),this._hasChildren=!0,this._children=e;var t=this._root._internalRoot,n=this._expirationTime,o=new tn;return qo.updateContainerAtExpirationTime(e,t,null,n,o._onCommit),o},en.prototype.then=function(e){if(this._didComplete)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},en.prototype.commit=function(){var e=this._root._internalRoot,t=e.firstBatch;if(this._defer&&null!==t||r("251"),this._hasChildren){var n=this._expirationTime;if(t!==this){this._hasChildren&&(n=this._expirationTime=t._expirationTime,this.render(this._children));for(var o=null,i=t;i!==this;)o=i,i=i._next;null===o&&r("251"),o._next=i._next,this._next=t,e.firstBatch=this}this._defer=!1,qo.flushRoot(e,n),t=this._next,this._next=null,t=e.firstBatch=t,null!==t&&t._hasChildren&&t.render(t._children)}else this._next=null,this._defer=!1},en.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++)(0,e[t])()}},tn.prototype.then=function(e){if(this._didCommit)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},tn.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++){var n=e[t];"function"!=typeof n&&r("191",n),n()}}},nn.prototype.render=function(e,t){var n=this._internalRoot,r=new tn;return t=void 0===t?null:t,null!==t&&r.then(t),qo.updateContainer(e,n,null,r._onCommit),r},nn.prototype.unmount=function(e){var t=this._internalRoot,n=new tn;return e=void 0===e?null:e,null!==e&&n.then(e),qo.updateContainer(null,t,null,n._onCommit),n},nn.prototype.legacy_renderSubtreeIntoContainer=function(e,t,n){var r=this._internalRoot,o=new tn;return n=void 0===n?null:n,null!==n&&o.then(n),qo.updateContainer(t,r,e,o._onCommit),o},nn.prototype.createBatch=function(){var e=new en(this),t=e._expirationTime,n=this._internalRoot,r=n.firstBatch;if(null===r)n.firstBatch=e,e._next=null;else{for(n=null;null!==r&&r._expirationTime<=t;)n=r,r=r._next;e._next=r,null!==n&&(n._next=e)}return e};var qo=Eo({getRootHostContext:function(e){var t=e.nodeType;switch(t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:At(null,"");break;default:t=8===t?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=At(e,t)}return e},getChildHostContext:function(e,t){return At(e,t)},getPublicInstance:function(e){return e},prepareForCommit:function(){Ko=Gr;var e=hn();if(Ye(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{var n=window.getSelection&&window.getSelection();if(n&&0!==n.rangeCount){t=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{t.nodeType,o.nodeType}catch(e){t=null;break e}var i=0,a=-1,l=-1,u=0,c=0,s=e,d=null;t:for(;;){for(var f;s!==t||0!==r&&3!==s.nodeType||(a=i+r),s!==o||0!==n&&3!==s.nodeType||(l=i+n),3===s.nodeType&&(i+=s.nodeValue.length),null!==(f=s.firstChild);)d=s,s=f;for(;;){if(s===e)break t;if(d===t&&++u===r&&(a=i),d===o&&++c===n&&(l=i),null!==(f=s.nextSibling))break;s=d,d=s.parentNode}s=f}t=-1===a||-1===l?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;$o={focusedElem:e,selectionRange:t},ze(!1)},resetAfterCommit:function(){var e=$o,t=hn(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&yn(document.documentElement,n)){if(Ye(n))if(t=r.start,e=r.end,void 0===e&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(window.getSelection){t=window.getSelection();var o=n[I()].length;e=Math.min(r.start,o),r=void 0===r.end?e:Math.min(r.end,o),!t.extend&&e>r&&(o=r,r=e,e=o),o=Ge(n,e);var i=Ge(n,r);if(o&&i&&(1!==t.rangeCount||t.anchorNode!==o.node||t.anchorOffset!==o.offset||t.focusNode!==i.node||t.focusOffset!==i.offset)){var a=document.createRange();a.setStart(o.node,o.offset),t.removeAllRanges(),e>r?(t.addRange(a),t.extend(i.node,i.offset)):(a.setEnd(i.node,i.offset),t.addRange(a))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}$o=null,ze(Ko),Ko=null},createInstance:function(e,t,n,r,o){return e=$t(e,t,n,r),e[Mn]=o,e[Dn]=t,e},appendInitialChild:function(e,t){e.appendChild(t)},finalizeInitialChildren:function(e,t,n,r){return Gt(e,t,n,r),on(t,n)},prepareUpdate:function(e,t,n,r,o){return Yt(e,t,n,r,o)},shouldSetTextContent:function(e,t){return"textarea"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html},shouldDeprioritizeSubtree:function(e,t){return!!t.hidden},createTextInstance:function(e,t,n,r){return e=qt(e,t),e[Mn]=r,e},now:_o,mutation:{commitMount:function(e,t,n){on(t,n)&&e.focus()},commitUpdate:function(e,t,n,r,o){e[Dn]=o,Xt(e,t,n,r,o)},resetTextContent:function(e){Bt(e,"")},commitTextUpdate:function(e,t,n){e.nodeValue=n},appendChild:function(e,t){e.appendChild(t)},appendChildToContainer:function(e,t){8===e.nodeType?e.parentNode.insertBefore(t,e):e.appendChild(t)},insertBefore:function(e,t,n){e.insertBefore(t,n)},insertInContainerBefore:function(e,t,n){8===e.nodeType?e.parentNode.insertBefore(t,n):e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},removeChildFromContainer:function(e,t){8===e.nodeType?e.parentNode.removeChild(t):e.removeChild(t)}},hydration:{canHydrateInstance:function(e,t){return 1!==e.nodeType||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e},canHydrateTextInstance:function(e,t){return""===t||3!==e.nodeType?null:e},getNextHydratableSibling:function(e){for(e=e.nextSibling;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e},getFirstHydratableChild:function(e){for(e=e.firstChild;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e},hydrateInstance:function(e,t,n,r,o,i){return e[Mn]=i,e[Dn]=n,Zt(e,t,n,o,r)},hydrateTextInstance:function(e,t,n){return e[Mn]=n,Jt(e,t)},didNotMatchHydratedContainerTextInstance:function(){},didNotMatchHydratedTextInstance:function(){},didNotHydrateContainerInstance:function(){},didNotHydrateInstance:function(){},didNotFindHydratableContainerInstance:function(){},didNotFindHydratableContainerTextInstance:function(){},didNotFindHydratableInstance:function(){},didNotFindHydratableTextInstance:function(){}},scheduleDeferredCallback:To,cancelDeferredCallback:So}),Go=qo;K=Go.batchedUpdates,$=Go.interactiveUpdates,q=Go.flushInteractiveUpdates;var Yo={createPortal:un,findDOMNode:function(e){return null==e?null:1===e.nodeType?e:qo.findHostInstance(e)},hydrate:function(e,t,n){return ln(null,e,t,!0,n)},render:function(e,t,n){return ln(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,o){return(null==e||void 0===e._reactInternalFiber)&&r("38"),ln(e,t,n,!1,o)},unmountComponentAtNode:function(e){return rn(e)||r("40"),!!e._reactRootContainer&&(qo.unbatchedUpdates(function(){ln(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},unstable_createPortal:function(){return un.apply(void 0,arguments)},unstable_batchedUpdates:qo.batchedUpdates,unstable_deferredUpdates:qo.deferredUpdates,flushSync:qo.flushSync,unstable_flushControlled:qo.flushControlled,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{EventPluginHub:In,EventPluginRegistry:_n,EventPropagators:Ln,ReactControlledComponent:rr,ReactDOMComponentTree:Rn,ReactDOMEventListener:Yr},unstable_createRoot:function(e,t){return new nn(e,!0,null!=t&&!0===t.hydrate)}};qo.injectIntoDevTools({findFiberByHostInstance:b,bundleType:0,version:"16.3.2",rendererPackageName:"react-dom"});var Xo=Object.freeze({default:Yo}),Zo=Xo&&Yo||Xo;e.exports=Zo.default?Zo.default:Zo},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){"use strict";function r(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}e.exports=r},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function o(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(!i.call(t,n[a])||!r(e[n[a]],t[n[a]]))return!1;return!0}var i=Object.prototype.hasOwnProperty;e.exports=o},function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!o(e)&&(o(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var o=n(13);e.exports=r},function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=n(14);e.exports=r},function(e,t,n){"use strict";function r(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),c=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={hasError:!1},n}return i(t,e),a(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0}),console.log("Builder UI Error:",e,t)}},{key:"render",value:function(){return this.state.hasError,this.props.children}}]),t}(u.default.Component);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),c=r(u),s=n(17),d=r(s),f=n(19),p=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),l(t,[{key:"render",value:function(){return c.default.createElement(u.Fragment,null,c.default.createElement(d.default,null),c.default.createElement(f.NotificationsManager,null))}}]),t}(u.Component);t.default=p},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0);n(18);var u=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),i=n.props.postId;return n.layoutClass=".fl-builder-content-"+(i||FLBuilderConfig.postId),n}return i(t,e),a(t,[{key:"componentDidMount",value:function(){this.setupHooks=this.setupHooks.bind(this),this.hooked=!1,jQuery(document).on("tinymce-editor-init",this.setupHooks),this.setupHooks()}},{key:"setupHooks",value:function(){if(window.tinymce&&!this.hooked&&FLBuilderConfig.inlineEnabled){var e=this.setupEditables.bind(this),t=this.refreshEditables.bind(this),n=(this.destroyEditables.bind(this),this.destroyAllEditables.bind(this)),r=this.destroyLoadingEditables.bind(this);FLBuilder&&(FLBuilder.addHook("init",e),FLBuilder.addHook("settingsConfigLoaded",e),FLBuilder.addHook("restartEditingSession",e),FLBuilder.addHook("endEditingSession",n),FLBuilder.addHook("didStartNodeLoading",r),FLBuilder.addHook("didRenderLayoutComplete",t),FLBuilder.addHook("didDeleteRow",t),FLBuilder.addHook("didDeleteColumn",t),FLBuilder.addHook("didDeleteModule",t)),this.setupEditables(),this.hooked=!0}}},{key:"setupEditables",value:function(){var e=this,t=FLBuilderSettingsConfig,n=t.editables,r=jQuery(this.layoutClass);if(r.length)for(var o in n){var i='.fl-module[data-type="'+o+'"]:not(.fl-editable):not(.fl-node-global)';r.find(i).each(function(t,n){return e.setupEditable(jQuery(n))})}}},{key:"setupEditable",value:function(e){var t=this,n=e.data("type"),r=e.data("node"),o=FLBuilderSettingsConfig.editables[n],i=".fl-node-"+r+" ",a="fl-inline-editor-"+r,l=jQuery('<div id="'+a+'" class="fl-inline-editor"></div>'),u=jQuery(".fl-builder-settings[data-node="+r+"]"),c=FLBuilderSettingsConfig.nodes[r],s=c.connections;e.append(l),e.addClass("fl-editable"),e.on("mouseup",this.onModuleMouseup.bind(this)),e.on("mouseleave",this.onModuleMouseleave.bind(this));for(var d in o){(function(e){var n=o[e],r=FLBuilderPreview.getFormattedSelector(i,n.selector),l=jQuery(r),d=l.html(),f=u.find("#fl-field-"+e+" .fl-field-connection-value");l.length&&(f.length&&""!==f.val()||(!f.length&&s&&s[e]||(l.data("field",n.field),l.on("drop",t.onEditorDrop.bind(t)),tinymce.init({selector:r,inline:!0,menubar:!1,skin:!FLBuilder&&"lightgray",skin_url:!FLBuilder&&tinyMCEPreInit.baseURL+"/skins/lightgray/",theme:"modern",theme_url:tinyMCEPreInit.baseURL+"/themes/modern/",fixed_toolbar_container:"#"+a,plugins:t.getEditorPluginConfig(n.field.type),toolbar:t.getEditorToolbarConfig(n.field.type),init_instance_callback:function(e){t.onEditorInit(e),t.matchHTML(d,t.getFieldHTML(n.field,c))||(l.html(d),l.addClass("fl-editable-has-dynamic-content"))}}))))})(d)}}},{key:"getEditorPluginConfig",value:function(e){switch(e){case"editor":return"wordpress, wplink, lists";default:return""}}},{key:"getEditorToolbarConfig",value:function(e){switch(e){case"editor":return"bold italic strikethrough link underline | alignleft aligncenter alignright";case"unit":return!1;default:return"bold italic strikethrough underline"}}},{key:"destroyEditables",value:function(e){var t=e.find(".mce-content-body"),n=e.find(".fl-inline-editor"),r=jQuery(".wplink-autocomplete, .ui-helper-hidden-accessible");t.removeAttr("contenteditable"),e.off("mouseup"),e.off("mouseleave"),e.removeClass("fl-editable"),n.remove(),r.remove(),t.each(function(e,t){var n=jQuery(t).attr("id");jQuery('[id="'+n+'"]').length<2&&setTimeout(function(){return tinymce.execCommand("mceRemoveEditor",!0,n)},1)})}},{key:"destroyAllEditables",value:function(){var e=jQuery(this.layoutClass),t=e.find(".fl-editable");this.destroyEditables(t)}},{key:"destroyLoadingEditables",value:function(e,t){var n=jQuery(t);n.hasClass("fl-module")||(n=n.find(".fl-module")),this.destroyEditables(n)}},{key:"refreshEditables",value:function(){this.setupEditables(),tinymce.editors.map(function(e,t){e.inline&&!jQuery("#"+e.id).length&&setTimeout(function(){return tinymce.execCommand("mceRemoveEditor",!0,e.id)},1)})}},{key:"getEditorEventVars",value:function(e){var t=jQuery(e),n=tinymce.get(t.attr("id")),r=t.data("field"),o=t.closest(".fl-module");return{editable:t,module:o,editor:n,field:r,nodeId:o.data("node")}}},{key:"onEditorInit",value:function(e){e.on("change",this.onEditorChange.bind(this)),e.on("keyup",this.onEditorChange.bind(this)),e.on("undo",this.onEditorChange.bind(this)),e.on("redo",this.onEditorChange.bind(this)),e.on("blur",this.onEditorBlur.bind(this)),e.on("focus",this.onEditorFocus.bind(this)),e.on("mousedown",this.onEditorMousedown.bind(this))}},{key:"onEditorChange",value:function(e){var t=e.target.bodyElement?e.target.bodyElement:e.target,n=this.getEditorEventVars(t),r=(n.editable,n.editor),o=n.field,i=n.nodeId,a=jQuery('.fl-builder-settings[data-node="'+i+'"]'),l=r.getContent();if(a.length)if("editor"===o.type){var u=a.find("#fl-field-"+o.name+" textarea.wp-editor-area"),c=u.attr("id");u.closest(".tmce-active").length?tinymce.get(c).setContent(l):u.val(l)}else{var s=document.createElement("textarea");s.innerHTML=l,a.find('[name="'+o.name+'"]').val(s.value)}}},{key:"onEditorBlur",value:function(e){var t=this.getEditorEventVars(e.target.bodyElement),n=t.editable,r=t.editor,o=t.module,i=t.field,a=t.nodeId,l=o.find(".fl-inline-editor"),u=FLBuilderSettingsConfig.nodes[a],c=!!i&&this.matchHTML(r.getContent(),this.getFieldHTML(i,u));l.removeClass("fl-inline-editor-no-toolbar"),c&&n.hasClass("fl-editable-editing-dynamic-content")&&(n.removeClass("fl-editable-editing-dynamic-content"),n.addClass("fl-editable-has-dynamic-content"),n.css("min-height",""),n.html(n.data("original")))}},{key:"onEditorFocus",value:function(e){var t=this.getEditorEventVars(e.target.bodyElement),n=t.editable,r=t.editor,o=t.module,i=t.field,a=t.nodeId,l=o.find(".fl-inline-editor"),u=FLBuilderSettingsConfig.nodes[a];this.showEditorOverlay(o),r.settings.toolbar?l.removeClass("fl-inline-editor-no-toolbar"):l.addClass("fl-inline-editor-no-toolbar"),n.hasClass("fl-editable-has-dynamic-content")&&(n.removeClass("fl-editable-has-dynamic-content"),n.addClass("fl-editable-editing-dynamic-content"),n.css("min-height",n.height()),n.data("original",n.html()),r.setContent(wp.editor.autop(u[i.name])),r.selection.select(r.getBody(),!0),r.selection.collapse(!1))}},{key:"onEditorMousedown",value:function(e){var t=this.getEditorEventVars(e.target),n=t.module;this.showEditorOverlay(n)}},{key:"onModuleMouseup",value:function(e){var t=jQuery(e.currentTarget),n=t.find(".mce-content-body").first().attr("id");jQuery(e.target).closest(".fl-module-overlay").length||(n&&!t.find(".mce-edit-focus").length&&tinymce.get(n).focus(),this.showModuleSettings(t))}},{key:"onEditorDrop",value:function(e){return e.preventDefault(),!1}},{key:"onModuleMouseleave",value:function(e){jQuery(".mce-inline-toolbar-grp:visible, .mce-floatpanel:visible").length||(this.hideEditorOverlays(),this.showNodeOverlays())}},{key:"showEditorOverlay",value:function(e){e.find(".fl-inline-editor").show(),this.hideNodeOverlays()}},{key:"hideEditorOverlays",value:function(){jQuery(".fl-inline-editor, .mce-floatpanel").hide()}},{key:"showNodeOverlays",value:function(){jQuery(".fl-block-overlay").show()}},{key:"hideNodeOverlays",value:function(){jQuery(".fl-block-overlay").hide()}},{key:"showModuleSettings",value:function(e){var t=e.data("type"),n=e.data("node"),r=e.closest(".fl-col").data("node"),o=e.hasClass("fl-node-global");jQuery('.fl-builder-settings[data-node="'+n+'"]').length||FLBuilder._showModuleSettings({type:t,nodeId:n,parentId:r,global:o})}},{key:"getFieldHTML",value:function(e,t){var n=t[e.name];return"editor"===e.type&&""!==n?wp.editor.autop(n):n}},{key:"matchHTML",value:function(e,t){return this.cleanHTML(e)===this.cleanHTML(t)}},{key:"cleanHTML",value:function(e){var t=/(\r\n|\n|\r)/gm;return jQuery("<div>"+e+"</div>").html().trim().replace(t,"")}},{key:"render",value:function(){return null}}]),t}(l.Component);t.default=u},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationsManager=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l);n(20);var c=function(e){return u.default.createElement("div",{dangerouslySetInnerHTML:{__html:e}})},s=FLBuilderConfig.lite,d=function(e){var t={__html:e.children},n=new Date(e.date).toDateString(),r=void 0;if("string"==typeof e.url&&""!==e.url){var o=s?e.url+"?utm_medium=bb-lite&utm_source=builder-ui&utm_campaign=notification-center":e.url+"?utm_medium=bb-pro&utm_source=builder-ui&utm_campaign=notification-center";r=u.default.createElement("a",{className:"fl-builder-ui-post",href:o,target:"_blank",rel:"noopener"},u.default.createElement("div",{className:"fl-builder-ui-post-date"},n),u.default.createElement("div",{className:"fl-builder-ui-post-title"},e.title),u.default.createElement("div",{className:"fl-builder-ui-post-content",dangerouslySetInnerHTML:t}))}else r=u.default.createElement("span",{className:"fl-builder-ui-post"},u.default.createElement("div",{className:"fl-builder-ui-post-date"},n),u.default.createElement("div",{className:"fl-builder-ui-post-title"},e.title),u.default.createElement("div",{className:"fl-builder-ui-post-content",dangerouslySetInnerHTML:t}));return r},f=function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return i(t,e),a(t,[{key:"getPosts",value:function(e){var t=void 0,n=void 0,r=FLBuilderStrings.notifications;return e.length>0?(n=e.map(function(e){return u.default.createElement(d,{key:e.id,title:c(e.title.rendered),date:e.date,url:e.meta._fl_notification[0]},e.content.rendered)}),t=u.default.createElement(l.Fragment,null,n)):t=u.default.createElement("div",{className:"fl-panel-no-message"},r.none),t}},{key:"componentDidMount",value:function(){FLBuilder._initScrollbars()}},{key:"componentDidUpdate",value:function(){FLBuilder._initScrollbars()}},{key:"render",value:function(){var e=this.getPosts(this.props.posts),t=FLBuilderStrings.notifications;return u.default.createElement("div",{className:"fl-notifications-panel"},u.default.createElement("div",{className:"fl-panel-title"},t.title),u.default.createElement("div",{className:"fl-nanoscroller",ref:this.setupScroller},u.default.createElement("div",{className:"fl-nanoscroller-content"},e)))}}]),t}(l.Component);t.NotificationsManager=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),i=FLBuilderConfig.notifications,a=(i.read,i.data);return n.state={shouldShowNotifications:!1,posts:JSON.parse(a)},FLBuilder.addHook("toggleNotifications",n.onToggleNotifications.bind(n)),n}return i(t,e),a(t,[{key:"onToggleNotifications",value:function(){this.setState({shouldShowNotifications:!this.state.shouldShowNotifications})}},{key:"render",value:function(){var e=this.state,t=e.shouldShowNotifications,n=e.posts;return FLBuilder.triggerHook("notificationsLoaded"),u.default.createElement(l.Fragment,null,t&&u.default.createElement(f,{posts:n}))}}]),t}(l.Component)},function(e,t){},function(e,t){}]);
|
3 |
(c) Sindre Sorhus
|
4 |
@license MIT
|
5 |
*/
|
6 |
+
var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,u=r(e),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var s in n)i.call(n,s)&&(u[s]=n[s]);if(o){l=o(n);for(var f=0;f<l.length;f++)a.call(n,l[f])&&(u[l[f]]=n[l[f]])}}return u}},function(e,t,n){"use strict";function r(e,t,n,r,i,a,l,u){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,i,a,l,u],f=0;c=new Error(t.replace(/%s/g,function(){return s[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var o=n(0),i=r(o),a=n(7),l=r(a),u=n(15),c=r(u),s=n(16),f=r(s);n(21),l.default.render(i.default.createElement(c.default,null,i.default.createElement(f.default,null)),document.getElementById("fl-ui-root"))},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="http://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);v(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}function o(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||I}function i(){}function a(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||I}function l(e,t,n){var r=void 0,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)D.call(t,r)&&!R.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:w,type:e,key:i,ref:a,props:o,_owner:F.current}}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===w}function c(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function s(e,t,n,r){if(U.length){var o=U.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function f(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>U.length&&U.push(e)}function d(e,t,n,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var a=!1;if(null===e)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case w:case E:a=!0}}if(a)return n(o,e,""===t?"."+p(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var l=0;l<e.length;l++){i=e[l];var u=t+p(i,l);a+=d(i,u,n,o)}else if(null===e||void 0===e?u=null:(u=O&&e[O]||e["@@iterator"],u="function"==typeof u?u:null),"function"==typeof u)for(e=u.call(e),l=0;!(i=e.next()).done;)i=i.value,u=t+p(i,l++),a+=d(i,u,n,o);else"object"===i&&(n=""+e,r("31","[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return a}function p(e,t){return"object"==typeof e&&null!==e&&null!=e.key?c(e.key):t.toString(36)}function h(e,t){e.func.call(e.context,t,e.count++)}function m(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?y(e,r,n,C.thatReturnsArgument):null!=e&&(u(e)&&(t=o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(L,"$&/")+"/")+n,e={$$typeof:w,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),r.push(e))}function y(e,t,n,r,o){var i="";null!=n&&(i=(""+n).replace(L,"$&/")+"/"),t=s(t,i,r,o),null==e||d(e,"",m,t),f(t)}/** @license React v16.3.2
|
7 |
* react.production.min.js
|
8 |
*
|
9 |
* Copyright (c) 2013-present, Facebook, Inc.
|
11 |
* This source code is licensed under the MIT license found in the
|
12 |
* LICENSE file in the root directory of this source tree.
|
13 |
*/
|
14 |
+
var g=n(1),v=n(2),b=n(3),C=n(4),k="function"==typeof Symbol&&Symbol.for,w=k?Symbol.for("react.element"):60103,E=k?Symbol.for("react.portal"):60106,x=k?Symbol.for("react.fragment"):60107,_=k?Symbol.for("react.strict_mode"):60108,T=k?Symbol.for("react.provider"):60109,S=k?Symbol.for("react.context"):60110,P=k?Symbol.for("react.async_mode"):60111,N=k?Symbol.for("react.forward_ref"):60112,O="function"==typeof Symbol&&Symbol.iterator,I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};o.prototype.isReactComponent={},o.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&r("85"),this.updater.enqueueSetState(this,e,t,"setState")},o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},i.prototype=o.prototype;var M=a.prototype=new i;M.constructor=a,g(M,o.prototype),M.isPureReactComponent=!0;var F={current:null},D=Object.prototype.hasOwnProperty,R={key:!0,ref:!0,__self:!0,__source:!0},L=/\/+/g,U=[],j={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return y(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=s(null,null,t,n),null==e||d(e,"",h,t),f(t)},count:function(e){return null==e?0:d(e,"",C.thatReturnsNull,null)},toArray:function(e){var t=[];return y(e,t,null,C.thatReturnsArgument),t},only:function(e){return u(e)||r("143"),e}},createRef:function(){return{current:null}},Component:o,PureComponent:a,createContext:function(e,t){return void 0===t&&(t=null),e={$$typeof:S,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_changedBits:0,Provider:null,Consumer:null},e.Provider={$$typeof:T,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:N,render:e}},Fragment:x,StrictMode:_,unstable_AsyncMode:P,createElement:l,cloneElement:function(e,t,n){(null===e||void 0===e)&&r("267",e);var o=void 0,i=g({},e.props),a=e.key,l=e.ref,u=e._owner;if(null!=t){void 0!==t.ref&&(l=t.ref,u=F.current),void 0!==t.key&&(a=""+t.key);var c=void 0;e.type&&e.type.defaultProps&&(c=e.type.defaultProps);for(o in t)D.call(t,o)&&!R.hasOwnProperty(o)&&(i[o]=void 0===t[o]&&void 0!==c?c[o]:t[o])}if(1===(o=arguments.length-2))i.children=n;else if(1<o){c=Array(o);for(var s=0;s<o;s++)c[s]=arguments[s+2];i.children=c}return{$$typeof:w,type:e.type,key:a,ref:l,props:i,_owner:u}},createFactory:function(e){var t=l.bind(null,e);return t.type=e,t},isValidElement:u,version:"16.3.2",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:F,assign:g}},H=Object.freeze({default:j}),z=H&&j||H;e.exports=z.default?z.default:z},function(e,t,n){"use strict";function r(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),e.exports=n(8)},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="http://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);cn(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}function o(e,t,n,r,o,i,a,l,u){this._hasCaughtError=!1,this._caughtError=null;var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this._caughtError=e,this._hasCaughtError=!0}}function i(){if(vn._hasRethrowError){var e=vn._rethrowError;throw vn._rethrowError=null,vn._hasRethrowError=!1,e}}function a(){if(bn)for(var e in Cn){var t=Cn[e],n=bn.indexOf(e);if(-1<n||r("96",e),!kn[n]){t.extractEvents||r("97",e),kn[n]=t,n=t.eventTypes;for(var o in n){var i=void 0,a=n[o],u=t,c=o;wn.hasOwnProperty(c)&&r("99",c),wn[c]=a;var s=a.phasedRegistrationNames;if(s){for(i in s)s.hasOwnProperty(i)&&l(s[i],u,c);i=!0}else a.registrationName?(l(a.registrationName,u,c),i=!0):i=!1;i||r("98",o,e)}}}}function l(e,t,n){En[e]&&r("100",e),En[e]=t,xn[e]=t.eventTypes[n].dependencies}function u(e){bn&&r("101"),bn=Array.prototype.slice.call(e),a()}function c(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var o=e[t];Cn.hasOwnProperty(t)&&Cn[t]===o||(Cn[t]&&r("102",t),Cn[t]=o,n=!0)}n&&a()}function s(e,t,n,r){t=e.type||"unknown-event",e.currentTarget=Pn(r),vn.invokeGuardedCallbackAndCatchFirstError(t,n,void 0,e),e.currentTarget=null}function f(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function d(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}function p(e,t){if(e){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)s(e,t,n[o],r[o]);else n&&s(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function h(e){return p(e,!0)}function m(e){return p(e,!1)}function y(e,t){var n=e.stateNode;if(!n)return null;var o=Tn(n);if(!o)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(o=!o.disabled)||(e=e.type,o=!("button"===e||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}return e?null:(n&&"function"!=typeof n&&r("231",t,typeof n),n)}function g(e,t){null!==e&&(Nn=f(Nn,e)),e=Nn,Nn=null,e&&(t?d(e,h):d(e,m),Nn&&r("95"),vn.rethrowCaughtError())}function v(e,t,n,r){for(var o=null,i=0;i<kn.length;i++){var a=kn[i];a&&(a=a.extractEvents(e,t,n,r))&&(o=f(o,a))}g(o,!1)}function b(e){if(e[Fn])return e[Fn];for(;!e[Fn];){if(!e.parentNode)return null;e=e.parentNode}return e=e[Fn],5===e.tag||6===e.tag?e:null}function C(e){if(5===e.tag||6===e.tag)return e.stateNode;r("33")}function k(e){return e[Dn]||null}function w(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function E(e,t,n){for(var r=[];e;)r.push(e),e=w(e);for(e=r.length;0<e--;)t(r[e],"captured",n);for(e=0;e<r.length;e++)t(r[e],"bubbled",n)}function x(e,t,n){(t=y(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=f(n._dispatchListeners,t),n._dispatchInstances=f(n._dispatchInstances,e))}function _(e){e&&e.dispatchConfig.phasedRegistrationNames&&E(e._targetInst,x,e)}function T(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst;t=t?w(t):null,E(t,x,e)}}function S(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=y(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=f(n._dispatchListeners,t),n._dispatchInstances=f(n._dispatchInstances,e))}function P(e){e&&e.dispatchConfig.registrationName&&S(e._targetInst,null,e)}function N(e){d(e,_)}function O(e,t,n,r){if(n&&r)e:{for(var o=n,i=r,a=0,l=o;l;l=w(l))a++;l=0;for(var u=i;u;u=w(u))l++;for(;0<a-l;)o=w(o),a--;for(;0<l-a;)i=w(i),l--;for(;a--;){if(o===i||o===i.alternate)break e;o=w(o),i=w(i)}o=null}else o=null;for(i=o,o=[];n&&n!==i&&(null===(a=n.alternate)||a!==i);)o.push(n),n=w(n);for(n=[];r&&r!==i&&(null===(a=r.alternate)||a!==i);)n.push(r),r=w(r);for(r=0;r<o.length;r++)S(o[r],"bubbled",e);for(e=n.length;0<e--;)S(n[e],"captured",t)}function I(){return!Un&&fn.canUseDOM&&(Un="textContent"in document.documentElement?"textContent":"innerText"),Un}function M(){if(jn._fallbackText)return jn._fallbackText;var e,t,n=jn._startText,r=n.length,o=F(),i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return jn._fallbackText=o.slice(e,1<t?1-t:void 0),jn._fallbackText}function F(){return"value"in jn._root?jn._root.value:jn._root[I()]}function D(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface;for(var o in e)e.hasOwnProperty(o)&&((t=e[o])?this[o]=t(n):"target"===o?this.target=r:this[o]=n[o]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?pn.thatReturnsTrue:pn.thatReturnsFalse,this.isPropagationStopped=pn.thatReturnsFalse,this}function R(e,t,n,r){if(this.eventPool.length){var o=this.eventPool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}function L(e){e instanceof this||r("223"),e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function U(e){e.eventPool=[],e.getPooled=R,e.release=L}function j(e,t){switch(e){case"topKeyUp":return-1!==Vn.indexOf(t.keyCode);case"topKeyDown":return 229!==t.keyCode;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function H(e){return e=e.detail,"object"==typeof e&&"data"in e?e.data:null}function z(e,t){switch(e){case"topCompositionEnd":return H(t);case"topKeyPress":return 32!==t.which?null:(Yn=!0,qn);case"topTextInput":return e=t.data,e===qn&&Yn?null:e;default:return null}}function A(e,t){if(Xn)return"topCompositionEnd"===e||!Wn&&j(e,t)?(e=M(),jn._root=null,jn._startText=null,jn._fallbackText=null,Xn=!1,e):null;switch(e){case"topPaste":return null;case"topKeyPress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"topCompositionEnd":return $n?null:t.data;default:return null}}function B(e){if(e=Sn(e)){Jn&&"function"==typeof Jn.restoreControlledState||r("194");var t=Tn(e.stateNode);Jn.restoreControlledState(e.stateNode,e.type,t)}}function V(e){tr?nr?nr.push(e):nr=[e]:tr=e}function W(){return null!==tr||null!==nr}function Q(){if(tr){var e=tr,t=nr;if(nr=tr=null,B(e),t)for(e=0;e<t.length;e++)B(t[e])}}function K(e,t){return e(t)}function $(e,t,n){return e(t,n)}function q(){}function G(e,t){if(or)return e(t);or=!0;try{return K(e,t)}finally{or=!1,W()&&(q(),Q())}}function Y(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ir[e.type]:"textarea"===t}function X(e){return e=e.target||window,e.correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function Z(e,t){return!(!fn.canUseDOM||t&&!("addEventListener"in document))&&(e="on"+e,t=e in document,t||(t=document.createElement("div"),t.setAttribute(e,"return;"),t="function"==typeof t[e]),t)}function J(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ee(e){var t=J(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"function"==typeof n.get&&"function"==typeof n.set)return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.get.call(this)},set:function(e){r=""+e,n.set.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}function te(e){e._valueTracker||(e._valueTracker=ee(e))}function ne(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=J(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function re(e){return null===e||void 0===e?null:(e=vr&&e[vr]||e["@@iterator"],"function"==typeof e?e:null)}function oe(e){if("function"==typeof(e=e.type))return e.displayName||e.name;if("string"==typeof e)return e;switch(e){case dr:return"ReactFragment";case fr:return"ReactPortal";case cr:return"ReactCall";case sr:return"ReactReturn"}if("object"==typeof e&&null!==e)switch(e.$$typeof){case gr:return e=e.render.displayName||e.render.name||"",""!==e?"ForwardRef("+e+")":"ForwardRef"}return null}function ie(e){var t="";do{e:switch(e.tag){case 0:case 1:case 2:case 5:var n=e._debugOwner,r=e._debugSource,o=oe(e),i=null;n&&(i=oe(n)),n=r,o="\n in "+(o||"Unknown")+(n?" (at "+n.fileName.replace(/^.*[\\\/]/,"")+":"+n.lineNumber+")":i?" (created by "+i+")":"");break e;default:o=""}t+=o,e=e.return}while(e);return t}function ae(e){return!!kr.hasOwnProperty(e)||!Cr.hasOwnProperty(e)&&(br.test(e)?kr[e]=!0:(Cr[e]=!0,!1))}function le(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}function ue(e,t,n,r){if(null===t||void 0===t||le(e,t,n,r))return!0;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ce(e,t,n,r,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t}function se(e){return e[1].toUpperCase()}function fe(e,t,n,r){var o=wr.hasOwnProperty(t)?wr[t]:null;(null!==o?0===o.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(ue(t,n,o,r)&&(n=null),r||null===o?ae(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(o=o.type,n=3===o||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function de(e,t){var n=t.checked;return dn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function pe(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=ve(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function he(e,t){null!=(t=t.checked)&&fe(e,"checked",t,!1)}function me(e,t){he(e,t);var n=ve(t.value);null!=n&&("number"===t.type?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n)),t.hasOwnProperty("value")?ge(e,t.type,n):t.hasOwnProperty("defaultValue")&&ge(e,t.type,ve(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ye(e,t){(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue"))&&(""===e.value&&(e.value=""+e._wrapperState.initialValue),e.defaultValue=""+e._wrapperState.initialValue),t=e.name,""!==t&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!e.defaultChecked,""!==t&&(e.name=t)}function ge(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ve(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function be(e,t,n){return e=D.getPooled(xr.change,e,t,n),e.type="change",V(n),N(e),e}function Ce(e){g(e,!1)}function ke(e){if(ne(C(e)))return e}function we(e,t){if("topChange"===e)return t}function Ee(){_r&&(_r.detachEvent("onpropertychange",xe),Tr=_r=null)}function xe(e){"value"===e.propertyName&&ke(Tr)&&(e=be(Tr,e,X(e)),G(Ce,e))}function _e(e,t,n){"topFocus"===e?(Ee(),_r=t,Tr=n,_r.attachEvent("onpropertychange",xe)):"topBlur"===e&&Ee()}function Te(e){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return ke(Tr)}function Se(e,t){if("topClick"===e)return ke(t)}function Pe(e,t){if("topInput"===e||"topChange"===e)return ke(t)}function Ne(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Or[e])&&!!t[e]}function Oe(){return Ne}function Ie(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!=(2&t.effectTag))return 1;for(;t.return;)if(t=t.return,0!=(2&t.effectTag))return 1}return 3===t.tag?2:3}function Me(e){return!!(e=e._reactInternalFiber)&&2===Ie(e)}function Fe(e){2!==Ie(e)&&r("188")}function De(e){var t=e.alternate;if(!t)return t=Ie(e),3===t&&r("188"),1===t?null:e;for(var n=e,o=t;;){var i=n.return,a=i?i.alternate:null;if(!i||!a)break;if(i.child===a.child){for(var l=i.child;l;){if(l===n)return Fe(i),e;if(l===o)return Fe(i),t;l=l.sibling}r("188")}if(n.return!==o.return)n=i,o=a;else{l=!1;for(var u=i.child;u;){if(u===n){l=!0,n=i,o=a;break}if(u===o){l=!0,o=i,n=a;break}u=u.sibling}if(!l){for(u=a.child;u;){if(u===n){l=!0,n=a,o=i;break}if(u===o){l=!0,o=a,n=i;break}u=u.sibling}l||r("189")}}n.alternate!==o&&r("190")}return 3!==n.tag&&r("188"),n.stateNode.current===n?e:t}function Re(e){if(!(e=De(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Le(e){if(!(e=De(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child&&4!==t.tag)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Ue(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function je(e,t){var n=e[0].toUpperCase()+e.slice(1),r="on"+n;n="top"+n,t={phasedRegistrationNames:{bubbled:r,captured:r+"Capture"},dependencies:[n],isInteractive:t},Wr[e]=t,Qr[n]=t}function He(e){var t=e.targetInst;do{if(!t){e.ancestors.push(t);break}var n;for(n=t;n.return;)n=n.return;if(!(n=3!==n.tag?null:n.stateNode.containerInfo))break;e.ancestors.push(t),t=b(n)}while(t);for(n=0;n<e.ancestors.length;n++)t=e.ancestors[n],v(e.topLevelType,t,e.nativeEvent,X(e.nativeEvent))}function ze(e){Gr=!!e}function Ae(e,t,n){if(!n)return null;e=($r(e)?Ve:We).bind(null,e),n.addEventListener(t,e,!1)}function Be(e,t,n){if(!n)return null;e=($r(e)?Ve:We).bind(null,e),n.addEventListener(t,e,!0)}function Ve(e,t){$(We,e,t)}function We(e,t){if(Gr){var n=X(t);if(n=b(n),null!==n&&"number"==typeof n.tag&&2!==Ie(n)&&(n=null),qr.length){var r=qr.pop();r.topLevelType=e,r.nativeEvent=t,r.targetInst=n,e=r}else e={topLevelType:e,nativeEvent:t,targetInst:n,ancestors:[]};try{G(He,e)}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>qr.length&&qr.push(e)}}}function Qe(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function Ke(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t,n=Xr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Jr)return Zr[e]=n[t];return e}function $e(e){return Object.prototype.hasOwnProperty.call(e,oo)||(e[oo]=ro++,no[e[oo]]={}),no[e[oo]]}function qe(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ge(e,t){var n=qe(e);e=0;for(var r;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=qe(n)}}function Ye(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)}function Xe(e,t){if(so||null==lo||lo!==hn())return null;var n=lo;return"selectionStart"in n&&Ye(n)?n={start:n.selectionStart,end:n.selectionEnd}:window.getSelection?(n=window.getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}):n=void 0,co&&mn(co,n)?null:(co=n,e=D.getPooled(ao.select,uo,e,t),e.type="select",e.target=lo,N(e),e)}function Ze(e,t,n,r){this.tag=e,this.key=n,this.stateNode=this.type=null,this.sibling=this.child=this.return=null,this.index=0,this.ref=null,this.pendingProps=t,this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.expirationTime=0,this.alternate=null}function Je(e,t,n){var r=e.alternate;return null===r?(r=new Ze(e.tag,t,e.key,e.mode),r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.expirationTime=n,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function et(e,t,n){var o=e.type,i=e.key;e=e.props;var a=void 0;if("function"==typeof o)a=o.prototype&&o.prototype.isReactComponent?2:0;else if("string"==typeof o)a=5;else switch(o){case dr:return tt(e.children,t,n,i);case yr:a=11,t|=3;break;case pr:a=11,t|=2;break;case cr:a=7;break;case sr:a=9;break;default:if("object"==typeof o&&null!==o)switch(o.$$typeof){case hr:a=13;break;case mr:a=12;break;case gr:a=14;break;default:if("number"==typeof o.tag)return t=o,t.pendingProps=e,t.expirationTime=n,t;r("130",null==o?o:typeof o,"")}else r("130",null==o?o:typeof o,"")}return t=new Ze(a,e,i,t),t.type=o,t.expirationTime=n,t}function tt(e,t,n,r){return e=new Ze(10,e,r,t),e.expirationTime=n,e}function nt(e,t,n){return e=new Ze(6,e,null,t),e.expirationTime=n,e}function rt(e,t,n){return t=new Ze(4,null!==e.children?e.children:[],e.key,t),t.expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ot(e){return function(t){try{return e(t)}catch(e){}}}function it(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);po=ot(function(e){return t.onCommitFiberRoot(n,e)}),ho=ot(function(e){return t.onCommitFiberUnmount(n,e)})}catch(e){}return!0}function at(e){"function"==typeof po&&po(e)}function lt(e){"function"==typeof ho&&ho(e)}function ut(e){return{baseState:e,expirationTime:0,first:null,last:null,callbackList:null,hasForceUpdate:!1,isInitialized:!1,capturedValues:null}}function ct(e,t){null===e.last?e.first=e.last=t:(e.last.next=t,e.last=t),(0===e.expirationTime||e.expirationTime>t.expirationTime)&&(e.expirationTime=t.expirationTime)}function st(e){mo=yo=null;var t=e.alternate,n=e.updateQueue;null===n&&(n=e.updateQueue=ut(null)),null!==t?null===(e=t.updateQueue)&&(e=t.updateQueue=ut(null)):e=null,mo=n,yo=e!==n?e:null}function ft(e,t){st(e),e=mo;var n=yo;null===n?ct(e,t):null===e.last||null===n.last?(ct(e,t),ct(n,t)):(ct(e,t),n.last=t)}function dt(e,t,n,r){return e=e.partialState,"function"==typeof e?e.call(t,n,r):e}function pt(e,t,n,r,o,i){null!==e&&e.updateQueue===n&&(n=t.updateQueue={baseState:n.baseState,expirationTime:n.expirationTime,first:n.first,last:n.last,isInitialized:n.isInitialized,capturedValues:n.capturedValues,callbackList:null,hasForceUpdate:!1}),n.expirationTime=0,n.isInitialized?e=n.baseState:(e=n.baseState=t.memoizedState,n.isInitialized=!0);for(var a=!0,l=n.first,u=!1;null!==l;){var c=l.expirationTime;if(c>i){var s=n.expirationTime;(0===s||s>c)&&(n.expirationTime=c),u||(u=!0,n.baseState=e)}else u||(n.first=l.next,null===n.first&&(n.last=null)),l.isReplace?(e=dt(l,r,e,o),a=!0):(c=dt(l,r,e,o))&&(e=a?dn({},e,c):dn(e,c),a=!1),l.isForced&&(n.hasForceUpdate=!0),null!==l.callback&&(c=n.callbackList,null===c&&(c=n.callbackList=[]),c.push(l)),null!==l.capturedValue&&(c=n.capturedValues,null===c?n.capturedValues=[l.capturedValue]:c.push(l.capturedValue));l=l.next}return null!==n.callbackList?t.effectTag|=32:null!==n.first||n.hasForceUpdate||null!==n.capturedValues||(t.updateQueue=null),u||(n.baseState=e),e}function ht(e,t){var n=e.callbackList;if(null!==n)for(e.callbackList=null,e=0;e<n.length;e++){var o=n[e],i=o.callback;o.callback=null,"function"!=typeof i&&r("191",i),i.call(t)}}function mt(e,t,n,r,o){function i(e,t,n,r,o,i){if(null===t||null!==e.updateQueue&&e.updateQueue.hasForceUpdate)return!0;var a=e.stateNode;return e=e.type,"function"==typeof a.shouldComponentUpdate?a.shouldComponentUpdate(n,o,i):!e.prototype||!e.prototype.isPureReactComponent||(!mn(t,n)||!mn(r,o))}function a(e,t){t.updater=h,e.stateNode=t,t._reactInternalFiber=e}function l(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&h.enqueueReplaceState(t,t.state,null)}function u(e,t,n,r){if(e=e.type,"function"==typeof e.getDerivedStateFromProps)return e.getDerivedStateFromProps.call(null,n,r)}var c=e.cacheContext,s=e.getMaskedContext,f=e.getUnmaskedContext,d=e.isContextConsumer,p=e.hasContextChanged,h={isMounted:Me,enqueueSetState:function(e,r,o){e=e._reactInternalFiber,o=void 0===o?null:o;var i=n(e);ft(e,{expirationTime:i,partialState:r,callback:o,isReplace:!1,isForced:!1,capturedValue:null,next:null}),t(e,i)},enqueueReplaceState:function(e,r,o){e=e._reactInternalFiber,o=void 0===o?null:o;var i=n(e);ft(e,{expirationTime:i,partialState:r,callback:o,isReplace:!0,isForced:!1,capturedValue:null,next:null}),t(e,i)},enqueueForceUpdate:function(e,r){e=e._reactInternalFiber,r=void 0===r?null:r;var o=n(e);ft(e,{expirationTime:o,partialState:null,callback:r,isReplace:!1,isForced:!0,capturedValue:null,next:null}),t(e,o)}};return{adoptClassInstance:a,callGetDerivedStateFromProps:u,constructClassInstance:function(e,t){var n=e.type,r=f(e),o=d(e),i=o?s(e,r):gn;n=new n(t,i);var l=null!==n.state&&void 0!==n.state?n.state:null;return a(e,n),e.memoizedState=l,t=u(e,n,t,l),null!==t&&void 0!==t&&(e.memoizedState=dn({},e.memoizedState,t)),o&&c(e,r,i),n},mountClassInstance:function(e,t){var n=e.type,r=e.alternate,o=e.stateNode,i=e.pendingProps,a=f(e);o.props=i,o.state=e.memoizedState,o.refs=gn,o.context=s(e,a),"function"==typeof n.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(n=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),n!==o.state&&h.enqueueReplaceState(o,o.state,null),null!==(n=e.updateQueue)&&(o.state=pt(r,e,n,o,i,t))),"function"==typeof o.componentDidMount&&(e.effectTag|=4)},resumeMountClassInstance:function(e,t){var n=e.type,a=e.stateNode;a.props=e.memoizedProps,a.state=e.memoizedState;var c=e.memoizedProps,d=e.pendingProps,h=a.context,m=f(e);m=s(e,m),(n="function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(c!==d||h!==m)&&l(e,a,d,m),h=e.memoizedState,t=null!==e.updateQueue?pt(null,e,e.updateQueue,a,d,t):h;var y=void 0;if(c!==d&&(y=u(e,a,d,t)),null!==y&&void 0!==y){t=null===t||void 0===t?y:dn({},t,y);var g=e.updateQueue;null!==g&&(g.baseState=dn({},g.baseState,y))}return c!==d||h!==t||p()||null!==e.updateQueue&&e.updateQueue.hasForceUpdate?((c=i(e,c,d,h,t,m))?(n||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(e.effectTag|=4)):("function"==typeof a.componentDidMount&&(e.effectTag|=4),r(e,d),o(e,t)),a.props=d,a.state=t,a.context=m,c):("function"==typeof a.componentDidMount&&(e.effectTag|=4),!1)},updateClassInstance:function(e,t,n){var a=t.type,c=t.stateNode;c.props=t.memoizedProps,c.state=t.memoizedState;var d=t.memoizedProps,h=t.pendingProps,m=c.context,y=f(t);y=s(t,y),(a="function"==typeof a.getDerivedStateFromProps||"function"==typeof c.getSnapshotBeforeUpdate)||"function"!=typeof c.UNSAFE_componentWillReceiveProps&&"function"!=typeof c.componentWillReceiveProps||(d!==h||m!==y)&&l(t,c,h,y),m=t.memoizedState,n=null!==t.updateQueue?pt(e,t,t.updateQueue,c,h,n):m;var g=void 0;if(d!==h&&(g=u(t,c,h,n)),null!==g&&void 0!==g){n=null===n||void 0===n?g:dn({},n,g);var v=t.updateQueue;null!==v&&(v.baseState=dn({},v.baseState,g))}return d!==h||m!==n||p()||null!==t.updateQueue&&t.updateQueue.hasForceUpdate?((g=i(t,d,h,m,n,y))?(a||"function"!=typeof c.UNSAFE_componentWillUpdate&&"function"!=typeof c.componentWillUpdate||("function"==typeof c.componentWillUpdate&&c.componentWillUpdate(h,n,y),"function"==typeof c.UNSAFE_componentWillUpdate&&c.UNSAFE_componentWillUpdate(h,n,y)),"function"==typeof c.componentDidUpdate&&(t.effectTag|=4),"function"==typeof c.getSnapshotBeforeUpdate&&(t.effectTag|=2048)):("function"!=typeof c.componentDidUpdate||d===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=4),"function"!=typeof c.getSnapshotBeforeUpdate||d===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=2048),r(t,h),o(t,n)),c.props=h,c.state=n,c.context=y,g):("function"!=typeof c.componentDidUpdate||d===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=4),"function"!=typeof c.getSnapshotBeforeUpdate||d===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=2048),!1)}}}function yt(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){n=n._owner;var o=void 0;n&&(2!==n.tag&&r("110"),o=n.stateNode),o||r("147",e);var i=""+e;return null!==t&&null!==t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=o.refs===gn?o.refs={}:o.refs;null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}"string"!=typeof e&&r("148"),n._owner||r("254",e)}return e}function gt(e,t){"textarea"!==e.type&&r("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function vt(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t,n){return e=Je(e,t,n),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index,r<n?(t.effectTag=2,n):r):(t.effectTag=2,n):n}function l(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?(t=nt(n,e.mode,r),t.return=e,t):(t=i(t,n,r),t.return=e,t)}function c(e,t,n,r){return null!==t&&t.type===n.type?(r=i(t,n.props,r),r.ref=yt(e,t,n),r.return=e,r):(r=et(n,e.mode,r),r.ref=yt(e,t,n),r.return=e,r)}function s(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=rt(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[],r),t.return=e,t)}function f(e,t,n,r,o){return null===t||10!==t.tag?(t=tt(n,e.mode,r,o),t.return=e,t):(t=i(t,n,r),t.return=e,t)}function d(e,t,n){if("string"==typeof t||"number"==typeof t)return t=nt(""+t,e.mode,n),t.return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case ur:return n=et(t,e.mode,n),n.ref=yt(e,null,t),n.return=e,n;case fr:return t=rt(t,e.mode,n),t.return=e,t}if(go(t)||re(t))return t=tt(t,e.mode,n,null),t.return=e,t;gt(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==o?null:u(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case ur:return n.key===o?n.type===dr?f(e,t,n.props.children,r,o):c(e,t,n,r):null;case fr:return n.key===o?s(e,t,n,r):null}if(go(n)||re(n))return null!==o?null:f(e,t,n,r,null);gt(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r||"number"==typeof r)return e=e.get(n)||null,u(t,e,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case ur:return e=e.get(null===r.key?n:r.key)||null,r.type===dr?f(t,e,r.props.children,o,r.key):c(t,e,r,o);case fr:return e=e.get(null===r.key?n:r.key)||null,s(t,e,r,o)}if(go(r)||re(r))return e=e.get(n)||null,f(t,e,r,o,null);gt(t,r)}return null}function m(r,i,l,u){for(var c=null,s=null,f=i,m=i=0,y=null;null!==f&&m<l.length;m++){f.index>m?(y=f,f=null):y=f.sibling;var g=p(r,f,l[m],u);if(null===g){null===f&&(f=y);break}e&&f&&null===g.alternate&&t(r,f),i=a(g,i,m),null===s?c=g:s.sibling=g,s=g,f=y}if(m===l.length)return n(r,f),c;if(null===f){for(;m<l.length;m++)(f=d(r,l[m],u))&&(i=a(f,i,m),null===s?c=f:s.sibling=f,s=f);return c}for(f=o(r,f);m<l.length;m++)(y=h(f,r,m,l[m],u))&&(e&&null!==y.alternate&&f.delete(null===y.key?m:y.key),i=a(y,i,m),null===s?c=y:s.sibling=y,s=y);return e&&f.forEach(function(e){return t(r,e)}),c}function y(i,l,u,c){var s=re(u);"function"!=typeof s&&r("150"),null==(u=s.call(u))&&r("151");for(var f=s=null,m=l,y=l=0,g=null,v=u.next();null!==m&&!v.done;y++,v=u.next()){m.index>y?(g=m,m=null):g=m.sibling;var b=p(i,m,v.value,c);if(null===b){m||(m=g);break}e&&m&&null===b.alternate&&t(i,m),l=a(b,l,y),null===f?s=b:f.sibling=b,f=b,m=g}if(v.done)return n(i,m),s;if(null===m){for(;!v.done;y++,v=u.next())null!==(v=d(i,v.value,c))&&(l=a(v,l,y),null===f?s=v:f.sibling=v,f=v);return s}for(m=o(i,m);!v.done;y++,v=u.next())null!==(v=h(m,i,y,v.value,c))&&(e&&null!==v.alternate&&m.delete(null===v.key?y:v.key),l=a(v,l,y),null===f?s=v:f.sibling=v,f=v);return e&&m.forEach(function(e){return t(i,e)}),s}return function(e,o,a,u){"object"==typeof a&&null!==a&&a.type===dr&&null===a.key&&(a=a.props.children);var c="object"==typeof a&&null!==a;if(c)switch(a.$$typeof){case ur:e:{var s=a.key;for(c=o;null!==c;){if(c.key===s){if(10===c.tag?a.type===dr:c.type===a.type){n(e,c.sibling),o=i(c,a.type===dr?a.props.children:a.props,u),o.ref=yt(e,c,a),o.return=e,e=o;break e}n(e,c);break}t(e,c),c=c.sibling}a.type===dr?(o=tt(a.props.children,e.mode,u,a.key),o.return=e,e=o):(u=et(a,e.mode,u),u.ref=yt(e,o,a),u.return=e,e=u)}return l(e);case fr:e:{for(c=a.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===a.containerInfo&&o.stateNode.implementation===a.implementation){n(e,o.sibling),o=i(o,a.children||[],u),o.return=e,e=o;break e}n(e,o);break}t(e,o),o=o.sibling}o=rt(a,e.mode,u),o.return=e,e=o}return l(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==o&&6===o.tag?(n(e,o.sibling),o=i(o,a,u),o.return=e,e=o):(n(e,o),o=nt(a,e.mode,u),o.return=e,e=o),l(e);if(go(a))return m(e,o,a,u);if(re(a))return y(e,o,a,u);if(c&>(e,a),void 0===a)switch(e.tag){case 2:case 1:u=e.type,r("152",u.displayName||u.name||"Component")}return n(e,o)}}function bt(e,t,n,o,i,a,l){function u(e,t,n){c(e,t,n,t.expirationTime)}function c(e,t,n,r){t.child=null===e?bo(t,null,n,r):vo(t,e.child,n,r)}function s(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function f(e,t,n,r,o,i){if(s(e,t),!n&&!o)return r&&T(t,!1),m(e,t);n=t.stateNode,ar.current=t;var a=o?null:n.render();return t.effectTag|=1,o&&(c(e,t,null,i),t.child=null),c(e,t,a,i),t.memoizedState=n.state,t.memoizedProps=n.props,r&&T(t,!0),t.child}function d(e){var t=e.stateNode;t.pendingContext?_(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_(e,t.context,!1),b(e,t.containerInfo)}function p(e,t,n,r){var o=e.child;for(null!==o&&(o.return=e);null!==o;){switch(o.tag){case 12:var i=0|o.stateNode;if(o.type===t&&0!=(i&n)){for(i=o;null!==i;){var a=i.alternate;if(0===i.expirationTime||i.expirationTime>r)i.expirationTime=r,null!==a&&(0===a.expirationTime||a.expirationTime>r)&&(a.expirationTime=r);else{if(null===a||!(0===a.expirationTime||a.expirationTime>r))break;a.expirationTime=r}i=i.return}i=null}else i=o.child;break;case 13:i=o.type===e.type?null:o.child;break;default:i=o.child}if(null!==i)i.return=o;else for(i=o;null!==i;){if(i===e){i=null;break}if(null!==(o=i.sibling)){i=o;break}i=i.return}o=i}}function h(e,t,n){var r=t.type._context,o=t.pendingProps,i=t.memoizedProps;if(!E()&&i===o)return t.stateNode=0,C(t),m(e,t);var a=o.value;if(t.memoizedProps=o,null===i)a=1073741823;else if(i.value===o.value){if(i.children===o.children)return t.stateNode=0,C(t),m(e,t);a=0}else{var l=i.value;if(l===a&&(0!==l||1/l==1/a)||l!==l&&a!==a){if(i.children===o.children)return t.stateNode=0,C(t),m(e,t);a=0}else if(a="function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,a):1073741823,0===(a|=0)){if(i.children===o.children)return t.stateNode=0,C(t),m(e,t)}else p(t,r,a,n)}return t.stateNode=a,C(t),u(e,t,o.children),t.child}function m(e,t){if(null!==e&&t.child!==e.child&&r("153"),null!==t.child){e=t.child;var n=Je(e,e.pendingProps,e.expirationTime);for(t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,n=n.sibling=Je(e,e.pendingProps,e.expirationTime),n.return=t;n.sibling=null}return t.child}var y=e.shouldSetTextContent,g=e.shouldDeprioritizeSubtree,v=t.pushHostContext,b=t.pushHostContainer,C=o.pushProvider,k=n.getMaskedContext,w=n.getUnmaskedContext,E=n.hasContextChanged,x=n.pushContextProvider,_=n.pushTopLevelContextObject,T=n.invalidateContextProvider,S=i.enterHydrationState,P=i.resetHydrationState,N=i.tryToClaimNextHydratableInstance;e=mt(n,a,l,function(e,t){e.memoizedProps=t},function(e,t){e.memoizedState=t});var O=e.adoptClassInstance,I=e.callGetDerivedStateFromProps,M=e.constructClassInstance,F=e.mountClassInstance,D=e.resumeMountClassInstance,R=e.updateClassInstance;return{beginWork:function(e,t,n){if(0===t.expirationTime||t.expirationTime>n){switch(t.tag){case 3:d(t);break;case 2:x(t);break;case 4:b(t,t.stateNode.containerInfo);break;case 13:C(t)}return null}switch(t.tag){case 0:null!==e&&r("155");var o=t.type,i=t.pendingProps,a=w(t);return a=k(t,a),o=o(i,a),t.effectTag|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(a=t.type,t.tag=2,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,"function"==typeof a.getDerivedStateFromProps&&null!==(i=I(t,o,i,t.memoizedState))&&void 0!==i&&(t.memoizedState=dn({},t.memoizedState,i)),i=x(t),O(t,o),F(t,n),e=f(e,t,!0,i,!1,n)):(t.tag=1,u(e,t,o),t.memoizedProps=i,e=t.child),e;case 1:return i=t.type,n=t.pendingProps,E()||t.memoizedProps!==n?(o=w(t),o=k(t,o),i=i(n,o),t.effectTag|=1,u(e,t,i),t.memoizedProps=n,e=t.child):e=m(e,t),e;case 2:i=x(t),null===e?null===t.stateNode?(M(t,t.pendingProps),F(t,n),o=!0):o=D(t,n):o=R(e,t,n),a=!1;var l=t.updateQueue;return null!==l&&null!==l.capturedValues&&(a=o=!0),f(e,t,o,i,a,n);case 3:e:if(d(t),null!==(o=t.updateQueue)){if(a=t.memoizedState,i=pt(e,t,o,null,null,n),t.memoizedState=i,null!==(o=t.updateQueue)&&null!==o.capturedValues)o=null;else{if(a===i){P(),e=m(e,t);break e}o=i.element}a=t.stateNode,(null===e||null===e.child)&&a.hydrate&&S(t)?(t.effectTag|=2,t.child=bo(t,null,o,n)):(P(),u(e,t,o)),t.memoizedState=i,e=t.child}else P(),e=m(e,t);return e;case 5:return v(t),null===e&&N(t),i=t.type,l=t.memoizedProps,o=t.pendingProps,a=null!==e?e.memoizedProps:null,E()||l!==o||((l=1&t.mode&&g(i,o))&&(t.expirationTime=1073741823),l&&1073741823===n)?(l=o.children,y(i,o)?l=null:a&&y(i,a)&&(t.effectTag|=16),s(e,t),1073741823!==n&&1&t.mode&&g(i,o)?(t.expirationTime=1073741823,t.memoizedProps=o,e=null):(u(e,t,l),t.memoizedProps=o,e=t.child)):e=m(e,t),e;case 6:return null===e&&N(t),t.memoizedProps=t.pendingProps,null;case 8:t.tag=7;case 7:return i=t.pendingProps,E()||t.memoizedProps!==i||(i=t.memoizedProps),o=i.children,t.stateNode=null===e?bo(t,t.stateNode,o,n):vo(t,e.stateNode,o,n),t.memoizedProps=i,t.stateNode;case 9:return null;case 4:return b(t,t.stateNode.containerInfo),i=t.pendingProps,E()||t.memoizedProps!==i?(null===e?t.child=vo(t,null,i,n):u(e,t,i),t.memoizedProps=i,e=t.child):e=m(e,t),e;case 14:return n=t.type.render,n=n(t.pendingProps,t.ref),u(e,t,n),t.memoizedProps=n,t.child;case 10:return n=t.pendingProps,E()||t.memoizedProps!==n?(u(e,t,n),t.memoizedProps=n,e=t.child):e=m(e,t),e;case 11:return n=t.pendingProps.children,E()||null!==n&&t.memoizedProps!==n?(u(e,t,n),t.memoizedProps=n,e=t.child):e=m(e,t),e;case 13:return h(e,t,n);case 12:e:{o=t.type,a=t.pendingProps,l=t.memoizedProps,i=o._currentValue;var c=o._changedBits;if(E()||0!==c||l!==a){t.memoizedProps=a;var _=a.unstable_observedBits;if(void 0!==_&&null!==_||(_=1073741823),t.stateNode=_,0!=(c&_))p(t,o,c,n);else if(l===a){e=m(e,t);break e}n=a.children,n=n(i),u(e,t,n),e=t.child}else e=m(e,t)}return e;default:r("156")}}}}function Ct(e,t,n,o,i){function a(e){e.effectTag|=4}var l=e.createInstance,u=e.createTextInstance,c=e.appendInitialChild,s=e.finalizeInitialChildren,f=e.prepareUpdate,d=e.persistence,p=t.getRootHostContainer,h=t.popHostContext,m=t.getHostContext,y=t.popHostContainer,g=n.popContextProvider,v=n.popTopLevelContextObject,b=o.popProvider,C=i.prepareToHydrateHostInstance,k=i.prepareToHydrateHostTextInstance,w=i.popHydrationState,E=void 0,x=void 0,_=void 0;return e.mutation?(E=function(){},x=function(e,t,n){(t.updateQueue=n)&&a(t)},_=function(e,t,n,r){n!==r&&a(t)}):r(d?"235":"236"),{completeWork:function(e,t,n){var o=t.pendingProps;switch(t.tag){case 1:return null;case 2:return g(t),e=t.stateNode,o=t.updateQueue,null!==o&&null!==o.capturedValues&&(t.effectTag&=-65,"function"==typeof e.componentDidCatch?t.effectTag|=256:o.capturedValues=null),null;case 3:return y(t),v(t),o=t.stateNode,o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null!==e&&null!==e.child||(w(t),t.effectTag&=-3),E(t),e=t.updateQueue,null!==e&&null!==e.capturedValues&&(t.effectTag|=256),null;case 5:h(t),n=p();var i=t.type;if(null!==e&&null!=t.stateNode){var d=e.memoizedProps,T=t.stateNode,S=m();T=f(T,i,d,o,n,S),x(e,t,T,i,d,o,n,S),e.ref!==t.ref&&(t.effectTag|=128)}else{if(!o)return null===t.stateNode&&r("166"),null;if(e=m(),w(t))C(t,n,e)&&a(t);else{d=l(i,o,n,e,t);e:for(S=t.child;null!==S;){if(5===S.tag||6===S.tag)c(d,S.stateNode);else if(4!==S.tag&&null!==S.child){S.child.return=S,S=S.child;continue}if(S===t)break;for(;null===S.sibling;){if(null===S.return||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}s(d,i,o,n,e)&&a(t),t.stateNode=d}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)_(e,t,e.memoizedProps,o);else{if("string"!=typeof o)return null===t.stateNode&&r("166"),null;e=p(),n=m(),w(t)?k(t)&&a(t):t.stateNode=u(o,e,n,t)}return null;case 7:(o=t.memoizedProps)||r("165"),t.tag=8,i=[];e:for((d=t.stateNode)&&(d.return=t);null!==d;){if(5===d.tag||6===d.tag||4===d.tag)r("247");else if(9===d.tag)i.push(d.pendingProps.value);else if(null!==d.child){d.child.return=d,d=d.child;continue}for(;null===d.sibling;){if(null===d.return||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}return d=o.handler,o=d(o.props,i),t.child=vo(t,null!==e?e.child:null,o,n),t.child;case 8:return t.tag=7,null;case 9:case 14:case 10:case 11:return null;case 4:return y(t),E(t),null;case 13:return b(t),null;case 12:return null;case 0:r("167");default:r("156")}}}}function kt(e,t,n,r,o){var i=e.popHostContainer,a=e.popHostContext,l=t.popContextProvider,u=t.popTopLevelContextObject,c=n.popProvider;return{throwException:function(e,t,n){t.effectTag|=512,t.firstEffect=t.lastEffect=null,t={value:n,source:t,stack:ie(t)};do{switch(e.tag){case 3:return st(e),e.updateQueue.capturedValues=[t],void(e.effectTag|=1024);case 2:if(n=e.stateNode,0==(64&e.effectTag)&&null!==n&&"function"==typeof n.componentDidCatch&&!o(n)){st(e),n=e.updateQueue;var r=n.capturedValues;return null===r?n.capturedValues=[t]:r.push(t),void(e.effectTag|=1024)}}e=e.return}while(null!==e)},unwindWork:function(e){switch(e.tag){case 2:l(e);var t=e.effectTag;return 1024&t?(e.effectTag=-1025&t|64,e):null;case 3:return i(e),u(e),t=e.effectTag,1024&t?(e.effectTag=-1025&t|64,e):null;case 5:return a(e),null;case 4:return i(e),null;case 13:return c(e),null;default:return null}},unwindInterruptedWork:function(e){switch(e.tag){case 2:l(e);break;case 3:i(e),u(e);break;case 5:a(e);break;case 4:i(e);break;case 13:c(e)}}}}function wt(e,t){var n=t.source;null===t.stack&&ie(n),null!==n&&oe(n),t=t.value,null!==e&&2===e.tag&&oe(e);try{t&&t.suppressReactErrorLogging||console.error(t)}catch(e){e&&e.suppressReactErrorLogging||console.error(e)}}function Et(e,t,n,o,i){function a(e){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){t(e,n)}else n.current=null}function l(e){switch("function"==typeof lt&<(e),e.tag){case 2:a(e);var n=e.stateNode;if("function"==typeof n.componentWillUnmount)try{n.props=e.memoizedProps,n.state=e.memoizedState,n.componentWillUnmount()}catch(n){t(e,n)}break;case 5:a(e);break;case 7:u(e.stateNode);break;case 4:d&&s(e)}}function u(e){for(var t=e;;)if(l(t),null===t.child||d&&4===t.tag){if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}else t.child.return=t,t=t.child}function c(e){return 5===e.tag||3===e.tag||4===e.tag}function s(e){for(var t=e,n=!1,o=void 0,i=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&r("160"),n.tag){case 5:o=n.stateNode,i=!1;break e;case 3:case 4:o=n.stateNode.containerInfo,i=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag)u(t),i?w(o,t.stateNode):k(o,t.stateNode);else if(4===t.tag?o=t.stateNode.containerInfo:l(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return,4===t.tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}var f=e.getPublicInstance,d=e.mutation;e=e.persistence,d||r(e?"235":"236");var p=d.commitMount,h=d.commitUpdate,m=d.resetTextContent,y=d.commitTextUpdate,g=d.appendChild,v=d.appendChildToContainer,b=d.insertBefore,C=d.insertInContainerBefore,k=d.removeChild,w=d.removeChildFromContainer;return{commitBeforeMutationLifeCycles:function(e,t){switch(t.tag){case 2:if(2048&t.effectTag&&null!==e){var n=e.memoizedProps,o=e.memoizedState;e=t.stateNode,e.props=t.memoizedProps,e.state=t.memoizedState,t=e.getSnapshotBeforeUpdate(n,o),e.__reactInternalSnapshotBeforeUpdate=t}break;case 3:case 5:case 6:case 4:break;default:r("163")}},commitResetTextContent:function(e){m(e.stateNode)},commitPlacement:function(e){e:{for(var t=e.return;null!==t;){if(c(t)){var n=t;break e}t=t.return}r("160"),n=void 0}var o=t=void 0;switch(n.tag){case 5:t=n.stateNode,o=!1;break;case 3:case 4:t=n.stateNode.containerInfo,o=!0;break;default:r("161")}16&n.effectTag&&(m(t),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||c(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var i=e;;){if(5===i.tag||6===i.tag)n?o?C(t,i.stateNode,n):b(t,i.stateNode,n):o?v(t,i.stateNode):g(t,i.stateNode);else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===e)break;for(;null===i.sibling;){if(null===i.return||i.return===e)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},commitDeletion:function(e){s(e),e.return=null,e.child=null,e.alternate&&(e.alternate.child=null,e.alternate.return=null)},commitWork:function(e,t){switch(t.tag){case 2:break;case 5:var n=t.stateNode;if(null!=n){var o=t.memoizedProps;e=null!==e?e.memoizedProps:o;var i=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&h(n,a,i,e,o,t)}break;case 6:null===t.stateNode&&r("162"),n=t.memoizedProps,y(t.stateNode,null!==e?e.memoizedProps:n,n);break;case 3:break;default:r("163")}},commitLifeCycles:function(e,t,n){switch(n.tag){case 2:if(e=n.stateNode,4&n.effectTag)if(null===t)e.props=n.memoizedProps,e.state=n.memoizedState,e.componentDidMount();else{var o=t.memoizedProps;t=t.memoizedState,e.props=n.memoizedProps,e.state=n.memoizedState,e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}n=n.updateQueue,null!==n&&ht(n,e);break;case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=f(n.child.stateNode);break;case 2:e=n.child.stateNode}ht(t,e)}break;case 5:e=n.stateNode,null===t&&4&n.effectTag&&p(e,n.type,n.memoizedProps,n);break;case 6:case 4:break;default:r("163")}},commitErrorLogging:function(e,t){switch(e.tag){case 2:var n=e.type;t=e.stateNode;var o=e.updateQueue;(null===o||null===o.capturedValues)&&r("264");var a=o.capturedValues;for(o.capturedValues=null,"function"!=typeof n.getDerivedStateFromCatch&&i(t),t.props=e.memoizedProps,t.state=e.memoizedState,n=0;n<a.length;n++){o=a[n];var l=o.value,u=o.stack;wt(e,o),t.componentDidCatch(l,{componentStack:null!==u?u:""})}break;case 3:for(n=e.updateQueue,(null===n||null===n.capturedValues)&&r("264"),a=n.capturedValues,n.capturedValues=null,n=0;n<a.length;n++)o=a[n],wt(e,o),t(o.value);break;default:r("265")}},commitAttachRef:function(e){var t=e.ref;if(null!==t){var n=e.stateNode;switch(e.tag){case 5:e=f(n);break;default:e=n}"function"==typeof t?t(e):t.current=e}},commitDetachRef:function(e){null!==(e=e.ref)&&("function"==typeof e?e(null):e.current=null)}}}function xt(e,t){function n(e){return e===Co&&r("174"),e}var o=e.getChildHostContext,i=e.getRootHostContext;e=t.createCursor;var a=t.push,l=t.pop,u=e(Co),c=e(Co),s=e(Co);return{getHostContext:function(){return n(u.current)},getRootHostContainer:function(){return n(s.current)},popHostContainer:function(e){l(u,e),l(c,e),l(s,e)},popHostContext:function(e){c.current===e&&(l(u,e),l(c,e))},pushHostContainer:function(e,t){a(s,t,e),a(c,e,e),a(u,Co,e),t=i(t),l(u,e),a(u,t,e)},pushHostContext:function(e){var t=n(s.current),r=n(u.current);t=o(r,e.type,t),r!==t&&(a(c,e,e),a(u,t,e))}}}function _t(e){function t(e,t){var n=new Ze(5,null,null,0);n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function n(e,t){switch(e.tag){case 5:return null!==(t=a(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=l(t,e.pendingProps))&&(e.stateNode=t,!0);default:return!1}}function o(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag;)e=e.return;d=e}var i=e.shouldSetTextContent;if(!(e=e.hydration))return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){r("175")},prepareToHydrateHostTextInstance:function(){r("176")},popHydrationState:function(){return!1}};var a=e.canHydrateInstance,l=e.canHydrateTextInstance,u=e.getNextHydratableSibling,c=e.getFirstHydratableChild,s=e.hydrateInstance,f=e.hydrateTextInstance,d=null,p=null,h=!1;return{enterHydrationState:function(e){return p=c(e.stateNode.containerInfo),d=e,h=!0},resetHydrationState:function(){p=d=null,h=!1},tryToClaimNextHydratableInstance:function(e){if(h){var r=p;if(r){if(!n(e,r)){if(!(r=u(r))||!n(e,r))return e.effectTag|=2,h=!1,void(d=e);t(d,p)}d=e,p=c(r)}else e.effectTag|=2,h=!1,d=e}},prepareToHydrateHostInstance:function(e,t,n){return t=s(e.stateNode,e.type,e.memoizedProps,t,n,e),e.updateQueue=t,null!==t},prepareToHydrateHostTextInstance:function(e){return f(e.stateNode,e.memoizedProps,e)},popHydrationState:function(e){if(e!==d)return!1;if(!h)return o(e),h=!0,!1;var n=e.type;if(5!==e.tag||"head"!==n&&"body"!==n&&!i(n,e.memoizedProps))for(n=p;n;)t(e,n),n=u(n);return o(e),p=d?u(e.stateNode):null,!0}}}function Tt(e){function t(e,t,n){e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n}function n(e){return 2===e.tag&&null!=e.type.childContextTypes}function o(e,t){var n=e.stateNode,o=e.type.childContextTypes;if("function"!=typeof n.getChildContext)return t;n=n.getChildContext();for(var i in n)i in o||r("108",oe(e)||"Unknown",i);return dn({},t,n)}var i=e.createCursor,a=e.push,l=e.pop,u=i(gn),c=i(!1),s=gn;return{getUnmaskedContext:function(e){return n(e)?s:u.current},cacheContext:t,getMaskedContext:function(e,n){var r=e.type.contextTypes;if(!r)return gn;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===n)return o.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in r)a[i]=n[i];return o&&t(e,n,a),a},hasContextChanged:function(){return c.current},isContextConsumer:function(e){return 2===e.tag&&null!=e.type.contextTypes},isContextProvider:n,popContextProvider:function(e){n(e)&&(l(c,e),l(u,e))},popTopLevelContextObject:function(e){l(c,e),l(u,e)},pushTopLevelContextObject:function(e,t,n){null!=u.cursor&&r("168"),a(u,t,e),a(c,n,e)},processChildContext:o,pushContextProvider:function(e){if(!n(e))return!1;var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||gn,s=u.current,a(u,t,e),a(c,c.current,e),!0},invalidateContextProvider:function(e,t){var n=e.stateNode;if(n||r("169"),t){var i=o(e,s);n.__reactInternalMemoizedMergedChildContext=i,l(c,e),l(u,e),a(u,i,e)}else l(c,e);a(c,t,e)},findCurrentUnmaskedContext:function(e){for(2!==Ie(e)||2!==e.tag?r("170"):void 0;3!==e.tag;){if(n(e))return e.stateNode.__reactInternalMemoizedMergedChildContext;(e=e.return)||r("171")}return e.stateNode.context}}}function St(e){var t=e.createCursor,n=e.push,r=e.pop,o=t(null),i=t(null),a=t(0);return{pushProvider:function(e){var t=e.type._context;n(a,t._changedBits,e),n(i,t._currentValue,e),n(o,e,e),t._currentValue=e.pendingProps.value,t._changedBits=e.stateNode},popProvider:function(e){var t=a.current,n=i.current;r(o,e),r(i,e),r(a,e),e=e.type._context,e._currentValue=n,e._changedBits=t}}}function Pt(){var e=[],t=-1;return{createCursor:function(e){return{current:e}},isEmpty:function(){return-1===t},pop:function(n){0>t||(n.current=e[t],e[t]=null,t--)},push:function(n,r){t++,e[t]=n.current,n.current=r},checkThatStackIsEmpty:function(){},resetStackAfterFatalErrorInDev:function(){}}}function Nt(e){function t(){if(null!==J)for(var e=J.return;null!==e;)M(e),e=e.return;ee=null,te=0,J=null,oe=!1}function n(e){return null!==ae&&ae.has(e)}function o(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0==(512&e.effectTag)){t=N(t,e,te);var o=e;if(1073741823===te||1073741823!==o.expirationTime){e:switch(o.tag){case 3:case 2:var i=o.updateQueue;i=null===i?0:i.expirationTime;break e;default:i=0}for(var a=o.child;null!==a;)0!==a.expirationTime&&(0===i||i>a.expirationTime)&&(i=a.expirationTime),a=a.sibling;o.expirationTime=i}if(null!==t)return t;if(null!==n&&0==(512&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1<e.effectTag&&(null!==n.lastEffect?n.lastEffect.nextEffect=e:n.firstEffect=e,n.lastEffect=e)),null!==r)return r;if(null===n){oe=!0;break}e=n}else{if(null!==(e=I(e)))return e.effectTag&=2559,e;if(null!==n&&(n.firstEffect=n.lastEffect=null,n.effectTag|=512),null!==r)return r;if(null===n)break;e=n}}return null}function i(e){var t=P(e.alternate,e,te);return null===t&&(t=o(e)),ar.current=null,t}function a(e,n,a){Z&&r("243"),Z=!0,n===te&&e===ee&&null!==J||(t(),ee=e,te=n,J=Je(ee.current,null,te),e.pendingCommitExpirationTime=0);for(var l=!1;;){try{if(a)for(;null!==J&&!w();)J=i(J);else for(;null!==J;)J=i(J)}catch(e){if(null===J){l=!0,E(e);break}a=J;var u=a.return;if(null===u){l=!0,E(e);break}O(u,a,e),J=o(a)}break}return Z=!1,l||null!==J?null:oe?(e.pendingCommitExpirationTime=n,e.current.alternate):void r("262")}function l(e,t,n,r){e={value:n,source:e,stack:ie(e)},ft(t,{expirationTime:r,partialState:null,callback:null,isReplace:!1,isForced:!1,capturedValue:e,next:null}),s(t,r)}function u(e,t){e:{Z&&!re&&r("263");for(var o=e.return;null!==o;){switch(o.tag){case 2:var i=o.stateNode;if("function"==typeof o.type.getDerivedStateFromCatch||"function"==typeof i.componentDidCatch&&!n(i)){l(e,o,t,1),e=void 0;break e}break;case 3:l(e,o,t,1),e=void 0;break e}o=o.return}3===e.tag&&l(e,e,t,1),e=void 0}return e}function c(e){return e=0!==X?X:Z?re?1:te:1&e.mode?ke?10*(1+((f()+15)/10|0)):25*(1+((f()+500)/25|0)):1,ke&&(0===he||e>he)&&(he=e),e}function s(e,n){e:{for(;null!==e;){if((0===e.expirationTime||e.expirationTime>n)&&(e.expirationTime=n),null!==e.alternate&&(0===e.alternate.expirationTime||e.alternate.expirationTime>n)&&(e.alternate.expirationTime=n),null===e.return){if(3!==e.tag){n=void 0;break e}var o=e.stateNode;!Z&&0!==te&&n<te&&t(),Z&&!re&&ee===o||h(o,n),xe>Ee&&r("185")}e=e.return}n=void 0}return n}function f(){return G=B()-$,q=2+(G/10|0)}function d(e,t,n,r,o){var i=X;X=1;try{return e(t,n,r,o)}finally{X=i}}function p(e){if(0!==ce){if(e>ce)return;W(se)}var t=B()-$;ce=e,se=V(y,{timeout:10*(e-2)-t})}function h(e,t){if(null===e.nextScheduledRoot)e.remainingExpirationTime=t,null===ue?(le=ue=e,e.nextScheduledRoot=e):(ue=ue.nextScheduledRoot=e,ue.nextScheduledRoot=le);else{var n=e.remainingExpirationTime;(0===n||t<n)&&(e.remainingExpirationTime=t)}fe||(be?Ce&&(de=e,pe=1,C(e,1,!1)):1===t?g():p(t))}function m(){var e=0,t=null;if(null!==ue)for(var n=ue,o=le;null!==o;){var i=o.remainingExpirationTime;if(0===i){if((null===n||null===ue)&&r("244"),o===o.nextScheduledRoot){le=ue=o.nextScheduledRoot=null;break}if(o===le)le=i=o.nextScheduledRoot,ue.nextScheduledRoot=i,o.nextScheduledRoot=null;else{if(o===ue){ue=n,ue.nextScheduledRoot=le,o.nextScheduledRoot=null;break}n.nextScheduledRoot=o.nextScheduledRoot,o.nextScheduledRoot=null}o=n.nextScheduledRoot}else{if((0===e||i<e)&&(e=i,t=o),o===ue)break;n=o,o=o.nextScheduledRoot}}n=de,null!==n&&n===t&&1===e?xe++:xe=0,de=t,pe=e}function y(e){v(0,!0,e)}function g(){v(1,!1,null)}function v(e,t,n){if(ve=n,m(),t)for(;null!==de&&0!==pe&&(0===e||e>=pe)&&(!me||f()>=pe);)C(de,pe,!me),m();else for(;null!==de&&0!==pe&&(0===e||e>=pe);)C(de,pe,!1),m();null!==ve&&(ce=0,se=-1),0!==pe&&p(pe),ve=null,me=!1,b()}function b(){if(xe=0,null!==we){var e=we;we=null;for(var t=0;t<e.length;t++){var n=e[t];try{n._onComplete()}catch(e){ye||(ye=!0,ge=e)}}}if(ye)throw e=ge,ge=null,ye=!1,e}function C(e,t,n){fe&&r("245"),fe=!0,n?(n=e.finishedWork,null!==n?k(e,n,t):(e.finishedWork=null,null!==(n=a(e,t,!0))&&(w()?e.finishedWork=n:k(e,n,t)))):(n=e.finishedWork,null!==n?k(e,n,t):(e.finishedWork=null,null!==(n=a(e,t,!1))&&k(e,n,t))),fe=!1}function k(e,t,n){var o=e.firstBatch;if(null!==o&&o._expirationTime<=n&&(null===we?we=[o]:we.push(o),o._defer))return e.finishedWork=t,void(e.remainingExpirationTime=0);e.finishedWork=null,re=Z=!0,n=t.stateNode,n.current===t&&r("177"),o=n.pendingCommitExpirationTime,0===o&&r("261"),n.pendingCommitExpirationTime=0;var i=f();if(ar.current=null,1<t.effectTag)if(null!==t.lastEffect){t.lastEffect.nextEffect=t;var a=t.firstEffect}else a=t;else a=t.firstEffect;for(Q(n.containerInfo),ne=a;null!==ne;){var l=!1,c=void 0;try{for(;null!==ne;)2048&ne.effectTag&&F(ne.alternate,ne),ne=ne.nextEffect}catch(e){l=!0,c=e}l&&(null===ne&&r("178"),u(ne,c),null!==ne&&(ne=ne.nextEffect))}for(ne=a;null!==ne;){l=!1,c=void 0;try{for(;null!==ne;){var s=ne.effectTag;if(16&s&&D(ne),128&s){var d=ne.alternate;null!==d&&A(d)}switch(14&s){case 2:R(ne),ne.effectTag&=-3;break;case 6:R(ne),ne.effectTag&=-3,U(ne.alternate,ne);break;case 4:U(ne.alternate,ne);break;case 8:L(ne)}ne=ne.nextEffect}}catch(e){l=!0,c=e}l&&(null===ne&&r("178"),u(ne,c),null!==ne&&(ne=ne.nextEffect))}for(K(n.containerInfo),n.current=t,ne=a;null!==ne;){s=!1,d=void 0;try{for(a=n,l=i,c=o;null!==ne;){var p=ne.effectTag;36&p&&j(a,ne.alternate,ne,l,c),256&p&&H(ne,E),128&p&&z(ne);var h=ne.nextEffect;ne.nextEffect=null,ne=h}}catch(e){s=!0,d=e}s&&(null===ne&&r("178"),u(ne,d),null!==ne&&(ne=ne.nextEffect))}Z=re=!1,"function"==typeof at&&at(t.stateNode),t=n.current.expirationTime,0===t&&(ae=null),e.remainingExpirationTime=t}function w(){return!(null===ve||ve.timeRemaining()>_e)&&(me=!0)}function E(e){null===de&&r("246"),de.remainingExpirationTime=0,ye||(ye=!0,ge=e)}var x=Pt(),_=xt(e,x),T=Tt(x);x=St(x);var S=_t(e),P=bt(e,_,T,x,S,s,c).beginWork,N=Ct(e,_,T,x,S).completeWork;_=kt(_,T,x,s,n);var O=_.throwException,I=_.unwindWork,M=_.unwindInterruptedWork;_=Et(e,u,s,c,function(e){null===ae?ae=new Set([e]):ae.add(e)},f);var F=_.commitBeforeMutationLifeCycles,D=_.commitResetTextContent,R=_.commitPlacement,L=_.commitDeletion,U=_.commitWork,j=_.commitLifeCycles,H=_.commitErrorLogging,z=_.commitAttachRef,A=_.commitDetachRef,B=e.now,V=e.scheduleDeferredCallback,W=e.cancelDeferredCallback,Q=e.prepareForCommit,K=e.resetAfterCommit,$=B(),q=2,G=$,Y=0,X=0,Z=!1,J=null,ee=null,te=0,ne=null,re=!1,oe=!1,ae=null,le=null,ue=null,ce=0,se=-1,fe=!1,de=null,pe=0,he=0,me=!1,ye=!1,ge=null,ve=null,be=!1,Ce=!1,ke=!1,we=null,Ee=1e3,xe=0,_e=1;return{recalculateCurrentTime:f,computeExpirationForFiber:c,scheduleWork:s,requestWork:h,flushRoot:function(e,t){fe&&r("253"),de=e,pe=t,C(e,t,!1),g(),b()},batchedUpdates:function(e,t){var n=be;be=!0;try{return e(t)}finally{(be=n)||fe||g()}},unbatchedUpdates:function(e,t){if(be&&!Ce){Ce=!0;try{return e(t)}finally{Ce=!1}}return e(t)},flushSync:function(e,t){fe&&r("187");var n=be;be=!0;try{return d(e,t)}finally{be=n,g()}},flushControlled:function(e){var t=be;be=!0;try{d(e)}finally{(be=t)||fe||v(1,!1,null)}},deferredUpdates:function(e){var t=X;X=25*(1+((f()+500)/25|0));try{return e()}finally{X=t}},syncUpdates:d,interactiveUpdates:function(e,t,n){if(ke)return e(t,n);be||fe||0===he||(v(he,!1,null),he=0);var r=ke,o=be;be=ke=!0;try{return e(t,n)}finally{ke=r,(be=o)||fe||g()}},flushInteractiveUpdates:function(){fe||0===he||(v(he,!1,null),he=0)},computeUniqueAsyncExpiration:function(){var e=25*(1+((f()+500)/25|0));return e<=Y&&(e=Y+1),Y=e},legacyContext:T}}function Ot(e){function t(e,t,n,r,o,i){if(r=t.current,n){n=n._reactInternalFiber;var l=u(n);n=c(n)?s(n,l):l}else n=gn;return null===t.context?t.context=n:t.pendingContext=n,t=i,ft(r,{expirationTime:o,partialState:{element:e},callback:void 0===t?null:t,isReplace:!1,isForced:!1,capturedValue:null,next:null}),a(r,o),o}var n=e.getPublicInstance;e=Nt(e);var o=e.recalculateCurrentTime,i=e.computeExpirationForFiber,a=e.scheduleWork,l=e.legacyContext,u=l.findCurrentUnmaskedContext,c=l.isContextProvider,s=l.processChildContext;return{createContainer:function(e,t,n){return t=new Ze(3,null,null,t?3:0),e={current:t,containerInfo:e,pendingChildren:null,pendingCommitExpirationTime:0,finishedWork:null,context:null,pendingContext:null,hydrate:n,remainingExpirationTime:0,firstBatch:null,nextScheduledRoot:null},t.stateNode=e},updateContainer:function(e,n,r,a){var l=n.current,u=o();return l=i(l),t(e,n,r,u,l,a)},updateContainerAtExpirationTime:function(e,n,r,i,a){return t(e,n,r,o(),i,a)},flushRoot:e.flushRoot,requestWork:e.requestWork,computeUniqueAsyncExpiration:e.computeUniqueAsyncExpiration,batchedUpdates:e.batchedUpdates,unbatchedUpdates:e.unbatchedUpdates,deferredUpdates:e.deferredUpdates,syncUpdates:e.syncUpdates,interactiveUpdates:e.interactiveUpdates,flushInteractiveUpdates:e.flushInteractiveUpdates,flushControlled:e.flushControlled,flushSync:e.flushSync,getPublicRootInstance:function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return n(e.child.stateNode);default:return e.child.stateNode}},findHostInstance:function(e){var t=e._reactInternalFiber;return void 0===t&&("function"==typeof e.render?r("188"):r("268",Object.keys(e))),e=Re(t),null===e?null:e.stateNode},findHostInstanceWithNoPortals:function(e){return e=Le(e),null===e?null:e.stateNode},injectIntoDevTools:function(e){var t=e.findFiberByHostInstance;return it(dn({},e,{findHostInstanceByFiber:function(e){return e=Re(e),null===e?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null}}))}}}function It(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:fr,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Mt(e){var t="";return sn.Children.forEach(e,function(e){null==e||"string"!=typeof e&&"number"!=typeof e||(t+=e)}),t}function Ft(e,t){return e=dn({children:void 0},t),(t=Mt(t.children))&&(e.children=t),e}function Dt(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+n,t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function Rt(e,t){var n=t.value;e._wrapperState={initialValue:null!=n?n:t.defaultValue,wasMultiple:!!t.multiple}}function Lt(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),dn({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ut(e,t){var n=t.value;null==n&&(n=t.defaultValue,t=t.children,null!=t&&(null!=n&&r("92"),Array.isArray(t)&&(1>=t.length||r("93"),t=t[0]),n=""+t),null==n&&(n="")),e._wrapperState={initialValue:""+n}}function jt(e,t){var n=t.value;null!=n&&(n=""+n,n!==e.value&&(e.value=n),null==t.defaultValue&&(e.defaultValue=n)),null!=t.defaultValue&&(e.defaultValue=t.defaultValue)}function Ht(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}function zt(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function At(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?zt(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Vt(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=n,i=t[n];o=null==i||"boolean"==typeof i||""===i?"":r||"number"!=typeof i||0===i||Ao.hasOwnProperty(o)&&Ao[o]?(""+i).trim():i+"px","float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}function Wt(e,t,n){t&&(Vo[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e,n()),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",n()))}function Qt(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Kt(e,t){e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument;var n=$e(e);t=xn[t];for(var r=0;r<t.length;r++){var o=t[r];n.hasOwnProperty(o)&&n[o]||("topScroll"===o?Be("topScroll","scroll",e):"topFocus"===o||"topBlur"===o?(Be("topFocus","focus",e),Be("topBlur","blur",e),n.topBlur=!0,n.topFocus=!0):"topCancel"===o?(Z("cancel",!0)&&Be("topCancel","cancel",e),n.topCancel=!0):"topClose"===o?(Z("close",!0)&&Be("topClose","close",e),n.topClose=!0):eo.hasOwnProperty(o)&&Ae(o,eo[o],e),n[o]=!0)}}function $t(e,t,n,r){return n=9===n.nodeType?n:n.ownerDocument,r===jo.html&&(r=zt(e)),r===jo.html?"script"===e?(e=n.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):e="string"==typeof t.is?n.createElement(e,{is:t.is}):n.createElement(e):e=n.createElementNS(r,e),e}function qt(e,t){return(9===t.nodeType?t:t.ownerDocument).createTextNode(e)}function Gt(e,t,n,r){var o=Qt(t,n);switch(t){case"iframe":case"object":Ae("topLoad","load",e);var i=n;break;case"video":case"audio":for(i in to)to.hasOwnProperty(i)&&Ae(i,to[i],e);i=n;break;case"source":Ae("topError","error",e),i=n;break;case"img":case"image":case"link":Ae("topError","error",e),Ae("topLoad","load",e),i=n;break;case"form":Ae("topReset","reset",e),Ae("topSubmit","submit",e),i=n;break;case"details":Ae("topToggle","toggle",e),i=n;break;case"input":pe(e,n),i=de(e,n),Ae("topInvalid","invalid",e),Kt(r,"onChange");break;case"option":i=Ft(e,n);break;case"select":Rt(e,n),i=dn({},n,{value:void 0}),Ae("topInvalid","invalid",e),Kt(r,"onChange");break;case"textarea":Ut(e,n),i=Lt(e,n),Ae("topInvalid","invalid",e),Kt(r,"onChange");break;default:i=n}Wt(t,i,Wo);var a,l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];"style"===a?Vt(e,u,Wo):"dangerouslySetInnerHTML"===a?null!=(u=u?u.__html:void 0)&&zo(e,u):"children"===a?"string"==typeof u?("textarea"!==t||""!==u)&&Bt(e,u):"number"==typeof u&&Bt(e,""+u):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(En.hasOwnProperty(a)?null!=u&&Kt(r,a):null!=u&&fe(e,a,u,o))}switch(t){case"input":te(e),ye(e,n);break;case"textarea":te(e),Ht(e,n);break;case"option":null!=n.value&&e.setAttribute("value",n.value);break;case"select":e.multiple=!!n.multiple,t=n.value,null!=t?Dt(e,!!n.multiple,t,!1):null!=n.defaultValue&&Dt(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=pn)}}function Yt(e,t,n,r,o){var i=null;switch(t){case"input":n=de(e,n),r=de(e,r),i=[];break;case"option":n=Ft(e,n),r=Ft(e,r),i=[];break;case"select":n=dn({},n,{value:void 0}),r=dn({},r,{value:void 0}),i=[];break;case"textarea":n=Lt(e,n),r=Lt(e,r),i=[];break;default:"function"!=typeof n.onClick&&"function"==typeof r.onClick&&(e.onclick=pn)}Wt(t,r,Wo),t=e=void 0;var a=null;for(e in n)if(!r.hasOwnProperty(e)&&n.hasOwnProperty(e)&&null!=n[e])if("style"===e){var l=n[e];for(t in l)l.hasOwnProperty(t)&&(a||(a={}),a[t]="")}else"dangerouslySetInnerHTML"!==e&&"children"!==e&&"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&"autoFocus"!==e&&(En.hasOwnProperty(e)?i||(i=[]):(i=i||[]).push(e,null));for(e in r){var u=r[e];if(l=null!=n?n[e]:void 0,r.hasOwnProperty(e)&&u!==l&&(null!=u||null!=l))if("style"===e)if(l){for(t in l)!l.hasOwnProperty(t)||u&&u.hasOwnProperty(t)||(a||(a={}),a[t]="");for(t in u)u.hasOwnProperty(t)&&l[t]!==u[t]&&(a||(a={}),a[t]=u[t])}else a||(i||(i=[]),i.push(e,a)),a=u;else"dangerouslySetInnerHTML"===e?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(i=i||[]).push(e,""+u)):"children"===e?l===u||"string"!=typeof u&&"number"!=typeof u||(i=i||[]).push(e,""+u):"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&(En.hasOwnProperty(e)?(null!=u&&Kt(o,e),i||l===u||(i=[])):(i=i||[]).push(e,u))}return a&&(i=i||[]).push("style",a),i}function Xt(e,t,n,r,o){"input"===n&&"radio"===o.type&&null!=o.name&&he(e,o),Qt(n,r),r=Qt(n,o);for(var i=0;i<t.length;i+=2){var a=t[i],l=t[i+1];"style"===a?Vt(e,l,Wo):"dangerouslySetInnerHTML"===a?zo(e,l):"children"===a?Bt(e,l):fe(e,a,l,r)}switch(n){case"input":me(e,o);break;case"textarea":jt(e,o);break;case"select":e._wrapperState.initialValue=void 0,t=e._wrapperState.wasMultiple,e._wrapperState.wasMultiple=!!o.multiple,n=o.value,null!=n?Dt(e,!!o.multiple,n,!1):t!==!!o.multiple&&(null!=o.defaultValue?Dt(e,!!o.multiple,o.defaultValue,!0):Dt(e,!!o.multiple,o.multiple?[]:"",!1))}}function Zt(e,t,n,r,o){switch(t){case"iframe":case"object":Ae("topLoad","load",e);break;case"video":case"audio":for(var i in to)to.hasOwnProperty(i)&&Ae(i,to[i],e);break;case"source":Ae("topError","error",e);break;case"img":case"image":case"link":Ae("topError","error",e),Ae("topLoad","load",e);break;case"form":Ae("topReset","reset",e),Ae("topSubmit","submit",e);break;case"details":Ae("topToggle","toggle",e);break;case"input":pe(e,n),Ae("topInvalid","invalid",e),Kt(o,"onChange");break;case"select":Rt(e,n),Ae("topInvalid","invalid",e),Kt(o,"onChange");break;case"textarea":Ut(e,n),Ae("topInvalid","invalid",e),Kt(o,"onChange")}Wt(t,n,Wo),r=null;for(var a in n)n.hasOwnProperty(a)&&(i=n[a],"children"===a?"string"==typeof i?e.textContent!==i&&(r=["children",i]):"number"==typeof i&&e.textContent!==""+i&&(r=["children",""+i]):En.hasOwnProperty(a)&&null!=i&&Kt(o,a));switch(t){case"input":te(e),ye(e,n);break;case"textarea":te(e),Ht(e,n);break;case"select":case"option":break;default:"function"==typeof n.onClick&&(e.onclick=pn)}return r}function Jt(e,t){return e.nodeValue!==t}function en(e){this._expirationTime=qo.computeUniqueAsyncExpiration(),this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function tn(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function nn(e,t,n){this._internalRoot=qo.createContainer(e,t,n)}function rn(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function on(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function an(e,t){if(t||(t=e?9===e.nodeType?e.documentElement:e.firstChild:null,t=!(!t||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new nn(e,!1,t)}function ln(e,t,n,o,i){rn(n)||r("200");var a=n._reactRootContainer;if(a){if("function"==typeof i){var l=i;i=function(){var e=qo.getPublicRootInstance(a._internalRoot);l.call(e)}}null!=e?a.legacy_renderSubtreeIntoContainer(e,t,i):a.render(t,i)}else{if(a=n._reactRootContainer=an(n,o),"function"==typeof i){var u=i;i=function(){var e=qo.getPublicRootInstance(a._internalRoot);u.call(e)}}qo.unbatchedUpdates(function(){null!=e?a.legacy_renderSubtreeIntoContainer(e,t,i):a.render(t,i)})}return qo.getPublicRootInstance(a._internalRoot)}function un(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return rn(t)||r("200"),It(e,t,null,n)}/** @license React v16.3.2
|
15 |
* react-dom.production.min.js
|
16 |
*
|
17 |
* Copyright (c) 2013-present, Facebook, Inc.
|
19 |
* This source code is licensed under the MIT license found in the
|
20 |
* LICENSE file in the root directory of this source tree.
|
21 |
*/
|
22 |
+
var cn=n(2),sn=n(0),fn=n(9),dn=n(1),pn=n(4),hn=n(10),mn=n(11),yn=n(12),gn=n(3);sn||r("227");var vn={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,invokeGuardedCallback:function(e,t,n,r,i,a,l,u,c){o.apply(vn,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,o,i,a,l,u){if(vn.invokeGuardedCallback.apply(this,arguments),vn.hasCaughtError()){var c=vn.clearCaughtError();vn._hasRethrowError||(vn._hasRethrowError=!0,vn._rethrowError=c)}},rethrowCaughtError:function(){return i.apply(vn,arguments)},hasCaughtError:function(){return vn._hasCaughtError},clearCaughtError:function(){if(vn._hasCaughtError){var e=vn._caughtError;return vn._caughtError=null,vn._hasCaughtError=!1,e}r("198")}},bn=null,Cn={},kn=[],wn={},En={},xn={},_n=Object.freeze({plugins:kn,eventNameDispatchConfigs:wn,registrationNameModules:En,registrationNameDependencies:xn,possibleRegistrationNames:null,injectEventPluginOrder:u,injectEventPluginsByName:c}),Tn=null,Sn=null,Pn=null,Nn=null,On={injectEventPluginOrder:u,injectEventPluginsByName:c},In=Object.freeze({injection:On,getListener:y,runEventsInBatch:g,runExtractedEventsInBatch:v}),Mn=Math.random().toString(36).slice(2),Fn="__reactInternalInstance$"+Mn,Dn="__reactEventHandlers$"+Mn,Rn=Object.freeze({precacheFiberNode:function(e,t){t[Fn]=e},getClosestInstanceFromNode:b,getInstanceFromNode:function(e){return e=e[Fn],!e||5!==e.tag&&6!==e.tag?null:e},getNodeFromInstance:C,getFiberCurrentPropsFromNode:k,updateFiberProps:function(e,t){e[Dn]=t}}),Ln=Object.freeze({accumulateTwoPhaseDispatches:N,accumulateTwoPhaseDispatchesSkipTarget:function(e){d(e,T)},accumulateEnterLeaveDispatches:O,accumulateDirectDispatches:function(e){d(e,P)}}),Un=null,jn={_root:null,_startText:null,_fallbackText:null},Hn="dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances".split(" "),zn={type:null,target:null,currentTarget:pn.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};dn(D.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=pn.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=pn.thatReturnsTrue)},persist:function(){this.isPersistent=pn.thatReturnsTrue},isPersistent:pn.thatReturnsFalse,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;for(t=0;t<Hn.length;t++)this[Hn[t]]=null}}),D.Interface=zn,D.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return dn(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=dn({},r.Interface,e),n.extend=r.extend,U(n),n},U(D);var An=D.extend({data:null}),Bn=D.extend({data:null}),Vn=[9,13,27,32],Wn=fn.canUseDOM&&"CompositionEvent"in window,Qn=null;fn.canUseDOM&&"documentMode"in document&&(Qn=document.documentMode);var Kn=fn.canUseDOM&&"TextEvent"in window&&!Qn,$n=fn.canUseDOM&&(!Wn||Qn&&8<Qn&&11>=Qn),qn=String.fromCharCode(32),Gn={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}},Yn=!1,Xn=!1,Zn={eventTypes:Gn,extractEvents:function(e,t,n,r){var o=void 0,i=void 0;if(Wn)e:{switch(e){case"topCompositionStart":o=Gn.compositionStart;break e;case"topCompositionEnd":o=Gn.compositionEnd;break e;case"topCompositionUpdate":o=Gn.compositionUpdate;break e}o=void 0}else Xn?j(e,n)&&(o=Gn.compositionEnd):"topKeyDown"===e&&229===n.keyCode&&(o=Gn.compositionStart);return o?($n&&(Xn||o!==Gn.compositionStart?o===Gn.compositionEnd&&Xn&&(i=M()):(jn._root=r,jn._startText=F(),Xn=!0)),o=An.getPooled(o,t,n,r),i?o.data=i:null!==(i=H(n))&&(o.data=i),N(o),i=o):i=null,(e=Kn?z(e,n):A(e,n))?(t=Bn.getPooled(Gn.beforeInput,t,n,r),t.data=e,N(t)):t=null,null===i?t:null===t?i:[i,t]}},Jn=null,er={injectFiberControlledHostComponent:function(e){Jn=e}},tr=null,nr=null,rr=Object.freeze({injection:er,enqueueStateRestore:V,needsStateRestore:W,restoreStateIfNeeded:Q}),or=!1,ir={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},ar=sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lr="function"==typeof Symbol&&Symbol.for,ur=lr?Symbol.for("react.element"):60103,cr=lr?Symbol.for("react.call"):60104,sr=lr?Symbol.for("react.return"):60105,fr=lr?Symbol.for("react.portal"):60106,dr=lr?Symbol.for("react.fragment"):60107,pr=lr?Symbol.for("react.strict_mode"):60108,hr=lr?Symbol.for("react.provider"):60109,mr=lr?Symbol.for("react.context"):60110,yr=lr?Symbol.for("react.async_mode"):60111,gr=lr?Symbol.for("react.forward_ref"):60112,vr="function"==typeof Symbol&&Symbol.iterator,br=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Cr={},kr={},wr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wr[e]=new ce(e,0,!1,e,null)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wr[t]=new ce(t,1,!1,e[1],null)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){wr[e]=new ce(e,2,!1,e.toLowerCase(),null)}),["autoReverse","externalResourcesRequired","preserveAlpha"].forEach(function(e){wr[e]=new ce(e,2,!1,e,null)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){wr[e]=new ce(e,3,!1,e.toLowerCase(),null)}),["checked","multiple","muted","selected"].forEach(function(e){wr[e]=new ce(e,3,!0,e.toLowerCase(),null)}),["capture","download"].forEach(function(e){wr[e]=new ce(e,4,!1,e.toLowerCase(),null)}),["cols","rows","size","span"].forEach(function(e){wr[e]=new ce(e,6,!1,e.toLowerCase(),null)}),["rowSpan","start"].forEach(function(e){wr[e]=new ce(e,5,!1,e.toLowerCase(),null)});var Er=/[\-:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Er,se);wr[t]=new ce(t,1,!1,e,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Er,se);wr[t]=new ce(t,1,!1,e,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Er,se);wr[t]=new ce(t,1,!1,e,"http://www.w3.org/XML/1998/namespace")}),wr.tabIndex=new ce("tabIndex",1,!1,"tabindex",null);var xr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange".split(" ")}},_r=null,Tr=null,Sr=!1;fn.canUseDOM&&(Sr=Z("input")&&(!document.documentMode||9<document.documentMode));var Pr={eventTypes:xr,_isInputEventSupported:Sr,extractEvents:function(e,t,n,r){var o=t?C(t):window,i=void 0,a=void 0,l=o.nodeName&&o.nodeName.toLowerCase();if("select"===l||"input"===l&&"file"===o.type?i=we:Y(o)?Sr?i=Pe:(i=Te,a=_e):(l=o.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(i=Se),i&&(i=i(e,t)))return be(i,n,r);a&&a(e,o,t),"topBlur"===e&&null!=t&&(e=t._wrapperState||o._wrapperState)&&e.controlled&&"number"===o.type&&ge(o,"number",o.value)}},Nr=D.extend({view:null,detail:null}),Or={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},Ir=Nr.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Oe,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)}}),Mr={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},Fr={eventTypes:Mr,extractEvents:function(e,t,n,r){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement)||"topMouseOut"!==e&&"topMouseOver"!==e)return null;var o=r.window===r?r:(o=r.ownerDocument)?o.defaultView||o.parentWindow:window;if("topMouseOut"===e?(e=t,t=(t=n.relatedTarget||n.toElement)?b(t):null):e=null,e===t)return null;var i=null==e?o:C(e);o=null==t?o:C(t);var a=Ir.getPooled(Mr.mouseLeave,e,n,r);return a.type="mouseleave",a.target=i,a.relatedTarget=o,n=Ir.getPooled(Mr.mouseEnter,t,n,r),n.type="mouseenter",n.target=o,n.relatedTarget=i,O(a,n,e,t),[a,n]}},Dr=D.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Rr=D.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lr=Nr.extend({relatedTarget:null}),Ur={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Hr=Nr.extend({key:function(e){if(e.key){var t=Ur[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?(e=Ue(e),13===e?"Enter":String.fromCharCode(e)):"keydown"===e.type||"keyup"===e.type?jr[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Oe,charCode:function(e){return"keypress"===e.type?Ue(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Ue(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),zr=Ir.extend({dataTransfer:null}),Ar=Nr.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Oe}),Br=D.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),Vr=Ir.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),Wr={},Qr={};"blur cancel click close contextMenu copy cut doubleClick dragEnd dragStart drop focus input invalid keyDown keyPress keyUp mouseDown mouseUp paste pause play rateChange reset seeked submit touchCancel touchEnd touchStart volumeChange".split(" ").forEach(function(e){je(e,!0)}),"abort animationEnd animationIteration animationStart canPlay canPlayThrough drag dragEnter dragExit dragLeave dragOver durationChange emptied encrypted ended error load loadedData loadedMetadata loadStart mouseMove mouseOut mouseOver playing progress scroll seeking stalled suspend timeUpdate toggle touchMove transitionEnd waiting wheel".split(" ").forEach(function(e){je(e,!1)});var Kr={eventTypes:Wr,isInteractiveTopLevelEventType:function(e){return void 0!==(e=Qr[e])&&!0===e.isInteractive},extractEvents:function(e,t,n,r){var o=Qr[e];if(!o)return null;switch(e){case"topKeyPress":if(0===Ue(n))return null;case"topKeyDown":case"topKeyUp":e=Hr;break;case"topBlur":case"topFocus":e=Lr;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":e=Ir;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":e=zr;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":e=Ar;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":e=Dr;break;case"topTransitionEnd":e=Br;break;case"topScroll":e=Nr;break;case"topWheel":e=Vr;break;case"topCopy":case"topCut":case"topPaste":e=Rr;break;default:e=D}return t=e.getPooled(o,t,n,r),N(t),t}},$r=Kr.isInteractiveTopLevelEventType,qr=[],Gr=!0,Yr=Object.freeze({get _enabled(){return Gr},setEnabled:ze,isEnabled:function(){return Gr},trapBubbledEvent:Ae,trapCapturedEvent:Be,dispatchEvent:We}),Xr={animationend:Qe("Animation","AnimationEnd"),animationiteration:Qe("Animation","AnimationIteration"),animationstart:Qe("Animation","AnimationStart"),transitionend:Qe("Transition","TransitionEnd")},Zr={},Jr={};fn.canUseDOM&&(Jr=document.createElement("div").style,"AnimationEvent"in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),"TransitionEvent"in window||delete Xr.transitionend.transition);var eo={topAnimationEnd:Ke("animationend"),topAnimationIteration:Ke("animationiteration"),topAnimationStart:Ke("animationstart"),topBlur:"blur",topCancel:"cancel",topChange:"change",topClick:"click",topClose:"close",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoad:"load",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topScroll:"scroll",topSelectionChange:"selectionchange",topTextInput:"textInput",topToggle:"toggle",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:Ke("transitionend"),topWheel:"wheel"},to={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},no={},ro=0,oo="_reactListenersID"+(""+Math.random()).slice(2),io=fn.canUseDOM&&"documentMode"in document&&11>=document.documentMode,ao={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}},lo=null,uo=null,co=null,so=!1,fo={eventTypes:ao,extractEvents:function(e,t,n,r){var o,i=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(o=!i)){e:{i=$e(i),o=xn.onSelect;for(var a=0;a<o.length;a++){var l=o[a];if(!i.hasOwnProperty(l)||!i[l]){i=!1;break e}}i=!0}o=!i}if(o)return null;switch(i=t?C(t):window,e){case"topFocus":(Y(i)||"true"===i.contentEditable)&&(lo=i,uo=t,co=null);break;case"topBlur":co=uo=lo=null;break;case"topMouseDown":so=!0;break;case"topContextMenu":case"topMouseUp":return so=!1,Xe(n,r);case"topSelectionChange":if(io)break;case"topKeyDown":case"topKeyUp":return Xe(n,r)}return null}};On.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin TapEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),Tn=Rn.getFiberCurrentPropsFromNode,Sn=Rn.getInstanceFromNode,Pn=Rn.getNodeFromInstance,On.injectEventPluginsByName({SimpleEventPlugin:Kr,EnterLeaveEventPlugin:Fr,ChangeEventPlugin:Pr,SelectEventPlugin:fo,BeforeInputEventPlugin:Zn});var po=null,ho=null;new Set;var mo=void 0,yo=void 0,go=Array.isArray,vo=vt(!0),bo=vt(!1),Co={},ko=Object.freeze({default:Ot}),wo=ko&&Ot||ko,Eo=wo.default?wo.default:wo,xo="object"==typeof performance&&"function"==typeof performance.now,_o=void 0;_o=xo?function(){return performance.now()}:function(){return Date.now()};var To=void 0,So=void 0;if(fn.canUseDOM)if("function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback){var Po=null,No=!1,Oo=-1,Io=!1,Mo=0,Fo=33,Do=33,Ro=void 0;Ro=xo?{didTimeout:!1,timeRemaining:function(){var e=Mo-performance.now();return 0<e?e:0}}:{didTimeout:!1,timeRemaining:function(){var e=Mo-Date.now();return 0<e?e:0}};var Lo="__reactIdleCallback$"+Math.random().toString(36).slice(2);window.addEventListener("message",function(e){if(e.source===window&&e.data===Lo){if(No=!1,e=_o(),0>=Mo-e){if(!(-1!==Oo&&Oo<=e))return void(Io||(Io=!0,requestAnimationFrame(Uo)));Ro.didTimeout=!0}else Ro.didTimeout=!1;Oo=-1,e=Po,Po=null,null!==e&&e(Ro)}},!1);var Uo=function(e){Io=!1;var t=e-Mo+Do;t<Do&&Fo<Do?(8>t&&(t=8),Do=t<Fo?Fo:t):Fo=t,Mo=e+Do,No||(No=!0,window.postMessage(Lo,"*"))};To=function(e,t){return Po=e,null!=t&&"number"==typeof t.timeout&&(Oo=_o()+t.timeout),Io||(Io=!0,requestAnimationFrame(Uo)),0},So=function(){Po=null,No=!1,Oo=-1}}else To=window.requestIdleCallback,So=window.cancelIdleCallback;else To=function(e){return setTimeout(function(){e({timeRemaining:function(){return 1/0},didTimeout:!1})})},So=function(e){clearTimeout(e)};var jo={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"},Ho=void 0,zo=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if(e.namespaceURI!==jo.svg||"innerHTML"in e)e.innerHTML=t;else{for(Ho=Ho||document.createElement("div"),Ho.innerHTML="<svg>"+t+"</svg>",t=Ho.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}),Ao={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Bo=["Webkit","ms","Moz","O"];Object.keys(Ao).forEach(function(e){Bo.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ao[t]=Ao[e]})});var Vo=dn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Wo=pn.thatReturns(""),Qo=Object.freeze({createElement:$t,createTextNode:qt,setInitialProperties:Gt,diffProperties:Yt,updateProperties:Xt,diffHydratedProperties:Zt,diffHydratedText:Jt,warnForUnmatchedText:function(){},warnForDeletedHydratableElement:function(){},warnForDeletedHydratableText:function(){},warnForInsertedHydratedElement:function(){},warnForInsertedHydratedText:function(){},restoreControlledState:function(e,t,n){switch(t){case"input":if(me(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var i=k(o);i||r("90"),ne(o),me(o,i)}}}break;case"textarea":jt(e,n);break;case"select":null!=(t=n.value)&&Dt(e,!!n.multiple,t,!1)}}});er.injectFiberControlledHostComponent(Qo);var Ko=null,$o=null;en.prototype.render=function(e){this._defer||r("250"),this._hasChildren=!0,this._children=e;var t=this._root._internalRoot,n=this._expirationTime,o=new tn;return qo.updateContainerAtExpirationTime(e,t,null,n,o._onCommit),o},en.prototype.then=function(e){if(this._didComplete)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},en.prototype.commit=function(){var e=this._root._internalRoot,t=e.firstBatch;if(this._defer&&null!==t||r("251"),this._hasChildren){var n=this._expirationTime;if(t!==this){this._hasChildren&&(n=this._expirationTime=t._expirationTime,this.render(this._children));for(var o=null,i=t;i!==this;)o=i,i=i._next;null===o&&r("251"),o._next=i._next,this._next=t,e.firstBatch=this}this._defer=!1,qo.flushRoot(e,n),t=this._next,this._next=null,t=e.firstBatch=t,null!==t&&t._hasChildren&&t.render(t._children)}else this._next=null,this._defer=!1},en.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++)(0,e[t])()}},tn.prototype.then=function(e){if(this._didCommit)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},tn.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++){var n=e[t];"function"!=typeof n&&r("191",n),n()}}},nn.prototype.render=function(e,t){var n=this._internalRoot,r=new tn;return t=void 0===t?null:t,null!==t&&r.then(t),qo.updateContainer(e,n,null,r._onCommit),r},nn.prototype.unmount=function(e){var t=this._internalRoot,n=new tn;return e=void 0===e?null:e,null!==e&&n.then(e),qo.updateContainer(null,t,null,n._onCommit),n},nn.prototype.legacy_renderSubtreeIntoContainer=function(e,t,n){var r=this._internalRoot,o=new tn;return n=void 0===n?null:n,null!==n&&o.then(n),qo.updateContainer(t,r,e,o._onCommit),o},nn.prototype.createBatch=function(){var e=new en(this),t=e._expirationTime,n=this._internalRoot,r=n.firstBatch;if(null===r)n.firstBatch=e,e._next=null;else{for(n=null;null!==r&&r._expirationTime<=t;)n=r,r=r._next;e._next=r,null!==n&&(n._next=e)}return e};var qo=Eo({getRootHostContext:function(e){var t=e.nodeType;switch(t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:At(null,"");break;default:t=8===t?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=At(e,t)}return e},getChildHostContext:function(e,t){return At(e,t)},getPublicInstance:function(e){return e},prepareForCommit:function(){Ko=Gr;var e=hn();if(Ye(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{var n=window.getSelection&&window.getSelection();if(n&&0!==n.rangeCount){t=n.anchorNode;var r=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{t.nodeType,o.nodeType}catch(e){t=null;break e}var i=0,a=-1,l=-1,u=0,c=0,s=e,f=null;t:for(;;){for(var d;s!==t||0!==r&&3!==s.nodeType||(a=i+r),s!==o||0!==n&&3!==s.nodeType||(l=i+n),3===s.nodeType&&(i+=s.nodeValue.length),null!==(d=s.firstChild);)f=s,s=d;for(;;){if(s===e)break t;if(f===t&&++u===r&&(a=i),f===o&&++c===n&&(l=i),null!==(d=s.nextSibling))break;s=f,f=s.parentNode}s=d}t=-1===a||-1===l?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;$o={focusedElem:e,selectionRange:t},ze(!1)},resetAfterCommit:function(){var e=$o,t=hn(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&yn(document.documentElement,n)){if(Ye(n))if(t=r.start,e=r.end,void 0===e&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(window.getSelection){t=window.getSelection();var o=n[I()].length;e=Math.min(r.start,o),r=void 0===r.end?e:Math.min(r.end,o),!t.extend&&e>r&&(o=r,r=e,e=o),o=Ge(n,e);var i=Ge(n,r);if(o&&i&&(1!==t.rangeCount||t.anchorNode!==o.node||t.anchorOffset!==o.offset||t.focusNode!==i.node||t.focusOffset!==i.offset)){var a=document.createRange();a.setStart(o.node,o.offset),t.removeAllRanges(),e>r?(t.addRange(a),t.extend(i.node,i.offset)):(a.setEnd(i.node,i.offset),t.addRange(a))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}$o=null,ze(Ko),Ko=null},createInstance:function(e,t,n,r,o){return e=$t(e,t,n,r),e[Fn]=o,e[Dn]=t,e},appendInitialChild:function(e,t){e.appendChild(t)},finalizeInitialChildren:function(e,t,n,r){return Gt(e,t,n,r),on(t,n)},prepareUpdate:function(e,t,n,r,o){return Yt(e,t,n,r,o)},shouldSetTextContent:function(e,t){return"textarea"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html},shouldDeprioritizeSubtree:function(e,t){return!!t.hidden},createTextInstance:function(e,t,n,r){return e=qt(e,t),e[Fn]=r,e},now:_o,mutation:{commitMount:function(e,t,n){on(t,n)&&e.focus()},commitUpdate:function(e,t,n,r,o){e[Dn]=o,Xt(e,t,n,r,o)},resetTextContent:function(e){Bt(e,"")},commitTextUpdate:function(e,t,n){e.nodeValue=n},appendChild:function(e,t){e.appendChild(t)},appendChildToContainer:function(e,t){8===e.nodeType?e.parentNode.insertBefore(t,e):e.appendChild(t)},insertBefore:function(e,t,n){e.insertBefore(t,n)},insertInContainerBefore:function(e,t,n){8===e.nodeType?e.parentNode.insertBefore(t,n):e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},removeChildFromContainer:function(e,t){8===e.nodeType?e.parentNode.removeChild(t):e.removeChild(t)}},hydration:{canHydrateInstance:function(e,t){return 1!==e.nodeType||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e},canHydrateTextInstance:function(e,t){return""===t||3!==e.nodeType?null:e},getNextHydratableSibling:function(e){for(e=e.nextSibling;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e},getFirstHydratableChild:function(e){for(e=e.firstChild;e&&1!==e.nodeType&&3!==e.nodeType;)e=e.nextSibling;return e},hydrateInstance:function(e,t,n,r,o,i){return e[Fn]=i,e[Dn]=n,Zt(e,t,n,o,r)},hydrateTextInstance:function(e,t,n){return e[Fn]=n,Jt(e,t)},didNotMatchHydratedContainerTextInstance:function(){},didNotMatchHydratedTextInstance:function(){},didNotHydrateContainerInstance:function(){},didNotHydrateInstance:function(){},didNotFindHydratableContainerInstance:function(){},didNotFindHydratableContainerTextInstance:function(){},didNotFindHydratableInstance:function(){},didNotFindHydratableTextInstance:function(){}},scheduleDeferredCallback:To,cancelDeferredCallback:So}),Go=qo;K=Go.batchedUpdates,$=Go.interactiveUpdates,q=Go.flushInteractiveUpdates;var Yo={createPortal:un,findDOMNode:function(e){return null==e?null:1===e.nodeType?e:qo.findHostInstance(e)},hydrate:function(e,t,n){return ln(null,e,t,!0,n)},render:function(e,t,n){return ln(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,o){return(null==e||void 0===e._reactInternalFiber)&&r("38"),ln(e,t,n,!1,o)},unmountComponentAtNode:function(e){return rn(e)||r("40"),!!e._reactRootContainer&&(qo.unbatchedUpdates(function(){ln(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},unstable_createPortal:function(){return un.apply(void 0,arguments)},unstable_batchedUpdates:qo.batchedUpdates,unstable_deferredUpdates:qo.deferredUpdates,flushSync:qo.flushSync,unstable_flushControlled:qo.flushControlled,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{EventPluginHub:In,EventPluginRegistry:_n,EventPropagators:Ln,ReactControlledComponent:rr,ReactDOMComponentTree:Rn,ReactDOMEventListener:Yr},unstable_createRoot:function(e,t){return new nn(e,!0,null!=t&&!0===t.hydrate)}};qo.injectIntoDevTools({findFiberByHostInstance:b,bundleType:0,version:"16.3.2",rendererPackageName:"react-dom"});var Xo=Object.freeze({default:Yo}),Zo=Xo&&Yo||Xo;e.exports=Zo.default?Zo.default:Zo},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){"use strict";function r(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}e.exports=r},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function o(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(!i.call(t,n[a])||!r(e[n[a]],t[n[a]]))return!1;return!0}var i=Object.prototype.hasOwnProperty;e.exports=o},function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!o(e)&&(o(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var o=n(13);e.exports=r},function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=n(14);e.exports=r},function(e,t,n){"use strict";function r(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),c=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={hasError:!1},n}return i(t,e),a(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0}),console.log("Builder UI Error:",e,t)}},{key:"render",value:function(){return this.state.hasError,this.props.children}}]),t}(u.default.Component);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),c=r(u),s=n(17),f=r(s),d=n(19),p=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),l(t,[{key:"render",value:function(){return c.default.createElement(u.Fragment,null,c.default.createElement(f.default,null),c.default.createElement(d.NotificationsManager,null))}}]),t}(u.Component);t.default=p},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0);n(18);var u=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),i=n.props.postId;return n.layoutClass=".fl-builder-content-"+(i||FLBuilderConfig.postId),n}return i(t,e),a(t,[{key:"componentDidMount",value:function(){this.setupHooks=this.setupHooks.bind(this),this.hooked=!1,jQuery(document).on("tinymce-editor-init",this.setupHooks),this.setupHooks()}},{key:"setupHooks",value:function(){if(window.tinymce&&!this.hooked&&FLBuilderConfig.inlineEnabled){var e=this.setupEditables.bind(this),t=this.refreshEditables.bind(this),n=(this.destroyEditables.bind(this),this.destroyAllEditables.bind(this)),r=this.destroyLoadingEditables.bind(this);FLBuilder&&(FLBuilder.addHook("settingsConfigLoaded",e),FLBuilder.addHook("restartEditingSession",e),FLBuilder.addHook("endEditingSession",n),FLBuilder.addHook("didStartNodeLoading",r),FLBuilder.addHook("didRenderLayoutComplete",t),FLBuilder.addHook("didDeleteRow",t),FLBuilder.addHook("didDeleteColumn",t),FLBuilder.addHook("didDeleteModule",t)),this.setupEditables(),this.hooked=!0}}},{key:"setupEditables",value:function(){var e=this,t=FLBuilderSettingsConfig,n=t.editables,r=jQuery(this.layoutClass);if(r.length)for(var o in n){var i='.fl-module[data-type="'+o+'"]:not(.fl-editable):not(.fl-node-global)';r.find(i).each(function(t,n){return e.setupEditable(jQuery(n))})}}},{key:"setupEditable",value:function(e){var t=this,n=e.data("type"),r=e.data("node"),o=FLBuilderSettingsConfig.editables[n],i=".fl-node-"+r+" ",a="fl-inline-editor-"+r,l=jQuery('<div id="'+a+'" class="fl-inline-editor"></div>'),u=jQuery(".fl-builder-settings[data-node="+r+"]"),c=FLBuilderSettingsConfig.nodes[r],s=c.connections;e.append(l),e.addClass("fl-editable"),e.delegate(".fl-block-overlay","click",this.onModuleOverlayClick.bind(this)),e.on("mouseleave",this.onModuleMouseleave.bind(this));for(var f in o){(function(e){var n=o[e],r=FLBuilderPreview.getFormattedSelector(i,n.selector),l=jQuery(r),c=l.html(),f=u.find("#fl-field-"+e+" .fl-field-connection-value");l.length&&(f.length&&""!==f.val()||(!f.length&&s&&s[e]||(l.data("field",n.field),l.on("drop",t.onEditorDrop.bind(t)),tinymce.init({selector:r,inline:!0,menubar:!1,skin:!FLBuilder&&"lightgray",skin_url:!FLBuilder&&tinyMCEPreInit.baseURL+"/skins/lightgray/",theme:"modern",theme_url:tinyMCEPreInit.baseURL+"/themes/modern/",fixed_toolbar_container:"#"+a,plugins:t.getEditorPluginConfig(n.field.type),toolbar:t.getEditorToolbarConfig(n.field.type),init_instance_callback:function(e){t.onEditorInit(e),l.html(c)}}))))})(f)}}},{key:"getEditorPluginConfig",value:function(e){switch(e){case"editor":return"wordpress, wplink, lists";default:return""}}},{key:"getEditorToolbarConfig",value:function(e){switch(e){case"editor":return"bold italic strikethrough link underline | alignleft aligncenter alignright";case"unit":return!1;default:return"bold italic strikethrough underline"}}},{key:"destroyEditables",value:function(e){var t=e.find(".mce-content-body"),n=e.find(".fl-inline-editor"),r=jQuery(".wplink-autocomplete, .ui-helper-hidden-accessible");t.removeAttr("contenteditable"),e.undelegate(".fl-block-overlay","click"),e.off("mouseleave"),e.removeClass("fl-editable"),n.remove(),r.remove(),t.each(function(e,t){var n=jQuery(t).attr("id");jQuery('[id="'+n+'"]').length<2&&setTimeout(function(){return tinymce.execCommand("mceRemoveEditor",!0,n)},1)})}},{key:"destroyAllEditables",value:function(){var e=jQuery(this.layoutClass),t=e.find(".fl-editable");this.destroyEditables(t)}},{key:"destroyLoadingEditables",value:function(e,t){var n=jQuery(t);n.hasClass("fl-module")||(n=n.find(".fl-module")),this.destroyEditables(n)}},{key:"refreshEditables",value:function(){this.setupEditables(),tinymce.editors.map(function(e,t){e.inline&&!jQuery("#"+e.id).length&&setTimeout(function(){return tinymce.execCommand("mceRemoveEditor",!0,e.id)},1)})}},{key:"getEditorEventVars",value:function(e){var t=jQuery(e).closest(".mce-content-body"),n=tinymce.get(t.attr("id")),r=t.data("field"),o=t.closest(".fl-module");return{editable:t,module:o,editor:n,field:r,nodeId:o.data("node")}}},{key:"onEditorInit",value:function(e){e.on("change",this.onEditorChange.bind(this)),e.on("keyup",this.onEditorChange.bind(this)),e.on("undo",this.onEditorChange.bind(this)),e.on("redo",this.onEditorChange.bind(this)),e.on("focus",this.onEditorFocus.bind(this)),e.on("blur",this.onEditorBlur.bind(this)),e.on("mousedown",this.onEditorMousedown.bind(this))}},{key:"onEditorChange",value:function(e){var t=e.target.bodyElement?e.target.bodyElement:e.target,n=this.getEditorEventVars(t),r=(n.editable,n.editor),o=n.field,i=n.nodeId,a=jQuery('.fl-builder-settings[data-node="'+i+'"]'),l=r.getContent();if(a.length)if("editor"===o.type){var u=a.find("#fl-field-"+o.name+" textarea.wp-editor-area"),c=u.attr("id");u.closest(".tmce-active").length?tinymce.get(c).setContent(l):u.val(l)}else{var s=document.createElement("textarea");s.innerHTML=l,a.find('[name="'+o.name+'"]').val(s.value)}}},{key:"onEditorFocus",value:function(e){var t=this.getEditorEventVars(e.target.bodyElement),n=t.editable,r=t.editor,o=t.module,i=t.field,a=t.nodeId,l=o.find(".fl-inline-editor"),u=this.getSettingHTML(a,i);this.matchHTML(r.getContent(),u)||(n.data("original",{settingHTML:u,editableHTML:n.html()}),n.css("min-height",n.height()),r.setContent(u),r.selection.select(r.getBody(),!0),r.selection.collapse(!1)),r.settings.toolbar?l.removeClass("fl-inline-editor-no-toolbar"):l.addClass("fl-inline-editor-no-toolbar"),o.addClass("fl-editable-focused"),this.showEditorOverlay(o),this.showModuleSettings(o)}},{key:"onEditorBlur",value:function(e){var t=this.getEditorEventVars(e.target.bodyElement),n=t.editable,r=t.editor,o=t.module,i=o.find(".fl-inline-editor"),a=n.data("original");i.removeClass("fl-inline-editor-no-toolbar"),o.removeClass("fl-editable-focused"),a&&this.matchHTML(r.getContent(),a.settingHTML)&&(n.html(a.editableHTML),n.css("min-height",""))}},{key:"onEditorMousedown",value:function(e){var t=this.getEditorEventVars(e.target),n=t.module;this.showEditorOverlay(n)}},{key:"onEditorDrop",value:function(e){return e.preventDefault(),!1}},{key:"onModuleOverlayClick",value:function(e){var t=jQuery(e.target).closest(".fl-block-overlay-actions"),n=jQuery(e.currentTarget).closest(".fl-module"),r=n.find(".mce-content-body").first().attr("id");t.length||r&&(tinymce.get(r).focus(),n.addClass("fl-editable-focused"))}},{key:"onModuleMouseleave",value:function(e){jQuery(".mce-inline-toolbar-grp:visible, .mce-floatpanel:visible").length||(this.hideEditorOverlays(),this.showNodeOverlays())}},{key:"showEditorOverlay",value:function(e){var t=e.find(".fl-inline-editor");this.hideNodeOverlays(),this.hideEditorOverlays(),t.show(),jQuery(".fl-inline-editor-active-toolbar").removeClass("fl-inline-editor-active-toolbar"),t.find("> .mce-panel:visible").addClass("fl-inline-editor-active-toolbar")}},{key:"hideEditorOverlays",value:function(){jQuery(".fl-inline-editor, .mce-floatpanel").hide()}},{key:"showNodeOverlays",value:function(){jQuery(".fl-block-overlay").show()}},{key:"hideNodeOverlays",value:function(){jQuery(".fl-block-overlay").hide()}},{key:"showModuleSettings",value:function(e){var t=e.data("type"),n=e.data("node"),r=e.closest(".fl-col").data("node"),o=e.hasClass("fl-node-global");jQuery('.fl-builder-settings[data-node="'+n+'"]').length||FLBuilder._showModuleSettings({type:t,nodeId:n,parentId:r,global:o})}},{key:"getSettingValue",value:function(e,t){var n=jQuery('.fl-builder-settings[data-node="'+e+'"]'),r={};return r=n.length?FLBuilder._getSettings(n):FLBuilderSettingsConfig.nodes[e],r[t]}},{key:"getSettingHTML",value:function(e,t){var n=this.getSettingValue(e,t.name);return"editor"===t.type&&""!==n?wp.editor.autop(n):n}},{key:"matchHTML",value:function(e,t){return this.cleanHTML(e)===this.cleanHTML(t)}},{key:"cleanHTML",value:function(e){var t=/(\r\n|\n|\r)/gm;return jQuery("<div>"+e+"</div>").html().trim().replace(t,"")}},{key:"render",value:function(){return null}}]),t}(l.Component);t.default=u},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationsManager=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l);n(20);var c=function(e){return u.default.createElement("div",{dangerouslySetInnerHTML:{__html:e}})},s=FLBuilderConfig.lite,f=function(e){var t={__html:e.children},n=new Date(e.date).toDateString(),r=void 0;if("string"==typeof e.url&&""!==e.url){var o=s?e.url+"?utm_medium=bb-lite&utm_source=builder-ui&utm_campaign=notification-center":e.url+"?utm_medium=bb-pro&utm_source=builder-ui&utm_campaign=notification-center";r=u.default.createElement("a",{className:"fl-builder-ui-post",href:o,target:"_blank",rel:"noopener"},u.default.createElement("div",{className:"fl-builder-ui-post-date"},n),u.default.createElement("div",{className:"fl-builder-ui-post-title"},e.title),u.default.createElement("div",{className:"fl-builder-ui-post-content",dangerouslySetInnerHTML:t}))}else r=u.default.createElement("span",{className:"fl-builder-ui-post"},u.default.createElement("div",{className:"fl-builder-ui-post-date"},n),u.default.createElement("div",{className:"fl-builder-ui-post-title"},e.title),u.default.createElement("div",{className:"fl-builder-ui-post-content",dangerouslySetInnerHTML:t}));return r},d=function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return i(t,e),a(t,[{key:"getPosts",value:function(e){var t=void 0,n=void 0,r=FLBuilderStrings.notifications;return e.length>0?(n=e.map(function(e){return u.default.createElement(f,{key:e.id,title:c(e.title.rendered),date:e.date,url:e.meta._fl_notification[0]},e.content.rendered)}),t=u.default.createElement(l.Fragment,null,n)):t=u.default.createElement("div",{className:"fl-panel-no-message"},r.none),t}},{key:"componentDidMount",value:function(){FLBuilder._initScrollbars()}},{key:"componentDidUpdate",value:function(){FLBuilder._initScrollbars()}},{key:"render",value:function(){var e=this.getPosts(this.props.posts),t=FLBuilderStrings.notifications;return u.default.createElement("div",{className:"fl-notifications-panel"},u.default.createElement("div",{className:"fl-panel-title"},t.title),u.default.createElement("div",{className:"fl-nanoscroller",ref:this.setupScroller},u.default.createElement("div",{className:"fl-nanoscroller-content"},e)))}}]),t}(l.Component);t.NotificationsManager=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),i=FLBuilderConfig.notifications,a=(i.read,i.data);return n.state={shouldShowNotifications:!1,posts:JSON.parse(a)},FLBuilder.addHook("toggleNotifications",n.onToggleNotifications.bind(n)),n}return i(t,e),a(t,[{key:"onToggleNotifications",value:function(){this.setState({shouldShowNotifications:!this.state.shouldShowNotifications})}},{key:"render",value:function(){var e=this.state,t=e.shouldShowNotifications,n=e.posts;return FLBuilder.triggerHook("notificationsLoaded"),u.default.createElement(l.Fragment,null,t&&u.default.createElement(d,{posts:n}))}}]),t}(l.Component)},function(e,t){},function(e,t){}]);
|
js/fl-builder-ui-pinned.js
CHANGED
@@ -245,7 +245,7 @@
|
|
245 |
*/
|
246 |
pinPanel: function( position ) {
|
247 |
var panel = $( '.fl-builder--content-library-panel' ),
|
248 |
-
width = panel.
|
249 |
body = $( 'body' ),
|
250 |
preview = $( '.fl-responsive-preview, .fl-responsive-preview-mask' ),
|
251 |
content = $( FLBuilder._contentClass ).parentsUntil( 'body' ).last();
|
@@ -650,7 +650,7 @@
|
|
650 |
lightbox = $( '.fl-lightbox-resizable:visible' ),
|
651 |
data = {
|
652 |
pinned: {
|
653 |
-
width : panel.
|
654 |
position : null
|
655 |
}
|
656 |
};
|
@@ -692,9 +692,9 @@
|
|
692 |
settings = FLBuilderConfig.userSettings.pinned;
|
693 |
|
694 |
if ( settings && settings.position ) {
|
695 |
-
panel.
|
696 |
this.pin( settings.position, false );
|
697 |
-
panel.
|
698 |
}
|
699 |
},
|
700 |
};
|
245 |
*/
|
246 |
pinPanel: function( position ) {
|
247 |
var panel = $( '.fl-builder--content-library-panel' ),
|
248 |
+
width = panel.outerWidth(),
|
249 |
body = $( 'body' ),
|
250 |
preview = $( '.fl-responsive-preview, .fl-responsive-preview-mask' ),
|
251 |
content = $( FLBuilder._contentClass ).parentsUntil( 'body' ).last();
|
650 |
lightbox = $( '.fl-lightbox-resizable:visible' ),
|
651 |
data = {
|
652 |
pinned: {
|
653 |
+
width : panel.outerWidth(),
|
654 |
position : null
|
655 |
}
|
656 |
};
|
692 |
settings = FLBuilderConfig.userSettings.pinned;
|
693 |
|
694 |
if ( settings && settings.position ) {
|
695 |
+
panel.css( 'width', settings.width + 'px' );
|
696 |
this.pin( settings.position, false );
|
697 |
+
panel.css( 'width', settings.width + 'px' );
|
698 |
}
|
699 |
},
|
700 |
};
|
js/fl-builder-ui.js
CHANGED
@@ -523,6 +523,7 @@
|
|
523 |
FLBuilder._initTemplateSelector();
|
524 |
FLBuilder._bindOverlayEvents();
|
525 |
FLBuilder._highlightEmptyCols();
|
|
|
526 |
|
527 |
$('html').addClass('fl-builder-edit').removeClass('fl-builder-show-admin-bar');
|
528 |
$('body').addClass('fl-builder-edit');
|
@@ -576,6 +577,7 @@
|
|
576 |
*/
|
577 |
show: function() {
|
578 |
if ( ! $( 'html' ).hasClass( 'fl-builder-edit' ) ) {
|
|
|
579 |
FLBuilder._bindOverlayEvents();
|
580 |
this.showMainToolbar();
|
581 |
FLBuilderResponsiveEditing._switchTo('default');
|
523 |
FLBuilder._initTemplateSelector();
|
524 |
FLBuilder._bindOverlayEvents();
|
525 |
FLBuilder._highlightEmptyCols();
|
526 |
+
FLBuilder._rebindEvents();
|
527 |
|
528 |
$('html').addClass('fl-builder-edit').removeClass('fl-builder-show-admin-bar');
|
529 |
$('body').addClass('fl-builder-edit');
|
577 |
*/
|
578 |
show: function() {
|
579 |
if ( ! $( 'html' ).hasClass( 'fl-builder-edit' ) ) {
|
580 |
+
FLBuilder._rebindEvents();
|
581 |
FLBuilder._bindOverlayEvents();
|
582 |
this.showMainToolbar();
|
583 |
FLBuilderResponsiveEditing._switchTo('default');
|
js/fl-builder.js
CHANGED
@@ -831,6 +831,17 @@
|
|
831 |
$('body').undelegate('.fl-builder-content a', 'click', FLBuilder._preventDefault);
|
832 |
},
|
833 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
834 |
/**
|
835 |
* Binds the events for overlays that appear when
|
836 |
* mousing over a row, column or module.
|
@@ -5160,6 +5171,10 @@
|
|
5160 |
*/
|
5161 |
_showModuleSettings: function( data, callback )
|
5162 |
{
|
|
|
|
|
|
|
|
|
5163 |
var config = FLBuilderSettingsConfig.modules[ data.type ],
|
5164 |
settings = data.settings ? data.settings : FLBuilderSettingsConfig.nodes[ data.nodeId ],
|
5165 |
head = $( 'head' ),
|
@@ -6868,7 +6883,19 @@
|
|
6868 |
*/
|
6869 |
_showCodeFieldError: function( e ) {
|
6870 |
e.stopImmediatePropagation();
|
6871 |
-
FLBuilder.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6872 |
},
|
6873 |
|
6874 |
/* Multiple Fields
|
831 |
$('body').undelegate('.fl-builder-content a', 'click', FLBuilder._preventDefault);
|
832 |
},
|
833 |
|
834 |
+
/**
|
835 |
+
* Rebind events when restarting the edit session
|
836 |
+
* @since 2.1.2.3
|
837 |
+
* @access private
|
838 |
+
*/
|
839 |
+
_rebindEvents: function() {
|
840 |
+
$('a').on('click', FLBuilder._preventDefault);
|
841 |
+
$('.fl-page-nav .nav a').on('click', FLBuilder._headerLinkClicked);
|
842 |
+
$('body').delegate('.fl-builder-content a', 'click', FLBuilder._preventDefault);
|
843 |
+
},
|
844 |
+
|
845 |
/**
|
846 |
* Binds the events for overlays that appear when
|
847 |
* mousing over a row, column or module.
|
5171 |
*/
|
5172 |
_showModuleSettings: function( data, callback )
|
5173 |
{
|
5174 |
+
if ( ! FLBuilderSettingsConfig.modules ) {
|
5175 |
+
return;
|
5176 |
+
}
|
5177 |
+
|
5178 |
var config = FLBuilderSettingsConfig.modules[ data.type ],
|
5179 |
settings = data.settings ? data.settings : FLBuilderSettingsConfig.nodes[ data.nodeId ],
|
5180 |
head = $( 'head' ),
|
6883 |
*/
|
6884 |
_showCodeFieldError: function( e ) {
|
6885 |
e.stopImmediatePropagation();
|
6886 |
+
FLBuilder.confirm( {
|
6887 |
+
message: FLBuilderStrings.codeError,
|
6888 |
+
cancel: function(){
|
6889 |
+
var saveBtn = $( '.fl-builder-settings:visible .fl-builder-settings-save' );
|
6890 |
+
saveBtn.removeClass( 'fl-builder-settings-error' );
|
6891 |
+
saveBtn.off( 'click', FLBuilder._showCodeFieldError );
|
6892 |
+
saveBtn.trigger( 'click' );
|
6893 |
+
},
|
6894 |
+
strings: {
|
6895 |
+
ok: FLBuilderStrings.codeErrorFix,
|
6896 |
+
cancel: FLBuilderStrings.codeErrorIgnore
|
6897 |
+
}
|
6898 |
+
} );
|
6899 |
},
|
6900 |
|
6901 |
/* Multiple Fields
|
js/fl-builder.min.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
var FLBuilderColorPicker;!function(e,t){function i(){var t,i,l="backgroundImage";h?f="filter":(t=e('<div id="iris-gradtest" />'),i="linear-gradient(top,#fff,#000)",e.each(g,function(e,o){if(t.css(l,o+i),t.css(l).match("gradient"))return f=e,!1}),f===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css(this.bgImageString).match("gradient")&&(f="webkit")),t.remove())}function l(t,i){return t="top"===t?"top":"left",i=e.isArray(i)?i:Array.prototype.slice.call(arguments,1),"webkit"===f?s(t,i):g[f]+"linear-gradient("+t+", "+i.join(", ")+")"}function o(t,i){var l,o,s,r,a,d,u,c,h;t="top"===t?"top":"left",i=e.isArray(i)?i:Array.prototype.slice.call(arguments,1),l="top"===t?0:1,o=e(this),s=i.length-1,r="filter",a=1===l?"left":"top",d=1===l?"right":"bottom",u=1===l?"height":"width",c='<div class="iris-ie-gradient-shim" style="position:absolute;'+u+":100%;"+a+":%start%;"+d+":%end%;"+r+':%filter%;" data-color:"%color%"></div>',h="","static"===o.css("position")&&o.css({position:"relative"}),i=n(i),e.each(i,function(e,t){var o,n,r;return e!==s&&(o=i[e+1],void(t.stop!==o.stop&&(n=100-parseFloat(o.stop)+"%",t.octoHex=new Color(t.color).toIEOctoHex(),o.octoHex=new Color(o.color).toIEOctoHex(),r="progid:DXImageTransform.Microsoft.Gradient(GradientType="+l+", StartColorStr='"+t.octoHex+"', EndColorStr='"+o.octoHex+"')",h+=c.replace("%start%",t.stop).replace("%end%",n).replace("%filter%",r))))}),o.find(".iris-ie-gradient-shim").remove(),e(h).prependTo(o)}function s(t,i){var l=[];return t="top"===t?"0% 0%,0% 100%,":"0% 100%,100% 100%,",i=n(i),e.each(i,function(e,t){l.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+l.join(",")+")"}function n(t){var i=[],l=[],o=[],s=t.length-1;return e.each(t,function(e,t){var o=t,s=!1,n=t.match(/1?[0-9]{1,2}%$/);n&&(o=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=n.shift()),i.push(o),l.push(s)}),l[0]===!1&&(l[0]="0%"),l[s]===!1&&(l[s]="100%"),l=r(l),e.each(l,function(e){o[e]={color:i[e],stop:l[e]}}),o}function r(t){var i,l,o,s,n=0,a=t.length-1,d=0,u=!1;if(t.length<=2||e.inArray(!1,t)<0)return t;for(;d<t.length-1;)u||t[d]!==!1?u&&t[d]!==!1&&(a=d,d=t.length):(n=d-1,u=!0),d++;for(l=a-n,s=parseInt(t[n].replace("%"),10),i=(parseFloat(t[a].replace("%"))-s)/l,d=n+1,o=1;d<a;)t[d]=s+o*i+"%",o++,d++;return r(t)}var a=[],d=navigator.userAgent.toLowerCase(),u="Microsoft Internet Explorer"===navigator.appName,c=u?parseFloat(d.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,h=u&&c<10,f=!1,g=["-moz-","-webkit-","-o-","-ms-"];flBuilderParseColorValue=function(e){var t=e.replace(/\s+/g,""),i=t.indexOf("rgba")!==-1?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100,l=i<100;return{value:t,alpha:i,rgba:l}},e.fn.flBuilderColorPickerGradient=function(){var t=arguments;return this.each(function(){h?o.apply(this,t):e(this).css("backgroundImage",l.apply(this,t))})},e.fn.flBuilderColorPickerRaninbowGradient=function(t,i){var l,o,s,n;for(t=t||"top",l=e.extend({},{s:100,l:50},i),o="hsl(%h%,"+l.s+"%,"+l.l+"%)",s=0,n=[];s<=360;)n.push(o.replace("%h%",s)),s+=30;return this.each(function(){e(this).flBuilderColorPickerGradient(t,n)})},FLBuilderColorPicker=function(t){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>';var i={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!"}};this.options=e.extend({},i,t),(h===!1||h===!0&&c>7)&&this._init()},FLBuilderColorPicker.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 t=this;e(t.options.elements);this._color=new Color("#ff0000").setHSpace(t.options.mode),a=this.options.presets,f===!1&&i(),e("html").hasClass("fl-color-picker-init")?t.picker=e(".fl-color-picker-ui"):t.picker=e(this._html).appendTo("body"),u?9===c?t.picker.addClass("iris-ie-9"):c<=8&&t.picker.addClass("iris-ie-lt9"):d.indexOf("compatible")<0&&d.indexOf("khtml")<0&&d.match(/mozilla/)&&t.picker.addClass("iris-mozilla"),t.controls={square:t.picker.find(".iris-square"),squareDrag:t.picker.find(".iris-square-value"),horiz:t.picker.find(".iris-square-horiz"),vert:t.picker.find(".iris-square-vert"),strip:t.picker.find(".iris-strip"),stripSlider:t.picker.find(".iris-strip .iris-slider-offset")},"hsv"===t.options.mode&&t._has("l",t.options.controls)?t.options.controls=t._defaultHSVControls:"hsl"===t.options.mode&&t._has("v",t.options.controls)&&(t.options.controls=t._defaultHSLControls),t.hue=t._color.h(),this._setTemplates(),this._ui=e(".fl-color-picker-ui"),this._iris=e(".iris-picker"),this._wrapper=e("body"),e("html").hasClass("fl-color-picker-init")||this._ui.prepend(this._hexHtml).append(this._presetsHtml),t.element=this._ui.find(".fl-color-picker-input"),t._initControls(),t.active="external",t._change(),t._addInputListeners(t.element),this._buildUI(),this._prepareColorFields(),this._pickerControls(),this._presetsControls(),this._buildAlphaUI(),e("html").addClass("fl-color-picker-init")},_prepareColorFields:function(){var t=this;e(".fl-color-picker-value").each(function(){var i=e(this),l=i.val(),o=i.parent().find(".fl-color-picker-color"),s=flBuilderParseColorValue(l),n="";if(l){if(o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba)n=i.val().toString();else if(!o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba){var r=l.replace("rgba","rgb");r=r.substr(0,r.lastIndexOf(","))+")",t._color._alpha=1,n=r,i.val(r)}else n="#"+i.val().toString();o.css({backgroundColor:n})}})},_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" maxlength="7" 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(t,i){var l=!1;return e.each(i,function(e,i){if(t===i)return l=!0,!1}),l},_buildUI:function(){var t=this;t._presetsList=this._ui.find(".fl-color-picker-presets-list"),t._presetsList.html(""),this.options.presets.length>0?e.each(this.options.presets,function(e,i){t._addPresetView(i)}):t._presetsList.append(this._noPresetsTpl)},_addPresetView:function(t){var i=this._presetsList.find(".fl-color-picker-no-preset");i.length>0&&i.remove();var l=e(this._presetsTpl),o=Color(t);l.attr("data-color",t).find(".fl-color-picker-preset-color").css({backgroundColor:o.toString()}).end().find(".fl-color-picker-preset-label").html(o.toString()),this._presetsList.append(l)},_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(){e(this).remove()})},_pickerControls:function(){var t=this;this._wrapper.on("click",".fl-color-picker-color",function(){var i=e(this);t._currentElement=i.parent().find(".fl-color-picker-value"),t._ui.position({my:"left top",at:"left bottom",of:i,collision:"flipfit",using:function(e,i){t._togglePicker(e)}})}).on("click",".fl-color-picker-clear",function(){var i=e(this);t._currentElement=i.parent().find(".fl-color-picker-value"),i.prev(".fl-color-picker-color").css({backgroundColor:"transparent"}).addClass("fl-color-picker-empty"),t._setColor(""),t.element.val(""),t._currentElement.val("").trigger("change")}),e(document).on("mousedown",function(t){0===e(t.target).closest(".fl-color-picker-ui").length&&e(".fl-color-picker-ui.fl-color-picker-active").removeClass("fl-color-picker-active")})},_presetsControls:function(){var t=this,i=t._ui.find(".fl-color-picker-preset-add"),l=t._ui.find(".fl-color-picker-presets"),o=l.find(".fl-color-picker-presets-open-label"),s=l.find(".fl-color-picker-presets-close-label"),n=l.find(".fl-color-picker-presets-list");i.off("click").on("click",function(){t._addPreset(t.element.val())}),n.css({height:t.element.innerHeight()+t._iris.innerHeight()+14+"px"}).hide(),l.off("click").on("click",".fl-color-picker-presets-toggle",function(){o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),n.slideToggle(500)}).on("click",".fl-color-picker-preset",function(i){var l=new Color(e(this).data("color").toString());t._setColor(l),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:l.toString()}).removeClass("fl-color-picker-empty"),o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),n.slideToggle(500)}).on("click",".fl-color-picker-preset-remove",function(i){i.stopPropagation(),t._removePreset(e(this).parent().data("color"))})},_removePreset:function(t){if(confirm(this.options.labels.removePresetConfirm)){var i=t.toString(),l=a.indexOf(i);l>-1&&(a.splice(l,1),this.options.presets=a,this._presetsList.find('.fl-color-picker-preset[data-color="'+i+'"]').slideUp(function(){e(this).remove()})),a.length<1&&this._presetsList.append(this._noPresetsTpl),e(this).trigger("presetRemoved",{presets:a})}},_addPreset:function(t){var i=t.toString().replace(/^#/,"");""===i?alert(this.options.labels.noneColorSelected):a.indexOf(i)>-1?alert(this.options.labels.alreadySaved.replace("%s","#"+i)):(this._addPresetView(i),this._addPresetFeedback(),a.push(i),this.options.presets=a,e(this).trigger("presetAdded",{presets:a}))},_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(){var e=this;e._paintDimension("right","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var i,l=this,o=l._color,s=l.options.mode,n=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"===s){switch(n=o.clone(),t){case"horiz":n[a.vert](100);break;case"vert":n[a.horiz](100);break;case"strip":n.setHSpace("hsl")}i=n.toHsl()}else i="strip"===t?{s:n.s,l:n.l}:{s:100,l:n.l};r.flBuilderColorPickerRaninbowGradient(e,i);break;case"s":"hsv"===s?"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("+n.h+",100%,50%)"]):i="vert"===t&&"h"===l.options.controls.horiz?["hsla(0, 0%, "+n.l+"%, 0)","hsla(0, 0%, "+n.l+"%, 1)"]:["hsl("+n.h+",0%,50%)","hsl("+n.h+",100%,50%)"],r.flBuilderColorPickerGradient(e,i);break;case"l":i="strip"===t?["hsl("+n.h+",100%,100%)","hsl("+n.h+", "+n.s+"%,50%)","hsl("+n.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,s=o.square,n=i.picker.find(".iris-strip"),r="77.5%",a="12%",d=20,u=l.border?l.width-d:l.width;if(e&&(s.css("width",""),n.css("width",""),i.picker.css({width:"",height:""})),r=u*(parseFloat(r)/100),a=u*(parseFloat(a)/100),t=l.border?r+d:r,s.width(r).height(r),n.height(r).width(a),i.picker.css({width:l.width,height:t}),!l.palettes)return i.picker.css("paddingBottom","")},_addInputListeners:function(e){var t=this,i=100,l=function(i){var l=new Color(e.val()),o=e.val().replace(/^#/,""),s=t._currentElement.hasClass("fl-color-picker-empty");if(e.removeClass("iris-error"),l.error)""!==o&&e.addClass("iris-error");else if(l.toString()!==t._color.toString()||""!==t._color.toString()&&s)if("keyup"===i.type){if(o.match(/^[0-9a-fA-F]{3}$/))return;t._setColor(o),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:Color(o).toString()}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change")}else if("paste"===i.type)return o=i.originalEvent.clipboardData.getData("text").replace(/^#/,""),hex=Color(o).toString(),t._setColor(o),e.val(hex),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:hex}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change"),!1};e.on("change",l).on("keyup",t._debounce(l,i))},_initControls:function(){var t=this,i=t.controls,l=i.square,o=t.options.controls,s=t._scale[o.strip];i.stripSlider.slider({orientation:"horizontal",max:s,slide:function(e,i){t.active="strip","h"===o.strip&&(i.value=s-i.value),t._color[o.strip](i.value),t._change.apply(t,arguments)}}),i.squareDrag.draggable({containment:i.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(e,i){t._squareDrag(e,i)},start:function(){l.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){l.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(i){var l="ui-state-focus";i.preventDefault(),"mousedown"===i.type?(t.picker.find("."+l).removeClass(l).blur(),e(this).addClass(l).focus()):e(this).removeClass(l)}).on("keydown",function(e){var l=i.square,o=i.squareDrag,s=o.position(),n=2;switch(e.altKey&&(n*=10),e.keyCode){case 37:s.left-=n;break;case 38:s.top-=n;break;case 39:s.left+=n;break;case 40:s.top+=n;break;default:return!0}s.left=Math.max(0,Math.min(s.left,l.width())),s.top=Math.max(0,Math.min(s.top,l.height())),o.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),l.mousedown(function(i){var l,o;1===i.which&&e(i.target).is("div")&&(l=t.controls.square.offset(),o={top:i.pageY-l.top,left:i.pageX-l.left},i.preventDefault(),t._squareDrag(i,{position:o}),i.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(o).trigger(i))})},_squareDrag:function(e,t){var i=this,l=i.options.controls,o=i._squareDimensions(),s=Math.round((o.h-t.position.top)/o.h*i._scale[l.vert]),n=i._scale[l.horiz]-Math.round((o.w-t.position.left)/o.w*i._scale[l.horiz]);i._color[l.horiz](n)[l.vert](s),i.active="square",i._change.apply(i,arguments)},_setColor:function(e){var t,i,l=this,o=l.options.color;l.options.color=e,e=""+e,t=e.replace(/^#/,""),i=new Color(e).setHSpace(l.options.mode),i.error?l.options.color=o:(l._color=i,l.options.color=l._color.toString(),l.active="external",l._change())},_squareDimensions:function(e){var i,l,o=this.controls.square;return e!==t&&o.data("dimensions")?o.data("dimensions"):(l=this.controls.squareDrag,i={w:o.width(),h:o.height()},o.data("dimensions",i),i)},_isNonHueControl:function(e,t){return"square"===e&&"h"===this.options.controls.strip||"external"!==t&&("h"!==t||"strip"!==e)},_change:function(){var t=this,i=t.controls,l=t._getHSpaceColor(),o=["square","strip"],s=t.options.controls,n=s[t.active]||"external",r=t.hue;"strip"===t.active?o=[]:"external"!==t.active&&o.pop(),e.each(o,function(e,o){var n,r,a;if(o!==t.active)switch(o){case"strip":n="h"===s.strip?t._scale[s.strip]-l[s.strip]:l[s.strip],i.stripSlider.slider("value",n);break;case"square":r=t._squareDimensions(),a={left:l[s.horiz]/t._scale[s.horiz]*r.w,top:r.h-l[s.vert]/t._scale[s.vert]*r.h},t.controls.squareDrag.css(a)}}),l.h!==r&&t._isNonHueControl(t.active,n)&&t._color.h(r),t.hue=t._color.h(),t.options.color=t._color.toString(),t.element.is(":input")&&!t._color.error&&(t.element.removeClass("iris-error"),t.element.val()!==t._color.toString()&&(t.element.val(t._color.toString()),this._currentElement&&(this._currentElement.val(t._color.toString().replace(/^#/,"")).parent().find(".fl-color-picker-color").css({backgroundColor:t._color.toString()}).removeClass("fl-color-picker-empty"),t._wrapper.find(".fl-alpha-slider-offset").css("background-color",t._color.toString()),this._currentElement.trigger("change")))),t._paint(),t._inited=!0,t.active=!1},_debounce:function(e,t,i){var l,o;return function(){var s,n,r=this,a=arguments;return s=function(){l=null,i||(o=e.apply(r,a))},n=i&&!l,clearTimeout(l),l=setTimeout(s,t),n&&(o=e.apply(r,a)),o}},_buildAlphaUI:function(){var t=this;t._wrapper.on("click",".fl-color-picker-color",function(){var i=e(this);t._currentElement.val();i.hasClass("fl-color-picker-alpha-enabled")?(t._ui.find(".fl-alpha-wrap").length<=0&&e(t._alphaHtml).insertAfter(t._iris),t.picker.addClass("fl-color-alpha-enabled"),t._pickerAlphaControls()):t._ui.find(".fl-alpha-wrap").remove()})},_pickerAlphaControls:function(){var e=this,t=e._currentElement,i=flBuilderParseColorValue(t.val()),l=parseFloat(i.alpha/100),o=e._wrapper,s=e._ui,n=s.find(".fl-alpha-wrap"),r=n.find(".fl-alpha-slider"),a=n.find(".fl-alpha-text"),d=n.find(".fl-alpha-slider-offset");alphaHandle=n.find(".ui-slider-handle"),a.text(l<1?l:""),r.slider({orientation:"vertical",slide:function(t,i){var l=parseFloat(i.value/100);e._color._alpha=l,a.text(l<1?l:""),e._change.apply(e,arguments)},create:function(){d.css({backgroundColor:i.value}),o.on("click",".fl-color-picker-clear",function(){e._color._alpha=1,a.text(""),r.slider("value",100).trigger("slide")})},value:i.alpha,step:1,min:1,max:100})}}}(jQuery),function(e,t){var i=function(e,t){return this instanceof i?this._init(e,t):new i(e,t)};i.fn=i.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 i="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),i=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":i,this[i](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 i(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"],l=t.length-1;l>=0;l--)e[t[l]]=this[t[l]];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(/;$/,""),e.match(i)&&e.match(/\)$/)){if(t=e.replace(/(\s|%)/g,"").replace(i,"").replace(/,?\);?$/,"").split(","),t.length<3)return this._error();if(4===t.length&&(this.a(parseFloat(t.pop())),this.error))return this;for(var l=t.length-1;l>=0;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,i){return"object"!=typeof e||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),i))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),3===e.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 i,l,o,s,n,r,a,d;return"object"!=typeof e||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",r=e.h/360,a=e.s/100,d=e.l/100,0===a?i=l=o=d:(s=d<.5?d*(1+a):d+a-d*a,n=2*d-s,i=this.hue2rgb(n,s,r+1/3),l=this.hue2rgb(n,s,r),o=this.hue2rgb(n,s,r-1/3)),this.fromRgb({r:255*i,g:255*l,b:255*o},!0))},fromHsv:function(e){var i,l,o,s,n,r,a,d,u,c,h;if("object"!=typeof e||e.h===t||e.s===t||e.v===t)return this._error();switch(this._hsv=e,this._hSpace="hsv",i=e.h/360,l=e.s/100,o=e.v/100,a=Math.floor(6*i),d=6*i-a,u=o*(1-l),c=o*(1-d*l),h=o*(1-(1-d)*l),a%6){case 0:s=o,n=h,r=u;break;case 1:s=c,n=o,r=u;break;case 2:s=u,n=o,r=h;break;case 3:s=u,n=c,r=o;break;case 4:s=h,n=u,r=o;break;case 5:s=o,n=u,r=c}return this.fromRgb({r:255*s,g:255*n,b:255*r},!0)},fromInt:function(e,i){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),i===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),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;t>=0;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":var l=this.toHsl();return t<1?"hsla( "+l.h+", "+l.s+"%, "+l.l+"%, "+t+" )":"hsl( "+l.h+", "+l.s+"%, "+l.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,i=this.toRgb(),l=i.r/255,o=i.g/255,s=i.b/255,n=Math.max(l,o,s),r=Math.min(l,o,s),a=(n+r)/2;if(n===r)e=t=0;else{var d=n-r;switch(t=a>.5?d/(2-n-r):d/(n+r),n){case l:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-l)/d+2;break;case s:e=(l-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsl.h!==e&&(e=this._hsl.h),t=Math.round(100*t),0===t&&this._hsl.s&&(t=this._hsl.s),{h:e,s:t,l:Math.round(100*a)}},toHsv:function(){var e,t,i=this.toRgb(),l=i.r/255,o=i.g/255,s=i.b/255,n=Math.max(l,o,s),r=Math.min(l,o,s),a=n,d=n-r;if(t=0===n?0:d/n,n===r)e=t=0;else{switch(n){case l:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-l)/d+2;break;case s:e=(l-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsv.h!==e&&(e=this._hsv.h),t=Math.round(100*t),0===t&&this._hsv.s&&(t=this._hsv.s),{h:e,s:t,v:Math.round(100*a)}},toInt:function(){return this._color},toIEOctoHex:function(){var e=this.toString(),t=parseInt(255*this._alpha,10).toString(16);return 1===t.length&&(t="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 i))throw"getDistanceLuminosityFrom requires a Color object";var t=this.toLuminosity(),l=e.toLuminosity();return t>l?(t+.05)/(l+.05):(l+.05)/(t+.05)},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new i(t)},getReadableContrastingColor:function(e,l){if(!(e instanceof i))return this;var o=l===t?5:l,s=e.getDistanceLuminosityFrom(this),n=e.getMaxContrastColor(),r=n.getDistanceLuminosityFrom(e);if(r<=o)return n;if(s>=o)return this;for(var a=0===n.toInt()?-1:1;s<o&&(this.l(a,!0),s=this.getDistanceLuminosityFrom(e),0!==this._color&&16777215!==this._color););return this},a:function(e){if(e===t)return this._alpha;var i=parseFloat(e);return isNaN(i)?this._error():(this._alpha=i,this)},darken:function(e){return e=e||5,this.l(-e,!0)},lighten:function(e){return e=e||5,this.l(e,!0)},saturate:function(e){return e=e||15,this.s(e,!0)},desaturate:function(e){return e=e||15,this.s(-e,!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(e){e=e||1;var t=180+30*e;return this.h(t,!0)},getAnalog:function(e){e=e||1;var t=30*e;return this.h(t,!0)},getTetrad:function(e){e=e||1;var t=60*e;return this.h(t,!0)},getTriad:function(e){e=e||1;var t=120*e;return this.h(t,!0)},_partial:function(e){var i=l[e];return function(l,o){var s=this._spaceFunc("to",i.space);return l===t?s[e]:(o===!0&&(l=s[e]+l),i.mod&&(l%=i.mod),i.range&&(l=l<i.range[0]?i.range[0]:l>i.range[1]?i.range[1]:l),s[e]=l,this._spaceFunc("from",i.space,s))}},_spaceFunc:function(e,t,i){var l=t||this._hSpace,o=e+l.charAt(0).toUpperCase()+l.substr(1);return this[o](i)}};var l={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(var o in l)l.hasOwnProperty(o)&&(i.fn[o]=i.fn._partial(o));"object"==typeof exports?module.exports=i:e.Color=i}(this),function(e){FLLightbox=function(e){this._init(e)},FLLightbox.closeParent=function(t){var i=e(t).closest(".fl-lightbox-wrap").attr("data-instance-id");_.isUndefined(i)||FLLightbox._instances[i].close()},FLLightbox.getResizableControlClass=function(){var t=e(".fl-lightbox-resizable").eq(0),i="far fa-window-maximize";return t.length&&t.hasClass("fl-lightbox-width-full")&&(i="far fa-window-minimize"),i},FLLightbox.unbindAll=function(){var e;for(e in FLLightbox._instances)FLLightbox._instances[e]._unbind()},FLLightbox.bindAll=function(){var e;for(e in FLLightbox._instances)FLLightbox._instances[e]._bind()},FLLightbox.closeAll=function(){var e;for(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&&t.css(l),this._bind(),this._node.show(),this._visible=!0,"undefined"!=typeof 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()},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(t){var i=0,l=null;for(l in FLLightbox._instances)i++;this._defaults=e.extend({},this._defaults,t),this._id=(new Date).getTime()+i,FLLightbox._instances[this._id]=this,this._render(),this._resizable()},_render:function(){this._node=e('<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),e("body").append(this._node)},_bind:function(){e(window).on("resize.fl-lightbox-"+this._id,this._delayedResize.bind(this))},_unbind:function(){e(window).off("resize.fl-lightbox-"+this._id)},_resizable:function(){var t=(e("body"),this._node.find(".fl-lightbox-mask")),i=this._node.find(".fl-lightbox"),l=e(".fl-lightbox-resizable").eq(0);this._defaults.resizable?(t.hide(),i.addClass("fl-lightbox-resizable"),i.delegate(".fl-lightbox-resize-toggle","click",this._resizeClicked.bind(this)),i.draggable({cursor:"move",handle:".fl-lightbox-header"}).resizable({handles:"all",minHeight:500,minWidth:380,start:this._resizeStart.bind(this),stop:this._resizeStop.bind(this)}),l.length&&l.hasClass("fl-lightbox-width-full")?(i.addClass("fl-lightbox-width-full"),i.draggable("disable")):this._restorePosition()):t.show(),this._resize()},_delayedResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._resize.bind(this),250)},_resize:function(){var t=this._node.find(".fl-lightbox"),i=parseInt(this._node.css("padding-top")),l=parseInt(this._node.css("padding-bottom")),o=parseInt(this._node.css("padding-left")),s=parseInt(this._node.css("padding-right")),n=t.height(),r=t.width(),a=e(window),d=a.height()-i-l,u=(a.width()-o-s,"0px");this._defaults.resizable?(r<600?t.addClass("fl-lightbox-width-slim"):t.removeClass("fl-lightbox-width-slim"),this._resizeEditors()):(d>n&&(u=(d-n-46)/2+"px"),t.attr("style","").css("margin",u+" auto 0")),this.trigger("resized")},_resizeStart:function(){e("body").addClass("fl-builder-resizable-is-resizing"),e(".fl-builder-lightbox:visible").append('<div class="fl-builder-resizable-iframe-fix"></div>'),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()},_resizeStop:function(t,i){var l=e(".fl-lightbox-resizable:visible");parseInt(l.css("top"))<0&&l.css("top","0"),this._savePosition(),e("body").removeClass("fl-builder-resizable-is-resizing"),e(".fl-builder-resizable-iframe-fix").remove(),FLBuilder._bindOverlayEvents()},_resizeClicked:function(){var t=e(".fl-lightbox-resizable"),i=(t.find(".fl-lightbox-resize-toggle"),this._node.find(".fl-lightbox"));i.hasClass("fl-lightbox-width-full")?this._resizeExitFull():this._resizeEnterFull(),this._resize()},_resizeEnterFull:function(){var t=e(".fl-lightbox-resizable"),i=t.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");i.removeClass("fa-window-maximize").addClass("fa-window-minimize"),t.addClass("fl-lightbox-width-full"),t.draggable("disable"),t.resizable("disable")},_resizeExitFull:function(){var t=e(".fl-lightbox-resizable"),i=t.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");i.removeClass("fa-window-minimize").addClass("fa-window-maximize"),t.removeClass("fl-lightbox-width-full"),t.draggable("enable"),t.resizable("enable")},_resizeEditors:function(){e(".fl-lightbox-resizable").each(function(){var t=e(this),i=t.find(".fl-builder-settings-fields").height(),l=t.find(".mce-edit-area > iframe, textarea.wp-editor-area, .ace_editor"),o=null;i<350&&(i=350),l.each(function(){o=e(this),o.hasClass("ace_editor")?(o.height(i-60),o.closest(".fl-field").data("editor").resize()):o.closest(".mce-container-body").find(".mce-toolbar-grp .mce-toolbar.mce-last").is(":visible")?o.height(i-175):o.height(i-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 t=FLBuilderConfig.userSettings.lightbox;if(!t)return!1;var i=e(window).height(),l=parseInt(t.height);return l>i&&i>546&&(t.height=i-50,
|
2 |
-
t.top=0),t}}}(jQuery),function(e){FLIconSelector={_content:null,_lightbox:null,_rendered:!1,_filterText:"",open:function(e){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(),FLIconSelector._lightbox.on("icon-selected",function(t,i){FLIconSelector._lightbox.off("icon-selected"),FLIconSelector._lightbox.close(),e(i)})},_render:function(){FLIconSelector._lightbox=new FLLightbox({className:"fl-icon-selector"}),FLIconSelector._rendered=!0,FLBuilder.addHook("endEditingSession",function(){FLIconSelector._lightbox.close()})},_getContentComplete:function(t){var i=JSON.parse(t);FLIconSelector._content=i.html,FLIconSelector._lightbox.setContent(i.html),e(".fl-icons-filter-select").on("change",FLIconSelector._filter),e(".fl-icons-filter-text").on("keyup",FLIconSelector._filter),e(".fl-icons-list i").on("click",FLIconSelector._select),e(".fl-icon-selector-cancel").on("click",e.proxy(FLIconSelector._lightbox.close,FLIconSelector._lightbox))},_filter:function(){var t=e(".fl-icons-filter-select").val(),i=e(".fl-icons-filter-text").val();"all"==t?e(".fl-icons-section").show():(e(".fl-icons-section").hide(),e(".fl-"+t).show()),FLIconSelector._filterText=i,""!==i?e(".fl-icons-list i").each(FLIconSelector._filterIcon):e(".fl-icons-list i").show()},_filterIcon:function(){var t=e(this);-1==t.attr("class").indexOf(FLIconSelector._filterText)?t.hide():t.show()},_select:function(){var t=e(this).attr("class");FLIconSelector._lightbox.trigger("icon-selected",t)}}}(jQuery),function(e){FLStyleSheet=function(t){"object"==typeof t&&e.extend(this,t),this._createSheet()},FLStyleSheet.prototype={id:null,_sheet:null,_sheetElement:null,updateRule:function(e,t,i){for(var l=this._sheet.cssRules?this._sheet.cssRules:this._sheet.rules,o=null,s=0;s<l.length;s++)l[s].selectorText.toLowerCase()==e.toLowerCase()&&(o=l[s]);if(o)if("object"==typeof t)for(s in t)o.style[this._toCamelCase(s)]=t[s];else o.style[this._toCamelCase(t)]=i;else this.addRule(e,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 t=this.id?' id="'+this.id+'"':"",i=this.className?' class="'+this.className+'"':"";this._sheet||(this._sheetElement=e('<style type="text/css"'+t+i+"></style>"),e("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(e){FLBuilder={preview:null,_actionsLightbox:null,_addModuleAfterNodeRender:null,_colResizeData:null,_colResizing:!1,_contentClass:!1,_dragEnabled:!1,_dragging:!1,_dragInitialScrollTop:0,_exitUrl:null,_layout:null,_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,_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._initTipTips(),FLBuilder._initTinyMCE(),FLBuilder._bindEvents(),FLBuilder._bindOverlayEvents(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder.addHook("didInitUI",FLBuilder._showTourOrTemplates.bind(FLBuilder)),FLBuilder.triggerHook("init")},_initJQueryReadyFix:function(){FLBuilderConfig.debug||(jQuery.fn.oldReady=jQuery.fn.ready,jQuery.fn.ready=function(t){return jQuery.fn.oldReady(function(){try{"function"==typeof t&&t(e)}catch(i){FLBuilder.logError(i)}})})},_initGlobalErrorHandling:function(){FLBuilderConfig.debug||(window.onerror=function(e,t,i,l,o){return FLBuilder.logGlobalError(e,t,i,l,o),!0})},_initPostLock:function(){"undefined"!=typeof wp.heartbeat&&(wp.heartbeat.interval(30),wp.heartbeat.enqueue("fl_builder_post_lock",{post_id:FLBuilderConfig.postId}))},_initClassNames:function(){e("html").addClass("fl-builder-edit"),e("body").addClass("fl-builder"),FLBuilderConfig.simpleUi&&e("body").addClass("fl-builder-simple"),FLBuilder._contentClass=".fl-builder-content-"+FLBuilderConfig.postId,e(FLBuilder._contentClass).addClass("fl-builder-content-editing")},_initMediaUploader:function(){wp.media.model.settings.post.id=FLBuilderConfig.postId},_initOverflowFix:function(){e(FLBuilder._contentClass).parents().css("overflow","visible")},_initScrollbars:function(){e(".fl-nanoscroller").nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"})},_initSortables:function(){var t={appendTo:"body",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"},i="",l="",o="";o="row"==FLBuilderConfig.userTemplateType||"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-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-col:not(.fl-node-global) .fl-col-content",l="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target",i=FLBuilderConfig.nestedColumns?o:"row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target",e(".fl-builder-rows").sortable(e.extend({},t,{connectWith:i,items:".fl-builder-block-row",stop:FLBuilder._rowDragStop})),e(".fl-builder-row-templates").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-row-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-rows").sortable(e.extend({},t,{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})),e(".fl-builder-saved-columns").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:l,items:".fl-builder-block-saved-column",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-modules, .fl-builder-widgets").sortable(e.extend({},t,{connectWith:o,items:".fl-builder-block-module",stop:FLBuilder._moduleDragStop})),e(".fl-builder-module-templates").sortable(e.extend({},t,{connectWith:o,items:".fl-builder-block-module-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-modules").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:o,items:".fl-builder-block-saved-module",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-row-sortable-proxy").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",helper:FLBuilder._rowDragHelper,start:FLBuilder._rowDragStart,stop:FLBuilder._rowDragStop})),e(".fl-col-sortable-proxy").sortable(e.extend({},t,{connectWith:o,helper:FLBuilder._colDragHelper,start:FLBuilder._colDragStart,stop:FLBuilder._colDragStop})),e(FLBuilder._contentClass+" .fl-col-content").sortable(e.extend({},t,{connectWith:o,handle:".fl-module-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._moduleDragHelper,items:".fl-module, .fl-col-group",start:FLBuilder._moduleDragStart,stop:FLBuilder._moduleDragStop})),e(FLBuilder._contentClass+" .fl-row-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-group-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-drop-target").sortable(t)},_initStrings:function(){e.validator.messages.required=FLBuilderStrings.validateRequiredMessage},_bindEvents:function(){$excludedLinks=e(".fl-builder-bar a, .fl-builder--content-library-panel a, .fl-page-nav .nav a"),e("a").not($excludedLinks).on("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),e("body").delegate(".fl-builder-content a","click",FLBuilder._preventDefault),e("body").delegate("button.fl-builder-button","mouseup",this._buttonMouseUp.bind(this)),e(document).on("heartbeat-tick",FLBuilder._initPostLock),e(window).on("beforeunload",FLBuilder._warnBeforeUnload),e("body").delegate(".fl-builder-has-submenu","click",FLBuilder._submenuParentClicked),e("body").delegate(".fl-builder-has-submenu a","click",FLBuilder._submenuChildClicked),e("body").delegate(".fl-builder-submenu","mouseenter",FLBuilder._submenuMouseenter),e("body").delegate(".fl-builder-submenu","mouseleave",FLBuilder._submenuMouseleave),e("body").delegate(".fl-builder-submenu .fl-builder-has-submenu","mouseenter",FLBuilder._submenuNestedParentMouseenter),e(".fl-builder-panel-actions .fl-builder-panel-close").on("click",FLBuilder._closePanel),e(".fl-builder-blocks-section-title").on("click",FLBuilder._blockSectionTitleClicked),e("body").delegate(".fl-builder-node-template-actions","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-delete","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","click",FLBuilder._editNodeTemplateClicked),e("body").delegate(".fl-builder-node-template-delete","click",FLBuilder._deleteNodeTemplateClicked),e("body").delegate(".fl-builder-block","mousedown",FLBuilder._blockDragInit),e("body").on("mouseup",FLBuilder._blockDragCancel),e("body").delegate(".fl-builder-actions .fl-builder-cancel-button","click",FLBuilder._cancelButtonClicked),e("body").delegate(".fl-builder-save-user-template-button","click",FLBuilder._saveUserTemplateClicked),e("body").delegate(".fl-builder-duplicate-layout-button","click",FLBuilder._duplicateLayoutClicked),e("body").delegate(".fl-builder-layout-settings-button","click",FLBuilder._layoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-save","click",FLBuilder._saveLayoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-builder-global-settings-button","click",FLBuilder._globalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-save","click",FLBuilder._saveGlobalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-user-template","click",FLBuilder._userTemplateClicked),e("body").delegate(".fl-user-template-edit","click",FLBuilder._editUserTemplateClicked),e("body").delegate(".fl-user-template-delete","click",FLBuilder._deleteUserTemplateClicked),e("body").delegate(".fl-builder-template-replace-button","click",FLBuilder._templateReplaceClicked),e("body").delegate(".fl-builder-template-append-button","click",FLBuilder._templateAppendClicked),e("body").delegate(".fl-builder-template-actions .fl-builder-cancel-button","click",FLBuilder._templateCancelClicked),e("body").delegate(".fl-builder-user-template-settings .fl-builder-settings-save","click",FLBuilder._saveUserTemplateSettings),e("body").delegate(".fl-builder-help-tour-button","click",FLBuilder._startHelpTour),e("body").delegate(".fl-builder-knowledge-base-button","click",FLBuilder._viewKnowledgeBaseClicked),e("body").delegate(".fl-builder-forums-button","click",FLBuilder._visitForumsClicked),e("body").delegate(".fl-builder-no-tour-button","click",FLBuilder._noTourButtonClicked),e("body").delegate(".fl-builder-yes-tour-button","click",FLBuilder._yesTourButtonClicked),e("body").delegate(".fl-builder-alert-close","click",FLBuilder._alertClose),e("body").delegate(".fl-block-overlay","contextmenu",FLBuilder._onContextmenu),e("body").delegate(".fl-row-overlay .fl-block-remove","click",FLBuilder._deleteRowClicked),e("body").delegate(".fl-row-overlay .fl-block-copy","click",FLBuilder._rowCopyClicked),e("body").delegate(".fl-row-overlay .fl-block-move","mousedown",FLBuilder._rowDragInit),e("body").delegate(".fl-row-overlay .fl-block-settings","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-row-overlay","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-builder-row-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-block-col-submenu .fl-block-row-reset","click",FLBuilder._resetRowWidthClicked),e("body").delegate(".fl-col-overlay .fl-block-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-copy","click",FLBuilder._copyColClicked),e("body").delegate(".fl-col-overlay .fl-block-remove","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-col-overlay .fl-block-settings","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-col-overlay","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-col-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-block-col-submenu .fl-block-col-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-delete","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-reset","click",FLBuilder._resetColumnWidthsClicked),e("body").delegate(".fl-block-col-submenu li","mouseenter",FLBuilder._showColHighlightGuide),e("body").delegate(".fl-block-col-submenu li","mouseleave",FLBuilder._removeColHighlightGuides),e("body").delegate(".fl-block-col-submenu .fl-block-col-move-parent","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit-parent","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-module-overlay .fl-block-remove","click",FLBuilder._deleteModuleClicked),e("body").delegate(".fl-module-overlay .fl-block-copy","click",FLBuilder._moduleCopyClicked),e("body").delegate(".fl-module-overlay .fl-block-move","mousedown",FLBuilder._blockDragInit),e("body").delegate(".fl-module-overlay .fl-block-settings","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-module-overlay","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-builder-module-settings .fl-builder-settings-save","click",FLBuilder._saveModuleClicked),e("body").delegate(".fl-module-overlay .fl-block-col-settings","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-settings-save-as","click",FLBuilder._showNodeTemplateSettings),e("body").delegate(".fl-builder-node-template-settings .fl-builder-settings-save","click",FLBuilder._saveNodeTemplate),e("body").delegate(".fl-builder-settings-tabs a","click",FLBuilder._settingsTabClicked),e("body").delegate(".fl-builder-settings-tabs a","show",FLBuilder._calculateSettingsTabsOverflow),e("body").delegate(".fl-builder-settings-tabs a","hide",FLBuilder._calculateSettingsTabsOverflow),e("body").delegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked),e("body").delegate(".fl-builder-settings-tabs-overflow-menu > a","click",FLBuilder._settingsTabsToOverflowMenuItemClicked.bind(this)),e("body").delegate(".fl-builder-settings-tabs-more","click",FLBuilder._toggleTabsOverflowMenu.bind(this)),e("body").delegate(".fl-builder-settings-tabs-overflow-click-mask","click",FLBuilder._hideTabsOverflowMenu.bind(this)),e("body").delegate(".fl-help-tooltip-icon","mouseover",FLBuilder._showHelpTooltip),e("body").delegate(".fl-help-tooltip-icon","mouseout",FLBuilder._hideHelpTooltip),e("body").delegate(".fl-builder-field-add","click",FLBuilder._addFieldClicked),e("body").delegate(".fl-builder-field-copy","click",FLBuilder._copyFieldClicked),e("body").delegate(".fl-builder-field-delete","click",FLBuilder._deleteFieldClicked),e("body").delegate(".fl-builder-settings-fields select","change",FLBuilder._settingsSelectChanged),e("body").delegate(".fl-photo-field .fl-photo-select","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-edit","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-replace","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-remove","click",FLBuilder._singlePhotoRemoved),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-select","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-edit","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-add","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-video-field .fl-video-select","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-video-field .fl-video-replace","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-video-field .fl-video-remove","click",FLBuilder._singleVideoRemoved),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-select","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-edit","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-add","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-icon-field .fl-icon-select","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-replace","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-remove","click",FLBuilder._removeIcon),e("body").delegate(".fl-form-field .fl-form-field-edit","click",FLBuilder._formFieldClicked),e("body").delegate(".fl-form-field-settings .fl-builder-settings-save","click",FLBuilder._saveFormFieldClicked),e("body").delegate(".fl-layout-field-option","click",FLBuilder._layoutFieldClicked),e("body").delegate(".fl-link-field-select","click",FLBuilder._linkFieldSelectClicked),e("body").delegate(".fl-link-field-search-cancel","click",FLBuilder._linkFieldSelectCancelClicked),e("body").delegate(".fl-loop-data-source-select select[name=data_source]","change",FLBuilder._loopDataSourceChange),e("body").delegate(".fl-custom-query select[name=post_type]","change",FLBuilder._customQueryPostTypeChange),e("body").delegate(".fl-field input[type=number]","focus",FLBuilder._onNumberFieldFocus),e("body").delegate(".fl-field input[type=number]","blur",FLBuilder._onNumberFieldBlur),FLBuilder.addHook("didCompleteAJAX",FLBuilder._refreshSettingsPreviewReference),FLBuilder.addHook("didRenderLayoutComplete",FLBuilder._refreshSettingsPreviewReference)},_unbindEvents:function(){e("a").off("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").off("click",FLBuilder._headerLinkClicked),e("body").undelegate(".fl-builder-content a","click",FLBuilder._preventDefault)},_bindOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.delegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.delegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.delegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.delegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.delegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_destroyOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.undelegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.undelegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.undelegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.undelegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.undelegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_onContextmenu:function(t){e(this).hide()},_preventDefault:function(e){e.preventDefault()},_stopPropagation:function(e){e.stopPropagation()},_headerLinkClicked:function(t){var i=e(this),l=i.attr("href");this.hash||(t.preventDefault(),FLBuilderConfig.isUserTemplate||(FLBuilder._exitUrl=l.indexOf("?")>-1?l:l+"?fl_builder",FLBuilder.triggerHook("triggerDone")))},_warnBeforeUnload:function(){var t=e(".fl-builder-row-settings").length>0,i=e(".fl-builder-col-settings").length>0,l=e(".fl-builder-module-settings").length>0;if(t||i||l)return FLBuilderStrings.unloadWarning},_initTipTips:function(){e(".fl-tip:not(.fl-has-tip)").each(function(){var t=e(this);t.addClass("fl-has-tip"),void 0==t.attr("data-title")&&t.attr("data-title",t.attr("title"))}).tipTip({defaultPosition:"top",delay:1e3})},_hideTipTips:function(){e("#tiptip_holder").stop().hide()},_submenuParentClicked:function(t){var i=e("body"),l=e(this),o=l.find(".fl-builder-submenu");l.hasClass("fl-builder-submenu-open")?(i.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-right")):(l.offset().left+o.width()>e(window).width()&&l.addClass("fl-builder-submenu-right"),i.addClass("fl-builder-submenu-open"),l.addClass("fl-builder-submenu-open")),o.closest(".fl-row-overlay").addClass("fl-row-menu-active"),FLBuilder._hideTipTips(),t.preventDefault(),t.stopPropagation()},_submenuChildClicked:function(t){var i=e("body"),l=e(this).parents(".fl-builder-has-submenu");l.parents(".fl-builder-has-submenu").length||(i.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-open"))},_submenuMouseenter:function(t){var i=e(this),l=i.data("timeout");"undefined"!=typeof l&&clearTimeout(l)},_submenuMouseleave:function(t){var i=e("body"),l=e(this),o=setTimeout(function(){i.removeClass("fl-builder-submenu-open"),l.closest(".fl-builder-has-submenu").removeClass("fl-builder-submenu-open")},500);l.closest(".fl-row-overlay").removeClass("fl-row-menu-active"),l.data("timeout",o)},_submenuNestedParentMouseenter:function(t){var i=e(this),l=i.find(".fl-builder-submenu");i.width()+i.offset().left+l.width()>e(window).width()&&i.addClass("fl-builder-submenu-right")},_closeAllSubmenus:function(){e(".fl-builder-submenu-open").removeClass("fl-builder-submenu-open")},_upgradeClicked:function(){window.open(FLBuilderConfig.upgradeUrl)},_buttonMouseUp:function(t){e(t.currentTarget).blur()},_closePanel:function(){FLBuilder.triggerHook("hideContentPanel")},_showPanel:function(){FLBuilder.triggerHook("showContentPanel")},_togglePanel:function(){FLBuilder.triggerHook("toggleContentPanel")},_blockSectionTitleClicked:function(){var t=e(this),i=t.parent();i.hasClass("fl-active")?i.removeClass("fl-active"):(e(".fl-builder-blocks-section").removeClass("fl-active"),i.addClass("fl-active")),FLBuilder._initScrollbars()},_publishLayout:function(e){if(FLBuilder._triggerSettingsSave(!1,!0)){if(_.isUndefined(e))var e=!0;FLBuilder.ajax({action:"save_layout"},this._onPublishComplete.bind(this,e))}},_publishButtonClicked:function(e){FLBuilder._publishLayout(e)},_onPublishComplete:function(t){t&&(FLBuilderConfig.shouldRefreshOnPublish?FLBuilder._exit():FLBuilder._exitWithoutRefresh()),e("#wp-admin-bar-fl-builder-frontend-edit-link .fl-builder-admin-bar-status-dot").css("color","#6bc373"),FLBuilder.triggerHook("didPublishLayout")},_draftButtonClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_draft"},FLBuilder._exit)},_discardButtonClicked:function(){var e=confirm(FLBuilderStrings.discardMessage);e?(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"clear_draft_layout"},FLBuilder._exit)):FLBuilder.triggerHook("didCancelDiscard")},_cancelButtonClicked:function(){FLBuilder._exitUrl=null,FLBuilder._actionsLightbox.close()},_exit:function(){var e=window.location.href;FLBuilderConfig.isUserTemplate&&"undefined"!=typeof window.opener&&window.opener?("undefined"!=typeof window.opener.FLBuilder&&("undefined"==typeof FLBuilderGlobalNodeId?window.opener.FLBuilder._updateLayout():window.opener.FLBuilder._updateNode(FLBuilderGlobalNodeId)),window.close()):(FLBuilder._exitUrl?e=FLBuilder._exitUrl:(e=e.replace("?fl_builder&","?"),e=e.replace("?fl_builder",""),e=e.replace("&fl_builder","")),window.location.href=e)},_exitWithoutRefresh:function(){window.location.href;FLBuilderConfig.isUserTemplate&&"undefined"!=typeof window.opener&&window.opener?("undefined"!=typeof window.opener.FLBuilder&&("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 t=e(".fl-builder-settings #fl-field-css textarea:not(.ace_text-input)");t.on("change",FLBuilder._layoutSettingsCSSChanged),FLBuilder._layoutSettingsCSSCache=t.val()},_layoutSettingsCSSChanged:function(){FLBuilder._layoutSettingsCSSTimeout&&clearTimeout(FLBuilder._layoutSettingsCSSTimeout),FLBuilder._layoutSettingsCSSTimeout=setTimeout(e.proxy(FLBuilder._layoutSettingsCSSDoChange,this),600)},_layoutSettingsCSSDoChange:function(){var t=e(".fl-builder-settings"),i=e(this),l=i.parents("#fl-field-css");l.find(".ace_error").length>0||(t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(i.val()):e("#fl-builder-global-css").html(i.val()),FLBuilder._layoutSettingsCSSTimeout=null)},_saveLayoutSettingsClicked:function(){for(var t=e(this).closest(".fl-builder-settings"),i=t.serializeArray(),l={},o=0;o<i.length;o++)l[i[o].name]=i[o].value;FLBuilder.showAjaxLoader(),FLBuilder._lightbox.close(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_layout_settings",settings:l},function(){FLBuilder.triggerHook("didSaveLayoutSettingsComplete",l),FLBuilder._updateLayout()})},_cancelLayoutSettingsClicked:function(){var t=e(".fl-builder-settings");t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(FLBuilder._layoutSettingsCSSCache):e("#fl-builder-global-css").html(FLBuilder._layoutSettingsCSSCache),FLBuilder._layoutSettingsCSSCache=null},_globalSettingsClicked:function(){FLBuilderSettingsForms.render({id:"global",className:"fl-builder-global-settings",settings:FLBuilderSettingsConfig.settings.global},function(){FLBuilder._layoutSettingsInitCSS()})},_saveGlobalSettingsClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=t.validate().form(),l=FLBuilder._getSettings(t);i&&(FLBuilder.showAjaxLoader(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_global_settings",settings:l},FLBuilder._saveGlobalSettingsComplete),FLBuilder._lightbox.close())},_saveGlobalSettingsComplete:function(e){FLBuilderConfig.global=JSON.parse(e),FLBuilder.triggerHook("didSaveGlobalSettingsComplete",FLBuilderConfig.global),FLBuilder._updateLayout()},_initTemplateSelector:function(){var t=e(FLBuilder._contentClass).find(".fl-row"),i=t.length>0;i||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="undefined"!=typeof t&&t?"1":"0",i="undefined"==typeof i?"core":i,FLBuilder._lightbox.close(),FLBuilder.showAjaxLoader(),"core"==i?FLBuilder.ajax({action:"apply_template",template_id:e,append:t},FLBuilder._applyTemplateComplete):FLBuilder.ajax({action:"apply_user_template",template_id:e,append:t},FLBuilder._applyUserTemplateComplete),FLBuilder.triggerHook("didApplyTemplate")},_applyTemplateComplete:function(e){var t=JSON.parse(e);FLBuilder._renderLayout(t.layout),FLBuilder.triggerHook("didApplyTemplateComplete",t.config)},_applyUserTemplateComplete:function(t){var i=JSON.parse(t);null!==i.layout_css&&e("#fl-builder-layout-css").html(i.layout_css),FLBuilder._renderLayout(i.layout),FLBuilder.triggerHook("didApplyTemplateComplete",i.config)},_saveUserTemplateClicked:function(){FLBuilderSettingsForms.render({id:"user_template",className:"fl-builder-user-template-settings",rules:{name:{required:!0}}})},_saveUserTemplateSettings:function(){var t=e(this).closest(".fl-builder-settings"),i=t.validate().form(),l=FLBuilder._getSettings(t);i&&(FLBuilder.ajax({action:"save_user_template",settings:l},FLBuilder._saveUserTemplateSettingsComplete),FLBuilder._lightbox.close())},_saveUserTemplateSettingsComplete:function(e){if(e){var e=JSON.parse(e);FLBuilderConfig.contentItems.template.push(e),FLBuilder.triggerHook("contentItemsChanged")}},_userTemplateClicked:function(){var t=e(this).attr("data-id");e(FLBuilder._contentClass).children(".fl-row").length>0?"blank"==t?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate("blank",!1,"user")):(FLBuilder._selectedTemplateId=t,FLBuilder._selectedTemplateType="user",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(t,!1,"user")},_editUserTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteUserTemplateClicked:function(t){var i=e(this).closest(".fl-user-template"),l=i.attr("data-id"),o=(e(".fl-user-template[data-id="+l+"]"),null),s=null,n=null;if(confirm(FLBuilderStrings.deleteTemplate)){
|
3 |
-
FLBuilder.ajax({action:"delete_user_template",template_id:l});for(s in FLBuilderConfig.contentItems.template)n=FLBuilderConfig.contentItems.template[s],n.postId==l&&(o=s);_.isNull(o)||(FLBuilderConfig.contentItems.template.splice(o,1),FLBuilder.triggerHook("contentItemsChanged"))}t.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())},_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 t=e(FLBuilder._contentClass);FLBuilderConfig.isUserTemplate&&"module"==FLBuilderConfig.userTemplateType||FLBuilderConfig.isUserTemplate&&"column"==FLBuilderConfig.userTemplateType||(t.removeClass("fl-builder-empty"),t.find(".fl-builder-empty-message").remove(),t.find(".fl-row, .fl-builder-block").length||(t.addClass("fl-builder-empty"),t.append('<span class="fl-builder-empty-message">'+FLBuilderStrings.emptyMessage+"</span>"),FLBuilder._initSortables()))},_updateNode:function(t,i){e(".fl-node-"+t).length&&(FLBuilder._showNodeLoading(t),FLBuilder.ajax({action:"render_node",node_id:t},function(e){FLBuilder._renderLayout(JSON.parse(e),i)}.bind(this)))},_updateLayout:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"render_layout"},FLBuilder._renderLayout)},_renderLayout:function(e,t){FLBuilder._layout=new FLBuilderAJAXLayout(e,t)},_renderLayoutComplete:function(){FLBuilder._layout&&(FLBuilder._layout._complete(),FLBuilder._layout=null)},_resizeLayout:function(){e(window).trigger("resize"),"undefined"!=typeof YUI&&YUI().use("node-event-simulate",function(e){e.one(window).simulate("resize")})},layoutHasContent:function(){return e(FLBuilder._contentClass).children(".fl-row").length>0},_initMediaElements:function(){var t={};"undefined"!=typeof e.fn.mediaelementplayer&&("undefined"!=typeof _wpmejsSettings&&(t.pluginPath=_wpmejsSettings.pluginPath),e(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").mediaelementplayer(t))},_initDropTargets:function(){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",l=e(FLBuilder._contentClass+" .fl-row"),o=null,s=e(FLBuilder._contentClass+" .fl-row"+t).find(".fl-col-group"),n=null,r=null,a="column"==FLBuilderConfig.userTemplateType?e(FLBuilder._contentClass+"> .fl-col").eq(0):null;for(i=0,e(".fl-col-drop-target").remove(),e(".fl-col-group-drop-target").remove(),e(".fl-row-drop-target").remove(),e(FLBuilder._contentClass).append('<div class="fl-drop-target fl-row-drop-target"></div>'),l.prepend('<div class="fl-drop-target fl-row-drop-target"></div>'),l.append('<div class="fl-drop-target fl-drop-target-last fl-row-drop-target fl-row-drop-target-last"></div>');i<l.length;i++)o=l.eq(i),0===o.find(".fl-col-group").length&&o.find(".fl-row-content").prepend('<div class="fl-drop-target fl-col-group-drop-target"></div>');for(a&&0===s.length&&(s=a.find(".fl-col-group"),a.append('<div class="fl-drop-target fl-col-drop-target"></div>'),a.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')),i=0;i<s.length;i++)n=s.eq(i),r=n.find("> .fl-col"),n.hasClass("fl-col-group-nested")||(n.append('<div class="fl-drop-target fl-col-group-drop-target"></div>'),n.append('<div class="fl-drop-target fl-drop-target-last fl-col-group-drop-target fl-col-group-drop-target-last"></div>')),r.append('<div class="fl-drop-target fl-col-drop-target"></div>'),r.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(t){var i=e(t.currentTarget),l=null,o=e(window).scrollTop(),s=0;FLBuilder._dragEnabled=!0,FLBuilder._dragInitialScrollTop=o,i.closest("[data-node]").length>0?(l=i.closest("[data-node]"),l.addClass("fl-node-drag-init")):i.hasClass("fl-builder-block")&&e(".fl-row").each(function(){null===l&&e(this).offset().top-o>0&&(l=e(this))}),null!==l&&(s=l.offset().top-o),FLBuilder._highlightRowsAndColsForDrag(i),FLBuilder._adjustColHeightsForDrag(),FLBuilder._disableGlobalRows(),FLBuilder._disableGlobalCols(),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays(),FLBuilder._initSortables(),e("body").addClass("fl-builder-dragging"),e(".fl-builder-empty-message").hide(),e(".fl-sortable-disabled").removeClass("fl-sortable-disabled"),s>0&&scrollTo(0,l.offset().top-s),FLBuilder.triggerHook("didInitDrag")},_blockDragStart:function(t,i){FLBuilder._dragging=!0,e(".fl-node-drag-init").removeClass("fl-node-drag-init"),FLBuilder.triggerHook("didStartDrag")},_blockDragSort:function(t,i){var l=i.placeholder.parent(),o=FLBuilderStrings.insert;FLBuilder._blockPreventSort(i.item,l)||(l.hasClass("fl-col-content")?o=i.item.hasClass("fl-builder-block-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-col-sortable-proxy-item")?FLBuilderStrings.column:i.item.hasClass("fl-builder-block-module")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-module")||i.item.hasClass("fl-builder-block-module-template")?i.item.find(".fl-builder-block-title").text():i.item.attr("data-name"):l.hasClass("fl-col-drop-target")?o="":l.hasClass("fl-col-group-drop-target")?o="":l.hasClass("fl-row-drop-target")&&(o=i.item.hasClass("fl-builder-block-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-column")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-row-sortable-proxy-item")?FLBuilderStrings.row:FLBuilderStrings.newRow),i.placeholder.html(o),i.item.hasClass("fl-node-global")||i.item.hasClass("fl-builder-block-global")||e(".fl-node-dragging").hasClass("fl-node-global")?i.placeholder.addClass("fl-builder-drop-zone-global"):i.placeholder.removeClass("fl-builder-drop-zone-global"))},_blockDragChange:function(e,t){t.placeholder.css("opacity","0"),t.placeholder.animate({opacity:"1"},100)},_blockPreventSort:function(t,i){var l=!1,o=t.hasClass("fl-builder-block-row"),s=t.hasClass("fl-col-sortable-proxy-item"),n=i.hasClass("fl-col-content"),r=i.hasClass("fl-col-drop-target"),a=i.parents(".fl-col-group:not(.fl-col-group-nested)"),d=i.parents(".fl-col-group-nested");return(o||s)&&n&&d.length>0&&(l=!0),n&&!i.find(".fl-module, .fl-col").length&&(o&&"1-col"==t.data("cols")?l=!0:s&&(l=!0)),o&&n&&e.inArray(t.data("cols"),["5-cols","6-cols"])>-1&&(l=!0),s&&e(".fl-node-dragging").find(".fl-col-group-nested").length>0&&(n||r&&d.length>0)&&(l=!0),r&&a.length>0&&0===d.length&&a.find("> .fl-col:visible").length>11&&(l=!0),r&&d.length>0&&d.find(".fl-col:visible").length>3&&(l=!0),l&&i.addClass("fl-sortable-disabled"),l},_blockDragStop:function(t,i){var l=e(window).scrollTop(),o=i.item.parent(),s=null;o.hasClass("fl-drop-target")&&o.closest("[data-node]").length?(o=o.closest("[data-node]"),s=o.offset().top-l):s=o.offset().top-l,o.hasClass("fl-builder-blocks-section-content")&&FLBuilder._showPanel(),FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._enableGlobalCols(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),scrollTo(0,o.offset().top-s),FLBuilder.triggerHook("didStopDrag")},_blockDragCancel:function(){FLBuilder._dragEnabled&&!FLBuilder._dragging&&(FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),e(".fl-node-drag-init").removeClass("fl-node-drag-init"),e(".fl-node-dragging").removeClass("fl-node-dragging"),scrollTo(0,FLBuilder._dragInitialScrollTop))},_reorderNode:function(e,t){FLBuilder.ajax({action:"reorder_node",node_id:e,position:t})},_moveNode:function(e,t,i){FLBuilder.ajax({action:"move_node",new_parent:e,node_id:t,position:i})},_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"),s=o?e.find("> .fl-row-content-wrap"):e.find("> .fl-node-content"),n={top:parseInt(s.css("margin-top"),10),bottom:parseInt(s.css("margin-bottom"),10)};return e.append(t),e.addClass("fl-block-overlay-active"),FLBuilder._initTipTips(),l=e.find("> .fl-block-overlay"),n.top<0&&(i=parseInt(l.css("top"),10),i=isNaN(i)?0:i,l.css("top",n.top+i+"px")),n.bottom<0&&(i=parseInt(l.css("bottom"),10),i=isNaN(i)?0:i,l.css("bottom",n.bottom+i+"px")),l},_buildOverlayOverflowMenu:function(e){var t=e.find(".fl-block-overlay-actions"),i=t.data("original"),l=0,o=null,s=0,n=null,r=0,a=[],d=[],u=[],c=wp.template("fl-overlay-overflow-menu");for(void 0!=i&&(t.after(i),t.remove(),t=i),t.data("original",t.clone()),l=Math.floor(t[0].getBoundingClientRect().width)-8,o=t.find(" > i, > span.fl-builder-has-submenu");r<o.length;r++)n=o.eq(r),s+=Math.floor(n[0].getBoundingClientRect().width),s>l?(d.push(n),n.remove()):a.push(n);if(d.length>0){for(a.length>0&&d.unshift(a.pop().remove()),r=0;r<d.length;r++)d[r].is(".fl-builder-has-submenu")?u.push({type:"submenu",label:d[r].find(".fa, .fas, .far").data("title"),submenu:d[r].find(".fl-builder-submenu")[0].outerHTML}):u.push({type:"action",label:d[r].data("title"),className:d[r].removeClass(function(e,t){return t.replace(/fl-block-([^\s]+)/,"")}).attr("class")});t.append(c(u)),FLBuilder._initTipTips()}},_removeRowOverlays:function(){e(".fl-row").removeClass("fl-block-overlay-active"),e(".fl-row-overlay").remove(),e(".fl-module").removeClass("fl-module-adjust-height"),e("body").removeClass("fl-builder-row-resizing"),FLBuilder._closeAllSubmenus()},_disableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-row.fl-node-global").addClass("fl-node-disabled")},_disableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&e(".fl-row:not(.fl-node-global) .fl-col.fl-node-global").addClass("fl-node-disabled")},_enableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-node-disabled").removeClass("fl-node-disabled")},_enableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&e(".fl-node-disabled").removeClass("fl-node-disabled")},_rowMouseenter:function(){var t=e(this),i=t.offset().top,l=null,o=null,s=wp.template("fl-row-overlay");t.closest(".fl-builder-node-loading").length||t.hasClass("fl-block-overlay-active")||(o=FLBuilder._appendOverlay(t,s({global:t.hasClass("fl-node-global"),node:t.attr("data-node")})),t.find(".fl-node-content:visible").each(function(){var t=e(this).offset().top;l=null===l||l>t?t:l}),null!==l&&l<i&&o.css("top",l-i-30+"px"),o.offset().top<43&&o.addClass("fl-row-overlay-header-bottom"),t.find(".fl-module").each(function(){var t=e(this);t.outerHeight(!0)<20&&t.addClass("fl-module-adjust-height")}),FLBuilder._buildOverlayOverflowMenu(o))},_rowMouseleave:function(t){var i=e(t.toElement)||e(t.relatedTarget),l=i.hasClass("fl-row-overlay"),o=i.closest(".fl-row-overlay").length>0,s=i.is("#tiptip_holder"),n=i.closest("#tiptip_holder").length>0;l||o||s||n||FLBuilder._removeRowOverlays()},_rowDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.row+"</div>")},_rowDragInit:function(t){var i=e(t.target),l=e(".fl-row-sortable-proxy-item"),o=i.closest(".fl-row");o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),t.target=l[0],l.trigger(t)},_rowDragStart:function(t,i){var l=e(FLBuilder._contentClass+" .fl-row"),o=e(".fl-node-dragging");1===l.length&&e(FLBuilder._contentClass).addClass("fl-builder-empty"),o.hide(),FLBuilder._blockDragStart(t,i)},_rowDragStop:function(t,i){var l=i.item,o=l.parent(),s=null,n=null,r=0;if(FLBuilder._blockDragStop(t,i),o.hasClass("fl-builder-rows"))return void l.remove();if(o.hasClass("fl-row-sortable-proxy"))return void e(".fl-node-dragging").removeClass("fl-node-dragging").show();if(l.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-col-content")?FLBuilder._addColGroup(l.closest(".fl-col").attr("data-node"),l.attr("data-cols"),o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(l)):o.hasClass("fl-col-drop-target")?FLBuilder._addCols(o.closest(".fl-col"),o.hasClass("fl-col-drop-target-last")?"after":"before",l.attr("data-cols"),o.closest(".fl-col-group-nested").length>0):o.hasClass("fl-col-group-drop-target")?(n=l.closest(".fl-col-group"),r=l.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(n),FLBuilder._addColGroup(l.closest(".fl-row").attr("data-node"),l.attr("data-cols"),o.hasClass("fl-drop-target-last")?r+1:r)):(s=l.closest(".fl-row"),r=s.length?e(FLBuilder._contentClass+" > .fl-row").index(s):0,FLBuilder._addRow(l.attr("data-cols"),o.hasClass("fl-drop-target-last")?r+1:r)),l.remove(),FLBuilder._showPanel(),e(".fl-builder-modules").siblings(".fl-builder-blocks-section-title").eq(0).trigger("click")}else s=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o.parent().hasClass("fl-builder-content")||(o.hasClass("fl-drop-target-last")?o.parent().after(s):o.parent().before(s),FLBuilder._reorderNode(s.attr("data-node"),s.index())),e(".fl-row-sortable-proxy").append(i.item)},_addRow:function(t,i){FLBuilder._showNodeLoadingPlaceholder(e(FLBuilder._contentClass),i),FLBuilder._newRowPosition=i,FLBuilder.ajax({action:"render_new_row",cols:t,position:i},FLBuilder._addRowComplete)},_addRowComplete:function(t){var i="object"==typeof t?t:JSON.parse(t),l=e(FLBuilder._contentClass),o=e(i.html).data("node"),s=FLBuilder._addModuleAfterNodeRender;i.nodeParent=l,i.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(i,function(){null!==s&&(e(".fl-node-"+o+" .fl-col-content").append(s),FLBuilder._reorderModule(s),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+o)),FLBuilder.triggerHook("didAddRow",o)})},_deleteRowClicked:function(t){var i=e(this).closest(".fl-row"),l=null;i.find(".fl-module").length?(l=confirm(FLBuilderStrings.deleteRowMessage),l&&FLBuilder._deleteRow(i)):FLBuilder._deleteRow(i),FLBuilder._removeAllOverlays(),t.stopPropagation()},_deleteRow:function(e){var t=e.attr("data-node");FLBuilder.ajax({action:"delete_node",node_id:t}),e.empty(),e.remove(),FLBuilder._setupEmptyLayout(),FLBuilder._removeRowOverlays(),FLBuilder.triggerHook("didDeleteRow",t)},_rowCopyClicked:function(t){var i=e(this).closest(".fl-row"),l=i.attr("data-node"),o=e(FLBuilder._contentClass+" > .fl-row").index(i)+1,s=i.clone(),n=e(".fl-builder-settings[data-node]"),r=n.attr("data-node"),a=r===l?i:i.find('[data-node="'+r+'"]'),d=null;n.length&&a.length&&(d=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[r]=d),s.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),s.find(".fl-block-overlay").remove(),i.after(s),e("html, body").animate({scrollTop:s.offset().top-75},500),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newRowPosition=o,FLBuilder.ajax({action:"copy_row",node_id:l,settings:d,settings_id:r},function(e){var t=JSON.parse(e);t.duplicatedRow=l,FLBuilder._rowCopyComplete(t)}),t.stopPropagation()},_rowCopyComplete:function(t){t.nodeParent=e(FLBuilder._contentClass),t.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(t,function(){FLBuilder.triggerHook("didDuplicateRow",{newNodeId:t.nodeId,oldNodeId:t.duplicatedRow}),t.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_rowSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-row").attr("data-node"),o=i.closest(".fl-block-overlay-global").length>0,s=null;o&&"row"!=FLBuilderConfig.userTemplateType?FLBuilderConfig.userCanEditGlobalTemplates&&(s=window.open(e('.fl-row[data-node="'+l+'"]').attr("data-template-url")),s.FLBuilderGlobalNodeId=l):i.hasClass("fl-block-settings")&&FLBuilderSettingsForms.render({id:"row",nodeId:l,className:"fl-builder-row-settings",attrs:'data-node="'+l+'"',buttons:o||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:o?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[l],preview:{type:"row"}},function(){e("#fl-field-width select").on("change",FLBuilder._rowWidthChanged),e("#fl-field-content_width select").on("change",FLBuilder._rowWidthChanged)}),t.stopPropagation()},_rowWidthChanged:function(){var t=e("#fl-field-width select").val(),i=e("#fl-field-content_width select").val(),l=e("#fl-field-max_content_width");"fixed"==t||"full"==t&&"fixed"==i?l.show():l.hide()},_resetRowWidthClicked:function(t){var i=e(this),l=i.closest(".fl-row"),o=l.attr("data-node"),s=l.find(".fl-row-content"),n=FLBuilderConfig.global.row_width+"px",r=e(".fl-builder-row-settings");l.hasClass("fl-row-fixed-width")&&l.css("max-width",n),s.css("max-width",n),r.length&&r.find("[name=max_content_width]").val(""),FLBuilder.ajax({action:"resize_row_content",node:o,width:""}),FLBuilder._closeAllSubmenus(),FLBuilder.triggerHook("didResetRowWidth",o),t.stopPropagation()},_highlightEmptyCols:function(){var t="row"==FLBuilderConfig.userTemplateType||"column"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",i=(e(FLBuilder._contentClass+" .fl-row"+t),e(FLBuilder._contentClass+" .fl-col"+t));e(".fl-row-highlight").removeClass("fl-row-highlight"),i.removeClass("fl-col-highlight").find(".fl-col-content").css("height",""),i.each(function(){var t=e(this);0===t.find(".fl-module, .fl-col").length&&t.addClass("fl-col-highlight")})},_removeEmptyColHighlights:function(){e(".fl-row-highlight").removeClass("fl-row-highlight"),e(".fl-col-highlight").removeClass("fl-col-highlight")},_highlightRowsAndColsForDrag:function(t){var i="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)";"column"==FLBuilderConfig.userTemplateType&&(i=":not(:first)"),e(FLBuilder._contentClass+" .fl-row").addClass("fl-row-highlight"),t.closest(".fl-row-overlay").length||e(FLBuilder._contentClass+" .fl-col"+i).addClass("fl-col-highlight")},_adjustColHeightsForDrag:function(){var t="row"==FLBuilderConfig.userTemplateType?"":".fl-row:not(.fl-node-global) ",i="column"==FLBuilderConfig.userTemplateType?"":".fl-col:not(.fl-node-global) ",l=e(FLBuilder._contentClass),o=l.find(t+".fl-col-group:not(.fl-col-group-nested) > "+i+"> .fl-col-content"),s=l.find(t+".fl-col-group-nested "+i+".fl-col-content"),n=0;for(e(".fl-node-drag-init").hide();n<s.length;n++)FLBuilder._adjustColHeightForDrag(s.eq(n));for(n=0;n<o.length;n++)FLBuilder._adjustColHeightForDrag(o.eq(n));e(".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 t=e(this),i=t.find("a"),l=t.closest(".fl-col"),o=l.parents(".fl-col"),s=e('<div class="fl-col-highlight-guide"></div>'),n=null,r=t.closest(".fl-block-overlay").offset().top;(i.hasClass("fl-block-col-move-parent")||i.hasClass("fl-block-col-edit-parent"))&&(l=o),l.hasClass("fl-col-highlight")||(l.find("> .fl-col-content").append(s),l.addClass("fl-col-has-highlight-guide"),n=s.offset().top,n>r&&s.css("top",r-n+4+"px"))},_removeColHighlightGuides:function(){e(".fl-col-has-highlight-guide").removeClass("fl-col-has-highlight-guide"),e(".fl-col-highlight-guide").remove()},_colMouseenter:function(){var t=e(this),i=t.closest(".fl-col-group"),l=i.hasClass("fl-col-group-has-child-loading"),o=t.hasClass("fl-node-global"),s=t.parents(".fl-node-global").length>0,n=t.closest(".fl-col-group").find("> .fl-col").length,r=i.find("> .fl-col").index(t),a=0===r,d=n===r+1,u=t.find(".fl-col").length>0,c=t.find(".fl-module").length>0,h=t.parents(".fl-col"),f=h.closest(".fl-col-group"),g=h.length>0,p="undefined"!=typeof t.data("template-url"),b="column"==FLBuilderConfig.userTemplateType&&!g;numParentCols=g?f.find("> .fl-col").length:0,parentIndex=f.find("> .fl-col").index(h),parentFirst=!!g&&0===parentIndex,parentLast=!!g&&numParentCols===parentIndex+1,contentWidth=t.find("> .fl-col-content").width(),row=t.closest(".fl-row"),rowIsFixedWidth=!!row.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,userCanResizeRows=FLBuilderConfig.rowResize.userCanResizeRows,template=wp.template("fl-col-overlay"),overlay=null,FLBuilderConfig.simpleUi||o&&s&&c&&!p||o&&"column"==FLBuilderConfig.userTemplateType&&c||!o&&t.find(".fl-module").length>0||t.find(".fl-builder-node-loading-placeholder").length>0||!c&&u||s&&u&&!p||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:n,first:a,last:d,isRootCol:b,hasChildCols:u,hasParentCol:g,parentFirst:parentFirst,parentLast:parentLast,numParentCols:numParentCols,contentWidth:contentWidth,rowIsFixedWidth:rowIsFixedWidth,userCanResizeRows:userCanResizeRows})),FLBuilder._buildOverlayOverflowMenu(overlay),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_colMouseleave:function(t){var i=e(this),l=e(t.toElement)||e(t.relatedTarget),o=i.find(".fl-module").length>0,s=(i.hasClass("fl-node-global"),"undefined"!=typeof i.data("template-url")),n=l.is("#tiptip_holder"),r=l.closest("#tiptip_holder").length>0;n||r||o&&!s||(FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._closeAllSubmenus())},_removeColOverlays:function(){var t=e(".fl-col");t.removeClass("fl-block-overlay-active"),t.find(".fl-col-overlay").remove(),e("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_colDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.column+"</div>")},_colDragInit:function(t){var i=e(t.target),l=e(".fl-col-sortable-proxy-item"),o=i.closest(".fl-col");i.hasClass("fl-block-col-move-parent")&&(o=o.parents(".fl-col")),o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),FLBuilder._removeColHighlightGuides(),t.target=l[0],l.trigger(t)},_colDragStart:function(t,i){var l=e(".fl-node-dragging");l.hide(),FLBuilder._resetColumnWidths(l.parent()),FLBuilder._blockDragStart(t,i)},_colDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o=l.attr("data-node"),s=i.item.parent(),n=l.parent(),r=n.attr("data-node");newGroup=s.closest(".fl-col-group"),newGroupId=newGroup.attr("data-node"),newRow=s.closest(".fl-row"),position=0,s.hasClass("fl-sortable-disabled")?FLBuilder._resetColumnWidths(n):s.hasClass("fl-col-sortable-proxy")?FLBuilder._resetColumnWidths(n):s.hasClass("fl-col-content")?(l.remove(),0===n.find(".fl-col").length&&n.remove(),position=s.find("> .fl-module, .fl-col-group, .fl-col-sortable-proxy-item").index(i.item),FLBuilder._addColGroup(s.closest(".fl-col").attr("data-node"),o,position)):s.hasClass("fl-col-drop-target")?(s.hasClass("fl-col-drop-target-last")?s.parent().after(l):s.parent().before(l),FLBuilder._resetColumnWidths(newGroup),r==newGroupId?FLBuilder.ajax({action:"reorder_col",node_id:o,position:l.index()}):FLBuilder.ajax({action:"move_col",node_id:o,new_parent:newGroupId,position:l.index(),resize:[r,newGroupId]}),FLBuilder._resizeLayout()):s.hasClass("fl-col-group-drop-target")?(l.remove(),0===n.find(".fl-col").length&&n.remove(),position=newRow.find(".fl-row-content > .fl-col-group").index(newGroup),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addColGroup(newRow.attr("data-node"),o,position)):s.hasClass("fl-row-drop-target")&&(l.remove(),position=s.closest(".fl-builder-content").find(".fl-row").index(newRow),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addRow(o,position)),0===n.find(".fl-col").length&&n.remove(),e(".fl-col-sortable-proxy").append(i.item),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._closeAllSubmenus()},_colSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-col"),o=l.find("> .fl-col-content"),s=i.parent().find("ul.fl-builder-submenu").length>0,n=i.closest(".fl-block-overlay-global").length>0,r=i.closest(".fl-block-overlay-global").hasClass("fl-col-overlay"),a="column"!=FLBuilderConfig.userTemplateType&&"undefined"!=typeof l.attr("data-template-url"),d=null;FLBuilder._colResizing||n&&!FLBuilderConfig.userCanEditGlobalTemplates||s&&!i.hasClass("fl-col-overlay")||(i.hasClass("fl-block-col-edit-parent")&&(l=l.parents(".fl-col")),d=l.attr("data-node"),n&&r&&a?FLBuilderConfig.userCanEditGlobalTemplates&&(win=window.open(e('.fl-col[data-node="'+d+'"]').attr("data-template-url")),win.FLBuilderGlobalNodeId=d):FLBuilderSettingsForms.render({id:"col",nodeId:d,className:"fl-builder-col-settings",attrs:'data-node="'+d+'"',buttons:n||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:n?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[d],preview:{type:"col"}},function(){0===l.siblings(".fl-col").length?e("#fl-builder-settings-section-general").hide():o.width()<=40&&e("#fl-field-size").hide()}),t.stopPropagation())},_copyColClicked:function(t){var i=e(this).closest(".fl-col"),l=i.attr("data-node"),o=i.clone(),s=i.parent(),n=e(".fl-builder-settings[data-node]"),r=n.attr("data-node"),a=r===l?i:i.find('[data-node="'+r+'"]'),d=null;n.length&&a.length&&(d=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[r]=d),o.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),o.find(".fl-block-overlay").remove(),i.after(o),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newColParent=s,FLBuilder._newColPosition=i.index()+1,FLBuilder._resetColumnWidths(s),FLBuilder.ajax({action:"copy_col",node_id:l,settings:d,settings_id:r},function(e){var t=JSON.parse(e);t.duplicatedColumn=l,FLBuilder._copyColComplete(t)}),t.stopPropagation()},_copyColComplete:function(e){e.nodeParent=FLBuilder._newColParent,e.nodePosition=FLBuilder._newColPosition,FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateColumn",{newNodeId:e.nodeId,oldNodeId:e.duplicatedColumn}),e.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_deleteColClicked:function(t){var i=e(this),l=i.closest(".fl-col"),o=l.closest(".fl-col-group"),s=l.parents(".fl-col"),n=s.length>0,r=s.find("> .fl-col-content > .fl-module, > .fl-col-content > .fl-col-group"),a=l.siblings(".fl-col"),d=!0;l.find(".fl-module").length>0&&(d=confirm(FLBuilderStrings.deleteColumnMessage)),n&&1===r.length&&(0===a.length?l=s:1!==a.length||a.find(".fl-module").length||(l=o)),d&&(FLBuilder._deleteCol(l),FLBuilder._removeAllOverlays(),FLBuilder._highlightEmptyCols()),t.stopPropagation()},_deleteCol:function(e){var t=e.attr("data-node"),i=e.closest(".fl-row"),l=e.closest(".fl-col-group"),o=0;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):(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})),FLBuilder.ajax({action:"delete_col",node_id:t,new_width:o}),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder.triggerHook("didDeleteColumn",t))},_addCols:function(e,t,i,l){var o=e.closest(".fl-col-group"),s=o.find(".fl-col").index(e);i="undefined"==typeof i?"1-col":i,l="undefined"!=typeof l&&l,"after"==t&&s++,FLBuilder._showNodeLoadingPlaceholder(o,s),FLBuilder._removeAllOverlays(),FLBuilder.ajax({action:"render_new_columns",node_id:e.attr("data-node"),insert:t,type:i,nested:l?1:0},FLBuilder._addColsComplete)},_addColsComplete:function(t){var i=JSON.parse(t),l=null,o=FLBuilder._addModuleAfterNodeRender;i.nodeParent=FLBuilder._newColParent,i.nodePosition=FLBuilder._newColPosition,FLBuilder._renderLayout(i,function(){null!==o&&(e('.fl-module[data-node="'+o.module.data("node")+'"]').remove(),l=e('.fl-col[data-node="'+o.colId+'"]'),"after"==o.position?l.next().find(".fl-col-content").append(o.module):l.prev().find(".fl-col-content").append(o.module),FLBuilder._reorderModule(o.module),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+i.nodeId)),FLBuilder.triggerHook("didAddColumn",i.nodeId),FLBuilder.triggerHook("didResetColumnWidths",{cols:e(".fl-node-"+i.nodeId).find("> .fl-col")})})},_addColGroup:function(t,i,l){var o=e(".fl-node-"+t);FLBuilder._newColGroupPosition=l,o.hasClass("fl-col")?FLBuilder._newColGroupParent=o.find(" > .fl-col-content"):FLBuilder._newColGroupParent=o.find(".fl-row-content"),FLBuilder._showNodeLoadingPlaceholder(FLBuilder._newColGroupParent,l),FLBuilder.ajax({action:"render_new_column_group",cols:i,node_id:t,position:l},FLBuilder._addColGroupComplete)},_addColGroupComplete:function(t){var i=JSON.parse(t),l=e(i.html),o=l.data("node"),s=l.find(".fl-col").data("node"),n=FLBuilder._addModuleAfterNodeRender;i.nodeParent=FLBuilder._newColGroupParent,i.nodePosition=FLBuilder._newColGroupPosition,FLBuilder._renderLayout(i,function(){i.nodeParent.hasClass("fl-col-content")&&i.nodeParent.parents(".fl-col").addClass("fl-col-has-cols"),null!==n&&(e(".fl-node-"+s+" .fl-col-content").append(n),FLBuilder._reorderModule(n),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+o)),FLBuilder.triggerHook("didAddColumnGroup",o)})},_initColDragResizing:function(){e(".fl-block-col-resize").not(".fl-block-row-resize").draggable({axis:"x",start:FLBuilder._colDragResizeStart,drag:FLBuilder._colDragResize,stop:FLBuilder._colDragResizeStop})},_colDragResizeStart:function(t,i){var l=e(i.helper),o="",s=l.hasClass("fl-block-col-resize-parent"),n=s?l.closest(".fl-col").parents(".fl-col"):null,r=s?n.parents(".fl-col-group"):l.closest(".fl-col-group"),a=r.find("> .fl-col"),d=s?n:l.closest(".fl-col"),u=d.attr("data-node"),c=e("[data-node="+u+"] #fl-field-size input"),h=null,f=null,g=null,p=100,b=0,m=null,v=null;for(l.hasClass("fl-block-col-resize-e")?(o="e",h=d.nextAll(".fl-col").first()):(o="w",h=d.prevAll(".fl-col").first()),f=h.attr("data-node"),g=e("[data-node="+f+"] #fl-field-size input");b<a.length;b++)a.eq(b).data("node")!=d.data("node")&&a.eq(b).data("node")!=h.data("node")&&(p-=parseFloat(a.eq(b)[0].style.width));c.length?(m=c,v="col"):g.length&&(m=g,v="sibling"),FLBuilder._colResizeData={handle:l,feedbackLeft:l.find(".fl-block-col-resize-feedback-left"),feedbackRight:l.find(".fl-block-col-resize-feedback-right"),direction:o,groupWidth:r.outerWidth(),col:d,colWidth:parseFloat(d[0].style.width)/100,sibling:h,offset:i.position.left,availWidth:p,setting:m,settingType:v},FLBuilder._colResizing=!0,e("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"),s=(i.offset-t.position.left)/i.groupWidth,n=l==i.direction?100*(i.colWidth-s):100*(i.colWidth+s),r=Math.round(100*n)/100,a=i.availWidth-n,d=Math.round(100*a)/100,u=8,c=Math.round(100*(i.availWidth-u))/100;r<u?(r=u,d=c):d<u&&(r=c,d=u),l==i.direction?(i.feedbackLeft.html(r.toFixed(1)+"%").show(),i.feedbackRight.html(d.toFixed(1)+"%").show()):(i.feedbackLeft.html(d.toFixed(1)+"%").show(),
|
4 |
-
i.feedbackRight.html(r.toFixed(1)+"%").show()),i.col.css("width",r+"%"),i.sibling.css("width",d+"%"),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))),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder.triggerHook("col-resize-drag")},_colDragResizeStop:function(t,i){var l=FLBuilder._colResizeData,o=FLBuilder._colResizeData.handle.closest(".fl-block-overlay"),s=l.col.data("node"),n=parseFloat(l.col[0].style.width),r=l.sibling.data("node"),a=parseFloat(l.sibling[0].style.width);FLBuilder._colResizeData.feedbackLeft.hide(),FLBuilder._colResizeData.feedbackRight.hide(),FLBuilder.ajax({action:"resize_cols",col_id:s,col_width:n,sibling_id:r,sibling_width:a}),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder._colResizeData=null,e("body").removeClass("fl-builder-col-resizing"),FLBuilder._bindOverlayEvents(),setTimeout(function(){FLBuilder._colResizing=!1},50),FLBuilder.triggerHook("col-resize-stop"),FLBuilder.triggerHook("didResizeColumn",{colId:s,colWidth:n,siblingId:r,siblingWidth:a})},_resetColumnWidthsClicked:function(t){var i=e(this),l=!!i.closest(".fl-row-overlay").length,o=null,s=null,n=[],r=null,a=0,d=e(".fl-builder-col-settings"),u=null;s=l?i.closest(".fl-row").find(".fl-row-content > .fl-col-group"):i.parents(".fl-col-group").last(),s.each(function(){for(o=e(this),r=o.find(".fl-col-group"),n.push(o.data("node")),FLBuilder._resetColumnWidths(o),a=0;a<r.length;a++)FLBuilder._resetColumnWidths(r.eq(a)),n.push(r.eq(a).data("node"))}),d.length&&(u=e(".fl-node-"+d.attr("data-node")),d.find("#fl-field-size input").val(parseFloat(u[0].style.width))),FLBuilder.ajax({action:"reset_col_widths",group_id:n}),FLBuilder.triggerHook("col-reset-widths"),FLBuilder._closeAllSubmenus(),t.stopPropagation()},_resetColumnWidths:function(e){var t=e.find(" > .fl-col:visible"),i=0;i=6===t.length?16.65:7===t.length?14.28:Math.round(100/t.length*100)/100,t.css("width",i+"%"),FLBuilder.triggerHook("didResetColumnWidths",{cols:t})},_moduleMouseenter:function(){var t=e(this),i=t.attr("data-name"),l=t.hasClass("fl-node-global"),o=t.parents(".fl-node-global").length>0,s=t.parents(".fl-col-group").last(),n=s.hasClass("fl-col-group-has-child-loading"),r=t.closest(".fl-col-group").find("> .fl-col").length,a=t.closest(".fl-col"),d=0===a.index(),u=r===a.index()+1,c=a.parents(".fl-col"),h=c.length>0,f=h?c.closest(".fl-col-group").find("> .fl-col").length:0,g=!!h&&0===c.index(),p=!!h&&f===c.index()+1,b="column"==FLBuilderConfig.userTemplateType&&!h;contentWidth=a.find("> .fl-col-content").width(),row=t.closest(".fl-row"),isGlobalRow=row.hasClass("fl-node-global"),rowIsFixedWidth=!!row.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,userCanResizeRows=FLBuilderConfig.rowResize.userCanResizeRows,template=wp.template("fl-module-overlay"),overlay=null,FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),l&&o&&"row"!=FLBuilderConfig.userTemplateType&&isGlobalRow||l&&o&&"column"!=FLBuilderConfig.userTemplateType&&!isGlobalRow||t.closest(".fl-builder-node-loading").length||t.find(".fl-inline-editor:visible").length||(t.hasClass("fl-block-overlay-active")||(overlay=FLBuilder._appendOverlay(t,template({global:l,moduleName:i,groupLoading:n,numCols:r,colFirst:d,colLast:u,isRootCol:b,hasParentCol:h,numParentCols:f,parentFirst:g,parentLast:p,contentWidth:contentWidth,rowIsFixedWidth:rowIsFixedWidth,userCanResizeRows:userCanResizeRows})),FLBuilder._buildOverlayOverflowMenu(overlay),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_moduleMouseleave:function(t){var i=(e(this),e(t.toElement)||e(t.relatedTarget)),l=i.is("#tiptip_holder"),o=i.closest("#tiptip_holder").length>0;l||o||(FLBuilder._removeModuleOverlays(),FLBuilder._removeColHighlightGuides())},_removeModuleOverlays:function(){var t=e(".fl-module");t.removeClass("fl-block-overlay-active"),t.find(".fl-module-overlay").remove(),e("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_moduleDragHelper:function(t,i){return e('<div class="fl-builder-block-drag-helper">'+i.attr("data-name")+"</div>")},_moduleDragStart:function(t,i){e(i.item).data("original-position",i.item.index()),FLBuilder._blockDragStart(t,i)},_moduleDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=i.item,o=l.parent(),s=null,n=0,r=0;if(o.hasClass("fl-builder-modules")||o.hasClass("fl-builder-widgets"))return void l.remove();if(l.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=l.closest(".fl-builder-content"),r=0,s=l.closest(".fl-row"),n=o.find(".fl-row").index(s)):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),r=o.closest(".fl-row").attr("data-node"),s=l.closest(".fl-col-group"),n=o.find(" > .fl-col-group").index(s)):o.hasClass("fl-col-drop-target")?(o=l.closest(".fl-col-group"),r=o.attr("data-node"),s=l.closest(".fl-col"),n=o.find(" > .fl-col").index(s)):(n=o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(l),r=l.closest(".fl-col").attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),FLBuilder._addModule(o,r,l.attr("data-type"),n,l.attr("data-widget"),l.attr("data-alias")),l.remove()}else{if(o.hasClass("fl-sortable-disabled"))return e(t.target).append(i.item),e(t.target).children().eq(i.item.data("original-position")).before(i.item),void FLBuilder._highlightEmptyCols();o.hasClass("fl-row-drop-target")?(s=l.closest(".fl-row"),n=l.closest(".fl-builder-content").children(".fl-row").index(s),n=l.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addModuleAfterNodeRender=l,FLBuilder._addRow("1-col",n),l.remove()):o.hasClass("fl-col-group-drop-target")?(s=l.closest(".fl-col-group"),n=l.closest(".fl-row-content ").find(" > .fl-col-group").index(s),n=l.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addModuleAfterNodeRender=l,FLBuilder._addColGroup(l.closest(".fl-row").attr("data-node"),"1-col",n),l.remove()):o.hasClass("fl-col-drop-target")?(s=l.closest(".fl-col"),n=l.closest(".fl-col-drop-target-last").length?"after":"before",FLBuilder._addModuleAfterNodeRender={module:l,colId:s.data("node"),position:n},FLBuilder._addCols(s,n,"1-col",l.closest(".fl-col-group-nested").length>0),l.remove()):FLBuilder._reorderModule(l)}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(t){var i=e(this).closest(".fl-module"),l=confirm(FLBuilderStrings.deleteModuleMessage);l&&(FLBuilder._deleteModule(i),FLBuilder._removeAllOverlays()),t.stopPropagation()},_deleteModule:function(e){var t=e.closest(".fl-row"),i=e.attr("data-node");FLBuilder.ajax({action:"delete_node",node_id:i}),e.empty(),e.remove(),t.removeClass("fl-block-overlay-muted"),FLBuilder._highlightEmptyCols(),FLBuilder._removeAllOverlays(),FLBuilder.triggerHook("didDeleteModule",i)},_moduleCopyClicked:function(t){var i=e(this).closest(".fl-module"),l=i.attr("data-node"),o=i.index()+1,s=i.clone(),n=e(".fl-builder-module-settings[data-node="+l+"]"),r=null;n.length&&(r=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[l]=r),s.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),s.find(".fl-block-overlay").remove(),i.after(s),e("html, body").animate({scrollTop:s.offset().top-75},500),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newModuleParent=i.parent(),FLBuilder._newModulePosition=o,FLBuilder.ajax({action:"copy_module",node_id:l,settings:r},function(e){var t=JSON.parse(e);t.duplicatedModule=l,FLBuilder._moduleCopyComplete(t)}),t.stopPropagation()},_moduleCopyComplete:function(e){e.nodeParent=FLBuilder._newModuleParent,e.nodePosition=FLBuilder._newModulePosition,FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateModule",{newNodeId:e.nodeId,oldNodeId:e.duplicatedModule}),e.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_moduleSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-module").attr("data-type"),o=i.closest(".fl-module").attr("data-node"),s=i.closest(".fl-col").attr("data-node"),n=i.closest(".fl-block-overlay-global").length>0;t.stopPropagation(),FLBuilder._colResizing||n&&!FLBuilderConfig.userCanEditGlobalTemplates||FLBuilder._showModuleSettings({type:l,nodeId:o,parentId:s,global:n})},_showModuleSettings:function(t,i){var l=FLBuilderSettingsConfig.modules[t.type],o=t.settings?t.settings:FLBuilderSettingsConfig.nodes[t.nodeId],s=e("head");-1===e.inArray(t.type,FLBuilder._loadedModuleAssets)&&(""!==l.assets.css&&s.append(l.assets.css),""!==l.assets.js&&s.append(l.assets.js),FLBuilder._loadedModuleAssets.push(t.type)),FLBuilderSettingsForms.render({type:"module",id:t.type,nodeId:t.nodeId,className:"fl-builder-module-settings fl-builder-"+t.type+"-settings",attrs:'data-node="'+t.nodeId+'" data-parent="'+t.parentId+'" data-type="'+t.type+'"',buttons:t.global||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:t.global?[FLBuilderStrings.global]:[],settings:o,legacy:t.legacy,helper:FLBuilder._moduleHelpers[t.type],rules:FLBuilder._moduleHelpers[t.type]?FLBuilder._moduleHelpers[t.type].rules:null,preview:{type:"module",layout:t.layout,callback:function(){FLBuilder.triggerHook("didAddModule",t.nodeId)}}},i)},_saveModuleClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=t.attr("data-type"),l=(t.attr("data-node"),FLBuilder._moduleHelpers[i]),o=!0;"undefined"!=typeof l&&(t.find("label.error").remove(),t.validate().hideErrors(),o=t.validate().form(),o&&(o=l.submit())),o?FLBuilder._saveSettings():FLBuilder._toggleSettingsTabErrors()},_addModule:function(e,t,i,l,o,s){FLBuilder._showNodeLoadingPlaceholder(e,l),e.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=e,FLBuilder._newModulePosition=l),FLBuilder.ajax({action:"render_new_module",parent_id:t,type:i,position:l,node_preview:1,widget:"undefined"==typeof o?"":o,alias:"undefined"==typeof s?"":s},FLBuilder._addModuleComplete)},_addModuleComplete:function(t){var i=JSON.parse(t);i.layout&&(i.layout.nodeParent=FLBuilder._newModuleParent,i.layout.nodePosition=FLBuilder._newModulePosition),i.settings||(i.settings=FLBuilderSettingsConfig.defaults.modules[i.type]),e("form.fl-builder-settings").length?i.layout&&FLBuilder._renderLayout(i.layout):FLBuilder._showModuleSettings(i,function(){e(".fl-builder-module-settings").data("new-module","1")})},registerModuleHelper:function(t,i){var l={rules:{},init:function(){},submit:function(){return!0},preview:function(){}};FLBuilder._moduleHelpers[t]=e.extend({},l,i)},_registerModuleHelper:function(e,t){FLBuilder.registerModuleHelper(e,t)},_showNodeTemplateSettings:function(t){var i=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=i.attr("data-node"),o=FLBuilderStrings.saveModule;return i.hasClass("fl-builder-row-settings")?o=FLBuilderStrings.saveRow:i.hasClass("fl-builder-col-settings")&&(o=FLBuilderStrings.saveColumn),!!FLBuilder._triggerSettingsSave(!1,!1,!1)&&void FLBuilderSettingsForms.render({id:"node_template",nodeId:l,title:o,attrs:'data-node="'+l+'"',className:"fl-builder-node-template-settings",rules:{name:{required:!0}}},function(){FLBuilderConfig.userCanEditGlobalTemplates||e("#fl-field-global").hide()})},_saveNodeTemplate:function(){var t=e(".fl-builder-node-template-settings"),i=t.attr("data-node"),l=t.validate().form();l&&(FLBuilder._showNodeLoading(i),FLBuilder.ajax({action:"save_node_template",node_id:i,settings:FLBuilder._getSettings(t)},function(e){FLBuilder._saveNodeTemplateComplete(e),FLBuilder._hideNodeLoading(i)}),FLBuilder._lightbox.close())},_saveNodeTemplateComplete:function(t){var i=JSON.parse(t),l=e(".fl-builder-saved-"+i.type+"s"),o=l.find(".fl-builder-block"),s=null,n="",r=i.name.toLowerCase(),a=0,d=wp.template("fl-node-template-block"),u={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(u),FLBuilder.triggerHook("contentItemsChanged"),i.layout&&(FLBuilder._renderLayout(i.layout),FLBuilder.triggerHook("didSaveGlobalNodeTemplate",i.config)),0===o.length)l.append(d(i));else for(;a<o.length;a++){if(s=o.eq(a),n=s.text().toLowerCase().trim(),0===a&&r<n){l.prepend(d(i));break}if(r<n){s.before(d(i));break}if(o.length-1===a){l.append(d(i));break}}l.find(".fl-builder-block-no-node-templates").remove()},_nodeTemplateDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=i.item,o=l.parent(),s=null,n=0,r=null,a="",d=null;if(o.hasClass("fl-builder-blocks-section-content"))return void l.remove();if(l.hasClass("fl-builder-block-saved-row")||l.hasClass("fl-builder-block-row-template"))r=l.closest(".fl-row"),n=r.length?e(FLBuilder._contentClass+" .fl-row").index(r):0,n=o.hasClass("fl-drop-target-last")?n+1:n,s=null,a="render_new_row",d=FLBuilder._addRowComplete,FLBuilder._newRowPosition=n,FLBuilder._showNodeLoadingPlaceholder(e(FLBuilder._contentClass),n);else if(l.hasClass("fl-builder-block-saved-column")){if(r=l.closest(".fl-col"),colGroup=o.closest(".fl-col-group"),colGroupId=colGroup.attr("data-node"),a="render_new_col_template",d=FLBuilder._addColsComplete,o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(r=l.closest(".fl-row"),s=0,o=e(FLBuilder._contentClass),n=r.length?o.find(".fl-row").index(r):0):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),s=l.closest(".fl-row").attr("data-node"),n=l.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(l.closest(".fl-col-group"))):o.hasClass("fl-col-drop-target")&&(o=l.closest(".fl-col-group"),n=o.children(".fl-col").index(l.closest(".fl-col")),s=o.attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),o.hasClass("fl-col-group")?FLBuilder._newColParent=null:FLBuilder._newColParent=o,FLBuilder._newColPosition=n,FLBuilder._showNodeLoadingPlaceholder(o,n)}else if(l.hasClass("fl-builder-block-saved-module")||l.hasClass("fl-builder-block-module-template")){if(a="render_new_module",d=FLBuilder._addModuleComplete,o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=l.closest(".fl-builder-content"),s=0,n=o.find(".fl-row").index(l.closest(".fl-row"))):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),s=o.closest(".fl-row").attr("data-node"),n=o.find(" > .fl-col-group").index(l.closest(".fl-col-group"))):o.hasClass("fl-col-drop-target")?(o=l.closest(".fl-col-group"),n=o.children(".fl-col").index(l.closest(".fl-col")),s=o.attr("data-node")):(n=o.children(".fl-module, .fl-builder-block").index(l),s=l.closest(".fl-col").attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),o.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=o,FLBuilder._newModulePosition=n),FLBuilder._showNodeLoadingPlaceholder(o,n)}FLBuilder.ajax({action:a,template_id:l.attr("data-id"),template_type:l.attr("data-type"),parent_id:s,position:n},function(e){if(a.indexOf("row")>-1){var t=JSON.parse(e);FLBuilder.triggerHook("didApplyRowTemplateComplete",t.config),d(t.layout)}else d(e)}),l.remove()},_editNodeTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteNodeTemplateClicked:function(t){var i=e(t.target),l=i.closest(".fl-builder-blocks-section"),o=l.find(".fl-builder-blocks-section-content"),s=o.find(".fl-builder-block"),n=i.closest(".fl-builder-block"),r=n.hasClass("fl-builder-block-global"),a=r?FLBuilder._updateLayout:void 0,d=r?FLBuilderStrings.deleteGlobalTemplate:FLBuilderStrings.deleteTemplate,u=null;confirm(d)&&(n.remove(),1===s.length&&(n.hasClass("fl-builder-block-saved-row")?o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedRows+"</span>"):o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedModules+"</span>")),n.hasClass("fl-builder-block-global")&&FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"delete_node_template",template_id:n.attr("data-id")},a),u=_.findIndex(FLBuilderConfig.contentItems.template,{id:n.attr("data-id"),type:"user"}),FLBuilderConfig.contentItems.template.splice(u,1),FLBuilder.triggerHook("contentItemsChanged"))},_initSettingsForms:function(){FLBuilder._initCodeFields(),FLBuilder._initColorPickers(),FLBuilder._initSelectFields(),FLBuilder._initEditorFields(),FLBuilder._initMultipleFields(),FLBuilder._initAutoSuggestFields(),FLBuilder._initLinkFields(),FLBuilder._initFontFields(),FLBuilder._initOrderingFields(),FLBuilder._initTimezoneFields(),FLBuilder._focusFirstSettingsControl(),FLBuilder._lightbox._resizeEditors(),e(".fl-builder-settings-fields").css("visibility","visible"),FLBuilder.triggerHook("settings-form-init")},_destroySettingsForms:function(){FLBuilder._destroyEditorFields()},_setSettingsFormContent:function(t){e(".fl-legacy-settings").remove(),e("body").append(t)},_settingsTabClicked:function(t){var i=e(this),l=i.closest(".fl-builder-settings"),o=i.attr("href").split("#").pop();FLBuilder._resetSettingsTabsState(),l.find(".fl-builder-settings-tab").removeClass("fl-active"),l.find("#"+o).addClass("fl-active"),l.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),l.find("a[href*="+o+"]").addClass("fl-active"),FLBuilder._focusFirstSettingsControl(),t.preventDefault()},_resetSettingsTabsState:function(){var t=e(".fl-lightbox:visible");FLBuilder._hideTabsOverflowMenu(),t.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),t.find(".fl-builder-settings-tabs-overflow-menu .fl-active").removeClass("fl-active"),t.find(".fl-contains-active").removeClass("fl-contains-active")},_calculateSettingsTabsOverflow:function(){var t=e(".fl-lightbox:visible"),i=t.outerWidth(),l=t.hasClass("fl-lightbox-width-slim"),o=t.find(".fl-builder-settings-tabs"),s=t.find(".fl-builder-settings-tabs-overflow-menu"),n=t.find(".fl-builder-settings-tabs-more"),r=o.find("a"),a=!1,d=i-60,u=0,c=l?16:30;s.html(""),FLBuilder._hideTabsOverflowMenu(),r.removeClass("fl-overflowed"),r.each(function(){if(!e(this).is(":visible"))return!0;if(!a){var t=e(this).textWidth()+c+12;u+=t,u>=d&&(a=!0)}if(a){var i=e(this).html(),l=e(this).attr("href"),o="";e(this).hasClass("fl-active")&&(o="fl-active"),e(this).hasClass("error")&&(o+=" error"),""!==o&&(o='class="'+o+'"');var n=e('<a href="'+l+'" '+o+">"+i+"</a>");s.append(n),e(this).addClass("fl-overflowed")}else e(this).removeClass("fl-overflowed")}),a?t.addClass("fl-lightbox-has-tab-overflow"):t.removeClass("fl-lightbox-has-tab-overflow"),s.find(".fl-active").length>0?n.addClass("fl-contains-active"):n.removeClass("fl-contains-active"),s.find(".error").length>0?n.addClass("fl-contains-errors"):n.removeClass("fl-contains-errors")},_settingsTabsToOverflowMenuItemClicked:function(t){var i=e(t.currentTarget),l=i.attr("href"),o=i.closest(".fl-lightbox-header-wrap").find(".fl-builder-settings-tabs"),s=o.find('a[href="'+l+'"]'),n=o.find(".fl-builder-settings-tabs-more");FLBuilder._resetSettingsTabsState(),s.trigger("click"),i.addClass("fl-active"),n.addClass("fl-contains-active"),FLBuilder._hideTabsOverflowMenu(),t.preventDefault()},_hasOverflowTabs:function(){var t=e(".fl-lightbox:visible"),i=t.find(".fl-builder-settings-tabs-overflow-menu a");return i.length>0},_showTabsOverflowMenu:function(){if(FLBuilder._hasOverflowTabs()){var t=e(".fl-lightbox:visible");t.find(".fl-builder-settings-tabs-overflow-menu").css("display","flex"),t.find(".fl-builder-settings-tabs-overflow-click-mask").show(),this.isShowingSettingsTabsOverflowMenu=!0}},_hideTabsOverflowMenu:function(){var t=e(".fl-lightbox:visible");t.find(".fl-builder-settings-tabs-overflow-menu").css("display","none"),t.find(".fl-builder-settings-tabs-overflow-click-mask").hide(),this.isShowingSettingsTabsOverflowMenu=!1},_toggleTabsOverflowMenu:function(e){FLBuilder.isShowingSettingsTabsOverflowMenu?FLBuilder._hideTabsOverflowMenu():FLBuilder._showTabsOverflowMenu(),e.stopPropagation()},_settingsCancelClicked:function(t){var i=e(".fl-builder-lightbox[data-parent]"),l=e(".fl-builder-module-settings"),o=null,s=null,n=null,r=null;return i.length>0?void FLBuilder._closeNestedSettings():(l.length>0&&"undefined"!=typeof l.data("new-module")?(o=e(FLBuilder.preview.state.html),s=e(".fl-node-"+l.data("node")),n=s.closest(".fl-col"),r=o.find(".fl-node-"+n.data("node")),r.length>0?FLBuilder._deleteModule(s):FLBuilder._deleteCol(n)):FLBuilder.preview&&FLBuilder.preview.revert(),FLBuilder.preview=null,void FLLightbox.closeParent(this))},_focusFirstSettingsControl:function(){var t=e(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab.fl-active"),l=t.data("node"),o=i.find(".fl-field").first(),s=o.find('input:not([type="hidden"]), textarea, select, button, a, .fl-editor-field').first();if(!l||!e(".fl-node-"+l+" .fl-inline-editor").length){if("undefined"!=typeof tinyMCE&&s.hasClass("fl-editor-field")){var n=s.find("textarea.wp-editor-area").attr("id");tinyMCE.get(n).focus()}else setTimeout(function(){s.focus().css("animation-name","fl-grab-attention")},300);o.css("animation-name","fl-grab-attention"),o.on("animationend",function(){o.css("animation-name","")})}},_initSettingsValidation:function(t,i){var l=e(".fl-builder-settings").last();l.validate({ignore:".fl-ignore-validation",rules:t,messages:i,errorPlacement:FLBuilder._settingsErrorPlacement})},_settingsErrorPlacement:function(e,t){e.appendTo(t.parent())},_toggleSettingsTabErrors:function(){for(var t=e(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab"),l=null,o=null,s=0;s<i.length;s++)l=i.eq(s),o=l.find("label.error"),tabLink=t.find(".fl-builder-settings-tabs a[href*="+l.attr("id")+"]"),tabLink.find(".fl-error-icon").remove(),tabLink.removeClass("error"),o.length>0&&(tabLink.append('<span class="fl-error-icon"></span>'),tabLink.addClass("error"));FLBuilder._calculateSettingsTabsOverflow()},_getSettings:function(t){FLBuilder._updateEditorFields();var i=t.serializeArray(),l=0,o=0,s="",n="",r="",a=[],d=[],u={};for(l=0;l<i.length;l++)if(s=i[l].value.replace(/\r/gm,""),!(i[l].name.indexOf("flrich")>-1))if(i[l].name.indexOf("[")>-1){for(n=i[l].name.replace(/\[(.*)\]/,""),r=i[l].name.replace(n,""),a=[],d=r.match(/\[[^\]]*\]/g),o=0;o<d.length;o++)"[]"!=d[o]&&a.push(d[o].replace(/\[|\]/g,""));r.match(/\[\]\[[^\]]*\]\[[^\]]+\]/)?("undefined"==typeof u[n]&&(u[n]={}),"undefined"==typeof u[n][a[0]]&&(u[n][a[0]]={}),"undefined"==typeof u[n][a[0]][a[1]]&&(u[n][a[0]][a[1]]={}),u[n][a[0]][a[1]]=s):r.match(/\[\]\[[^\]]*\]\[\]/)?("undefined"==typeof u[n]&&(u[n]={}),"undefined"==typeof u[n][a[0]]&&(u[n][a[0]]=[]),u[n][a[0]].push(s)):r.match(/\[\]\[[^\]]*\]/)?("undefined"==typeof u[n]&&(u[n]={}),u[n][a[0]]=s):r.match(/\[\]/)&&("undefined"==typeof u[n]&&(u[n]=[]),u[n].push(s))}else u[i[l].name]=s;for(r in u)if("undefined"!=typeof u["as_values_"+r]){u[r]=e.grep(u["as_values_"+r].split(","),function(e){return""!==e}).join(",");try{delete u["as_values_"+r]}catch(c){}}return e.each(t.find("[name]"),function(t,i){var l=e(i).attr("name").replace(/\[(.*)\]/,"");l in u||(u[l]="")}),u=e.extend({},FLBuilder._getOriginalSettings(t),u)},_getSettingsJSONForHTML:function(e){return JSON.stringify(e).replace(/\'/g,"'").replace("<wbr />","<wbr>")},_getOriginalSettings:function(t,i){var l=t.find(".fl-builder-settings-json"),o=t.data("node"),s=FLBuilderSettingsConfig.nodes,n=null,r={};if(o&&s[o]?n=s[o]:l.length&&(n=JSON.parse(l.val().replace(/'/g,"'"))),n)for(key in n)(e("#fl-field-"+key).length||i)&&(r[key]=n[key]);return r},_getSettingsForChangedCheck:function(t,i){var l=FLBuilder._getSettings(i);if(t){var o=e(".fl-node-"+t);if(o.hasClass("fl-module")){var s=o.data("type"),n=FLBuilderSettingsConfig.editables[s];if(n&&FLBuilderSettingsConfig.nodes[t])for(var r in n)l[r]=FLBuilderSettingsConfig.nodes[t][r]}}return l},_saveSettings:function(t){var i=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=i.data("new-module"),o=i.attr("data-node"),s=FLBuilder._getSettings(i),n=FLBuilder.preview;return!_.isUndefined(t)&&_.isBoolean(t)||(t=!0),n&&!n._settingsHaveChanged()&&_.isUndefined(l)?void FLBuilder._lightbox.close():(FLBuilder._showNodeLoading(o),FLBuilderSettingsConfig.nodes[o]=s,FLBuilder.ajax({action:"save_settings",node_id:o,settings:s},FLBuilder._saveSettingsComplete.bind(this,t,n)),FLBuilder.triggerHook("didSaveNodeSettings",{nodeId:o,settings:s}),void FLBuilder._lightbox.close())},_saveSettingsComplete:function(e,t,i){var l=JSON.parse(i),o=function(){t&&l.layout.partial&&l.layout.nodeId===t.nodeId&&(t.clear(),t=null)};!0===e?FLBuilder._renderLayout(l.layout,o):o(),FLBuilder.triggerHook("didSaveNodeSettingsComplete",{nodeId:l.node_id,settings:l.settings})},_triggerSettingsSave:function(t,i,l){var o=FLBuilder._lightbox._node.find("form.fl-builder-settings"),s=FLBuilder._lightbox._node.data("instance-id"),n=FLLightbox._instances[s],r=e(".fl-lightbox-wrap[data-parent]:visible"),a=!1,d=!0;return t=!_.isUndefined(t)&&t,i=!_.isUndefined(i)&&i,l=!!_.isUndefined(l)||l,o.length&&(r.length&&(r.find(".fl-builder-settings-save").trigger("click"),(r.find("label.error").length||e(".fl-builder-alert-lightbox:visible").length)&&(d=!1)),d&&!o.validate().form()&&(d=!1),a=FLBuilderSettingsForms.settingsHaveChanged(),d&&a&&(t&&n.disableClose(),o.find(".fl-builder-settings-save").trigger("click"),t&&n.enableClose(),(o.find("label.error").length||e(".fl-builder-alert-lightbox:visible").length)&&(d=!1)),l&&(FLBuilder._destroySettingsForms(),!a&&FLBuilder.preview&&(FLBuilder.preview.clear(),FLBuilder.preview=null)),a||t||n.close()),d||(FLBuilder.triggerHook("didFailSettingsSave"),FLBuilder._toggleSettingsTabErrors(),i&&!e(".fl-builder-alert-lightbox:visible").length&&FLBuilder.alert(FLBuilderStrings.settingsHaveErrors)),d},_refreshSettingsPreviewReference:function(){FLBuilder.preview&&FLBuilder.preview._initElementsAndClasses()},_openNestedSettings:function(t){t.className&&-1===t.className.indexOf("fl-builder-settings-lightbox")&&(t.className+=" fl-builder-settings-lightbox"),t=e.extend({className:"fl-builder-lightbox fl-builder-settings-lightbox",destroyOnClose:!0,resizable:!0},t);var i=e(".fl-lightbox-wrap:visible"),l=i.find(".fl-lightbox"),o=new FLLightbox(t),s=o._node,n=s.find(".fl-lightbox");return i.hide(),s.attr("data-parent",i.attr("data-instance-id")),n.attr("style",l.attr("style")),o.on("resized",FLBuilder._calculateSettingsTabsOverflow),o.open('<div class="fl-builder-lightbox-loading"></div>'),o},_closeNestedSettings:function(){var t=e(".fl-builder-lightbox[data-parent]:visible"),i=t.find(".fl-lightbox"),l=t.attr("data-instance-id"),o=FLLightbox._instances[l],s=t.attr("data-parent"),n=e('[data-instance-id="'+s+'"]'),r=n.find(".fl-lightbox"),a=n.find("form"),d=FLLightbox._instances[s];o.on("close",function(){r.attr("style",i.attr("style")),n.show(),d._resize(),n.find("label.error").remove(),a.validate().hideErrors(),FLBuilder._toggleSettingsTabErrors()}),o.close()},_showHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeIn()},_hideHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeOut()},_initAutoSuggestFields:function(){var t=e(".fl-builder-settings:visible .fl-suggest-field"),i=null,l=null,o=null,s=[];t.each(function(){i=e(this),""!==i.attr("data-value")&&(FLBuilderSettingsForms.showFieldLoader(i),s.push({name:i.attr("name"),value:i.attr("data-value"),action:i.attr("data-action"),data:i.attr("data-action-data")}))}),s.length?FLBuilder.ajax({action:"get_autosuggest_values",fields:s},function(i){l=JSON.parse(i);for(o in l)e('.fl-suggest-field[name="'+o+'"]').attr("data-value",l[o]);t.each(FLBuilder._initAutoSuggestField)}):t.each(FLBuilder._initAutoSuggestField)},_initAutoSuggestField:function(){var t=e(this);t.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:t.data("action"),fl_as_action_data:t.data("action-data"),_wpnonce:FLBuilderConfig.ajaxNonce}),e.extend({},{asHtmlID:t.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:3,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,preFill:t.data("value"),queryParam:"fl_as_query",afterSelectionAdd:FLBuilder._updateAutoSuggestField,afterSelectionRemove:FLBuilder._updateAutoSuggestField,selectionLimit:t.data("limit")},t.data("args"))),FLBuilderSettingsForms.hideFieldLoader(t)},_updateAutoSuggestField:function(t,i,l){e(this).siblings(".as-values").val(l.join(",")).trigger("change")},_initCodeFields:function(){e(".fl-builder-settings:visible").find(".fl-code-field").each(FLBuilder._initCodeField)},_initCodeField:function(){var t=e(this),i=t.closest(".fl-builder-settings"),l=t.find("textarea"),o=(l.attr("id"),l.data("editor")),s=l.data("wrap"),n=e("<div>",{position:"absolute",height:20*parseInt(l.attr("rows"),10)}),r=null;n.insertBefore(l),l.css("display","none"),ace.require("ace/ext/language_tools"),r=ace.edit(n[0]),r.$blockScrolling=1/0,r.getSession().setValue(l.val()),r.getSession().setMode("ace/mode/"+o),s&&r.getSession().setUseWrapMode(!0),r.setOptions({enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!1,showLineNumbers:!1,showFoldWidgets:!1}),r.getSession().on("change",function(e){l.val(r.getSession().getValue()).trigger("change")}),r.getSession().on("changeAnnotation",function(){for(var e=r.getSession().getAnnotations(),t=i.find(".fl-builder-settings-save"),l=i.find(".fl-builder-settings-error"),o=!1,s=0;s<e.length;s++)if(!(e[s].text.indexOf("DOCTYPE")>-1||e[s].text.indexOf("Named entity expected")>-1||e[s].text.indexOf("@supports")>-1||"error"!==e[s].type)){o=!0;break}o&&!l.length&&FLBuilderConfig.CheckCodeErrors?(t.addClass("fl-builder-settings-error"),t.on("click",FLBuilder._showCodeFieldError)):!o&&l.length&&(l.removeClass("fl-builder-settings-error"),l.off("click",FLBuilder._showCodeFieldError))}),l.closest(".fl-field").data("editor",r)},_showCodeFieldError:function(e){e.stopImmediatePropagation(),FLBuilder.alert(FLBuilderStrings.codeError)},_initMultipleFields:function(){for(var t=e(".fl-builder-settings:visible .fl-builder-field-multiples"),i=null,l=null,o=0,s=FLBuilderConfig.isRtl?{left:10}:{right:10};o<t.length;o++)i=t.eq(o),l=i.find(".fl-builder-field-multiple"),1===l.length?l.eq(0).find(".fl-builder-field-actions").addClass("fl-builder-field-actions-single"):l.find(".fl-builder-field-actions").removeClass("fl-builder-field-actions-single");e(".fl-builder-field-multiples").sortable({items:".fl-builder-field-multiple",cursor:"move",cursorAt:s,distance:5,opacity:.5,placeholder:"fl-builder-field-dd-zone",stop:FLBuilder._fieldDragStop,tolerance:"pointer",axis:"y"})},_addFieldClicked:function(){var t=e(this),i=t.attr("data-field"),l=t.closest("tr").siblings("tr[data-field="+i+"]").last(),o=l.clone(),s=o.find(".fl-form-field"),n=null,r=parseInt(l.find("label span.fl-builder-field-index").html(),10)+1;o.find("th label span.fl-builder-field-index").html(r),o.find(".fl-form-field-preview-text").html(""),o.find("input, textarea, select").val(""),l.after(o),FLBuilder._initMultipleFields(),s.length&&(n=s.find(".fl-form-field-edit").data("type"),s.find("input").val(JSON.stringify(FLBuilderSettingsConfig.defaults.forms[n])))},_copyFieldClicked:function(){var t=e(this),i=t.closest("tr"),l=i.clone(),o=parseInt(i.find("label span.fl-builder-field-index").html(),10)+1;l.find("th label span.fl-builder-field-index").html(o),i.after(l),FLBuilder._renumberFields(i.parent()),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview()},_deleteFieldClicked:function(){var t=e(this).closest("tr"),i=t.parent(),l=confirm(FLBuilderStrings.deleteFieldMessage);l&&(t.remove(),FLBuilder._renumberFields(i),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview());
|
5 |
-
},_renumberFields:function(e){for(var t=e.find(".fl-builder-field-multiple"),i=0;i<t.length;i++)t.eq(i).find("th label span.fl-builder-field-index").html(i+1)},_fieldDragHelper:function(){return e('<div class="fl-builder-field-dd-helper"></div>')},_fieldDragStop:function(e,t){FLBuilder._renumberFields(t.item.parent()),FLBuilder.preview.delayPreview()},_initSelectFields:function(){e(".fl-builder-settings:visible").find(".fl-builder-settings-fields select").trigger("change")},_settingsSelectChanged:function(){var t=e(this),i=t.attr("data-toggle"),l=t.attr("data-hide"),o=t.attr("data-trigger"),s=t.val(),n=0;if("undefined"!=typeof i){i=JSON.parse(i);for(n in i)FLBuilder._settingsSelectToggle(i[n].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(i[n].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[n].tabs,"hide","a[href*=fl-builder-settings-tab-","]");"undefined"!=typeof i[s]&&(FLBuilder._settingsSelectToggle(i[s].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(i[s].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[s].tabs,"show","a[href*=fl-builder-settings-tab-","]"))}if("undefined"!=typeof l&&(l=JSON.parse(l),"undefined"!=typeof l[s]&&(FLBuilder._settingsSelectToggle(l[s].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(l[s].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(l[s].tabs,"hide","a[href*=fl-builder-settings-tab-","]"))),"undefined"!=typeof o&&(o=JSON.parse(o),"undefined"!=typeof o[s]&&"undefined"!=typeof o[s].fields))for(n=0;n<o[s].fields.length;n++)e("#fl-field-"+o[s].fields[n]).find("select").trigger("change");FLBuilder._calculateSettingsTabsOverflow()},_settingsSelectToggle:function(t,i,l,o){var s=0;if(o="undefined"==typeof o?"":o,"undefined"!=typeof t)for(;s<t.length;s++)e(".fl-builder-settings:visible").find(l+t[s]+o)[i](),e(l+t[s]+o).parent().find('.fl-field[data-type="code"]').each(function(){e(this).data("editor").resize()})},_initColorPickers:function(){var t=FLBuilderConfig.colorPresets?FLBuilderConfig.colorPresets:[];FLBuilder.colorPicker=new FLBuilderColorPicker({mode:"hsv",elements:".fl-color-picker .fl-color-picker-value",presets:t,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}}),e(FLBuilder.colorPicker).on("presetRemoved presetAdded",function(e,t){FLBuilder.ajax({action:"save_color_presets",presets:t.presets})})},_initSinglePhotoSelector:function(){null===FLBuilder._singlePhotoSelector&&(FLBuilder._singlePhotoSelector=wp.media({title:FLBuilderStrings.selectPhoto,button:{text:FLBuilderStrings.selectPhoto},library:{type:"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",e.proxy(FLBuilder._singlePhotoOpened,this)),FLBuilder._singlePhotoSelector.once("select",e.proxy(FLBuilder._singlePhotoSelected,this)),FLBuilder._singlePhotoSelector.open()},_singlePhotoOpened:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection"),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=l.val(),s=null;e(this).hasClass("fl-photo-replace")?(t.reset(),i.addClass("fl-photo-empty"),l.val("")):""!==o?(s=wp.media.attachment(o),s.fetch(),t.add(s?[s]:[])):t.reset()},_singlePhotoSelected:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection").first().toJSON(),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=i.find(".fl-photo-preview img"),s=i.find("select");l.val(t.id),o.attr("src",FLBuilder._getPhotoSrc(t)),i.removeClass("fl-photo-empty").removeClass("fl-photo-no-attachment"),i.find("label.error").remove(),s.show(),s.html(FLBuilder._getPhotoSizeOptions(t)),s.trigger("change"),FLBuilderSettingsConfig.attachments[t.id]=t},_singlePhotoRemoved:function(){FLBuilder._initSinglePhotoSelector();var t=FLBuilder._singlePhotoSelector.state(),i="undefined"!=typeof t?t.get("selection"):null,l=e(this).closest(".fl-photo-field"),o=l.find("input[type=hidden]"),s=l.find("select");i&&i.reset(),l.addClass("fl-photo-empty"),o.val(""),s.html('<option value="" selected></option>'),s.trigger("change")},_getPhotoSrc:function(e){return"undefined"==typeof e.sizes?e.url:"undefined"!=typeof e.sizes.thumbnail?e.sizes.thumbnail.url:e.sizes.full.url},_getPhotoSizeOptions:function(e,t){var i="",l=null,o=null,s="",n={full:FLBuilderStrings.fullSize,large:FLBuilderStrings.large,medium:FLBuilderStrings.medium,thumbnail:FLBuilderStrings.thumbnail};if("undefined"==typeof e.sizes||0===e.sizes.length)i+='<option value="'+e.url+'">'+FLBuilderStrings.fullSize+"</option>";else{t&&(t=t.replace(/https?/,""));for(l in e.sizes)s="undefined"!=typeof n[l]?n[l]+" - ":"undefined"!=typeof FLBuilderConfig.customImageSizeTitles[l]?FLBuilderConfig.customImageSizeTitles[l]+" - ":"",o="",t?t===e.sizes[l].url.replace(/https?/,"")&&(o=' selected="selected"'):o="full"==l?' selected="selected"':"",i+='<option value="'+e.sizes[l].url+'"'+o+">"+s+e.sizes[l].width+" x "+e.sizes[l].height+"</option>"}return i},_selectMultiplePhotos:function(){var t=e(this).closest(".fl-multiple-photos-field"),i=t.find("input[type=hidden]"),l=i.val(),o=""===l?"":JSON.parse(l),s=wp.media.gallery.defaults.id,n='[gallery ids="-1"]',r=null,a=null,d=null,u=null,c=[];if("object"==typeof o){for(u in o)c.push(o[u]);n='[gallery ids="'+c.join()+'"]'}r=wp.shortcode.next("gallery",n).shortcode,_.isUndefined(r.get("id"))&&!_.isUndefined(s)&&r.set("id",s),a=wp.media.gallery.attachments(r),d=new wp.media.model.Selection(a.models,{props:a.props.toJSON(),multiple:!0}),d.gallery=a.gallery,d.more().done(function(){d.length||FLBuilder._multiplePhotoSelector.setState("gallery-library"),d.props.set({query:!1}),d.unmirror(),d.props.unset("orderby")}),FLBuilder._multiplePhotoSelector&&FLBuilder._multiplePhotoSelector.dispose(),FLBuilder._multiplePhotoSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-photos-edit")?"gallery-edit":"gallery-library",title:wp.media.view.l10n.editGalleryTitle,editing:!0,multiple:!0,selection:d}).open(),e(FLBuilder._multiplePhotoSelector.views.view.el).addClass("fl-multiple-photos-lightbox"),FLBuilder._multiplePhotoSelector.once("update",e.proxy(FLBuilder._multiplePhotosSelected,this))},_multiplePhotosSelected:function(t){for(var i=e(this).closest(".fl-multiple-photos-field"),l=i.find("input[type=hidden]"),o=i.find(".fl-multiple-photos-count"),s=[],n=0;n<t.models.length;n++)s.push(t.models[n].id);1==s.length?o.html("1 "+FLBuilderStrings.photoSelected):o.html(s.length+" "+FLBuilderStrings.photosSelected),i.removeClass("fl-multiple-photos-empty"),i.find("label.error").remove(),l.val(JSON.stringify(s)).trigger("change")},_initSingleVideoSelector:function(){null===FLBuilder._singleVideoSelector&&(FLBuilder._singleVideoSelector=wp.media({title:FLBuilderStrings.selectVideo,button:{text:FLBuilderStrings.selectVideo},library:{type:"video"},multiple:!1}),FLBuilder._singleVideoSelector.on("open",FLBuilder._wpmedia_reset_errors),_wpPluploadSettings.defaults.multipart_params.fl_upload_type="video")},_selectSingleVideo:function(){FLBuilder._initSingleVideoSelector(),FLBuilder._singleVideoSelector.once("select",e.proxy(FLBuilder._singleVideoSelected,this)),FLBuilder._singleVideoSelector.open()},_singleVideoSelected:function(){var t=FLBuilder._singleVideoSelector.state().get("selection").first().toJSON(),i=e(this).closest(".fl-video-field"),l=i.find(".fl-video-preview-img"),o=i.find(".fl-video-preview-filename"),s=i.find("input[type=hidden]");l.html('<span class="dashicons dashicons-media-video"></span>'),o.html(t.filename),i.removeClass("fl-video-empty"),i.find("label.error").remove(),s.val(t.id).trigger("change"),FLBuilderSettingsConfig.attachments[t.id]=t},_singleVideoRemoved:function(){FLBuilder._initSingleVideoSelector();var t=FLBuilder._singleVideoSelector.state(),i="undefined"!=typeof t?t.get("selection"):null,l=e(this).closest(".fl-video-field"),o=l.find(".fl-video-preview-img img"),s=l.find(".fl-video-preview-filename"),n=l.find("input[type=hidden]");i&&i.reset(),o.attr("src",""),s.html(""),l.addClass("fl-video-empty"),n.val("").trigger("change")},_selectMultipleAudios:function(){var t=e(this).closest(".fl-multiple-audios-field"),i=t.find("input[type=hidden]"),l=i.val(),o=""==l?'[playlist ids="-1"]':'[playlist ids="'+JSON.parse(l).join()+'"]',s=wp.shortcode.next("playlist",o).shortcode,n=wp.media.playlist.defaults.id,r=null,a=null;_.isUndefined(s.get("id"))&&!_.isUndefined(n)&&s.set("id",n),r=wp.media.playlist.attachments(s),a=new wp.media.model.Selection(r.models,{props:r.props.toJSON(),multiple:!0}),a.playlist=r.playlist,a.more().done(function(){a.props.set({query:!1}),a.unmirror(),a.props.unset("orderby")}),FLBuilder._multipleAudiosSelector&&FLBuilder._multipleAudiosSelector.dispose(),FLBuilder._multipleAudiosSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-audios-edit")?"playlist-edit":"playlist-library",title:wp.media.view.l10n.editPlaylistTitle,editing:!0,multiple:!0,selection:a}).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",e.proxy(FLBuilder._multipleAudiosSelected,this))},_multipleAudiosSelected:function(t){for(var i=e(this).closest(".fl-multiple-audios-field"),l=i.find(".fl-multiple-audios-count"),o=i.find("input[type=hidden]"),s=[],n=0;n<t.models.length;n++)s.push(t.models[n].id);1==s.length?l.html("1 "+FLBuilderStrings.audioSelected):l.html(s.length+" "+FLBuilderStrings.audiosSelected),o.val(JSON.stringify(s)).trigger("change"),i.removeClass("fl-multiple-audios-empty"),i.find("label.error").remove()},_selectIcon:function(){var e=this;FLIconSelector.open(function(t){FLBuilder._iconSelected.apply(e,[t])})},_iconSelected:function(t){var i=e(this).closest(".fl-icon-field"),l=i.find("input[type=hidden]"),o=i.find("i"),s=o.attr("data-icon");l.val(t).trigger("change"),o.removeClass(s),o.addClass(t),o.attr("data-icon",t),i.removeClass("fl-icon-empty"),i.find("label.error").remove()},_removeIcon:function(){var t=e(this).closest(".fl-icon-field"),i=t.find("input[type=hidden]"),l=t.find("i");i.val("").trigger("change"),l.removeClass(),l.attr("data-icon",""),t.addClass("fl-icon-empty")},_formFieldClicked:function(){var t=e(this),i=t.closest(".fl-builder-settings"),l=t.attr("data-type"),o=t.siblings("input").val(),s=FLBuilder._moduleHelpers[l],n=(FLBuilderSettingsConfig.forms[l],FLBuilder._openNestedSettings({className:"fl-builder-lightbox fl-form-field-settings"}));""===o&&(o=JSON.stringify(FLBuilderSettingsConfig.forms[l])),FLBuilderSettingsForms.render({id:l,nodeId:i.attr("data-node"),nodeSettings:FLBuilder._getSettings(i),settings:JSON.parse(o.replace(/'/g,"'")),lightbox:n,helper:s,rules:s?s.rules:null},function(){t.attr("id","fl-"+n._node.attr("data-instance-id")),n._node.find("form.fl-builder-settings").attr("data-type",l)})},_saveFormFieldClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=e(this).closest(".fl-lightbox-wrap").attr("data-instance-id"),l=t.attr("data-type"),o=FLBuilder._getSettings(t),s={},n=FLBuilder._moduleHelpers[l],r=e(".fl-builder-settings #fl-"+i),a=r.parent().attr("data-preview-text"),d=t.find("#fl-field-"+a),u=o[a],c=e('select[name="'+a+'"]'),h=document.createElement("div"),f=!0;return c.length>0&&(u=c.find('option[value="'+o[a]+'"]').text()),"undefined"!=typeof n&&(t.find("label.error").remove(),t.validate().hideErrors(),f=t.validate().form(),f&&(f=n.submit())),f?("undefined"!=typeof a&&"undefined"!=typeof u&&("icon"===d.data("type")?u='<i class="'+u+'"></i>':u.length>35&&(h.innerHTML=u,u=(h.textContent||h.innerText||"").replace(/^(.{35}[^\s]*).*/,"$1")+"..."),r.siblings(".fl-form-field-preview-text").html(u)),s=r.siblings("input").val().replace(/'/g,"'"),""!=s&&(o=e.extend(JSON.parse(s),o)),r.siblings("input").val(JSON.stringify(o)).trigger("change"),FLBuilder._closeNestedSettings(),!0):(FLBuilder._toggleSettingsTabErrors(),!1)},_layoutFieldClicked:function(){var t=e(this);t.siblings().removeClass("fl-layout-field-option-selected"),t.addClass("fl-layout-field-option-selected"),t.siblings("input").val(t.attr("data-value"))},_initLinkFields:function(){e(".fl-builder-settings:visible .fl-link-field").each(FLBuilder._initLinkField)},_initLinkField:function(){var t=e(this),i=t.find(".fl-link-field-search-input");i.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:"fl_as_links",_wpnonce:FLBuilderConfig.ajaxNonce}),{asHtmlID:i.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})},_updateLinkField:function(e,t,i){var l=e.closest(".fl-link-field"),o=l.find(".fl-link-field-search"),s=l.find(".fl-link-field-search-input"),n=l.find(".fl-link-field-input");n.val(t.value).trigger("keyup"),s.autoSuggest("remove",t.value),o.hide()},_linkFieldSelectClicked:function(){var t=e(this).closest(".fl-link-field").find(".fl-link-field-search");t.show(),t.find("input").focus()},_linkFieldSelectCancelClicked:function(){var t=e(this);t.parent().hide(),t.closest(".fl-link-field").find("input.fl-link-field-input").focus()},_initFontFields:function(){e(".fl-builder-settings:visible .fl-font-field").each(FLBuilder._initFontField)},_initFontField:function(){var t=e(this),i=t.attr("data-value"),l=t.find(".fl-font-field-font"),o=t.find(".fl-font-field-weight");l.on("change",function(){FLBuilder._getFontWeights(l)}),i.indexOf("family")>-1&&(i=JSON.parse(i),l.val(i.family),l.trigger("change"),o.find("option[value="+i.weight+"]").length&&o.val(i.weight))},_getFontWeights:function(t){var i=t.next(".fl-font-field-weight"),l=t.val(),o={"default":"Default",regular:"Regular",100:"Thin 100",200:"Extra-Light 200",300:"Light 300",400:"Normal 400",500:"Medium 500",600:"Semi-Bold 600",700:"Bold 700",800:"Extra-Bold 800",900:"Ultra-Bold 900"},s={};i.html(""),s="undefined"!=typeof FLBuilderFontFamilies.system[l]?FLBuilderFontFamilies.system[l].weights:"undefined"!=typeof FLBuilderFontFamilies.google[l]?FLBuilderFontFamilies.google[l]:FLBuilderFontFamilies["default"][l],e.each(s,function(e,t){i.append('<option value="'+t+'">'+o[t]+"</option>")})},_initTinyMCE:function(){tinymce.ui.FloatPanel&&(tinymce.ui.FloatPanel.zIndex=100100),e(".fl-builder-hidden-editor").each(FLBuilder._initEditorField)},_initEditorFields:function(){e(".fl-builder-settings:visible .fl-editor-field").each(FLBuilder._initEditorField)},_initEditorField:function(){var t=e(this),i=t.find("textarea"),l=t.attr("data-name"),o="flrich"+(new Date).getTime()+"_"+l,s=FLBuilderConfig.wp_editor,n=tinyMCEPreInit,r=Number(t.attr("data-buttons")),a=t.attr("data-rows"),d=null,u=null;s=s.replace(/flbuildereditor/g,o),n=JSON.parse(JSON.stringify(n).replace(/flbuildereditor/g,o)),i.after(s).remove(),e("textarea#"+o).val(i.val()),void 0!==typeof tinymce&&void 0!==n.mceInit[o]&&(d=n.mceInit[o],u=tinymce.$("#wp-"+o+"-wrap"),u.find("textarea").attr("rows",a),r||u.find(".wp-media-buttons").remove(),!u.hasClass("tmce-active")&&n.qtInit.hasOwnProperty(o)||d.wp_skip_init||tinymce.init(d)),void 0!==typeof quicktags&&quicktags(n.qtInit[o]),window.wpActiveEditor=o},_reinitEditorFields:function(){e(".fl-lightbox-resizable:visible").length&&setTimeout(function(){var t,i;if("undefined"!=typeof tinymce){for(t=tinymce.editors.length-1;t>-1;t--)tinymce.editors[t].inline||(i=tinymce.editors[t].id,tinyMCE.execCommand("mceRemoveEditor",!0,i),tinyMCE.execCommand("mceAddEditor",!0,i));FLBuilder.preview&&FLBuilder.preview._initDefaultFieldPreviews(e('.fl-field[data-type="editor"]'))}},1)},_destroyEditorFields:function(){var t;if("undefined"!=typeof tinymce){for(t=tinymce.editors.length-1;t>-1;t--)tinymce.editors[t].inline||tinyMCE.execCommand("mceRemoveEditor",!0,tinymce.editors[t].id);e(".wplink-autocomplete").remove(),e(".ui-helper-hidden-accessible").remove()}},_updateEditorFields:function(){var t=e(".fl-builder-settings:visible textarea.wp-editor-area");t.each(FLBuilder._updateEditorField)},_updateEditorField:function(){var t=e(this),i=t.closest(".fl-editor-field"),l=(t.closest(".fl-builder-settings"),t.closest(".wp-editor-wrap")),o=t.attr("id"),s=i.attr("data-name"),n="undefined"!=typeof tinymce&&tinymce.get(o),r=t.siblings('textarea[name="'+s+'"]'),a=i.data("wpautop");0===r.length&&(r=e('<textarea name="'+s+'"></textarea>').hide(),t.after(r)),a?n&&l.hasClass("tmce-active")?r.val(n.getContent()):"undefined"!=typeof switchEditors?r.val(switchEditors.wpautop(t.val())):r.val(t.val()):(n&&l.hasClass("tmce-active")&&n.save(),r.val(t.val()))},_loopDataSourceChange:function(){var t=e(this).val();e(".fl-loop-data-source").hide(),e('.fl-loop-data-source[data-source="'+t+'"]').show()},_customQueryPostTypeChange:function(){var t=e(this).val();e(".fl-custom-query-filter").hide(),e(".fl-custom-query-"+t+"-filter").show()},_initOrderingFields:function(){e(".fl-builder-settings:visible .fl-ordering-field-options").each(FLBuilder._initOrderingField)},_initOrderingField:function(){e(this).sortable({items:".fl-ordering-field-option",containment:"parent",tolerance:"pointer",stop:FLBuilder._updateOrderingField})},_updateOrderingField:function(t){var i=e(t.target),l=i.siblings("input[type=hidden]"),o=[];i.find(".fl-ordering-field-option").each(function(){o.push(e(this).attr("data-key"))}),l.val(JSON.stringify(o)).trigger("change")},_onNumberFieldFocus:function(t){var i=e(t.currentTarget);i.addClass("mousetrap"),Mousetrap.bind("up",function(){i.attr("step",1)}),Mousetrap.bind("down",function(){i.attr("step",1)}),Mousetrap.bind("shift+up",function(){i.attr("step",10)}),Mousetrap.bind("shift+down",function(){i.attr("step",10)})},_onNumberFieldBlur:function(t){var i=e(t.currentTarget);i.attr("step",1).removeClass("mousetrap")},_initTimezoneFields:function(){e(".fl-builder-settings:visible .fl-field[data-type=timezone]").each(FLBuilder._initTimezoneField)},_initTimezoneField:function(){var t=e(this).find("select"),i=t.attr("data-value");t.find('option[value="'+i+'"]').attr("selected","selected")},ajax:function(t,i){var l;FLBuilder.triggerHook("didBeginAJAX",t);for(l in t)"undefined"==typeof t[l]&&(t[l]=null);return t._wpnonce=FLBuilderConfig.ajaxNonce,t.post_id=FLBuilderConfig.postId,t.fl_builder=1,t.fl_action=t.action,"undefined"!=typeof t.settings&&(t.settings=FLBuilder._ajaxModSecFix(e.extend(!0,{},t.settings))),"undefined"!=typeof t.node_settings&&(t.node_settings=FLBuilder._ajaxModSecFix(e.extend(!0,{},t.node_settings))),t={fl_builder_data:t},e.post(FLBuilder._ajaxUrl(),t,function(e){FLBuilder._ajaxComplete(),"undefined"!=typeof i&&i.call(this,e),FLBuilder.triggerHook("didCompleteAJAX",t)})},_ajaxComplete:function(){FLBuilder.hideAjaxLoader()},_ajaxUrl:function(e){var t=window.location.href.split("#").shift(),i=null;if("undefined"!=typeof e)for(i in e)t+=t.indexOf("?")>-1?"&":"?",t+=i+"="+e[i];return t},showAjaxLoader:function(){0===e(".fl-builder-lightbox-loading").length&&e(".fl-builder-loading").show()},hideAjaxLoader:function(){e(".fl-builder-loading").hide()},_showNodeLoading:function(t){var i=e(".fl-node-"+t);i.addClass("fl-builder-node-loading"),FLBuilder.triggerHook("didStartNodeLoading",i)},_hideNodeLoading:function(t){var i=e(".fl-node-"+t);i.removeClass("fl-builder-node-loading")},_showNodeLoadingPlaceholder:function(t,i){var l=e('<div class="fl-builder-node-loading-placeholder"></div>');t.hasClass("fl-builder-content")?siblings=t.find(" > .fl-row"):t.hasClass("fl-row-content")?siblings=t.find(" > .fl-col-group"):t.hasClass("fl-col-group")?(t.addClass("fl-col-group-has-child-loading"),siblings=t.find(" > .fl-col")):siblings=t.find(" > .fl-col-group, > .fl-module"),0===siblings.length||siblings.length==i?t.append(l):siblings.eq(i).before(l)},_removeNodeLoadingPlaceholder:function(e){var t=e.prev(".fl-builder-node-loading-placeholder"),i=e.next(".fl-builder-node-loading-placeholder");t.length?t.remove():i.remove()},_ajaxModSecFix:function(e){var t;if(FLBuilderConfig.modSecFix&&"undefined"!=typeof btoa)if("string"==typeof e)e=FLBuilder._btoa(e);else for(t in e)"string"==typeof e[t]?e[t]=FLBuilder._btoa(e[t]):"object"==typeof e[t]&&(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(){e(".upload-error").remove(),e(".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(){FLBuilder._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),FLBuilder._initLightboxScrollbars()},_setLightboxContent:function(e){FLBuilder._lightbox.setContent(e)},_initLightboxScrollbars:function(){FLBuilder._initScrollbars(),FLBuilder._lightboxScrollbarTimeout=setTimeout(FLBuilder._initLightboxScrollbars,500)},_lightboxClosed:function(){FLBuilder.triggerHook("settings-lightbox-closed"),FLBuilder._lightbox.empty(),clearTimeout(FLBuilder._lightboxScrollbarTimeout)},_showActionsLightbox:function(e){var t=wp.template("fl-actions-lightbox");FLBuilder.triggerHook("actions-lightbox-settings",e),FLBuilder._actionsLightbox.open(t(e))},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}))},_alertClose:function(){FLLightbox.closeParent(this)},confirm:function(t){var i={message:"",ok:function(){},cancel:function(){},strings:{ok:FLBuilderStrings.ok,cancel:FLBuilderStrings.cancel}},l=e.extend({},i,"undefined"==typeof t?{}:t);lightbox=new FLLightbox({className:"fl-builder-confirm-lightbox fl-builder-alert-lightbox",destroyOnClose:!0}),template=wp.template("fl-confirm-lightbox"),lightbox.open(template(l)),lightbox._node.find(".fl-builder-confirm-ok").on("click",l.ok),lightbox._node.find(".fl-builder-confirm-cancel").on("click",l.cancel)},triggerHook:function(t,i){e("body").trigger("fl-builder."+t,i)},addHook:function(t,i){e("body").on("fl-builder."+t,i)},removeHook:function(t,i){e("body").off("fl-builder."+t,i)},log:function(e){"undefined"!=typeof window.console&&"undefined"!=typeof window.console.log&&console.log(e)},logError:function(e){var t=null;"undefined"!=typeof e&&("undefined"!=typeof e.stack?t=e.stack:"undefined"!=typeof e.message&&(t=e.message),t&&(FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(t),FLBuilder.log("************************************************************************")))},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)),"undefined"!=typeof o&&"undefined"!=typeof o.stack&&(FLBuilder.log(o.stack),FLBuilder.log("************************************************************************"))}},e(function(){FLBuilder._init()})}(jQuery),function(e){FLBuilderAJAXLayout=function(t,i){this._data=e.extend({},this._defaults,"string"==typeof t?JSON.parse(t):t),this._callback=i,this._post=FLBuilderConfig.postId,this._head=e("head").eq(0),this._body=e("body").eq(0),this._data.css&&(this._loader=e('<img src="'+this._data.css+'" />'),this._oldCss=e('link[href*="/cache/'+this._post+'"]'),this._newCss=e('<link rel="stylesheet" id="fl-builder-layout-'+this._post+'-css" href="'+this._data.css+'" />')),this._data.partial?(this._data.js&&(this._oldJs=e("#fl-builder-partial-refresh-js"),this._newJs=e('<script type="text/javascript" id="fl-builder-partial-refresh-js">'+this._data.js+"</script>")),this._data.nodeId&&(this._data.oldNodeId?(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.oldNodeId+'"]'),this._content=e(".fl-node-"+this._data.oldNodeId)):(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.nodeId+'"]'),this._content=e(".fl-node-"+this._data.nodeId).eq(0)))):(this._oldJs=e('script[src*="/cache/'+this._post+'"]'),this._newJs=e('<script src="'+this._data.js+'"></script>'),this._oldScriptsStyles=e(".fl-builder-layout-scripts-styles"),this._content=e(FLBuilder._contentClass)),this._init()},FLBuilderAJAXLayout.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._loader?(this._loader.on("error",e.proxy(this._loadNewCSSComplete,this)),this._body.append(this._loader)):this._finish()},_loadNewCSSComplete:function(){this._loader.remove(),this._oldCss.length>0?this._oldCss.after(this._newCss):this._head.append(this._newCss),setTimeout(e.proxy(this._finish,this),250)},_finish:function(){this._removeOldContentAndAssets(),this._cleanNewHTML(),this._cleanNewAssets(),this._addNewHTML(),this._addNewScriptsStyles(),this._addNewJS(),e(FLBuilder._contentClass).trigger("fl-builder.layout-rendered"),FLBuilder.hideAjaxLoader(),"undefined"!=typeof this._callback&&this._callback(),FLBuilder.triggerHook("didRenderLayoutComplete")},_removeOldContentAndAssets:function(){this._content&&this._content.empty(),this._oldCss&&this._oldCss.remove(),this._oldJs&&this._oldJs.remove(),this._oldScriptsStyles&&this._oldScriptsStyles.remove()},_cleanNewHTML:function(){if(this._data.scriptsStyles){var t=e("<div>"+this._data.html+"</div>"),i="fl-row",l=this._data.scriptsStyles,o="";this._data.partial&&(i="column-group"==this._data.nodeType?"fl-col-group":"column"==this._data.nodeType?"fl-col":"fl-"+this._data.nodeType),t.find("> *, script").each(function(){e(this).hasClass(i)||(o=e(this).remove(),l+=o[0].outerHTML)}),""!==l&&(l=this._data.partial?'<div class="fl-builder-node-scripts-styles" data-node="'+this._data.nodeId+'">'+l+"<div>":'<div class="fl-builder-node-scripts-styles">'+l+"<div>"),this._data.html=t.html(),this._data.scriptsStyles=l}},_addNewHTML:function(){var t;if(this._data.partial?this._data.nodeParent?(t=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"),t=t.filter(":not(.fl-builder-node-clone)"),0===t.length||t.length==this._data.nodePosition?this._data.nodeParent.append(this._data.html):t.eq(this._data.nodePosition).before(this._data.html),this._data.nodeId&&FLBuilder._removeNodeLoadingPlaceholder(e(".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){var i=e(FLBuilder.preview.classes.node),l=i.closest(".fl-node-"+this._data.nodeId).length;l&&i.html(FLBuilder.preview.elements.node.html())}},_cleanNewAssets:function(){var t=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?e(".fl-builder-node-scripts-styles").each(function(){t._data.html.indexOf("fl-node-"+e(this).data("node"))>-1&&e(this).remove()}):(e("#fl-builder-partial-refresh-js").remove(),e(".fl-builder-node-scripts-styles").remove())},_removeDuplicateAssets:function(t){var i=e("<div>"+t+"</div>"),l="",o=null,s="",n=null,r=window.location,a=r.protocol+"//"+r.hostname+(r.port?":"+r.port:"");return i.find("script").each(function(){l=e(this).attr("src"),"undefined"!=typeof l&&(l=l.replace(a,""),o=e('script[src*="'+l+'"]'),o.length>0&&e(this).remove())}),i.find("link").each(function(){s=e(this).attr("href"),"undefined"!=typeof s&&(s=s.replace(a,""),n=e('link[href*="'+s+'"]'),n.length>0&&e(this).remove())}),i.html()},_addNewScriptsStyles:function(){this._data.scriptsStyles&&""!==this._data.scriptsStyles&&this._body.append(this._data.scriptsStyles)},_addNewJS:function(){setTimeout(e.proxy(function(){this._newJs&&this._head.append(this._newJs)},this),50)},_complete:function(){FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._resizeLayout(),FLBuilder._initMediaElements(),FLBuilderLayout.init(),FLBuilderResponsiveEditing.refreshPreview(),this._body.height("auto")}}}(jQuery),function(e){FLBuilderPreview=function(e){this.type=e.type,this._saveState(),e.layout?FLBuilder._renderLayout(e.layout,function(){this._init(),e.callback&&e.callback()}.bind(this)):this._init()},FLBuilderPreview._fontsList={},FLBuilderPreview.getFormattedSelector=function(e,t){for(var i="",l=t.split(","),o=0;o<l.length;o++)l[o].indexOf("{node}")>-1?i=l[o].replace("{node}",e):i+=e+" "+l[o],o!=l.length-1&&(i+=", ");return i},FLBuilderPreview.prototype={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=e(".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()}},_saveSettings:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings");this._savedSettings=FLBuilder._getSettingsForChangedCheck(this.nodeId,t)},_settingsHaveChanged:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),i=FLBuilder._getSettings(t);return JSON.stringify(this._savedSettings)!=JSON.stringify(i)},_initElementsAndClasses:function(){var t;t="row"==this.type?".fl-row-content-wrap":".fl-"+this.type+"-content",e.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+" > "+t}),e.extend(this.elements,{settings:e(this.classes.settings),settingsHeader:e(this.classes.settingsHeader),node:e(this.classes.node),content:e(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._styleSheetResponsive||(this._styleSheetResponsive=new FLStyleSheet({id:"fl-builder-preview-responsive",
|
6 |
-
className:"fl-builder-preview-style"}))},_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)},updateCSSRule:function(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){var t=parseInt(e,16),i=t>>16&255,l=t>>8&255,o=255&t;return[i,l,o]},parseFloat:function(e){return isNaN(parseFloat(e))?0:parseFloat(e)},_initResponsivePreviews:function(){FLBuilder.addHook("responsive-editing-switched.preview",e.proxy(this._responsiveEditingSwitched,this))},_destroyResponsivePreviews:function(){FLBuilder.removeHook("responsive-editing-switched.preview")},_responsiveEditingSwitched:function(e,t){"default"==t?(this._styleSheetMedium.disable(),this._styleSheetResponsive.disable()):"medium"==t?(this._styleSheetMedium.enable(),this._styleSheetResponsive.disable()):"responsive"==t&&(this._styleSheetMedium.disable(),this._styleSheetResponsive.enable())},updateResponsiveCSSRule:function(e,t,i){var l=FLBuilderResponsiveEditing._mode,o="default"==l?"":l.charAt(0).toUpperCase()+l.slice(1);this["_styleSheet"+o].updateRule(e,t,i)},_saveState:function(){var t=FLBuilderConfig.postId,i=e('link[href*="/cache/'+t+'"]').attr("href"),l=e('script[src*="/cache/'+t+'"]').attr("src"),o=e(FLBuilder._contentClass).html();this.state={css:i,js:l,html:o}},preview:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),i=t.attr("data-node"),l=FLBuilder._getSettings(t);FLBuilder._showNodeLoading(i),this._cancelPreview(),this._xhr=FLBuilder.ajax({action:"render_layout",node_id:i,node_preview:l},e.proxy(this._renderPreview,this))},delayPreview:function(t){var i="undefined"==typeof t?[]:e(t.target).closest("tr").find("th"),l=e(".fl-builder-widget-settings .fl-builder-settings-title"),o=e(".fl-builder-settings .fl-lightbox-header"),s=FLBuilderLayoutConfig.paths.pluginUrl+"img/ajax-loader-small.svg",n=e('<img class="fl-builder-preview-loader" src="'+s+'" />');this.delay(1e3,e.proxy(this.preview,this)),this._loaderTimeout=setTimeout(function(){e(".fl-builder-preview-loader").remove(),i.length>0?i.append(n):l.length>0?l.append(n):o.length>0&&o.append(n)},1500)},_cancelPreview:function(){this._xhr&&(this._xhr.abort(),this._xhr=null)},_renderPreview:function(t){this._xhr=null,FLBuilder._renderLayout(t,e.proxy(this._renderPreviewComplete,this))},_renderPreviewComplete:function(){this._createSheets(),this._initElementsAndClasses(),null!==this._loaderTimeout&&clearTimeout(this._loaderTimeout),e(".fl-builder-preview-loader").remove(),e(FLBuilder._contentClass).trigger("fl-builder.preview-rendered")},revert:function(){return this._settingsHaveChanged()?void FLBuilder._updateNode(this.nodeId,function(){this.clear()}.bind(this)):void this.clear()},cancel:function(){this._cancelDelay(),this._cancelPreview()},clear:function(){this.cancel(),this._destroySheets(),this._destroyResponsivePreviews()},_initNodeTextColor:function(){e.extend(this.elements,{textColor:e(this.classes.settings+" input[name=text_color]"),linkColor:e(this.classes.settings+" input[name=link_color]"),hoverColor:e(this.classes.settings+" input[name=hover_color]"),headingColor:e(this.classes.settings+" input[name=heading_color]")}),this.elements.textColor.on("change",e.proxy(this._textColorChange,this)),this.elements.linkColor.on("change",e.proxy(this._textColorChange,this)),this.elements.hoverColor.on("change",e.proxy(this._textColorChange,this)),this.elements.headingColor.on("change",e.proxy(this._textColorChange,this))},_textColorChange:function(t){var i=this.elements.textColor.val(),l=this.elements.linkColor.val(),o=this.elements.hoverColor.val(),s=this.elements.headingColor.val();l=""===l?i:l,o=""===o?i:o,s=""===s?i:s,this.delay(100,e.proxy(function(){""===i?this.updateCSSRule(this.classes.node,"color","inherit"):this.updateCSSRule(this.classes.node,"color","#"+i),""===l?this.updateCSSRule(this.classes.node+" a","color","inherit"):this.updateCSSRule(this.classes.node+" a","color","#"+l),""===o?this.updateCSSRule(this.classes.node+" a:hover","color","inherit"):this.updateCSSRule(this.classes.node+" a:hover","color","#"+o),""===s?(this.updateCSSRule(this.classes.node+" h1","color","inherit"),this.updateCSSRule(this.classes.node+" h2","color","inherit"),this.updateCSSRule(this.classes.node+" h3","color","inherit"),this.updateCSSRule(this.classes.node+" h4","color","inherit"),this.updateCSSRule(this.classes.node+" h5","color","inherit"),this.updateCSSRule(this.classes.node+" h6","color","inherit"),this.updateCSSRule(this.classes.node+" h1 a","color","inherit"),this.updateCSSRule(this.classes.node+" h2 a","color","inherit"),this.updateCSSRule(this.classes.node+" h3 a","color","inherit"),this.updateCSSRule(this.classes.node+" h4 a","color","inherit"),this.updateCSSRule(this.classes.node+" h5 a","color","inherit"),this.updateCSSRule(this.classes.node+" h6 a","color","inherit")):(this.updateCSSRule(this.classes.node+" h1","color","#"+s),this.updateCSSRule(this.classes.node+" h2","color","#"+s),this.updateCSSRule(this.classes.node+" h3","color","#"+s),this.updateCSSRule(this.classes.node+" h4","color","#"+s),this.updateCSSRule(this.classes.node+" h5","color","#"+s),this.updateCSSRule(this.classes.node+" h6","color","#"+s),this.updateCSSRule(this.classes.node+" h1 a","color","#"+s),this.updateCSSRule(this.classes.node+" h2 a","color","#"+s),this.updateCSSRule(this.classes.node+" h3 a","color","#"+s),this.updateCSSRule(this.classes.node+" h4 a","color","#"+s),this.updateCSSRule(this.classes.node+" h5 a","color","#"+s),this.updateCSSRule(this.classes.node+" h6 a","color","#"+s))},this))},_initNodeBg:function(){e.extend(this.elements,{bgType:e(this.classes.settings+" select[name=bg_type]"),bgColor:e(this.classes.settings+" input[name=bg_color]"),bgColorPicker:e(this.classes.settings+" .fl-picker-bg_color"),bgOpacity:e(this.classes.settings+" input[name=bg_opacity]"),bgImageSrc:e(this.classes.settings+" select[name=bg_image_src]"),bgRepeat:e(this.classes.settings+" select[name=bg_repeat]"),bgPosition:e(this.classes.settings+" select[name=bg_position]"),bgAttachment:e(this.classes.settings+" select[name=bg_attachment]"),bgSize:e(this.classes.settings+" select[name=bg_size]"),bgVideoSource:e(this.classes.settings+" select[name=bg_video_source]"),bgVideo:e(this.classes.settings+" input[name=bg_video]"),bgVideoServiceUrl:e(this.classes.settings+" input[name=bg_video_service_url]"),bgVideoFallbackSrc:e(this.classes.settings+" select[name=bg_video_fallback_src]"),bgSlideshowSource:e(this.classes.settings+" select[name=ss_source]"),bgSlideshowPhotos:e(this.classes.settings+" input[name=ss_photos]"),bgSlideshowFeedUrl:e(this.classes.settings+" input[name=ss_feed_url]"),bgSlideshowSpeed:e(this.classes.settings+" input[name=ss_speed]"),bgSlideshowTrans:e(this.classes.settings+" select[name=ss_transition]"),bgSlideshowTransSpeed:e(this.classes.settings+" input[name=ss_transitionDuration]"),bgParallaxImageSrc:e(this.classes.settings+" select[name=bg_parallax_image_src]"),bgOverlayColor:e(this.classes.settings+" input[name=bg_overlay_color]"),bgOverlayOpacity:e(this.classes.settings+" input[name=bg_overlay_opacity]")}),this.elements.bgType.on("change",e.proxy(this._bgTypeChange,this)),this.elements.bgColor.on("change",e.proxy(this._bgColorChange,this)),this.elements.bgOpacity.on("keyup",e.proxy(this._bgOpacityChange,this)),this.elements.bgImageSrc.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgRepeat.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgPosition.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgAttachment.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgSize.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgVideoServiceUrl.on("change",e.proxy(this._bgVideoChange,this)),this.elements.bgSlideshowSource.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowPhotos.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowFeedUrl.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTrans.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTransSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgParallaxImageSrc.on("change",e.proxy(this._bgParallaxChange,this)),this.elements.bgOverlayColor.on("change",e.proxy(this._bgOverlayChange,this)),this.elements.bgOverlayOpacity.on("keyup",e.proxy(this._bgOverlayChange,this))},_bgTypeChange:function(e){var t=this.elements.bgType.val();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","background-image":"none"}),"none"==t?this._bgOverlayClear():"color"==t?(this.elements.bgColor.trigger("change"),this._bgOverlayClear()):"photo"==t?(this.elements.bgColor.trigger("change"),this.elements.bgImageSrc.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(t){var i,l,o;""===this.elements.bgColor.val()||isNaN(this.elements.bgOpacity.val())?this.updateCSSRule(this.classes.content,"background-color","transparent"):(i=this.hexToRgb(this.elements.bgColor.val()),l=this.parseFloat(this.elements.bgOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"background-color",o)},this)))},_bgOpacityChange:function(e){this.elements.bgColor.trigger("change")},_bgPhotoChange:function(e){this.elements.bgImageSrc.val()?this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgImageSrc.val()+")","background-repeat":this.elements.bgRepeat.val(),"background-position":this.elements.bgPosition.val(),"background-attachment":this.elements.bgAttachment.val(),"background-size":this.elements.bgSize.val()}):this.updateCSSRule(this.classes.content,{"background-image":"none"})},_bgVideoChange:function(t){var i=this.elements,l=i.bgVideoSource.val(),o=i.bgVideo.val(),s=i.bgVideoServiceUrl.val(),n="https://www.youtube.com/iframe_api",r="https://player.vimeo.com/api/player.js",a=e("<script>");"video_service"==l&&""!=s?(/^(?:(?:(?:https?:)?\/\/)?(?:www.)?(?:youtu(?:be.com|.be))\/(?:watch\?v\=|v\/|embed\/)?([\w\-]+))/i.test(s)&&e('script[src*="youtube.com"').length<1?a.attr("src",n):/^(http\:\/\/|https\:\/\/)?(www\.)?(vimeo\.com\/)([0-9]+)$/.test(s)&&e('script[src*="vimeo.com"').length<1&&a.attr("src",r),a.attr("type","text/javascript").appendTo("head"),this.delay(500,e.proxy(this.preview,this))):""!=o&&this.preview()},_bgSlideshowChange:function(t){var i=this.elements,l=i.bgSlideshowSource.val(),o=i.bgSlideshowPhotos.val(),s=i.bgSlideshowFeedUrl.val(),n=i.bgSlideshowSpeed.val(),r=i.bgSlideshowTransSpeed.val();"wordpress"==l&&""===o||"smugmug"==l&&""===s||isNaN(parseInt(n))||isNaN(parseInt(r))||this.delay(500,e.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(t){var i,l,o;""===this.elements.bgOverlayColor.val()||isNaN(this.elements.bgOverlayOpacity.val())?(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")):(i=this.hexToRgb(this.elements.bgOverlayColor.val()),l=this.parseFloat(this.elements.bgOverlayOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.elements.node.hasClass("fl-col")?this.elements.node.addClass("fl-col-bg-overlay"):this.elements.node.addClass("fl-row-bg-overlay"),this.updateCSSRule(this.classes.content+":after","background-color",o)},this)))},_bgOverlayClear:function(e){this.elements.bgOverlayColor.prev(".fl-color-picker-clear").trigger("click")},_initNodeBorder:function(){e.extend(this.elements,{borderType:e(this.classes.settings+" select[name=border_type]"),borderColor:e(this.classes.settings+" input[name=border_color]"),borderColorPicker:e(this.classes.settings+" .fl-picker-border_color"),borderOpacity:e(this.classes.settings+" input[name=border_opacity]")}),this.elements.borderType.on("change",e.proxy(this._borderTypeChange,this)),this.elements.borderColor.on("change",e.proxy(this._borderColorChange,this)),this.elements.borderOpacity.on("keyup",e.proxy(this._borderOpacityChange,this))},_borderTypeChange:function(e){var t=this.elements.borderType.val();this.updateCSSRule(this.classes.content,{"border-style":""===t?"none":t}),this.elements.borderColor.trigger("change"),this.elements.borderTop.trigger("keyup")},_borderColorChange:function(t){var i,l,o;""===this.elements.borderColor.val()||isNaN(this.elements.borderOpacity.val())?this.updateCSSRule(this.classes.content,"border-color","transparent"):(i=this.hexToRgb(this.elements.borderColor.val()),l=parseInt(this.elements.borderOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"border-color",o)},this)))},_borderOpacityChange:function(e){this.elements.borderColor.trigger("change")},_initNodeClassName:function(){e.extend(this.elements,{className:e(this.classes.settings+" input[name=class]")}),this.elements.className.on("keyup",e.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},_initResponsiveDimensions:function(t){var i={},l=["Top","Bottom","Left","Right"],o=["","Medium","Responsive"],s=this.classes.settings,n="",r="",a=null,d=null;for(a=0;a<l.length;a++)for(d=0;d<o.length;d++)n=t+l[a]+o[d],r=t+"_"+l[a].toLowerCase(),""!=o[d]&&(r+="_"+o[d].toLowerCase()),i[n]=e(s+" input[name="+r+"]"),i[n].on("keyup",e.proxy(this._responsiveDimensionChange,this,t));e.extend(this.elements,i)},_getDimensions:function(e){for(var t=FLBuilderResponsiveEditing._mode,i=["Top","Bottom","Left","Right"],l="default"==t?"":t.charAt(0).toUpperCase()+t.slice(1),o={},s=0;s<i.length;s++)o[i[s].toLowerCase()]=this.elements[e+i[s]+l].val();return this._normalizeDimensionValues(o,e)},_responsiveDimensionChange:function(t){var i=this._getDimensions(t),l={},o="border"==t;e.each(i,function(e,i){l[t+"-"+e+(o?"-width":"")]=i}),this.updateResponsiveCSSRule(this.classes.content,l),this._positionAbsoluteBgs()},_normalizeDimensionValues:function(t,i){var l=this,o=FLBuilderResponsiveEditing._mode,s="default"==o?"":o.charAt(0).toUpperCase()+o.slice(1),i=i.split("-");return"undefined"==typeof i[1]?i[1]="":i[1]=i[1].charAt(0).toUpperCase()+i[1].slice(1),e.map(t,function(e,o){if(e=e.toLowerCase().replace(/[^a-z0-9%.\-]/g,""),""===e){var n=i[0]+o.charAt(0).toUpperCase()+o.slice(1)+i[1]+s,r=l.elements[n].attr("placeholder");r&&(e=r)}null===e||""===e||isNaN(e)||(e=parseFloat(e)+"px"),t[o]=e}),t},_positionAbsoluteBgs:function(){var t=this.elements.node.find(".fl-bg-slideshow"),i=this.elements.node.find(".fl-bg-video"),l=null,o=null,s={top:0,bottom:0,left:0,right:0};(t.length>0||i.length>0)&&(l=this._getDimensions("margin"),o=this._getDimensions("border"),e.map(s,function(e,t){l[t]&&o[t]?s[t]="calc("+l[t]+"+"+o[t]+")":l[t]?s[t]=l[t]:o[t]&&(s[t]=o[t])}),t.length>0&&(this.updateCSSRule(this.classes.node+" .fl-bg-slideshow",s),FLBuilder._resizeLayout()),i.length>0&&this.updateCSSRule(this.classes.node+" .fl-bg-video",s))},_initRow:function(){e.extend(this.elements,{width:e(this.classes.settings+" select[name=width]"),contentWidth:e(this.classes.settings+" select[name=content_width]"),maxContentWidth:e(this.classes.settings+" input[name=max_content_width]"),height:e(this.classes.settings+" select[name=full_height]"),align:e(this.classes.settings+" select[name=content_alignment]")}),this.elements.width.on("change",e.proxy(this._rowWidthChange,this)),this.elements.contentWidth.on("change",e.proxy(this._rowContentWidthChange,this)),this.elements.maxContentWidth.on("keyup",e.proxy(this._rowMaxContentWidthChange,this)),this.elements.height.on("change",e.proxy(this._rowHeightChange,this)),this.elements.align.on("change",e.proxy(this._rowHeightChange,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_rowWidthChange:function(e){var t=this.elements.node,i=this.elements.maxContentWidth.val();"full"==this.elements.width.val()?(t.css("max-width","none"),t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"),""!==i?t.css("max-width",i+"px"):t.css("max-width",FLBuilderConfig.global.row_width+"px"))},_rowHeightChange:function(e){var t=this.elements.node;t.removeClass("fl-row-align-top"),t.removeClass("fl-row-align-center"),t.removeClass("fl-row-align-bottom"),"full"==this.elements.height.val()?(t.addClass("fl-row-full-height"),t.addClass("fl-row-align-"+this.elements.align.val())):t.removeClass("fl-row-full-height")},_rowContentWidthChange:function(e){var t=this.elements.content.find(".fl-row-content"),i=this.elements.maxContentWidth.val();"full"==this.elements.contentWidth.val()?(t.css("max-width","none"),t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"),""!==i?t.css("max-width",i+"px"):t.css("max-width",FLBuilderConfig.global.row_width+"px"))},_rowMaxContentWidthChange:function(e){var t=this.elements.node,i=this.elements.content.find(".fl-row-content"),l=this.elements.maxContentWidth.val();""==l?l=FLBuilderConfig.global.row_width+"px":l+="px","fixed"==this.elements.width.val()&&t.css("max-width",l),"fixed"==this.elements.contentWidth.val()&&i.css("max-width",l)},_initColumn:function(){e.extend(this.elements,{size:e(this.classes.settings+" input[name=size]"),columnHeight:e(this.classes.settings+" select[name=equal_height]"),columnAlign:e(this.classes.settings+" select[name=content_alignment]"),responsiveOrder:e(this.classes.settings+" select[name=responsive_order]")}),this.elements.size.on("keyup",e.proxy(this._colSizeChange,this)),this.elements.columnHeight.on("change",e.proxy(this._colHeightChange,this)),this.elements.columnAlign.on("change",e.proxy(this._colHeightChange,this)),this.elements.responsiveOrder.on("change",e.proxy(this._colResponsiveOrder,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_colSizeChange:function(){var t=8,i=100-t,l=parseFloat(this.elements.size.val()),o=this.elements.node.prev(".fl-col"),s=this.elements.node.next(".fl-col"),n=0===s.length?o:s,r=this.elements.node.siblings(".fl-col"),a=0;0===r.length||isNaN(l)||(r.each(function(){e(this).data("node")!=n.data("node")&&(i-=parseFloat(e(this)[0].style.width),a+=parseFloat(e(this)[0].style.width))}),l<t&&(l=t),l>i&&(l=i),n.css("width",100-a-l+"%"),this.elements.node.css("width",l+"%"))},_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._initResponsiveDimensions("margin")},_initDefaultFieldPreviews:function(e){for(var e=_.isUndefined(e)?this.elements.settings.find(".fl-field"):e,t=null,i=null,l=0;l<e.length;l++)t=e.eq(l),i=t.data("preview"),"refresh"==i.type&&this._initFieldRefreshPreview(t),"text"==i.type&&this._initFieldTextPreview(t),"css"==i.type&&this._initFieldCSSPreview(t),"widget"==i.type&&this._initFieldWidgetPreview(t),"font"==i.type&&this._initFieldFontPreview(t)},_initFieldRefreshPreview:function(t){var i=t.data("type"),l=t.data("preview"),o=e.proxy(this.delayPreview,this);switch(i){case"text":t.find("input[type=text]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"select":t.find("select").on("change",o);break;case"color":t.find(".fl-color-picker-value").on("change",o);break;case"photo":t.find("select").on("change",o);break;case"multiple-photos":t.find("input").on("change",o);break;case"photo-sizes":t.find("select").on("change",o);break;case"video":t.find("input").on("change",o);break;case"multiple-audios":t.find("input").on("change",o);break;case"icon":t.find("input").on("change",o);break;case"form":t.delegate("input","change",o);break;case"editor":this._addTextEditorCallback(t,l);break;case"code":t.find("textarea").on("change",o);break;case"post-type":t.find("select").on("change",o);break;case"suggest":t.find(".as-values").on("change",o),t.find("select").on("change",o);break;case"unit":case"dimension":t.find("input[type=number]").on("keyup",o);break;case"ordering":t.find("input[type=hidden]").on("change",o);break;default:t.on("change",o)}},_initFieldTextPreview:function(t){var i=t.data("type"),l=t.data("preview"),o=e.proxy(this._previewText,this,l);switch(i){case"text":t.find("input[type=text]").on("keyup",o);break;case"unit":t.find("input[type=number]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"code":t.find("textarea").on("change",o);break;case"editor":this._addTextEditorCallback(t,l)}},_previewText:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=e(l),s=e("<div>"+e(i.target).val()+"</div>");o.length>0?(s.find("script").remove(),o.html(s.html())):this.delayPreview(i)},_previewTextEditor:function(t,i,l){var o=this._getPreviewSelector(this.classes.node,t.selector),s=e(o),n="undefined"!=typeof tinyMCE?tinyMCE.get(i):null,r=e("#"+i),a="";s.length>0&&(a=e(n&&"none"==r.css("display")?"<div>"+n.getContent()+"</div>":"undefined"==typeof switchEditors||"undefined"==typeof switchEditors.wpautop?"<div>"+r.val()+"</div>":"<div>"+switchEditors.wpautop(r.val())+"</div>"),a.find("script").remove(),s.html(a.html()))},_addTextEditorCallback:function(t,i){var l=t.find("textarea.wp-editor-area").attr("id"),o=null;if("refresh"==i.type)o=e.proxy(this.delayPreview,this);else{if("text"!=i.type)return;o=e.proxy(this._previewTextEditor,this,i,l)}e("#"+l).on("keyup",o),"undefined"!=typeof tinyMCE&&(editor=tinyMCE.get(l),editor.on("change",o),editor.on("keyup",o))},_initFieldFontPreview:function(t){var i=t.data("type"),l=t.data("preview");l.id=t.attr("id");var o=e.proxy(this._previewFont,this,l);"font"==i&&t.find(".fl-font-field").on("change","select",o)},_previewFont:function(t,i){var l=e(i.delegateTarget),o=l.find(".fl-font-field-font"),s=e(o).find(":selected"),n=s.parent().attr("label"),r=l.find(".fl-font-field-weight"),a=t.id+"-"+this.nodeId,d=this._getPreviewSelector(this.classes.node,t.selector);"Google"==n&&this._buildFontStylesheet(a,o.val(),r.val()),"Default"==o.val()?(this.updateCSSRule(d,"font-family",""),this.updateCSSRule(d,"font-weight","")):(this.updateCSSRule(d,"font-family",o.val()),this.updateCSSRule(d,"font-weight",r.val()))},_buildFontStylesheet:function(t,i,l){var o=FLBuilderConfig.googleFontsUrl,s="",n={},r={};n[i]=[l],FLBuilderPreview._fontsList[t]=n,Object.keys(FLBuilderPreview._fontsList).forEach(function(e){var t=FLBuilderPreview._fontsList[e];Object.keys(t).forEach(function(e){var i=t[e];r[e]=r[e]||[],i=i.filter(function(t){return r[e].indexOf(t)<0}),r[e]=r[e].concat(i)})}),e.each(r,function(e,t){s+=e+":"+t.join()+"|"}),s=o+s.slice(0,-1).replace(" ","+"),e("#fl-builder-google-fonts-preview").length<1?e("<link>").attr("id","fl-builder-google-fonts-preview").attr("type","text/css").attr("rel","stylesheet").attr("href",s).appendTo("head"):e("#fl-builder-google-fonts-preview").attr("href",s)},_initFieldCSSPreview:function(e){var t=e.data("preview"),i=null;if("undefined"!=typeof t.rules)for(i in t.rules)this._initFieldCSSPreviewCallback(e,t.rules[i]);else this._initFieldCSSPreviewCallback(e,t)},_initFieldCSSPreviewCallback:function(t,i){switch(t.data("type")){case"text":t.find("input[type=text]").on("keyup",e.proxy(this._previewCSS,this,i));break;case"unit":t.find("input[type=number]").on("keyup",e.proxy(this._previewCSS,this,i));break;case"dimension":t.find("input[type=number]").on("keyup",e.proxy(this._previewDimensionCSS,this,i));break;case"select":t.find("select").on("change",e.proxy(this._previewCSS,this,i));break;case"color":t.find(".fl-color-picker-value").on("change",e.proxy(this._previewColor,this,i))}},_previewCSS:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=t.property,s="undefined"==typeof t.unit?"":t.unit,n=e(i.target),r=n.val();"%"===s&&"opacity"===o?r=parseInt(r)/100:""!==r&&(r+=s),n.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(l,o,r):this.updateCSSRule(l,o,r)},_previewDimensionCSS:function(t,i){var l=e.extend({},t),o=l.property,s=e(i.target).data("unit");"border-width"===o?l.property="border-"+s+"-width":l.property=o+"-"+s,this._previewCSS(l,i)},_previewColor:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=e(i.target),s=o.val(),n=""===s?"inherit":"#"+s;/^rgb/.test(s.replace(/\s+/g,""))&&(n=s),o.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(l,t.property,n):this.updateCSSRule(l,t.property,n)},_initFieldWidgetPreview:function(t){var i=e.proxy(this.delayPreview,this);t.find("input").on("keyup",i),t.find("input[type=checkbox]").on("click",i),t.find("textarea").on("keyup",i),t.find("select").on("change",i)},_getPreviewSelector:function(e,t){return FLBuilderPreview.getFormattedSelector(e,t)}}}(jQuery),function(e){var t={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,i.update(),this.queueSheets()?this.runQueue():this.applyStyles()},queueSheets:function(){for(var t=e("link, style"),i=null,l=null,o=null,s=null,n=null,r=null,a=null,d=!1,u=0,c=0;u<t.length;u++)if(element=t[u],i=element.href,l=element.id,o=element.tagName.toLowerCase(),s=element.rel,n=element.media,r=i?i:l?l:"style-"+u,a=!0,d=!1,"style"===o||i&&s&&"stylesheet"===s.toLowerCase()){for(c=0;c<this.ignored.length;c++)if(r.indexOf(this.ignored[c])>-1){d=!0;break}if(d)continue;for(c=0;c<this.reparsed.length;c++)if(r.indexOf(this.reparsed[c])>-1){this.sheets[r]=null;break}void 0!==this.sheets[r]&&this.sheets[r]||this.queue.push({element:t.eq(u),key:r,tagName:o,href:i,id:l,media:n})}return this.queue.length},runQueue:function(){var t;this.queue.length?(t=this.queue.shift(),"style"===t.tagName?(this.parse(t.element.html(),t),this.runQueue()):e.get(t.href,e.proxy(function(e){this.parse(e,t),this.runQueue()},this))):this.applyStyles()},parse:function(e,t){var i=this.regex,l=this.cleanStyles(e),o=l.match(i.media),s=o&&o.length||0,n=!s&&t.media,r=null,a=null,d=null,u="",c=0,h=0;for(o?u=l.replace(i.media,""):n&&"all"!=t.media?s=1:u=l,this.sheets[t.key]={element:t.element,key:t.key,tagName:t.tagName,href:t.href,id:t.id,all:u,queries:[]},c=0;c<s;c++)for(n?(r=t.media,l=this.convertURLs(l,t.href)):(r=o[c].match(i.findStyles)&&RegExp.$1,l=RegExp.$2&&this.convertURLs(RegExp.$2,t.href)),a=r.split(","),h=0;h<a.length;h++)r=a[h],d=r.split("(")[0].match(i.only)&&RegExp.$2,"print"!=d&&(r.replace(i.minmaxwh,"").match(i.other)||this.sheets[t.key].queries.push({minw:r.match(i.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:r.match(i.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),styles:l}))},applyStyles:function(){var t=e("head"),i=null,l=null,o=null,s=null,n=null,r=null,a=null,d=null,u=!1;this.clearStyles();for(s in this.sheets)if(i="",l=e("<style></style>"),o=this.sheets[s],o.queries.length&&this.width){for(i+=o.all,r=0;r<o.queries.length;r++)n=o.queries[r],a=n.minw,d=n.maxw,u=!1,a&&(a=parseFloat(a)*(a.indexOf("em")>-1?this.getEmPxValue():1),this.width>=a&&(i+=n.styles,u=!0)),d&&!u&&(d=parseFloat(d)*(d.indexOf("em")>-1?this.getEmPxValue():1),this.width<=d&&(i+=n.styles));this.styles.push(l),t.append(l),l.html(i),o.element.remove()}},clearStyles:function(){var t=e("head"),i=null,l=this.styles.slice(0);this.styles=[];for(i in this.sheets)this.sheets[i].element.parent().length||t.append(this.sheets[i].element);setTimeout(function(){for(var e=0;e<l.length;e++)l[e].empty(),l[e].remove()},50)},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("/")),t.length&&(t+="/"),e.replace(this.regex.urls,"$1"+t+"$2$3")):e},getEmPxValue:function(){if(this.emPxValue)return this.emPxValue;var e=null,t=window.document,i=t.documentElement,l=t.body,o=t.createElement("div"),s=i.style.fontSize,n=l&&l.style.fontSize,r=!1;return o.style.cssText="position:absolute;font-size:1em;width:1em",l||(l=r=t.createElement("body"),l.style.background="none"),i.style.fontSize="100%",l.style.fontSize="100%",l.appendChild(o),r&&i.insertBefore(l,i.firstChild),e=parseFloat(o.offsetWidth),r?i.removeChild(l):l.removeChild(o),i.style.fontSize=s,n?l.style.fontSize=n:l.style.fontSize="",this.emPxValue=e,e}},i={_functions:null,update:function(){var e;if(!this._functions){this._functions={};for(e in l)this._functions[e]=jQuery.fn[e]}if(t.width)for(e in l)jQuery.fn[e]=l[e];else for(e in this._functions)jQuery.fn[e]=this._functions[e]}},l={width:function(l){return void 0!=l?i._functions.width.call(this,l):e.isWindow(this[0])?t.width:i._functions.width.call(this)}};FLBuilderSimulateMediaQuery={ignore:function(e){t.ignore(e)},reparse:function(e){t.reparse(e)},update:function(e,i){t.update(e,i)}}}(jQuery),function(e){FLBuilderResponsiveEditing={_mode:"default",refreshPreview:function(){var t;e(".fl-responsive-preview").length&&"default"!=this._mode&&("responsive"==this._mode?(t=FLBuilderConfig.global.responsive_breakpoint>=320?320:FLBuilderConfig.global.responsive_breakpoint,FLBuilderSimulateMediaQuery.update(t)):"medium"==this._mode&&(t=FLBuilderConfig.global.medium_breakpoint>=769?769:FLBuilderConfig.global.medium_breakpoint,
|
7 |
-
FLBuilderSimulateMediaQuery.update(t)),FLBuilder._resizeLayout())},_init:function(){this._bind(),this._initMediaQueries()},_bind:function(){FLBuilder.addHook("settings-form-init",this._initSettingsForms),FLBuilder.addHook("settings-lightbox-closed",this._clearPreview),e("body").delegate(".fl-field-responsive-toggle","click",this._settingToggleClicked)},_initMediaQueries:function(){FLBuilderSimulateMediaQuery.ignore([FLBuilderConfig.pluginUrl,"fl-theme-builder","/wp-includes/","/wp-admin/","admin-bar-inline-css","ace-tm","ace_editor.css"]),FLBuilderSimulateMediaQuery.reparse([FLBuilderConfig.postId+"-layout-draft.css?",FLBuilderConfig.postId+"-layout-draft-partial.css?",FLBuilderConfig.postId+"-layout-preview.css?",FLBuilderConfig.postId+"-layout-preview-partial.css?","fl-builder-global-css","fl-builder-layout-css"])},_switchTo:function(t,i){var l=e("html"),o=e("body"),s=e(FLBuilder._contentClass),n=e(".fl-responsive-preview"),r=e(".fl-responsive-preview-mask"),a=e(".fl-content-placeholder"),d=null;if(FLBuilderResponsiveEditing._mode=t,"default"==t){if(0===a.length)return;l.removeClass("fl-responsive-preview-enabled"),a.after(s),a.remove(),n.remove(),r.remove()}else 0===n.length?(l.addClass("fl-responsive-preview-enabled"),s.after('<div class="fl-content-placeholder"></div>'),o.prepend(wp.template("fl-responsive-preview")()),e(".fl-responsive-preview").addClass("fl-preview-"+t),e(".fl-responsive-preview-content").append(s)):(n.removeClass("fl-preview-responsive fl-preview-medium"),n.addClass("fl-preview-"+t));"responsive"==t?(d=FLBuilderConfig.global.responsive_breakpoint>=360?360:FLBuilderConfig.global.responsive_breakpoint,s.width(d),FLBuilderSimulateMediaQuery.update(d,i)):"medium"==t?(d=FLBuilderConfig.global.medium_breakpoint>=769?769:FLBuilderConfig.global.medium_breakpoint,s.width(d),FLBuilderSimulateMediaQuery.update(d,i)):(s.width(""),FLBuilderSimulateMediaQuery.update(null,i)),this._setContentBackgroundColor(),FLBuilder._resizeLayout(),FLBuilder.triggerHook("responsive-editing-switched",t)},_setContentBackgroundColor:function(){var t=e(FLBuilder._contentClass),i=e(".fl-responsive-preview"),l=e(".fl-content-placeholder"),o=l.parents(),s="#fff",n=0;if(0===i.length)t.css("background-color","");else{for(;n<o.length&&(s=o.eq(n).css("background-color"),"rgba(0, 0, 0, 0)"==s);n++);t.css("background-color",s)}},_switchToAndScroll:function(t){var i=e(".fl-builder-settings").data("node"),l=void 0===i?void 0:e(".fl-node-"+i);FLBuilderResponsiveEditing._switchTo(t,function(){void 0!==l&&l&&setTimeout(function(){var t=e(window),i=e(".fl-responsive-preview-content");!i.length||t.height()<i.height()?e("html, body").animate({scrollTop:l.offset().top-100},250):scrollTo(0,0)},250)})},_clearPreview:function(){FLBuilderResponsiveEditing._switchToAndScroll("default")},_settingToggleClicked:function(){var t=e(this),i=t.data("mode");i="default"==i?"medium":"medium"==i?"responsive":"default",FLBuilderResponsiveEditing._switchAllSettingsTo(i),t.siblings(".fl-field-responsive-setting:visible").find("input").focus()},_switchAllSettingsTo:function(t){var i="dashicons-desktop dashicons-tablet dashicons-smartphone";e(".fl-field-responsive-toggle").removeClass(i),e(".fl-field-responsive-setting").hide(),i="default"==t?"dashicons-desktop":"medium"==t?"dashicons-tablet":"dashicons-smartphone",e(".fl-field-responsive-toggle").addClass(i).data("mode",t),e(".fl-field-responsive-setting-"+t).css("display","inline-block"),FLBuilderResponsiveEditing._switchToAndScroll(t)},_initSettingsForms:function(){var e=FLBuilderResponsiveEditing;Number(FLBuilderConfig.global.responsive_enabled)&&(e._initFields("dimension","input","keyup",e._spacingFieldKeyup,["margin","padding"]),e._initFields("dimension","input","keyup",e._textFieldKeyup),e._initFields("unit","input","keyup",e._textFieldKeyup)),e._switchAllSettingsTo(e._mode)},_initFields:function(t,i,l,o,s){for(var n=e(".fl-builder-settings"),r=n.find(".fl-field").has(".fl-field-responsive-setting"),a=null,d=null,u=0;u<r.length;u++)a=r.eq(u),d=a.attr("id").replace("fl-field-",""),"object"==typeof s&&e.inArray(d,s)<0||t==a.attr("data-type")&&void 0===a.attr("data-responsive-init")&&(a.find(".fl-field-responsive-setting-default "+i).on(l,o),a.find(".fl-field-responsive-setting-medium "+i).on(l,o),a.find(".fl-field-responsive-setting-responsive "+i).on(l,o),a.find(".fl-field-responsive-setting-default "+i).trigger(l),a.attr("data-responsive-init",1))},_getFields:function(t,i){var l=e(t).closest(".fl-field");return{"default":l.find(".fl-field-responsive-setting-default "+i),medium:l.find(".fl-field-responsive-setting-medium "+i),responsive:l.find(".fl-field-responsive-setting-responsive "+i)}},_textFieldKeyup:function(){var e=FLBuilderResponsiveEditing._getFields(this,"input");e["default"].each(function(t){var i=e["default"].eq(t).attr("placeholder"),l=e["default"].eq(t).val(),o=e.medium.eq(t).val();""==l?e.medium.eq(t).attr("placeholder",void 0===i?"":i):e.medium.eq(t).attr("placeholder",l),""==o?e.responsive.eq(t).attr("placeholder",e.medium.eq(t).attr("placeholder")):e.responsive.eq(t).attr("placeholder",o)})},_spacingFieldKeyup:function(){var t=e(".fl-builder-settings"),i="row",l=e(this).closest(".fl-field").attr("id").replace("fl-field-",""),o=FLBuilderResponsiveEditing._getFields(this,"input"),s=FLBuilderConfig.global,n=null,r=null,a=null,d=null;t.hasClass("fl-builder-row-settings")?i="row":t.hasClass("fl-builder-col-settings")?i="col":t.hasClass("fl-builder-module-settings")&&(i="module"),e.extend(s,{col_margins:0,col_margins_medium:"",col_margins_responsive:"",col_padding:0,col_padding_medium:"",col_padding_responsive:""}),n=i+"_"+l+("margin"===l?"s":""),r=s[n],a=s[n+"_medium"],d=s[n+"_responsive"],o["default"].each(function(e){var t=o["default"].eq(e).attr("name").split("_").pop(),n=o["default"].eq(e).val(),u=o.medium.eq(e).val(),c=(o.responsive.eq(e).val(),null),h=null;""===a&&(""!==n?o.medium.eq(e).attr("placeholder",n):""!==r&&o.medium.eq(e).attr("placeholder",r)),""===d&&("module"===i&&Number(s.auto_spacing)?(c=""===a?Number(r):a,h=""===u?Number(n):u,""!==h&&(h>c||h<0)?o.responsive.eq(e).attr("placeholder",c):""!==h?o.responsive.eq(e).attr("placeholder",h):o.responsive.eq(e).attr("placeholder",c)):(!Number(s.auto_spacing)||"padding"===l&&"top|bottom".indexOf(t)>-1)&&(""!==u?o.responsive.eq(e).attr("placeholder",u):""!==a?o.responsive.eq(e).attr("placeholder",a):""!==n?o.responsive.eq(e).attr("placeholder",n):""!==r&&o.responsive.eq(e).attr("placeholder",r)))})}},e(function(){FLBuilderResponsiveEditing._init()})}(jQuery),function(e){FLBuilderResponsivePreview={enter:function(){this.render()},exit:function(){this.destroy()},switchTo:function(t){var i=FLBuilderConfig.global,l=e("#fl-builder-preview-frame"),o="100%";"responsive"==t?(o=i.responsive_breakpoint>=360?360:i.responsive_breakpoint,l.width(o)):"medium"==t&&(o=i.medium_breakpoint>=769?769:i.medium_breakpoint,l.width(o)),l.width(o)},render:function(){var t=e("body"),i=FLBuilderConfig.previewUrl,l=e("#fl-builder-preview-mask, #fl-builder-preview-frame"),o=e('<div id="fl-builder-preview-mask"></div>'),s=e('<iframe id="fl-builder-preview-frame" src="'+i+'" frameborder="0"></iframe>');l.remove(),t.append(o),t.append(s)},destroy:function(){e("#fl-builder-preview-mask, #fl-builder-preview-frame").remove()}}}(jQuery),function(e){var t={init:function(){var t=e("body");t.delegate(".fl-builder-service-select","change",this._serviceChange),t.delegate(".fl-builder-service-connect-button","click",this._connectClicked),t.delegate(".fl-builder-service-account-select","change",this._accountChange),t.delegate(".fl-builder-service-account-delete","click",this._accountDeleteClicked),t.delegate(".fl-builder-campaign-monitor-client-select","change",this._campaignMonitorClientChange),t.delegate(".fl-builder-mailchimp-list-select","change",this._mailChimpListChange),t.delegate(".fl-builder-activecampaign-list_type-select","change",this._activeCampaignChange)},_startSettingsLoading:function(t){var i=e(".fl-builder-settings"),l=t.closest(".fl-builder-service-settings"),o=e(".fl-builder-service-error");i.append('<div class="fl-builder-loading"></div>'),l.addClass("fl-builder-service-settings-loading"),o.remove()},_finishSettingsLoading:function(){var t=e(".fl-builder-settings"),i=e(".fl-builder-service-settings-loading");t.find(".fl-builder-loading").remove(),i.removeClass("fl-builder-service-settings-loading")},_serviceChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this),o=l.closest("tr"),s=l.val();o.siblings("tr.fl-builder-service-account-row").remove(),o.siblings("tr.fl-builder-service-connect-row").remove(),o.siblings("tr.fl-builder-service-field-row").remove(),e(".fl-builder-service-error").remove(),""!==s&&(t._startSettingsLoading(l),FLBuilder.ajax({action:"render_service_settings",node_id:i,service:s},t._serviceChangeComplete))},_serviceChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row");s.after(l.html),t._addAccountDelete(o),t._finishSettingsLoading()},_connectClicked:function(){for(var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-connect-row"),n=l.find(".fl-builder-service-connect-input"),r=null,a=null,d=0,u={action:"connect_service",node_id:i,service:o.val(),fields:{}};d<n.length;d++)r=n.eq(d),a=r.attr("name"),u.fields[a]=r.val();s.hide(),t._startSettingsLoading(o),FLBuilder.ajax(u,t._connectComplete)},_connectComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row"),n=o.find(".fl-builder-service-select"),r=o.find(".fl-builder-service-account-row"),a=o.find(".fl-builder-service-account-select"),d=o.find(".fl-builder-service-connect-row");l.error?(d.show(),0===a.length?n.after('<div class="fl-builder-service-error">'+l.error+"</div>"):a.after('<div class="fl-builder-service-error">'+l.error+"</div>")):(d.remove(),r.remove(),s.after(l.html)),t._addAccountDelete(o),t._finishSettingsLoading()},_accountChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-connect-row"),r=l.find("tr.fl-builder-service-field-row"),a=e(".fl-builder-service-error"),d=s.val(),u=null;n.remove(),r.remove(),a.remove(),"add_new_account"==d?u={action:"render_service_settings",node_id:i,service:o.val(),add_new:!0}:""!==d&&(u={action:"render_service_fields",node_id:i,service:o.val(),account:d}),u&&(t._startSettingsLoading(o),FLBuilder.ajax(u,t._accountChangeComplete)),t._addAccountDelete(l)},_accountChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-account-row");s.after(l.html),t._finishSettingsLoading()},_addAccountDelete:function(e){var t=e.find(".fl-builder-service-account-select");t.length>0&&(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 i=e(this).closest(".fl-builder-service-settings"),l=i.find(".fl-builder-service-select"),o=i.find(".fl-builder-service-account-select");confirm(FLBuilderStrings.deleteAccountWarning)&&(FLBuilder.ajax({action:"delete_service_account",service:l.val(),account:o.val()},t._accountDeleteComplete),t._startSettingsLoading(o))},_accountDeleteComplete:function(){var i=e(".fl-builder-service-settings-loading"),l=i.find(".fl-builder-service-select");t._finishSettingsLoading(),l.trigger("change")},_campaignMonitorClientChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=e(this),r=l.find(".fl-builder-service-list-select"),a=n.val();0!==r.length&&r.closest("tr").remove(),""!==a&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),client:a},t._campaignMonitorClientChangeComplete))},_campaignMonitorClientChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-campaign-monitor-client-select");s.closest("tr").after(l.html),t._finishSettingsLoading()},_mailChimpListChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-list-select");e(".fl-builder-mailchimp-group-select").closest("tr").remove(),""!==n.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),list_id:n.val()},t._mailChimpListChangeComplete))},_mailChimpListChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-list-select");s.closest("tr").after(l.html),t._finishSettingsLoading()},_activeCampaignChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-list-select");list_type=l.find('select[name="list_type"]'),0!==n.length&&n.closest("tr").remove(),""!==list_type.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),list_type:list_type.val()},t._activeCampaignTypeChangeComplete))},_activeCampaignTypeChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-field-row");s.after(l.html),t._finishSettingsLoading()}};e(function(){t.init()})}(jQuery),function(e){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 t={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:first-of-type",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-row:first-of-type .fl-module-overlay .fl-block-overlay-actions",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent2,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".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"),e(".fl-row").eq(0).trigger("mouseleave"),e(".fl-module").eq(0).trigger("mouseleave")}},{animation:!1,element:".fl-builder-templates-button",placement:"bottom",title:FLBuilderStrings.tourTemplatesButtonTitle,content:FLBuilderStrings.tourTemplatesButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-tools-button",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 FLBuilderConfig.lite?t.steps.shift():"disabled"==FLBuilderConfig.enabledTemplates?t.steps.shift():"fl-builder-template"==FLBuilderConfig.postType&&t.steps.shift(),t},_onStart:function(){var t=e("body");t.scrollTop(0),t.append('<div class="fl-builder-tour-mask"></div>'),0===e(".fl-row").length&&"module"!=FLBuilderConfig.userTemplateType&&(e(".fl-builder-content").append('<div class="fl-builder-tour-demo-content fl-row fl-row-fixed-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())},_onPrev:function(){e(".fl-builder-tour-dimmed").remove()},_onNext:function(){e(".fl-builder-tour-dimmed").remove()},_onEnd:function(){e("body").off("fl-builder.template-selector-loaded"),e(".fl-builder-tour-mask").remove(),e(".fl-builder-tour-dimmed").remove(),e(".fl-builder-tour-demo-content").remove(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._showPanel(),FLBuilder._initTemplateSelector()},_dimSection:function(t){e(t).find(".fl-builder-tour-dimmed").remove(),e(t).append('<div class="fl-builder-tour-dimmed"></div>')}}}(jQuery),function(e,t){String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),e.fn.textWidth=function(t,i){return e.fn.textWidth.fakeEl||(e.fn.textWidth.fakeEl=e("<span>").hide().appendTo(document.body)),e.fn.textWidth.fakeEl.text(t||this.val()||this.text()).css("font",i||this.css("font")),e.fn.textWidth.fakeEl.width()},FLExtendableObject={create:function(t){var i=Object.create(this);return i=e.extend(i,t),e(this).trigger("onCreate"),i}},e.fn.switchClass=function(t,i){return this.each(function(){return e(this).removeClass(function(e,i){var l=[],o=i.split(" ");for(var e in o)o[e].startsWith(t)&&l.push(o[e]);return l.join(" ")}),e(this).addClass(t+i)})};var i={init:function(){t.addHook("cancelTask",this.onCancelTask.bind(this)),t.addHook("showSavedMessage",this.onSaveShortcut.bind(this)),t.addHook("goToNextTab",this.onNextPrevTabShortcut.bind(this,"next")),t.addHook("goToPrevTab",this.onNextPrevTabShortcut.bind(this,"prev")),t.addHook("endEditingSession",this.onEndEditingSession.bind(this)),t.addHook("restartEditingSession",this.onRestartEditingSession.bind(this)),this.setDefaultKeyboardShortcuts()},addShortcut:function(t,i,l){var o=e.proxy(this,"onTriggerKey",t);l?Mousetrap.bindGlobal(i,o):Mousetrap.bind(i,o)},reset:function(){Mousetrap.reset()},setDefaultKeyboardShortcuts:function(){this.reset();for(var e in FLBuilderConfig.keyboardShortcuts){var t=FLBuilderConfig.keyboardShortcuts[e].keyCode,i=FLBuilderConfig.keyboardShortcuts[e].isGlobal;this.addShortcut(e,t,i)}},onTriggerKey:function(e,i){t.triggerHook(e),i.preventDefault?i.preventDefault():i.returnValue=!1},onCancelTask:function(){return s.isPreviewing?void s.endPreview():o.isShowing?void o.hide():t.ContentPanel.isShowing?void t.ContentPanel.hide():void 0},pause:function(){Mousetrap.pause()},unpause:function(){Mousetrap.unpause()},onEndEditingSession:function(){this.reset(),this.addShortcut("restartEditingSession","mod+e")},onRestartEditingSession:function(){this.reset(),this.setDefaultKeyboardShortcuts()},onSaveShortcut:function(){if(t.SaveManager.layoutNeedsPublish()){var e=FLBuilderStrings.savedStatus.hasAlreadySaved;t.SaveManager.showStatusMessage(e),setTimeout(function(){t.SaveManager.resetStatusMessage()},2e3)}else{var e=FLBuilderStrings.savedStatus.nothingToSave;t.SaveManager.showStatusMessage(e),setTimeout(function(){t.SaveManager.resetStatusMessage()},2e3)}},onNextPrevTabShortcut:function(i,l){var o,s,n=e(".fl-lightbox:visible"),r=n.find(".fl-builder-settings-tabs a");n.length>0&&(o=r.filter("a.fl-active"),s="next"==i?o.is(r.last())?r.first():o.next("a"):o.is(r.first())?r.last():o.prev("a"),s.trigger("click")),t._calculateSettingsTabsOverflow(),l.preventDefault()}},l={isShowing:!1,init:function(){this.render(),t.addHook("showKeyboardShortcuts",this.show.bind(this))},render:function(){var t=wp.template("fl-keyboard-shortcuts"),i=FLBuilderConfig.keyboardShortcuts;this.$el=e(t(i)),e("body").append(this.$el),this.$el.find(".dismiss-shortcut-ui").on("click",this.hide.bind(this)),this.$el.on("click",this.hide.bind(this))},show:function(){this.isShowing||(this.$el.addClass("is-showing"),this.isShowing=!0)},hide:function(){this.isShowing&&(this.$el.removeClass("is-showing"),this.isShowing=!1)},toggle:function(){this.isShowing?this.hide():this.show()}},o=FLExtendableObject.create({isShowing:!1,init:function(){this.$el=e(".fl-builder-publish-actions"),this.$defaultBarButtons=e(".fl-builder-bar-actions"),this.$clickAwayMask=e(".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",this.onActionClicked.bind(this)),t.addHook("triggerDone",this.onDoneTriggered.bind(this));var i=this.hide.bind(this);t.addHook("cancelPublishActions",i),t.addHook("endEditingSession",i),this.$clickAwayMask.on("click",i)},onDoneTriggered:function(){t.SaveManager.layoutNeedsPublish()?this.show():FLBuilderConfig.shouldRefreshOnPublish?t._exit():t._exitWithoutRefresh()},show:function(){this.isShowing||t._triggerSettingsSave(!1,!0)&&(this.$el.removeClass("is-hidden"),this.$defaultBarButtons.css("opacity","0"),this.$clickAwayMask.show(),this.isShowing=!0,t.triggerHook("didShowPublishActions"))},hide:function(){this.isShowing&&(this.$el.addClass("is-hidden"),this.$defaultBarButtons.css("opacity","1"),this.$clickAwayMask.hide(),this.isShowing=!1)},onActionClicked:function(i){var l=e(i.currentTarget).data("action");switch(l){case"dismiss":this.hide();break;case"discard":this.hide(),s.muteToolbar(),t._discardButtonClicked();break;case"publish":this.hide(),s.muteToolbar(),t._publishButtonClicked(),t._destroyOverlayEvents();break;case"draft":this.hide(),s.muteToolbar(),t._draftButtonClicked();break;default:this.hide(),s.muteToolbar(),t._draftButtonClicked()}t.triggerHook(l+"ButtonClicked")}}),s={isPreviewing:!1,init:function(){this.$el=e("body"),this.$mainToolbar=e(".fl-builder-bar"),this.$mainToolbarContent=this.$mainToolbar.find(".fl-builder-bar-content"),this.$wpAdminBar=e("#wpadminbar"),this.$endPreviewBtn=e(".fl-builder--preview-actions .end-preview-btn"),t.addHook("endEditingSession",this.endEditingSession.bind(this)),t.addHook("previewLayout",this.togglePreview.bind(this)),this.$endPreviewBtn.on("click",this.endPreview.bind(this)),this.$deviceIcons=e(".fl-builder--preview-actions i"),this.$deviceIcons.on("click",this.onDeviceIconClick.bind(this));var i=this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a, #wp-admin-bar-fl-theme-builder-frontend-edit-link > a");i.on("click",this.onClickPageBuilderToolbarLink.bind(this)),e("#wpadminbar a").attr("tabindex","-1");var l=this.restartEditingSession.bind(this);t.addHook("restartEditingSession",l),t.addHook("didHideAllLightboxes",this.unmuteToolbar.bind(this)),t.addHook("didCancelDiscard",this.unmuteToolbar.bind(this)),t.addHook("didEnterRevisionPreview",this.hide.bind(this)),t.addHook("didExitRevisionPreview",this.show.bind(this)),t.addHook("didPublishLayout",this.onPublish.bind(this))},endEditingSession:function(){t._destroyOverlayEvents(),t._removeAllOverlays(),t._removeEmptyColHighlights(),t._removeColHighlightGuides(),t._unbindEvents(),e("html").removeClass("fl-builder-edit").addClass("fl-builder-show-admin-bar"),e("body").removeClass("fl-builder-edit"),e("#wpadminbar a").attr("tabindex",null),e(t._contentClass).removeClass("fl-builder-content-editing"),this.hideMainToolbar(),t.ContentPanel.hide(),FLBuilderLayout.init()},restartEditingSession:function(i){t._initTemplateSelector(),t._bindOverlayEvents(),t._highlightEmptyCols(),e("html").addClass("fl-builder-edit").removeClass("fl-builder-show-admin-bar"),e("body").addClass("fl-builder-edit"),e("#wpadminbar a").attr("tabindex","-1"),e(t._contentClass).addClass("fl-builder-content-editing"),this.showMainToolbar(),i.preventDefault()},onClickPageBuilderToolbarLink:function(e){t.triggerHook("restartEditingSession"),e.preventDefault()},onPublish:function(){var e=this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a span");e.css("color","#6bc373")},hide:function(){e("html").hasClass("fl-builder-edit")&&(t._unbindEvents(),t._destroyOverlayEvents(),t._removeAllOverlays(),e("html").removeClass("fl-builder-edit"),e("body").removeClass("admin-bar"),this.hideMainToolbar(),t.ContentPanel.hide(),FLBuilderLayout.init(),t.triggerHook("didHideEditingUI"))},show:function(){e("html").hasClass("fl-builder-edit")||(t._bindOverlayEvents(),this.showMainToolbar(),FLBuilderResponsiveEditing._switchTo("default"),e("html").addClass("fl-builder-edit"),e("body").addClass("admin-bar"),t.triggerHook("didShowEditingUI"))},beginPreview:function(){t._triggerSettingsSave(!1,!0)&&(this.isPreviewing=!0,this.hide(),e("html").addClass("fl-builder-preview"),e("html, body").removeClass("fl-builder-edit"),t._removeEmptyColHighlights(),t._removeColHighlightGuides(),t.triggerHook("didBeginPreview"),FLBuilderResponsivePreview.enter())},endPreview:function(){this.isPreviewing=!1,this.show(),t._highlightEmptyCols(),FLBuilderResponsivePreview.exit(),e("html").removeClass("fl-builder-preview"),e("html, body").addClass("fl-builder-edit")},togglePreview:function(){this.isPreviewing?this.endPreview():this.beginPreview()},hideMainToolbar:function(){this.$mainToolbar.addClass("is-hidden"),e("html").removeClass("fl-builder-is-showing-toolbar")},showMainToolbar:function(){this.unmuteToolbar(),this.$mainToolbar.removeClass("is-hidden"),e("html").addClass("fl-builder-is-showing-toolbar")},onDeviceIconClick:function(t){var i=e(t.target).data("mode");FLBuilderResponsivePreview.switchTo(i)},muteToolbar:function(){this.$mainToolbarContent.addClass("is-muted"),t._hideTipTips()},unmuteToolbar:function(){this.$mainToolbarContent.removeClass("is-muted")}},n={isEditing:!0,init:function(){history.pushState&&(t.addHook("endEditingSession",this.onLeaveBuilder.bind(this)),t.addHook("restartEditingSession",this.onEnterBuilder.bind(this)))},onEnterBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.editUrl),this.isEditing=!0},onLeaveBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.url),this.isEditing=!1}},r={$row:null,$rowContent:null,row:null,drag:{},init:function(){if(this.userCanResize()){var i=e(t._contentClass);i.delegate(".fl-block-row-resize","mouseenter",this.onDragHandleHover.bind(this)),i.delegate(".fl-block-row-resize","mousedown",this.onDragHandleDown.bind(this))}},userCanResize:function(){return FLBuilderConfig.rowResize.userCanResizeRows},onDragHandleHover:function(t){if(!this.drag.isDragging){var i=e(t.target);this.$row=i.closest(".fl-row"),this.$rowContent=this.$row.find(".fl-row-content"),this.row={node:this.$row.data("node"),isFixedWidth:this.$row.hasClass("fl-row-fixed-width"),settings:e(".fl-builder-row-settings[data-node="+this.$row.data("node")+"]")},this.drag={edge:null,isDragging:!1,originalPosition:null,originalWidth:null,calculatedWidth:null,operation:null},this.row.isFixedWidth?this.drag.originalWidth=this.$row.width():this.drag.originalWidth=this.$rowContent.width(),this.dragInit()}},onDragHandleDown:function(){e("body").addClass("fl-builder-row-resizing")},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(i,l){var o=e("body"),s=e(l.helper);this.drag.isDragging=!0,this.row.isFixedWidth?this.drag.originalWidth=this.$row.width():this.drag.originalWidth=this.$rowContent.width(),s.hasClass("fl-block-col-resize-e")&&(this.drag.edge="e",this.$feedback=s.find(".fl-block-col-resize-feedback-left")),s.hasClass("fl-block-col-resize-w")&&(this.drag.edge="w",this.$feedback=s.find(".fl-block-col-resize-feedback-right")),o.addClass("fl-builder-row-resizing"),t._colResizing=!0,t._destroyOverlayEvents(),t._closePanel()},dragging:function(e,t){var i=t.position.left,l=t.originalPosition.left,o=this.drag.originalWidth,s=0,n=this.drag.edge,r=FLBuilderConfig.rowResize.minAllowedWidth,a=FLBuilderConfig.rowResize.maxAllowedWidth;l!==i&&(FLBuilderConfig.isRtl&&(n="w"==n?"e":"w"),l>i?"w"===n?this.drag.operation="+":this.drag.operation="-":"e"===n?this.drag.operation="+":this.drag.operation="-",s=Math.abs(l-i),"+"===this.drag.operation?this.drag.calculatedWidth=o+2*s:this.drag.calculatedWidth=o-2*s,!1!==r&&this.drag.calculatedWidth<r&&(this.drag.calculatedWidth=r),!1!==a&&this.drag.calculatedWidth>a&&(this.drag.calculatedWidth=a),this.row.isFixedWidth&&this.$row.css("max-width",this.drag.calculatedWidth+"px"),this.$rowContent.css("max-width",this.drag.calculatedWidth+"px"),_.isUndefined(this.$feedback)||this.$feedback.html(this.drag.calculatedWidth+"px").show(),this.row.settings.length&&this.row.settings.find("[name=max_content_width]").val(this.drag.calculatedWidth))},dragStop:function(i,l){this.drag.isDragging=!1,_.isUndefined(this.$feedback)||this.$feedback.hide();var o={action:"resize_row_content",node:this.row.node,width:this.drag.calculatedWidth
|
8 |
-
},s=e("body");t.ajax(o),t._bindOverlayEvents(),s.removeClass("fl-builder-row-resizing"),e(".fl-block-overlay").each(function(){t._buildOverlayOverflowMenu(e(this))}),e("body").removeClass("fl-builder-row-resizing"),setTimeout(function(){t._colResizing=!1},50),t.triggerHook("didResizeRow",{rowId:this.row.node,rowWidth:this.drag.calculatedWidth})}},a={templateName:"fl-toolbar",init:function(){this.template=wp.template(this.templateName),this.render(),this.initTipTips();var e=this.$el.find(".fl-builder-content-panel-button");e.on("click",t._togglePanel),this.$el.find(".fl-builder-buy-button").on("click",t._upgradeClicked),this.$el.find(".fl-builder-upgrade-button").on("click",t._upgradeClicked),this.$el.find("#fl-builder-toggle-notifications").on("click",this.onNotificationsButtonClicked.bind(this)),t.addHook("notificationsLoaded",this.onNotificationsLoaded.bind(this))},render:function(t){var i=e(this.template(t));this.$el=i,this.el=i.get(0),s.$mainToolbar=this.$el,e("body").prepend(i),e("html").addClass("fl-builder-is-showing-toolbar")},initTipTips:function(){e(".fl-builder--saving-indicator").tipTip({defaultPosition:"bottom",edgeOffset:14}),e(".fl-builder-publish-actions .fl-builder-button-group .fl-builder-button").tipTip({defaultPosition:"bottom",edgeOffset:6})},onNotificationsButtonClicked:function(){t.triggerHook("toggleNotifications")},onNotificationsLoaded:function(){e("body").removeClass("fl-builder-has-new-notifications");var i={action:"fl_builder_notifications",read:!0};t.ajax(i)}};e(function(){t.ContentPanel.init(),FLBuilderConfig.simpleUi||t.MainMenu.init(),FLBuilderConfig.showToolbar?(a.init(),t.ContentPanel.alignPanelArrow()):e("html").addClass("fl-builder-no-toolbar"),i.init(),l.init(),s.init(),n.init(),r.init(),o.init(),t.triggerHook("didInitUI")})}(jQuery,FLBuilder),function(e,t){var i=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")},hide:function(){this.$el.removeClass("is-showing")},transitionIn:function(e){requestAnimationFrame(this.show.bind(this))},transitionOut:function(e){this.hide()}}),l=FLExtendableObject.create({templateName:"fl-main-menu-panel",template:null,menu:null,views:{},viewNavigationStack:[],isShowing:!1,shouldShowTabs:!1,init:function(){this.template=wp.template(this.templateName),e("body").prepend(this.template(this)),this.$el=e(".fl-builder--main-menu-panel"),this.$el.find(".fl-builder--main-menu-panel-views").html("");for(var i in FLBuilderConfig.mainMenu){this.renderPanel(i);var l="render"+i.charAt(0).toUpperCase()+i.slice(1)+"Panel";t.addHook(l,e.proxy(function(){this.renderPanel(i)},this))}e("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=e(".fl-builder-bar-title"),e("body").on("click",".fl-builder-bar-title",this.toggle.bind(this));var n=this.hide.bind(this);t.addHook("didShowPublishActions",n),t.addHook("didBeginSearch",n),t.addHook("didBeginPreview",n),t.addHook("didShowContentPanel",n),t.addHook("endEditingSession",n),t.addHook("didFocusSearchBox",n),t.addHook("didEnterRevisionPreview",n),t.addHook("didFailSettingsSave",n),t.addHook("showKeyboardShortcuts",n),this.$mask=e(".fl-builder--main-menu-panel-mask"),this.$mask.on("click",n),o.init(),s.init()},renderPanel:function(t){var l,o,s;e('fl-builder--main-menu-panel-view[data-name="'+t+'"]').remove(),l=FLBuilderConfig.mainMenu[t],l.handle=t,o=i.create(l),o.init(),s=e(o.render()),o.$el=s,e(".fl-builder--main-menu-panel-views").append(s),o.bindEvents(),o.$el.find(".fl-builder--menu-item").on("click",this.onItemClick.bind(this)),o.isRootView&&(this.rootView=o,this.currentView=o),this.views[t]=o},show:function(){this.isShowing||(this.$el.addClass("is-showing"),this.$barTitle.addClass("is-showing-menu"),this.currentView.transitionIn(),this.isShowing=!0,this.$mask.show(),t.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(i){var l=e(i.currentTarget),o=l.data("type");switch(o){case"view":var s=l.data("view");this.goToView(s);break;case"event":var n=l.data("event");t.triggerHook(n,l);break;case"link":}},goToView:function(e){var t=this.currentView,i=this.views[e];t.transitionOut(),i.transitionIn(),this.currentView=i,this.viewNavigationStack.push(t)},goToPreviousView:function(){var t=this.currentView,i=this.viewNavigationStack.pop();t.transitionOut(!0),i.transitionIn(!0),this.currentView=i,e(".fl-builder-bar-title-caret").focus()},resetViews:function(){this.currentView!=this.rootView&&(this.currentView.hide(),this.rootView.show(),this.currentView=this.rootView,this.viewNavigationStack=[])}});t.MainMenu=l;var o={init:function(){t.addHook("saveTemplate",this.saveTemplate.bind(this)),t.addHook("saveCoreTemplate",this.saveCoreTemplate.bind(this)),t.addHook("duplicateLayout",this.duplicateLayout.bind(this)),t.addHook("showLayoutSettings",this.showLayoutSettings.bind(this)),t.addHook("showGlobalSettings",this.showGlobalSettings.bind(this)),t.addHook("toggleUISkin",this.toggleUISkin.bind(this)),t.addHook("clearLayoutCache",this.clearLayoutCache.bind(this))},saveTemplate:function(){t._saveUserTemplateClicked(),l.hide()},saveCoreTemplate:function(){FLBuilderCoreTemplatesAdmin._saveClicked(),l.hide()},duplicateLayout:function(){t._duplicateLayoutClicked(),l.hide()},showGlobalSettings:function(){t._globalSettingsClicked(),l.hide()},showLayoutSettings:function(){t._layoutSettingsClicked(),l.hide()},clearLayoutCache:function(){t.ajax({action:"clear_cache"},function(){location.href=FLBuilderConfig.editUrl}),t.showAjaxLoader(),l.hide()},toggleUISkin:function(i){e('a[data-event="toggleUISkin"]');if(e("body").hasClass("fl-builder-ui-skin--light"))var l="light",o="dark";if(e("body").hasClass("fl-builder-ui-skin--dark"))var l="dark",o="light";e("body").removeClass("fl-builder-ui-skin--"+l).addClass("fl-builder-ui-skin--"+o),t.ajax({action:"save_ui_skin",skin_name:o})}},s={init:function(){t.addHook("beginTour",this.onStartTourClicked.bind(this))},onStartTourClicked:function(){FLBuilderTour.start(),l.hide()}}}(jQuery,FLBuilder),function(e,t){var i=FLExtendableObject.create({handle:"",name:"",panel:null,shouldShowTabItem:!0,isShowing:!1,views:{},activeView:null,defaultView:null,categorySelector:null,init:function(i){this.categorySelector=a.create({handle:"selector-"+this.handle,tab:this,items:[]}),this.categorySelector.init(),e(this.categorySelector).on("categorySelected",this.onViewSelected.bind(this));i.views;if(this.initViews(i.views),0===Object.keys(this.views).length){var l={handle:"noViews",name:"No Views",templateName:"fl-content-panel-no-view"};this.addView(l)}if(!this.activeView){var o=Object.keys(this.views)[0],l=this.views[o];this.activeView=l}this.defaultView=this.activeView,e(this.panel).on("afterRender",this.renderView.bind(this,this.activeView)),e(this.panel).on("onShow onShowTab",this.initScroller.bind(this)),t.addHook("contentItemsChanged",this.onLibraryDataChanged.bind(this))},initViews:function(e){for(var t in e){var i=e[t];this.categorySelector.addItem(i),"separator"!==i.type&&this.addView(i)}},addView:function(e){var t=l;switch(this.handle){case"modules":t=o;break;case"rows":t=s;break;case"templates":t=n;break;case"saved":t=r;break;default:t=l}_.isNull(this.viewController)||_.isUndefined(this.viewController)||(t=window[this.viewController]);var i=t.create(e),a=i.handle;i.init(),this.views[a]=i,i.isShowing&&(this.activeView=i)},renderView:function(e){if(this.$el=this.panel.$el.find('.fl-builder--panel-view[data-tab="'+this.handle+'"]'),_.isObject(e))var i=e;else var i=this.views[e];if(_.isObject(i)&&_.isFunction(i.render)){var l=i.render();this.$el.find(".fl-nanoscroller-content").html(l),this.activeView=i,t._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(){e(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=this.panel.$groupSelect,t=this.panel.$el.find(".fl-builder-panel-search");if(this.isSearchEnabled?t.show():t.hide(),Object.keys(this.views).length>1&&!_.isUndefined(this.categorySelector)){var i=this.categorySelector.render();this.panel.$el.find(".fl-builder-content-group-select");e.html(i),e.show(),this.panel.$el.removeClass("single-view")}else e.hide(),t.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),e(this).on("afterRender",this.bindEvents.bind(this)),e(this).trigger("afterInit")},filterTemplateData:function(e){return _.isNull(this.query)||_.isUndefined(this.query)||(e.queryResults=t.Search.byQuery(this.query)),e},render:function(){e(this).trigger("beforeRender");var t=this;t=this.filterTemplateData(t);var i=e(this.template(t));return this.$el=i,e(this).trigger("afterRender"),i},bindEvents:function(){},transitionIn:function(){},transitionOut:function(){}}),o=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")}}),s=l.create({templateName:"fl-content-panel-row-templates-view",bindEvents:function(){this.$items=this.$el.find(".fl-builder-block, .fl-builder-blocks-section-title")}}),n=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=e(".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(t){var i=e(t.currentTarget),l=i.val(),o=i.siblings("button");""!==l?o.show():o.hide()},onSaveButtonClick:function(i){var l=e(i.currentTarget),o=l.siblings('input[name="template-name"]').val(),s=l.siblings('input[name="template-category"]').val(),n={name:o,category:s};""!==o&&t.ajax({action:"save_user_template",settings:n},t._saveUserTemplateSettingsComplete)},onTemplateClick:function(i){var l=e(i.currentTarget),o=l.data("id"),s=l.data("type");t._requestTemplateInsert(o,s)}}),r=l.create({templateName:"fl-content-panel-saved-view",filterTemplateData:function(e){return e.queryResults=t.Search.byQuery({kind:"template",type:"user",content:["module","column","row"]}),e}}),a=FLExtendableObject.create({templateName:"fl-content-panel-category-selector",template:null,tab:null,isOpen:!1,items:{},init:function(){this.template=wp.template(this.templateName),e(this).on("afterRender",this.bindEvents.bind(this)),e(this.tab.panel).on("didShowSearchControls",this.close.bind(this))},render:function(){this.close();var t=e(this.template(this));return this.$el=t,e(this).trigger("afterRender"),t},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;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(t){var i=e(t.target).data("view");e(this).trigger("categorySelected",i)}});t.ContentPanel=FLExtendableObject.create({templateName:"fl-content-panel-base",template:null,tabs:{},activeTab:null,isShowing:!1,init:function(){if(FLBuilderConfig.panelData){var e=FLBuilderConfig.panelData.tabs;for(var l in e){var o=e[l];if(n=i.create(o),n.panel=this,n.views={},n.init(o),this.tabs[l]=n,n.isShowing&&(this.activeTab=n),!this.activeTab){var s=Object.keys(this.tabs)[0],n=this.tabs[s];n.isShowing=!0,this.activeTab=n}}this.template=wp.template(this.templateName),this.render(),this.renderSearchResults=wp.template("fl-search-results-panel"),this.renderNoResults=wp.template("fl-search-no-results"),t.triggerHook("contentPanelDidInit")}},render:function(){e("body").prepend(this.template(this)),this.$el=e(".fl-builder--content-library-panel"),this.bindEvents(),this.$groupSelect=this.$el.find(".fl-builder-content-group-select"),e(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"),t.addHook("showContentPanel",this.show.bind(this)),t.addHook("showModules",this.show.bind(this,"modules")),t.addHook("showRows",this.show.bind(this,"rows")),t.addHook("showTemplates",this.show.bind(this,"templates")),t.addHook("showSaved",this.show.bind(this,"saved")),t.addHook("showSearch",this.goToSearch.bind(this));var e=this.hide.bind(this);t.addHook("hideContentPanel",e),t.addHook("didShowLightbox",e),t.addHook("didShowPublishActions",e),t.addHook("didBeginSearch",e),t.addHook("didInitDrag",e),t.addHook("didOpenMainMenu",e),t.addHook("didApplyTemplate",e);var i=this.toggleShowHide.bind(this);t.addHook("toggleContentPanel",i),t.addHook("didStopDrag",this.hideSearchControls.bind(this))},alignPanelArrow:function(){var t,i,l=this.$el,o=null,s=this.$el.find(".fl-builder--panel-arrow"),n=e(".fl-builder-content-panel-button"),r=this.$el.css("animation-duration");if(0!=n.length){this.$el.css("animation-duration","0s"),this.show(),o=l[0].getBoundingClientRect(),t=s[0].getBoundingClientRect(),this.hide(),this.$el.css("animation-duration",r),buttonOffset=n[0].getBoundingClientRect();var a=buttonOffset.x+buttonOffset.width/2;i=a<o.x?20:a-o.x-t.width/2,s.css({right:"auto",left:i+"px"})}},show:function(i){"module"===FLBuilderConfig.userTemplateType||FLBuilderConfig.simpleUi||(t.triggerHook("willShowContentPanel"),"undefined"!=typeof i&&this.showTab(i),this.isShowing||t._triggerSettingsSave(!1,!0)&&(e("body").addClass("fl-builder-content-panel-is-showing"),this.isShowing=!0,e(this).trigger("onShow"),t.triggerHook("didShowContentPanel")))},hide:function(){this.isShowing&&(this.$el.hasClass("fl-builder-ui-pinned")||(e("body").removeClass("fl-builder-content-panel-is-showing"),this.isShowing=!1,e(this).trigger("onHide"),t.triggerHook("didHideContentPanel")))},toggleShowHide:function(){this.isShowing?this.hide():this.show()},showTab:function(t){var i=this.tabs[t];_.isObject(i)&&(_.isObject(this.activeTab)&&(this.activeTab.hide(),this.$tabs.filter(".is-showing").removeClass("is-showing")),this.hideSearchControls(),i.show(),this.$tabs.filter('[data-tab="'+i.handle+'"]').addClass("is-showing"),this.activeTab=i,e(this).trigger("onShowTab"))},goToSearch:function(){this.show("modules"),this.$el.find(".fl-builder-toggle-panel-search").trigger("click")},onTabItemMouseUp:function(t){e(t.currentTarget).blur()},onTabItemClick:function(t){var i=e(t.target),l=i.data("tab");this.showTab(l)},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(),e(".fl-builder--selector-display-label").attr("tabindex",-1),this.$searchBtn.attr("tabindex",-1),e(this).trigger("didShowSearchControls")},hideSearchControls:function(){this.$search.removeClass("is-showing-input"),this.clearSearchInput(),this.hideSearchResults(),e(".fl-builder--selector-display-label").attr("tabindex",null),this.$searchBtn.attr("tabindex",null)},onSearchTermChanged:function(e){var i=this.$searchInput.val();if(""!==i){var l=t.Search.byTerm(i);""!=l.term?this.showSearchResults(l):this.hideSearchResults()}else this.hideSearchResults()},clearSearchInput:function(){this.$searchInput.val(""),this.hideSearchResults()},showSearchResults:function(i){if(i.total>0){var l=e(this.renderSearchResults(i));this.$searchPanel.html(l),t._initSortables()}else{var l=e(this.renderNoResults(i));this.$searchPanel.html(l)}e("body").addClass("fl-builder-search-results-panel-is-showing")},hideSearchResults:function(){e("body").removeClass("fl-builder-search-results-panel-is-showing")}})}(jQuery,FLBuilder),function(e){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(t,i){var l=FLBuilderSettingsConfig.forms,o=FLBuilderSettingsConfig.modules,s={type:"general",id:null,nodeId:null,className:"",attrs:"",title:"",badges:[],tabs:[],buttons:[],settings:{},legacy:null,rules:null,preview:null,helper:null};if(t.nodeId&&!t.settings)return void this.loadNodeSettings(t,i);if(t=e.extend(s,t),i=void 0===i?function(){}:i,t.id){if("general"===t.type&&void 0!==l[t.id])t=e.extend(!0,t,l[t.id]);else{if("module"!==t.type||void 0===o[t.id])return;t=e.extend(!0,t,o[t.id])}this.config=t,this.renderLightbox(t)&&(t.legacy||!this.renderLegacySettings(t,i)?this.renderComplete(t,i):this.showLightboxLoader())}},loadNodeSettings:function(e,t){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"get_node_settings",node_id:e.nodeId},function(i){e.settings=JSON.parse(i),FLBuilderSettingsConfig.nodes[e.nodeId]=e.settings,FLBuilderSettingsForms.render(e,t),FLBuilder.hideAjaxLoader()})},renderLightbox:function(t){var i=wp.template("fl-builder-settings"),l=FLBuilder._lightbox._node.find("form.fl-builder-settings");e(".fl-lightbox-wrap[data-parent]");if(t.nodeId&&t.nodeId===l.data("node")&&!t.lightbox)return FLBuilder._focusFirstSettingsControl(),!1;if(t.lightbox)t.lightbox.setContent(i(t));else{if(!FLBuilder._triggerSettingsSave(!0,!0))return!1;FLBuilder.preview&&FLBuilder.preview.cancel(),FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder._setLightboxContent(i(t))}return!0},renderComplete:function(t,i){var l=e(".fl-builder-settings:visible");setTimeout(function(){t.legacy&&this.renderLegacySettingsComplete(t.legacy),i(),FLBuilder._initSettingsForms(),t.rules&&FLBuilder._initSettingsValidation(t.rules),t.preview&&(FLBuilder.preview=new FLBuilderPreview(t.preview)),t.helper&&t.helper.init(),l.closest(".fl-lightbox-wrap[data-parent]").length||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,l))}.bind(this),1)},renderFields:function(t,i){var l=wp.template("fl-builder-settings-row"),o="",s=null,n=null,r=null,a=!1,d=null,u=["dimension","unit"],i=i?i:this.config.settings,c=FLBuilderConfig.global;for(n in t)s=t[n],a=!!s.multiple,supportsResponsive=e.inArray(s.type,u)>-1,r=_.isUndefined(i[n])?"":i[n],_.isUndefined(i[n])&&s["default"]&&(r=s["default"]),d=s.responsive&&c.responsive_enabled&&!a&&supportsResponsive?s.responsive:null,o+=l({field:s,name:n,rootName:n,value:r,preview:JSON.stringify(s.preview?s.preview:{type:"refresh"}),responsive:d,rowClass:s.row_class?" "+s.row_class:"",isMultiple:a,supportsMultiple:"editor"!==s.type&&"photo"!==s.type&&"service"!==s.type,settings:i,globalSettings:c,template:e("#tmpl-fl-builder-field-"+s.type)});return o},renderField:function(e){var t=wp.template("fl-builder-field");return t(e)},renderSectionTemplate:function(e,t){var i=wp.template(e.template.id);return i({section:e,settings:t})},renderTabTemplate:function(e,t){var i=wp.template(e.template.id);return i({tab:e,settings:t})},renderLegacySettings:function(t,i){var l=e(".fl-builder-settings:visible"),o=null,s=!1,n={tabs:[],sections:[],fields:[],settings:null,node_id:null};return l.find(".fl-legacy-field").each(function(){o=e(this),n.fields.push(o.attr("data-field")),FLBuilderSettingsForms.showFieldLoader(o),s=!0}),l.find(".fl-legacy-settings-section").each(function(){o=e(this),n.sections.push({tab:o.attr("data-tab"),section:o.attr("data-section")}),s=!0}),l.find(".fl-legacy-settings-tab").each(function(){o=e(this),n.tabs.push(o.attr("data-tab")),s=!0}),l.attr("data-node")?n.node_id=l.attr("data-node"):n.settings=FLBuilder._getOriginalSettings(l,!0),this.legacyXhr&&(this.legacyXhr.abort(),this.legacyXhr=null),this.legacyXhr=FLBuilder.ajax(e.extend(this.getLegacyVars(),{action:"render_legacy_settings",data:n,form:l.attr("data-form-id"),group:l.attr("data-form-group"),lightbox:l.closest(".fl-builder-lightbox").attr("data-instance-id")}),function(e){FLBuilderSettingsForms.renderLegacySettingsComplete(e),s&&FLBuilderSettingsForms.renderComplete(t,i),FLBuilderSettingsForms.hideLightboxLoader()}),s},renderLegacySettingsComplete:function(t){var i="object"==typeof t?t:JSON.parse(t),l=null,o=null,s="",n=null,r=null,a=null;if(i.lightbox?(l=e(".fl-builder-lightbox[data-instance-id="+i.lightbox+"]"),o=l.length?l.find(".fl-builder-settings"):null):(o=e(".fl-builder-settings:visible"),l=o.closest(".fl-builder-lightbox")),o&&o.length){for(s in i.fields)n=e("#fl-field-"+s).attr("id",""),n.after(i.fields[s]).remove();for(s in i.extras)n=e("#fl-field-"+s).find(".fl-field-control-wrapper"),n.prepend(i.extras[s].before),n.append(i.extras[s].after);for(a in i.sections)for(s in i.sections[a])r=e("#fl-builder-settings-section-"+s),r.html(i.sections[a][s]);for(s in i.tabs)a=e("#fl-builder-settings-tab-"+s),a.html(i.tabs[s]);l.data("parent")||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,o),FLBuilder.preview&&(FLBuilder.preview._savedSettings=this.settings)),_.isUndefined(window.FLThemeBuilderFieldConnections)||FLThemeBuilderFieldConnections._initSettingsForms(),this.legacyXhr=null}},getLegacyVars:function(){var t=e(".fl-builder-settings:visible"),i=t.closest(".fl-builder-lightbox"),l=i.attr("data-parent"),o=null,s=null,n={};return l&&(l=e(".fl-builder-lightbox[data-instance-id="+l+"]"),t=l.find("form.fl-builder-settings"),o=FLBuilder._getSettings(t),s=t.attr("data-node"),s&&(n.node_id=s,n.node_settings=o)),n},settingsHaveChanged:function(){var e=FLBuilder._lightbox._node.find("form.fl-builder-settings"),t=FLBuilder._getSettings(e),i=!!this.settings&&JSON.stringify(this.settings)!=JSON.stringify(t);return i},closeOnDeleteNode:function(t,i){var l=e(".fl-builder-settings[data-node]"),o=FLBuilder._contentClass+" .fl-node-"+l.data("node");l.length&&!e(o).length&&FLLightbox.closeAll()},showLightboxLoader:function(){e(".fl-builder-settings:visible").append('<div class="fl-builder-loading"></div>')},hideLightboxLoader:function(t){e(".fl-builder-settings:visible .fl-builder-loading").remove()},showFieldLoader:function(e){var t=e.closest(".fl-field-control").find(".fl-field-control-wrapper");t.hide().after('<div class="fl-field-loader">'+FLBuilderStrings.fieldLoading+"</div>")},hideFieldLoader:function(e){var t=e.closest(".fl-field"),i=e.closest(".fl-field-control").find(".fl-field-control-wrapper");i.show(),t.find(".fl-field-loader").remove()}},FLBuilderSettingsConfig="undefined"==typeof FLBuilderSettingsConfig?{}:FLBuilderSettingsConfig,e.extend(FLBuilderSettingsConfig,{init:function(){FLBuilder.addHook("didSaveNodeSettings",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveNodeSettingsComplete",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveGlobalSettingsComplete",this.updateOnSaveGlobalSettings.bind(this)),FLBuilder.addHook("didSaveLayoutSettingsComplete",this.updateOnSaveLayoutSettings.bind(this)),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("didSaveGlobalNodeTemplate",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didRestoreRevisionComplete",this.updateOnApplyTemplate.bind(this))},updateOnSaveGlobalSettings:function(e,t){this.settings.global=t},updateOnSaveLayoutSettings:function(e,t){this.settings.layout=t},updateOnNodeEvent:function(){var e=arguments[0];e.namespace.indexOf("didAdd")>-1?this.addNode(arguments[1]):e.namespace.indexOf("didSaveNodeSettings")>-1?this.updateNode(arguments[1].nodeId,arguments[1].settings):e.namespace.indexOf("didDelete")>-1?this.deleteNodes():e.namespace.indexOf("didDuplicate")>-1&&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(t,i){var l=this;i.cols.each(function(){var t=e(this),i=t.attr("data-node");l.nodes[i]&&(l.nodes[i].size=parseFloat(t[0].style.width))})},updateOnApplyTemplate:function(e,t){this.nodes=t.nodes,this.attachments=t.attachments},addNode:function(t,i){var l=e(".fl-node-"+t),o=l.hasClass("fl-row"),s=l.hasClass("fl-col"),n=l.hasClass("fl-col-group"),r=l.hasClass("fl-module"),a=this;this.nodes[t]||(i||(o?i=e.extend({},this.defaults.row):s?i=e.extend({},this.defaults.column):r&&(i=e.extend({},this.defaults.modules[l.attr("data-type")])),o||n?l.find(".fl-col").each(function(){var t=e(this),i=e.extend({},a.defaults.column);i.size=parseFloat(t[0].style.width),a.addNode(t.attr("data-node"),i)}):r&&(a.addNode(l.closest(".fl-row").attr("data-node")),a.addNode(l.closest(".fl-col").attr("data-node")),a.updateOnResetColumnWidths(null,{cols:l.closest(".fl-col-group").find("> .fl-col")}))),i&&(this.nodes[t]=i))},updateNode:function(t,i){var l=e(".fl-node-"+t),o=this;l.hasClass("fl-col")&&l.closest(".fl-col-group").find("> .fl-col").each(function(){var t=e(this),l=t.attr("data-node");o.nodes[l].size=parseFloat(t[0].style.width),o.nodes[l].equal_height=i.equal_height,o.nodes[l].content_alignment=i.content_alignment,o.nodes[l].responsive_order=i.responsive_order}),this.nodes[t]=i},duplicateNode:function(t,i){var l=e(".fl-node-"+i),o=l.find("[data-node]"),s=e(".fl-node-"+t),n=s.find("[data-node]"),r=this;this.nodes[i]=this.nodes[t],o.each(function(l){t=n.eq(l).attr("data-node"),i=e(this).attr("data-node"),r.nodes[t]&&(r.nodes[i]=r.nodes[t])})},deleteNodes:function(){var t="",i=e(FLBuilder._contentClass).html();for(t in this.nodes)i.indexOf(t)===-1&&(this.nodes[t]=null,delete this.nodes[t])}}),e(function(){FLBuilderSettingsConfig.init(),FLBuilderSettingsForms.init()})}(jQuery),function(e){var t={init:function(){this.initPanel(),this.pinOrUnpin(),this.bind()},bind:function(){var t=e(window),i=e("body");t.on("resize",_.throttle(this.windowResize.bind(this),250)),i.delegate(".fl-builder-ui-pinned-collapse","click",this.collapse),i.delegate(".fl-builder--content-library-panel .fl-builder--tabs","click",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 e(".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 t=e(".fl-builder--content-library-panel"),i=this.isPinned();t.hasClass("fl-builder-ui-pinned-hidden")||(window.innerWidth<=500?(i&&this.unpin(!1),this.disableDragAndResize()):(i||this.restorePosition(),this.enableDragAndResize()))},show:function(){var t=e(".fl-builder--content-library-panel");t.hasClass("fl-builder-ui-pinned-hidden")&&(t.removeClass("fl-builder-ui-pinned-hidden"),t.show(),this.restorePosition())},hide:function(){var t=e("body"),i=e(".fl-builder--content-library-panel");this.isPinned()&&(this.uncollapse(),i.addClass("fl-builder-ui-pinned-hidden"),i.hide(),t.css("margin",""),FLBuilder._resizeLayout())},collapse:function(){var t=e(this).find("i:visible"),i=e("body"),l=t.data("toggle"),o=t.data("position"),s=e(".fl-builder--content-library-panel"),n=s.outerWidth();
|
9 |
-
"hide"===l?(s.css(o,"-"+n+"px"),i.css("margin-"+o,""),i.addClass("fl-builder-ui-pinned-is-collapsed")):(s.css(o,"0px"),i.css("margin-"+o,n+"px"),i.removeClass("fl-builder-ui-pinned-is-collapsed"))},uncollapse:function(){this.isCollapsed()&&e(".fl-builder-ui-pinned-collapse:visible").trigger("click")},isCollapsed:function(){return e("body").hasClass("fl-builder-ui-pinned-is-collapsed")},initPanel:function(){var t=e(".fl-builder--content-library-panel");t.draggable({cursor:"move",handle:".fl-builder--tabs",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:400,minWidth:380,maxWidth:500,start:this.resizeStart.bind(this),stop:this.resizeStop.bind(this)}),t.addClass("fl-builder-ui-pinned-container"),t.find(".ui-resizable-e, .ui-resizable-w").hide()},pinPanel:function(t){var i=e(".fl-builder--content-library-panel"),l=i.width(),o=e("body"),s=e(".fl-responsive-preview, .fl-responsive-preview-mask"),n=e(FLBuilder._contentClass).parentsUntil("body").last();o.addClass("fl-builder-ui-is-pinned fl-builder-ui-is-pinned-"+t),o.addClass("fl-builder-content-panel-is-showing"),o.css("margin-"+t,l+"px"),s.css("margin-"+t,l+"px"),n.addClass("fl-builder-ui-pinned-content-transform"),i.addClass("fl-builder-ui-pinned fl-builder-ui-pinned-"+t),i.find(".ui-resizable-"+("left"===t?"e":"w")).show(),i.on("resize",_.throttle(this.resize.bind(this),250)),i.attr("style",""),FLBuilder.ContentPanel.isShowing=!0},unpinPanel:function(){var t=e(".fl-builder--content-library-panel"),i=t.find(".fl-builder--panel-content .is-showing").data("tab"),l=e("body"),o=e(".fl-responsive-preview, .fl-responsive-preview-mask"),s=e(FLBuilder._contentClass).parentsUntil("body").last();l.css("margin-left",""),l.css("margin-right",""),l.removeClass("fl-builder-ui-is-pinned"),l.removeClass("fl-builder-ui-is-pinned-left"),l.removeClass("fl-builder-ui-is-pinned-right"),o.css("margin-left",""),o.css("margin-right",""),s.removeClass("fl-lightbox-content-transform"),t.removeClass("fl-builder-ui-pinned"),t.removeClass("fl-builder-ui-pinned-left"),t.removeClass("fl-builder-ui-pinned-right"),t.find(".ui-resizable-handle").hide(),t.off("resize"),t.attr("style",""),t.find(".fl-builder--tabs [data-tab="+i+"]").addClass("is-showing")},pinLightboxes:function(){var t=this;e(".fl-lightbox-resizable").each(function(){t.pinLightbox(e(this))}),FLBuilder._reinitEditorFields()},pinLightbox:function(t){var i=e(".fl-builder--content-library-panel"),l=t.closest(".fl-lightbox-wrap");l.closest(".fl-builder-ui-pinned").length||(i.append(l),t.attr("style",""),t.draggable("disable"),t.resizable("disable")),t.is(":visible")&&i.find(".fl-builder--tabs .is-showing").removeClass("is-showing")},pinLightboxOnOpen:function(e,t){var i=t._node.find(".fl-lightbox-resizable");i.length&&(i.hasClass("fl-builder-ui-pinning-initialized")||(i.draggable("option","start",this.dragStart.bind(this)),i.draggable("option","drag",this.drag.bind(this)),i.draggable("option","stop",this.dragStop.bind(this)),i.addClass("fl-builder-ui-pinning-initialized")),this.isPinned()&&this.pinLightbox(i),FLBuilder.addHook("responsive-editing-switched",this.resize))},pinnedLightboxClosed:function(){var t=e(".fl-builder--content-library-panel");tab=null,this.isPinned()&&(tab=t.find(".fl-builder--panel-content .is-showing").data("tab"),t.find(".fl-builder--tabs [data-tab="+tab+"]").addClass("is-showing")),e(".fl-lightbox").removeClass("fl-lightbox-prevent-animation")},unpinLightboxes:function(){var t=e("body"),i=e(".fl-builder--content-library-panel");i.find(".fl-lightbox-wrap").each(function(){var l=e(this),o=l.find(".fl-lightbox"),s=0,n=0,r=0;o.draggable("enable"),o.resizable("enable"),o.find(".ui-resizable-handle").show(),t.append(l),o.is(":visible")?(s=parseInt(i.css("top"))-parseInt(l.css("top"))-parseInt(l.css("padding-top")),n=parseInt(i.css("left"))-parseInt(l.css("padding-left")),r=parseInt(i.css("right"))-parseInt(l.css("padding-right")),o.css("top",(s<0?0:s)+"px"),o.css(FLBuilderConfig.isRtl?"right":"left",(FLBuilderConfig.isRtl?r:n)+"px"),o.addClass("fl-lightbox-prevent-animation"),t.removeClass("fl-builder-content-panel-is-showing"),FLBuilder.ContentPanel.isShowing=!1):o.css({top:"25px",left:"25px"})}),FLBuilder._reinitEditorFields()},closeLightboxOnPanelClick:function(){FLBuilder._triggerSettingsSave(!1,!0)},windowResize:function(){this.pinOrUnpin()},resizeStart:function(){e("body").addClass("fl-builder-resizable-is-resizing"),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()},resize:function(){var t=e("body"),i=e(".fl-responsive-preview, .fl-responsive-preview-mask"),l=e(".fl-builder--content-library-panel"),o=l.outerWidth();l.hasClass("fl-builder-ui-pinned-left")?(t.css("margin-left",o+"px"),i.css("margin-left",o+"px")):l.hasClass("fl-builder-ui-pinned-right")&&(t.css("margin-right",o+"px"),i.css("margin-right",o+"px"))},resizeStop:function(){e("body").removeClass("fl-builder-resizable-is-resizing"),FLBuilder._bindOverlayEvents(),FLBuilder._resizeLayout(),this.savePosition()},dragStart:function(t,i){var l=e("body"),o=(e(t.target),e(".fl-builder-bar-actions"));e(".fl-lightbox-resizable:visible").length||o.addClass("fl-builder-content-panel-pin-zone"),l.addClass("fl-builder-draggable-is-dragging"),l.append('<div class="fl-builder-ui-pin-zone fl-builder-ui-pin-zone-left"></div>'),l.append('<div class="fl-builder-ui-pin-zone fl-builder-ui-pin-zone-right"></div>'),FLBuilder._destroyOverlayEvents()},drag:function(t,i){var l=e("body"),o=e(".fl-responsive-preview"),s=e(window),n=o.length?o.width():s.width(),r=s.scrollTop(),a=e(".fl-builder--content-library-panel"),d=a.offset().top,u=e(".fl-builder-bar-actions"),c=e(t.target);c.hasClass("fl-builder--content-library-panel")&&(t.clientX<n-75&&d-r<46?u.addClass("fl-builder-content-panel-pin-zone-hover"):u.removeClass("fl-builder-content-panel-pin-zone-hover")),c.hasClass("fl-builder-ui-pinned")?this.unpinPanel():t.clientX<75?l.addClass("fl-builder-ui-show-pin-zone fl-builder-ui-show-pin-zone-left"):t.clientX>n-75?l.addClass("fl-builder-ui-show-pin-zone fl-builder-ui-show-pin-zone-right"):(l.removeClass("fl-builder-ui-show-pin-zone"),l.removeClass("fl-builder-ui-show-pin-zone-left"),l.removeClass("fl-builder-ui-show-pin-zone-right"))},dragStop:function(t,i){var l=(e(window),e("body")),o=e(".fl-builder-bar-actions"),s=e(".fl-builder-ui-pin-zone"),n=e(".fl-builder--content-library-panel"),r=e(".fl-lightbox-resizable:visible");e(t.target);l.removeClass("fl-builder-draggable-is-dragging"),o.removeClass("fl-builder-content-panel-pin-zone"),o.removeClass("fl-builder-content-panel-pin-zone-hover"),s.remove(),r.length&&parseInt(r.css("top"))<0&&r.css("top","0"),l.hasClass("fl-builder-ui-show-pin-zone")?(l.hasClass("fl-builder-ui-show-pin-zone-left")?this.pin("left",!0):this.pin("right",!0),l.removeClass("fl-builder-ui-show-pin-zone"),l.removeClass("fl-builder-ui-show-pin-zone-left"),l.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 t=e(".fl-builder--content-library-panel"),i=e(".fl-lightbox-resizable");t.draggable("disable"),t.resizable("disable"),i.draggable("disable"),i.resizable("disable")},enableDragAndResize:function(){var t=e(".fl-builder--content-library-panel"),i=e(".fl-lightbox-resizable:not(.fl-lightbox-width-full)");t.draggable("enable"),t.resizable("enable"),this.isPinned()||(i.draggable("enable"),i.resizable("enable"))},savePosition:function(){var t=e(".fl-builder--content-library-panel"),i=e(".fl-lightbox-resizable:visible"),l={pinned:{width:t.width(),position:null}};t.hasClass("fl-builder-ui-pinned-left")?l.pinned.position="left":t.hasClass("fl-builder-ui-pinned-right")?l.pinned.position="right":i.length&&(l.lightbox={width:i.width(),height:i.height(),top:parseInt(i.css("top"))<0?"0px":i.css("top"),left:i.css("left")}),FLBuilderConfig.userSettings.pinned=l.pinned,l.lightbox&&(FLBuilderConfig.userSettings.lightbox=l.lightbox),FLBuilder.ajax({action:"save_pinned_ui_position",data:l})},restorePosition:function(){var t=e(".fl-builder--content-library-panel"),i=FLBuilderConfig.userSettings.pinned;i&&i.position&&(t.width(i.width),this.pin(i.position,!1),t.width(i.width))}};e(function(){t.init()})}(jQuery),function(e){var t={init:function(){this.setupMainMenuData(),e(".fl-builder--revision-actions select").on("change",this.selectChanged),e(".fl-cancel-revision-preview").on("click",this.exitPreview.bind(this)),e(".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 t=FLBuilderConfig.revisions.posts,i=FLBuilderConfig.revisions.authors,l=wp.template("fl-revision-list-item"),o=e(".fl-builder--revision-actions select"),s="",n="",r=0;if(FLBuilderConfig.mainMenu.revisions.items=[],o.html(""),0===t.length)FLBuilderConfig.mainMenu.revisions.items.push({eventName:"noRevisionsMessage",type:"event",label:wp.template("fl-no-revisions-message")()});else for(;r<t.length;r++)s=FLBuilderStrings.revisionDate.replace("%s",t[r].date.diff),s+=" ("+t[r].date.published+")",n=FLBuilderStrings.revisionAuthor.replace("%s",i[t[r].author].name),FLBuilderConfig.mainMenu.revisions.items.push({eventName:"revisionItemClicked",type:"event",label:l({id:t[r].id,date:s,author:n,avatar:i[t[r].author].avatar})}),o.append('<option value="'+t[r].id+'">'+s+"</option>");FLBuilder.triggerHook("renderRevisionsPanel")},refreshItems:function(){FLBuilder.ajax({action:"refresh_revision_items"},this.refreshItemsComplete.bind(this))},refreshItemsComplete:function(e){FLBuilderConfig.revisions=JSON.parse(e),this.setupMainMenuData()},itemClicked:function(t,i){var l=e(i).find(".fl-revision-list-item").attr("data-revision-id");FLBuilder._triggerSettingsSave(!1,!0)&&(e(".fl-builder--revision-actions select").val(l),this.preview(l))},selectChanged:function(i){t.preview(e(this).val())},applyClicked:function(i){var l=e(".fl-builder--revision-actions select").val();t.restore(l)},preview:function(t){e(".fl-builder--revision-actions").css("display","flex"),FLBuilder.triggerHook("didEnterRevisionPreview"),FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"render_revision_preview",revision_id:t},this.previewRenderComplete.bind(this))},previewRenderComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()})},exitPreview:function(){e(".fl-builder--revision-actions").hide(),FLBuilder.triggerHook("didExitRevisionPreview"),FLBuilder._bindOverlayEvents(),FLBuilder._updateLayout()},restore:function(i){e(".fl-builder--revision-actions").hide(),FLBuilder.triggerHook("didExitRevisionPreview"),FLBuilder.showAjaxLoader(),FLBuilder._bindOverlayEvents(),FLBuilder.ajax({action:"restore_revision",revision_id:i},t.restoreComplete)},restoreComplete:function(e){var t=JSON.parse(e);FLBuilder._renderLayout(t.layout),FLBuilder.triggerHook("didRestoreRevisionComplete",t.config)}};e(function(){t.init()})}(jQuery),function(e){var t={query:function(e){var t={},i=null,l={library:{}},o=null;if(e=this.normalizeQuery(e),_.isNull(e.kind))t=FLBuilderConfig.contentItems;else for(var s in e.kind)i=e.kind[s],t[i]=FLBuilderConfig.contentItems[i];return o=this.findMatches(e,t),l.library=this.formatResults(o,e),l},normalizeQuery:function(e){var t={kind:null,type:null,category:null,group:null,enabled:!0,global:null,searchTerm:null,categorized:!1};return e=_.extend(t,e),_.isString(e.kind)&&(e.kind=[e.kind]),e},findMatches:function(e,t){var i={},l=null,o=null,s=null,n=null,r=null,a=null;for(l in t){o=t[l],i[l]={items:[]};for(a in o)if(s=o[a],_.isUndefined(e.category)||_.isNull(e.category)||this.matchesCategory(s.category,e.category)){switch(l){case"template":if(!(_.isUndefined(e.content)||_.isNull(e.content)||(n=_.contains(e.content,s.content),r=e.content===s.content,n||r)))continue;if(!_.isUndefined(e.type)&&!_.isNull(e.type)&&e.type!==s.type)continue;if(!_.isNull(e.group)){var d=e.group,u=s.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];_.contains(u,h)&&(c=!0)}if(!c)continue}break;case"module":if(!_.isNull(e.group)){if(e.group===!1&&s.group.length>0)continue;if(e.group!==!1&&!_.contains(s.group,e.group))continue}}(_.isUndefined(e.searchTerm)||_.isNull(e.searchTerm)||this.matchesSearchTerm(s,e.searchTerm))&&i[l].items.push(s)}}return i},matchesCategory:function(e,t){var i,l,o,s,n,r;if(e===t)return!0;_.isString(t)&&(t=[t]);for(l in t){if(i=t[l],_.isString(e)&&e===i)return!0;if(_.isArray(e))for(o in e)if(s=e[o],s===i)return!0;if(_.isObject(e))for(n in e)if(r=e[n],r===i||n===i)return!0}return!1},matchesSearchTerm:function(e,t){var i,l,o=t.toLowerCase();return!(_.isUndefined(e.slug)||!e.slug.toLowerCase().includes(o))||(!(_.isUndefined(e.name)||!e.name.toLowerCase().includes(o))||(!(!_.isString(e.category)||!e.category.toLowerCase().includes(o))||(!(_.isUndefined(e.description)||!e.description.toLowerCase().includes(o))||(!(_.isUndefined(e.id_base)||!e.id_base.includes(t))||(!(!e.isWidget||(i="widget",!i.includes(o)))||!(_.isUndefined(e.editor_export)||(l="module",!l.includes(o))))))))},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,t){var i,l,o={};return _.forEach(e,function(e,s,n){i=e[t],_.isNull(i)||_.isUndefined(i)||_.isString(i)&&""===e[i]||(_.isString(i)&&(o[i]=o[i]||[],o[i].push(e)),_.isArray(i)&&(l=i,_.forEach(l,function(t,i,l){o[t]=o[t]||[],o[t].push(e)})),_.isObject(i)&&(l=i,_.forEach(l,function(t,i,l){o[t]=o[t]||[],o[t].push(e)})))}),o},search:function(e){var t={searchTerm:e},i=this.query(t),l={total:0,term:e,sections:{}};if(!_.isUndefined(i.library.module.items)){var o={};for(var s in i.library.module.items){var n=i.library.module.items[s],r=n.group[0],a=n.category;n.name;_.isUndefined(o[r])&&(o[r]={}),_.isUndefined(o[r][a])&&(o[r][a]=[]),o[r][a].push(n)}l.grouped=o}for(var s in i.library){var d=i.library[s];!_.isUndefined(d.items)&&d.items.length>0&&(l.sections[s]={name:FLBuilderStrings.typeLabels[s],handle:s,type:"",items:d.items},l.total+=d.items.length)}return l}};FLBuilder.Search={byQuery:function(e){return t.query(e)},byTerm:function(e){var i=t.search(e);return i}}}(jQuery),function(e,t){var i={layoutNeedsPublish:!1,defaultIndicatorMessage:"",defaultTooltipMessage:"",messages:null,init:function(){this.messages=FLBuilderStrings.savedStatus,this.$savingIndicator=e(".fl-builder--saving-indicator"),t.addHook("didBeginAJAX",this.onLayoutSaving.bind(this)),t.addHook("didCompleteAJAX",this.onLayoutSaved.bind(this)),t.addHook("didPublishLayout",this.onLayoutPublished.bind(this)),t.addHook("publishAndRemain",this.onPublishAndRemain.bind(this)),t.addHook("didShowLightbox",this.setLayoutNeedsPublish.bind(this)),!FLBuilderConfig.layoutHasDraftedChanges&&FLBuilderConfig.builderEnabledd||(this.setLayoutNeedsPublish(),this.resetStatusMessage())},setLayoutNeedsPublish:function(){this.layoutNeedsPublish||(this.layoutNeedsPublish=!0,e("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)))))},onLayoutSaved:function(e,t){if(this.isUpdatingLayout(t.fl_builder_data.action)){this.showStatusMessage(this.messages.saved,this.messages.savedTooltip);var i=this;setTimeout(function(){i.resetStatusMessage()},2e3)}},onLayoutPublished:function(){this.layoutNeedsPublish=!1,e("body").removeClass("fl-builder--layout-has-drafted-changes"),this.resetStatusMessage()},showStatusMessage:function(t,i){this.$savingIndicator.html(t),_.isUndefined(i)||(this.$savingIndicator.attr("title",i),e(".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(){if(this.layoutNeedsPublish)t._publishLayout(!1);else{this.showStatusMessage(this.messages.noChanges);var e=this;setTimeout(function(){e.resetStatusMessage()},2e3)}}};t.SaveManager={layoutNeedsPublish:function(){return i.layoutNeedsPublish},showStatusMessage:function(e,t){i.showStatusMessage(e,t)},resetStatusMessage:function(){i.resetStatusMessage()}},e(function(){i.init()})}(jQuery,FLBuilder);
|
1 |
+
var FLBuilderColorPicker;!function(e,t){function i(){var t,i,l="backgroundImage";h?f="filter":(t=e('<div id="iris-gradtest" />'),i="linear-gradient(top,#fff,#000)",e.each(g,function(e,o){if(t.css(l,o+i),t.css(l).match("gradient"))return f=e,!1}),f===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css(this.bgImageString).match("gradient")&&(f="webkit")),t.remove())}function l(t,i){return t="top"===t?"top":"left",i=e.isArray(i)?i:Array.prototype.slice.call(arguments,1),"webkit"===f?s(t,i):g[f]+"linear-gradient("+t+", "+i.join(", ")+")"}function o(t,i){var l,o,s,r,a,d,u,c,h;t="top"===t?"top":"left",i=e.isArray(i)?i:Array.prototype.slice.call(arguments,1),l="top"===t?0:1,o=e(this),s=i.length-1,r="filter",a=1===l?"left":"top",d=1===l?"right":"bottom",u=1===l?"height":"width",c='<div class="iris-ie-gradient-shim" style="position:absolute;'+u+":100%;"+a+":%start%;"+d+":%end%;"+r+':%filter%;" data-color:"%color%"></div>',h="","static"===o.css("position")&&o.css({position:"relative"}),i=n(i),e.each(i,function(e,t){var o,n,r;return e!==s&&(o=i[e+1],void(t.stop!==o.stop&&(n=100-parseFloat(o.stop)+"%",t.octoHex=new Color(t.color).toIEOctoHex(),o.octoHex=new Color(o.color).toIEOctoHex(),r="progid:DXImageTransform.Microsoft.Gradient(GradientType="+l+", StartColorStr='"+t.octoHex+"', EndColorStr='"+o.octoHex+"')",h+=c.replace("%start%",t.stop).replace("%end%",n).replace("%filter%",r))))}),o.find(".iris-ie-gradient-shim").remove(),e(h).prependTo(o)}function s(t,i){var l=[];return t="top"===t?"0% 0%,0% 100%,":"0% 100%,100% 100%,",i=n(i),e.each(i,function(e,t){l.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+l.join(",")+")"}function n(t){var i=[],l=[],o=[],s=t.length-1;return e.each(t,function(e,t){var o=t,s=!1,n=t.match(/1?[0-9]{1,2}%$/);n&&(o=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=n.shift()),i.push(o),l.push(s)}),l[0]===!1&&(l[0]="0%"),l[s]===!1&&(l[s]="100%"),l=r(l),e.each(l,function(e){o[e]={color:i[e],stop:l[e]}}),o}function r(t){var i,l,o,s,n=0,a=t.length-1,d=0,u=!1;if(t.length<=2||e.inArray(!1,t)<0)return t;for(;d<t.length-1;)u||t[d]!==!1?u&&t[d]!==!1&&(a=d,d=t.length):(n=d-1,u=!0),d++;for(l=a-n,s=parseInt(t[n].replace("%"),10),i=(parseFloat(t[a].replace("%"))-s)/l,d=n+1,o=1;d<a;)t[d]=s+o*i+"%",o++,d++;return r(t)}var a=[],d=navigator.userAgent.toLowerCase(),u="Microsoft Internet Explorer"===navigator.appName,c=u?parseFloat(d.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,h=u&&c<10,f=!1,g=["-moz-","-webkit-","-o-","-ms-"];flBuilderParseColorValue=function(e){var t=e.replace(/\s+/g,""),i=t.indexOf("rgba")!==-1?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100,l=i<100;return{value:t,alpha:i,rgba:l}},e.fn.flBuilderColorPickerGradient=function(){var t=arguments;return this.each(function(){h?o.apply(this,t):e(this).css("backgroundImage",l.apply(this,t))})},e.fn.flBuilderColorPickerRaninbowGradient=function(t,i){var l,o,s,n;for(t=t||"top",l=e.extend({},{s:100,l:50},i),o="hsl(%h%,"+l.s+"%,"+l.l+"%)",s=0,n=[];s<=360;)n.push(o.replace("%h%",s)),s+=30;return this.each(function(){e(this).flBuilderColorPickerGradient(t,n)})},FLBuilderColorPicker=function(t){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>';var i={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!"}};this.options=e.extend({},i,t),(h===!1||h===!0&&c>7)&&this._init()},FLBuilderColorPicker.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 t=this;e(t.options.elements);this._color=new Color("#ff0000").setHSpace(t.options.mode),a=this.options.presets,f===!1&&i(),e("html").hasClass("fl-color-picker-init")?t.picker=e(".fl-color-picker-ui"):t.picker=e(this._html).appendTo("body"),u?9===c?t.picker.addClass("iris-ie-9"):c<=8&&t.picker.addClass("iris-ie-lt9"):d.indexOf("compatible")<0&&d.indexOf("khtml")<0&&d.match(/mozilla/)&&t.picker.addClass("iris-mozilla"),t.controls={square:t.picker.find(".iris-square"),squareDrag:t.picker.find(".iris-square-value"),horiz:t.picker.find(".iris-square-horiz"),vert:t.picker.find(".iris-square-vert"),strip:t.picker.find(".iris-strip"),stripSlider:t.picker.find(".iris-strip .iris-slider-offset")},"hsv"===t.options.mode&&t._has("l",t.options.controls)?t.options.controls=t._defaultHSVControls:"hsl"===t.options.mode&&t._has("v",t.options.controls)&&(t.options.controls=t._defaultHSLControls),t.hue=t._color.h(),this._setTemplates(),this._ui=e(".fl-color-picker-ui"),this._iris=e(".iris-picker"),this._wrapper=e("body"),e("html").hasClass("fl-color-picker-init")||this._ui.prepend(this._hexHtml).append(this._presetsHtml),t.element=this._ui.find(".fl-color-picker-input"),t._initControls(),t.active="external",t._change(),t._addInputListeners(t.element),this._buildUI(),this._prepareColorFields(),this._pickerControls(),this._presetsControls(),this._buildAlphaUI(),e("html").addClass("fl-color-picker-init")},_prepareColorFields:function(){var t=this;e(".fl-color-picker-value").each(function(){var i=e(this),l=i.val(),o=i.parent().find(".fl-color-picker-color"),s=flBuilderParseColorValue(l),n="";if(l){if(o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba)n=i.val().toString();else if(!o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba){var r=l.replace("rgba","rgb");r=r.substr(0,r.lastIndexOf(","))+")",t._color._alpha=1,n=r,i.val(r)}else n="#"+i.val().toString();o.css({backgroundColor:n})}})},_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" maxlength="7" 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(t,i){var l=!1;return e.each(i,function(e,i){if(t===i)return l=!0,!1}),l},_buildUI:function(){var t=this;t._presetsList=this._ui.find(".fl-color-picker-presets-list"),t._presetsList.html(""),this.options.presets.length>0?e.each(this.options.presets,function(e,i){t._addPresetView(i)}):t._presetsList.append(this._noPresetsTpl)},_addPresetView:function(t){var i=this._presetsList.find(".fl-color-picker-no-preset");i.length>0&&i.remove();var l=e(this._presetsTpl),o=Color(t);l.attr("data-color",t).find(".fl-color-picker-preset-color").css({backgroundColor:o.toString()}).end().find(".fl-color-picker-preset-label").html(o.toString()),this._presetsList.append(l)},_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(){e(this).remove()})},_pickerControls:function(){var t=this;this._wrapper.on("click",".fl-color-picker-color",function(){var i=e(this);t._currentElement=i.parent().find(".fl-color-picker-value"),t._ui.position({my:"left top",at:"left bottom",of:i,collision:"flip",using:function(e,i){t._togglePicker(e)}})}).on("click",".fl-color-picker-clear",function(){var i=e(this);t._currentElement=i.parent().find(".fl-color-picker-value"),i.prev(".fl-color-picker-color").css({backgroundColor:"transparent"}).addClass("fl-color-picker-empty"),t._setColor(""),t.element.val(""),t._currentElement.val("").trigger("change")}),e(document).on("mousedown",function(t){0===e(t.target).closest(".fl-color-picker-ui").length&&e(".fl-color-picker-ui.fl-color-picker-active").removeClass("fl-color-picker-active")})},_presetsControls:function(){var t=this,i=t._ui.find(".fl-color-picker-preset-add"),l=t._ui.find(".fl-color-picker-presets"),o=l.find(".fl-color-picker-presets-open-label"),s=l.find(".fl-color-picker-presets-close-label"),n=l.find(".fl-color-picker-presets-list");i.off("click").on("click",function(){t._addPreset(t.element.val())}),n.css({height:t.element.innerHeight()+t._iris.innerHeight()+14+"px"}).hide(),l.off("click").on("click",".fl-color-picker-presets-toggle",function(){o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),n.slideToggle(500)}).on("click",".fl-color-picker-preset",function(i){var l=new Color(e(this).data("color").toString());t._setColor(l),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:l.toString()}).removeClass("fl-color-picker-empty"),o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),n.slideToggle(500)}).on("click",".fl-color-picker-preset-remove",function(i){i.stopPropagation(),t._removePreset(e(this).parent().data("color"))})},_removePreset:function(t){if(confirm(this.options.labels.removePresetConfirm)){var i=t.toString(),l=a.indexOf(i);l>-1&&(a.splice(l,1),this.options.presets=a,this._presetsList.find('.fl-color-picker-preset[data-color="'+i+'"]').slideUp(function(){e(this).remove()})),a.length<1&&this._presetsList.append(this._noPresetsTpl),e(this).trigger("presetRemoved",{presets:a})}},_addPreset:function(t){var i=t.toString().replace(/^#/,"");""===i?alert(this.options.labels.noneColorSelected):a.indexOf(i)>-1?alert(this.options.labels.alreadySaved.replace("%s","#"+i)):(this._addPresetView(i),this._addPresetFeedback(),a.push(i),this.options.presets=a,e(this).trigger("presetAdded",{presets:a}))},_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(){var e=this;e._paintDimension("right","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var i,l=this,o=l._color,s=l.options.mode,n=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"===s){switch(n=o.clone(),t){case"horiz":n[a.vert](100);break;case"vert":n[a.horiz](100);break;case"strip":n.setHSpace("hsl")}i=n.toHsl()}else i="strip"===t?{s:n.s,l:n.l}:{s:100,l:n.l};r.flBuilderColorPickerRaninbowGradient(e,i);break;case"s":"hsv"===s?"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("+n.h+",100%,50%)"]):i="vert"===t&&"h"===l.options.controls.horiz?["hsla(0, 0%, "+n.l+"%, 0)","hsla(0, 0%, "+n.l+"%, 1)"]:["hsl("+n.h+",0%,50%)","hsl("+n.h+",100%,50%)"],r.flBuilderColorPickerGradient(e,i);break;case"l":i="strip"===t?["hsl("+n.h+",100%,100%)","hsl("+n.h+", "+n.s+"%,50%)","hsl("+n.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,s=o.square,n=i.picker.find(".iris-strip"),r="77.5%",a="12%",d=20,u=l.border?l.width-d:l.width;if(e&&(s.css("width",""),n.css("width",""),i.picker.css({width:"",height:""})),r=u*(parseFloat(r)/100),a=u*(parseFloat(a)/100),t=l.border?r+d:r,s.width(r).height(r),n.height(r).width(a),i.picker.css({width:l.width,height:t}),!l.palettes)return i.picker.css("paddingBottom","")},_addInputListeners:function(e){var t=this,i=100,l=function(i){var l=new Color(e.val()),o=e.val().replace(/^#/,""),s=t._currentElement.hasClass("fl-color-picker-empty");if(e.removeClass("iris-error"),l.error)""!==o&&e.addClass("iris-error");else if(l.toString()!==t._color.toString()||""!==t._color.toString()&&s)if("keyup"===i.type){if(o.match(/^[0-9a-fA-F]{3}$/))return;t._setColor(o),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:Color(o).toString()}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change")}else if("paste"===i.type)return o=i.originalEvent.clipboardData.getData("text").replace(/^#/,""),hex=Color(o).toString(),t._setColor(o),e.val(hex),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:hex}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change"),!1};e.on("change",l).on("keyup",t._debounce(l,i))},_initControls:function(){var t=this,i=t.controls,l=i.square,o=t.options.controls,s=t._scale[o.strip];i.stripSlider.slider({orientation:"horizontal",max:s,slide:function(e,i){t.active="strip","h"===o.strip&&(i.value=s-i.value),t._color[o.strip](i.value),t._change.apply(t,arguments)}}),i.squareDrag.draggable({containment:i.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(e,i){t._squareDrag(e,i)},start:function(){l.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){l.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(i){var l="ui-state-focus";i.preventDefault(),"mousedown"===i.type?(t.picker.find("."+l).removeClass(l).blur(),e(this).addClass(l).focus()):e(this).removeClass(l)}).on("keydown",function(e){var l=i.square,o=i.squareDrag,s=o.position(),n=2;switch(e.altKey&&(n*=10),e.keyCode){case 37:s.left-=n;break;case 38:s.top-=n;break;case 39:s.left+=n;break;case 40:s.top+=n;break;default:return!0}s.left=Math.max(0,Math.min(s.left,l.width())),s.top=Math.max(0,Math.min(s.top,l.height())),o.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),l.mousedown(function(i){var l,o;1===i.which&&e(i.target).is("div")&&(l=t.controls.square.offset(),o={top:i.pageY-l.top,left:i.pageX-l.left},i.preventDefault(),t._squareDrag(i,{position:o}),i.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(o).trigger(i))})},_squareDrag:function(e,t){var i=this,l=i.options.controls,o=i._squareDimensions(),s=Math.round((o.h-t.position.top)/o.h*i._scale[l.vert]),n=i._scale[l.horiz]-Math.round((o.w-t.position.left)/o.w*i._scale[l.horiz]);i._color[l.horiz](n)[l.vert](s),i.active="square",i._change.apply(i,arguments)},_setColor:function(e){var t,i,l=this,o=l.options.color;l.options.color=e,e=""+e,t=e.replace(/^#/,""),i=new Color(e).setHSpace(l.options.mode),i.error?l.options.color=o:(l._color=i,l.options.color=l._color.toString(),l.active="external",l._change())},_squareDimensions:function(e){var i,l,o=this.controls.square;return e!==t&&o.data("dimensions")?o.data("dimensions"):(l=this.controls.squareDrag,i={w:o.width(),h:o.height()},o.data("dimensions",i),i)},_isNonHueControl:function(e,t){return"square"===e&&"h"===this.options.controls.strip||"external"!==t&&("h"!==t||"strip"!==e)},_change:function(){var t=this,i=t.controls,l=t._getHSpaceColor(),o=["square","strip"],s=t.options.controls,n=s[t.active]||"external",r=t.hue;"strip"===t.active?o=[]:"external"!==t.active&&o.pop(),e.each(o,function(e,o){var n,r,a;if(o!==t.active)switch(o){case"strip":n="h"===s.strip?t._scale[s.strip]-l[s.strip]:l[s.strip],i.stripSlider.slider("value",n);break;case"square":r=t._squareDimensions(),a={left:l[s.horiz]/t._scale[s.horiz]*r.w,top:r.h-l[s.vert]/t._scale[s.vert]*r.h},t.controls.squareDrag.css(a)}}),l.h!==r&&t._isNonHueControl(t.active,n)&&t._color.h(r),t.hue=t._color.h(),t.options.color=t._color.toString(),t.element.is(":input")&&!t._color.error&&(t.element.removeClass("iris-error"),t.element.val()!==t._color.toString()&&(t.element.val(t._color.toString()),this._currentElement&&(this._currentElement.val(t._color.toString().replace(/^#/,"")).parent().find(".fl-color-picker-color").css({backgroundColor:t._color.toString()}).removeClass("fl-color-picker-empty"),t._wrapper.find(".fl-alpha-slider-offset").css("background-color",t._color.toString()),this._currentElement.trigger("change")))),t._paint(),t._inited=!0,t.active=!1},_debounce:function(e,t,i){var l,o;return function(){var s,n,r=this,a=arguments;return s=function(){l=null,i||(o=e.apply(r,a))},n=i&&!l,clearTimeout(l),l=setTimeout(s,t),n&&(o=e.apply(r,a)),o}},_buildAlphaUI:function(){var t=this;t._wrapper.on("click",".fl-color-picker-color",function(){var i=e(this);t._currentElement.val();i.hasClass("fl-color-picker-alpha-enabled")?(t._ui.find(".fl-alpha-wrap").length<=0&&e(t._alphaHtml).insertAfter(t._iris),t.picker.addClass("fl-color-alpha-enabled"),t._pickerAlphaControls()):t._ui.find(".fl-alpha-wrap").remove()})},_pickerAlphaControls:function(){var e=this,t=e._currentElement,i=flBuilderParseColorValue(t.val()),l=parseFloat(i.alpha/100),o=e._wrapper,s=e._ui,n=s.find(".fl-alpha-wrap"),r=n.find(".fl-alpha-slider"),a=n.find(".fl-alpha-text"),d=n.find(".fl-alpha-slider-offset");alphaHandle=n.find(".ui-slider-handle"),a.text(l<1?l:""),r.slider({orientation:"vertical",slide:function(t,i){var l=parseFloat(i.value/100);e._color._alpha=l,a.text(l<1?l:""),e._change.apply(e,arguments)},create:function(){d.css({backgroundColor:i.value}),o.on("click",".fl-color-picker-clear",function(){e._color._alpha=1,a.text(""),r.slider("value",100).trigger("slide")})},value:i.alpha,step:1,min:1,max:100})}}}(jQuery),function(e,t){var i=function(e,t){return this instanceof i?this._init(e,t):new i(e,t)};i.fn=i.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 i="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),i=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":i,this[i](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 i(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"],l=t.length-1;l>=0;l--)e[t[l]]=this[t[l]];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(/;$/,""),e.match(i)&&e.match(/\)$/)){if(t=e.replace(/(\s|%)/g,"").replace(i,"").replace(/,?\);?$/,"").split(","),t.length<3)return this._error();if(4===t.length&&(this.a(parseFloat(t.pop())),this.error))return this;for(var l=t.length-1;l>=0;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,i){return"object"!=typeof e||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),i))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),3===e.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 i,l,o,s,n,r,a,d;return"object"!=typeof e||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",r=e.h/360,a=e.s/100,d=e.l/100,0===a?i=l=o=d:(s=d<.5?d*(1+a):d+a-d*a,n=2*d-s,i=this.hue2rgb(n,s,r+1/3),l=this.hue2rgb(n,s,r),o=this.hue2rgb(n,s,r-1/3)),this.fromRgb({r:255*i,g:255*l,b:255*o},!0))},fromHsv:function(e){var i,l,o,s,n,r,a,d,u,c,h;if("object"!=typeof e||e.h===t||e.s===t||e.v===t)return this._error();switch(this._hsv=e,this._hSpace="hsv",i=e.h/360,l=e.s/100,o=e.v/100,a=Math.floor(6*i),d=6*i-a,u=o*(1-l),c=o*(1-d*l),h=o*(1-(1-d)*l),a%6){case 0:s=o,n=h,r=u;break;case 1:s=c,n=o,r=u;break;case 2:s=u,n=o,r=h;break;case 3:s=u,n=c,r=o;break;case 4:s=h,n=u,r=o;break;case 5:s=o,n=u,r=c}return this.fromRgb({r:255*s,g:255*n,b:255*r},!0)},fromInt:function(e,i){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),i===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),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;t>=0;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":var l=this.toHsl();return t<1?"hsla( "+l.h+", "+l.s+"%, "+l.l+"%, "+t+" )":"hsl( "+l.h+", "+l.s+"%, "+l.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,i=this.toRgb(),l=i.r/255,o=i.g/255,s=i.b/255,n=Math.max(l,o,s),r=Math.min(l,o,s),a=(n+r)/2;if(n===r)e=t=0;else{var d=n-r;switch(t=a>.5?d/(2-n-r):d/(n+r),n){case l:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-l)/d+2;break;case s:e=(l-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsl.h!==e&&(e=this._hsl.h),t=Math.round(100*t),0===t&&this._hsl.s&&(t=this._hsl.s),{h:e,s:t,l:Math.round(100*a)}},toHsv:function(){var e,t,i=this.toRgb(),l=i.r/255,o=i.g/255,s=i.b/255,n=Math.max(l,o,s),r=Math.min(l,o,s),a=n,d=n-r;if(t=0===n?0:d/n,n===r)e=t=0;else{switch(n){case l:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-l)/d+2;break;case s:e=(l-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsv.h!==e&&(e=this._hsv.h),t=Math.round(100*t),0===t&&this._hsv.s&&(t=this._hsv.s),{h:e,s:t,v:Math.round(100*a)}},toInt:function(){return this._color},toIEOctoHex:function(){var e=this.toString(),t=parseInt(255*this._alpha,10).toString(16);return 1===t.length&&(t="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 i))throw"getDistanceLuminosityFrom requires a Color object";var t=this.toLuminosity(),l=e.toLuminosity();return t>l?(t+.05)/(l+.05):(l+.05)/(t+.05)},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new i(t)},getReadableContrastingColor:function(e,l){if(!(e instanceof i))return this;var o=l===t?5:l,s=e.getDistanceLuminosityFrom(this),n=e.getMaxContrastColor(),r=n.getDistanceLuminosityFrom(e);if(r<=o)return n;if(s>=o)return this;for(var a=0===n.toInt()?-1:1;s<o&&(this.l(a,!0),s=this.getDistanceLuminosityFrom(e),0!==this._color&&16777215!==this._color););return this},a:function(e){if(e===t)return this._alpha;var i=parseFloat(e);return isNaN(i)?this._error():(this._alpha=i,this)},darken:function(e){return e=e||5,this.l(-e,!0)},lighten:function(e){return e=e||5,this.l(e,!0)},saturate:function(e){return e=e||15,this.s(e,!0)},desaturate:function(e){return e=e||15,this.s(-e,!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(e){e=e||1;var t=180+30*e;return this.h(t,!0)},getAnalog:function(e){e=e||1;var t=30*e;return this.h(t,!0)},getTetrad:function(e){e=e||1;var t=60*e;return this.h(t,!0)},getTriad:function(e){e=e||1;var t=120*e;return this.h(t,!0)},_partial:function(e){var i=l[e];return function(l,o){var s=this._spaceFunc("to",i.space);return l===t?s[e]:(o===!0&&(l=s[e]+l),i.mod&&(l%=i.mod),i.range&&(l=l<i.range[0]?i.range[0]:l>i.range[1]?i.range[1]:l),s[e]=l,this._spaceFunc("from",i.space,s))}},_spaceFunc:function(e,t,i){var l=t||this._hSpace,o=e+l.charAt(0).toUpperCase()+l.substr(1);return this[o](i)}};var l={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(var o in l)l.hasOwnProperty(o)&&(i.fn[o]=i.fn._partial(o));"object"==typeof exports?module.exports=i:e.Color=i}(this),function(e){FLLightbox=function(e){this._init(e)},FLLightbox.closeParent=function(t){var i=e(t).closest(".fl-lightbox-wrap").attr("data-instance-id");_.isUndefined(i)||FLLightbox._instances[i].close()},FLLightbox.getResizableControlClass=function(){var t=e(".fl-lightbox-resizable").eq(0),i="far fa-window-maximize";return t.length&&t.hasClass("fl-lightbox-width-full")&&(i="far fa-window-minimize"),i},FLLightbox.unbindAll=function(){var e;for(e in FLLightbox._instances)FLLightbox._instances[e]._unbind()},FLLightbox.bindAll=function(){var e;for(e in FLLightbox._instances)FLLightbox._instances[e]._bind()},FLLightbox.closeAll=function(){var e;for(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,"undefined"!=typeof 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()},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(t){var i=0,l=null;for(l in FLLightbox._instances)i++;this._defaults=e.extend({},this._defaults,t),this._id=(new Date).getTime()+i,FLLightbox._instances[this._id]=this,this._render(),this._resizable()},_render:function(){this._node=e('<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),e("body").append(this._node)},_bind:function(){e(window).on("resize.fl-lightbox-"+this._id,this._delayedResize.bind(this))},_unbind:function(){e(window).off("resize.fl-lightbox-"+this._id)},_resizable:function(){var t=(e("body"),this._node.find(".fl-lightbox-mask")),i=this._node.find(".fl-lightbox"),l=e(".fl-lightbox-resizable").eq(0);this._defaults.resizable?(t.hide(),i.addClass("fl-lightbox-resizable"),i.delegate(".fl-lightbox-resize-toggle","click",this._resizeClicked.bind(this)),i.draggable({cursor:"move",handle:".fl-lightbox-header"}).resizable({handles:"all",minHeight:500,minWidth:380,start:this._resizeStart.bind(this),stop:this._resizeStop.bind(this)}),l.length&&l.hasClass("fl-lightbox-width-full")?(i.addClass("fl-lightbox-width-full"),i.draggable("disable")):this._restorePosition()):t.show(),this._resize()},_delayedResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._resize.bind(this),250)},_resize:function(){var t=this._node.find(".fl-lightbox"),i=parseInt(this._node.css("padding-top")),l=parseInt(this._node.css("padding-bottom")),o=parseInt(this._node.css("padding-left")),s=parseInt(this._node.css("padding-right")),n=t.height(),r=t.width(),a=e(window),d=a.height()-i-l,u=(a.width()-o-s,"0px");this._defaults.resizable?(r<600?t.addClass("fl-lightbox-width-slim"):t.removeClass("fl-lightbox-width-slim"),this._resizeEditors()):(d>n&&(u=(d-n-46)/2+"px"),t.attr("style","").css("margin",u+" auto 0")),this.trigger("resized")},_resizeStart:function(){e("body").addClass("fl-builder-resizable-is-resizing"),e(".fl-builder-lightbox:visible").append('<div class="fl-builder-resizable-iframe-fix"></div>'),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()},_resizeStop:function(t,i){var l=e(".fl-lightbox-resizable:visible");parseInt(l.css("top"))<0&&l.css("top","0"),this._savePosition(),e("body").removeClass("fl-builder-resizable-is-resizing"),e(".fl-builder-resizable-iframe-fix").remove(),FLBuilder._bindOverlayEvents()},_resizeClicked:function(){var t=e(".fl-lightbox-resizable"),i=(t.find(".fl-lightbox-resize-toggle"),this._node.find(".fl-lightbox"));i.hasClass("fl-lightbox-width-full")?this._resizeExitFull():this._resizeEnterFull(),this._resize()},_resizeEnterFull:function(){var t=e(".fl-lightbox-resizable"),i=t.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");i.removeClass("fa-window-maximize").addClass("fa-window-minimize"),t.addClass("fl-lightbox-width-full"),t.draggable("disable"),t.resizable("disable")},_resizeExitFull:function(){var t=e(".fl-lightbox-resizable"),i=t.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");i.removeClass("fa-window-minimize").addClass("fa-window-maximize"),t.removeClass("fl-lightbox-width-full"),t.draggable("enable"),t.resizable("enable")},_resizeEditors:function(){e(".fl-lightbox-resizable").each(function(){var t=e(this),i=t.find(".fl-builder-settings-fields").height(),l=t.find(".mce-edit-area > iframe, textarea.wp-editor-area, .ace_editor"),o=null;i<350&&(i=350),l.each(function(){o=e(this),o.hasClass("ace_editor")?(o.height(i-60),o.closest(".fl-field").data("editor").resize()):o.closest(".mce-container-body").find(".mce-toolbar-grp .mce-toolbar.mce-last").is(":visible")?o.height(i-175):o.height(i-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 t=FLBuilderConfig.userSettings.lightbox;if(!t)return!1;var i=e(window).height(),l=parseInt(t.height);return l>i&&i>546&&(t.height=i-50,
|
2 |
+
t.top=0),t}}}(jQuery),function(e){FLIconSelector={_content:null,_lightbox:null,_rendered:!1,_filterText:"",open:function(e){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(),FLIconSelector._lightbox.on("icon-selected",function(t,i){FLIconSelector._lightbox.off("icon-selected"),FLIconSelector._lightbox.close(),e(i)})},_render:function(){FLIconSelector._lightbox=new FLLightbox({className:"fl-icon-selector"}),FLIconSelector._rendered=!0,FLBuilder.addHook("endEditingSession",function(){FLIconSelector._lightbox.close()})},_getContentComplete:function(t){var i=JSON.parse(t);FLIconSelector._content=i.html,FLIconSelector._lightbox.setContent(i.html),e(".fl-icons-filter-select").on("change",FLIconSelector._filter),e(".fl-icons-filter-text").on("keyup",FLIconSelector._filter),e(".fl-icons-list i").on("click",FLIconSelector._select),e(".fl-icon-selector-cancel").on("click",e.proxy(FLIconSelector._lightbox.close,FLIconSelector._lightbox))},_filter:function(){var t=e(".fl-icons-filter-select").val(),i=e(".fl-icons-filter-text").val();"all"==t?e(".fl-icons-section").show():(e(".fl-icons-section").hide(),e(".fl-"+t).show()),FLIconSelector._filterText=i,""!==i?e(".fl-icons-list i").each(FLIconSelector._filterIcon):e(".fl-icons-list i").show()},_filterIcon:function(){var t=e(this);-1==t.attr("class").indexOf(FLIconSelector._filterText)?t.hide():t.show()},_select:function(){var t=e(this).attr("class");FLIconSelector._lightbox.trigger("icon-selected",t)}}}(jQuery),function(e){FLStyleSheet=function(t){"object"==typeof t&&e.extend(this,t),this._createSheet()},FLStyleSheet.prototype={id:null,_sheet:null,_sheetElement:null,updateRule:function(e,t,i){for(var l=this._sheet.cssRules?this._sheet.cssRules:this._sheet.rules,o=null,s=0;s<l.length;s++)l[s].selectorText.toLowerCase()==e.toLowerCase()&&(o=l[s]);if(o)if("object"==typeof t)for(s in t)o.style[this._toCamelCase(s)]=t[s];else o.style[this._toCamelCase(t)]=i;else this.addRule(e,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 t=this.id?' id="'+this.id+'"':"",i=this.className?' class="'+this.className+'"':"";this._sheet||(this._sheetElement=e('<style type="text/css"'+t+i+"></style>"),e("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(e){FLBuilder={preview:null,_actionsLightbox:null,_addModuleAfterNodeRender:null,_colResizeData:null,_colResizing:!1,_contentClass:!1,_dragEnabled:!1,_dragging:!1,_dragInitialScrollTop:0,_exitUrl:null,_layout:null,_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,_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._initTipTips(),FLBuilder._initTinyMCE(),FLBuilder._bindEvents(),FLBuilder._bindOverlayEvents(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder.addHook("didInitUI",FLBuilder._showTourOrTemplates.bind(FLBuilder)),FLBuilder.triggerHook("init")},_initJQueryReadyFix:function(){FLBuilderConfig.debug||(jQuery.fn.oldReady=jQuery.fn.ready,jQuery.fn.ready=function(t){return jQuery.fn.oldReady(function(){try{"function"==typeof t&&t(e)}catch(i){FLBuilder.logError(i)}})})},_initGlobalErrorHandling:function(){FLBuilderConfig.debug||(window.onerror=function(e,t,i,l,o){return FLBuilder.logGlobalError(e,t,i,l,o),!0})},_initPostLock:function(){"undefined"!=typeof wp.heartbeat&&(wp.heartbeat.interval(30),wp.heartbeat.enqueue("fl_builder_post_lock",{post_id:FLBuilderConfig.postId}))},_initClassNames:function(){e("html").addClass("fl-builder-edit"),e("body").addClass("fl-builder"),FLBuilderConfig.simpleUi&&e("body").addClass("fl-builder-simple"),FLBuilder._contentClass=".fl-builder-content-"+FLBuilderConfig.postId,e(FLBuilder._contentClass).addClass("fl-builder-content-editing")},_initMediaUploader:function(){wp.media.model.settings.post.id=FLBuilderConfig.postId},_initOverflowFix:function(){e(FLBuilder._contentClass).parents().css("overflow","visible")},_initScrollbars:function(){e(".fl-nanoscroller").nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"})},_initSortables:function(){var t={appendTo:"body",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"},i="",l="",o="";o="row"==FLBuilderConfig.userTemplateType||"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-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-col:not(.fl-node-global) .fl-col-content",l="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target",i=FLBuilderConfig.nestedColumns?o:"row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target",e(".fl-builder-rows").sortable(e.extend({},t,{connectWith:i,items:".fl-builder-block-row",stop:FLBuilder._rowDragStop})),e(".fl-builder-row-templates").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-row-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-rows").sortable(e.extend({},t,{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})),e(".fl-builder-saved-columns").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:l,items:".fl-builder-block-saved-column",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-modules, .fl-builder-widgets").sortable(e.extend({},t,{connectWith:o,items:".fl-builder-block-module",stop:FLBuilder._moduleDragStop})),e(".fl-builder-module-templates").sortable(e.extend({},t,{connectWith:o,items:".fl-builder-block-module-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-modules").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:o,items:".fl-builder-block-saved-module",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-row-sortable-proxy").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",helper:FLBuilder._rowDragHelper,start:FLBuilder._rowDragStart,stop:FLBuilder._rowDragStop})),e(".fl-col-sortable-proxy").sortable(e.extend({},t,{connectWith:o,helper:FLBuilder._colDragHelper,start:FLBuilder._colDragStart,stop:FLBuilder._colDragStop})),e(FLBuilder._contentClass+" .fl-col-content").sortable(e.extend({},t,{connectWith:o,handle:".fl-module-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._moduleDragHelper,items:".fl-module, .fl-col-group",start:FLBuilder._moduleDragStart,stop:FLBuilder._moduleDragStop})),e(FLBuilder._contentClass+" .fl-row-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-group-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-drop-target").sortable(t)},_initStrings:function(){e.validator.messages.required=FLBuilderStrings.validateRequiredMessage},_bindEvents:function(){$excludedLinks=e(".fl-builder-bar a, .fl-builder--content-library-panel a, .fl-page-nav .nav a"),e("a").not($excludedLinks).on("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),e("body").delegate(".fl-builder-content a","click",FLBuilder._preventDefault),e("body").delegate("button.fl-builder-button","mouseup",this._buttonMouseUp.bind(this)),e(document).on("heartbeat-tick",FLBuilder._initPostLock),e(window).on("beforeunload",FLBuilder._warnBeforeUnload),e("body").delegate(".fl-builder-has-submenu","click",FLBuilder._submenuParentClicked),e("body").delegate(".fl-builder-has-submenu a","click",FLBuilder._submenuChildClicked),e("body").delegate(".fl-builder-submenu","mouseenter",FLBuilder._submenuMouseenter),e("body").delegate(".fl-builder-submenu","mouseleave",FLBuilder._submenuMouseleave),e("body").delegate(".fl-builder-submenu .fl-builder-has-submenu","mouseenter",FLBuilder._submenuNestedParentMouseenter),e(".fl-builder-panel-actions .fl-builder-panel-close").on("click",FLBuilder._closePanel),e(".fl-builder-blocks-section-title").on("click",FLBuilder._blockSectionTitleClicked),e("body").delegate(".fl-builder-node-template-actions","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-delete","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","click",FLBuilder._editNodeTemplateClicked),e("body").delegate(".fl-builder-node-template-delete","click",FLBuilder._deleteNodeTemplateClicked),e("body").delegate(".fl-builder-block","mousedown",FLBuilder._blockDragInit),e("body").on("mouseup",FLBuilder._blockDragCancel),e("body").delegate(".fl-builder-actions .fl-builder-cancel-button","click",FLBuilder._cancelButtonClicked),e("body").delegate(".fl-builder-save-user-template-button","click",FLBuilder._saveUserTemplateClicked),e("body").delegate(".fl-builder-duplicate-layout-button","click",FLBuilder._duplicateLayoutClicked),e("body").delegate(".fl-builder-layout-settings-button","click",FLBuilder._layoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-save","click",FLBuilder._saveLayoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-builder-global-settings-button","click",FLBuilder._globalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-save","click",FLBuilder._saveGlobalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-user-template","click",FLBuilder._userTemplateClicked),e("body").delegate(".fl-user-template-edit","click",FLBuilder._editUserTemplateClicked),e("body").delegate(".fl-user-template-delete","click",FLBuilder._deleteUserTemplateClicked),e("body").delegate(".fl-builder-template-replace-button","click",FLBuilder._templateReplaceClicked),e("body").delegate(".fl-builder-template-append-button","click",FLBuilder._templateAppendClicked),e("body").delegate(".fl-builder-template-actions .fl-builder-cancel-button","click",FLBuilder._templateCancelClicked),e("body").delegate(".fl-builder-user-template-settings .fl-builder-settings-save","click",FLBuilder._saveUserTemplateSettings),e("body").delegate(".fl-builder-help-tour-button","click",FLBuilder._startHelpTour),e("body").delegate(".fl-builder-knowledge-base-button","click",FLBuilder._viewKnowledgeBaseClicked),e("body").delegate(".fl-builder-forums-button","click",FLBuilder._visitForumsClicked),e("body").delegate(".fl-builder-no-tour-button","click",FLBuilder._noTourButtonClicked),e("body").delegate(".fl-builder-yes-tour-button","click",FLBuilder._yesTourButtonClicked),e("body").delegate(".fl-builder-alert-close","click",FLBuilder._alertClose),e("body").delegate(".fl-block-overlay","contextmenu",FLBuilder._onContextmenu),e("body").delegate(".fl-row-overlay .fl-block-remove","click",FLBuilder._deleteRowClicked),e("body").delegate(".fl-row-overlay .fl-block-copy","click",FLBuilder._rowCopyClicked),e("body").delegate(".fl-row-overlay .fl-block-move","mousedown",FLBuilder._rowDragInit),e("body").delegate(".fl-row-overlay .fl-block-settings","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-row-overlay","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-builder-row-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-block-col-submenu .fl-block-row-reset","click",FLBuilder._resetRowWidthClicked),e("body").delegate(".fl-col-overlay .fl-block-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-copy","click",FLBuilder._copyColClicked),e("body").delegate(".fl-col-overlay .fl-block-remove","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-col-overlay .fl-block-settings","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-col-overlay","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-col-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-block-col-submenu .fl-block-col-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-delete","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-reset","click",FLBuilder._resetColumnWidthsClicked),e("body").delegate(".fl-block-col-submenu li","mouseenter",FLBuilder._showColHighlightGuide),e("body").delegate(".fl-block-col-submenu li","mouseleave",FLBuilder._removeColHighlightGuides),e("body").delegate(".fl-block-col-submenu .fl-block-col-move-parent","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit-parent","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-module-overlay .fl-block-remove","click",FLBuilder._deleteModuleClicked),e("body").delegate(".fl-module-overlay .fl-block-copy","click",FLBuilder._moduleCopyClicked),e("body").delegate(".fl-module-overlay .fl-block-move","mousedown",FLBuilder._blockDragInit),e("body").delegate(".fl-module-overlay .fl-block-settings","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-module-overlay","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-builder-module-settings .fl-builder-settings-save","click",FLBuilder._saveModuleClicked),e("body").delegate(".fl-module-overlay .fl-block-col-settings","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-settings-save-as","click",FLBuilder._showNodeTemplateSettings),e("body").delegate(".fl-builder-node-template-settings .fl-builder-settings-save","click",FLBuilder._saveNodeTemplate),e("body").delegate(".fl-builder-settings-tabs a","click",FLBuilder._settingsTabClicked),e("body").delegate(".fl-builder-settings-tabs a","show",FLBuilder._calculateSettingsTabsOverflow),e("body").delegate(".fl-builder-settings-tabs a","hide",FLBuilder._calculateSettingsTabsOverflow),e("body").delegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked),e("body").delegate(".fl-builder-settings-tabs-overflow-menu > a","click",FLBuilder._settingsTabsToOverflowMenuItemClicked.bind(this)),e("body").delegate(".fl-builder-settings-tabs-more","click",FLBuilder._toggleTabsOverflowMenu.bind(this)),e("body").delegate(".fl-builder-settings-tabs-overflow-click-mask","click",FLBuilder._hideTabsOverflowMenu.bind(this)),e("body").delegate(".fl-help-tooltip-icon","mouseover",FLBuilder._showHelpTooltip),e("body").delegate(".fl-help-tooltip-icon","mouseout",FLBuilder._hideHelpTooltip),e("body").delegate(".fl-builder-field-add","click",FLBuilder._addFieldClicked),e("body").delegate(".fl-builder-field-copy","click",FLBuilder._copyFieldClicked),e("body").delegate(".fl-builder-field-delete","click",FLBuilder._deleteFieldClicked),e("body").delegate(".fl-builder-settings-fields select","change",FLBuilder._settingsSelectChanged),e("body").delegate(".fl-photo-field .fl-photo-select","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-edit","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-replace","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-remove","click",FLBuilder._singlePhotoRemoved),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-select","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-edit","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-add","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-video-field .fl-video-select","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-video-field .fl-video-replace","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-video-field .fl-video-remove","click",FLBuilder._singleVideoRemoved),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-select","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-edit","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-add","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-icon-field .fl-icon-select","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-replace","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-remove","click",FLBuilder._removeIcon),e("body").delegate(".fl-form-field .fl-form-field-edit","click",FLBuilder._formFieldClicked),e("body").delegate(".fl-form-field-settings .fl-builder-settings-save","click",FLBuilder._saveFormFieldClicked),e("body").delegate(".fl-layout-field-option","click",FLBuilder._layoutFieldClicked),e("body").delegate(".fl-link-field-select","click",FLBuilder._linkFieldSelectClicked),e("body").delegate(".fl-link-field-search-cancel","click",FLBuilder._linkFieldSelectCancelClicked),e("body").delegate(".fl-loop-data-source-select select[name=data_source]","change",FLBuilder._loopDataSourceChange),e("body").delegate(".fl-custom-query select[name=post_type]","change",FLBuilder._customQueryPostTypeChange),e("body").delegate(".fl-field input[type=number]","focus",FLBuilder._onNumberFieldFocus),e("body").delegate(".fl-field input[type=number]","blur",FLBuilder._onNumberFieldBlur),FLBuilder.addHook("didCompleteAJAX",FLBuilder._refreshSettingsPreviewReference),FLBuilder.addHook("didRenderLayoutComplete",FLBuilder._refreshSettingsPreviewReference)},_unbindEvents:function(){e("a").off("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").off("click",FLBuilder._headerLinkClicked),e("body").undelegate(".fl-builder-content a","click",FLBuilder._preventDefault)},_rebindEvents:function(){e("a").on("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),e("body").delegate(".fl-builder-content a","click",FLBuilder._preventDefault)},_bindOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.delegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.delegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.delegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.delegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.delegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_destroyOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.undelegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.undelegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.undelegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.undelegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.undelegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_onContextmenu:function(t){e(this).hide()},_preventDefault:function(e){e.preventDefault()},_stopPropagation:function(e){e.stopPropagation()},_headerLinkClicked:function(t){var i=e(this),l=i.attr("href");this.hash||(t.preventDefault(),FLBuilderConfig.isUserTemplate||(FLBuilder._exitUrl=l.indexOf("?")>-1?l:l+"?fl_builder",FLBuilder.triggerHook("triggerDone")))},_warnBeforeUnload:function(){var t=e(".fl-builder-row-settings").length>0,i=e(".fl-builder-col-settings").length>0,l=e(".fl-builder-module-settings").length>0;if(t||i||l)return FLBuilderStrings.unloadWarning},_initTipTips:function(){e(".fl-tip:not(.fl-has-tip)").each(function(){var t=e(this);t.addClass("fl-has-tip"),void 0==t.attr("data-title")&&t.attr("data-title",t.attr("title"))}).tipTip({defaultPosition:"top",delay:1e3})},_hideTipTips:function(){e("#tiptip_holder").stop().hide()},_submenuParentClicked:function(t){var i=e("body"),l=e(this),o=l.find(".fl-builder-submenu");l.hasClass("fl-builder-submenu-open")?(i.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-right")):(l.offset().left+o.width()>e(window).width()&&l.addClass("fl-builder-submenu-right"),i.addClass("fl-builder-submenu-open"),l.addClass("fl-builder-submenu-open")),o.closest(".fl-row-overlay").addClass("fl-row-menu-active"),FLBuilder._hideTipTips(),t.preventDefault(),t.stopPropagation()},_submenuChildClicked:function(t){var i=e("body"),l=e(this).parents(".fl-builder-has-submenu");l.parents(".fl-builder-has-submenu").length||(i.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-open"))},_submenuMouseenter:function(t){var i=e(this),l=i.data("timeout");"undefined"!=typeof l&&clearTimeout(l)},_submenuMouseleave:function(t){var i=e("body"),l=e(this),o=setTimeout(function(){i.removeClass("fl-builder-submenu-open"),l.closest(".fl-builder-has-submenu").removeClass("fl-builder-submenu-open")},500);l.closest(".fl-row-overlay").removeClass("fl-row-menu-active"),l.data("timeout",o)},_submenuNestedParentMouseenter:function(t){var i=e(this),l=i.find(".fl-builder-submenu");i.width()+i.offset().left+l.width()>e(window).width()&&i.addClass("fl-builder-submenu-right")},_closeAllSubmenus:function(){e(".fl-builder-submenu-open").removeClass("fl-builder-submenu-open")},_upgradeClicked:function(){window.open(FLBuilderConfig.upgradeUrl)},_buttonMouseUp:function(t){e(t.currentTarget).blur()},_closePanel:function(){FLBuilder.triggerHook("hideContentPanel")},_showPanel:function(){FLBuilder.triggerHook("showContentPanel")},_togglePanel:function(){FLBuilder.triggerHook("toggleContentPanel")},_blockSectionTitleClicked:function(){var t=e(this),i=t.parent();i.hasClass("fl-active")?i.removeClass("fl-active"):(e(".fl-builder-blocks-section").removeClass("fl-active"),i.addClass("fl-active")),FLBuilder._initScrollbars()},_publishLayout:function(e){if(FLBuilder._triggerSettingsSave(!1,!0)){if(_.isUndefined(e))var e=!0;FLBuilder.ajax({action:"save_layout"},this._onPublishComplete.bind(this,e))}},_publishButtonClicked:function(e){FLBuilder._publishLayout(e)},_onPublishComplete:function(t){t&&(FLBuilderConfig.shouldRefreshOnPublish?FLBuilder._exit():FLBuilder._exitWithoutRefresh()),e("#wp-admin-bar-fl-builder-frontend-edit-link .fl-builder-admin-bar-status-dot").css("color","#6bc373"),FLBuilder.triggerHook("didPublishLayout")},_draftButtonClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_draft"},FLBuilder._exit)},_discardButtonClicked:function(){var e=confirm(FLBuilderStrings.discardMessage);e?(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"clear_draft_layout"},FLBuilder._exit)):FLBuilder.triggerHook("didCancelDiscard")},_cancelButtonClicked:function(){FLBuilder._exitUrl=null,FLBuilder._actionsLightbox.close()},_exit:function(){var e=window.location.href;FLBuilderConfig.isUserTemplate&&"undefined"!=typeof window.opener&&window.opener?("undefined"!=typeof window.opener.FLBuilder&&("undefined"==typeof FLBuilderGlobalNodeId?window.opener.FLBuilder._updateLayout():window.opener.FLBuilder._updateNode(FLBuilderGlobalNodeId)),window.close()):(FLBuilder._exitUrl?e=FLBuilder._exitUrl:(e=e.replace("?fl_builder&","?"),e=e.replace("?fl_builder",""),e=e.replace("&fl_builder","")),window.location.href=e)},_exitWithoutRefresh:function(){window.location.href;FLBuilderConfig.isUserTemplate&&"undefined"!=typeof window.opener&&window.opener?("undefined"!=typeof window.opener.FLBuilder&&("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 t=e(".fl-builder-settings #fl-field-css textarea:not(.ace_text-input)");t.on("change",FLBuilder._layoutSettingsCSSChanged),FLBuilder._layoutSettingsCSSCache=t.val()},_layoutSettingsCSSChanged:function(){FLBuilder._layoutSettingsCSSTimeout&&clearTimeout(FLBuilder._layoutSettingsCSSTimeout),FLBuilder._layoutSettingsCSSTimeout=setTimeout(e.proxy(FLBuilder._layoutSettingsCSSDoChange,this),600)},_layoutSettingsCSSDoChange:function(){var t=e(".fl-builder-settings"),i=e(this),l=i.parents("#fl-field-css");l.find(".ace_error").length>0||(t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(i.val()):e("#fl-builder-global-css").html(i.val()),FLBuilder._layoutSettingsCSSTimeout=null)},_saveLayoutSettingsClicked:function(){for(var t=e(this).closest(".fl-builder-settings"),i=t.serializeArray(),l={},o=0;o<i.length;o++)l[i[o].name]=i[o].value;FLBuilder.showAjaxLoader(),FLBuilder._lightbox.close(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_layout_settings",settings:l},function(){FLBuilder.triggerHook("didSaveLayoutSettingsComplete",l),FLBuilder._updateLayout()})},_cancelLayoutSettingsClicked:function(){var t=e(".fl-builder-settings");t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(FLBuilder._layoutSettingsCSSCache):e("#fl-builder-global-css").html(FLBuilder._layoutSettingsCSSCache),FLBuilder._layoutSettingsCSSCache=null},_globalSettingsClicked:function(){FLBuilderSettingsForms.render({id:"global",className:"fl-builder-global-settings",settings:FLBuilderSettingsConfig.settings.global},function(){FLBuilder._layoutSettingsInitCSS()})},_saveGlobalSettingsClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=t.validate().form(),l=FLBuilder._getSettings(t);i&&(FLBuilder.showAjaxLoader(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_global_settings",settings:l},FLBuilder._saveGlobalSettingsComplete),FLBuilder._lightbox.close())},_saveGlobalSettingsComplete:function(e){FLBuilderConfig.global=JSON.parse(e),FLBuilder.triggerHook("didSaveGlobalSettingsComplete",FLBuilderConfig.global),FLBuilder._updateLayout()},_initTemplateSelector:function(){var t=e(FLBuilder._contentClass).find(".fl-row"),i=t.length>0;i||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="undefined"!=typeof t&&t?"1":"0",i="undefined"==typeof i?"core":i,FLBuilder._lightbox.close(),FLBuilder.showAjaxLoader(),"core"==i?FLBuilder.ajax({action:"apply_template",template_id:e,append:t},FLBuilder._applyTemplateComplete):FLBuilder.ajax({action:"apply_user_template",template_id:e,append:t},FLBuilder._applyUserTemplateComplete),FLBuilder.triggerHook("didApplyTemplate")},_applyTemplateComplete:function(e){var t=JSON.parse(e);FLBuilder._renderLayout(t.layout),FLBuilder.triggerHook("didApplyTemplateComplete",t.config)},_applyUserTemplateComplete:function(t){var i=JSON.parse(t);null!==i.layout_css&&e("#fl-builder-layout-css").html(i.layout_css),FLBuilder._renderLayout(i.layout),FLBuilder.triggerHook("didApplyTemplateComplete",i.config)},_saveUserTemplateClicked:function(){FLBuilderSettingsForms.render({id:"user_template",className:"fl-builder-user-template-settings",rules:{name:{required:!0}}})},_saveUserTemplateSettings:function(){var t=e(this).closest(".fl-builder-settings"),i=t.validate().form(),l=FLBuilder._getSettings(t);i&&(FLBuilder.ajax({action:"save_user_template",settings:l},FLBuilder._saveUserTemplateSettingsComplete),FLBuilder._lightbox.close())},_saveUserTemplateSettingsComplete:function(e){if(e){var e=JSON.parse(e);FLBuilderConfig.contentItems.template.push(e),FLBuilder.triggerHook("contentItemsChanged")}},_userTemplateClicked:function(){var t=e(this).attr("data-id");e(FLBuilder._contentClass).children(".fl-row").length>0?"blank"==t?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate("blank",!1,"user")):(FLBuilder._selectedTemplateId=t,FLBuilder._selectedTemplateType="user",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(t,!1,"user")},_editUserTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),
|
3 |
+
window.open(e(this).attr("href"))},_deleteUserTemplateClicked:function(t){var i=e(this).closest(".fl-user-template"),l=i.attr("data-id"),o=(e(".fl-user-template[data-id="+l+"]"),null),s=null,n=null;if(confirm(FLBuilderStrings.deleteTemplate)){FLBuilder.ajax({action:"delete_user_template",template_id:l});for(s in FLBuilderConfig.contentItems.template)n=FLBuilderConfig.contentItems.template[s],n.postId==l&&(o=s);_.isNull(o)||(FLBuilderConfig.contentItems.template.splice(o,1),FLBuilder.triggerHook("contentItemsChanged"))}t.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())},_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 t=e(FLBuilder._contentClass);FLBuilderConfig.isUserTemplate&&"module"==FLBuilderConfig.userTemplateType||FLBuilderConfig.isUserTemplate&&"column"==FLBuilderConfig.userTemplateType||(t.removeClass("fl-builder-empty"),t.find(".fl-builder-empty-message").remove(),t.find(".fl-row, .fl-builder-block").length||(t.addClass("fl-builder-empty"),t.append('<span class="fl-builder-empty-message">'+FLBuilderStrings.emptyMessage+"</span>"),FLBuilder._initSortables()))},_updateNode:function(t,i){e(".fl-node-"+t).length&&(FLBuilder._showNodeLoading(t),FLBuilder.ajax({action:"render_node",node_id:t},function(e){FLBuilder._renderLayout(JSON.parse(e),i)}.bind(this)))},_updateLayout:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"render_layout"},FLBuilder._renderLayout)},_renderLayout:function(e,t){FLBuilder._layout=new FLBuilderAJAXLayout(e,t)},_renderLayoutComplete:function(){FLBuilder._layout&&(FLBuilder._layout._complete(),FLBuilder._layout=null)},_resizeLayout:function(){e(window).trigger("resize"),"undefined"!=typeof YUI&&YUI().use("node-event-simulate",function(e){e.one(window).simulate("resize")})},layoutHasContent:function(){return e(FLBuilder._contentClass).children(".fl-row").length>0},_initMediaElements:function(){var t={};"undefined"!=typeof e.fn.mediaelementplayer&&("undefined"!=typeof _wpmejsSettings&&(t.pluginPath=_wpmejsSettings.pluginPath),e(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").mediaelementplayer(t))},_initDropTargets:function(){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",l=e(FLBuilder._contentClass+" .fl-row"),o=null,s=e(FLBuilder._contentClass+" .fl-row"+t).find(".fl-col-group"),n=null,r=null,a="column"==FLBuilderConfig.userTemplateType?e(FLBuilder._contentClass+"> .fl-col").eq(0):null;for(i=0,e(".fl-col-drop-target").remove(),e(".fl-col-group-drop-target").remove(),e(".fl-row-drop-target").remove(),e(FLBuilder._contentClass).append('<div class="fl-drop-target fl-row-drop-target"></div>'),l.prepend('<div class="fl-drop-target fl-row-drop-target"></div>'),l.append('<div class="fl-drop-target fl-drop-target-last fl-row-drop-target fl-row-drop-target-last"></div>');i<l.length;i++)o=l.eq(i),0===o.find(".fl-col-group").length&&o.find(".fl-row-content").prepend('<div class="fl-drop-target fl-col-group-drop-target"></div>');for(a&&0===s.length&&(s=a.find(".fl-col-group"),a.append('<div class="fl-drop-target fl-col-drop-target"></div>'),a.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')),i=0;i<s.length;i++)n=s.eq(i),r=n.find("> .fl-col"),n.hasClass("fl-col-group-nested")||(n.append('<div class="fl-drop-target fl-col-group-drop-target"></div>'),n.append('<div class="fl-drop-target fl-drop-target-last fl-col-group-drop-target fl-col-group-drop-target-last"></div>')),r.append('<div class="fl-drop-target fl-col-drop-target"></div>'),r.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(t){var i=e(t.currentTarget),l=null,o=e(window).scrollTop(),s=0;FLBuilder._dragEnabled=!0,FLBuilder._dragInitialScrollTop=o,i.closest("[data-node]").length>0?(l=i.closest("[data-node]"),l.addClass("fl-node-drag-init")):i.hasClass("fl-builder-block")&&e(".fl-row").each(function(){null===l&&e(this).offset().top-o>0&&(l=e(this))}),null!==l&&(s=l.offset().top-o),FLBuilder._highlightRowsAndColsForDrag(i),FLBuilder._adjustColHeightsForDrag(),FLBuilder._disableGlobalRows(),FLBuilder._disableGlobalCols(),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays(),FLBuilder._initSortables(),e("body").addClass("fl-builder-dragging"),e(".fl-builder-empty-message").hide(),e(".fl-sortable-disabled").removeClass("fl-sortable-disabled"),s>0&&scrollTo(0,l.offset().top-s),FLBuilder.triggerHook("didInitDrag")},_blockDragStart:function(t,i){FLBuilder._dragging=!0,e(".fl-node-drag-init").removeClass("fl-node-drag-init"),FLBuilder.triggerHook("didStartDrag")},_blockDragSort:function(t,i){var l=i.placeholder.parent(),o=FLBuilderStrings.insert;FLBuilder._blockPreventSort(i.item,l)||(l.hasClass("fl-col-content")?o=i.item.hasClass("fl-builder-block-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-col-sortable-proxy-item")?FLBuilderStrings.column:i.item.hasClass("fl-builder-block-module")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-module")||i.item.hasClass("fl-builder-block-module-template")?i.item.find(".fl-builder-block-title").text():i.item.attr("data-name"):l.hasClass("fl-col-drop-target")?o="":l.hasClass("fl-col-group-drop-target")?o="":l.hasClass("fl-row-drop-target")&&(o=i.item.hasClass("fl-builder-block-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-column")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-row-sortable-proxy-item")?FLBuilderStrings.row:FLBuilderStrings.newRow),i.placeholder.html(o),i.item.hasClass("fl-node-global")||i.item.hasClass("fl-builder-block-global")||e(".fl-node-dragging").hasClass("fl-node-global")?i.placeholder.addClass("fl-builder-drop-zone-global"):i.placeholder.removeClass("fl-builder-drop-zone-global"))},_blockDragChange:function(e,t){t.placeholder.css("opacity","0"),t.placeholder.animate({opacity:"1"},100)},_blockPreventSort:function(t,i){var l=!1,o=t.hasClass("fl-builder-block-row"),s=t.hasClass("fl-col-sortable-proxy-item"),n=i.hasClass("fl-col-content"),r=i.hasClass("fl-col-drop-target"),a=i.parents(".fl-col-group:not(.fl-col-group-nested)"),d=i.parents(".fl-col-group-nested");return(o||s)&&n&&d.length>0&&(l=!0),n&&!i.find(".fl-module, .fl-col").length&&(o&&"1-col"==t.data("cols")?l=!0:s&&(l=!0)),o&&n&&e.inArray(t.data("cols"),["5-cols","6-cols"])>-1&&(l=!0),s&&e(".fl-node-dragging").find(".fl-col-group-nested").length>0&&(n||r&&d.length>0)&&(l=!0),r&&a.length>0&&0===d.length&&a.find("> .fl-col:visible").length>11&&(l=!0),r&&d.length>0&&d.find(".fl-col:visible").length>3&&(l=!0),l&&i.addClass("fl-sortable-disabled"),l},_blockDragStop:function(t,i){var l=e(window).scrollTop(),o=i.item.parent(),s=null;o.hasClass("fl-drop-target")&&o.closest("[data-node]").length?(o=o.closest("[data-node]"),s=o.offset().top-l):s=o.offset().top-l,o.hasClass("fl-builder-blocks-section-content")&&FLBuilder._showPanel(),FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._enableGlobalCols(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),scrollTo(0,o.offset().top-s),FLBuilder.triggerHook("didStopDrag")},_blockDragCancel:function(){FLBuilder._dragEnabled&&!FLBuilder._dragging&&(FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),e(".fl-node-drag-init").removeClass("fl-node-drag-init"),e(".fl-node-dragging").removeClass("fl-node-dragging"),scrollTo(0,FLBuilder._dragInitialScrollTop))},_reorderNode:function(e,t){FLBuilder.ajax({action:"reorder_node",node_id:e,position:t})},_moveNode:function(e,t,i){FLBuilder.ajax({action:"move_node",new_parent:e,node_id:t,position:i})},_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"),s=o?e.find("> .fl-row-content-wrap"):e.find("> .fl-node-content"),n={top:parseInt(s.css("margin-top"),10),bottom:parseInt(s.css("margin-bottom"),10)};return e.append(t),e.addClass("fl-block-overlay-active"),FLBuilder._initTipTips(),l=e.find("> .fl-block-overlay"),n.top<0&&(i=parseInt(l.css("top"),10),i=isNaN(i)?0:i,l.css("top",n.top+i+"px")),n.bottom<0&&(i=parseInt(l.css("bottom"),10),i=isNaN(i)?0:i,l.css("bottom",n.bottom+i+"px")),l},_buildOverlayOverflowMenu:function(e){var t=e.find(".fl-block-overlay-actions"),i=t.data("original"),l=0,o=null,s=0,n=null,r=0,a=[],d=[],u=[],c=wp.template("fl-overlay-overflow-menu");for(void 0!=i&&(t.after(i),t.remove(),t=i),t.data("original",t.clone()),l=Math.floor(t[0].getBoundingClientRect().width)-8,o=t.find(" > i, > span.fl-builder-has-submenu");r<o.length;r++)n=o.eq(r),s+=Math.floor(n[0].getBoundingClientRect().width),s>l?(d.push(n),n.remove()):a.push(n);if(d.length>0){for(a.length>0&&d.unshift(a.pop().remove()),r=0;r<d.length;r++)d[r].is(".fl-builder-has-submenu")?u.push({type:"submenu",label:d[r].find(".fa, .fas, .far").data("title"),submenu:d[r].find(".fl-builder-submenu")[0].outerHTML}):u.push({type:"action",label:d[r].data("title"),className:d[r].removeClass(function(e,t){return t.replace(/fl-block-([^\s]+)/,"")}).attr("class")});t.append(c(u)),FLBuilder._initTipTips()}},_removeRowOverlays:function(){e(".fl-row").removeClass("fl-block-overlay-active"),e(".fl-row-overlay").remove(),e(".fl-module").removeClass("fl-module-adjust-height"),e("body").removeClass("fl-builder-row-resizing"),FLBuilder._closeAllSubmenus()},_disableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-row.fl-node-global").addClass("fl-node-disabled")},_disableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&e(".fl-row:not(.fl-node-global) .fl-col.fl-node-global").addClass("fl-node-disabled")},_enableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-node-disabled").removeClass("fl-node-disabled")},_enableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&e(".fl-node-disabled").removeClass("fl-node-disabled")},_rowMouseenter:function(){var t=e(this),i=t.offset().top,l=null,o=null,s=wp.template("fl-row-overlay");t.closest(".fl-builder-node-loading").length||t.hasClass("fl-block-overlay-active")||(o=FLBuilder._appendOverlay(t,s({global:t.hasClass("fl-node-global"),node:t.attr("data-node")})),t.find(".fl-node-content:visible").each(function(){var t=e(this).offset().top;l=null===l||l>t?t:l}),null!==l&&l<i&&o.css("top",l-i-30+"px"),o.offset().top<43&&o.addClass("fl-row-overlay-header-bottom"),t.find(".fl-module").each(function(){var t=e(this);t.outerHeight(!0)<20&&t.addClass("fl-module-adjust-height")}),FLBuilder._buildOverlayOverflowMenu(o))},_rowMouseleave:function(t){var i=e(t.toElement)||e(t.relatedTarget),l=i.hasClass("fl-row-overlay"),o=i.closest(".fl-row-overlay").length>0,s=i.is("#tiptip_holder"),n=i.closest("#tiptip_holder").length>0;l||o||s||n||FLBuilder._removeRowOverlays()},_rowDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.row+"</div>")},_rowDragInit:function(t){var i=e(t.target),l=e(".fl-row-sortable-proxy-item"),o=i.closest(".fl-row");o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),t.target=l[0],l.trigger(t)},_rowDragStart:function(t,i){var l=e(FLBuilder._contentClass+" .fl-row"),o=e(".fl-node-dragging");1===l.length&&e(FLBuilder._contentClass).addClass("fl-builder-empty"),o.hide(),FLBuilder._blockDragStart(t,i)},_rowDragStop:function(t,i){var l=i.item,o=l.parent(),s=null,n=null,r=0;if(FLBuilder._blockDragStop(t,i),o.hasClass("fl-builder-rows"))return void l.remove();if(o.hasClass("fl-row-sortable-proxy"))return void e(".fl-node-dragging").removeClass("fl-node-dragging").show();if(l.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-col-content")?FLBuilder._addColGroup(l.closest(".fl-col").attr("data-node"),l.attr("data-cols"),o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(l)):o.hasClass("fl-col-drop-target")?FLBuilder._addCols(o.closest(".fl-col"),o.hasClass("fl-col-drop-target-last")?"after":"before",l.attr("data-cols"),o.closest(".fl-col-group-nested").length>0):o.hasClass("fl-col-group-drop-target")?(n=l.closest(".fl-col-group"),r=l.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(n),FLBuilder._addColGroup(l.closest(".fl-row").attr("data-node"),l.attr("data-cols"),o.hasClass("fl-drop-target-last")?r+1:r)):(s=l.closest(".fl-row"),r=s.length?e(FLBuilder._contentClass+" > .fl-row").index(s):0,FLBuilder._addRow(l.attr("data-cols"),o.hasClass("fl-drop-target-last")?r+1:r)),l.remove(),FLBuilder._showPanel(),e(".fl-builder-modules").siblings(".fl-builder-blocks-section-title").eq(0).trigger("click")}else s=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o.parent().hasClass("fl-builder-content")||(o.hasClass("fl-drop-target-last")?o.parent().after(s):o.parent().before(s),FLBuilder._reorderNode(s.attr("data-node"),s.index())),e(".fl-row-sortable-proxy").append(i.item)},_addRow:function(t,i){FLBuilder._showNodeLoadingPlaceholder(e(FLBuilder._contentClass),i),FLBuilder._newRowPosition=i,FLBuilder.ajax({action:"render_new_row",cols:t,position:i},FLBuilder._addRowComplete)},_addRowComplete:function(t){var i="object"==typeof t?t:JSON.parse(t),l=e(FLBuilder._contentClass),o=e(i.html).data("node"),s=FLBuilder._addModuleAfterNodeRender;i.nodeParent=l,i.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(i,function(){null!==s&&(e(".fl-node-"+o+" .fl-col-content").append(s),FLBuilder._reorderModule(s),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+o)),FLBuilder.triggerHook("didAddRow",o)})},_deleteRowClicked:function(t){var i=e(this).closest(".fl-row"),l=null;i.find(".fl-module").length?(l=confirm(FLBuilderStrings.deleteRowMessage),l&&FLBuilder._deleteRow(i)):FLBuilder._deleteRow(i),FLBuilder._removeAllOverlays(),t.stopPropagation()},_deleteRow:function(e){var t=e.attr("data-node");FLBuilder.ajax({action:"delete_node",node_id:t}),e.empty(),e.remove(),FLBuilder._setupEmptyLayout(),FLBuilder._removeRowOverlays(),FLBuilder.triggerHook("didDeleteRow",t)},_rowCopyClicked:function(t){var i=e(this).closest(".fl-row"),l=i.attr("data-node"),o=e(FLBuilder._contentClass+" > .fl-row").index(i)+1,s=i.clone(),n=e(".fl-builder-settings[data-node]"),r=n.attr("data-node"),a=r===l?i:i.find('[data-node="'+r+'"]'),d=null;n.length&&a.length&&(d=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[r]=d),s.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),s.find(".fl-block-overlay").remove(),i.after(s),e("html, body").animate({scrollTop:s.offset().top-75},500),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newRowPosition=o,FLBuilder.ajax({action:"copy_row",node_id:l,settings:d,settings_id:r},function(e){var t=JSON.parse(e);t.duplicatedRow=l,FLBuilder._rowCopyComplete(t)}),t.stopPropagation()},_rowCopyComplete:function(t){t.nodeParent=e(FLBuilder._contentClass),t.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(t,function(){FLBuilder.triggerHook("didDuplicateRow",{newNodeId:t.nodeId,oldNodeId:t.duplicatedRow}),t.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_rowSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-row").attr("data-node"),o=i.closest(".fl-block-overlay-global").length>0,s=null;o&&"row"!=FLBuilderConfig.userTemplateType?FLBuilderConfig.userCanEditGlobalTemplates&&(s=window.open(e('.fl-row[data-node="'+l+'"]').attr("data-template-url")),s.FLBuilderGlobalNodeId=l):i.hasClass("fl-block-settings")&&FLBuilderSettingsForms.render({id:"row",nodeId:l,className:"fl-builder-row-settings",attrs:'data-node="'+l+'"',buttons:o||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:o?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[l],preview:{type:"row"}},function(){e("#fl-field-width select").on("change",FLBuilder._rowWidthChanged),e("#fl-field-content_width select").on("change",FLBuilder._rowWidthChanged)}),t.stopPropagation()},_rowWidthChanged:function(){var t=e("#fl-field-width select").val(),i=e("#fl-field-content_width select").val(),l=e("#fl-field-max_content_width");"fixed"==t||"full"==t&&"fixed"==i?l.show():l.hide()},_resetRowWidthClicked:function(t){var i=e(this),l=i.closest(".fl-row"),o=l.attr("data-node"),s=l.find(".fl-row-content"),n=FLBuilderConfig.global.row_width+"px",r=e(".fl-builder-row-settings");l.hasClass("fl-row-fixed-width")&&l.css("max-width",n),s.css("max-width",n),r.length&&r.find("[name=max_content_width]").val(""),FLBuilder.ajax({action:"resize_row_content",node:o,width:""}),FLBuilder._closeAllSubmenus(),FLBuilder.triggerHook("didResetRowWidth",o),t.stopPropagation()},_highlightEmptyCols:function(){var t="row"==FLBuilderConfig.userTemplateType||"column"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",i=(e(FLBuilder._contentClass+" .fl-row"+t),e(FLBuilder._contentClass+" .fl-col"+t));e(".fl-row-highlight").removeClass("fl-row-highlight"),i.removeClass("fl-col-highlight").find(".fl-col-content").css("height",""),i.each(function(){var t=e(this);0===t.find(".fl-module, .fl-col").length&&t.addClass("fl-col-highlight")})},_removeEmptyColHighlights:function(){e(".fl-row-highlight").removeClass("fl-row-highlight"),e(".fl-col-highlight").removeClass("fl-col-highlight")},_highlightRowsAndColsForDrag:function(t){var i="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)";"column"==FLBuilderConfig.userTemplateType&&(i=":not(:first)"),e(FLBuilder._contentClass+" .fl-row").addClass("fl-row-highlight"),t.closest(".fl-row-overlay").length||e(FLBuilder._contentClass+" .fl-col"+i).addClass("fl-col-highlight")},_adjustColHeightsForDrag:function(){var t="row"==FLBuilderConfig.userTemplateType?"":".fl-row:not(.fl-node-global) ",i="column"==FLBuilderConfig.userTemplateType?"":".fl-col:not(.fl-node-global) ",l=e(FLBuilder._contentClass),o=l.find(t+".fl-col-group:not(.fl-col-group-nested) > "+i+"> .fl-col-content"),s=l.find(t+".fl-col-group-nested "+i+".fl-col-content"),n=0;for(e(".fl-node-drag-init").hide();n<s.length;n++)FLBuilder._adjustColHeightForDrag(s.eq(n));for(n=0;n<o.length;n++)FLBuilder._adjustColHeightForDrag(o.eq(n));e(".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 t=e(this),i=t.find("a"),l=t.closest(".fl-col"),o=l.parents(".fl-col"),s=e('<div class="fl-col-highlight-guide"></div>'),n=null,r=t.closest(".fl-block-overlay").offset().top;(i.hasClass("fl-block-col-move-parent")||i.hasClass("fl-block-col-edit-parent"))&&(l=o),l.hasClass("fl-col-highlight")||(l.find("> .fl-col-content").append(s),l.addClass("fl-col-has-highlight-guide"),n=s.offset().top,n>r&&s.css("top",r-n+4+"px"))},_removeColHighlightGuides:function(){e(".fl-col-has-highlight-guide").removeClass("fl-col-has-highlight-guide"),e(".fl-col-highlight-guide").remove()},_colMouseenter:function(){var t=e(this),i=t.closest(".fl-col-group"),l=i.hasClass("fl-col-group-has-child-loading"),o=t.hasClass("fl-node-global"),s=t.parents(".fl-node-global").length>0,n=t.closest(".fl-col-group").find("> .fl-col").length,r=i.find("> .fl-col").index(t),a=0===r,d=n===r+1,u=t.find(".fl-col").length>0,c=t.find(".fl-module").length>0,h=t.parents(".fl-col"),f=h.closest(".fl-col-group"),g=h.length>0,p="undefined"!=typeof t.data("template-url"),b="column"==FLBuilderConfig.userTemplateType&&!g;numParentCols=g?f.find("> .fl-col").length:0,parentIndex=f.find("> .fl-col").index(h),parentFirst=!!g&&0===parentIndex,parentLast=!!g&&numParentCols===parentIndex+1,contentWidth=t.find("> .fl-col-content").width(),row=t.closest(".fl-row"),rowIsFixedWidth=!!row.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,userCanResizeRows=FLBuilderConfig.rowResize.userCanResizeRows,template=wp.template("fl-col-overlay"),overlay=null,FLBuilderConfig.simpleUi||o&&s&&c&&!p||o&&"column"==FLBuilderConfig.userTemplateType&&c||!o&&t.find(".fl-module").length>0||t.find(".fl-builder-node-loading-placeholder").length>0||!c&&u||s&&u&&!p||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:n,first:a,last:d,isRootCol:b,hasChildCols:u,hasParentCol:g,parentFirst:parentFirst,parentLast:parentLast,numParentCols:numParentCols,contentWidth:contentWidth,rowIsFixedWidth:rowIsFixedWidth,userCanResizeRows:userCanResizeRows})),FLBuilder._buildOverlayOverflowMenu(overlay),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_colMouseleave:function(t){var i=e(this),l=e(t.toElement)||e(t.relatedTarget),o=i.find(".fl-module").length>0,s=(i.hasClass("fl-node-global"),"undefined"!=typeof i.data("template-url")),n=l.is("#tiptip_holder"),r=l.closest("#tiptip_holder").length>0;n||r||o&&!s||(FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._closeAllSubmenus())},_removeColOverlays:function(){var t=e(".fl-col");t.removeClass("fl-block-overlay-active"),t.find(".fl-col-overlay").remove(),e("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_colDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.column+"</div>")},_colDragInit:function(t){var i=e(t.target),l=e(".fl-col-sortable-proxy-item"),o=i.closest(".fl-col");i.hasClass("fl-block-col-move-parent")&&(o=o.parents(".fl-col")),o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),FLBuilder._removeColHighlightGuides(),t.target=l[0],l.trigger(t)},_colDragStart:function(t,i){var l=e(".fl-node-dragging");l.hide(),FLBuilder._resetColumnWidths(l.parent()),FLBuilder._blockDragStart(t,i)},_colDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o=l.attr("data-node"),s=i.item.parent(),n=l.parent(),r=n.attr("data-node");newGroup=s.closest(".fl-col-group"),newGroupId=newGroup.attr("data-node"),newRow=s.closest(".fl-row"),position=0,s.hasClass("fl-sortable-disabled")?FLBuilder._resetColumnWidths(n):s.hasClass("fl-col-sortable-proxy")?FLBuilder._resetColumnWidths(n):s.hasClass("fl-col-content")?(l.remove(),0===n.find(".fl-col").length&&n.remove(),position=s.find("> .fl-module, .fl-col-group, .fl-col-sortable-proxy-item").index(i.item),FLBuilder._addColGroup(s.closest(".fl-col").attr("data-node"),o,position)):s.hasClass("fl-col-drop-target")?(s.hasClass("fl-col-drop-target-last")?s.parent().after(l):s.parent().before(l),FLBuilder._resetColumnWidths(newGroup),r==newGroupId?FLBuilder.ajax({action:"reorder_col",node_id:o,position:l.index()}):FLBuilder.ajax({action:"move_col",node_id:o,new_parent:newGroupId,position:l.index(),resize:[r,newGroupId]}),FLBuilder._resizeLayout()):s.hasClass("fl-col-group-drop-target")?(l.remove(),0===n.find(".fl-col").length&&n.remove(),position=newRow.find(".fl-row-content > .fl-col-group").index(newGroup),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addColGroup(newRow.attr("data-node"),o,position)):s.hasClass("fl-row-drop-target")&&(l.remove(),position=s.closest(".fl-builder-content").find(".fl-row").index(newRow),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addRow(o,position)),0===n.find(".fl-col").length&&n.remove(),e(".fl-col-sortable-proxy").append(i.item),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._closeAllSubmenus()},_colSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-col"),o=l.find("> .fl-col-content"),s=i.parent().find("ul.fl-builder-submenu").length>0,n=i.closest(".fl-block-overlay-global").length>0,r=i.closest(".fl-block-overlay-global").hasClass("fl-col-overlay"),a="column"!=FLBuilderConfig.userTemplateType&&"undefined"!=typeof l.attr("data-template-url"),d=null;FLBuilder._colResizing||n&&!FLBuilderConfig.userCanEditGlobalTemplates||s&&!i.hasClass("fl-col-overlay")||(i.hasClass("fl-block-col-edit-parent")&&(l=l.parents(".fl-col")),d=l.attr("data-node"),n&&r&&a?FLBuilderConfig.userCanEditGlobalTemplates&&(win=window.open(e('.fl-col[data-node="'+d+'"]').attr("data-template-url")),win.FLBuilderGlobalNodeId=d):FLBuilderSettingsForms.render({id:"col",nodeId:d,className:"fl-builder-col-settings",attrs:'data-node="'+d+'"',buttons:n||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:n?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[d],preview:{type:"col"}},function(){0===l.siblings(".fl-col").length?e("#fl-builder-settings-section-general").hide():o.width()<=40&&e("#fl-field-size").hide()}),t.stopPropagation())},_copyColClicked:function(t){var i=e(this).closest(".fl-col"),l=i.attr("data-node"),o=i.clone(),s=i.parent(),n=e(".fl-builder-settings[data-node]"),r=n.attr("data-node"),a=r===l?i:i.find('[data-node="'+r+'"]'),d=null;n.length&&a.length&&(d=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[r]=d),o.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),o.find(".fl-block-overlay").remove(),i.after(o),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newColParent=s,FLBuilder._newColPosition=i.index()+1,FLBuilder._resetColumnWidths(s),FLBuilder.ajax({action:"copy_col",node_id:l,settings:d,settings_id:r},function(e){var t=JSON.parse(e);t.duplicatedColumn=l,FLBuilder._copyColComplete(t)}),t.stopPropagation()},_copyColComplete:function(e){e.nodeParent=FLBuilder._newColParent,e.nodePosition=FLBuilder._newColPosition,FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateColumn",{newNodeId:e.nodeId,oldNodeId:e.duplicatedColumn}),e.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_deleteColClicked:function(t){var i=e(this),l=i.closest(".fl-col"),o=l.closest(".fl-col-group"),s=l.parents(".fl-col"),n=s.length>0,r=s.find("> .fl-col-content > .fl-module, > .fl-col-content > .fl-col-group"),a=l.siblings(".fl-col"),d=!0;l.find(".fl-module").length>0&&(d=confirm(FLBuilderStrings.deleteColumnMessage)),n&&1===r.length&&(0===a.length?l=s:1!==a.length||a.find(".fl-module").length||(l=o)),d&&(FLBuilder._deleteCol(l),FLBuilder._removeAllOverlays(),FLBuilder._highlightEmptyCols()),t.stopPropagation()},_deleteCol:function(e){var t=e.attr("data-node"),i=e.closest(".fl-row"),l=e.closest(".fl-col-group"),o=0;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):(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})),FLBuilder.ajax({action:"delete_col",node_id:t,new_width:o}),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder.triggerHook("didDeleteColumn",t))},_addCols:function(e,t,i,l){var o=e.closest(".fl-col-group"),s=o.find(".fl-col").index(e);i="undefined"==typeof i?"1-col":i,l="undefined"!=typeof l&&l,"after"==t&&s++,FLBuilder._showNodeLoadingPlaceholder(o,s),FLBuilder._removeAllOverlays(),FLBuilder.ajax({action:"render_new_columns",node_id:e.attr("data-node"),insert:t,type:i,nested:l?1:0},FLBuilder._addColsComplete)},_addColsComplete:function(t){var i=JSON.parse(t),l=null,o=FLBuilder._addModuleAfterNodeRender;i.nodeParent=FLBuilder._newColParent,i.nodePosition=FLBuilder._newColPosition,FLBuilder._renderLayout(i,function(){null!==o&&(e('.fl-module[data-node="'+o.module.data("node")+'"]').remove(),l=e('.fl-col[data-node="'+o.colId+'"]'),"after"==o.position?l.next().find(".fl-col-content").append(o.module):l.prev().find(".fl-col-content").append(o.module),FLBuilder._reorderModule(o.module),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+i.nodeId)),FLBuilder.triggerHook("didAddColumn",i.nodeId),FLBuilder.triggerHook("didResetColumnWidths",{cols:e(".fl-node-"+i.nodeId).find("> .fl-col")})})},_addColGroup:function(t,i,l){var o=e(".fl-node-"+t);FLBuilder._newColGroupPosition=l,o.hasClass("fl-col")?FLBuilder._newColGroupParent=o.find(" > .fl-col-content"):FLBuilder._newColGroupParent=o.find(".fl-row-content"),FLBuilder._showNodeLoadingPlaceholder(FLBuilder._newColGroupParent,l),FLBuilder.ajax({action:"render_new_column_group",cols:i,node_id:t,position:l},FLBuilder._addColGroupComplete)},_addColGroupComplete:function(t){var i=JSON.parse(t),l=e(i.html),o=l.data("node"),s=l.find(".fl-col").data("node"),n=FLBuilder._addModuleAfterNodeRender;i.nodeParent=FLBuilder._newColGroupParent,i.nodePosition=FLBuilder._newColGroupPosition,FLBuilder._renderLayout(i,function(){i.nodeParent.hasClass("fl-col-content")&&i.nodeParent.parents(".fl-col").addClass("fl-col-has-cols"),null!==n&&(e(".fl-node-"+s+" .fl-col-content").append(n),FLBuilder._reorderModule(n),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+o)),FLBuilder.triggerHook("didAddColumnGroup",o)})},_initColDragResizing:function(){e(".fl-block-col-resize").not(".fl-block-row-resize").draggable({axis:"x",start:FLBuilder._colDragResizeStart,drag:FLBuilder._colDragResize,stop:FLBuilder._colDragResizeStop})},_colDragResizeStart:function(t,i){var l=e(i.helper),o="",s=l.hasClass("fl-block-col-resize-parent"),n=s?l.closest(".fl-col").parents(".fl-col"):null,r=s?n.parents(".fl-col-group"):l.closest(".fl-col-group"),a=r.find("> .fl-col"),d=s?n:l.closest(".fl-col"),u=d.attr("data-node"),c=e("[data-node="+u+"] #fl-field-size input"),h=null,f=null,g=null,p=100,b=0,m=null,v=null;for(l.hasClass("fl-block-col-resize-e")?(o="e",h=d.nextAll(".fl-col").first()):(o="w",h=d.prevAll(".fl-col").first()),f=h.attr("data-node"),g=e("[data-node="+f+"] #fl-field-size input");b<a.length;b++)a.eq(b).data("node")!=d.data("node")&&a.eq(b).data("node")!=h.data("node")&&(p-=parseFloat(a.eq(b)[0].style.width));c.length?(m=c,v="col"):g.length&&(m=g,v="sibling"),FLBuilder._colResizeData={handle:l,feedbackLeft:l.find(".fl-block-col-resize-feedback-left"),feedbackRight:l.find(".fl-block-col-resize-feedback-right"),direction:o,groupWidth:r.outerWidth(),col:d,colWidth:parseFloat(d[0].style.width)/100,sibling:h,offset:i.position.left,availWidth:p,setting:m,settingType:v},FLBuilder._colResizing=!0,e("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"),s=(i.offset-t.position.left)/i.groupWidth,n=l==i.direction?100*(i.colWidth-s):100*(i.colWidth+s),r=Math.round(100*n)/100,a=i.availWidth-n,d=Math.round(100*a)/100,u=8,c=Math.round(100*(i.availWidth-u))/100;
|
4 |
+
r<u?(r=u,d=c):d<u&&(r=c,d=u),l==i.direction?(i.feedbackLeft.html(r.toFixed(1)+"%").show(),i.feedbackRight.html(d.toFixed(1)+"%").show()):(i.feedbackLeft.html(d.toFixed(1)+"%").show(),i.feedbackRight.html(r.toFixed(1)+"%").show()),i.col.css("width",r+"%"),i.sibling.css("width",d+"%"),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))),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder.triggerHook("col-resize-drag")},_colDragResizeStop:function(t,i){var l=FLBuilder._colResizeData,o=FLBuilder._colResizeData.handle.closest(".fl-block-overlay"),s=l.col.data("node"),n=parseFloat(l.col[0].style.width),r=l.sibling.data("node"),a=parseFloat(l.sibling[0].style.width);FLBuilder._colResizeData.feedbackLeft.hide(),FLBuilder._colResizeData.feedbackRight.hide(),FLBuilder.ajax({action:"resize_cols",col_id:s,col_width:n,sibling_id:r,sibling_width:a}),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder._colResizeData=null,e("body").removeClass("fl-builder-col-resizing"),FLBuilder._bindOverlayEvents(),setTimeout(function(){FLBuilder._colResizing=!1},50),FLBuilder.triggerHook("col-resize-stop"),FLBuilder.triggerHook("didResizeColumn",{colId:s,colWidth:n,siblingId:r,siblingWidth:a})},_resetColumnWidthsClicked:function(t){var i=e(this),l=!!i.closest(".fl-row-overlay").length,o=null,s=null,n=[],r=null,a=0,d=e(".fl-builder-col-settings"),u=null;s=l?i.closest(".fl-row").find(".fl-row-content > .fl-col-group"):i.parents(".fl-col-group").last(),s.each(function(){for(o=e(this),r=o.find(".fl-col-group"),n.push(o.data("node")),FLBuilder._resetColumnWidths(o),a=0;a<r.length;a++)FLBuilder._resetColumnWidths(r.eq(a)),n.push(r.eq(a).data("node"))}),d.length&&(u=e(".fl-node-"+d.attr("data-node")),d.find("#fl-field-size input").val(parseFloat(u[0].style.width))),FLBuilder.ajax({action:"reset_col_widths",group_id:n}),FLBuilder.triggerHook("col-reset-widths"),FLBuilder._closeAllSubmenus(),t.stopPropagation()},_resetColumnWidths:function(e){var t=e.find(" > .fl-col:visible"),i=0;i=6===t.length?16.65:7===t.length?14.28:Math.round(100/t.length*100)/100,t.css("width",i+"%"),FLBuilder.triggerHook("didResetColumnWidths",{cols:t})},_moduleMouseenter:function(){var t=e(this),i=t.attr("data-name"),l=t.hasClass("fl-node-global"),o=t.parents(".fl-node-global").length>0,s=t.parents(".fl-col-group").last(),n=s.hasClass("fl-col-group-has-child-loading"),r=t.closest(".fl-col-group").find("> .fl-col").length,a=t.closest(".fl-col"),d=0===a.index(),u=r===a.index()+1,c=a.parents(".fl-col"),h=c.length>0,f=h?c.closest(".fl-col-group").find("> .fl-col").length:0,g=!!h&&0===c.index(),p=!!h&&f===c.index()+1,b="column"==FLBuilderConfig.userTemplateType&&!h;contentWidth=a.find("> .fl-col-content").width(),row=t.closest(".fl-row"),isGlobalRow=row.hasClass("fl-node-global"),rowIsFixedWidth=!!row.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,userCanResizeRows=FLBuilderConfig.rowResize.userCanResizeRows,template=wp.template("fl-module-overlay"),overlay=null,FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),l&&o&&"row"!=FLBuilderConfig.userTemplateType&&isGlobalRow||l&&o&&"column"!=FLBuilderConfig.userTemplateType&&!isGlobalRow||t.closest(".fl-builder-node-loading").length||t.find(".fl-inline-editor:visible").length||(t.hasClass("fl-block-overlay-active")||(overlay=FLBuilder._appendOverlay(t,template({global:l,moduleName:i,groupLoading:n,numCols:r,colFirst:d,colLast:u,isRootCol:b,hasParentCol:h,numParentCols:f,parentFirst:g,parentLast:p,contentWidth:contentWidth,rowIsFixedWidth:rowIsFixedWidth,userCanResizeRows:userCanResizeRows})),FLBuilder._buildOverlayOverflowMenu(overlay),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_moduleMouseleave:function(t){var i=(e(this),e(t.toElement)||e(t.relatedTarget)),l=i.is("#tiptip_holder"),o=i.closest("#tiptip_holder").length>0;l||o||(FLBuilder._removeModuleOverlays(),FLBuilder._removeColHighlightGuides())},_removeModuleOverlays:function(){var t=e(".fl-module");t.removeClass("fl-block-overlay-active"),t.find(".fl-module-overlay").remove(),e("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_moduleDragHelper:function(t,i){return e('<div class="fl-builder-block-drag-helper">'+i.attr("data-name")+"</div>")},_moduleDragStart:function(t,i){e(i.item).data("original-position",i.item.index()),FLBuilder._blockDragStart(t,i)},_moduleDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=i.item,o=l.parent(),s=null,n=0,r=0;if(o.hasClass("fl-builder-modules")||o.hasClass("fl-builder-widgets"))return void l.remove();if(l.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=l.closest(".fl-builder-content"),r=0,s=l.closest(".fl-row"),n=o.find(".fl-row").index(s)):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),r=o.closest(".fl-row").attr("data-node"),s=l.closest(".fl-col-group"),n=o.find(" > .fl-col-group").index(s)):o.hasClass("fl-col-drop-target")?(o=l.closest(".fl-col-group"),r=o.attr("data-node"),s=l.closest(".fl-col"),n=o.find(" > .fl-col").index(s)):(n=o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(l),r=l.closest(".fl-col").attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),FLBuilder._addModule(o,r,l.attr("data-type"),n,l.attr("data-widget"),l.attr("data-alias")),l.remove()}else{if(o.hasClass("fl-sortable-disabled"))return e(t.target).append(i.item),e(t.target).children().eq(i.item.data("original-position")).before(i.item),void FLBuilder._highlightEmptyCols();o.hasClass("fl-row-drop-target")?(s=l.closest(".fl-row"),n=l.closest(".fl-builder-content").children(".fl-row").index(s),n=l.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addModuleAfterNodeRender=l,FLBuilder._addRow("1-col",n),l.remove()):o.hasClass("fl-col-group-drop-target")?(s=l.closest(".fl-col-group"),n=l.closest(".fl-row-content ").find(" > .fl-col-group").index(s),n=l.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addModuleAfterNodeRender=l,FLBuilder._addColGroup(l.closest(".fl-row").attr("data-node"),"1-col",n),l.remove()):o.hasClass("fl-col-drop-target")?(s=l.closest(".fl-col"),n=l.closest(".fl-col-drop-target-last").length?"after":"before",FLBuilder._addModuleAfterNodeRender={module:l,colId:s.data("node"),position:n},FLBuilder._addCols(s,n,"1-col",l.closest(".fl-col-group-nested").length>0),l.remove()):FLBuilder._reorderModule(l)}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(t){var i=e(this).closest(".fl-module"),l=confirm(FLBuilderStrings.deleteModuleMessage);l&&(FLBuilder._deleteModule(i),FLBuilder._removeAllOverlays()),t.stopPropagation()},_deleteModule:function(e){var t=e.closest(".fl-row"),i=e.attr("data-node");FLBuilder.ajax({action:"delete_node",node_id:i}),e.empty(),e.remove(),t.removeClass("fl-block-overlay-muted"),FLBuilder._highlightEmptyCols(),FLBuilder._removeAllOverlays(),FLBuilder.triggerHook("didDeleteModule",i)},_moduleCopyClicked:function(t){var i=e(this).closest(".fl-module"),l=i.attr("data-node"),o=i.index()+1,s=i.clone(),n=e(".fl-builder-module-settings[data-node="+l+"]"),r=null;n.length&&(r=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[l]=r),s.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),s.find(".fl-block-overlay").remove(),i.after(s),e("html, body").animate({scrollTop:s.offset().top-75},500),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newModuleParent=i.parent(),FLBuilder._newModulePosition=o,FLBuilder.ajax({action:"copy_module",node_id:l,settings:r},function(e){var t=JSON.parse(e);t.duplicatedModule=l,FLBuilder._moduleCopyComplete(t)}),t.stopPropagation()},_moduleCopyComplete:function(e){e.nodeParent=FLBuilder._newModuleParent,e.nodePosition=FLBuilder._newModulePosition,FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateModule",{newNodeId:e.nodeId,oldNodeId:e.duplicatedModule}),e.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_moduleSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-module").attr("data-type"),o=i.closest(".fl-module").attr("data-node"),s=i.closest(".fl-col").attr("data-node"),n=i.closest(".fl-block-overlay-global").length>0;t.stopPropagation(),FLBuilder._colResizing||n&&!FLBuilderConfig.userCanEditGlobalTemplates||FLBuilder._showModuleSettings({type:l,nodeId:o,parentId:s,global:n})},_showModuleSettings:function(t,i){if(FLBuilderSettingsConfig.modules){var l=FLBuilderSettingsConfig.modules[t.type],o=t.settings?t.settings:FLBuilderSettingsConfig.nodes[t.nodeId],s=e("head");-1===e.inArray(t.type,FLBuilder._loadedModuleAssets)&&(""!==l.assets.css&&s.append(l.assets.css),""!==l.assets.js&&s.append(l.assets.js),FLBuilder._loadedModuleAssets.push(t.type)),FLBuilderSettingsForms.render({type:"module",id:t.type,nodeId:t.nodeId,className:"fl-builder-module-settings fl-builder-"+t.type+"-settings",attrs:'data-node="'+t.nodeId+'" data-parent="'+t.parentId+'" data-type="'+t.type+'"',buttons:t.global||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:t.global?[FLBuilderStrings.global]:[],settings:o,legacy:t.legacy,helper:FLBuilder._moduleHelpers[t.type],rules:FLBuilder._moduleHelpers[t.type]?FLBuilder._moduleHelpers[t.type].rules:null,preview:{type:"module",layout:t.layout,callback:function(){FLBuilder.triggerHook("didAddModule",t.nodeId)}}},i)}},_saveModuleClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=t.attr("data-type"),l=(t.attr("data-node"),FLBuilder._moduleHelpers[i]),o=!0;"undefined"!=typeof l&&(t.find("label.error").remove(),t.validate().hideErrors(),o=t.validate().form(),o&&(o=l.submit())),o?FLBuilder._saveSettings():FLBuilder._toggleSettingsTabErrors()},_addModule:function(e,t,i,l,o,s){FLBuilder._showNodeLoadingPlaceholder(e,l),e.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=e,FLBuilder._newModulePosition=l),FLBuilder.ajax({action:"render_new_module",parent_id:t,type:i,position:l,node_preview:1,widget:"undefined"==typeof o?"":o,alias:"undefined"==typeof s?"":s},FLBuilder._addModuleComplete)},_addModuleComplete:function(t){var i=JSON.parse(t);i.layout&&(i.layout.nodeParent=FLBuilder._newModuleParent,i.layout.nodePosition=FLBuilder._newModulePosition),i.settings||(i.settings=FLBuilderSettingsConfig.defaults.modules[i.type]),e("form.fl-builder-settings").length?i.layout&&FLBuilder._renderLayout(i.layout):FLBuilder._showModuleSettings(i,function(){e(".fl-builder-module-settings").data("new-module","1")})},registerModuleHelper:function(t,i){var l={rules:{},init:function(){},submit:function(){return!0},preview:function(){}};FLBuilder._moduleHelpers[t]=e.extend({},l,i)},_registerModuleHelper:function(e,t){FLBuilder.registerModuleHelper(e,t)},_showNodeTemplateSettings:function(t){var i=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=i.attr("data-node"),o=FLBuilderStrings.saveModule;return i.hasClass("fl-builder-row-settings")?o=FLBuilderStrings.saveRow:i.hasClass("fl-builder-col-settings")&&(o=FLBuilderStrings.saveColumn),!!FLBuilder._triggerSettingsSave(!1,!1,!1)&&void FLBuilderSettingsForms.render({id:"node_template",nodeId:l,title:o,attrs:'data-node="'+l+'"',className:"fl-builder-node-template-settings",rules:{name:{required:!0}}},function(){FLBuilderConfig.userCanEditGlobalTemplates||e("#fl-field-global").hide()})},_saveNodeTemplate:function(){var t=e(".fl-builder-node-template-settings"),i=t.attr("data-node"),l=t.validate().form();l&&(FLBuilder._showNodeLoading(i),FLBuilder.ajax({action:"save_node_template",node_id:i,settings:FLBuilder._getSettings(t)},function(e){FLBuilder._saveNodeTemplateComplete(e),FLBuilder._hideNodeLoading(i)}),FLBuilder._lightbox.close())},_saveNodeTemplateComplete:function(t){var i=JSON.parse(t),l=e(".fl-builder-saved-"+i.type+"s"),o=l.find(".fl-builder-block"),s=null,n="",r=i.name.toLowerCase(),a=0,d=wp.template("fl-node-template-block"),u={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(u),FLBuilder.triggerHook("contentItemsChanged"),i.layout&&(FLBuilder._renderLayout(i.layout),FLBuilder.triggerHook("didSaveGlobalNodeTemplate",i.config)),0===o.length)l.append(d(i));else for(;a<o.length;a++){if(s=o.eq(a),n=s.text().toLowerCase().trim(),0===a&&r<n){l.prepend(d(i));break}if(r<n){s.before(d(i));break}if(o.length-1===a){l.append(d(i));break}}l.find(".fl-builder-block-no-node-templates").remove()},_nodeTemplateDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=i.item,o=l.parent(),s=null,n=0,r=null,a="",d=null;if(o.hasClass("fl-builder-blocks-section-content"))return void l.remove();if(l.hasClass("fl-builder-block-saved-row")||l.hasClass("fl-builder-block-row-template"))r=l.closest(".fl-row"),n=r.length?e(FLBuilder._contentClass+" .fl-row").index(r):0,n=o.hasClass("fl-drop-target-last")?n+1:n,s=null,a="render_new_row",d=FLBuilder._addRowComplete,FLBuilder._newRowPosition=n,FLBuilder._showNodeLoadingPlaceholder(e(FLBuilder._contentClass),n);else if(l.hasClass("fl-builder-block-saved-column")){if(r=l.closest(".fl-col"),colGroup=o.closest(".fl-col-group"),colGroupId=colGroup.attr("data-node"),a="render_new_col_template",d=FLBuilder._addColsComplete,o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(r=l.closest(".fl-row"),s=0,o=e(FLBuilder._contentClass),n=r.length?o.find(".fl-row").index(r):0):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),s=l.closest(".fl-row").attr("data-node"),n=l.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(l.closest(".fl-col-group"))):o.hasClass("fl-col-drop-target")&&(o=l.closest(".fl-col-group"),n=o.children(".fl-col").index(l.closest(".fl-col")),s=o.attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),o.hasClass("fl-col-group")?FLBuilder._newColParent=null:FLBuilder._newColParent=o,FLBuilder._newColPosition=n,FLBuilder._showNodeLoadingPlaceholder(o,n)}else if(l.hasClass("fl-builder-block-saved-module")||l.hasClass("fl-builder-block-module-template")){if(a="render_new_module",d=FLBuilder._addModuleComplete,o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=l.closest(".fl-builder-content"),s=0,n=o.find(".fl-row").index(l.closest(".fl-row"))):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),s=o.closest(".fl-row").attr("data-node"),n=o.find(" > .fl-col-group").index(l.closest(".fl-col-group"))):o.hasClass("fl-col-drop-target")?(o=l.closest(".fl-col-group"),n=o.children(".fl-col").index(l.closest(".fl-col")),s=o.attr("data-node")):(n=o.children(".fl-module, .fl-builder-block").index(l),s=l.closest(".fl-col").attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),o.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=o,FLBuilder._newModulePosition=n),FLBuilder._showNodeLoadingPlaceholder(o,n)}FLBuilder.ajax({action:a,template_id:l.attr("data-id"),template_type:l.attr("data-type"),parent_id:s,position:n},function(e){if(a.indexOf("row")>-1){var t=JSON.parse(e);FLBuilder.triggerHook("didApplyRowTemplateComplete",t.config),d(t.layout)}else d(e)}),l.remove()},_editNodeTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteNodeTemplateClicked:function(t){var i=e(t.target),l=i.closest(".fl-builder-blocks-section"),o=l.find(".fl-builder-blocks-section-content"),s=o.find(".fl-builder-block"),n=i.closest(".fl-builder-block"),r=n.hasClass("fl-builder-block-global"),a=r?FLBuilder._updateLayout:void 0,d=r?FLBuilderStrings.deleteGlobalTemplate:FLBuilderStrings.deleteTemplate,u=null;confirm(d)&&(n.remove(),1===s.length&&(n.hasClass("fl-builder-block-saved-row")?o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedRows+"</span>"):o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedModules+"</span>")),n.hasClass("fl-builder-block-global")&&FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"delete_node_template",template_id:n.attr("data-id")},a),u=_.findIndex(FLBuilderConfig.contentItems.template,{id:n.attr("data-id"),type:"user"}),FLBuilderConfig.contentItems.template.splice(u,1),FLBuilder.triggerHook("contentItemsChanged"))},_initSettingsForms:function(){FLBuilder._initCodeFields(),FLBuilder._initColorPickers(),FLBuilder._initSelectFields(),FLBuilder._initEditorFields(),FLBuilder._initMultipleFields(),FLBuilder._initAutoSuggestFields(),FLBuilder._initLinkFields(),FLBuilder._initFontFields(),FLBuilder._initOrderingFields(),FLBuilder._initTimezoneFields(),FLBuilder._focusFirstSettingsControl(),FLBuilder._lightbox._resizeEditors(),e(".fl-builder-settings-fields").css("visibility","visible"),FLBuilder.triggerHook("settings-form-init")},_destroySettingsForms:function(){FLBuilder._destroyEditorFields()},_setSettingsFormContent:function(t){e(".fl-legacy-settings").remove(),e("body").append(t)},_settingsTabClicked:function(t){var i=e(this),l=i.closest(".fl-builder-settings"),o=i.attr("href").split("#").pop();FLBuilder._resetSettingsTabsState(),l.find(".fl-builder-settings-tab").removeClass("fl-active"),l.find("#"+o).addClass("fl-active"),l.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),l.find("a[href*="+o+"]").addClass("fl-active"),FLBuilder._focusFirstSettingsControl(),t.preventDefault()},_resetSettingsTabsState:function(){var t=e(".fl-lightbox:visible");FLBuilder._hideTabsOverflowMenu(),t.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),t.find(".fl-builder-settings-tabs-overflow-menu .fl-active").removeClass("fl-active"),t.find(".fl-contains-active").removeClass("fl-contains-active")},_calculateSettingsTabsOverflow:function(){var t=e(".fl-lightbox:visible"),i=t.outerWidth(),l=t.hasClass("fl-lightbox-width-slim"),o=t.find(".fl-builder-settings-tabs"),s=t.find(".fl-builder-settings-tabs-overflow-menu"),n=t.find(".fl-builder-settings-tabs-more"),r=o.find("a"),a=!1,d=i-60,u=0,c=l?16:30;s.html(""),FLBuilder._hideTabsOverflowMenu(),r.removeClass("fl-overflowed"),r.each(function(){if(!e(this).is(":visible"))return!0;if(!a){var t=e(this).textWidth()+c+12;u+=t,u>=d&&(a=!0)}if(a){var i=e(this).html(),l=e(this).attr("href"),o="";e(this).hasClass("fl-active")&&(o="fl-active"),e(this).hasClass("error")&&(o+=" error"),""!==o&&(o='class="'+o+'"');var n=e('<a href="'+l+'" '+o+">"+i+"</a>");s.append(n),e(this).addClass("fl-overflowed")}else e(this).removeClass("fl-overflowed")}),a?t.addClass("fl-lightbox-has-tab-overflow"):t.removeClass("fl-lightbox-has-tab-overflow"),s.find(".fl-active").length>0?n.addClass("fl-contains-active"):n.removeClass("fl-contains-active"),s.find(".error").length>0?n.addClass("fl-contains-errors"):n.removeClass("fl-contains-errors")},_settingsTabsToOverflowMenuItemClicked:function(t){var i=e(t.currentTarget),l=i.attr("href"),o=i.closest(".fl-lightbox-header-wrap").find(".fl-builder-settings-tabs"),s=o.find('a[href="'+l+'"]'),n=o.find(".fl-builder-settings-tabs-more");FLBuilder._resetSettingsTabsState(),s.trigger("click"),i.addClass("fl-active"),n.addClass("fl-contains-active"),FLBuilder._hideTabsOverflowMenu(),t.preventDefault()},_hasOverflowTabs:function(){var t=e(".fl-lightbox:visible"),i=t.find(".fl-builder-settings-tabs-overflow-menu a");return i.length>0},_showTabsOverflowMenu:function(){if(FLBuilder._hasOverflowTabs()){var t=e(".fl-lightbox:visible");t.find(".fl-builder-settings-tabs-overflow-menu").css("display","flex"),t.find(".fl-builder-settings-tabs-overflow-click-mask").show(),this.isShowingSettingsTabsOverflowMenu=!0}},_hideTabsOverflowMenu:function(){var t=e(".fl-lightbox:visible");t.find(".fl-builder-settings-tabs-overflow-menu").css("display","none"),t.find(".fl-builder-settings-tabs-overflow-click-mask").hide(),this.isShowingSettingsTabsOverflowMenu=!1},_toggleTabsOverflowMenu:function(e){FLBuilder.isShowingSettingsTabsOverflowMenu?FLBuilder._hideTabsOverflowMenu():FLBuilder._showTabsOverflowMenu(),e.stopPropagation()},_settingsCancelClicked:function(t){var i=e(".fl-builder-lightbox[data-parent]"),l=e(".fl-builder-module-settings"),o=null,s=null,n=null,r=null;return i.length>0?void FLBuilder._closeNestedSettings():(l.length>0&&"undefined"!=typeof l.data("new-module")?(o=e(FLBuilder.preview.state.html),s=e(".fl-node-"+l.data("node")),n=s.closest(".fl-col"),r=o.find(".fl-node-"+n.data("node")),r.length>0?FLBuilder._deleteModule(s):FLBuilder._deleteCol(n)):FLBuilder.preview&&FLBuilder.preview.revert(),FLBuilder.preview=null,void FLLightbox.closeParent(this))},_focusFirstSettingsControl:function(){var t=e(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab.fl-active"),l=t.data("node"),o=i.find(".fl-field").first(),s=o.find('input:not([type="hidden"]), textarea, select, button, a, .fl-editor-field').first();if(!l||!e(".fl-node-"+l+" .fl-inline-editor").length){if("undefined"!=typeof tinyMCE&&s.hasClass("fl-editor-field")){var n=s.find("textarea.wp-editor-area").attr("id");tinyMCE.get(n).focus()}else setTimeout(function(){s.focus().css("animation-name","fl-grab-attention")},300);o.css("animation-name","fl-grab-attention"),o.on("animationend",function(){o.css("animation-name","")})}},_initSettingsValidation:function(t,i){var l=e(".fl-builder-settings").last();l.validate({ignore:".fl-ignore-validation",rules:t,messages:i,errorPlacement:FLBuilder._settingsErrorPlacement})},_settingsErrorPlacement:function(e,t){e.appendTo(t.parent())},_toggleSettingsTabErrors:function(){for(var t=e(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab"),l=null,o=null,s=0;s<i.length;s++)l=i.eq(s),o=l.find("label.error"),tabLink=t.find(".fl-builder-settings-tabs a[href*="+l.attr("id")+"]"),tabLink.find(".fl-error-icon").remove(),tabLink.removeClass("error"),o.length>0&&(tabLink.append('<span class="fl-error-icon"></span>'),tabLink.addClass("error"));FLBuilder._calculateSettingsTabsOverflow()},_getSettings:function(t){FLBuilder._updateEditorFields();var i=t.serializeArray(),l=0,o=0,s="",n="",r="",a=[],d=[],u={};for(l=0;l<i.length;l++)if(s=i[l].value.replace(/\r/gm,""),!(i[l].name.indexOf("flrich")>-1))if(i[l].name.indexOf("[")>-1){for(n=i[l].name.replace(/\[(.*)\]/,""),r=i[l].name.replace(n,""),a=[],d=r.match(/\[[^\]]*\]/g),o=0;o<d.length;o++)"[]"!=d[o]&&a.push(d[o].replace(/\[|\]/g,""));r.match(/\[\]\[[^\]]*\]\[[^\]]+\]/)?("undefined"==typeof u[n]&&(u[n]={}),"undefined"==typeof u[n][a[0]]&&(u[n][a[0]]={}),"undefined"==typeof u[n][a[0]][a[1]]&&(u[n][a[0]][a[1]]={}),u[n][a[0]][a[1]]=s):r.match(/\[\]\[[^\]]*\]\[\]/)?("undefined"==typeof u[n]&&(u[n]={}),"undefined"==typeof u[n][a[0]]&&(u[n][a[0]]=[]),u[n][a[0]].push(s)):r.match(/\[\]\[[^\]]*\]/)?("undefined"==typeof u[n]&&(u[n]={}),u[n][a[0]]=s):r.match(/\[\]/)&&("undefined"==typeof u[n]&&(u[n]=[]),u[n].push(s))}else u[i[l].name]=s;for(r in u)if("undefined"!=typeof u["as_values_"+r]){u[r]=e.grep(u["as_values_"+r].split(","),function(e){return""!==e}).join(",");try{delete u["as_values_"+r]}catch(c){}}return e.each(t.find("[name]"),function(t,i){var l=e(i).attr("name").replace(/\[(.*)\]/,"");l in u||(u[l]="")}),u=e.extend({},FLBuilder._getOriginalSettings(t),u)},_getSettingsJSONForHTML:function(e){return JSON.stringify(e).replace(/\'/g,"'").replace("<wbr />","<wbr>")},_getOriginalSettings:function(t,i){var l=t.find(".fl-builder-settings-json"),o=t.data("node"),s=FLBuilderSettingsConfig.nodes,n=null,r={};if(o&&s[o]?n=s[o]:l.length&&(n=JSON.parse(l.val().replace(/'/g,"'"))),n)for(key in n)(e("#fl-field-"+key).length||i)&&(r[key]=n[key]);return r},_getSettingsForChangedCheck:function(t,i){var l=FLBuilder._getSettings(i);if(t){var o=e(".fl-node-"+t);if(o.hasClass("fl-module")){var s=o.data("type"),n=FLBuilderSettingsConfig.editables[s];if(n&&FLBuilderSettingsConfig.nodes[t])for(var r in n)l[r]=FLBuilderSettingsConfig.nodes[t][r]}}return l},_saveSettings:function(t){var i=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=i.data("new-module"),o=i.attr("data-node"),s=FLBuilder._getSettings(i),n=FLBuilder.preview;return!_.isUndefined(t)&&_.isBoolean(t)||(t=!0),n&&!n._settingsHaveChanged()&&_.isUndefined(l)?void FLBuilder._lightbox.close():(FLBuilder._showNodeLoading(o),FLBuilderSettingsConfig.nodes[o]=s,FLBuilder.ajax({action:"save_settings",node_id:o,settings:s},FLBuilder._saveSettingsComplete.bind(this,t,n)),FLBuilder.triggerHook("didSaveNodeSettings",{nodeId:o,settings:s}),void FLBuilder._lightbox.close())},_saveSettingsComplete:function(e,t,i){var l=JSON.parse(i),o=function(){t&&l.layout.partial&&l.layout.nodeId===t.nodeId&&(t.clear(),t=null)};!0===e?FLBuilder._renderLayout(l.layout,o):o(),FLBuilder.triggerHook("didSaveNodeSettingsComplete",{nodeId:l.node_id,settings:l.settings})},_triggerSettingsSave:function(t,i,l){var o=FLBuilder._lightbox._node.find("form.fl-builder-settings"),s=FLBuilder._lightbox._node.data("instance-id"),n=FLLightbox._instances[s],r=e(".fl-lightbox-wrap[data-parent]:visible"),a=!1,d=!0;return t=!_.isUndefined(t)&&t,i=!_.isUndefined(i)&&i,l=!!_.isUndefined(l)||l,o.length&&(r.length&&(r.find(".fl-builder-settings-save").trigger("click"),(r.find("label.error").length||e(".fl-builder-alert-lightbox:visible").length)&&(d=!1)),d&&!o.validate().form()&&(d=!1),a=FLBuilderSettingsForms.settingsHaveChanged(),d&&a&&(t&&n.disableClose(),o.find(".fl-builder-settings-save").trigger("click"),t&&n.enableClose(),(o.find("label.error").length||e(".fl-builder-alert-lightbox:visible").length)&&(d=!1)),l&&(FLBuilder._destroySettingsForms(),!a&&FLBuilder.preview&&(FLBuilder.preview.clear(),FLBuilder.preview=null)),a||t||n.close()),d||(FLBuilder.triggerHook("didFailSettingsSave"),FLBuilder._toggleSettingsTabErrors(),i&&!e(".fl-builder-alert-lightbox:visible").length&&FLBuilder.alert(FLBuilderStrings.settingsHaveErrors)),d},_refreshSettingsPreviewReference:function(){FLBuilder.preview&&FLBuilder.preview._initElementsAndClasses()},_openNestedSettings:function(t){t.className&&-1===t.className.indexOf("fl-builder-settings-lightbox")&&(t.className+=" fl-builder-settings-lightbox"),t=e.extend({className:"fl-builder-lightbox fl-builder-settings-lightbox",destroyOnClose:!0,resizable:!0},t);var i=e(".fl-lightbox-wrap:visible"),l=i.find(".fl-lightbox"),o=new FLLightbox(t),s=o._node,n=s.find(".fl-lightbox");return i.hide(),s.attr("data-parent",i.attr("data-instance-id")),n.attr("style",l.attr("style")),o.on("resized",FLBuilder._calculateSettingsTabsOverflow),o.open('<div class="fl-builder-lightbox-loading"></div>'),o},_closeNestedSettings:function(){var t=e(".fl-builder-lightbox[data-parent]:visible"),i=t.find(".fl-lightbox"),l=t.attr("data-instance-id"),o=FLLightbox._instances[l],s=t.attr("data-parent"),n=e('[data-instance-id="'+s+'"]'),r=n.find(".fl-lightbox"),a=n.find("form"),d=FLLightbox._instances[s];o.on("close",function(){r.attr("style",i.attr("style")),n.show(),d._resize(),n.find("label.error").remove(),a.validate().hideErrors(),FLBuilder._toggleSettingsTabErrors()}),o.close()},_showHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeIn()},_hideHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeOut()},_initAutoSuggestFields:function(){var t=e(".fl-builder-settings:visible .fl-suggest-field"),i=null,l=null,o=null,s=[];t.each(function(){i=e(this),""!==i.attr("data-value")&&(FLBuilderSettingsForms.showFieldLoader(i),s.push({name:i.attr("name"),value:i.attr("data-value"),action:i.attr("data-action"),data:i.attr("data-action-data")}))}),s.length?FLBuilder.ajax({action:"get_autosuggest_values",fields:s},function(i){l=JSON.parse(i);for(o in l)e('.fl-suggest-field[name="'+o+'"]').attr("data-value",l[o]);t.each(FLBuilder._initAutoSuggestField)}):t.each(FLBuilder._initAutoSuggestField)},_initAutoSuggestField:function(){var t=e(this);t.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:t.data("action"),fl_as_action_data:t.data("action-data"),_wpnonce:FLBuilderConfig.ajaxNonce}),e.extend({},{asHtmlID:t.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:3,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,preFill:t.data("value"),queryParam:"fl_as_query",afterSelectionAdd:FLBuilder._updateAutoSuggestField,afterSelectionRemove:FLBuilder._updateAutoSuggestField,selectionLimit:t.data("limit")},t.data("args"))),FLBuilderSettingsForms.hideFieldLoader(t)},_updateAutoSuggestField:function(t,i,l){e(this).siblings(".as-values").val(l.join(",")).trigger("change")},_initCodeFields:function(){e(".fl-builder-settings:visible").find(".fl-code-field").each(FLBuilder._initCodeField)},_initCodeField:function(){var t=e(this),i=t.closest(".fl-builder-settings"),l=t.find("textarea"),o=(l.attr("id"),l.data("editor")),s=l.data("wrap"),n=e("<div>",{position:"absolute",height:20*parseInt(l.attr("rows"),10)}),r=null;n.insertBefore(l),l.css("display","none"),ace.require("ace/ext/language_tools"),r=ace.edit(n[0]),r.$blockScrolling=1/0,r.getSession().setValue(l.val()),r.getSession().setMode("ace/mode/"+o),s&&r.getSession().setUseWrapMode(!0),r.setOptions({enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!1,showLineNumbers:!1,showFoldWidgets:!1}),r.getSession().on("change",function(e){l.val(r.getSession().getValue()).trigger("change")}),r.getSession().on("changeAnnotation",function(){for(var e=r.getSession().getAnnotations(),t=i.find(".fl-builder-settings-save"),l=i.find(".fl-builder-settings-error"),o=!1,s=0;s<e.length;s++)if(!(e[s].text.indexOf("DOCTYPE")>-1||e[s].text.indexOf("Named entity expected")>-1||e[s].text.indexOf("@supports")>-1||"error"!==e[s].type)){o=!0;break}o&&!l.length&&FLBuilderConfig.CheckCodeErrors?(t.addClass("fl-builder-settings-error"),t.on("click",FLBuilder._showCodeFieldError)):!o&&l.length&&(l.removeClass("fl-builder-settings-error"),l.off("click",FLBuilder._showCodeFieldError))}),l.closest(".fl-field").data("editor",r)},_showCodeFieldError:function(t){t.stopImmediatePropagation(),FLBuilder.confirm({message:FLBuilderStrings.codeError,cancel:function(){var t=e(".fl-builder-settings:visible .fl-builder-settings-save");t.removeClass("fl-builder-settings-error"),t.off("click",FLBuilder._showCodeFieldError),t.trigger("click")},strings:{ok:FLBuilderStrings.codeErrorFix,cancel:FLBuilderStrings.codeErrorIgnore}})},_initMultipleFields:function(){for(var t=e(".fl-builder-settings:visible .fl-builder-field-multiples"),i=null,l=null,o=0,s=FLBuilderConfig.isRtl?{left:10}:{right:10};o<t.length;o++)i=t.eq(o),l=i.find(".fl-builder-field-multiple"),1===l.length?l.eq(0).find(".fl-builder-field-actions").addClass("fl-builder-field-actions-single"):l.find(".fl-builder-field-actions").removeClass("fl-builder-field-actions-single");e(".fl-builder-field-multiples").sortable({items:".fl-builder-field-multiple",cursor:"move",cursorAt:s,distance:5,opacity:.5,placeholder:"fl-builder-field-dd-zone",stop:FLBuilder._fieldDragStop,tolerance:"pointer",axis:"y"})},_addFieldClicked:function(){var t=e(this),i=t.attr("data-field"),l=t.closest("tr").siblings("tr[data-field="+i+"]").last(),o=l.clone(),s=o.find(".fl-form-field"),n=null,r=parseInt(l.find("label span.fl-builder-field-index").html(),10)+1;o.find("th label span.fl-builder-field-index").html(r),o.find(".fl-form-field-preview-text").html(""),o.find("input, textarea, select").val(""),l.after(o),FLBuilder._initMultipleFields(),s.length&&(n=s.find(".fl-form-field-edit").data("type"),s.find("input").val(JSON.stringify(FLBuilderSettingsConfig.defaults.forms[n])))},_copyFieldClicked:function(){
|
5 |
+
var t=e(this),i=t.closest("tr"),l=i.clone(),o=parseInt(i.find("label span.fl-builder-field-index").html(),10)+1;l.find("th label span.fl-builder-field-index").html(o),i.after(l),FLBuilder._renumberFields(i.parent()),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview()},_deleteFieldClicked:function(){var t=e(this).closest("tr"),i=t.parent(),l=confirm(FLBuilderStrings.deleteFieldMessage);l&&(t.remove(),FLBuilder._renumberFields(i),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview())},_renumberFields:function(e){for(var t=e.find(".fl-builder-field-multiple"),i=0;i<t.length;i++)t.eq(i).find("th label span.fl-builder-field-index").html(i+1)},_fieldDragHelper:function(){return e('<div class="fl-builder-field-dd-helper"></div>')},_fieldDragStop:function(e,t){FLBuilder._renumberFields(t.item.parent()),FLBuilder.preview.delayPreview()},_initSelectFields:function(){e(".fl-builder-settings:visible").find(".fl-builder-settings-fields select").trigger("change")},_settingsSelectChanged:function(){var t=e(this),i=t.attr("data-toggle"),l=t.attr("data-hide"),o=t.attr("data-trigger"),s=t.val(),n=0;if("undefined"!=typeof i){i=JSON.parse(i);for(n in i)FLBuilder._settingsSelectToggle(i[n].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(i[n].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[n].tabs,"hide","a[href*=fl-builder-settings-tab-","]");"undefined"!=typeof i[s]&&(FLBuilder._settingsSelectToggle(i[s].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(i[s].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[s].tabs,"show","a[href*=fl-builder-settings-tab-","]"))}if("undefined"!=typeof l&&(l=JSON.parse(l),"undefined"!=typeof l[s]&&(FLBuilder._settingsSelectToggle(l[s].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(l[s].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(l[s].tabs,"hide","a[href*=fl-builder-settings-tab-","]"))),"undefined"!=typeof o&&(o=JSON.parse(o),"undefined"!=typeof o[s]&&"undefined"!=typeof o[s].fields))for(n=0;n<o[s].fields.length;n++)e("#fl-field-"+o[s].fields[n]).find("select").trigger("change");FLBuilder._calculateSettingsTabsOverflow()},_settingsSelectToggle:function(t,i,l,o){var s=0;if(o="undefined"==typeof o?"":o,"undefined"!=typeof t)for(;s<t.length;s++)e(".fl-builder-settings:visible").find(l+t[s]+o)[i](),e(l+t[s]+o).parent().find('.fl-field[data-type="code"]').each(function(){e(this).data("editor").resize()})},_initColorPickers:function(){var t=FLBuilderConfig.colorPresets?FLBuilderConfig.colorPresets:[];FLBuilder.colorPicker=new FLBuilderColorPicker({mode:"hsv",elements:".fl-color-picker .fl-color-picker-value",presets:t,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}}),e(FLBuilder.colorPicker).on("presetRemoved presetAdded",function(e,t){FLBuilder.ajax({action:"save_color_presets",presets:t.presets})})},_initSinglePhotoSelector:function(){null===FLBuilder._singlePhotoSelector&&(FLBuilder._singlePhotoSelector=wp.media({title:FLBuilderStrings.selectPhoto,button:{text:FLBuilderStrings.selectPhoto},library:{type:"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",e.proxy(FLBuilder._singlePhotoOpened,this)),FLBuilder._singlePhotoSelector.once("select",e.proxy(FLBuilder._singlePhotoSelected,this)),FLBuilder._singlePhotoSelector.open()},_singlePhotoOpened:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection"),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=l.val(),s=null;e(this).hasClass("fl-photo-replace")?(t.reset(),i.addClass("fl-photo-empty"),l.val("")):""!==o?(s=wp.media.attachment(o),s.fetch(),t.add(s?[s]:[])):t.reset()},_singlePhotoSelected:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection").first().toJSON(),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=i.find(".fl-photo-preview img"),s=i.find("select");l.val(t.id),o.attr("src",FLBuilder._getPhotoSrc(t)),i.removeClass("fl-photo-empty").removeClass("fl-photo-no-attachment"),i.find("label.error").remove(),s.show(),s.html(FLBuilder._getPhotoSizeOptions(t)),s.trigger("change"),FLBuilderSettingsConfig.attachments[t.id]=t},_singlePhotoRemoved:function(){FLBuilder._initSinglePhotoSelector();var t=FLBuilder._singlePhotoSelector.state(),i="undefined"!=typeof t?t.get("selection"):null,l=e(this).closest(".fl-photo-field"),o=l.find("input[type=hidden]"),s=l.find("select");i&&i.reset(),l.addClass("fl-photo-empty"),o.val(""),s.html('<option value="" selected></option>'),s.trigger("change")},_getPhotoSrc:function(e){return"undefined"==typeof e.sizes?e.url:"undefined"!=typeof e.sizes.thumbnail?e.sizes.thumbnail.url:e.sizes.full.url},_getPhotoSizeOptions:function(e,t){var i="",l=null,o=null,s="",n={full:FLBuilderStrings.fullSize,large:FLBuilderStrings.large,medium:FLBuilderStrings.medium,thumbnail:FLBuilderStrings.thumbnail};if("undefined"==typeof e.sizes||0===e.sizes.length)i+='<option value="'+e.url+'">'+FLBuilderStrings.fullSize+"</option>";else{t&&(t=t.replace(/https?/,""));for(l in e.sizes)s="undefined"!=typeof n[l]?n[l]+" - ":"undefined"!=typeof FLBuilderConfig.customImageSizeTitles[l]?FLBuilderConfig.customImageSizeTitles[l]+" - ":"",o="",t?t===e.sizes[l].url.replace(/https?/,"")&&(o=' selected="selected"'):o="full"==l?' selected="selected"':"",i+='<option value="'+e.sizes[l].url+'"'+o+">"+s+e.sizes[l].width+" x "+e.sizes[l].height+"</option>"}return i},_selectMultiplePhotos:function(){var t=e(this).closest(".fl-multiple-photos-field"),i=t.find("input[type=hidden]"),l=i.val(),o=""===l?"":JSON.parse(l),s=wp.media.gallery.defaults.id,n='[gallery ids="-1"]',r=null,a=null,d=null,u=null,c=[];if("object"==typeof o){for(u in o)c.push(o[u]);n='[gallery ids="'+c.join()+'"]'}r=wp.shortcode.next("gallery",n).shortcode,_.isUndefined(r.get("id"))&&!_.isUndefined(s)&&r.set("id",s),a=wp.media.gallery.attachments(r),d=new wp.media.model.Selection(a.models,{props:a.props.toJSON(),multiple:!0}),d.gallery=a.gallery,d.more().done(function(){d.length||FLBuilder._multiplePhotoSelector.setState("gallery-library"),d.props.set({query:!1}),d.unmirror(),d.props.unset("orderby")}),FLBuilder._multiplePhotoSelector&&FLBuilder._multiplePhotoSelector.dispose(),FLBuilder._multiplePhotoSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-photos-edit")?"gallery-edit":"gallery-library",title:wp.media.view.l10n.editGalleryTitle,editing:!0,multiple:!0,selection:d}).open(),e(FLBuilder._multiplePhotoSelector.views.view.el).addClass("fl-multiple-photos-lightbox"),FLBuilder._multiplePhotoSelector.once("update",e.proxy(FLBuilder._multiplePhotosSelected,this))},_multiplePhotosSelected:function(t){for(var i=e(this).closest(".fl-multiple-photos-field"),l=i.find("input[type=hidden]"),o=i.find(".fl-multiple-photos-count"),s=[],n=0;n<t.models.length;n++)s.push(t.models[n].id);1==s.length?o.html("1 "+FLBuilderStrings.photoSelected):o.html(s.length+" "+FLBuilderStrings.photosSelected),i.removeClass("fl-multiple-photos-empty"),i.find("label.error").remove(),l.val(JSON.stringify(s)).trigger("change")},_initSingleVideoSelector:function(){null===FLBuilder._singleVideoSelector&&(FLBuilder._singleVideoSelector=wp.media({title:FLBuilderStrings.selectVideo,button:{text:FLBuilderStrings.selectVideo},library:{type:"video"},multiple:!1}),FLBuilder._singleVideoSelector.on("open",FLBuilder._wpmedia_reset_errors),_wpPluploadSettings.defaults.multipart_params.fl_upload_type="video")},_selectSingleVideo:function(){FLBuilder._initSingleVideoSelector(),FLBuilder._singleVideoSelector.once("select",e.proxy(FLBuilder._singleVideoSelected,this)),FLBuilder._singleVideoSelector.open()},_singleVideoSelected:function(){var t=FLBuilder._singleVideoSelector.state().get("selection").first().toJSON(),i=e(this).closest(".fl-video-field"),l=i.find(".fl-video-preview-img"),o=i.find(".fl-video-preview-filename"),s=i.find("input[type=hidden]");l.html('<span class="dashicons dashicons-media-video"></span>'),o.html(t.filename),i.removeClass("fl-video-empty"),i.find("label.error").remove(),s.val(t.id).trigger("change"),FLBuilderSettingsConfig.attachments[t.id]=t},_singleVideoRemoved:function(){FLBuilder._initSingleVideoSelector();var t=FLBuilder._singleVideoSelector.state(),i="undefined"!=typeof t?t.get("selection"):null,l=e(this).closest(".fl-video-field"),o=l.find(".fl-video-preview-img img"),s=l.find(".fl-video-preview-filename"),n=l.find("input[type=hidden]");i&&i.reset(),o.attr("src",""),s.html(""),l.addClass("fl-video-empty"),n.val("").trigger("change")},_selectMultipleAudios:function(){var t=e(this).closest(".fl-multiple-audios-field"),i=t.find("input[type=hidden]"),l=i.val(),o=""==l?'[playlist ids="-1"]':'[playlist ids="'+JSON.parse(l).join()+'"]',s=wp.shortcode.next("playlist",o).shortcode,n=wp.media.playlist.defaults.id,r=null,a=null;_.isUndefined(s.get("id"))&&!_.isUndefined(n)&&s.set("id",n),r=wp.media.playlist.attachments(s),a=new wp.media.model.Selection(r.models,{props:r.props.toJSON(),multiple:!0}),a.playlist=r.playlist,a.more().done(function(){a.props.set({query:!1}),a.unmirror(),a.props.unset("orderby")}),FLBuilder._multipleAudiosSelector&&FLBuilder._multipleAudiosSelector.dispose(),FLBuilder._multipleAudiosSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-audios-edit")?"playlist-edit":"playlist-library",title:wp.media.view.l10n.editPlaylistTitle,editing:!0,multiple:!0,selection:a}).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",e.proxy(FLBuilder._multipleAudiosSelected,this))},_multipleAudiosSelected:function(t){for(var i=e(this).closest(".fl-multiple-audios-field"),l=i.find(".fl-multiple-audios-count"),o=i.find("input[type=hidden]"),s=[],n=0;n<t.models.length;n++)s.push(t.models[n].id);1==s.length?l.html("1 "+FLBuilderStrings.audioSelected):l.html(s.length+" "+FLBuilderStrings.audiosSelected),o.val(JSON.stringify(s)).trigger("change"),i.removeClass("fl-multiple-audios-empty"),i.find("label.error").remove()},_selectIcon:function(){var e=this;FLIconSelector.open(function(t){FLBuilder._iconSelected.apply(e,[t])})},_iconSelected:function(t){var i=e(this).closest(".fl-icon-field"),l=i.find("input[type=hidden]"),o=i.find("i"),s=o.attr("data-icon");l.val(t).trigger("change"),o.removeClass(s),o.addClass(t),o.attr("data-icon",t),i.removeClass("fl-icon-empty"),i.find("label.error").remove()},_removeIcon:function(){var t=e(this).closest(".fl-icon-field"),i=t.find("input[type=hidden]"),l=t.find("i");i.val("").trigger("change"),l.removeClass(),l.attr("data-icon",""),t.addClass("fl-icon-empty")},_formFieldClicked:function(){var t=e(this),i=t.closest(".fl-builder-settings"),l=t.attr("data-type"),o=t.siblings("input").val(),s=FLBuilder._moduleHelpers[l],n=(FLBuilderSettingsConfig.forms[l],FLBuilder._openNestedSettings({className:"fl-builder-lightbox fl-form-field-settings"}));""===o&&(o=JSON.stringify(FLBuilderSettingsConfig.forms[l])),FLBuilderSettingsForms.render({id:l,nodeId:i.attr("data-node"),nodeSettings:FLBuilder._getSettings(i),settings:JSON.parse(o.replace(/'/g,"'")),lightbox:n,helper:s,rules:s?s.rules:null},function(){t.attr("id","fl-"+n._node.attr("data-instance-id")),n._node.find("form.fl-builder-settings").attr("data-type",l)})},_saveFormFieldClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=e(this).closest(".fl-lightbox-wrap").attr("data-instance-id"),l=t.attr("data-type"),o=FLBuilder._getSettings(t),s={},n=FLBuilder._moduleHelpers[l],r=e(".fl-builder-settings #fl-"+i),a=r.parent().attr("data-preview-text"),d=t.find("#fl-field-"+a),u=o[a],c=e('select[name="'+a+'"]'),h=document.createElement("div"),f=!0;return c.length>0&&(u=c.find('option[value="'+o[a]+'"]').text()),"undefined"!=typeof n&&(t.find("label.error").remove(),t.validate().hideErrors(),f=t.validate().form(),f&&(f=n.submit())),f?("undefined"!=typeof a&&"undefined"!=typeof u&&("icon"===d.data("type")?u='<i class="'+u+'"></i>':u.length>35&&(h.innerHTML=u,u=(h.textContent||h.innerText||"").replace(/^(.{35}[^\s]*).*/,"$1")+"..."),r.siblings(".fl-form-field-preview-text").html(u)),s=r.siblings("input").val().replace(/'/g,"'"),""!=s&&(o=e.extend(JSON.parse(s),o)),r.siblings("input").val(JSON.stringify(o)).trigger("change"),FLBuilder._closeNestedSettings(),!0):(FLBuilder._toggleSettingsTabErrors(),!1)},_layoutFieldClicked:function(){var t=e(this);t.siblings().removeClass("fl-layout-field-option-selected"),t.addClass("fl-layout-field-option-selected"),t.siblings("input").val(t.attr("data-value"))},_initLinkFields:function(){e(".fl-builder-settings:visible .fl-link-field").each(FLBuilder._initLinkField)},_initLinkField:function(){var t=e(this),i=t.find(".fl-link-field-search-input");i.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:"fl_as_links",_wpnonce:FLBuilderConfig.ajaxNonce}),{asHtmlID:i.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})},_updateLinkField:function(e,t,i){var l=e.closest(".fl-link-field"),o=l.find(".fl-link-field-search"),s=l.find(".fl-link-field-search-input"),n=l.find(".fl-link-field-input");n.val(t.value).trigger("keyup"),s.autoSuggest("remove",t.value),o.hide()},_linkFieldSelectClicked:function(){var t=e(this).closest(".fl-link-field").find(".fl-link-field-search");t.show(),t.find("input").focus()},_linkFieldSelectCancelClicked:function(){var t=e(this);t.parent().hide(),t.closest(".fl-link-field").find("input.fl-link-field-input").focus()},_initFontFields:function(){e(".fl-builder-settings:visible .fl-font-field").each(FLBuilder._initFontField)},_initFontField:function(){var t=e(this),i=t.attr("data-value"),l=t.find(".fl-font-field-font"),o=t.find(".fl-font-field-weight");l.on("change",function(){FLBuilder._getFontWeights(l)}),i.indexOf("family")>-1&&(i=JSON.parse(i),l.val(i.family),l.trigger("change"),o.find("option[value="+i.weight+"]").length&&o.val(i.weight))},_getFontWeights:function(t){var i=t.next(".fl-font-field-weight"),l=t.val(),o={"default":"Default",regular:"Regular",100:"Thin 100",200:"Extra-Light 200",300:"Light 300",400:"Normal 400",500:"Medium 500",600:"Semi-Bold 600",700:"Bold 700",800:"Extra-Bold 800",900:"Ultra-Bold 900"},s={};i.html(""),s="undefined"!=typeof FLBuilderFontFamilies.system[l]?FLBuilderFontFamilies.system[l].weights:"undefined"!=typeof FLBuilderFontFamilies.google[l]?FLBuilderFontFamilies.google[l]:FLBuilderFontFamilies["default"][l],e.each(s,function(e,t){i.append('<option value="'+t+'">'+o[t]+"</option>")})},_initTinyMCE:function(){tinymce.ui.FloatPanel&&(tinymce.ui.FloatPanel.zIndex=100100),e(".fl-builder-hidden-editor").each(FLBuilder._initEditorField)},_initEditorFields:function(){e(".fl-builder-settings:visible .fl-editor-field").each(FLBuilder._initEditorField)},_initEditorField:function(){var t=e(this),i=t.find("textarea"),l=t.attr("data-name"),o="flrich"+(new Date).getTime()+"_"+l,s=FLBuilderConfig.wp_editor,n=tinyMCEPreInit,r=Number(t.attr("data-buttons")),a=t.attr("data-rows"),d=null,u=null;s=s.replace(/flbuildereditor/g,o),n=JSON.parse(JSON.stringify(n).replace(/flbuildereditor/g,o)),i.after(s).remove(),e("textarea#"+o).val(i.val()),void 0!==typeof tinymce&&void 0!==n.mceInit[o]&&(d=n.mceInit[o],u=tinymce.$("#wp-"+o+"-wrap"),u.find("textarea").attr("rows",a),r||u.find(".wp-media-buttons").remove(),!u.hasClass("tmce-active")&&n.qtInit.hasOwnProperty(o)||d.wp_skip_init||tinymce.init(d)),void 0!==typeof quicktags&&quicktags(n.qtInit[o]),window.wpActiveEditor=o},_reinitEditorFields:function(){e(".fl-lightbox-resizable:visible").length&&setTimeout(function(){var t,i;if("undefined"!=typeof tinymce){for(t=tinymce.editors.length-1;t>-1;t--)tinymce.editors[t].inline||(i=tinymce.editors[t].id,tinyMCE.execCommand("mceRemoveEditor",!0,i),tinyMCE.execCommand("mceAddEditor",!0,i));FLBuilder.preview&&FLBuilder.preview._initDefaultFieldPreviews(e('.fl-field[data-type="editor"]'))}},1)},_destroyEditorFields:function(){var t;if("undefined"!=typeof tinymce){for(t=tinymce.editors.length-1;t>-1;t--)tinymce.editors[t].inline||tinyMCE.execCommand("mceRemoveEditor",!0,tinymce.editors[t].id);e(".wplink-autocomplete").remove(),e(".ui-helper-hidden-accessible").remove()}},_updateEditorFields:function(){var t=e(".fl-builder-settings:visible textarea.wp-editor-area");t.each(FLBuilder._updateEditorField)},_updateEditorField:function(){var t=e(this),i=t.closest(".fl-editor-field"),l=(t.closest(".fl-builder-settings"),t.closest(".wp-editor-wrap")),o=t.attr("id"),s=i.attr("data-name"),n="undefined"!=typeof tinymce&&tinymce.get(o),r=t.siblings('textarea[name="'+s+'"]'),a=i.data("wpautop");0===r.length&&(r=e('<textarea name="'+s+'"></textarea>').hide(),t.after(r)),a?n&&l.hasClass("tmce-active")?r.val(n.getContent()):"undefined"!=typeof switchEditors?r.val(switchEditors.wpautop(t.val())):r.val(t.val()):(n&&l.hasClass("tmce-active")&&n.save(),r.val(t.val()))},_loopDataSourceChange:function(){var t=e(this).val();e(".fl-loop-data-source").hide(),e('.fl-loop-data-source[data-source="'+t+'"]').show()},_customQueryPostTypeChange:function(){var t=e(this).val();e(".fl-custom-query-filter").hide(),e(".fl-custom-query-"+t+"-filter").show()},_initOrderingFields:function(){e(".fl-builder-settings:visible .fl-ordering-field-options").each(FLBuilder._initOrderingField)},_initOrderingField:function(){e(this).sortable({items:".fl-ordering-field-option",containment:"parent",tolerance:"pointer",stop:FLBuilder._updateOrderingField})},_updateOrderingField:function(t){var i=e(t.target),l=i.siblings("input[type=hidden]"),o=[];i.find(".fl-ordering-field-option").each(function(){o.push(e(this).attr("data-key"))}),l.val(JSON.stringify(o)).trigger("change")},_onNumberFieldFocus:function(t){var i=e(t.currentTarget);i.addClass("mousetrap"),Mousetrap.bind("up",function(){i.attr("step",1)}),Mousetrap.bind("down",function(){i.attr("step",1)}),Mousetrap.bind("shift+up",function(){i.attr("step",10)}),Mousetrap.bind("shift+down",function(){i.attr("step",10)})},_onNumberFieldBlur:function(t){var i=e(t.currentTarget);i.attr("step",1).removeClass("mousetrap")},_initTimezoneFields:function(){e(".fl-builder-settings:visible .fl-field[data-type=timezone]").each(FLBuilder._initTimezoneField)},_initTimezoneField:function(){var t=e(this).find("select"),i=t.attr("data-value");t.find('option[value="'+i+'"]').attr("selected","selected")},ajax:function(t,i){var l;FLBuilder.triggerHook("didBeginAJAX",t);for(l in t)"undefined"==typeof t[l]&&(t[l]=null);return t._wpnonce=FLBuilderConfig.ajaxNonce,t.post_id=FLBuilderConfig.postId,t.fl_builder=1,t.fl_action=t.action,"undefined"!=typeof t.settings&&(t.settings=FLBuilder._ajaxModSecFix(e.extend(!0,{},t.settings))),"undefined"!=typeof t.node_settings&&(t.node_settings=FLBuilder._ajaxModSecFix(e.extend(!0,{},t.node_settings))),t={fl_builder_data:t},e.post(FLBuilder._ajaxUrl(),t,function(e){FLBuilder._ajaxComplete(),"undefined"!=typeof i&&i.call(this,e),FLBuilder.triggerHook("didCompleteAJAX",t)})},_ajaxComplete:function(){FLBuilder.hideAjaxLoader()},_ajaxUrl:function(e){var t=window.location.href.split("#").shift(),i=null;if("undefined"!=typeof e)for(i in e)t+=t.indexOf("?")>-1?"&":"?",t+=i+"="+e[i];return t},showAjaxLoader:function(){0===e(".fl-builder-lightbox-loading").length&&e(".fl-builder-loading").show()},hideAjaxLoader:function(){e(".fl-builder-loading").hide()},_showNodeLoading:function(t){var i=e(".fl-node-"+t);i.addClass("fl-builder-node-loading"),FLBuilder.triggerHook("didStartNodeLoading",i)},_hideNodeLoading:function(t){var i=e(".fl-node-"+t);i.removeClass("fl-builder-node-loading")},_showNodeLoadingPlaceholder:function(t,i){var l=e('<div class="fl-builder-node-loading-placeholder"></div>');t.hasClass("fl-builder-content")?siblings=t.find(" > .fl-row"):t.hasClass("fl-row-content")?siblings=t.find(" > .fl-col-group"):t.hasClass("fl-col-group")?(t.addClass("fl-col-group-has-child-loading"),siblings=t.find(" > .fl-col")):siblings=t.find(" > .fl-col-group, > .fl-module"),0===siblings.length||siblings.length==i?t.append(l):siblings.eq(i).before(l)},_removeNodeLoadingPlaceholder:function(e){var t=e.prev(".fl-builder-node-loading-placeholder"),i=e.next(".fl-builder-node-loading-placeholder");t.length?t.remove():i.remove()},_ajaxModSecFix:function(e){var t;if(FLBuilderConfig.modSecFix&&"undefined"!=typeof btoa)if("string"==typeof e)e=FLBuilder._btoa(e);else for(t in e)"string"==typeof e[t]?e[t]=FLBuilder._btoa(e[t]):"object"==typeof e[t]&&(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(){e(".upload-error").remove(),e(".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(){FLBuilder._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),FLBuilder._initLightboxScrollbars()},_setLightboxContent:function(e){FLBuilder._lightbox.setContent(e)},_initLightboxScrollbars:function(){FLBuilder._initScrollbars(),FLBuilder._lightboxScrollbarTimeout=setTimeout(FLBuilder._initLightboxScrollbars,500)},_lightboxClosed:function(){FLBuilder.triggerHook("settings-lightbox-closed"),FLBuilder._lightbox.empty(),clearTimeout(FLBuilder._lightboxScrollbarTimeout)},_showActionsLightbox:function(e){var t=wp.template("fl-actions-lightbox");FLBuilder.triggerHook("actions-lightbox-settings",e),FLBuilder._actionsLightbox.open(t(e))},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}))},_alertClose:function(){FLLightbox.closeParent(this)},confirm:function(t){var i={message:"",ok:function(){},cancel:function(){},strings:{ok:FLBuilderStrings.ok,cancel:FLBuilderStrings.cancel}},l=e.extend({},i,"undefined"==typeof t?{}:t);lightbox=new FLLightbox({className:"fl-builder-confirm-lightbox fl-builder-alert-lightbox",destroyOnClose:!0}),template=wp.template("fl-confirm-lightbox"),lightbox.open(template(l)),lightbox._node.find(".fl-builder-confirm-ok").on("click",l.ok),lightbox._node.find(".fl-builder-confirm-cancel").on("click",l.cancel)},triggerHook:function(t,i){e("body").trigger("fl-builder."+t,i)},addHook:function(t,i){e("body").on("fl-builder."+t,i)},removeHook:function(t,i){e("body").off("fl-builder."+t,i)},log:function(e){"undefined"!=typeof window.console&&"undefined"!=typeof window.console.log&&console.log(e)},logError:function(e){var t=null;"undefined"!=typeof e&&("undefined"!=typeof e.stack?t=e.stack:"undefined"!=typeof e.message&&(t=e.message),t&&(FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(t),FLBuilder.log("************************************************************************")))},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)),"undefined"!=typeof o&&"undefined"!=typeof o.stack&&(FLBuilder.log(o.stack),FLBuilder.log("************************************************************************"))}},e(function(){FLBuilder._init()})}(jQuery),function(e){FLBuilderAJAXLayout=function(t,i){this._data=e.extend({},this._defaults,"string"==typeof t?JSON.parse(t):t),this._callback=i,this._post=FLBuilderConfig.postId,this._head=e("head").eq(0),this._body=e("body").eq(0),this._data.css&&(this._loader=e('<img src="'+this._data.css+'" />'),this._oldCss=e('link[href*="/cache/'+this._post+'"]'),this._newCss=e('<link rel="stylesheet" id="fl-builder-layout-'+this._post+'-css" href="'+this._data.css+'" />')),this._data.partial?(this._data.js&&(this._oldJs=e("#fl-builder-partial-refresh-js"),this._newJs=e('<script type="text/javascript" id="fl-builder-partial-refresh-js">'+this._data.js+"</script>")),this._data.nodeId&&(this._data.oldNodeId?(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.oldNodeId+'"]'),this._content=e(".fl-node-"+this._data.oldNodeId)):(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.nodeId+'"]'),this._content=e(".fl-node-"+this._data.nodeId).eq(0)))):(this._oldJs=e('script[src*="/cache/'+this._post+'"]'),this._newJs=e('<script src="'+this._data.js+'"></script>'),this._oldScriptsStyles=e(".fl-builder-layout-scripts-styles"),this._content=e(FLBuilder._contentClass)),this._init()},FLBuilderAJAXLayout.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._loader?(this._loader.on("error",e.proxy(this._loadNewCSSComplete,this)),this._body.append(this._loader)):this._finish()},_loadNewCSSComplete:function(){this._loader.remove(),this._oldCss.length>0?this._oldCss.after(this._newCss):this._head.append(this._newCss),setTimeout(e.proxy(this._finish,this),250)},_finish:function(){this._removeOldContentAndAssets(),this._cleanNewHTML(),this._cleanNewAssets(),this._addNewHTML(),this._addNewScriptsStyles(),this._addNewJS(),e(FLBuilder._contentClass).trigger("fl-builder.layout-rendered"),FLBuilder.hideAjaxLoader(),"undefined"!=typeof this._callback&&this._callback(),FLBuilder.triggerHook("didRenderLayoutComplete")},_removeOldContentAndAssets:function(){this._content&&this._content.empty(),this._oldCss&&this._oldCss.remove(),this._oldJs&&this._oldJs.remove(),this._oldScriptsStyles&&this._oldScriptsStyles.remove()},_cleanNewHTML:function(){if(this._data.scriptsStyles){var t=e("<div>"+this._data.html+"</div>"),i="fl-row",l=this._data.scriptsStyles,o="";this._data.partial&&(i="column-group"==this._data.nodeType?"fl-col-group":"column"==this._data.nodeType?"fl-col":"fl-"+this._data.nodeType),t.find("> *, script").each(function(){e(this).hasClass(i)||(o=e(this).remove(),l+=o[0].outerHTML)}),""!==l&&(l=this._data.partial?'<div class="fl-builder-node-scripts-styles" data-node="'+this._data.nodeId+'">'+l+"<div>":'<div class="fl-builder-node-scripts-styles">'+l+"<div>"),this._data.html=t.html(),this._data.scriptsStyles=l}},_addNewHTML:function(){var t;if(this._data.partial?this._data.nodeParent?(t=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"),t=t.filter(":not(.fl-builder-node-clone)"),0===t.length||t.length==this._data.nodePosition?this._data.nodeParent.append(this._data.html):t.eq(this._data.nodePosition).before(this._data.html),this._data.nodeId&&FLBuilder._removeNodeLoadingPlaceholder(e(".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){var i=e(FLBuilder.preview.classes.node),l=i.closest(".fl-node-"+this._data.nodeId).length;l&&i.html(FLBuilder.preview.elements.node.html())}},_cleanNewAssets:function(){var t=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?e(".fl-builder-node-scripts-styles").each(function(){t._data.html.indexOf("fl-node-"+e(this).data("node"))>-1&&e(this).remove()}):(e("#fl-builder-partial-refresh-js").remove(),e(".fl-builder-node-scripts-styles").remove())},_removeDuplicateAssets:function(t){var i=e("<div>"+t+"</div>"),l="",o=null,s="",n=null,r=window.location,a=r.protocol+"//"+r.hostname+(r.port?":"+r.port:"");return i.find("script").each(function(){l=e(this).attr("src"),"undefined"!=typeof l&&(l=l.replace(a,""),o=e('script[src*="'+l+'"]'),o.length>0&&e(this).remove())}),i.find("link").each(function(){s=e(this).attr("href"),"undefined"!=typeof s&&(s=s.replace(a,""),n=e('link[href*="'+s+'"]'),n.length>0&&e(this).remove())}),i.html()},_addNewScriptsStyles:function(){this._data.scriptsStyles&&""!==this._data.scriptsStyles&&this._body.append(this._data.scriptsStyles)},_addNewJS:function(){setTimeout(e.proxy(function(){this._newJs&&this._head.append(this._newJs)},this),50)},_complete:function(){FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._resizeLayout(),FLBuilder._initMediaElements(),FLBuilderLayout.init(),FLBuilderResponsiveEditing.refreshPreview(),this._body.height("auto")}}}(jQuery),function(e){FLBuilderPreview=function(e){this.type=e.type,this._saveState(),e.layout?FLBuilder._renderLayout(e.layout,function(){this._init(),e.callback&&e.callback()}.bind(this)):this._init()},FLBuilderPreview._fontsList={},FLBuilderPreview.getFormattedSelector=function(e,t){for(var i="",l=t.split(","),o=0;o<l.length;o++)l[o].indexOf("{node}")>-1?i=l[o].replace("{node}",e):i+=e+" "+l[o],o!=l.length-1&&(i+=", ");return i},FLBuilderPreview.prototype={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=e(".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()}},_saveSettings:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings");this._savedSettings=FLBuilder._getSettingsForChangedCheck(this.nodeId,t)},_settingsHaveChanged:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),i=FLBuilder._getSettings(t);return JSON.stringify(this._savedSettings)!=JSON.stringify(i)},_initElementsAndClasses:function(){var t;t="row"==this.type?".fl-row-content-wrap":".fl-"+this.type+"-content",e.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+" > "+t}),e.extend(this.elements,{settings:e(this.classes.settings),
|
6 |
+
settingsHeader:e(this.classes.settingsHeader),node:e(this.classes.node),content:e(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._styleSheetResponsive||(this._styleSheetResponsive=new FLStyleSheet({id:"fl-builder-preview-responsive",className:"fl-builder-preview-style"}))},_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)},updateCSSRule:function(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){var t=parseInt(e,16),i=t>>16&255,l=t>>8&255,o=255&t;return[i,l,o]},parseFloat:function(e){return isNaN(parseFloat(e))?0:parseFloat(e)},_initResponsivePreviews:function(){FLBuilder.addHook("responsive-editing-switched.preview",e.proxy(this._responsiveEditingSwitched,this))},_destroyResponsivePreviews:function(){FLBuilder.removeHook("responsive-editing-switched.preview")},_responsiveEditingSwitched:function(e,t){"default"==t?(this._styleSheetMedium.disable(),this._styleSheetResponsive.disable()):"medium"==t?(this._styleSheetMedium.enable(),this._styleSheetResponsive.disable()):"responsive"==t&&(this._styleSheetMedium.disable(),this._styleSheetResponsive.enable())},updateResponsiveCSSRule:function(e,t,i){var l=FLBuilderResponsiveEditing._mode,o="default"==l?"":l.charAt(0).toUpperCase()+l.slice(1);this["_styleSheet"+o].updateRule(e,t,i)},_saveState:function(){var t=FLBuilderConfig.postId,i=e('link[href*="/cache/'+t+'"]').attr("href"),l=e('script[src*="/cache/'+t+'"]').attr("src"),o=e(FLBuilder._contentClass).html();this.state={css:i,js:l,html:o}},preview:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),i=t.attr("data-node"),l=FLBuilder._getSettings(t);FLBuilder._showNodeLoading(i),this._cancelPreview(),this._xhr=FLBuilder.ajax({action:"render_layout",node_id:i,node_preview:l},e.proxy(this._renderPreview,this))},delayPreview:function(t){var i="undefined"==typeof t?[]:e(t.target).closest("tr").find("th"),l=e(".fl-builder-widget-settings .fl-builder-settings-title"),o=e(".fl-builder-settings .fl-lightbox-header"),s=FLBuilderLayoutConfig.paths.pluginUrl+"img/ajax-loader-small.svg",n=e('<img class="fl-builder-preview-loader" src="'+s+'" />');this.delay(1e3,e.proxy(this.preview,this)),this._loaderTimeout=setTimeout(function(){e(".fl-builder-preview-loader").remove(),i.length>0?i.append(n):l.length>0?l.append(n):o.length>0&&o.append(n)},1500)},_cancelPreview:function(){this._xhr&&(this._xhr.abort(),this._xhr=null)},_renderPreview:function(t){this._xhr=null,FLBuilder._renderLayout(t,e.proxy(this._renderPreviewComplete,this))},_renderPreviewComplete:function(){this._createSheets(),this._initElementsAndClasses(),null!==this._loaderTimeout&&clearTimeout(this._loaderTimeout),e(".fl-builder-preview-loader").remove(),e(FLBuilder._contentClass).trigger("fl-builder.preview-rendered")},revert:function(){return this._settingsHaveChanged()?void FLBuilder._updateNode(this.nodeId,function(){this.clear()}.bind(this)):void this.clear()},cancel:function(){this._cancelDelay(),this._cancelPreview()},clear:function(){this.cancel(),this._destroySheets(),this._destroyResponsivePreviews()},_initNodeTextColor:function(){e.extend(this.elements,{textColor:e(this.classes.settings+" input[name=text_color]"),linkColor:e(this.classes.settings+" input[name=link_color]"),hoverColor:e(this.classes.settings+" input[name=hover_color]"),headingColor:e(this.classes.settings+" input[name=heading_color]")}),this.elements.textColor.on("change",e.proxy(this._textColorChange,this)),this.elements.linkColor.on("change",e.proxy(this._textColorChange,this)),this.elements.hoverColor.on("change",e.proxy(this._textColorChange,this)),this.elements.headingColor.on("change",e.proxy(this._textColorChange,this))},_textColorChange:function(t){var i=this.elements.textColor.val(),l=this.elements.linkColor.val(),o=this.elements.hoverColor.val(),s=this.elements.headingColor.val();l=""===l?i:l,o=""===o?i:o,s=""===s?i:s,this.delay(100,e.proxy(function(){""===i?this.updateCSSRule(this.classes.node,"color","inherit"):this.updateCSSRule(this.classes.node,"color","#"+i),""===l?this.updateCSSRule(this.classes.node+" a","color","inherit"):this.updateCSSRule(this.classes.node+" a","color","#"+l),""===o?this.updateCSSRule(this.classes.node+" a:hover","color","inherit"):this.updateCSSRule(this.classes.node+" a:hover","color","#"+o),""===s?(this.updateCSSRule(this.classes.node+" h1","color","inherit"),this.updateCSSRule(this.classes.node+" h2","color","inherit"),this.updateCSSRule(this.classes.node+" h3","color","inherit"),this.updateCSSRule(this.classes.node+" h4","color","inherit"),this.updateCSSRule(this.classes.node+" h5","color","inherit"),this.updateCSSRule(this.classes.node+" h6","color","inherit"),this.updateCSSRule(this.classes.node+" h1 a","color","inherit"),this.updateCSSRule(this.classes.node+" h2 a","color","inherit"),this.updateCSSRule(this.classes.node+" h3 a","color","inherit"),this.updateCSSRule(this.classes.node+" h4 a","color","inherit"),this.updateCSSRule(this.classes.node+" h5 a","color","inherit"),this.updateCSSRule(this.classes.node+" h6 a","color","inherit")):(this.updateCSSRule(this.classes.node+" h1","color","#"+s),this.updateCSSRule(this.classes.node+" h2","color","#"+s),this.updateCSSRule(this.classes.node+" h3","color","#"+s),this.updateCSSRule(this.classes.node+" h4","color","#"+s),this.updateCSSRule(this.classes.node+" h5","color","#"+s),this.updateCSSRule(this.classes.node+" h6","color","#"+s),this.updateCSSRule(this.classes.node+" h1 a","color","#"+s),this.updateCSSRule(this.classes.node+" h2 a","color","#"+s),this.updateCSSRule(this.classes.node+" h3 a","color","#"+s),this.updateCSSRule(this.classes.node+" h4 a","color","#"+s),this.updateCSSRule(this.classes.node+" h5 a","color","#"+s),this.updateCSSRule(this.classes.node+" h6 a","color","#"+s))},this))},_initNodeBg:function(){e.extend(this.elements,{bgType:e(this.classes.settings+" select[name=bg_type]"),bgColor:e(this.classes.settings+" input[name=bg_color]"),bgColorPicker:e(this.classes.settings+" .fl-picker-bg_color"),bgOpacity:e(this.classes.settings+" input[name=bg_opacity]"),bgImageSrc:e(this.classes.settings+" select[name=bg_image_src]"),bgRepeat:e(this.classes.settings+" select[name=bg_repeat]"),bgPosition:e(this.classes.settings+" select[name=bg_position]"),bgAttachment:e(this.classes.settings+" select[name=bg_attachment]"),bgSize:e(this.classes.settings+" select[name=bg_size]"),bgVideoSource:e(this.classes.settings+" select[name=bg_video_source]"),bgVideo:e(this.classes.settings+" input[name=bg_video]"),bgVideoServiceUrl:e(this.classes.settings+" input[name=bg_video_service_url]"),bgVideoFallbackSrc:e(this.classes.settings+" select[name=bg_video_fallback_src]"),bgSlideshowSource:e(this.classes.settings+" select[name=ss_source]"),bgSlideshowPhotos:e(this.classes.settings+" input[name=ss_photos]"),bgSlideshowFeedUrl:e(this.classes.settings+" input[name=ss_feed_url]"),bgSlideshowSpeed:e(this.classes.settings+" input[name=ss_speed]"),bgSlideshowTrans:e(this.classes.settings+" select[name=ss_transition]"),bgSlideshowTransSpeed:e(this.classes.settings+" input[name=ss_transitionDuration]"),bgParallaxImageSrc:e(this.classes.settings+" select[name=bg_parallax_image_src]"),bgOverlayColor:e(this.classes.settings+" input[name=bg_overlay_color]"),bgOverlayOpacity:e(this.classes.settings+" input[name=bg_overlay_opacity]")}),this.elements.bgType.on("change",e.proxy(this._bgTypeChange,this)),this.elements.bgColor.on("change",e.proxy(this._bgColorChange,this)),this.elements.bgOpacity.on("keyup",e.proxy(this._bgOpacityChange,this)),this.elements.bgImageSrc.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgRepeat.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgPosition.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgAttachment.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgSize.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgVideoServiceUrl.on("change",e.proxy(this._bgVideoChange,this)),this.elements.bgSlideshowSource.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowPhotos.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowFeedUrl.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTrans.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTransSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgParallaxImageSrc.on("change",e.proxy(this._bgParallaxChange,this)),this.elements.bgOverlayColor.on("change",e.proxy(this._bgOverlayChange,this)),this.elements.bgOverlayOpacity.on("keyup",e.proxy(this._bgOverlayChange,this))},_bgTypeChange:function(e){var t=this.elements.bgType.val();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","background-image":"none"}),"none"==t?this._bgOverlayClear():"color"==t?(this.elements.bgColor.trigger("change"),this._bgOverlayClear()):"photo"==t?(this.elements.bgColor.trigger("change"),this.elements.bgImageSrc.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(t){var i,l,o;""===this.elements.bgColor.val()||isNaN(this.elements.bgOpacity.val())?this.updateCSSRule(this.classes.content,"background-color","transparent"):(i=this.hexToRgb(this.elements.bgColor.val()),l=this.parseFloat(this.elements.bgOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"background-color",o)},this)))},_bgOpacityChange:function(e){this.elements.bgColor.trigger("change")},_bgPhotoChange:function(e){this.elements.bgImageSrc.val()?this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgImageSrc.val()+")","background-repeat":this.elements.bgRepeat.val(),"background-position":this.elements.bgPosition.val(),"background-attachment":this.elements.bgAttachment.val(),"background-size":this.elements.bgSize.val()}):this.updateCSSRule(this.classes.content,{"background-image":"none"})},_bgVideoChange:function(t){var i=this.elements,l=i.bgVideoSource.val(),o=i.bgVideo.val(),s=i.bgVideoServiceUrl.val(),n="https://www.youtube.com/iframe_api",r="https://player.vimeo.com/api/player.js",a=e("<script>");"video_service"==l&&""!=s?(/^(?:(?:(?:https?:)?\/\/)?(?:www.)?(?:youtu(?:be.com|.be))\/(?:watch\?v\=|v\/|embed\/)?([\w\-]+))/i.test(s)&&e('script[src*="youtube.com"').length<1?a.attr("src",n):/^(http\:\/\/|https\:\/\/)?(www\.)?(vimeo\.com\/)([0-9]+)$/.test(s)&&e('script[src*="vimeo.com"').length<1&&a.attr("src",r),a.attr("type","text/javascript").appendTo("head"),this.delay(500,e.proxy(this.preview,this))):""!=o&&this.preview()},_bgSlideshowChange:function(t){var i=this.elements,l=i.bgSlideshowSource.val(),o=i.bgSlideshowPhotos.val(),s=i.bgSlideshowFeedUrl.val(),n=i.bgSlideshowSpeed.val(),r=i.bgSlideshowTransSpeed.val();"wordpress"==l&&""===o||"smugmug"==l&&""===s||isNaN(parseInt(n))||isNaN(parseInt(r))||this.delay(500,e.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(t){var i,l,o;""===this.elements.bgOverlayColor.val()||isNaN(this.elements.bgOverlayOpacity.val())?(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")):(i=this.hexToRgb(this.elements.bgOverlayColor.val()),l=this.parseFloat(this.elements.bgOverlayOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.elements.node.hasClass("fl-col")?this.elements.node.addClass("fl-col-bg-overlay"):this.elements.node.addClass("fl-row-bg-overlay"),this.updateCSSRule(this.classes.content+":after","background-color",o)},this)))},_bgOverlayClear:function(e){this.elements.bgOverlayColor.prev(".fl-color-picker-clear").trigger("click")},_initNodeBorder:function(){e.extend(this.elements,{borderType:e(this.classes.settings+" select[name=border_type]"),borderColor:e(this.classes.settings+" input[name=border_color]"),borderColorPicker:e(this.classes.settings+" .fl-picker-border_color"),borderOpacity:e(this.classes.settings+" input[name=border_opacity]")}),this.elements.borderType.on("change",e.proxy(this._borderTypeChange,this)),this.elements.borderColor.on("change",e.proxy(this._borderColorChange,this)),this.elements.borderOpacity.on("keyup",e.proxy(this._borderOpacityChange,this))},_borderTypeChange:function(e){var t=this.elements.borderType.val();this.updateCSSRule(this.classes.content,{"border-style":""===t?"none":t}),this.elements.borderColor.trigger("change"),this.elements.borderTop.trigger("keyup")},_borderColorChange:function(t){var i,l,o;""===this.elements.borderColor.val()||isNaN(this.elements.borderOpacity.val())?this.updateCSSRule(this.classes.content,"border-color","transparent"):(i=this.hexToRgb(this.elements.borderColor.val()),l=parseInt(this.elements.borderOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"border-color",o)},this)))},_borderOpacityChange:function(e){this.elements.borderColor.trigger("change")},_initNodeClassName:function(){e.extend(this.elements,{className:e(this.classes.settings+" input[name=class]")}),this.elements.className.on("keyup",e.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},_initResponsiveDimensions:function(t){var i={},l=["Top","Bottom","Left","Right"],o=["","Medium","Responsive"],s=this.classes.settings,n="",r="",a=null,d=null;for(a=0;a<l.length;a++)for(d=0;d<o.length;d++)n=t+l[a]+o[d],r=t+"_"+l[a].toLowerCase(),""!=o[d]&&(r+="_"+o[d].toLowerCase()),i[n]=e(s+" input[name="+r+"]"),i[n].on("keyup",e.proxy(this._responsiveDimensionChange,this,t));e.extend(this.elements,i)},_getDimensions:function(e){for(var t=FLBuilderResponsiveEditing._mode,i=["Top","Bottom","Left","Right"],l="default"==t?"":t.charAt(0).toUpperCase()+t.slice(1),o={},s=0;s<i.length;s++)o[i[s].toLowerCase()]=this.elements[e+i[s]+l].val();return this._normalizeDimensionValues(o,e)},_responsiveDimensionChange:function(t){var i=this._getDimensions(t),l={},o="border"==t;e.each(i,function(e,i){l[t+"-"+e+(o?"-width":"")]=i}),this.updateResponsiveCSSRule(this.classes.content,l),this._positionAbsoluteBgs()},_normalizeDimensionValues:function(t,i){var l=this,o=FLBuilderResponsiveEditing._mode,s="default"==o?"":o.charAt(0).toUpperCase()+o.slice(1),i=i.split("-");return"undefined"==typeof i[1]?i[1]="":i[1]=i[1].charAt(0).toUpperCase()+i[1].slice(1),e.map(t,function(e,o){if(e=e.toLowerCase().replace(/[^a-z0-9%.\-]/g,""),""===e){var n=i[0]+o.charAt(0).toUpperCase()+o.slice(1)+i[1]+s,r=l.elements[n].attr("placeholder");r&&(e=r)}null===e||""===e||isNaN(e)||(e=parseFloat(e)+"px"),t[o]=e}),t},_positionAbsoluteBgs:function(){var t=this.elements.node.find(".fl-bg-slideshow"),i=this.elements.node.find(".fl-bg-video"),l=null,o=null,s={top:0,bottom:0,left:0,right:0};(t.length>0||i.length>0)&&(l=this._getDimensions("margin"),o=this._getDimensions("border"),e.map(s,function(e,t){l[t]&&o[t]?s[t]="calc("+l[t]+"+"+o[t]+")":l[t]?s[t]=l[t]:o[t]&&(s[t]=o[t])}),t.length>0&&(this.updateCSSRule(this.classes.node+" .fl-bg-slideshow",s),FLBuilder._resizeLayout()),i.length>0&&this.updateCSSRule(this.classes.node+" .fl-bg-video",s))},_initRow:function(){e.extend(this.elements,{width:e(this.classes.settings+" select[name=width]"),contentWidth:e(this.classes.settings+" select[name=content_width]"),maxContentWidth:e(this.classes.settings+" input[name=max_content_width]"),height:e(this.classes.settings+" select[name=full_height]"),align:e(this.classes.settings+" select[name=content_alignment]")}),this.elements.width.on("change",e.proxy(this._rowWidthChange,this)),this.elements.contentWidth.on("change",e.proxy(this._rowContentWidthChange,this)),this.elements.maxContentWidth.on("keyup",e.proxy(this._rowMaxContentWidthChange,this)),this.elements.height.on("change",e.proxy(this._rowHeightChange,this)),this.elements.align.on("change",e.proxy(this._rowHeightChange,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_rowWidthChange:function(e){var t=this.elements.node,i=this.elements.maxContentWidth.val();"full"==this.elements.width.val()?(t.css("max-width","none"),t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"),""!==i?t.css("max-width",i+"px"):t.css("max-width",FLBuilderConfig.global.row_width+"px"))},_rowHeightChange:function(e){var t=this.elements.node;t.removeClass("fl-row-align-top"),t.removeClass("fl-row-align-center"),t.removeClass("fl-row-align-bottom"),"full"==this.elements.height.val()?(t.addClass("fl-row-full-height"),t.addClass("fl-row-align-"+this.elements.align.val())):t.removeClass("fl-row-full-height")},_rowContentWidthChange:function(e){var t=this.elements.content.find(".fl-row-content"),i=this.elements.maxContentWidth.val();"full"==this.elements.contentWidth.val()?(t.css("max-width","none"),t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"),""!==i?t.css("max-width",i+"px"):t.css("max-width",FLBuilderConfig.global.row_width+"px"))},_rowMaxContentWidthChange:function(e){var t=this.elements.node,i=this.elements.content.find(".fl-row-content"),l=this.elements.maxContentWidth.val();""==l?l=FLBuilderConfig.global.row_width+"px":l+="px","fixed"==this.elements.width.val()&&t.css("max-width",l),"fixed"==this.elements.contentWidth.val()&&i.css("max-width",l)},_initColumn:function(){e.extend(this.elements,{size:e(this.classes.settings+" input[name=size]"),columnHeight:e(this.classes.settings+" select[name=equal_height]"),columnAlign:e(this.classes.settings+" select[name=content_alignment]"),responsiveOrder:e(this.classes.settings+" select[name=responsive_order]")}),this.elements.size.on("keyup",e.proxy(this._colSizeChange,this)),this.elements.columnHeight.on("change",e.proxy(this._colHeightChange,this)),this.elements.columnAlign.on("change",e.proxy(this._colHeightChange,this)),this.elements.responsiveOrder.on("change",e.proxy(this._colResponsiveOrder,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_colSizeChange:function(){var t=8,i=100-t,l=parseFloat(this.elements.size.val()),o=this.elements.node.prev(".fl-col"),s=this.elements.node.next(".fl-col"),n=0===s.length?o:s,r=this.elements.node.siblings(".fl-col"),a=0;0===r.length||isNaN(l)||(r.each(function(){e(this).data("node")!=n.data("node")&&(i-=parseFloat(e(this)[0].style.width),a+=parseFloat(e(this)[0].style.width))}),l<t&&(l=t),l>i&&(l=i),n.css("width",100-a-l+"%"),this.elements.node.css("width",l+"%"))},_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._initResponsiveDimensions("margin")},_initDefaultFieldPreviews:function(e){for(var e=_.isUndefined(e)?this.elements.settings.find(".fl-field"):e,t=null,i=null,l=0;l<e.length;l++)t=e.eq(l),i=t.data("preview"),"refresh"==i.type&&this._initFieldRefreshPreview(t),"text"==i.type&&this._initFieldTextPreview(t),"css"==i.type&&this._initFieldCSSPreview(t),"widget"==i.type&&this._initFieldWidgetPreview(t),"font"==i.type&&this._initFieldFontPreview(t)},_initFieldRefreshPreview:function(t){var i=t.data("type"),l=t.data("preview"),o=e.proxy(this.delayPreview,this);switch(i){case"text":t.find("input[type=text]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"select":t.find("select").on("change",o);break;case"color":t.find(".fl-color-picker-value").on("change",o);break;case"photo":t.find("select").on("change",o);break;case"multiple-photos":t.find("input").on("change",o);break;case"photo-sizes":t.find("select").on("change",o);break;case"video":t.find("input").on("change",o);break;case"multiple-audios":t.find("input").on("change",o);break;case"icon":t.find("input").on("change",o);break;case"form":t.delegate("input","change",o);break;case"editor":this._addTextEditorCallback(t,l);break;case"code":t.find("textarea").on("change",o);break;case"post-type":t.find("select").on("change",o);break;case"suggest":t.find(".as-values").on("change",o),t.find("select").on("change",o);break;case"unit":case"dimension":t.find("input[type=number]").on("keyup",o);break;case"ordering":t.find("input[type=hidden]").on("change",o);break;default:t.on("change",o)}},_initFieldTextPreview:function(t){var i=t.data("type"),l=t.data("preview"),o=e.proxy(this._previewText,this,l);switch(i){case"text":t.find("input[type=text]").on("keyup",o);break;case"unit":t.find("input[type=number]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"code":t.find("textarea").on("change",o);break;case"editor":this._addTextEditorCallback(t,l)}},_previewText:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=e(l),s=e("<div>"+e(i.target).val()+"</div>");o.length>0?(s.find("script").remove(),o.html(s.html())):this.delayPreview(i)},_previewTextEditor:function(t,i,l){var o=this._getPreviewSelector(this.classes.node,t.selector),s=e(o),n="undefined"!=typeof tinyMCE?tinyMCE.get(i):null,r=e("#"+i),a="";s.length>0&&(a=e(n&&"none"==r.css("display")?"<div>"+n.getContent()+"</div>":"undefined"==typeof switchEditors||"undefined"==typeof switchEditors.wpautop?"<div>"+r.val()+"</div>":"<div>"+switchEditors.wpautop(r.val())+"</div>"),a.find("script").remove(),s.html(a.html()))},_addTextEditorCallback:function(t,i){var l=t.find("textarea.wp-editor-area").attr("id"),o=null;if("refresh"==i.type)o=e.proxy(this.delayPreview,this);else{if("text"!=i.type)return;o=e.proxy(this._previewTextEditor,this,i,l)}e("#"+l).on("keyup",o),"undefined"!=typeof tinyMCE&&(editor=tinyMCE.get(l),editor.on("change",o),editor.on("keyup",o))},_initFieldFontPreview:function(t){var i=t.data("type"),l=t.data("preview");l.id=t.attr("id");var o=e.proxy(this._previewFont,this,l);"font"==i&&t.find(".fl-font-field").on("change","select",o)},_previewFont:function(t,i){var l=e(i.delegateTarget),o=l.find(".fl-font-field-font"),s=e(o).find(":selected"),n=s.parent().attr("label"),r=l.find(".fl-font-field-weight"),a=t.id+"-"+this.nodeId,d=this._getPreviewSelector(this.classes.node,t.selector);"Google"==n&&this._buildFontStylesheet(a,o.val(),r.val()),"Default"==o.val()?(this.updateCSSRule(d,"font-family",""),this.updateCSSRule(d,"font-weight","")):(this.updateCSSRule(d,"font-family",o.val()),this.updateCSSRule(d,"font-weight",r.val()))},_buildFontStylesheet:function(t,i,l){var o=FLBuilderConfig.googleFontsUrl,s="",n={},r={};n[i]=[l],FLBuilderPreview._fontsList[t]=n,Object.keys(FLBuilderPreview._fontsList).forEach(function(e){var t=FLBuilderPreview._fontsList[e];Object.keys(t).forEach(function(e){var i=t[e];r[e]=r[e]||[],i=i.filter(function(t){return r[e].indexOf(t)<0}),r[e]=r[e].concat(i)})}),e.each(r,function(e,t){s+=e+":"+t.join()+"|"}),s=o+s.slice(0,-1).replace(" ","+"),e("#fl-builder-google-fonts-preview").length<1?e("<link>").attr("id","fl-builder-google-fonts-preview").attr("type","text/css").attr("rel","stylesheet").attr("href",s).appendTo("head"):e("#fl-builder-google-fonts-preview").attr("href",s)},_initFieldCSSPreview:function(e){var t=e.data("preview"),i=null;if("undefined"!=typeof t.rules)for(i in t.rules)this._initFieldCSSPreviewCallback(e,t.rules[i]);else this._initFieldCSSPreviewCallback(e,t)},_initFieldCSSPreviewCallback:function(t,i){switch(t.data("type")){case"text":t.find("input[type=text]").on("keyup",e.proxy(this._previewCSS,this,i));break;case"unit":t.find("input[type=number]").on("keyup",e.proxy(this._previewCSS,this,i));break;case"dimension":t.find("input[type=number]").on("keyup",e.proxy(this._previewDimensionCSS,this,i));break;case"select":t.find("select").on("change",e.proxy(this._previewCSS,this,i));break;case"color":t.find(".fl-color-picker-value").on("change",e.proxy(this._previewColor,this,i))}},_previewCSS:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=t.property,s="undefined"==typeof t.unit?"":t.unit,n=e(i.target),r=n.val();"%"===s&&"opacity"===o?r=parseInt(r)/100:""!==r&&(r+=s),n.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(l,o,r):this.updateCSSRule(l,o,r)},_previewDimensionCSS:function(t,i){var l=e.extend({},t),o=l.property,s=e(i.target).data("unit");"border-width"===o?l.property="border-"+s+"-width":l.property=o+"-"+s,this._previewCSS(l,i)},_previewColor:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=e(i.target),s=o.val(),n=""===s?"inherit":"#"+s;/^rgb/.test(s.replace(/\s+/g,""))&&(n=s),o.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(l,t.property,n):this.updateCSSRule(l,t.property,n)},_initFieldWidgetPreview:function(t){var i=e.proxy(this.delayPreview,this);t.find("input").on("keyup",i),t.find("input[type=checkbox]").on("click",i),t.find("textarea").on("keyup",i),t.find("select").on("change",i)},_getPreviewSelector:function(e,t){return FLBuilderPreview.getFormattedSelector(e,t)}}}(jQuery),function(e){var t={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,i.update(),this.queueSheets()?this.runQueue():this.applyStyles()},queueSheets:function(){for(var t=e("link, style"),i=null,l=null,o=null,s=null,n=null,r=null,a=null,d=!1,u=0,c=0;u<t.length;u++)if(element=t[u],i=element.href,l=element.id,o=element.tagName.toLowerCase(),s=element.rel,n=element.media,r=i?i:l?l:"style-"+u,a=!0,d=!1,"style"===o||i&&s&&"stylesheet"===s.toLowerCase()){for(c=0;c<this.ignored.length;c++)if(r.indexOf(this.ignored[c])>-1){d=!0;break}if(d)continue;for(c=0;c<this.reparsed.length;c++)if(r.indexOf(this.reparsed[c])>-1){this.sheets[r]=null;break}void 0!==this.sheets[r]&&this.sheets[r]||this.queue.push({element:t.eq(u),key:r,tagName:o,href:i,id:l,media:n})}return this.queue.length},runQueue:function(){var t;this.queue.length?(t=this.queue.shift(),"style"===t.tagName?(this.parse(t.element.html(),t),this.runQueue()):e.get(t.href,e.proxy(function(e){this.parse(e,t),this.runQueue()},this))):this.applyStyles()},parse:function(e,t){var i=this.regex,l=this.cleanStyles(e),o=l.match(i.media),s=o&&o.length||0,n=!s&&t.media,r=null,a=null,d=null,u="",c=0,h=0;for(o?u=l.replace(i.media,""):n&&"all"!=t.media?s=1:u=l,this.sheets[t.key]={element:t.element,key:t.key,tagName:t.tagName,href:t.href,id:t.id,all:u,queries:[]},c=0;c<s;c++)for(n?(r=t.media,l=this.convertURLs(l,t.href)):(r=o[c].match(i.findStyles)&&RegExp.$1,l=RegExp.$2&&this.convertURLs(RegExp.$2,t.href)),a=r.split(","),h=0;h<a.length;h++)r=a[h],d=r.split("(")[0].match(i.only)&&RegExp.$2,"print"!=d&&(r.replace(i.minmaxwh,"").match(i.other)||this.sheets[t.key].queries.push({minw:r.match(i.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:r.match(i.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),styles:l}))},applyStyles:function(){var t=e("head"),i=null,l=null,o=null,s=null,n=null,r=null,a=null,d=null,u=!1;this.clearStyles();for(s in this.sheets)if(i="",l=e("<style></style>"),o=this.sheets[s],o.queries.length&&this.width){for(i+=o.all,r=0;r<o.queries.length;r++)n=o.queries[r],a=n.minw,d=n.maxw,u=!1,a&&(a=parseFloat(a)*(a.indexOf("em")>-1?this.getEmPxValue():1),this.width>=a&&(i+=n.styles,u=!0)),d&&!u&&(d=parseFloat(d)*(d.indexOf("em")>-1?this.getEmPxValue():1),this.width<=d&&(i+=n.styles));this.styles.push(l),t.append(l),l.html(i),o.element.remove()}},clearStyles:function(){var t=e("head"),i=null,l=this.styles.slice(0);this.styles=[];for(i in this.sheets)this.sheets[i].element.parent().length||t.append(this.sheets[i].element);setTimeout(function(){for(var e=0;e<l.length;e++)l[e].empty(),l[e].remove()},50)},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("/")),t.length&&(t+="/"),e.replace(this.regex.urls,"$1"+t+"$2$3")):e},getEmPxValue:function(){if(this.emPxValue)return this.emPxValue;var e=null,t=window.document,i=t.documentElement,l=t.body,o=t.createElement("div"),s=i.style.fontSize,n=l&&l.style.fontSize,r=!1;return o.style.cssText="position:absolute;font-size:1em;width:1em",l||(l=r=t.createElement("body"),l.style.background="none"),i.style.fontSize="100%",l.style.fontSize="100%",l.appendChild(o),r&&i.insertBefore(l,i.firstChild),e=parseFloat(o.offsetWidth),r?i.removeChild(l):l.removeChild(o),i.style.fontSize=s,n?l.style.fontSize=n:l.style.fontSize="",this.emPxValue=e,e}},i={_functions:null,update:function(){var e;if(!this._functions){this._functions={};for(e in l)this._functions[e]=jQuery.fn[e]}if(t.width)for(e in l)jQuery.fn[e]=l[e];else for(e in this._functions)jQuery.fn[e]=this._functions[e]}},l={width:function(l){return void 0!=l?i._functions.width.call(this,l):e.isWindow(this[0])?t.width:i._functions.width.call(this);
|
7 |
+
}};FLBuilderSimulateMediaQuery={ignore:function(e){t.ignore(e)},reparse:function(e){t.reparse(e)},update:function(e,i){t.update(e,i)}}}(jQuery),function(e){FLBuilderResponsiveEditing={_mode:"default",refreshPreview:function(){var t;e(".fl-responsive-preview").length&&"default"!=this._mode&&("responsive"==this._mode?(t=FLBuilderConfig.global.responsive_breakpoint>=320?320:FLBuilderConfig.global.responsive_breakpoint,FLBuilderSimulateMediaQuery.update(t)):"medium"==this._mode&&(t=FLBuilderConfig.global.medium_breakpoint>=769?769:FLBuilderConfig.global.medium_breakpoint,FLBuilderSimulateMediaQuery.update(t)),FLBuilder._resizeLayout())},_init:function(){this._bind(),this._initMediaQueries()},_bind:function(){FLBuilder.addHook("settings-form-init",this._initSettingsForms),FLBuilder.addHook("settings-lightbox-closed",this._clearPreview),e("body").delegate(".fl-field-responsive-toggle","click",this._settingToggleClicked)},_initMediaQueries:function(){FLBuilderSimulateMediaQuery.ignore([FLBuilderConfig.pluginUrl,"fl-theme-builder","/wp-includes/","/wp-admin/","admin-bar-inline-css","ace-tm","ace_editor.css"]),FLBuilderSimulateMediaQuery.reparse([FLBuilderConfig.postId+"-layout-draft.css?",FLBuilderConfig.postId+"-layout-draft-partial.css?",FLBuilderConfig.postId+"-layout-preview.css?",FLBuilderConfig.postId+"-layout-preview-partial.css?","fl-builder-global-css","fl-builder-layout-css"])},_switchTo:function(t,i){var l=e("html"),o=e("body"),s=e(FLBuilder._contentClass),n=e(".fl-responsive-preview"),r=e(".fl-responsive-preview-mask"),a=e(".fl-content-placeholder"),d=null;if(FLBuilderResponsiveEditing._mode=t,"default"==t){if(0===a.length)return;l.removeClass("fl-responsive-preview-enabled"),a.after(s),a.remove(),n.remove(),r.remove()}else 0===n.length?(l.addClass("fl-responsive-preview-enabled"),s.after('<div class="fl-content-placeholder"></div>'),o.prepend(wp.template("fl-responsive-preview")()),e(".fl-responsive-preview").addClass("fl-preview-"+t),e(".fl-responsive-preview-content").append(s)):(n.removeClass("fl-preview-responsive fl-preview-medium"),n.addClass("fl-preview-"+t));"responsive"==t?(d=FLBuilderConfig.global.responsive_breakpoint>=360?360:FLBuilderConfig.global.responsive_breakpoint,s.width(d),FLBuilderSimulateMediaQuery.update(d,i)):"medium"==t?(d=FLBuilderConfig.global.medium_breakpoint>=769?769:FLBuilderConfig.global.medium_breakpoint,s.width(d),FLBuilderSimulateMediaQuery.update(d,i)):(s.width(""),FLBuilderSimulateMediaQuery.update(null,i)),this._setContentBackgroundColor(),FLBuilder._resizeLayout(),FLBuilder.triggerHook("responsive-editing-switched",t)},_setContentBackgroundColor:function(){var t=e(FLBuilder._contentClass),i=e(".fl-responsive-preview"),l=e(".fl-content-placeholder"),o=l.parents(),s="#fff",n=0;if(0===i.length)t.css("background-color","");else{for(;n<o.length&&(s=o.eq(n).css("background-color"),"rgba(0, 0, 0, 0)"==s);n++);t.css("background-color",s)}},_switchToAndScroll:function(t){var i=e(".fl-builder-settings").data("node"),l=void 0===i?void 0:e(".fl-node-"+i);FLBuilderResponsiveEditing._switchTo(t,function(){void 0!==l&&l&&setTimeout(function(){var t=e(window),i=e(".fl-responsive-preview-content");!i.length||t.height()<i.height()?e("html, body").animate({scrollTop:l.offset().top-100},250):scrollTo(0,0)},250)})},_clearPreview:function(){FLBuilderResponsiveEditing._switchToAndScroll("default")},_settingToggleClicked:function(){var t=e(this),i=t.data("mode");i="default"==i?"medium":"medium"==i?"responsive":"default",FLBuilderResponsiveEditing._switchAllSettingsTo(i),t.siblings(".fl-field-responsive-setting:visible").find("input").focus()},_switchAllSettingsTo:function(t){var i="dashicons-desktop dashicons-tablet dashicons-smartphone";e(".fl-field-responsive-toggle").removeClass(i),e(".fl-field-responsive-setting").hide(),i="default"==t?"dashicons-desktop":"medium"==t?"dashicons-tablet":"dashicons-smartphone",e(".fl-field-responsive-toggle").addClass(i).data("mode",t),e(".fl-field-responsive-setting-"+t).css("display","inline-block"),FLBuilderResponsiveEditing._switchToAndScroll(t)},_initSettingsForms:function(){var e=FLBuilderResponsiveEditing;Number(FLBuilderConfig.global.responsive_enabled)&&(e._initFields("dimension","input","keyup",e._spacingFieldKeyup,["margin","padding"]),e._initFields("dimension","input","keyup",e._textFieldKeyup),e._initFields("unit","input","keyup",e._textFieldKeyup)),e._switchAllSettingsTo(e._mode)},_initFields:function(t,i,l,o,s){for(var n=e(".fl-builder-settings"),r=n.find(".fl-field").has(".fl-field-responsive-setting"),a=null,d=null,u=0;u<r.length;u++)a=r.eq(u),d=a.attr("id").replace("fl-field-",""),"object"==typeof s&&e.inArray(d,s)<0||t==a.attr("data-type")&&void 0===a.attr("data-responsive-init")&&(a.find(".fl-field-responsive-setting-default "+i).on(l,o),a.find(".fl-field-responsive-setting-medium "+i).on(l,o),a.find(".fl-field-responsive-setting-responsive "+i).on(l,o),a.find(".fl-field-responsive-setting-default "+i).trigger(l),a.attr("data-responsive-init",1))},_getFields:function(t,i){var l=e(t).closest(".fl-field");return{"default":l.find(".fl-field-responsive-setting-default "+i),medium:l.find(".fl-field-responsive-setting-medium "+i),responsive:l.find(".fl-field-responsive-setting-responsive "+i)}},_textFieldKeyup:function(){var e=FLBuilderResponsiveEditing._getFields(this,"input");e["default"].each(function(t){var i=e["default"].eq(t).attr("placeholder"),l=e["default"].eq(t).val(),o=e.medium.eq(t).val();""==l?e.medium.eq(t).attr("placeholder",void 0===i?"":i):e.medium.eq(t).attr("placeholder",l),""==o?e.responsive.eq(t).attr("placeholder",e.medium.eq(t).attr("placeholder")):e.responsive.eq(t).attr("placeholder",o)})},_spacingFieldKeyup:function(){var t=e(".fl-builder-settings"),i="row",l=e(this).closest(".fl-field").attr("id").replace("fl-field-",""),o=FLBuilderResponsiveEditing._getFields(this,"input"),s=FLBuilderConfig.global,n=null,r=null,a=null,d=null;t.hasClass("fl-builder-row-settings")?i="row":t.hasClass("fl-builder-col-settings")?i="col":t.hasClass("fl-builder-module-settings")&&(i="module"),e.extend(s,{col_margins:0,col_margins_medium:"",col_margins_responsive:"",col_padding:0,col_padding_medium:"",col_padding_responsive:""}),n=i+"_"+l+("margin"===l?"s":""),r=s[n],a=s[n+"_medium"],d=s[n+"_responsive"],o["default"].each(function(e){var t=o["default"].eq(e).attr("name").split("_").pop(),n=o["default"].eq(e).val(),u=o.medium.eq(e).val(),c=(o.responsive.eq(e).val(),null),h=null;""===a&&(""!==n?o.medium.eq(e).attr("placeholder",n):""!==r&&o.medium.eq(e).attr("placeholder",r)),""===d&&("module"===i&&Number(s.auto_spacing)?(c=""===a?Number(r):a,h=""===u?Number(n):u,""!==h&&(h>c||h<0)?o.responsive.eq(e).attr("placeholder",c):""!==h?o.responsive.eq(e).attr("placeholder",h):o.responsive.eq(e).attr("placeholder",c)):(!Number(s.auto_spacing)||"padding"===l&&"top|bottom".indexOf(t)>-1)&&(""!==u?o.responsive.eq(e).attr("placeholder",u):""!==a?o.responsive.eq(e).attr("placeholder",a):""!==n?o.responsive.eq(e).attr("placeholder",n):""!==r&&o.responsive.eq(e).attr("placeholder",r)))})}},e(function(){FLBuilderResponsiveEditing._init()})}(jQuery),function(e){FLBuilderResponsivePreview={enter:function(){this.render()},exit:function(){this.destroy()},switchTo:function(t){var i=FLBuilderConfig.global,l=e("#fl-builder-preview-frame"),o="100%";"responsive"==t?(o=i.responsive_breakpoint>=360?360:i.responsive_breakpoint,l.width(o)):"medium"==t&&(o=i.medium_breakpoint>=769?769:i.medium_breakpoint,l.width(o)),l.width(o)},render:function(){var t=e("body"),i=FLBuilderConfig.previewUrl,l=e("#fl-builder-preview-mask, #fl-builder-preview-frame"),o=e('<div id="fl-builder-preview-mask"></div>'),s=e('<iframe id="fl-builder-preview-frame" src="'+i+'" frameborder="0"></iframe>');l.remove(),t.append(o),t.append(s)},destroy:function(){e("#fl-builder-preview-mask, #fl-builder-preview-frame").remove()}}}(jQuery),function(e){var t={init:function(){var t=e("body");t.delegate(".fl-builder-service-select","change",this._serviceChange),t.delegate(".fl-builder-service-connect-button","click",this._connectClicked),t.delegate(".fl-builder-service-account-select","change",this._accountChange),t.delegate(".fl-builder-service-account-delete","click",this._accountDeleteClicked),t.delegate(".fl-builder-campaign-monitor-client-select","change",this._campaignMonitorClientChange),t.delegate(".fl-builder-mailchimp-list-select","change",this._mailChimpListChange),t.delegate(".fl-builder-activecampaign-list_type-select","change",this._activeCampaignChange)},_startSettingsLoading:function(t){var i=e(".fl-builder-settings"),l=t.closest(".fl-builder-service-settings"),o=e(".fl-builder-service-error");i.append('<div class="fl-builder-loading"></div>'),l.addClass("fl-builder-service-settings-loading"),o.remove()},_finishSettingsLoading:function(){var t=e(".fl-builder-settings"),i=e(".fl-builder-service-settings-loading");t.find(".fl-builder-loading").remove(),i.removeClass("fl-builder-service-settings-loading")},_serviceChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this),o=l.closest("tr"),s=l.val();o.siblings("tr.fl-builder-service-account-row").remove(),o.siblings("tr.fl-builder-service-connect-row").remove(),o.siblings("tr.fl-builder-service-field-row").remove(),e(".fl-builder-service-error").remove(),""!==s&&(t._startSettingsLoading(l),FLBuilder.ajax({action:"render_service_settings",node_id:i,service:s},t._serviceChangeComplete))},_serviceChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row");s.after(l.html),t._addAccountDelete(o),t._finishSettingsLoading()},_connectClicked:function(){for(var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-connect-row"),n=l.find(".fl-builder-service-connect-input"),r=null,a=null,d=0,u={action:"connect_service",node_id:i,service:o.val(),fields:{}};d<n.length;d++)r=n.eq(d),a=r.attr("name"),u.fields[a]=r.val();s.hide(),t._startSettingsLoading(o),FLBuilder.ajax(u,t._connectComplete)},_connectComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row"),n=o.find(".fl-builder-service-select"),r=o.find(".fl-builder-service-account-row"),a=o.find(".fl-builder-service-account-select"),d=o.find(".fl-builder-service-connect-row");l.error?(d.show(),0===a.length?n.after('<div class="fl-builder-service-error">'+l.error+"</div>"):a.after('<div class="fl-builder-service-error">'+l.error+"</div>")):(d.remove(),r.remove(),s.after(l.html)),t._addAccountDelete(o),t._finishSettingsLoading()},_accountChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-connect-row"),r=l.find("tr.fl-builder-service-field-row"),a=e(".fl-builder-service-error"),d=s.val(),u=null;n.remove(),r.remove(),a.remove(),"add_new_account"==d?u={action:"render_service_settings",node_id:i,service:o.val(),add_new:!0}:""!==d&&(u={action:"render_service_fields",node_id:i,service:o.val(),account:d}),u&&(t._startSettingsLoading(o),FLBuilder.ajax(u,t._accountChangeComplete)),t._addAccountDelete(l)},_accountChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-account-row");s.after(l.html),t._finishSettingsLoading()},_addAccountDelete:function(e){var t=e.find(".fl-builder-service-account-select");t.length>0&&(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 i=e(this).closest(".fl-builder-service-settings"),l=i.find(".fl-builder-service-select"),o=i.find(".fl-builder-service-account-select");confirm(FLBuilderStrings.deleteAccountWarning)&&(FLBuilder.ajax({action:"delete_service_account",service:l.val(),account:o.val()},t._accountDeleteComplete),t._startSettingsLoading(o))},_accountDeleteComplete:function(){var i=e(".fl-builder-service-settings-loading"),l=i.find(".fl-builder-service-select");t._finishSettingsLoading(),l.trigger("change")},_campaignMonitorClientChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=e(this),r=l.find(".fl-builder-service-list-select"),a=n.val();0!==r.length&&r.closest("tr").remove(),""!==a&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),client:a},t._campaignMonitorClientChangeComplete))},_campaignMonitorClientChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-campaign-monitor-client-select");s.closest("tr").after(l.html),t._finishSettingsLoading()},_mailChimpListChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-list-select");e(".fl-builder-mailchimp-group-select").closest("tr").remove(),""!==n.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),list_id:n.val()},t._mailChimpListChangeComplete))},_mailChimpListChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-list-select");s.closest("tr").after(l.html),t._finishSettingsLoading()},_activeCampaignChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-list-select");list_type=l.find('select[name="list_type"]'),0!==n.length&&n.closest("tr").remove(),""!==list_type.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),list_type:list_type.val()},t._activeCampaignTypeChangeComplete))},_activeCampaignTypeChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-field-row");s.after(l.html),t._finishSettingsLoading()}};e(function(){t.init()})}(jQuery),function(e){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 t={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:first-of-type",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-row:first-of-type .fl-module-overlay .fl-block-overlay-actions",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent2,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".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"),e(".fl-row").eq(0).trigger("mouseleave"),e(".fl-module").eq(0).trigger("mouseleave")}},{animation:!1,element:".fl-builder-templates-button",placement:"bottom",title:FLBuilderStrings.tourTemplatesButtonTitle,content:FLBuilderStrings.tourTemplatesButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-tools-button",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 FLBuilderConfig.lite?t.steps.shift():"disabled"==FLBuilderConfig.enabledTemplates?t.steps.shift():"fl-builder-template"==FLBuilderConfig.postType&&t.steps.shift(),t},_onStart:function(){var t=e("body");t.scrollTop(0),t.append('<div class="fl-builder-tour-mask"></div>'),0===e(".fl-row").length&&"module"!=FLBuilderConfig.userTemplateType&&(e(".fl-builder-content").append('<div class="fl-builder-tour-demo-content fl-row fl-row-fixed-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())},_onPrev:function(){e(".fl-builder-tour-dimmed").remove()},_onNext:function(){e(".fl-builder-tour-dimmed").remove()},_onEnd:function(){e("body").off("fl-builder.template-selector-loaded"),e(".fl-builder-tour-mask").remove(),e(".fl-builder-tour-dimmed").remove(),e(".fl-builder-tour-demo-content").remove(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._showPanel(),FLBuilder._initTemplateSelector()},_dimSection:function(t){e(t).find(".fl-builder-tour-dimmed").remove(),e(t).append('<div class="fl-builder-tour-dimmed"></div>')}}}(jQuery),function(e,t){String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),e.fn.textWidth=function(t,i){return e.fn.textWidth.fakeEl||(e.fn.textWidth.fakeEl=e("<span>").hide().appendTo(document.body)),e.fn.textWidth.fakeEl.text(t||this.val()||this.text()).css("font",i||this.css("font")),e.fn.textWidth.fakeEl.width()},FLExtendableObject={create:function(t){var i=Object.create(this);return i=e.extend(i,t),e(this).trigger("onCreate"),i}},e.fn.switchClass=function(t,i){return this.each(function(){return e(this).removeClass(function(e,i){var l=[],o=i.split(" ");for(var e in o)o[e].startsWith(t)&&l.push(o[e]);return l.join(" ")}),e(this).addClass(t+i)})};var i={init:function(){t.addHook("cancelTask",this.onCancelTask.bind(this)),t.addHook("showSavedMessage",this.onSaveShortcut.bind(this)),t.addHook("goToNextTab",this.onNextPrevTabShortcut.bind(this,"next")),t.addHook("goToPrevTab",this.onNextPrevTabShortcut.bind(this,"prev")),t.addHook("endEditingSession",this.onEndEditingSession.bind(this)),t.addHook("restartEditingSession",this.onRestartEditingSession.bind(this)),this.setDefaultKeyboardShortcuts()},addShortcut:function(t,i,l){var o=e.proxy(this,"onTriggerKey",t);l?Mousetrap.bindGlobal(i,o):Mousetrap.bind(i,o)},reset:function(){Mousetrap.reset()},setDefaultKeyboardShortcuts:function(){this.reset();for(var e in FLBuilderConfig.keyboardShortcuts){var t=FLBuilderConfig.keyboardShortcuts[e].keyCode,i=FLBuilderConfig.keyboardShortcuts[e].isGlobal;this.addShortcut(e,t,i)}},onTriggerKey:function(e,i){t.triggerHook(e),i.preventDefault?i.preventDefault():i.returnValue=!1},onCancelTask:function(){return s.isPreviewing?void s.endPreview():o.isShowing?void o.hide():t.ContentPanel.isShowing?void t.ContentPanel.hide():void 0},pause:function(){Mousetrap.pause()},unpause:function(){Mousetrap.unpause()},onEndEditingSession:function(){this.reset(),this.addShortcut("restartEditingSession","mod+e")},onRestartEditingSession:function(){this.reset(),this.setDefaultKeyboardShortcuts()},onSaveShortcut:function(){if(t.SaveManager.layoutNeedsPublish()){var e=FLBuilderStrings.savedStatus.hasAlreadySaved;t.SaveManager.showStatusMessage(e),setTimeout(function(){t.SaveManager.resetStatusMessage()},2e3)}else{var e=FLBuilderStrings.savedStatus.nothingToSave;t.SaveManager.showStatusMessage(e),setTimeout(function(){t.SaveManager.resetStatusMessage()},2e3)}},onNextPrevTabShortcut:function(i,l){var o,s,n=e(".fl-lightbox:visible"),r=n.find(".fl-builder-settings-tabs a");n.length>0&&(o=r.filter("a.fl-active"),s="next"==i?o.is(r.last())?r.first():o.next("a"):o.is(r.first())?r.last():o.prev("a"),s.trigger("click")),t._calculateSettingsTabsOverflow(),l.preventDefault()}},l={isShowing:!1,init:function(){this.render(),t.addHook("showKeyboardShortcuts",this.show.bind(this))},render:function(){var t=wp.template("fl-keyboard-shortcuts"),i=FLBuilderConfig.keyboardShortcuts;this.$el=e(t(i)),e("body").append(this.$el),this.$el.find(".dismiss-shortcut-ui").on("click",this.hide.bind(this)),this.$el.on("click",this.hide.bind(this))},show:function(){this.isShowing||(this.$el.addClass("is-showing"),this.isShowing=!0)},hide:function(){this.isShowing&&(this.$el.removeClass("is-showing"),this.isShowing=!1)},toggle:function(){this.isShowing?this.hide():this.show()}},o=FLExtendableObject.create({isShowing:!1,init:function(){this.$el=e(".fl-builder-publish-actions"),this.$defaultBarButtons=e(".fl-builder-bar-actions"),this.$clickAwayMask=e(".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",this.onActionClicked.bind(this)),t.addHook("triggerDone",this.onDoneTriggered.bind(this));var i=this.hide.bind(this);t.addHook("cancelPublishActions",i),t.addHook("endEditingSession",i),this.$clickAwayMask.on("click",i)},onDoneTriggered:function(){t.SaveManager.layoutNeedsPublish()?this.show():FLBuilderConfig.shouldRefreshOnPublish?t._exit():t._exitWithoutRefresh()},show:function(){this.isShowing||t._triggerSettingsSave(!1,!0)&&(this.$el.removeClass("is-hidden"),this.$defaultBarButtons.css("opacity","0"),this.$clickAwayMask.show(),this.isShowing=!0,t.triggerHook("didShowPublishActions"))},hide:function(){this.isShowing&&(this.$el.addClass("is-hidden"),this.$defaultBarButtons.css("opacity","1"),this.$clickAwayMask.hide(),this.isShowing=!1)},onActionClicked:function(i){var l=e(i.currentTarget).data("action");switch(l){case"dismiss":this.hide();break;case"discard":this.hide(),s.muteToolbar(),t._discardButtonClicked();break;case"publish":this.hide(),s.muteToolbar(),t._publishButtonClicked(),t._destroyOverlayEvents();break;case"draft":this.hide(),s.muteToolbar(),t._draftButtonClicked();break;default:this.hide(),s.muteToolbar(),t._draftButtonClicked()}t.triggerHook(l+"ButtonClicked")}}),s={isPreviewing:!1,init:function(){this.$el=e("body"),this.$mainToolbar=e(".fl-builder-bar"),this.$mainToolbarContent=this.$mainToolbar.find(".fl-builder-bar-content"),this.$wpAdminBar=e("#wpadminbar"),this.$endPreviewBtn=e(".fl-builder--preview-actions .end-preview-btn"),t.addHook("endEditingSession",this.endEditingSession.bind(this)),t.addHook("previewLayout",this.togglePreview.bind(this)),this.$endPreviewBtn.on("click",this.endPreview.bind(this)),this.$deviceIcons=e(".fl-builder--preview-actions i"),this.$deviceIcons.on("click",this.onDeviceIconClick.bind(this));var i=this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a, #wp-admin-bar-fl-theme-builder-frontend-edit-link > a");i.on("click",this.onClickPageBuilderToolbarLink.bind(this)),e("#wpadminbar a").attr("tabindex","-1");var l=this.restartEditingSession.bind(this);t.addHook("restartEditingSession",l),t.addHook("didHideAllLightboxes",this.unmuteToolbar.bind(this)),t.addHook("didCancelDiscard",this.unmuteToolbar.bind(this)),t.addHook("didEnterRevisionPreview",this.hide.bind(this)),t.addHook("didExitRevisionPreview",this.show.bind(this)),t.addHook("didPublishLayout",this.onPublish.bind(this))},endEditingSession:function(){t._destroyOverlayEvents(),t._removeAllOverlays(),t._removeEmptyColHighlights(),t._removeColHighlightGuides(),t._unbindEvents(),e("html").removeClass("fl-builder-edit").addClass("fl-builder-show-admin-bar"),e("body").removeClass("fl-builder-edit"),e("#wpadminbar a").attr("tabindex",null),e(t._contentClass).removeClass("fl-builder-content-editing"),this.hideMainToolbar(),t.ContentPanel.hide(),FLBuilderLayout.init()},restartEditingSession:function(i){t._initTemplateSelector(),t._bindOverlayEvents(),t._highlightEmptyCols(),t._rebindEvents(),e("html").addClass("fl-builder-edit").removeClass("fl-builder-show-admin-bar"),e("body").addClass("fl-builder-edit"),e("#wpadminbar a").attr("tabindex","-1"),e(t._contentClass).addClass("fl-builder-content-editing"),this.showMainToolbar(),i.preventDefault()},onClickPageBuilderToolbarLink:function(e){t.triggerHook("restartEditingSession"),e.preventDefault()},onPublish:function(){var e=this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a span");e.css("color","#6bc373")},hide:function(){e("html").hasClass("fl-builder-edit")&&(t._unbindEvents(),t._destroyOverlayEvents(),t._removeAllOverlays(),e("html").removeClass("fl-builder-edit"),e("body").removeClass("admin-bar"),this.hideMainToolbar(),t.ContentPanel.hide(),FLBuilderLayout.init(),t.triggerHook("didHideEditingUI"))},show:function(){e("html").hasClass("fl-builder-edit")||(t._rebindEvents(),t._bindOverlayEvents(),this.showMainToolbar(),FLBuilderResponsiveEditing._switchTo("default"),e("html").addClass("fl-builder-edit"),e("body").addClass("admin-bar"),t.triggerHook("didShowEditingUI"))},beginPreview:function(){t._triggerSettingsSave(!1,!0)&&(this.isPreviewing=!0,this.hide(),e("html").addClass("fl-builder-preview"),e("html, body").removeClass("fl-builder-edit"),t._removeEmptyColHighlights(),t._removeColHighlightGuides(),t.triggerHook("didBeginPreview"),FLBuilderResponsivePreview.enter())},endPreview:function(){this.isPreviewing=!1,this.show(),t._highlightEmptyCols(),FLBuilderResponsivePreview.exit(),e("html").removeClass("fl-builder-preview"),e("html, body").addClass("fl-builder-edit")},togglePreview:function(){this.isPreviewing?this.endPreview():this.beginPreview()},hideMainToolbar:function(){this.$mainToolbar.addClass("is-hidden"),e("html").removeClass("fl-builder-is-showing-toolbar")},showMainToolbar:function(){this.unmuteToolbar(),this.$mainToolbar.removeClass("is-hidden"),e("html").addClass("fl-builder-is-showing-toolbar")},onDeviceIconClick:function(t){var i=e(t.target).data("mode");FLBuilderResponsivePreview.switchTo(i)},muteToolbar:function(){this.$mainToolbarContent.addClass("is-muted"),t._hideTipTips()},unmuteToolbar:function(){this.$mainToolbarContent.removeClass("is-muted")}},n={isEditing:!0,init:function(){history.pushState&&(t.addHook("endEditingSession",this.onLeaveBuilder.bind(this)),t.addHook("restartEditingSession",this.onEnterBuilder.bind(this)))},onEnterBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.editUrl),this.isEditing=!0},onLeaveBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.url),this.isEditing=!1}},r={$row:null,$rowContent:null,row:null,drag:{},init:function(){if(this.userCanResize()){var i=e(t._contentClass);i.delegate(".fl-block-row-resize","mouseenter",this.onDragHandleHover.bind(this)),i.delegate(".fl-block-row-resize","mousedown",this.onDragHandleDown.bind(this))}},userCanResize:function(){return FLBuilderConfig.rowResize.userCanResizeRows},onDragHandleHover:function(t){if(!this.drag.isDragging){var i=e(t.target);this.$row=i.closest(".fl-row"),this.$rowContent=this.$row.find(".fl-row-content"),this.row={node:this.$row.data("node"),isFixedWidth:this.$row.hasClass("fl-row-fixed-width"),settings:e(".fl-builder-row-settings[data-node="+this.$row.data("node")+"]")},this.drag={edge:null,isDragging:!1,originalPosition:null,originalWidth:null,calculatedWidth:null,operation:null},this.row.isFixedWidth?this.drag.originalWidth=this.$row.width():this.drag.originalWidth=this.$rowContent.width(),this.dragInit()}},onDragHandleDown:function(){e("body").addClass("fl-builder-row-resizing")},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(i,l){var o=e("body"),s=e(l.helper);this.drag.isDragging=!0,this.row.isFixedWidth?this.drag.originalWidth=this.$row.width():this.drag.originalWidth=this.$rowContent.width(),s.hasClass("fl-block-col-resize-e")&&(this.drag.edge="e",this.$feedback=s.find(".fl-block-col-resize-feedback-left")),s.hasClass("fl-block-col-resize-w")&&(this.drag.edge="w",this.$feedback=s.find(".fl-block-col-resize-feedback-right")),o.addClass("fl-builder-row-resizing"),t._colResizing=!0,t._destroyOverlayEvents(),t._closePanel()},dragging:function(e,t){var i=t.position.left,l=t.originalPosition.left,o=this.drag.originalWidth,s=0,n=this.drag.edge,r=FLBuilderConfig.rowResize.minAllowedWidth,a=FLBuilderConfig.rowResize.maxAllowedWidth;l!==i&&(FLBuilderConfig.isRtl&&(n="w"==n?"e":"w"),l>i?"w"===n?this.drag.operation="+":this.drag.operation="-":"e"===n?this.drag.operation="+":this.drag.operation="-",s=Math.abs(l-i),"+"===this.drag.operation?this.drag.calculatedWidth=o+2*s:this.drag.calculatedWidth=o-2*s,!1!==r&&this.drag.calculatedWidth<r&&(this.drag.calculatedWidth=r),
|
8 |
+
!1!==a&&this.drag.calculatedWidth>a&&(this.drag.calculatedWidth=a),this.row.isFixedWidth&&this.$row.css("max-width",this.drag.calculatedWidth+"px"),this.$rowContent.css("max-width",this.drag.calculatedWidth+"px"),_.isUndefined(this.$feedback)||this.$feedback.html(this.drag.calculatedWidth+"px").show(),this.row.settings.length&&this.row.settings.find("[name=max_content_width]").val(this.drag.calculatedWidth))},dragStop:function(i,l){this.drag.isDragging=!1,_.isUndefined(this.$feedback)||this.$feedback.hide();var o={action:"resize_row_content",node:this.row.node,width:this.drag.calculatedWidth},s=e("body");t.ajax(o),t._bindOverlayEvents(),s.removeClass("fl-builder-row-resizing"),e(".fl-block-overlay").each(function(){t._buildOverlayOverflowMenu(e(this))}),e("body").removeClass("fl-builder-row-resizing"),setTimeout(function(){t._colResizing=!1},50),t.triggerHook("didResizeRow",{rowId:this.row.node,rowWidth:this.drag.calculatedWidth})}},a={templateName:"fl-toolbar",init:function(){this.template=wp.template(this.templateName),this.render(),this.initTipTips();var e=this.$el.find(".fl-builder-content-panel-button");e.on("click",t._togglePanel),this.$el.find(".fl-builder-buy-button").on("click",t._upgradeClicked),this.$el.find(".fl-builder-upgrade-button").on("click",t._upgradeClicked),this.$el.find("#fl-builder-toggle-notifications").on("click",this.onNotificationsButtonClicked.bind(this)),t.addHook("notificationsLoaded",this.onNotificationsLoaded.bind(this))},render:function(t){var i=e(this.template(t));this.$el=i,this.el=i.get(0),s.$mainToolbar=this.$el,e("body").prepend(i),e("html").addClass("fl-builder-is-showing-toolbar")},initTipTips:function(){e(".fl-builder--saving-indicator").tipTip({defaultPosition:"bottom",edgeOffset:14}),e(".fl-builder-publish-actions .fl-builder-button-group .fl-builder-button").tipTip({defaultPosition:"bottom",edgeOffset:6})},onNotificationsButtonClicked:function(){t.triggerHook("toggleNotifications")},onNotificationsLoaded:function(){e("body").removeClass("fl-builder-has-new-notifications");var i={action:"fl_builder_notifications",read:!0};t.ajax(i)}};e(function(){t.ContentPanel.init(),FLBuilderConfig.simpleUi||t.MainMenu.init(),FLBuilderConfig.showToolbar?(a.init(),t.ContentPanel.alignPanelArrow()):e("html").addClass("fl-builder-no-toolbar"),i.init(),l.init(),s.init(),n.init(),r.init(),o.init(),t.triggerHook("didInitUI")})}(jQuery,FLBuilder),function(e,t){var i=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")},hide:function(){this.$el.removeClass("is-showing")},transitionIn:function(e){requestAnimationFrame(this.show.bind(this))},transitionOut:function(e){this.hide()}}),l=FLExtendableObject.create({templateName:"fl-main-menu-panel",template:null,menu:null,views:{},viewNavigationStack:[],isShowing:!1,shouldShowTabs:!1,init:function(){this.template=wp.template(this.templateName),e("body").prepend(this.template(this)),this.$el=e(".fl-builder--main-menu-panel"),this.$el.find(".fl-builder--main-menu-panel-views").html("");for(var i in FLBuilderConfig.mainMenu){this.renderPanel(i);var l="render"+i.charAt(0).toUpperCase()+i.slice(1)+"Panel";t.addHook(l,e.proxy(function(){this.renderPanel(i)},this))}e("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=e(".fl-builder-bar-title"),e("body").on("click",".fl-builder-bar-title",this.toggle.bind(this));var n=this.hide.bind(this);t.addHook("didShowPublishActions",n),t.addHook("didBeginSearch",n),t.addHook("didBeginPreview",n),t.addHook("didShowContentPanel",n),t.addHook("endEditingSession",n),t.addHook("didFocusSearchBox",n),t.addHook("didEnterRevisionPreview",n),t.addHook("didFailSettingsSave",n),t.addHook("showKeyboardShortcuts",n),this.$mask=e(".fl-builder--main-menu-panel-mask"),this.$mask.on("click",n),o.init(),s.init()},renderPanel:function(t){var l,o,s;e('fl-builder--main-menu-panel-view[data-name="'+t+'"]').remove(),l=FLBuilderConfig.mainMenu[t],l.handle=t,o=i.create(l),o.init(),s=e(o.render()),o.$el=s,e(".fl-builder--main-menu-panel-views").append(s),o.bindEvents(),o.$el.find(".fl-builder--menu-item").on("click",this.onItemClick.bind(this)),o.isRootView&&(this.rootView=o,this.currentView=o),this.views[t]=o},show:function(){this.isShowing||(this.$el.addClass("is-showing"),this.$barTitle.addClass("is-showing-menu"),this.currentView.transitionIn(),this.isShowing=!0,this.$mask.show(),t.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(i){var l=e(i.currentTarget),o=l.data("type");switch(o){case"view":var s=l.data("view");this.goToView(s);break;case"event":var n=l.data("event");t.triggerHook(n,l);break;case"link":}},goToView:function(e){var t=this.currentView,i=this.views[e];t.transitionOut(),i.transitionIn(),this.currentView=i,this.viewNavigationStack.push(t)},goToPreviousView:function(){var t=this.currentView,i=this.viewNavigationStack.pop();t.transitionOut(!0),i.transitionIn(!0),this.currentView=i,e(".fl-builder-bar-title-caret").focus()},resetViews:function(){this.currentView!=this.rootView&&(this.currentView.hide(),this.rootView.show(),this.currentView=this.rootView,this.viewNavigationStack=[])}});t.MainMenu=l;var o={init:function(){t.addHook("saveTemplate",this.saveTemplate.bind(this)),t.addHook("saveCoreTemplate",this.saveCoreTemplate.bind(this)),t.addHook("duplicateLayout",this.duplicateLayout.bind(this)),t.addHook("showLayoutSettings",this.showLayoutSettings.bind(this)),t.addHook("showGlobalSettings",this.showGlobalSettings.bind(this)),t.addHook("toggleUISkin",this.toggleUISkin.bind(this)),t.addHook("clearLayoutCache",this.clearLayoutCache.bind(this))},saveTemplate:function(){t._saveUserTemplateClicked(),l.hide()},saveCoreTemplate:function(){FLBuilderCoreTemplatesAdmin._saveClicked(),l.hide()},duplicateLayout:function(){t._duplicateLayoutClicked(),l.hide()},showGlobalSettings:function(){t._globalSettingsClicked(),l.hide()},showLayoutSettings:function(){t._layoutSettingsClicked(),l.hide()},clearLayoutCache:function(){t.ajax({action:"clear_cache"},function(){location.href=FLBuilderConfig.editUrl}),t.showAjaxLoader(),l.hide()},toggleUISkin:function(i){e('a[data-event="toggleUISkin"]');if(e("body").hasClass("fl-builder-ui-skin--light"))var l="light",o="dark";if(e("body").hasClass("fl-builder-ui-skin--dark"))var l="dark",o="light";e("body").removeClass("fl-builder-ui-skin--"+l).addClass("fl-builder-ui-skin--"+o),t.ajax({action:"save_ui_skin",skin_name:o})}},s={init:function(){t.addHook("beginTour",this.onStartTourClicked.bind(this))},onStartTourClicked:function(){FLBuilderTour.start(),l.hide()}}}(jQuery,FLBuilder),function(e,t){var i=FLExtendableObject.create({handle:"",name:"",panel:null,shouldShowTabItem:!0,isShowing:!1,views:{},activeView:null,defaultView:null,categorySelector:null,init:function(i){this.categorySelector=a.create({handle:"selector-"+this.handle,tab:this,items:[]}),this.categorySelector.init(),e(this.categorySelector).on("categorySelected",this.onViewSelected.bind(this));i.views;if(this.initViews(i.views),0===Object.keys(this.views).length){var l={handle:"noViews",name:"No Views",templateName:"fl-content-panel-no-view"};this.addView(l)}if(!this.activeView){var o=Object.keys(this.views)[0],l=this.views[o];this.activeView=l}this.defaultView=this.activeView,e(this.panel).on("afterRender",this.renderView.bind(this,this.activeView)),e(this.panel).on("onShow onShowTab",this.initScroller.bind(this)),t.addHook("contentItemsChanged",this.onLibraryDataChanged.bind(this))},initViews:function(e){for(var t in e){var i=e[t];this.categorySelector.addItem(i),"separator"!==i.type&&this.addView(i)}},addView:function(e){var t=l;switch(this.handle){case"modules":t=o;break;case"rows":t=s;break;case"templates":t=n;break;case"saved":t=r;break;default:t=l}_.isNull(this.viewController)||_.isUndefined(this.viewController)||(t=window[this.viewController]);var i=t.create(e),a=i.handle;i.init(),this.views[a]=i,i.isShowing&&(this.activeView=i)},renderView:function(e){if(this.$el=this.panel.$el.find('.fl-builder--panel-view[data-tab="'+this.handle+'"]'),_.isObject(e))var i=e;else var i=this.views[e];if(_.isObject(i)&&_.isFunction(i.render)){var l=i.render();this.$el.find(".fl-nanoscroller-content").html(l),this.activeView=i,t._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(){e(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=this.panel.$groupSelect,t=this.panel.$el.find(".fl-builder-panel-search");if(this.isSearchEnabled?t.show():t.hide(),Object.keys(this.views).length>1&&!_.isUndefined(this.categorySelector)){var i=this.categorySelector.render();this.panel.$el.find(".fl-builder-content-group-select");e.html(i),e.show(),this.panel.$el.removeClass("single-view")}else e.hide(),t.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),e(this).on("afterRender",this.bindEvents.bind(this)),e(this).trigger("afterInit")},filterTemplateData:function(e){return _.isNull(this.query)||_.isUndefined(this.query)||(e.queryResults=t.Search.byQuery(this.query)),e},render:function(){e(this).trigger("beforeRender");var t=this;t=this.filterTemplateData(t);var i=e(this.template(t));return this.$el=i,e(this).trigger("afterRender"),i},bindEvents:function(){},transitionIn:function(){},transitionOut:function(){}}),o=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")}}),s=l.create({templateName:"fl-content-panel-row-templates-view",bindEvents:function(){this.$items=this.$el.find(".fl-builder-block, .fl-builder-blocks-section-title")}}),n=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=e(".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(t){var i=e(t.currentTarget),l=i.val(),o=i.siblings("button");""!==l?o.show():o.hide()},onSaveButtonClick:function(i){var l=e(i.currentTarget),o=l.siblings('input[name="template-name"]').val(),s=l.siblings('input[name="template-category"]').val(),n={name:o,category:s};""!==o&&t.ajax({action:"save_user_template",settings:n},t._saveUserTemplateSettingsComplete)},onTemplateClick:function(i){var l=e(i.currentTarget),o=l.data("id"),s=l.data("type");t._requestTemplateInsert(o,s)}}),r=l.create({templateName:"fl-content-panel-saved-view",filterTemplateData:function(e){return e.queryResults=t.Search.byQuery({kind:"template",type:"user",content:["module","column","row"]}),e}}),a=FLExtendableObject.create({templateName:"fl-content-panel-category-selector",template:null,tab:null,isOpen:!1,items:{},init:function(){this.template=wp.template(this.templateName),e(this).on("afterRender",this.bindEvents.bind(this)),e(this.tab.panel).on("didShowSearchControls",this.close.bind(this))},render:function(){this.close();var t=e(this.template(this));return this.$el=t,e(this).trigger("afterRender"),t},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;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(t){var i=e(t.target).data("view");e(this).trigger("categorySelected",i)}});t.ContentPanel=FLExtendableObject.create({templateName:"fl-content-panel-base",template:null,tabs:{},activeTab:null,isShowing:!1,init:function(){if(FLBuilderConfig.panelData){var e=FLBuilderConfig.panelData.tabs;for(var l in e){var o=e[l];if(n=i.create(o),n.panel=this,n.views={},n.init(o),this.tabs[l]=n,n.isShowing&&(this.activeTab=n),!this.activeTab){var s=Object.keys(this.tabs)[0],n=this.tabs[s];n.isShowing=!0,this.activeTab=n}}this.template=wp.template(this.templateName),this.render(),this.renderSearchResults=wp.template("fl-search-results-panel"),this.renderNoResults=wp.template("fl-search-no-results"),t.triggerHook("contentPanelDidInit")}},render:function(){e("body").prepend(this.template(this)),this.$el=e(".fl-builder--content-library-panel"),this.bindEvents(),this.$groupSelect=this.$el.find(".fl-builder-content-group-select"),e(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"),t.addHook("showContentPanel",this.show.bind(this)),t.addHook("showModules",this.show.bind(this,"modules")),t.addHook("showRows",this.show.bind(this,"rows")),t.addHook("showTemplates",this.show.bind(this,"templates")),t.addHook("showSaved",this.show.bind(this,"saved")),t.addHook("showSearch",this.goToSearch.bind(this));var e=this.hide.bind(this);t.addHook("hideContentPanel",e),t.addHook("didShowLightbox",e),t.addHook("didShowPublishActions",e),t.addHook("didBeginSearch",e),t.addHook("didInitDrag",e),t.addHook("didOpenMainMenu",e),t.addHook("didApplyTemplate",e);var i=this.toggleShowHide.bind(this);t.addHook("toggleContentPanel",i),t.addHook("didStopDrag",this.hideSearchControls.bind(this))},alignPanelArrow:function(){var t,i,l=this.$el,o=null,s=this.$el.find(".fl-builder--panel-arrow"),n=e(".fl-builder-content-panel-button"),r=this.$el.css("animation-duration");if(0!=n.length){this.$el.css("animation-duration","0s"),this.show(),o=l[0].getBoundingClientRect(),t=s[0].getBoundingClientRect(),this.hide(),this.$el.css("animation-duration",r),buttonOffset=n[0].getBoundingClientRect();var a=buttonOffset.x+buttonOffset.width/2;i=a<o.x?20:a-o.x-t.width/2,s.css({right:"auto",left:i+"px"})}},show:function(i){"module"===FLBuilderConfig.userTemplateType||FLBuilderConfig.simpleUi||(t.triggerHook("willShowContentPanel"),"undefined"!=typeof i&&this.showTab(i),this.isShowing||t._triggerSettingsSave(!1,!0)&&(e("body").addClass("fl-builder-content-panel-is-showing"),this.isShowing=!0,e(this).trigger("onShow"),t.triggerHook("didShowContentPanel")))},hide:function(){this.isShowing&&(this.$el.hasClass("fl-builder-ui-pinned")||(e("body").removeClass("fl-builder-content-panel-is-showing"),this.isShowing=!1,e(this).trigger("onHide"),t.triggerHook("didHideContentPanel")))},toggleShowHide:function(){this.isShowing?this.hide():this.show()},showTab:function(t){var i=this.tabs[t];_.isObject(i)&&(_.isObject(this.activeTab)&&(this.activeTab.hide(),this.$tabs.filter(".is-showing").removeClass("is-showing")),this.hideSearchControls(),i.show(),this.$tabs.filter('[data-tab="'+i.handle+'"]').addClass("is-showing"),this.activeTab=i,e(this).trigger("onShowTab"))},goToSearch:function(){this.show("modules"),this.$el.find(".fl-builder-toggle-panel-search").trigger("click")},onTabItemMouseUp:function(t){e(t.currentTarget).blur()},onTabItemClick:function(t){var i=e(t.target),l=i.data("tab");this.showTab(l)},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(),e(".fl-builder--selector-display-label").attr("tabindex",-1),this.$searchBtn.attr("tabindex",-1),e(this).trigger("didShowSearchControls")},hideSearchControls:function(){this.$search.removeClass("is-showing-input"),this.clearSearchInput(),this.hideSearchResults(),e(".fl-builder--selector-display-label").attr("tabindex",null),this.$searchBtn.attr("tabindex",null)},onSearchTermChanged:function(e){var i=this.$searchInput.val();if(""!==i){var l=t.Search.byTerm(i);""!=l.term?this.showSearchResults(l):this.hideSearchResults()}else this.hideSearchResults()},clearSearchInput:function(){this.$searchInput.val(""),this.hideSearchResults()},showSearchResults:function(i){if(i.total>0){var l=e(this.renderSearchResults(i));this.$searchPanel.html(l),t._initSortables()}else{var l=e(this.renderNoResults(i));this.$searchPanel.html(l)}e("body").addClass("fl-builder-search-results-panel-is-showing")},hideSearchResults:function(){e("body").removeClass("fl-builder-search-results-panel-is-showing")}})}(jQuery,FLBuilder),function(e){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(t,i){var l=FLBuilderSettingsConfig.forms,o=FLBuilderSettingsConfig.modules,s={type:"general",id:null,nodeId:null,className:"",attrs:"",title:"",badges:[],tabs:[],buttons:[],settings:{},legacy:null,rules:null,preview:null,helper:null};if(t.nodeId&&!t.settings)return void this.loadNodeSettings(t,i);if(t=e.extend(s,t),i=void 0===i?function(){}:i,t.id){if("general"===t.type&&void 0!==l[t.id])t=e.extend(!0,t,l[t.id]);else{if("module"!==t.type||void 0===o[t.id])return;t=e.extend(!0,t,o[t.id])}this.config=t,this.renderLightbox(t)&&(t.legacy||!this.renderLegacySettings(t,i)?this.renderComplete(t,i):this.showLightboxLoader())}},loadNodeSettings:function(e,t){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"get_node_settings",node_id:e.nodeId},function(i){e.settings=JSON.parse(i),FLBuilderSettingsConfig.nodes[e.nodeId]=e.settings,FLBuilderSettingsForms.render(e,t),FLBuilder.hideAjaxLoader()})},renderLightbox:function(t){var i=wp.template("fl-builder-settings"),l=FLBuilder._lightbox._node.find("form.fl-builder-settings");e(".fl-lightbox-wrap[data-parent]");if(t.nodeId&&t.nodeId===l.data("node")&&!t.lightbox)return FLBuilder._focusFirstSettingsControl(),!1;if(t.lightbox)t.lightbox.setContent(i(t));else{if(!FLBuilder._triggerSettingsSave(!0,!0))return!1;FLBuilder.preview&&FLBuilder.preview.cancel(),FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder._setLightboxContent(i(t))}return!0},renderComplete:function(t,i){var l=e(".fl-builder-settings:visible");setTimeout(function(){t.legacy&&this.renderLegacySettingsComplete(t.legacy),i(),FLBuilder._initSettingsForms(),t.rules&&FLBuilder._initSettingsValidation(t.rules),t.preview&&(FLBuilder.preview=new FLBuilderPreview(t.preview)),t.helper&&t.helper.init(),l.closest(".fl-lightbox-wrap[data-parent]").length||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,l))}.bind(this),1)},renderFields:function(t,i){var l=wp.template("fl-builder-settings-row"),o="",s=null,n=null,r=null,a=!1,d=null,u=["dimension","unit"],i=i?i:this.config.settings,c=FLBuilderConfig.global;for(n in t)s=t[n],a=!!s.multiple,supportsResponsive=e.inArray(s.type,u)>-1,r=_.isUndefined(i[n])?"":i[n],_.isUndefined(i[n])&&s["default"]&&(r=s["default"]),d=s.responsive&&c.responsive_enabled&&!a&&supportsResponsive?s.responsive:null,o+=l({field:s,name:n,rootName:n,value:r,preview:JSON.stringify(s.preview?s.preview:{type:"refresh"}),responsive:d,rowClass:s.row_class?" "+s.row_class:"",isMultiple:a,supportsMultiple:"editor"!==s.type&&"photo"!==s.type&&"service"!==s.type,settings:i,globalSettings:c,template:e("#tmpl-fl-builder-field-"+s.type)});return o},renderField:function(e){var t=wp.template("fl-builder-field");return t(e)},renderSectionTemplate:function(e,t){var i=wp.template(e.template.id);return i({section:e,settings:t})},renderTabTemplate:function(e,t){var i=wp.template(e.template.id);return i({tab:e,settings:t})},renderLegacySettings:function(t,i){var l=e(".fl-builder-settings:visible"),o=null,s=!1,n={tabs:[],sections:[],fields:[],settings:null,node_id:null};return l.find(".fl-legacy-field").each(function(){o=e(this),n.fields.push(o.attr("data-field")),FLBuilderSettingsForms.showFieldLoader(o),s=!0}),l.find(".fl-legacy-settings-section").each(function(){o=e(this),n.sections.push({tab:o.attr("data-tab"),section:o.attr("data-section")}),s=!0}),l.find(".fl-legacy-settings-tab").each(function(){o=e(this),n.tabs.push(o.attr("data-tab")),s=!0}),l.attr("data-node")?n.node_id=l.attr("data-node"):n.settings=FLBuilder._getOriginalSettings(l,!0),this.legacyXhr&&(this.legacyXhr.abort(),this.legacyXhr=null),this.legacyXhr=FLBuilder.ajax(e.extend(this.getLegacyVars(),{action:"render_legacy_settings",data:n,form:l.attr("data-form-id"),group:l.attr("data-form-group"),lightbox:l.closest(".fl-builder-lightbox").attr("data-instance-id")}),function(e){FLBuilderSettingsForms.renderLegacySettingsComplete(e),s&&FLBuilderSettingsForms.renderComplete(t,i),FLBuilderSettingsForms.hideLightboxLoader()}),s},renderLegacySettingsComplete:function(t){var i="object"==typeof t?t:JSON.parse(t),l=null,o=null,s="",n=null,r=null,a=null;if(i.lightbox?(l=e(".fl-builder-lightbox[data-instance-id="+i.lightbox+"]"),o=l.length?l.find(".fl-builder-settings"):null):(o=e(".fl-builder-settings:visible"),l=o.closest(".fl-builder-lightbox")),o&&o.length){for(s in i.fields)n=e("#fl-field-"+s).attr("id",""),n.after(i.fields[s]).remove();for(s in i.extras)n=e("#fl-field-"+s).find(".fl-field-control-wrapper"),n.prepend(i.extras[s].before),n.append(i.extras[s].after);for(a in i.sections)for(s in i.sections[a])r=e("#fl-builder-settings-section-"+s),r.html(i.sections[a][s]);for(s in i.tabs)a=e("#fl-builder-settings-tab-"+s),a.html(i.tabs[s]);l.data("parent")||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,o),FLBuilder.preview&&(FLBuilder.preview._savedSettings=this.settings)),_.isUndefined(window.FLThemeBuilderFieldConnections)||FLThemeBuilderFieldConnections._initSettingsForms(),this.legacyXhr=null}},getLegacyVars:function(){var t=e(".fl-builder-settings:visible"),i=t.closest(".fl-builder-lightbox"),l=i.attr("data-parent"),o=null,s=null,n={};return l&&(l=e(".fl-builder-lightbox[data-instance-id="+l+"]"),t=l.find("form.fl-builder-settings"),o=FLBuilder._getSettings(t),s=t.attr("data-node"),s&&(n.node_id=s,n.node_settings=o)),n},settingsHaveChanged:function(){var e=FLBuilder._lightbox._node.find("form.fl-builder-settings"),t=FLBuilder._getSettings(e),i=!!this.settings&&JSON.stringify(this.settings)!=JSON.stringify(t);return i},closeOnDeleteNode:function(t,i){var l=e(".fl-builder-settings[data-node]"),o=FLBuilder._contentClass+" .fl-node-"+l.data("node");l.length&&!e(o).length&&FLLightbox.closeAll()},showLightboxLoader:function(){e(".fl-builder-settings:visible").append('<div class="fl-builder-loading"></div>')},hideLightboxLoader:function(t){e(".fl-builder-settings:visible .fl-builder-loading").remove()},showFieldLoader:function(e){var t=e.closest(".fl-field-control").find(".fl-field-control-wrapper");t.hide().after('<div class="fl-field-loader">'+FLBuilderStrings.fieldLoading+"</div>")},hideFieldLoader:function(e){var t=e.closest(".fl-field"),i=e.closest(".fl-field-control").find(".fl-field-control-wrapper");i.show(),t.find(".fl-field-loader").remove()}},FLBuilderSettingsConfig="undefined"==typeof FLBuilderSettingsConfig?{}:FLBuilderSettingsConfig,e.extend(FLBuilderSettingsConfig,{init:function(){FLBuilder.addHook("didSaveNodeSettings",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveNodeSettingsComplete",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveGlobalSettingsComplete",this.updateOnSaveGlobalSettings.bind(this)),FLBuilder.addHook("didSaveLayoutSettingsComplete",this.updateOnSaveLayoutSettings.bind(this)),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("didSaveGlobalNodeTemplate",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didRestoreRevisionComplete",this.updateOnApplyTemplate.bind(this))},updateOnSaveGlobalSettings:function(e,t){this.settings.global=t},updateOnSaveLayoutSettings:function(e,t){this.settings.layout=t},updateOnNodeEvent:function(){var e=arguments[0];e.namespace.indexOf("didAdd")>-1?this.addNode(arguments[1]):e.namespace.indexOf("didSaveNodeSettings")>-1?this.updateNode(arguments[1].nodeId,arguments[1].settings):e.namespace.indexOf("didDelete")>-1?this.deleteNodes():e.namespace.indexOf("didDuplicate")>-1&&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(t,i){var l=this;i.cols.each(function(){var t=e(this),i=t.attr("data-node");l.nodes[i]&&(l.nodes[i].size=parseFloat(t[0].style.width))})},updateOnApplyTemplate:function(e,t){this.nodes=t.nodes,this.attachments=t.attachments},addNode:function(t,i){var l=e(".fl-node-"+t),o=l.hasClass("fl-row"),s=l.hasClass("fl-col"),n=l.hasClass("fl-col-group"),r=l.hasClass("fl-module"),a=this;this.nodes[t]||(i||(o?i=e.extend({},this.defaults.row):s?i=e.extend({},this.defaults.column):r&&(i=e.extend({},this.defaults.modules[l.attr("data-type")])),o||n?l.find(".fl-col").each(function(){var t=e(this),i=e.extend({},a.defaults.column);i.size=parseFloat(t[0].style.width),a.addNode(t.attr("data-node"),i)}):r&&(a.addNode(l.closest(".fl-row").attr("data-node")),a.addNode(l.closest(".fl-col").attr("data-node")),a.updateOnResetColumnWidths(null,{cols:l.closest(".fl-col-group").find("> .fl-col")}))),i&&(this.nodes[t]=i))},updateNode:function(t,i){var l=e(".fl-node-"+t),o=this;l.hasClass("fl-col")&&l.closest(".fl-col-group").find("> .fl-col").each(function(){var t=e(this),l=t.attr("data-node");o.nodes[l].size=parseFloat(t[0].style.width),o.nodes[l].equal_height=i.equal_height,o.nodes[l].content_alignment=i.content_alignment,o.nodes[l].responsive_order=i.responsive_order}),this.nodes[t]=i},duplicateNode:function(t,i){var l=e(".fl-node-"+i),o=l.find("[data-node]"),s=e(".fl-node-"+t),n=s.find("[data-node]"),r=this;this.nodes[i]=this.nodes[t],o.each(function(l){t=n.eq(l).attr("data-node"),i=e(this).attr("data-node"),r.nodes[t]&&(r.nodes[i]=r.nodes[t])})},deleteNodes:function(){var t="",i=e(FLBuilder._contentClass).html();for(t in this.nodes)i.indexOf(t)===-1&&(this.nodes[t]=null,delete this.nodes[t])}}),e(function(){FLBuilderSettingsConfig.init(),FLBuilderSettingsForms.init()})}(jQuery),function(e){var t={init:function(){this.initPanel(),this.pinOrUnpin(),this.bind()},bind:function(){var t=e(window),i=e("body");t.on("resize",_.throttle(this.windowResize.bind(this),250)),i.delegate(".fl-builder-ui-pinned-collapse","click",this.collapse),i.delegate(".fl-builder--content-library-panel .fl-builder--tabs","click",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 e(".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 t=e(".fl-builder--content-library-panel"),i=this.isPinned();t.hasClass("fl-builder-ui-pinned-hidden")||(window.innerWidth<=500?(i&&this.unpin(!1),
|
9 |
+
this.disableDragAndResize()):(i||this.restorePosition(),this.enableDragAndResize()))},show:function(){var t=e(".fl-builder--content-library-panel");t.hasClass("fl-builder-ui-pinned-hidden")&&(t.removeClass("fl-builder-ui-pinned-hidden"),t.show(),this.restorePosition())},hide:function(){var t=e("body"),i=e(".fl-builder--content-library-panel");this.isPinned()&&(this.uncollapse(),i.addClass("fl-builder-ui-pinned-hidden"),i.hide(),t.css("margin",""),FLBuilder._resizeLayout())},collapse:function(){var t=e(this).find("i:visible"),i=e("body"),l=t.data("toggle"),o=t.data("position"),s=e(".fl-builder--content-library-panel"),n=s.outerWidth();"hide"===l?(s.css(o,"-"+n+"px"),i.css("margin-"+o,""),i.addClass("fl-builder-ui-pinned-is-collapsed")):(s.css(o,"0px"),i.css("margin-"+o,n+"px"),i.removeClass("fl-builder-ui-pinned-is-collapsed"))},uncollapse:function(){this.isCollapsed()&&e(".fl-builder-ui-pinned-collapse:visible").trigger("click")},isCollapsed:function(){return e("body").hasClass("fl-builder-ui-pinned-is-collapsed")},initPanel:function(){var t=e(".fl-builder--content-library-panel");t.draggable({cursor:"move",handle:".fl-builder--tabs",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:400,minWidth:380,maxWidth:500,start:this.resizeStart.bind(this),stop:this.resizeStop.bind(this)}),t.addClass("fl-builder-ui-pinned-container"),t.find(".ui-resizable-e, .ui-resizable-w").hide()},pinPanel:function(t){var i=e(".fl-builder--content-library-panel"),l=i.outerWidth(),o=e("body"),s=e(".fl-responsive-preview, .fl-responsive-preview-mask"),n=e(FLBuilder._contentClass).parentsUntil("body").last();o.addClass("fl-builder-ui-is-pinned fl-builder-ui-is-pinned-"+t),o.addClass("fl-builder-content-panel-is-showing"),o.css("margin-"+t,l+"px"),s.css("margin-"+t,l+"px"),n.addClass("fl-builder-ui-pinned-content-transform"),i.addClass("fl-builder-ui-pinned fl-builder-ui-pinned-"+t),i.find(".ui-resizable-"+("left"===t?"e":"w")).show(),i.on("resize",_.throttle(this.resize.bind(this),250)),i.attr("style",""),FLBuilder.ContentPanel.isShowing=!0},unpinPanel:function(){var t=e(".fl-builder--content-library-panel"),i=t.find(".fl-builder--panel-content .is-showing").data("tab"),l=e("body"),o=e(".fl-responsive-preview, .fl-responsive-preview-mask"),s=e(FLBuilder._contentClass).parentsUntil("body").last();l.css("margin-left",""),l.css("margin-right",""),l.removeClass("fl-builder-ui-is-pinned"),l.removeClass("fl-builder-ui-is-pinned-left"),l.removeClass("fl-builder-ui-is-pinned-right"),o.css("margin-left",""),o.css("margin-right",""),s.removeClass("fl-lightbox-content-transform"),t.removeClass("fl-builder-ui-pinned"),t.removeClass("fl-builder-ui-pinned-left"),t.removeClass("fl-builder-ui-pinned-right"),t.find(".ui-resizable-handle").hide(),t.off("resize"),t.attr("style",""),t.find(".fl-builder--tabs [data-tab="+i+"]").addClass("is-showing")},pinLightboxes:function(){var t=this;e(".fl-lightbox-resizable").each(function(){t.pinLightbox(e(this))}),FLBuilder._reinitEditorFields()},pinLightbox:function(t){var i=e(".fl-builder--content-library-panel"),l=t.closest(".fl-lightbox-wrap");l.closest(".fl-builder-ui-pinned").length||(i.append(l),t.attr("style",""),t.draggable("disable"),t.resizable("disable")),t.is(":visible")&&i.find(".fl-builder--tabs .is-showing").removeClass("is-showing")},pinLightboxOnOpen:function(e,t){var i=t._node.find(".fl-lightbox-resizable");i.length&&(i.hasClass("fl-builder-ui-pinning-initialized")||(i.draggable("option","start",this.dragStart.bind(this)),i.draggable("option","drag",this.drag.bind(this)),i.draggable("option","stop",this.dragStop.bind(this)),i.addClass("fl-builder-ui-pinning-initialized")),this.isPinned()&&this.pinLightbox(i),FLBuilder.addHook("responsive-editing-switched",this.resize))},pinnedLightboxClosed:function(){var t=e(".fl-builder--content-library-panel");tab=null,this.isPinned()&&(tab=t.find(".fl-builder--panel-content .is-showing").data("tab"),t.find(".fl-builder--tabs [data-tab="+tab+"]").addClass("is-showing")),e(".fl-lightbox").removeClass("fl-lightbox-prevent-animation")},unpinLightboxes:function(){var t=e("body"),i=e(".fl-builder--content-library-panel");i.find(".fl-lightbox-wrap").each(function(){var l=e(this),o=l.find(".fl-lightbox"),s=0,n=0,r=0;o.draggable("enable"),o.resizable("enable"),o.find(".ui-resizable-handle").show(),t.append(l),o.is(":visible")?(s=parseInt(i.css("top"))-parseInt(l.css("top"))-parseInt(l.css("padding-top")),n=parseInt(i.css("left"))-parseInt(l.css("padding-left")),r=parseInt(i.css("right"))-parseInt(l.css("padding-right")),o.css("top",(s<0?0:s)+"px"),o.css(FLBuilderConfig.isRtl?"right":"left",(FLBuilderConfig.isRtl?r:n)+"px"),o.addClass("fl-lightbox-prevent-animation"),t.removeClass("fl-builder-content-panel-is-showing"),FLBuilder.ContentPanel.isShowing=!1):o.css({top:"25px",left:"25px"})}),FLBuilder._reinitEditorFields()},closeLightboxOnPanelClick:function(){FLBuilder._triggerSettingsSave(!1,!0)},windowResize:function(){this.pinOrUnpin()},resizeStart:function(){e("body").addClass("fl-builder-resizable-is-resizing"),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()},resize:function(){var t=e("body"),i=e(".fl-responsive-preview, .fl-responsive-preview-mask"),l=e(".fl-builder--content-library-panel"),o=l.outerWidth();l.hasClass("fl-builder-ui-pinned-left")?(t.css("margin-left",o+"px"),i.css("margin-left",o+"px")):l.hasClass("fl-builder-ui-pinned-right")&&(t.css("margin-right",o+"px"),i.css("margin-right",o+"px"))},resizeStop:function(){e("body").removeClass("fl-builder-resizable-is-resizing"),FLBuilder._bindOverlayEvents(),FLBuilder._resizeLayout(),this.savePosition()},dragStart:function(t,i){var l=e("body"),o=(e(t.target),e(".fl-builder-bar-actions"));e(".fl-lightbox-resizable:visible").length||o.addClass("fl-builder-content-panel-pin-zone"),l.addClass("fl-builder-draggable-is-dragging"),l.append('<div class="fl-builder-ui-pin-zone fl-builder-ui-pin-zone-left"></div>'),l.append('<div class="fl-builder-ui-pin-zone fl-builder-ui-pin-zone-right"></div>'),FLBuilder._destroyOverlayEvents()},drag:function(t,i){var l=e("body"),o=e(".fl-responsive-preview"),s=e(window),n=o.length?o.width():s.width(),r=s.scrollTop(),a=e(".fl-builder--content-library-panel"),d=a.offset().top,u=e(".fl-builder-bar-actions"),c=e(t.target);c.hasClass("fl-builder--content-library-panel")&&(t.clientX<n-75&&d-r<46?u.addClass("fl-builder-content-panel-pin-zone-hover"):u.removeClass("fl-builder-content-panel-pin-zone-hover")),c.hasClass("fl-builder-ui-pinned")?this.unpinPanel():t.clientX<75?l.addClass("fl-builder-ui-show-pin-zone fl-builder-ui-show-pin-zone-left"):t.clientX>n-75?l.addClass("fl-builder-ui-show-pin-zone fl-builder-ui-show-pin-zone-right"):(l.removeClass("fl-builder-ui-show-pin-zone"),l.removeClass("fl-builder-ui-show-pin-zone-left"),l.removeClass("fl-builder-ui-show-pin-zone-right"))},dragStop:function(t,i){var l=(e(window),e("body")),o=e(".fl-builder-bar-actions"),s=e(".fl-builder-ui-pin-zone"),n=e(".fl-builder--content-library-panel"),r=e(".fl-lightbox-resizable:visible");e(t.target);l.removeClass("fl-builder-draggable-is-dragging"),o.removeClass("fl-builder-content-panel-pin-zone"),o.removeClass("fl-builder-content-panel-pin-zone-hover"),s.remove(),r.length&&parseInt(r.css("top"))<0&&r.css("top","0"),l.hasClass("fl-builder-ui-show-pin-zone")?(l.hasClass("fl-builder-ui-show-pin-zone-left")?this.pin("left",!0):this.pin("right",!0),l.removeClass("fl-builder-ui-show-pin-zone"),l.removeClass("fl-builder-ui-show-pin-zone-left"),l.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 t=e(".fl-builder--content-library-panel"),i=e(".fl-lightbox-resizable");t.draggable("disable"),t.resizable("disable"),i.draggable("disable"),i.resizable("disable")},enableDragAndResize:function(){var t=e(".fl-builder--content-library-panel"),i=e(".fl-lightbox-resizable:not(.fl-lightbox-width-full)");t.draggable("enable"),t.resizable("enable"),this.isPinned()||(i.draggable("enable"),i.resizable("enable"))},savePosition:function(){var t=e(".fl-builder--content-library-panel"),i=e(".fl-lightbox-resizable:visible"),l={pinned:{width:t.outerWidth(),position:null}};t.hasClass("fl-builder-ui-pinned-left")?l.pinned.position="left":t.hasClass("fl-builder-ui-pinned-right")?l.pinned.position="right":i.length&&(l.lightbox={width:i.width(),height:i.height(),top:parseInt(i.css("top"))<0?"0px":i.css("top"),left:i.css("left")}),FLBuilderConfig.userSettings.pinned=l.pinned,l.lightbox&&(FLBuilderConfig.userSettings.lightbox=l.lightbox),FLBuilder.ajax({action:"save_pinned_ui_position",data:l})},restorePosition:function(){var t=e(".fl-builder--content-library-panel"),i=FLBuilderConfig.userSettings.pinned;i&&i.position&&(t.css("width",i.width+"px"),this.pin(i.position,!1),t.css("width",i.width+"px"))}};e(function(){t.init()})}(jQuery),function(e){var t={init:function(){this.setupMainMenuData(),e(".fl-builder--revision-actions select").on("change",this.selectChanged),e(".fl-cancel-revision-preview").on("click",this.exitPreview.bind(this)),e(".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 t=FLBuilderConfig.revisions.posts,i=FLBuilderConfig.revisions.authors,l=wp.template("fl-revision-list-item"),o=e(".fl-builder--revision-actions select"),s="",n="",r=0;if(FLBuilderConfig.mainMenu.revisions.items=[],o.html(""),0===t.length)FLBuilderConfig.mainMenu.revisions.items.push({eventName:"noRevisionsMessage",type:"event",label:wp.template("fl-no-revisions-message")()});else for(;r<t.length;r++)s=FLBuilderStrings.revisionDate.replace("%s",t[r].date.diff),s+=" ("+t[r].date.published+")",n=FLBuilderStrings.revisionAuthor.replace("%s",i[t[r].author].name),FLBuilderConfig.mainMenu.revisions.items.push({eventName:"revisionItemClicked",type:"event",label:l({id:t[r].id,date:s,author:n,avatar:i[t[r].author].avatar})}),o.append('<option value="'+t[r].id+'">'+s+"</option>");FLBuilder.triggerHook("renderRevisionsPanel")},refreshItems:function(){FLBuilder.ajax({action:"refresh_revision_items"},this.refreshItemsComplete.bind(this))},refreshItemsComplete:function(e){FLBuilderConfig.revisions=JSON.parse(e),this.setupMainMenuData()},itemClicked:function(t,i){var l=e(i).find(".fl-revision-list-item").attr("data-revision-id");FLBuilder._triggerSettingsSave(!1,!0)&&(e(".fl-builder--revision-actions select").val(l),this.preview(l))},selectChanged:function(i){t.preview(e(this).val())},applyClicked:function(i){var l=e(".fl-builder--revision-actions select").val();t.restore(l)},preview:function(t){e(".fl-builder--revision-actions").css("display","flex"),FLBuilder.triggerHook("didEnterRevisionPreview"),FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"render_revision_preview",revision_id:t},this.previewRenderComplete.bind(this))},previewRenderComplete:function(e){FLBuilder._renderLayout(e,function(){FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()})},exitPreview:function(){e(".fl-builder--revision-actions").hide(),FLBuilder.triggerHook("didExitRevisionPreview"),FLBuilder._bindOverlayEvents(),FLBuilder._updateLayout()},restore:function(i){e(".fl-builder--revision-actions").hide(),FLBuilder.triggerHook("didExitRevisionPreview"),FLBuilder.showAjaxLoader(),FLBuilder._bindOverlayEvents(),FLBuilder.ajax({action:"restore_revision",revision_id:i},t.restoreComplete)},restoreComplete:function(e){var t=JSON.parse(e);FLBuilder._renderLayout(t.layout),FLBuilder.triggerHook("didRestoreRevisionComplete",t.config)}};e(function(){t.init()})}(jQuery),function(e){var t={query:function(e){var t={},i=null,l={library:{}},o=null;if(e=this.normalizeQuery(e),_.isNull(e.kind))t=FLBuilderConfig.contentItems;else for(var s in e.kind)i=e.kind[s],t[i]=FLBuilderConfig.contentItems[i];return o=this.findMatches(e,t),l.library=this.formatResults(o,e),l},normalizeQuery:function(e){var t={kind:null,type:null,category:null,group:null,enabled:!0,global:null,searchTerm:null,categorized:!1};return e=_.extend(t,e),_.isString(e.kind)&&(e.kind=[e.kind]),e},findMatches:function(e,t){var i={},l=null,o=null,s=null,n=null,r=null,a=null;for(l in t){o=t[l],i[l]={items:[]};for(a in o)if(s=o[a],_.isUndefined(e.category)||_.isNull(e.category)||this.matchesCategory(s.category,e.category)){switch(l){case"template":if(!(_.isUndefined(e.content)||_.isNull(e.content)||(n=_.contains(e.content,s.content),r=e.content===s.content,n||r)))continue;if(!_.isUndefined(e.type)&&!_.isNull(e.type)&&e.type!==s.type)continue;if(!_.isNull(e.group)){var d=e.group,u=s.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];_.contains(u,h)&&(c=!0)}if(!c)continue}break;case"module":if(!_.isNull(e.group)){if(e.group===!1&&s.group.length>0)continue;if(e.group!==!1&&!_.contains(s.group,e.group))continue}}(_.isUndefined(e.searchTerm)||_.isNull(e.searchTerm)||this.matchesSearchTerm(s,e.searchTerm))&&i[l].items.push(s)}}return i},matchesCategory:function(e,t){var i,l,o,s,n,r;if(e===t)return!0;_.isString(t)&&(t=[t]);for(l in t){if(i=t[l],_.isString(e)&&e===i)return!0;if(_.isArray(e))for(o in e)if(s=e[o],s===i)return!0;if(_.isObject(e))for(n in e)if(r=e[n],r===i||n===i)return!0}return!1},matchesSearchTerm:function(e,t){var i,l,o=t.toLowerCase();return!(_.isUndefined(e.slug)||!e.slug.toLowerCase().includes(o))||(!(_.isUndefined(e.name)||!e.name.toLowerCase().includes(o))||(!(!_.isString(e.category)||!e.category.toLowerCase().includes(o))||(!(_.isUndefined(e.description)||!e.description.toLowerCase().includes(o))||(!(_.isUndefined(e.id_base)||!e.id_base.includes(t))||(!(!e.isWidget||(i="widget",!i.includes(o)))||!(_.isUndefined(e.editor_export)||(l="module",!l.includes(o))))))))},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,t){var i,l,o={};return _.forEach(e,function(e,s,n){i=e[t],_.isNull(i)||_.isUndefined(i)||_.isString(i)&&""===e[i]||(_.isString(i)&&(o[i]=o[i]||[],o[i].push(e)),_.isArray(i)&&(l=i,_.forEach(l,function(t,i,l){o[t]=o[t]||[],o[t].push(e)})),_.isObject(i)&&(l=i,_.forEach(l,function(t,i,l){o[t]=o[t]||[],o[t].push(e)})))}),o},search:function(e){var t={searchTerm:e},i=this.query(t),l={total:0,term:e,sections:{}};if(!_.isUndefined(i.library.module.items)){var o={};for(var s in i.library.module.items){var n=i.library.module.items[s],r=n.group[0],a=n.category;n.name;_.isUndefined(o[r])&&(o[r]={}),_.isUndefined(o[r][a])&&(o[r][a]=[]),o[r][a].push(n)}l.grouped=o}for(var s in i.library){var d=i.library[s];!_.isUndefined(d.items)&&d.items.length>0&&(l.sections[s]={name:FLBuilderStrings.typeLabels[s],handle:s,type:"",items:d.items},l.total+=d.items.length)}return l}};FLBuilder.Search={byQuery:function(e){return t.query(e)},byTerm:function(e){var i=t.search(e);return i}}}(jQuery),function(e,t){var i={layoutNeedsPublish:!1,defaultIndicatorMessage:"",defaultTooltipMessage:"",messages:null,init:function(){this.messages=FLBuilderStrings.savedStatus,this.$savingIndicator=e(".fl-builder--saving-indicator"),t.addHook("didBeginAJAX",this.onLayoutSaving.bind(this)),t.addHook("didCompleteAJAX",this.onLayoutSaved.bind(this)),t.addHook("didPublishLayout",this.onLayoutPublished.bind(this)),t.addHook("publishAndRemain",this.onPublishAndRemain.bind(this)),t.addHook("didShowLightbox",this.setLayoutNeedsPublish.bind(this)),!FLBuilderConfig.layoutHasDraftedChanges&&FLBuilderConfig.builderEnabledd||(this.setLayoutNeedsPublish(),this.resetStatusMessage())},setLayoutNeedsPublish:function(){this.layoutNeedsPublish||(this.layoutNeedsPublish=!0,e("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)))))},onLayoutSaved:function(e,t){if(this.isUpdatingLayout(t.fl_builder_data.action)){this.showStatusMessage(this.messages.saved,this.messages.savedTooltip);var i=this;setTimeout(function(){i.resetStatusMessage()},2e3)}},onLayoutPublished:function(){this.layoutNeedsPublish=!1,e("body").removeClass("fl-builder--layout-has-drafted-changes"),this.resetStatusMessage()},showStatusMessage:function(t,i){this.$savingIndicator.html(t),_.isUndefined(i)||(this.$savingIndicator.attr("title",i),e(".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(){if(this.layoutNeedsPublish)t._publishLayout(!1);else{this.showStatusMessage(this.messages.noChanges);var e=this;setTimeout(function(){e.resetStatusMessage()},2e3)}}};t.SaveManager={layoutNeedsPublish:function(){return i.layoutNeedsPublish},showStatusMessage:function(e,t){i.showStatusMessage(e,t)},resetStatusMessage:function(){i.resetStatusMessage()}},e(function(){i.init()})}(jQuery,FLBuilder);
|
js/fl-color-picker.js
CHANGED
@@ -724,7 +724,7 @@ var FLBuilderColorPicker;
|
|
724 |
my: 'left top',
|
725 |
at: 'left bottom',
|
726 |
of: $this,
|
727 |
-
collision: '
|
728 |
using: function( position, feedback ){
|
729 |
self._togglePicker( position );
|
730 |
}
|
724 |
my: 'left top',
|
725 |
at: 'left bottom',
|
726 |
of: $this,
|
727 |
+
collision: 'flip',
|
728 |
using: function( position, feedback ){
|
729 |
self._togglePicker( position );
|
730 |
}
|
js/fl-lightbox.js
CHANGED
@@ -192,7 +192,7 @@
|
|
192 |
isPinned = ( lightbox.closest( '.fl-builder-ui-pinned' ).length ),
|
193 |
settings = this._getPositionSettings();
|
194 |
|
195 |
-
if ( ! isPinned && settings ) {
|
196 |
lightbox.css( settings );
|
197 |
}
|
198 |
|
192 |
isPinned = ( lightbox.closest( '.fl-builder-ui-pinned' ).length ),
|
193 |
settings = this._getPositionSettings();
|
194 |
|
195 |
+
if ( ! isPinned && settings && this._defaults.resizable ) {
|
196 |
lightbox.css( settings );
|
197 |
}
|
198 |
|
languages/en_GB.mo
CHANGED
Binary file
|
languages/fi.mo
CHANGED
Binary file
|
languages/fr_CA.mo
CHANGED
Binary file
|
languages/fr_FR.mo
CHANGED
Binary file
|
languages/it_IT.mo
CHANGED
Binary file
|
languages/nb_NO.mo
CHANGED
Binary file
|
languages/nl_NL.mo
CHANGED
Binary file
|
languages/pl_PL.mo
CHANGED
Binary file
|
languages/pt_BR.mo
CHANGED
Binary file
|
languages/pt_PT.mo
CHANGED
Binary file
|
languages/sk_SK.mo
CHANGED
Binary file
|
languages/sl_SI.mo
CHANGED
Binary file
|
languages/sv_SE.mo
CHANGED
Binary file
|