Formidable Forms – Form Builder for WordPress - Version 2.02.11

Version Description

  • New: Added frm_create_default_email_action hook to prevent default email action creation.
  • New: Added frm_inline_submit CSS Layout Class.
  • Improved: Include IP for checking comment blacklist.
  • Improved: Load minified themepicker js and placeholder js when possible.
  • Improved: Better spam checking with Akismet.
  • Improved: Update placeholder JS for old browsers to v2.3.1.
  • Fixed: Dont force fields created by a add-on to a text field when Pro is not installed.
  • Fixed: Style success message text color now applies to nested paragraph tags.
  • Fixed: Prevent PHP warning messages some sites are seeing during cache key retrieval.
  • Fixed: -1 offset in frm_scroll_offset hook now stops auto-scrolling.
  • Fixed: Invalid Portuguese translation for field is invalid message.
  • Fixed: A few HTML errors on form Settings page are resolved.
  • Fixed: Set default margin on checkbox and radio divs. This resolves conflicts with Bootstrap styling and frm_two_col and frm_three_col classes.
  • Fixed: If same form is published multiple times on the same page, make sure success message shows with the right occurrence of the form. Auto-scroll to the correct form as well.
  • Pro Version *
  • New: Add time_ago=2 and time_ago=3 to created_at shortcode options. The number used here will determine how many time levels are shown, e.g. time_ago=1 will show 2 years, time_ago=2 will show 2 years 3 months, time_ago=3 will show "2 years 3 months 15 days.
  • New: Allow time comparisons with NOW, e.g. [if x less_than="NOW"]Show this content[/if x]
  • New: Added author_link parameter to userID shortcode options. [25 show=author_link] will include a link to the WordPress author page.
  • New: Added frm_allow_date_mismatch hook to improve validation for certain date formats. This may be needed if you are using a custom format in your date fields that include non-English text.
  • New: Added greater than or equal to and less than or equal to filter to stats and graphs.
  • Improved: Added comma between values in text calculation when multiple values come from the same field.
  • Improved: RTL indented sub-category styling for checkboxes and radio buttons.
  • Improved: Include the hidden Dropzone field inside the form instead of in the footer.
  • Improved: Remove entry div from the page after fadeout when deleting an entry.
  • Improved: Order post type dropdown in Create Post action by post key.
  • Improved: Allow repeating fields to be selected in a field's Lookup population options.
  • Improved: Repeating entry keys are now randomly generated.
  • Improved: Allow dynamic default value shortcodes in calculation box.
  • Fixed: Do not filter shortcodes submitted in entry when editing the entry. Process external shortcodes before replacing [input].
  • Fixed: The default value is now set correctly in dependent Lookup radio and checkbox fields.
  • Fixed: Style font now applies to section headings.
  • Fixed: Unnecessary urlencode removed from $_GET variable. Allows searching with + symbol in query string now.
  • Fixed: Endless loop prevented when new child form is given same ID as parent from XML.
  • Fixed: Allow updating of read-only dropdown in back-end Entries.
  • Fixed: Lookup field options wouldn't update while dropdown was open in Chrome on Windows. Dropdown is now disabled until options are completely loaded.
  • Fixed: Ensure that autocomplete text shows in dropdown when theme styling is overridden in Style.
  • Fixed: UserID field now autopopulates correctly when creating an entry in the WordPress dashboard.
  • Fixed: Errors on entries page when file didn't exist.
  • Fixed: The include_zero parameter in graphs caused errors with certain WordPress date formats. This now works with any date format.
  • Fixed: Using "hours" in a Creation Date View filter would result in erroneous results.
  • Fixed: Data was duplicated in the frm_item_metas and post meta or taxonomies table. It is now only present in the post meta or taxonomies table.
  • Fixed: Do not force html=1 on file upload field in frm-field-value shortcode.
  • Fixed: Prevent errors when a hidden field or text field is used for post status.
Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 2.02.11
Comparing to
See all releases

Code changes from version 2.02.10 to 2.02.11

Files changed (42) hide show
  1. classes/controllers/FrmAddonsController.php +150 -66
  2. classes/controllers/FrmFieldsController.php +5 -5
  3. classes/controllers/FrmFormsController.php +20 -5
  4. classes/controllers/FrmStylesController.php +2 -1
  5. classes/helpers/FrmAppHelper.php +5 -5
  6. classes/helpers/FrmCSVExportHelper.php +1 -1
  7. classes/helpers/FrmEntriesHelper.php +1 -1
  8. classes/helpers/FrmFieldsHelper.php +22 -12
  9. classes/helpers/FrmFormsHelper.php +7 -0
  10. classes/models/FrmAddon.php +6 -11
  11. classes/models/FrmEntryValidate.php +92 -63
  12. classes/models/FrmField.php +1 -1
  13. classes/views/addons/list.php +14 -27
  14. classes/views/frm-entries/errors.php +1 -1
  15. classes/views/frm-fields/front-end/dropdown-field.php +1 -1
  16. classes/views/frm-form-actions/_email_settings.php +6 -6
  17. classes/views/frm-forms/settings.php +1 -3
  18. css/_single_theme.css.php +32 -1
  19. css/custom_theme.css.php +19 -1
  20. css/font_icons.css +2 -1
  21. css/frm_admin.css +38 -2
  22. formidable.php +1 -1
  23. js/formidable.js +79 -11
  24. js/formidable.min.js +91 -90
  25. js/formidable_admin.js +27 -12
  26. js/jquery/jquery-ui-themepicker.min.js +1 -0
  27. js/jquery/jquery.placeholder.js +0 -183
  28. js/jquery/jquery.placeholder.min.js +5 -0
  29. languages/formidable-az_AZ.mo +0 -0
  30. languages/formidable-az_AZ.po +589 -581
  31. languages/formidable-de_DE.mo +0 -0
  32. languages/formidable-de_DE.po +594 -586
  33. languages/formidable-es_ES.mo +0 -0
  34. languages/formidable-es_ES.po +588 -580
  35. languages/formidable-fa_IR.mo +0 -0
  36. languages/formidable-fr_FR.mo +0 -0
  37. languages/formidable-hu_HU.mo +0 -0
  38. languages/{formidable-fa_IR.po → formidable-hu_HU.po} +980 -974
  39. languages/formidable-it_IT.mo +0 -0
  40. languages/{formidable-fr_FR.po → formidable-it_IT.po} +3326 -3443
  41. languages/formidable-ja_JP.mo +0 -0
  42. languages/formidable-ja_JP.po +356 -345
classes/controllers/FrmAddonsController.php CHANGED
@@ -13,53 +13,12 @@ class FrmAddonsController {
13
  public static function list_addons() {
14
  $installed_addons = apply_filters( 'frm_installed_addons', array() );
15
 
16
- $pro_link = 'https://formidablepro.com/pricing';
17
- $addons = self::get_ordered_addons( $pro_link );
18
-
19
- $plugin_names = array(
20
- 'formidable-pro' => 'formidable/pro',
21
- 'wp-multilingual' => 'formidable-wpml',
22
- 'registration-lite' => 'formidable-registration',
23
- 'bootstrap-modal' => 'formidable-modal',
24
- 'paypal-standard' => 'formidable-paypal',
25
- 'formidable-api' => 'formidable-api',
26
- 'authorize-net-aim' => 'formidable-authorize-net',
27
- );
28
-
29
- include( FrmAppHelper::plugin_path() . '/classes/views/addons/list.php' );
30
- }
31
-
32
- private static function get_ordered_addons( $pro_link = 'https://formidablepro.com/pricing' ) {
33
  $addons = self::get_api_addons();
34
- if ( ! is_array( $addons ) ) {
35
- $addons = array(
36
- 'info' => array( 'link' => $pro_link, 'name' => 'Formidable Pro', 'slug' => 'formidable_pro' ),
37
- );
38
- } else {
39
- $addons = $addons['products'];
40
- }
41
- $addons = array_reverse( $addons );
42
 
43
- $keyed_addons = array();
44
- foreach ( $addons as $addon ) {
45
- $keyed_addons[ $addon['info']['slug'] ] = $addon;
46
- }
47
 
48
- $plugin_order = array(
49
- 'formidable-pro', 'mailchimp', 'registration-lite',
50
- 'paypal-standard', 'stripe', 'authorize-net-aim',
51
- 'bootstrap-modal', 'math-captcha',
52
- 'zapier',
53
- );
54
- $ordered_addons = array();
55
- foreach ( $plugin_order as $plugin ) {
56
- if ( isset( $keyed_addons[ $plugin ] ) ) {
57
- $ordered_addons[] = $keyed_addons[ $plugin ];
58
- unset( $keyed_addons[ $plugin ] );
59
- }
60
- }
61
- $addons = $ordered_addons + $keyed_addons;
62
- return $addons;
63
  }
64
 
65
  public static function license_settings() {
@@ -73,20 +32,151 @@ class FrmAddonsController {
73
  }
74
 
75
  private static function get_api_addons() {
76
- $addons = get_transient( 'frm_api_addons' );
77
- if ( $addons !== false ) {
78
- return $addons;
79
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
- $url = 'https://formidablepro.com/edd-api/products?number=40';
 
82
 
83
- // check every 5 days
84
- $addons = self::send_api_request( $url, array( 'name' => 'frm_api_addons', 'expires' => 60 * 60 * 24 * 5 ) );
85
- if ( is_array( $addons ) ) {
86
- return $addons;
87
  }
88
 
89
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
 
92
  public static function get_licenses() {
@@ -130,25 +220,19 @@ class FrmAddonsController {
130
  }
131
 
132
  public static function upgrade_to_pro() {
133
- $addons = self::get_ordered_addons();
134
- $pro_pricing = array();
135
- self::prepare_pro_info( $addons[0], $pro_pricing );
136
 
137
  include( FrmAppHelper::plugin_path() . '/classes/views/addons/upgrade_to_pro.php' );
138
  }
139
 
140
- private static function prepare_pro_info( $pro, &$pro_pricing ) {
141
  $pro_pricing = array(
142
- 'personal' => array( 'id' => 5, 'price' => '49.00', 'name' => 'Personal' ),
143
- 'professional' => array( 'id' => 6, 'price' => '99.00', 'name' => 'Professional' ),
144
  'smallbusiness' => array( 'id' => 3, 'price' => '199.00', 'name' => 'Small Business' ),
145
- 'enterprise' => array( 'id' => 4, 'price' => '399.00', 'name' => 'Enterprise' ),
146
  );
147
 
148
- foreach ( $pro['pricing'] as $name => $price ) {
149
- if ( isset( $pro_pricing[ $name ] ) ) {
150
- $pro_pricing[ $name ]['price'] = $price;
151
- }
152
- }
153
  }
154
  }
13
  public static function list_addons() {
14
  $installed_addons = apply_filters( 'frm_installed_addons', array() );
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  $addons = self::get_api_addons();
17
+ self::prepare_addons( $addons );
 
 
 
 
 
 
 
18
 
19
+ $site_url = 'https://formidablepro.com/';
 
 
 
20
 
21
+ include( FrmAppHelper::plugin_path() . '/classes/views/addons/list.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
 
24
  public static function license_settings() {
32
  }
33
 
34
  private static function get_api_addons() {
35
+ $addons = array(
36
+ 'formidable-pro' => array(
37
+ 'title' => 'Formidable Pro',
38
+ 'link' => 'pricing/',
39
+ 'docs' => '',
40
+ 'file' => 'formidable/pro',
41
+ 'excerpt' => 'Enhance your basic Formidable forms with a plethora of Pro field types and features. Create advanced forms and data-driven applications in minutes.',
42
+ ),
43
+ 'mailchimp' => array(
44
+ 'title' => 'MailChimp',
45
+ 'excerpt' => 'Get on the path to more sales and leads in a matter of minutes. Add leads to a MailChimp mailing list when they submit forms and update their information along with the entry.',
46
+ ),
47
+ 'registration' => array(
48
+ 'title' => 'User Registration',
49
+ 'link' => 'downloads/user-registration/',
50
+ 'excerpt' => 'Give new users access to your site as quickly and painlessly as possible. Allow users to register, edit and be able to login to their profiles on your site from the front end in a clean, customized registration form.',
51
+ ),
52
+ 'paypal' => array(
53
+ 'title' => 'PayPal Standard',
54
+ 'link' => 'downloads/paypal-standard/',
55
+ 'excerpt' => 'Automate your business by collecting instant payments from your clients. Collect information, calculate a total, and send them on to PayPal. Require a payment before publishing content on your site.',
56
+ ),
57
+ 'stripe' => array(
58
+ 'title' => 'Stripe',
59
+ 'docs' => 'stripe/',
60
+ 'excerpt' => 'Any Formidable forms on your site can accept credit card payments without users ever leaving your site.',
61
+ ),
62
+ 'authorize-net' => array(
63
+ 'title' => 'Authorize.net AIM',
64
+ 'link' => 'downloads/authorize-net-aim/',
65
+ 'docs' => 'authorize-net-aim/',
66
+ 'excerpt' => 'Accept one-time payments directly on your site, using Authorize.net AIM.',
67
+ ),
68
+ 'woocommerce' => array(
69
+ 'title' => 'WooCommerce',
70
+ 'excerpt' => 'Use a Formidable form on your WooCommerce product pages.',
71
+ ),
72
+ 'autoresponder' => array(
73
+ 'title' => 'Form Action Automation',
74
+ 'docs' => 'formidable-autoresponder/',
75
+ 'excerpt' => 'Schedule email notifications, SMS messages, and API actions.',
76
+ ),
77
+ 'modal' => array(
78
+ 'title' => 'Bootstrap Modal',
79
+ 'link' => 'downloads/bootstrap-modal/',
80
+ 'docs' => 'bootstrap-modal/',
81
+ 'excerpt' => 'Open a view or form in a Bootstrap popup.',
82
+ ),
83
+ 'bootstrap' => array(
84
+ 'title' => 'Bootstrap',
85
+ 'excerpt' => 'Instantly add Bootstrap styling to all your Formidable forms.',
86
+ ),
87
+ 'zapier' => array(
88
+ 'title' => 'Zapier',
89
+ 'excerpt' => 'Connect with hundreds of different applications through Zapier. Insert a new row in a Google docs spreadsheet, post on Twitter, or add a new Dropbox file with your form.',
90
+ ),
91
+ 'signature' => array(
92
+ 'title' => 'Signature',
93
+ 'excerpt' => 'Add a signature field to your form. The user may write their signature with a trackpad/mouse or just type it.',
94
+ ),
95
+ 'api' => array(
96
+ 'title' => 'Formidable API',
97
+ 'link' => 'downloads/formidable-api/',
98
+ 'excerpt' => 'Send entry results to any other site that has a Rest API. This includes the option of sending entries from one Formidable site to another.',
99
+ ),
100
+ 'twilio' => array(
101
+ 'title' => 'Twilio',
102
+ 'docs' => 'twilio-add-on/',
103
+ 'excerpt' => 'Allow users to text their votes for polls created by Formidable Forms, or send SMS notifications when entries are submitted or updated.',
104
+ ),
105
+ 'aweber' => array(
106
+ 'title' => 'AWeber',
107
+ 'excerpt' => 'Subscribe users to an AWeber mailing list when they submit a form. AWeber is a powerful email marketing service.',
108
+ ),
109
+ 'highrise' => array(
110
+ 'title' => 'Highrise',
111
+ 'excerpt' => 'Add your leads to your Highrise CRM account any time a Formidable form is submitted.',
112
+ ),
113
+ 'wpml' => array(
114
+ 'title' => 'WP Multilingual',
115
+ 'link' => 'downloads/wp-multilingual/',
116
+ 'docs' => 'formidable-multi-language/',
117
+ 'excerpt' => 'Translate your forms into multiple languages using the Formidable-integrated WPML plugin.',
118
+ ),
119
+ 'polylang' => array(
120
+ 'title' => 'Polylang',
121
+ 'excerpt' => 'Create bilingual or multilingual forms with help from Polylang.',
122
+ ),
123
+ 'math-captcha' => array(
124
+ 'title' => 'Math Captcha',
125
+ 'excerpt' => 'Require users to perform a simple calculation before submitting a form to prevent spam. This add-on extends BestWebSoft\'s Captcha plugin.',
126
+ ),
127
+ 'locations' => array(
128
+ 'title' => 'Locations',
129
+ 'excerpt' => 'Populate fields with Countries, States/Provinces, U.S. Counties, and U.S. Cities. This data can then be used in dependent Data from Entries fields.',
130
+ ),
131
+ 'user-tracking' => array(
132
+ 'title' => 'User Tracking',
133
+ 'excerpt' => 'Track which pages a user visits prior to submitting a form.',
134
+ ),
135
+ );
136
 
137
+ return $addons;
138
+ }
139
 
140
+ private static function prepare_addons( &$addons ) {
141
+ $activate_url = '';
142
+ if ( current_user_can( 'activate_plugins' ) ) {
143
+ $activate_url = add_query_arg( array( 'action' => 'activate' ), network_admin_url( 'plugins.php' ) );
144
  }
145
 
146
+ $loop_addons = $addons;
147
+ foreach ( $loop_addons as $slug => $addon ) {
148
+ if ( isset( $addon['file'] ) ) {
149
+ $base_file = $addon['file'];
150
+ } else {
151
+ $base_file = 'formidable-' . $slug;
152
+ }
153
+ $file = WP_PLUGIN_DIR . '/' . $base_file;
154
+
155
+ $addon['installed'] = is_dir( $file );
156
+ $addon['activate_url'] = '';
157
+ if ( $addon['installed'] && ! empty( $activate_url ) ) {
158
+ if ( file_exists( $file . '/' . $base_file . '.php' ) ) {
159
+ $file_name = $base_file . '/' . $base_file . '.php';
160
+ if ( ! is_plugin_active( $file_name ) ) {
161
+ $addon['activate_url'] = add_query_arg( array(
162
+ '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $file_name ),
163
+ 'plugin' => $file_name,
164
+ ), $activate_url );
165
+ }
166
+ }
167
+ }
168
+
169
+ if ( ! isset( $addon['docs'] ) ) {
170
+ $addon['docs'] = 'formidable-' . $slug . '/';
171
+ }
172
+
173
+ if ( ! isset( $addon['link'] ) ) {
174
+ $addon['link'] = 'downloads/' . $slug . '/';
175
+ }
176
+ $addon['link'] = FrmAppHelper::make_affiliate_url( $addon['link'] );
177
+
178
+ $addons[ $slug ] = $addon;
179
+ }
180
  }
181
 
182
  public static function get_licenses() {
220
  }
221
 
222
  public static function upgrade_to_pro() {
223
+ $pro_pricing = self::prepare_pro_info();
 
 
224
 
225
  include( FrmAppHelper::plugin_path() . '/classes/views/addons/upgrade_to_pro.php' );
226
  }
227
 
228
+ private static function prepare_pro_info() {
229
  $pro_pricing = array(
230
+ 'personal' => array( 'id' => 5, 'price' => '49.00', 'name' => 'Personal' ),
231
+ 'professional' => array( 'id' => 6, 'price' => '99.00', 'name' => 'Professional' ),
232
  'smallbusiness' => array( 'id' => 3, 'price' => '199.00', 'name' => 'Small Business' ),
233
+ 'enterprise' => array( 'id' => 4, 'price' => '399.00', 'name' => 'Enterprise' ),
234
  );
235
 
236
+ return $pro_pricing;
 
 
 
 
237
  }
238
  }
classes/controllers/FrmFieldsController.php CHANGED
@@ -491,11 +491,11 @@ class FrmFieldsController {
491
  $type = $type_switch[ $type ];
492
  }
493
 
494
- $frm_field_selection = FrmField::field_selection();
495
- $types = array_keys($frm_field_selection);
496
- if ( ! in_array($type, $types) && $type != 'captcha' ) {
497
- $type = 'text';
498
- }
499
 
500
  return $type;
501
  }
491
  $type = $type_switch[ $type ];
492
  }
493
 
494
+ $pro_fields = FrmField::pro_field_selection();
495
+ $types = array_keys( $pro_fields );
496
+ if ( in_array( $type, $types ) ) {
497
+ $type = 'text';
498
+ }
499
 
500
  return $type;
501
  }
classes/controllers/FrmFormsController.php CHANGED
@@ -56,16 +56,15 @@ class FrmFormsController {
56
  $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ];
57
 
58
  if ( $action == 'create' ) {
59
- return self::create($values);
 
60
  } else if ( $action == 'new' ) {
61
  $frm_field_selection = FrmField::field_selection();
62
  $values = FrmFormsHelper::setup_new_vars($values);
63
  $id = FrmForm::create( $values );
64
  $form = FrmForm::getOne($id);
65
 
66
- // add default email notification
67
- $action_control = FrmFormActionsController::get_form_actions( 'email' );
68
- $action_control->create($form->id);
69
 
70
  $all_templates = FrmForm::getAll( array( 'is_template' => 1 ), 'name' );
71
 
@@ -74,6 +73,22 @@ class FrmFormsController {
74
  }
75
  }
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  public static function create( $values = array() ) {
78
  FrmAppHelper::permission_check('frm_edit_forms');
79
 
@@ -1211,7 +1226,7 @@ class FrmFormsController {
1211
  $version = FrmAppHelper::plugin_version();
1212
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
1213
  wp_register_script( 'formidable', FrmAppHelper::plugin_url() . "/js/formidable{$suffix}.js", array( 'jquery' ), $version, true );
1214
- wp_register_script( 'jquery-placeholder', FrmAppHelper::plugin_url() . '/js/jquery/jquery.placeholder.js', array( 'jquery' ), '2.0.7', true );
1215
  add_filter( 'script_loader_tag', 'FrmFormsController::defer_script_loading', 10, 2 );
1216
 
1217
  if ( FrmAppHelper::is_admin() ) {
56
  $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ];
57
 
58
  if ( $action == 'create' ) {
59
+ self::create($values);
60
+ return;
61
  } else if ( $action == 'new' ) {
62
  $frm_field_selection = FrmField::field_selection();
63
  $values = FrmFormsHelper::setup_new_vars($values);
64
  $id = FrmForm::create( $values );
65
  $form = FrmForm::getOne($id);
66
 
67
+ self::create_default_email_action( $form );
 
 
68
 
69
  $all_templates = FrmForm::getAll( array( 'is_template' => 1 ), 'name' );
70
 
73
  }
74
  }
75
 
76
+ /**
77
+ * Create the default email action
78
+ *
79
+ * @since 2.02.11
80
+ *
81
+ * @param object $form
82
+ */
83
+ private static function create_default_email_action( $form ) {
84
+ $create_email = apply_filters( 'frm_create_default_email_action', true, $form );
85
+
86
+ if ( $create_email ) {
87
+ $action_control = FrmFormActionsController::get_form_actions( 'email' );
88
+ $action_control->create( $form->id );
89
+ }
90
+ }
91
+
92
  public static function create( $values = array() ) {
93
  FrmAppHelper::permission_check('frm_edit_forms');
94
 
1226
  $version = FrmAppHelper::plugin_version();
1227
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
1228
  wp_register_script( 'formidable', FrmAppHelper::plugin_url() . "/js/formidable{$suffix}.js", array( 'jquery' ), $version, true );
1229
+ wp_register_script( 'jquery-placeholder', FrmAppHelper::plugin_url() . '/js/jquery/jquery.placeholder.min.js', array( 'jquery' ), '2.3.1', true );
1230
  add_filter( 'script_loader_tag', 'FrmFormsController::defer_script_loading', 10, 2 );
1231
 
1232
  if ( FrmAppHelper::is_admin() ) {
classes/controllers/FrmStylesController.php CHANGED
@@ -60,7 +60,8 @@ class FrmStylesController {
60
  wp_enqueue_script('jquery-ui-datepicker');
61
 
62
  $version = FrmAppHelper::plugin_version();
63
- wp_enqueue_script( 'jquery-frm-themepicker', FrmAppHelper::plugin_url() . '/js/jquery/jquery-ui-themepicker.js', array( 'jquery' ), $version );
 
64
 
65
  wp_enqueue_style( 'frm-custom-theme', admin_url('admin-ajax.php?action=frmpro_css' ) );
66
 
60
  wp_enqueue_script('jquery-ui-datepicker');
61
 
62
  $version = FrmAppHelper::plugin_version();
63
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
64
+ wp_enqueue_script( 'jquery-frm-themepicker', FrmAppHelper::plugin_url() . '/js/jquery/jquery-ui-themepicker' . $suffix . '.js', array( 'jquery' ), $version );
65
 
66
  wp_enqueue_style( 'frm-custom-theme', admin_url('admin-ajax.php?action=frmpro_css' ) );
67
 
classes/helpers/FrmAppHelper.php CHANGED
@@ -10,7 +10,7 @@ class FrmAppHelper {
10
  /**
11
  * @since 2.0
12
  */
13
- public static $plug_version = '2.02.10';
14
 
15
  /**
16
  * @since 1.07.02
@@ -238,7 +238,7 @@ class FrmAppHelper {
238
  if ( $src == 'get' ) {
239
  $value = isset( $_POST[ $param ] ) ? stripslashes_deep( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? stripslashes_deep( $_GET[ $param ] ) : $default );
240
  if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) {
241
- $value = stripslashes_deep( htmlspecialchars_decode( urldecode( $_GET[ $param ] ) ) );
242
  }
243
  self::sanitize_value( $sanitize, $value );
244
  } else {
@@ -473,7 +473,7 @@ class FrmAppHelper {
473
 
474
  public static function get_group_cached_keys( $group ) {
475
  $cached = wp_cache_get( 'cached_keys', $group );
476
- if ( ! $cached ) {
477
  $cached = array();
478
  }
479
 
@@ -1279,7 +1279,7 @@ class FrmAppHelper {
1279
  * @param int|string $to in seconds
1280
  * @return string $time_ago
1281
  */
1282
- public static function human_time_diff( $from, $to = '' ) {
1283
  if ( empty( $to ) ) {
1284
  $now = new DateTime;
1285
  } else {
@@ -1305,7 +1305,7 @@ class FrmAppHelper {
1305
  }
1306
  }
1307
 
1308
- $levels_deep = apply_filters( 'frm_time_ago_levels', 1, compact( 'time_strings', 'from', 'to' ) );
1309
  $time_strings = array_slice( $time_strings, 0, $levels_deep );
1310
  $time_ago_string = $time_strings ? implode( ' ', $time_strings ) : '0 ' . __( 'seconds', 'formidable' );
1311
 
10
  /**
11
  * @since 2.0
12
  */
13
+ public static $plug_version = '2.02.11';
14
 
15
  /**
16
  * @since 1.07.02
238
  if ( $src == 'get' ) {
239
  $value = isset( $_POST[ $param ] ) ? stripslashes_deep( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? stripslashes_deep( $_GET[ $param ] ) : $default );
240
  if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) {
241
+ $value = stripslashes_deep( htmlspecialchars_decode( $_GET[ $param ] ) );
242
  }
243
  self::sanitize_value( $sanitize, $value );
244
  } else {
473
 
474
  public static function get_group_cached_keys( $group ) {
475
  $cached = wp_cache_get( 'cached_keys', $group );
476
+ if ( ! $cached || ! is_array( $cached ) ) {
477
  $cached = array();
478
  }
479
 
1279
  * @param int|string $to in seconds
1280
  * @return string $time_ago
1281
  */
1282
+ public static function human_time_diff( $from, $to = '', $levels = 1 ) {
1283
  if ( empty( $to ) ) {
1284
  $now = new DateTime;
1285
  } else {
1305
  }
1306
  }
1307
 
1308
+ $levels_deep = apply_filters( 'frm_time_ago_levels', $levels, compact( 'time_strings', 'from', 'to' ) );
1309
  $time_strings = array_slice( $time_strings, 0, $levels_deep );
1310
  $time_ago_string = $time_strings ? implode( ' ', $time_strings ) : '0 ' . __( 'seconds', 'formidable' );
1311
 
classes/helpers/FrmCSVExportHelper.php CHANGED
@@ -187,7 +187,7 @@ class FrmCSVExportHelper {
187
  'type' => $col->type, 'post_id' => self::$entry->post_id, 'show_icon' => false,
188
  'entry_id' => self::$entry->id, 'sep' => self::$separator,
189
  'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0,
190
- ) );
191
  $row[ $col->id . '_label' ] = $sep_value;
192
  unset( $sep_value );
193
  }
187
  'type' => $col->type, 'post_id' => self::$entry->post_id, 'show_icon' => false,
188
  'entry_id' => self::$entry->id, 'sep' => self::$separator,
189
  'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0,
190
+ ) );
191
  $row[ $col->id . '_label' ] = $sep_value;
192
  unset( $sep_value );
193
  }
classes/helpers/FrmEntriesHelper.php CHANGED
@@ -478,7 +478,7 @@ class FrmEntriesHelper {
478
 
479
  if ( is_array($val) ) {
480
  $val = FrmAppHelper::array_flatten( $val );
481
- $val = implode(',', $val);
482
  }
483
 
484
  $content .= $val;
478
 
479
  if ( is_array($val) ) {
480
  $val = FrmAppHelper::array_flatten( $val );
481
+ $val = implode( ', ', $val );
482
  }
483
 
484
  $content .= $val;
classes/helpers/FrmFieldsHelper.php CHANGED
@@ -284,6 +284,18 @@ DEFAULT_HTML;
284
  $entry_key = FrmAppHelper::simple_get( 'entry', 'sanitize_title' );
285
  $html = str_replace('[entry_key]', $entry_key, $html);
286
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  //replace [input]
288
  preg_match_all("/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $html, $shortcodes, PREG_PATTERN_ORDER);
289
  global $frm_vars;
@@ -317,15 +329,6 @@ DEFAULT_HTML;
317
  $html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $html );
318
  }
319
 
320
- if ( $form ) {
321
- $form = (array) $form;
322
-
323
- //replace [form_key]
324
- $html = str_replace('[form_key]', $form['form_key'], $html);
325
-
326
- //replace [form_name]
327
- $html = str_replace('[form_name]', $form['name'], $html);
328
- }
329
  $html .= "\n";
330
 
331
  //Return html if conf_field to prevent loop
@@ -342,12 +345,19 @@ DEFAULT_HTML;
342
 
343
  self::remove_collapse_shortcode( $html );
344
 
 
 
 
 
 
 
 
 
 
345
  if ( apply_filters( 'frm_do_html_shortcodes', true ) ) {
346
  $html = do_shortcode( $html );
347
  }
348
-
349
- return $html;
350
- }
351
 
352
  /**
353
  * Add classes to a field div
284
  $entry_key = FrmAppHelper::simple_get( 'entry', 'sanitize_title' );
285
  $html = str_replace('[entry_key]', $entry_key, $html);
286
 
287
+ if ( $form ) {
288
+ $form = (array) $form;
289
+
290
+ //replace [form_key]
291
+ $html = str_replace('[form_key]', $form['form_key'], $html);
292
+
293
+ //replace [form_name]
294
+ $html = str_replace('[form_name]', $form['name'], $html);
295
+ }
296
+
297
+ self::process_wp_shortcodes( $html );
298
+
299
  //replace [input]
300
  preg_match_all("/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $html, $shortcodes, PREG_PATTERN_ORDER);
301
  global $frm_vars;
329
  $html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $html );
330
  }
331
 
 
 
 
 
 
 
 
 
 
332
  $html .= "\n";
333
 
334
  //Return html if conf_field to prevent loop
345
 
346
  self::remove_collapse_shortcode( $html );
347
 
348
+ return $html;
349
+ }
350
+
351
+ /**
352
+ * This filters shortcodes in the field HTML
353
+ *
354
+ * @since 2.02.11
355
+ */
356
+ private static function process_wp_shortcodes( &$html ) {
357
  if ( apply_filters( 'frm_do_html_shortcodes', true ) ) {
358
  $html = do_shortcode( $html );
359
  }
360
+ }
 
 
361
 
362
  /**
363
  * Add classes to a field div
classes/helpers/FrmFormsHelper.php CHANGED
@@ -555,6 +555,13 @@ BEFORE_HTML;
555
  }
556
  }
557
 
 
 
 
 
 
 
 
558
  public static function get_scroll_js( $form_id ) {
559
  ?><script type="text/javascript">document.addEventListener('DOMContentLoaded',function(){frmFrontForm.scrollMsg(<?php echo (int) $form_id ?>);})</script><?php
560
  }
555
  }
556
  }
557
 
558
+ public static function maybe_get_scroll_js( $id ) {
559
+ $offset = apply_filters( 'frm_scroll_offset', 4, array( 'form_id' => $id ) );
560
+ if ( $offset != -1 ) {
561
+ self::get_scroll_js( $id );
562
+ }
563
+ }
564
+
565
  public static function get_scroll_js( $form_id ) {
566
  ?><script type="text/javascript">document.addEventListener('DOMContentLoaded',function(){frmFrontForm.scrollMsg(<?php echo (int) $form_id ?>);})</script><?php
567
  }
classes/models/FrmAddon.php CHANGED
@@ -170,11 +170,12 @@ class FrmAddon {
170
  return;
171
  }
172
 
173
- $license_status = get_site_transient( $this->transient_key() );
 
174
 
175
- if ( $license_status === false && $this->test_transient() ) {
 
176
  $response = $this->get_license_status();
177
- set_site_transient( $this->transient_key(), $response, 60 * 60 * 24 * 7 ); // check weekly
178
  if ( $response['status'] == 'revoked' ) {
179
  $this->clear_license();
180
  }
@@ -185,13 +186,6 @@ class FrmAddon {
185
  return 'frm_' . md5( sanitize_key( $this->license . '_' . $this->plugin_slug ) );
186
  }
187
 
188
- private static function test_transient() {
189
- $key = 'frm_test';
190
- set_site_transient( $key, $key, 120 );
191
- $transient = get_site_transient( $key );
192
- return ( $transient ) ? true : false;
193
- }
194
-
195
  public static function activate() {
196
  FrmAppHelper::permission_check('frm_change_settings');
197
  check_ajax_referer( 'frm_ajax', 'nonce' );
@@ -303,11 +297,12 @@ class FrmAddon {
303
  $api_params = array(
304
  'edd_action' => $action,
305
  'license' => $this->license,
306
- 'item_name' => urlencode( $this->plugin_name ),
307
  'url' => home_url(),
308
  );
309
  if ( is_numeric( $this->download_id ) ) {
310
  $api_params['item_id'] = absint( $this->download_id );
 
 
311
  }
312
 
313
  $arg_array = array(
170
  return;
171
  }
172
 
173
+ $last_checked = get_site_option( $this->transient_key() );
174
+ $seven_days_ago = date( 'Y-m-d H:i:s', strtotime('-7 days') );
175
 
176
+ if ( ! $last_checked || $last_checked < $seven_days_ago ) {
177
+ update_site_option( $this->transient_key(), date( 'Y-m-d H:i:s' ) ); // check weekly
178
  $response = $this->get_license_status();
 
179
  if ( $response['status'] == 'revoked' ) {
180
  $this->clear_license();
181
  }
186
  return 'frm_' . md5( sanitize_key( $this->license . '_' . $this->plugin_slug ) );
187
  }
188
 
 
 
 
 
 
 
 
189
  public static function activate() {
190
  FrmAppHelper::permission_check('frm_change_settings');
191
  check_ajax_referer( 'frm_ajax', 'nonce' );
297
  $api_params = array(
298
  'edd_action' => $action,
299
  'license' => $this->license,
 
300
  'url' => home_url(),
301
  );
302
  if ( is_numeric( $this->download_id ) ) {
303
  $api_params['item_id'] = absint( $this->download_id );
304
+ } else {
305
+ $api_params['item_name'] = urlencode( $this->plugin_name );
306
  }
307
 
308
  $arg_array = array(
classes/models/FrmEntryValidate.php CHANGED
@@ -271,15 +271,15 @@ class FrmEntryValidate {
271
  return;
272
  }
273
 
 
 
 
 
274
  if ( self::is_akismet_spam( $values ) ) {
275
  if ( self::is_akismet_enabled_for_user( $values['form_id'] ) ) {
276
  $errors['spam'] = __( 'Your entry appears to be spam!', 'formidable' );
277
  }
278
  }
279
-
280
- if ( self::blacklist_check( $values ) ) {
281
- $errors['spam'] = __( 'Your entry appears to be spam!', 'formidable' );
282
- }
283
  }
284
 
285
  private static function is_akismet_spam( $values ) {
@@ -298,84 +298,113 @@ class FrmEntryValidate {
298
  }
299
 
300
  $mod_keys = trim( get_option( 'blacklist_keys' ) );
301
-
302
  if ( empty( $mod_keys ) ) {
303
  return false;
304
  }
305
 
306
- $content = FrmEntriesHelper::entry_array_to_string($values);
307
-
308
- if ( empty($content) ) {
309
- return false;
310
  }
311
 
312
- $words = explode( "\n", $mod_keys );
313
-
314
- foreach ( (array) $words as $word ) {
315
- $word = trim( $word );
316
-
317
- if ( empty($word) ) {
318
- continue;
319
- }
320
-
321
- if ( preg_match('#' . preg_quote( $word, '#' ) . '#', $content) ) {
322
- return true;
323
- }
324
- }
325
 
326
- return false;
327
  }
328
 
329
- /**
330
- * Check entries for spam
331
- *
332
- * @return boolean true if is spam
333
- */
334
- public static function akismet( $values ) {
335
- $content = FrmEntriesHelper::entry_array_to_string( $values );
336
-
337
  if ( empty( $content ) ) {
338
- return false;
339
  }
340
 
341
- $datas = array();
342
- self::parse_akismet_array( $datas, $content );
343
 
344
- $query_string = '';
345
- foreach ( $datas as $key => $data ) {
346
- $query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&';
347
- unset( $key, $data );
348
- }
349
-
350
- $response = Akismet::http_post($query_string, 'comment-check');
351
 
352
  return ( is_array( $response ) && $response[1] == 'true' );
353
- }
354
 
355
- /**
356
- * @since 2.0
357
- * @param string $content
358
- */
359
- private static function parse_akismet_array( &$datas, $content ) {
360
- $datas['blog'] = FrmAppHelper::site_url();
361
- $datas['user_ip'] = preg_replace( '/[^0-9., ]/', '', FrmAppHelper::get_ip_address() );
 
 
 
 
 
362
  $datas['user_agent'] = FrmAppHelper::get_server_value( 'HTTP_USER_AGENT' );
363
  $datas['referrer'] = isset( $_SERVER['HTTP_REFERER'] ) ? FrmAppHelper::get_server_value( 'HTTP_REFERER' ) : false;
364
- $datas['comment_type'] = 'formidable';
365
- $datas['comment_content'] = $content;
366
 
367
- if ( $permalink = get_permalink() ) {
368
- $datas['permalink'] = $permalink;
369
- }
 
370
 
371
- foreach ( $_SERVER as $key => $value ) {
372
- if ( ! in_array( $key, array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' ) ) && is_string( $value ) ) {
373
- $datas[ $key ] = wp_strip_all_tags( $value );
374
- } else {
375
- $datas[ $key ] = '';
376
- }
377
 
378
- unset($key, $value);
379
- }
380
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  }
271
  return;
272
  }
273
 
274
+ if ( self::blacklist_check( $values ) ) {
275
+ $errors['spam'] = __( 'Your entry appears to be blacklist spam!', 'formidable' );
276
+ }
277
+
278
  if ( self::is_akismet_spam( $values ) ) {
279
  if ( self::is_akismet_enabled_for_user( $values['form_id'] ) ) {
280
  $errors['spam'] = __( 'Your entry appears to be spam!', 'formidable' );
281
  }
282
  }
 
 
 
 
283
  }
284
 
285
  private static function is_akismet_spam( $values ) {
298
  }
299
 
300
  $mod_keys = trim( get_option( 'blacklist_keys' ) );
 
301
  if ( empty( $mod_keys ) ) {
302
  return false;
303
  }
304
 
305
+ $content = FrmEntriesHelper::entry_array_to_string( $values );
306
+ if ( empty( $content ) ) {
307
+ return false;
 
308
  }
309
 
310
+ $ip = FrmAppHelper::get_ip_address();
311
+ $user_agent = FrmAppHelper::get_server_value( 'HTTP_USER_AGENT' );
312
+ $user_info = self::get_spam_check_user_info( $values );
 
 
 
 
 
 
 
 
 
 
313
 
314
+ return wp_blacklist_check( $user_info['comment_author'], $user_info['comment_author_email'], $user_info['comment_author_url'], $content, $ip, $user_agent );
315
  }
316
 
317
+ /**
318
+ * Check entries for Akismet spam
319
+ *
320
+ * @return boolean true if is spam
321
+ */
322
+ public static function akismet( $values ) {
323
+ $content = FrmEntriesHelper::entry_array_to_string( $values );
 
324
  if ( empty( $content ) ) {
325
+ return false;
326
  }
327
 
328
+ $datas = array( 'comment_type' => 'formidable', 'comment_content' => $content );
329
+ self::parse_akismet_array( $datas, $values );
330
 
331
+ $query_string = _http_build_query( $datas, '', '&' );
332
+ $response = Akismet::http_post( $query_string, 'comment-check' );
 
 
 
 
 
333
 
334
  return ( is_array( $response ) && $response[1] == 'true' );
335
+ }
336
 
337
+ /**
338
+ * @since 2.0
339
+ */
340
+ private static function parse_akismet_array( &$datas, $values ) {
341
+ self::add_site_info_to_akismet( $datas );
342
+ self::add_user_info_to_akismet( $datas, $values );
343
+ self::add_server_values_to_akismet( $datas );
344
+ }
345
+
346
+ private static function add_site_info_to_akismet( &$datas ) {
347
+ $datas['blog'] = FrmAppHelper::site_url();
348
+ $datas['user_ip'] = preg_replace( '/[^0-9., ]/', '', FrmAppHelper::get_ip_address() );
349
  $datas['user_agent'] = FrmAppHelper::get_server_value( 'HTTP_USER_AGENT' );
350
  $datas['referrer'] = isset( $_SERVER['HTTP_REFERER'] ) ? FrmAppHelper::get_server_value( 'HTTP_REFERER' ) : false;
351
+ $datas['blog_lang'] = get_locale();
352
+ $datas['blog_charset'] = get_option('blog_charset');
353
 
354
+ if ( akismet_test_mode() ) {
355
+ $datas['is_test'] = 'true';
356
+ }
357
+ }
358
 
359
+ private static function add_user_info_to_akismet( &$datas, $values ) {
360
+ $user_info = self::get_spam_check_user_info( $values );
361
+ $datas = $datas + $user_info;
 
 
 
362
 
363
+ if ( isset( $user_info['user_ID'] ) ) {
364
+ $datas['user_role'] = Akismet::get_user_roles( $user_info['user_ID'] );
365
+ }
366
+ }
367
+
368
+ private static function get_spam_check_user_info( $values ) {
369
+ $datas = array();
370
+
371
+ if ( is_user_logged_in() ) {
372
+ $user = wp_get_current_user();
373
+ $datas['user_ID'] = $datas['user_id'] = $user->ID;
374
+ $datas['comment_author'] = $user->display_name;
375
+ $datas['comment_author_email'] = $user->user_email;
376
+ $datas['comment_author_url'] = $user->user_url;
377
+ } else {
378
+ $datas['comment_author'] = '';
379
+ $datas['comment_author_email'] = '';
380
+ $datas['comment_author_url'] = '';
381
+
382
+ $values = array_filter( $values );
383
+ foreach ( $values as $value ) {
384
+ if ( ! is_array( $value ) ) {
385
+ if ( $datas['comment_author_email'] == '' && strpos( $value, '@' ) && is_email( $value ) ) {
386
+ $datas['comment_author_email'] = $value;
387
+ } elseif ( $datas['comment_author_url'] == '' && strpos( $value, 'http' ) === 0 ) {
388
+ $datas['comment_author_url'] = $value;
389
+ } elseif ( $datas['comment_author'] == '' && ! is_numeric( $value ) && strlen( $value ) < 200 ) {
390
+ $datas['comment_author'] = $value;
391
+ }
392
+ }
393
+ }
394
+ }
395
+
396
+ return $datas;
397
+ }
398
+
399
+ private static function add_server_values_to_akismet( &$datas ) {
400
+ foreach ( $_SERVER as $key => $value ) {
401
+ $include_value = is_string( $value ) && ! preg_match( '/^HTTP_COOKIE/', $key ) && preg_match( '/^(HTTP_|REMOTE_ADDR|REQUEST_URI|DOCUMENT_URI)/', $key );
402
+
403
+ // Send any potentially useful $_SERVER vars, but avoid sending junk we don't need.
404
+ if ( $include_value ) {
405
+ $datas[ $key ] = $value;
406
+ }
407
+ unset( $key, $value );
408
+ }
409
+ }
410
  }
classes/models/FrmField.php CHANGED
@@ -238,7 +238,7 @@ class FrmField {
238
  FrmAppHelper::cache_delete_group( 'frm_field' );
239
 
240
  $form = FrmForm::getOne($form_id);
241
- if ( $form && $form->parent_form_id ) {
242
  self::delete_form_transient( $form->parent_form_id );
243
  }
244
  }
238
  FrmAppHelper::cache_delete_group( 'frm_field' );
239
 
240
  $form = FrmForm::getOne($form_id);
241
+ if ( $form && $form->parent_form_id && $form->parent_form_id != $form_id ) {
242
  self::delete_form_transient( $form->parent_form_id );
243
  }
244
  }
classes/views/addons/list.php CHANGED
@@ -2,45 +2,32 @@
2
  <h1><?php _e( 'Formidable AddOns', 'formidable' ) ?></h1>
3
 
4
  <div id="the-list" class="frm-addons">
5
- <?php foreach ( $addons as $addon ) {
6
- if ( empty( $addon['info']['excerpt'] ) || empty( $addon['licensing']['enabled'] ) ) {
7
- continue;
8
- }
9
-
10
- if ( isset( $plugin_names[ $addon['info']['slug'] ] ) ) {
11
- $installed = is_dir( WP_PLUGIN_DIR . '/' . $plugin_names[ $addon['info']['slug'] ] );
12
- } else {
13
- $installed = isset( $installed_addons[ $addon['info']['slug'] ] ) || is_dir( WP_PLUGIN_DIR . '/formidable-' . $addon['info']['slug'] );
14
- }
15
- $has_thumbnail = ! empty( $addon['info']['thumbnail'] );
16
- if ( $addon['info']['slug'] == 'formidable-pro' ) {
17
- $addon['info']['link'] = $pro_link;
18
- }
19
- $addon['info']['link'] = FrmAppHelper::make_affiliate_url( $addon['info']['link'] );
20
-
21
- ?>
22
- <div class="plugin-card plugin-card-<?php echo esc_attr( $addon['info']['slug'] ) ?> <?php echo esc_attr( $has_thumbnail ? '' : 'frm-no-thumb' ) ?>">
23
  <div class="plugin-card-top">
24
  <div class="name column-name">
25
  <h3>
26
- <a href="<?php echo esc_url( $addon['info']['link'] ) ?>">
27
- <?php echo esc_html( $addon['info']['title'] ) ?>
28
- <?php if ( $has_thumbnail ) { ?>
29
- <img src="<?php echo esc_url( $addon['info']['thumbnail'] ) ?>" class="plugin-icon" alt="" />
30
- <?php } ?>
31
  </a>
32
  </h3>
33
  </div>
34
  <div class="action-links">
35
  <ul class="plugin-action-buttons">
36
- <?php if ( $installed ) { ?>
37
- <li><span class="button button-disabled" title="<?php esc_attr_e( 'This plugin is already installed', 'formidable' ) ?>"><?php _e( 'Installed', 'formidable' ) ?></span></li>
 
 
 
 
 
 
38
  <?php } ?>
39
- <li><a href="<?php echo esc_url( $addon['info']['link'] ) ?>" target="_blank" aria-label="<?php esc_attr_e( 'More Details', 'formidable' ) ?>"><?php _e( 'More Details', 'formidable' ) ?></a></li>
40
  </ul>
41
  </div>
42
  <div class="desc column-description">
43
- <p><?php echo wp_kses_post( $addon['info']['excerpt'] ) ?></p>
44
  </div>
45
  </div>
46
  </div>
2
  <h1><?php _e( 'Formidable AddOns', 'formidable' ) ?></h1>
3
 
4
  <div id="the-list" class="frm-addons">
5
+ <?php foreach ( $addons as $slug => $addon ) { ?>
6
+ <div class="plugin-card plugin-card-<?php echo esc_attr( $slug ) ?> frm-no-thumb">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  <div class="plugin-card-top">
8
  <div class="name column-name">
9
  <h3>
10
+ <a href="<?php echo esc_url( $site_url . $addon['link'] ) ?>">
11
+ <?php echo esc_html( $addon['title'] ) ?>
 
 
 
12
  </a>
13
  </h3>
14
  </div>
15
  <div class="action-links">
16
  <ul class="plugin-action-buttons">
17
+ <?php if ( $addon['installed'] ) { ?>
18
+ <?php if ( empty( $addon['activate_url'] ) ) { ?>
19
+ <li><span class="button button-disabled" title="<?php esc_attr_e( 'This plugin is already installed', 'formidable' ) ?>"><?php _e( 'Installed', 'formidable' ) ?></span></li>
20
+ <?php } else { ?>
21
+ <li><a href="<?php echo esc_url( $addon['activate_url'] ) ?>" class="button activate-now"><?php _e( 'Activate', 'formidable' ); ?></a></li>
22
+ <?php } ?>
23
+ <?php } else { ?>
24
+ <li><a class="install-now button" href="<?php echo esc_url( $site_url . $addon['link'] ) ?>" target="_blank" aria-label="<?php esc_attr_e( 'Get Started', 'formidable' ) ?>"><?php _e( 'Get Started', 'formidable' ) ?></a></li>
25
  <?php } ?>
26
+ <li><a href="<?php echo esc_url( $site_url . 'knowledgebase/' . $addon['docs'] ) ?>" target="_blank" aria-label="<?php esc_attr_e( 'View Docs', 'formidable' ) ?>"><?php _e( 'View Docs', 'formidable' ) ?></a></li>
27
  </ul>
28
  </div>
29
  <div class="desc column-description">
30
+ <p><?php echo wp_kses_post( $addon['excerpt'] ) ?></p>
31
  </div>
32
  </div>
33
  </div>
classes/views/frm-entries/errors.php CHANGED
@@ -7,7 +7,7 @@ if ( isset( $message ) && $message != '' ) {
7
  if ( FrmAppHelper::is_admin() ) {
8
  ?><div id="message" class="frm_message updated frm_msg_padding"><?php echo wp_kses_post( $message ) ?></div><?php
9
  } else {
10
- FrmFormsHelper::get_scroll_js($form->id);
11
 
12
  // we need to allow scripts here for javascript in the success message
13
  echo $message;
7
  if ( FrmAppHelper::is_admin() ) {
8
  ?><div id="message" class="frm_message updated frm_msg_padding"><?php echo wp_kses_post( $message ) ?></div><?php
9
  } else {
10
+ FrmFormsHelper::maybe_get_scroll_js( $form->id );
11
 
12
  // we need to allow scripts here for javascript in the success message
13
  echo $message;
classes/views/frm-fields/front-end/dropdown-field.php CHANGED
@@ -4,7 +4,7 @@ $read_only = false;
4
  if ( isset($field['post_field']) && $field['post_field'] == 'post_category' && FrmAppHelper::pro_is_installed() ) {
5
  echo FrmProPost::get_category_dropdown( $field, array( 'location' => 'front', 'name' => $field_name, 'id' => $html_id ) );
6
  } else {
7
- if ( FrmAppHelper::pro_is_installed() && FrmField::is_read_only( $field ) ) {
8
  $read_only = true;
9
 
10
  echo FrmProDropdownFieldsController::get_hidden_fields_with_readonly_values( $field, $field_name, $html_id ); ?>
4
  if ( isset($field['post_field']) && $field['post_field'] == 'post_category' && FrmAppHelper::pro_is_installed() ) {
5
  echo FrmProPost::get_category_dropdown( $field, array( 'location' => 'front', 'name' => $field_name, 'id' => $html_id ) );
6
  } else {
7
+ if ( FrmAppHelper::pro_is_installed() && FrmField::is_read_only( $field ) && ! FrmAppHelper::is_admin() ) {
8
  $read_only = true;
9
 
10
  echo FrmProDropdownFieldsController::get_hidden_fields_with_readonly_values( $field, $field_name, $html_id ); ?>
classes/views/frm-form-actions/_email_settings.php CHANGED
@@ -5,15 +5,15 @@
5
  <td><input type="text" name="<?php echo esc_attr( $this->get_field_name('email_to') ) ?>" value="<?php echo esc_attr( $form_action->post_content['email_to'] ); ?>" class="frm_not_email_to frm_email_blur large-text <?php FrmAppHelper::maybe_add_tooltip('email_to', 'open') ?>" id="<?php echo esc_attr( $this->get_field_id('email_to') ) ?>" />
6
  </td>
7
  <td class="frm_bcc_cc_container">
8
- <a href="javascript:void(0)" class="button frm_email_buttons frm_bcc_button <?php
9
- echo ( ! empty($form_action->post_content['bcc']) ? 'frm_hidden' : '' );
10
- ?>" data-emailrow="bcc"><?php _e( 'BCC', 'formidable' ) ?></a>
11
  <a href="javascript:void(0)" class="button frm_email_buttons frm_cc_button <?php
12
  echo ( ! empty($form_action->post_content['cc']) ? 'frm_hidden' : '' );
13
  ?>" data-emailrow="cc"><?php _e( 'CC', 'formidable' ) ?></a>
 
 
 
14
  </td>
15
  </tr>
16
- <tr id="frm_cc_row" class="<?php echo empty( $form_action->post_content['cc'] ) ? 'frm_hidden' : ''; ?>" >
17
  <th><label <?php FrmAppHelper::maybe_add_tooltip('cc') ?>><?php _e( 'CC', 'formidable' ) ?></label>
18
  </th>
19
  <td class="frm_right_addon">
@@ -22,7 +22,7 @@
22
  </td>
23
  <td></td>
24
  </tr>
25
- <tr id="frm_bcc_row" class="<?php echo empty( $form_action->post_content['bcc'] ) ? 'frm_hidden' : ''; ?>" >
26
  <th><label <?php FrmAppHelper::maybe_add_tooltip('bcc') ?>><?php _e( 'BCC', 'formidable' ) ?></label>
27
  </th>
28
  <td class="frm_right_addon">
@@ -31,7 +31,7 @@
31
  </td>
32
  <td></td>
33
  </tr>
34
- <tr id="frm_reply_to_row" class="<?php echo empty( $form_action->post_content['reply_to'] ) ? 'frm_hidden' : ''; ?>">
35
  <th><label <?php FrmAppHelper::maybe_add_tooltip('reply_to') ?>><?php _e( 'Reply to', 'formidable' ) ?></label>
36
  </th>
37
  <td class="frm_right_addon">
5
  <td><input type="text" name="<?php echo esc_attr( $this->get_field_name('email_to') ) ?>" value="<?php echo esc_attr( $form_action->post_content['email_to'] ); ?>" class="frm_not_email_to frm_email_blur large-text <?php FrmAppHelper::maybe_add_tooltip('email_to', 'open') ?>" id="<?php echo esc_attr( $this->get_field_id('email_to') ) ?>" />
6
  </td>
7
  <td class="frm_bcc_cc_container">
 
 
 
8
  <a href="javascript:void(0)" class="button frm_email_buttons frm_cc_button <?php
9
  echo ( ! empty($form_action->post_content['cc']) ? 'frm_hidden' : '' );
10
  ?>" data-emailrow="cc"><?php _e( 'CC', 'formidable' ) ?></a>
11
+ <a href="javascript:void(0)" class="button frm_email_buttons frm_bcc_button <?php
12
+ echo ( ! empty($form_action->post_content['bcc']) ? 'frm_hidden' : '' );
13
+ ?>" data-emailrow="bcc"><?php _e( 'BCC', 'formidable' ) ?></a>
14
  </td>
15
  </tr>
16
+ <tr class="frm_cc_row<?php echo empty( $form_action->post_content['cc'] ) ? ' frm_hidden' : ''; ?>" >
17
  <th><label <?php FrmAppHelper::maybe_add_tooltip('cc') ?>><?php _e( 'CC', 'formidable' ) ?></label>
18
  </th>
19
  <td class="frm_right_addon">
22
  </td>
23
  <td></td>
24
  </tr>
25
+ <tr class="frm_bcc_row<?php echo empty( $form_action->post_content['bcc'] ) ? ' frm_hidden' : ''; ?>" >
26
  <th><label <?php FrmAppHelper::maybe_add_tooltip('bcc') ?>><?php _e( 'BCC', 'formidable' ) ?></label>
27
  </th>
28
  <td class="frm_right_addon">
31
  </td>
32
  <td></td>
33
  </tr>
34
+ <tr class="frm_reply_to_row<?php echo empty( $form_action->post_content['reply_to'] ) ? ' frm_hidden' : ''; ?>">
35
  <th><label <?php FrmAppHelper::maybe_add_tooltip('reply_to') ?>><?php _e( 'Reply to', 'formidable' ) ?></label>
36
  </th>
37
  <td class="frm_right_addon">
classes/views/frm-forms/settings.php CHANGED
@@ -132,9 +132,7 @@
132
  </table>
133
 
134
  <!--Permissions Section-->
135
- <table class="form-table">
136
- <?php do_action('frm_add_form_perm_options', $values); ?>
137
- </table>
138
 
139
  <!--Styling & Buttons Section-->
140
  <h3><?php _e( 'Styling & Buttons', 'formidable' ) ?>
132
  </table>
133
 
134
  <!--Permissions Section-->
135
+ <?php do_action('frm_add_form_perm_options', $values); ?>
 
 
136
 
137
  <!--Styling & Buttons Section-->
138
  <h3><?php _e( 'Styling & Buttons', 'formidable' ) ?>
css/_single_theme.css.php CHANGED
@@ -94,6 +94,7 @@ if ( ! isset( $center_form ) ) {
94
  padding:<?php echo esc_html( $section_pad . $important ) ?>;
95
  margin:0<?php echo esc_html( $important ) ?>;
96
  font-size:<?php echo esc_html( $section_font_size . $important ) ?>;
 
97
  font-weight:<?php echo esc_html( $section_weight . $important ) ?>;
98
  color:#<?php echo esc_html( $section_color . $important ) ?>;
99
  border:none<?php echo esc_html( $important ) ?>;
@@ -503,6 +504,24 @@ if ( ! isset( $center_form ) ) {
503
  <?php } ?>
504
  }
505
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
506
  <?php
507
  if ( ! $submit_style ) { ?>
508
  .<?php echo esc_html( $style_class ) ?> .frm_compact .frm_dropzone.dz-clickable .dz-message,
@@ -669,10 +688,14 @@ if ( ! $submit_style ) { ?>
669
  .frm_success_style{
670
  border:1px solid #<?php echo esc_html( $success_border_color ) ?>;
671
  background-color:<?php echo esc_html( ( empty( $success_bg_color ) ? 'transparent' : '#' . $success_bg_color ) . $important ); ?>;
672
- color:#<?php echo esc_html( $success_text_color ) ?>;
673
  border-radius:<?php echo esc_html( $border_radius . $important ) ?>;
674
  }
675
 
 
 
 
 
676
  .<?php echo esc_html( $style_class ) ?> .frm_message{
677
  margin:5px 0 15px;
678
  font-size:<?php echo esc_html( $success_font_size . $important ) ?>;
@@ -747,6 +770,7 @@ if ( ! $submit_style ) { ?>
747
  background-color:transparent<?php echo esc_html( $important ) ?>;
748
  border:none<?php echo esc_html( $important ) ?>;
749
  display:inline<?php echo esc_html( $important ) ?>;
 
750
  padding:0<?php echo esc_html( $important ) ?>;
751
  }
752
 
@@ -885,6 +909,13 @@ if ( ! $submit_style ) { ?>
885
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_four_col .frm_checkbox{
886
  float:right;
887
  }
 
 
 
 
 
 
 
888
  <?php } ?>
889
  /* Start Chosen */
890
  .<?php echo esc_html( $style_class ) ?> .chosen-container{
94
  padding:<?php echo esc_html( $section_pad . $important ) ?>;
95
  margin:0<?php echo esc_html( $important ) ?>;
96
  font-size:<?php echo esc_html( $section_font_size . $important ) ?>;
97
+ font-family:<?php echo FrmAppHelper::kses( $font ) ?>;
98
  font-weight:<?php echo esc_html( $section_weight . $important ) ?>;
99
  color:#<?php echo esc_html( $section_color . $important ) ?>;
100
  border:none<?php echo esc_html( $important ) ?>;
504
  <?php } ?>
505
  }
506
 
507
+ .<?php echo esc_html( $style_class ) ?> .frm_submit.frm_inline_submit::before {
508
+ content:"before";
509
+ font-family:<?php echo FrmAppHelper::kses( $font ) ?>;
510
+ font-size:<?php echo esc_html( $font_size . $important ) ?>;
511
+ color:#<?php echo esc_html( $label_color . $important ) ?>;
512
+ font-weight:<?php echo esc_html( $weight . $important ) ?>;
513
+ margin:0;
514
+ padding:<?php echo esc_html( $label_padding . $important ) ?>;
515
+ width:auto;
516
+ display:block;
517
+ visibility:hidden;
518
+ }
519
+
520
+ .<?php echo esc_html( $style_class ) ?> .frm_submit.frm_inline_submit input,
521
+ .<?php echo esc_html( $style_class ) ?> .frm_submit.frm_inline_submit button {
522
+ margin-top: 0 <?php echo esc_html( $important ) ?>;
523
+ }
524
+
525
  <?php
526
  if ( ! $submit_style ) { ?>
527
  .<?php echo esc_html( $style_class ) ?> .frm_compact .frm_dropzone.dz-clickable .dz-message,
688
  .frm_success_style{
689
  border:1px solid #<?php echo esc_html( $success_border_color ) ?>;
690
  background-color:<?php echo esc_html( ( empty( $success_bg_color ) ? 'transparent' : '#' . $success_bg_color ) . $important ); ?>;
691
+ color:#<?php echo esc_html( $success_text_color . $important ) ?>;
692
  border-radius:<?php echo esc_html( $border_radius . $important ) ?>;
693
  }
694
 
695
+ .<?php echo esc_html( $style_class ) ?> .frm_message p{
696
+ color:#<?php echo esc_html( $success_text_color . $important ) ?>;
697
+ }
698
+
699
  .<?php echo esc_html( $style_class ) ?> .frm_message{
700
  margin:5px 0 15px;
701
  font-size:<?php echo esc_html( $success_font_size . $important ) ?>;
770
  background-color:transparent<?php echo esc_html( $important ) ?>;
771
  border:none<?php echo esc_html( $important ) ?>;
772
  display:inline<?php echo esc_html( $important ) ?>;
773
+ width:auto<?php echo esc_html( $important ) ?>;
774
  padding:0<?php echo esc_html( $important ) ?>;
775
  }
776
 
909
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_four_col .frm_checkbox{
910
  float:right;
911
  }
912
+
913
+ .<?php echo esc_html( $style_class ) ?> .frm_catlevel_2,
914
+ .<?php echo esc_html( $style_class ) ?> .frm_catlevel_3,
915
+ .<?php echo esc_html( $style_class ) ?> .frm_catlevel_4,
916
+ .<?php echo esc_html( $style_class ) ?> .frm_catlevel_5{
917
+ margin-right:18px;
918
+ }
919
  <?php } ?>
920
  /* Start Chosen */
921
  .<?php echo esc_html( $style_class ) ?> .chosen-container{
css/custom_theme.css.php CHANGED
@@ -140,6 +140,10 @@ legend.frm_hidden{
140
  border:none;
141
  }
142
 
 
 
 
 
143
  .with_frm_style .auto_width #loginform input,
144
  .with_frm_style .auto_width input,
145
  .with_frm_style input.auto_width,
@@ -551,6 +555,13 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
551
  padding:6px 12px;
552
  }
553
 
 
 
 
 
 
 
 
554
  #ui-datepicker-div{
555
  display:none;
556
  z-index:999999 !important;
@@ -966,6 +977,12 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
966
  margin-right:4%;
967
  }
968
 
 
 
 
 
 
 
969
  .frm_form_field.frm_three_col .frm_radio,
970
  .frm_form_field.frm_three_col .frm_checkbox{
971
  width:30%;
@@ -1033,6 +1050,7 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
1033
  font-weight:bold;
1034
  -moz-box-shadow:none;
1035
  -webkit-box-shadow:none;
 
1036
  box-shadow:none !important;
1037
  display:inline;
1038
  -moz-appearance:textfield;
@@ -1377,7 +1395,7 @@ html[xmlns] .frm_clearfix{
1377
 
1378
  .with_frm_style .chosen-container-multi .chosen-choices li.search-field input[type="text"]{
1379
  margin:1px 0;
1380
- padding:0;
1381
  height:25px;
1382
  outline:0;
1383
  border:0 !important;
140
  border:none;
141
  }
142
 
143
+ .with_frm_style textarea{
144
+ height:auto;
145
+ }
146
+
147
  .with_frm_style .auto_width #loginform input,
148
  .with_frm_style .auto_width input,
149
  .with_frm_style input.auto_width,
555
  padding:6px 12px;
556
  }
557
 
558
+ select.frm_loading_lookup{
559
+ background-image: url(<?php echo FrmAppHelper::relative_plugin_url() ?>/images/ajax_loader.gif) !important;
560
+ background-position: 10px;
561
+ background-repeat: no-repeat;
562
+ color: transparent !important;
563
+ }
564
+
565
  #ui-datepicker-div{
566
  display:none;
567
  z-index:999999 !important;
977
  margin-right:4%;
978
  }
979
 
980
+ .frm_form_field .frm_checkbox,
981
+ .frm_form_field .frm_radio{
982
+ margin-top: 0;
983
+ margin-bottom: 0;
984
+ }
985
+
986
  .frm_form_field.frm_three_col .frm_radio,
987
  .frm_form_field.frm_three_col .frm_checkbox{
988
  width:30%;
1050
  font-weight:bold;
1051
  -moz-box-shadow:none;
1052
  -webkit-box-shadow:none;
1053
+ width:auto !important;
1054
  box-shadow:none !important;
1055
  display:inline;
1056
  -moz-appearance:textfield;
1395
 
1396
  .with_frm_style .chosen-container-multi .chosen-choices li.search-field input[type="text"]{
1397
  margin:1px 0;
1398
+ padding:0 !important;
1399
  height:25px;
1400
  outline:0;
1401
  border:0 !important;
css/font_icons.css CHANGED
@@ -22,10 +22,11 @@ select.frm_icon_font{
22
  }
23
 
24
  .frm_icon_font,
25
- a.frm_icon_font
26
  .frm_icon_font:hover,
27
  a.frm_icon_font:hover{
28
  text-decoration:none !important;
 
29
  }
30
 
31
  .frm_icon_font:focus,
22
  }
23
 
24
  .frm_icon_font,
25
+ a.frm_icon_font,
26
  .frm_icon_font:hover,
27
  a.frm_icon_font:hover{
28
  text-decoration:none !important;
29
+ box-shadow:none;
30
  }
31
 
32
  .frm_icon_font:focus,
css/frm_admin.css CHANGED
@@ -756,6 +756,37 @@ label input[type="checkbox"], label input[type="radio"] {vertical-align:inherit;
756
  margin-right:1px;
757
  }
758
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
759
  .frm_field_opts_list{
760
  height:105px; margin-top:10px;
761
  border:1px solid #ddd;
@@ -1274,12 +1305,17 @@ label.frm_action_events{
1274
  #frm_notification_settings .frm_email_buttons{
1275
  height: 22px;
1276
  line-height: 20px;
1277
- float:right;
 
 
 
 
 
1278
  }
1279
  #frm_notification_settings .frm_bcc_cc_container{
1280
  width:96px;
1281
  }
1282
- #frm_notification_settings .frm_bcc_button, .submitdelete.frm_delete_wo_post{
1283
  margin-left: 10px;
1284
  }
1285
  .frm_action_id{
756
  margin-right:1px;
757
  }
758
 
759
+ table.frm_name_value {
760
+ background-color: #f9f9f9;
761
+ border: 1px solid #ddd;
762
+ border-spacing: 0;
763
+ margin: 0;
764
+ width: 100%;
765
+ }
766
+
767
+ table.frm_name_value thead th {
768
+ background-color: #f1f1f1;
769
+ padding: 5px 8px 8px;
770
+ }
771
+
772
+ table.frm_name_value tr {
773
+ vertical-align: top;
774
+ }
775
+
776
+ table.frm_name_value td.left,
777
+ table.frm_name_value th.left {
778
+ width: 38%;
779
+ }
780
+
781
+ table.frm_name_value input,
782
+ table.frm_name_value select,
783
+ table.frm_name_value textarea {
784
+ margin: 8px;
785
+ width: 96%;
786
+ height:auto;
787
+ line-height:normal;
788
+ }
789
+
790
  .frm_field_opts_list{
791
  height:105px; margin-top:10px;
792
  border:1px solid #ddd;
1305
  #frm_notification_settings .frm_email_buttons{
1306
  height: 22px;
1307
  line-height: 20px;
1308
+ }
1309
+ #frm_notification_settings .frm_cc_button{
1310
+ float:left;
1311
+ }
1312
+ #frm_notification_settings .frm_bcc_button{
1313
+ float:right;
1314
  }
1315
  #frm_notification_settings .frm_bcc_cc_container{
1316
  width:96px;
1317
  }
1318
+ .submitdelete.frm_delete_wo_post{
1319
  margin-left: 10px;
1320
  }
1321
  .frm_action_id{
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 2.02.10
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 2.02.11
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
js/formidable.js CHANGED
@@ -140,6 +140,7 @@ function frmFrontFormJS(){
140
  maxFilesize: uploadFields[i].maxFilesize,
141
  maxFiles: max,
142
  uploadMultiple: uploadFields[i].uploadMultiple,
 
143
  dictDefaultMessage: uploadFields[i].defaultMessage,
144
  dictFallbackMessage: uploadFields[i].fallbackMessage,
145
  dictFallbackText: uploadFields[i].fallbackText,
@@ -771,7 +772,7 @@ function frmFrontFormJS(){
771
  }
772
 
773
  if ( checkedVals.length === 0 ) {
774
- checkedVals = '';
775
  }
776
 
777
  return checkedVals;
@@ -1689,7 +1690,7 @@ function frmFrontFormJS(){
1689
  triggerChange(jQuery(childSelect), childFieldArgs.fieldKey);
1690
  }
1691
  } else {
1692
- addLoadingTextToLookup( childSelect );
1693
 
1694
  // If all parents have values, check for updated options
1695
  jQuery.ajax({
@@ -1716,11 +1717,26 @@ function frmFrontFormJS(){
1716
  }
1717
  }
1718
 
1719
- function addLoadingTextToLookup( childSelect ) {
1720
- if ( ! childSelect.value ) {
1721
- childSelect.options.length = 1;
1722
- childSelect.options[1] = new Option(frm_js.loading, '', false, false);
1723
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1724
  }
1725
 
1726
  /**
@@ -1751,6 +1767,8 @@ function frmFrontFormJS(){
1751
 
1752
  maybeUpdateChosenOptions( childSelect );
1753
 
 
 
1754
  // Trigger a change if the new value is different from the old value
1755
  if ( childSelect.value != origVal ) {
1756
  triggerChange( jQuery(childSelect), fieldKey );
@@ -1816,6 +1834,8 @@ function frmFrontFormJS(){
1816
  currentValue = getValuesFromCheckboxInputs(inputs);
1817
  }
1818
 
 
 
1819
  jQuery.ajax({
1820
  type:'POST',
1821
  url:frm_js.ajax_url,
@@ -1826,6 +1846,7 @@ function frmFrontFormJS(){
1826
  field_id:childFieldArgs.fieldId,
1827
  row_index:childFieldArgs.repeatRow,
1828
  current_value:currentValue,
 
1829
  nonce:frm_js.nonce
1830
  },
1831
  success:function(newHtml){
@@ -1837,6 +1858,7 @@ function frmFrontFormJS(){
1837
  maybeHideRadioLookup( childFieldArgs, childDiv );
1838
  } else {
1839
  maybeShowRadioLookup( childFieldArgs, childDiv );
 
1840
  }
1841
 
1842
  triggerChange( jQuery( inputs[0] ), childFieldArgs.fieldKey );
@@ -1844,6 +1866,36 @@ function frmFrontFormJS(){
1844
  });
1845
  }
1846
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1847
  /**
1848
  * Hide a Radio Lookup field if it doesn't have any options
1849
  *
@@ -2591,10 +2643,21 @@ function frmFrontFormJS(){
2591
  return vals;
2592
  }
2593
 
 
 
 
2594
  calcField.each(function(){
2595
  var thisVal = getOptionValue( field.thisField, this );
2596
  thisVal = thisVal.trim();
2597
- vals[field.valKey] += thisVal;
 
 
 
 
 
 
 
 
2598
  });
2599
 
2600
  return vals;
@@ -3064,8 +3127,10 @@ function frmFrontFormJS(){
3064
 
3065
  jQuery(object).find('.frm_ajax_loading').removeClass('frm_loading_now');
3066
  var formID = jQuery(object).find('input[name="form_id"]').val();
3067
- jQuery(object).closest( '#frm_form_'+ formID +'_container' ).replaceWith( response.content );
3068
- frmFrontForm.scrollMsg( formID );
 
 
3069
 
3070
  if(typeof(frmThemeOverride_frmAfterSubmit) == 'function'){
3071
  var pageOrder = jQuery('input[name="frm_page_order_'+ formID +'"]').val();
@@ -3614,7 +3679,10 @@ function frmFrontFormJS(){
3614
  data:{action:'frm_entries_destroy', entry:entry_id, nonce:frm_js.nonce},
3615
  success:function(html){
3616
  if(html.replace(/^\s+|\s+$/g,'') == 'success'){
3617
- jQuery(document.getElementById(prefix+entry_id)).fadeOut('slow');
 
 
 
3618
  jQuery(document.getElementById('frm_delete_'+entry_id)).fadeOut('slow');
3619
  }else{
3620
  jQuery(document.getElementById('frm_delete_'+entry_id)).replaceWith(html);
140
  maxFilesize: uploadFields[i].maxFilesize,
141
  maxFiles: max,
142
  uploadMultiple: uploadFields[i].uploadMultiple,
143
+ hiddenInputContainer:'#'+ form.attr('id'),
144
  dictDefaultMessage: uploadFields[i].defaultMessage,
145
  dictFallbackMessage: uploadFields[i].fallbackMessage,
146
  dictFallbackText: uploadFields[i].fallbackText,
772
  }
773
 
774
  if ( checkedVals.length === 0 ) {
775
+ checkedVals = false;
776
  }
777
 
778
  return checkedVals;
1690
  triggerChange(jQuery(childSelect), childFieldArgs.fieldKey);
1691
  }
1692
  } else {
1693
+ disableLookup( childSelect );
1694
 
1695
  // If all parents have values, check for updated options
1696
  jQuery.ajax({
1717
  }
1718
  }
1719
 
1720
+ /**
1721
+ * Disable a Select Lookup field and add loading image
1722
+ *
1723
+ * @since 2.02.11
1724
+ * @param {object} childSelect
1725
+ */
1726
+ function disableLookup( childSelect ) {
1727
+ childSelect.className = childSelect.className + ' frm_loading_lookup';
1728
+ childSelect.disabled = true;
1729
+ }
1730
+
1731
+ /**
1732
+ * Enable a Select Lookup field and remove loading image
1733
+ *
1734
+ * @since 2.02.11
1735
+ * @param {object} childSelect
1736
+ */
1737
+ function enableLookup( childSelect ) {
1738
+ childSelect.disabled = false;
1739
+ childSelect.className = childSelect.className.replace( ' frm_loading_lookup', '' );
1740
  }
1741
 
1742
  /**
1767
 
1768
  maybeUpdateChosenOptions( childSelect );
1769
 
1770
+ enableLookup( childSelect );
1771
+
1772
  // Trigger a change if the new value is different from the old value
1773
  if ( childSelect.value != origVal ) {
1774
  triggerChange( jQuery(childSelect), fieldKey );
1834
  currentValue = getValuesFromCheckboxInputs(inputs);
1835
  }
1836
 
1837
+ var defaultValue = jQuery( inputs[0] ).data( 'frmval' );
1838
+
1839
  jQuery.ajax({
1840
  type:'POST',
1841
  url:frm_js.ajax_url,
1846
  field_id:childFieldArgs.fieldId,
1847
  row_index:childFieldArgs.repeatRow,
1848
  current_value:currentValue,
1849
+ default_value:defaultValue,
1850
  nonce:frm_js.nonce
1851
  },
1852
  success:function(newHtml){
1858
  maybeHideRadioLookup( childFieldArgs, childDiv );
1859
  } else {
1860
  maybeShowRadioLookup( childFieldArgs, childDiv );
1861
+ maybeSetDefaultCbRadioValue( childFieldArgs, inputs, defaultValue );
1862
  }
1863
 
1864
  triggerChange( jQuery( inputs[0] ), childFieldArgs.fieldKey );
1866
  });
1867
  }
1868
 
1869
+ /**
1870
+ * Select the defatul value in a radio/checkbox field if no value is selected
1871
+ *
1872
+ * @since 2.02.11
1873
+ *
1874
+ * @param {Object} inputs
1875
+ * @param {Object} childFieldArgs
1876
+ * @param {string} childFieldArgs.inputType
1877
+ * @param {(string|Array)} defaultValue
1878
+ */
1879
+ function maybeSetDefaultCbRadioValue( childFieldArgs, inputs, defaultValue ) {
1880
+ if ( defaultValue === undefined ) {
1881
+ return;
1882
+ }
1883
+
1884
+ var currentValue = false;
1885
+ if ( childFieldArgs.inputType == 'radio' ) {
1886
+ currentValue = getValueFromRadioInputs( inputs );
1887
+ } else {
1888
+ currentValue = getValuesFromCheckboxInputs(inputs);
1889
+ }
1890
+
1891
+ if ( currentValue !== false || inputs.length < 1 ) {
1892
+ return;
1893
+ }
1894
+
1895
+ var inputName = inputs[0].name;
1896
+ setCheckboxOrRadioDefaultValue( inputName, defaultValue )
1897
+ }
1898
+
1899
  /**
1900
  * Hide a Radio Lookup field if it doesn't have any options
1901
  *
2643
  return vals;
2644
  }
2645
 
2646
+ var count = 0;
2647
+ var sep = '';
2648
+
2649
  calcField.each(function(){
2650
  var thisVal = getOptionValue( field.thisField, this );
2651
  thisVal = thisVal.trim();
2652
+
2653
+ if ( count > 0 ) {
2654
+ sep = ', ';
2655
+ }
2656
+
2657
+ if ( thisVal !== '' ) {
2658
+ vals[field.valKey] += sep + thisVal;
2659
+ count++;
2660
+ }
2661
  });
2662
 
2663
  return vals;
3127
 
3128
  jQuery(object).find('.frm_ajax_loading').removeClass('frm_loading_now');
3129
  var formID = jQuery(object).find('input[name="form_id"]').val();
3130
+ jQuery(object).closest( '.frm_forms' ).replaceWith( response.content );
3131
+ if ( frm_js.offset != -1 ) {
3132
+ frmFrontForm.scrollMsg( formID, jQuery(object) );
3133
+ }
3134
 
3135
  if(typeof(frmThemeOverride_frmAfterSubmit) == 'function'){
3136
  var pageOrder = jQuery('input[name="frm_page_order_'+ formID +'"]').val();
3679
  data:{action:'frm_entries_destroy', entry:entry_id, nonce:frm_js.nonce},
3680
  success:function(html){
3681
  if(html.replace(/^\s+|\s+$/g,'') == 'success'){
3682
+ var container = jQuery(document.getElementById(prefix+entry_id));
3683
+ container.fadeOut('slow', function(){
3684
+ container.remove();
3685
+ });
3686
  jQuery(document.getElementById('frm_delete_'+entry_id)).fadeOut('slow');
3687
  }else{
3688
  jQuery(document.getElementById('frm_delete_'+entry_id)).replaceWith(html);
js/formidable.min.js CHANGED
@@ -1,96 +1,97 @@
1
- function frmFrontFormJS(){function l(a){var b=jQuery(this),c=b.attr("type");"submit"!==c&&a.preventDefault();a=b.parents("form:first");var d=b="",e=this.name;if("frm_prev_page"===e||-1!==this.className.indexOf("frm_prev_page"))b=jQuery(a).find(".frm_next_page").attr("id").replace("frm_next_p_","");else if("frm_save_draft"===e||-1!==this.className.indexOf("frm_save_draft"))d=1;jQuery(".frm_next_page").val(b);jQuery(".frm_saving_draft").val(d);"submit"!==c&&a.trigger("submit")}function n(){jQuery(this).parent().children(".frm_toggle_container").slideToggle("fast");
2
- jQuery(this).toggleClass("active").children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-e")}function p(){for(var a=__frmUniqueTimes,b=0;b<a.length;b++)a[b].dateID==this.id&&frmFrontForm.removeUsedTimes(this,a[b].timeID)}function r(){if(-1===this.className.indexOf("frm_custom_date")&&"undefined"!==typeof __frmDatepicker){var a=__frmDatepicker,b=this.id,c=b.split("-");c.pop();c='input[id^="'+c.join("-")+'"]';jQuery.datepicker.setDefaults(jQuery.datepicker.regional[""]);
3
  for(var d=0,e=0;e<a.length;e++)if(a[e].triggerID=="#"+b||a[e].triggerID==c)d=e;""!==a[d].options.defaultDate&&(a[d].options.defaultDate=new Date(a[d].options.defaultDate));jQuery(this).datepicker(jQuery.extend(jQuery.datepicker.regional[a[d].locale],a[d].options))}}function v(a){if("undefined"!==typeof __frmDropzone)for(var b=__frmDropzone,c=0;c<b.length;c++)z(c,a)}function z(a,b){var c=__frmDropzone,d="#"+c[a].htmlID+"_dropzone",e=c[a].fieldName;"undefined"!==typeof b&&-1!==d.indexOf("-0_dropzone")&&
4
  (d=d.replace("-0_dropzone","-"+b+"_dropzone"),e=e.replace("[0]","["+b+"]"),delete c[a].mockFiles);d=jQuery(d);if(!(1>d.length||d.hasClass("dz-clickable"))){var f=c[a].maxFiles;if("undefined"!==typeof c[a].mockFiles){var h=c[a].mockFiles.length;0<f&&(f-=h)}var h=d.closest("form"),g=h.find('input[type="submit"], .frm_submit input[type="button"]'),k=h.find(".frm_ajax_loading");d.dropzone({url:frm_js.ajax_url,addRemoveLinks:!0,paramName:d.attr("id").replace("_dropzone",""),maxFilesize:c[a].maxFilesize,
5
- maxFiles:f,uploadMultiple:c[a].uploadMultiple,dictDefaultMessage:c[a].defaultMessage,dictFallbackMessage:c[a].fallbackMessage,dictFallbackText:c[a].fallbackText,dictFileTooBig:c[a].fileTooBig,dictInvalidFileType:c[a].invalidFileType,dictResponseError:c[a].responseError,dictCancelUpload:c[a].cancel,dictCancelUploadConfirmation:c[a].cancelConfirm,dictRemoveFile:c[a].remove,dictMaxFilesExceeded:c[a].maxFilesExceeded,fallback:function(){jQuery(this.element).closest("form").removeClass("frm_ajax_submit")},
6
  init:function(){this.on("sending",function(b,d,e){e.append("action","frm_submit_dropzone");e.append("field_id",c[a].fieldID);e.append("form_id",c[a].formID)});this.on("success",function(b,d){for(var f=jQuery.parseJSON(d),g=0;g<f.length;g++)!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val(f[g])});this.on("successmultiple",function(b,d){for(var f=jQuery.parseJSON(d),g=0;g<b.length;g++)jQuery(b[g].previewElement).append(y(c[a],f[g],e))});this.on("complete",function(b){if("undefined"!==typeof b.mediaID){c[a].uploadMultiple&&
7
  jQuery(b.previewElement).append(y(c[a],b.mediaID,e));for(var d=b.previewElement.querySelectorAll("[data-dz-name]"),f=0,g=d.length;f<g;f++)d[f].innerHTML='<a href="'+b.url+'">'+b.name+"</a>"}});this.on("addedfile",function(){k.addClass("frm_loading_now");g.attr("disabled","disabled")});this.on("queuecomplete",function(){k.removeClass("frm_loading_now");g.removeAttr("disabled")});this.on("removedfile",function(b){!1!==b.accepted&&!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val("");!1!==
8
  b.accepted&&"undefined"!==typeof b.mediaID&&(jQuery(b.previewElement).remove(),this.options.maxFiles=c[a].maxFiles-this.files.length)});if("undefined"!==typeof c[a].mockFiles)for(var b=0;b<c[a].mockFiles.length;b++){var d={name:c[a].mockFiles[b].name,size:c[a].mockFiles[b].size,url:c[a].mockFiles[b].file_url,mediaID:c[a].mockFiles[b].id};this.emit("addedfile",d);this.emit("thumbnail",d,c[a].mockFiles[b].url);this.emit("complete",d);this.files.push(d)}}})}}function y(a,b,c){return'<input name="'+c+
9
- '[]" type="hidden" value="'+b+'" data-frmfile="'+a.fieldID+'" />'}function w(){var a=jQuery(this).data("frm-remove");Pa(jQuery(this).parent(".dz-preview"));a=jQuery('input[name="'+a+'"]');a.length&&a.val("")}function A(){var a=this.type,b=!1,c=!1;if("select-one"===a)c=!0,"frm_other_trigger"===this.options[this.selectedIndex].className&&(b=!0);else if("select-multiple"===a)for(var c=!0,d=this.options,b=!1,e=0;e<d.length;e++)if("frm_other_trigger"===d[e].className&&d[e].selected){b=!0;break}c?(a=jQuery(this).parent().children(".frm_other_input"),
10
  a.length&&(b?a[0].className=a[0].className.replace("frm_pos_none",""):(1>a[0].className.indexOf("frm_pos_none")&&(a[0].className+=" frm_pos_none"),a[0].value=""))):"radio"===a?jQuery(this).is(":checked")&&(jQuery(this).closest(".frm_radio").children(".frm_other_input").removeClass("frm_pos_none"),jQuery(this).closest(".frm_radio").siblings().children(".frm_other_input").addClass("frm_pos_none").val("")):"checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):
11
- jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function G(a){var b=q(this,!1);if(b&&"undefined"!==typeof b&&(!a.frmTriggered||a.frmTriggered!=b)&&(ea(b,jQuery(this)),a="undefined"!==typeof a.originalEvent||-1<a.currentTarget.className.indexOf("frm_chzn")?"value changed":"other",fa(b,jQuery(this),a),L(b,jQuery(this)),jQuery(this).closest("form").hasClass("frm_js_validate"))){b=[];a=jQuery(this).closest(".frm_form_field");a.hasClass("frm_required_field")&&
12
- !jQuery(this).hasClass("frm_optional")&&(b=ga(this,b));if(1>b.length)if("email"==this.type)var c=jQuery(this).closest("form").find("input[type=email]"),b=ha(this,b,c);else"number"==this.type?b=ia(this,b):null!==this.pattern&&(b=ja(this,b));a.removeClass("frm_blank_field");a.find(".frm_error").remove();if(0<Object.keys(b).length)for(var d in b)M(a,d,b)}}function q(a,b){var c="",c=a instanceof jQuery?a.attr("name"):a.name;if(""===c)return c=a instanceof jQuery?a.data("name"):a.getAttribute("data-name"),
13
- ""!==c&&c?c:0;c=c.replace("item_meta[","").replace("[]","").split("]");if(1>c.length)return 0;var c=c.filter(function(a){return""!==a}),d=c[0],e=!1;if(1===c.length)return d;if("[form"===c[1]||"[row_ids"===c[1])return 0;jQuery('input[name="item_meta['+d+'][form]"]').length&&(d=c[2].replace("[",""),e=!0);"other"===d&&(d=e?c[3].replace("[",""):c[1].replace("[",""));!0===b&&(d=d===c[0]?d+"-"+c[1].replace("[",""):d+"-"+c[0]+"-"+c[1].replace("[",""));return d}function ea(a,b){if(!("undefined"===typeof __FRMRULES||
14
- "undefined"===typeof __FRMRULES[a]||1>__FRMRULES[a].dependents.length||null===b||"undefined"===typeof b))for(var c=__FRMRULES[a],d=H(b[0].name),e=0,f=c.dependents.length;e<f;e++)I(c.dependents[e],d)}function I(a,b){var c=N(a);if(!(!1===c||1>c.conditions.length)){var d;d=[];if(c.isRepeating)if(""!==b.repeatingSection){var e="frm_field_"+c.fieldId+"-",e=e+(b.repeatingSection+"-"+b.repeatRow+"_container");d.push(e)}else if(d=O(c),null!==document.getElementById("frm_field_"+d+"_container")){d=[];for(var e=
15
- document.querySelectorAll(".frm_field_"+c.fieldId+"_container"),f=0,h=e.length;f<h;f++)d.push(e[f].id)}else{d=[];for(var f=O(c),e="frm_field_"+c.fieldId+"-"+f+"-",f=document.querySelectorAll('[name="item_meta['+f+'][row_ids][]"]'),h=0,g=f.length;h<g;h++)""!==f[h].value&&d.push(e+f[h].value+"_container");1>d.length&&d.push(e+"0_container")}else d.push("frm_field_"+c.fieldId+"_container");e=d.length;for(f=0;f<e;f++)c.containerId=d[f],ka(c,d[f]),la(c)}}function O(a){var b="";"0"!==a.inEmbedForm?b=a.inEmbedForm:
16
- "0"!==a.inSection&&(b=a.inSection);return b}function ka(a,b){if(a.isRepeating){var c=b.replace("_container","").split("-");a.repeatRow=c[2]}else a.repeatRow=""}function la(a){for(var b=[],c=a.conditions.length,d=0;d<c;d++)b.push(Qa(a.conditions[d],a));c=C="any"==a.anyAll?-1<b.indexOf(!0)?a.showHide:ma(a.showHide):-1<b.indexOf(!1)?ma(a.showHide):a.showHide;b=null!==document.getElementById(a.containerId);"show"==c?"data"==a.fieldType&&a.hasOwnProperty("dataLogic")?(a={fieldId:a.fieldId,fieldKey:a.fieldKey,
17
- formId:a.formId,containerId:a.containerId,repeatRow:a.repeatRow,dataLogic:{actualValue:a.dataLogic.actualValue,fieldId:a.dataLogic.fieldId},children:"",inputType:a.inputType},"data"==a.inputType?Ra(a,b):b&&Sa(a)):!1!==B(a.containerId,a.formId)&&(D(a.containerId,a.formId),b?(b=na(a.containerId),oa(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId),jQuery("#"+a.containerId).show()):(b=pa(a),oa(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId))):P(a,b)}function N(a){return"undefined"===typeof __FRMRULES||
18
- "undefined"===typeof __FRMRULES[a]?!1:__FRMRULES[a]}function Qa(a,b){var c=N(a.fieldId),d=qa(c,b);"data"==b.fieldType&&"data"==c.fieldType?(c=""===a.value?""===d||1==d.length&&""===d[0]?!1:!0:Q(a.operator,a.value,d),b.dataLogic=a,b.dataLogic.actualValue=d,d=c):d=Q(a.operator,a.value,d);return d}function qa(a,b){var c;if("radio"==a.inputType||"checkbox"==a.inputType)c=ra(a,b),c=document.querySelectorAll('input[name^="'+c+'"]'),c="checkbox"==a.inputType?R(c):sa(c);else if(c="",!0===a.isMultiSelect){c=
19
- ra(a,b);var d=document.querySelectorAll('[name^="'+c+'"]');1==d.length&&"hidden"!=d[0].type?(c=jQuery('[name^="'+c+'"]').val(),null===c&&(c="")):c=R(d)}else d="field_"+a.fieldKey,a.isRepeating&&(d+="-"+b.repeatRow),d=document.getElementById(d),null!==d&&(c=d.value);"undefined"===typeof c?c="":"string"===typeof c&&(c=c.trim());return c}function ra(a,b){return a.isRepeating?"item_meta["+("0"!==b.inEmbedForm?b.inEmbedForm:b.inSection)+"]["+b.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]"}function R(a){for(var b=
20
- [],c=0,d=a.length;c<d;c++)("hidden"==a[c].type||a[c].checked)&&b.push(a[c].value);0===b.length&&(b="");return b}function Q(a,b,c){b=Ta(b);c=Ua(b,c);return"string"===typeof b&&"-1"!=b.indexOf("&quot;")&&Q(a,b.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){if(!b)return!1;a=S(a);b=ta(a,b);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;a=S(a);b=ta(a,b);return-1==
21
- b.indexOf(a)}}[a](b,c)}function Ta(a){-1!==String(a).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)?a=parseFloat(a):"string"===typeof a&&(a=a.trim());return a}function Ua(a,b){"undefined"===typeof b&&(b="");jQuery.isArray(b)&&-1<jQuery.inArray(String(a),b)&&(b=a);"number"===typeof a&&"string"===typeof b&&(b=parseFloat(b));"string"===typeof b&&(b=b.trim());return b}function ta(a,b){b=S(b);var c;if(jQuery.isArray(b))for(var d=0,e=b.length;d<e;d++)if(c=b[d].toLowerCase(),-1<c.indexOf(a)){b=a;break}return b}
22
- function S(a){"string"===typeof a?a=a.toLowerCase():"number"===typeof a&&(a=a.toString());return a}function ma(a){return"show"==a?"hide":"show"}function na(a){return document.getElementById(a).querySelectorAll('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]')}function pa(a){if("divider"==a.fieldType){var b=[];"divider"==a.fieldType&&(b=document.querySelectorAll('[data-sectionid="'+a.fieldId+'"]'));a=b}else"form"==a.fieldType?a=document.querySelectorAll('[id^="field_'+
23
- a.fieldKey+'-"]'):(a=a.isRepeating?"item_meta["+O(a)+"]["+a.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]",a=document.querySelectorAll('[name^="'+a+'"]'));return a}function oa(a,b,c){if(a.length)for(var d,e=["checkbox","radio"],f=0;f<a.length;f++)if(!(0<f&&"undefined"!==typeof d&&d.name==a[f].name&&-1<e.indexOf(d.type)||b&&T(a[f],c))){d=a[f];var h=jQuery(d),g=h.data("frmval");if("undefined"!==typeof g){if("checkbox"==d.type||"radio"==d.type)for(var k=document.getElementsByName(d.name),m=
24
- 0,l=k.length;m<l;m++)if("hidden"==k[m].type)jQuery.isArray(g)&&null!==g[m]?k[m].value=g[m]:k[m].value=g;else{if(k[m].value==g||jQuery.isArray(g)&&-1<g.indexOf(k[m].value))if(k[m].checked=!0,"radio"==k[m].type)break}else if(-1<d.name.indexOf("[]"))if(k=document.getElementsByName(d.name),jQuery.isArray(g))for(m=0,l=g.length;m<l;m++)m in k&&(k[m].value=g[m]);else null!==k[0]&&(k[0].value=g);else g.constructor===Object&&(k=d.getAttribute("name").split("[").slice(-1)[0],null!==k&&(k=k.replace("]",""),
25
- g=g[k],"undefined"==typeof g&&(g=""))),d.value=g;"SELECT"==d.tagName&&U(d);u(h)}d=a[f];h=q(d,!1);h=V(h);!1!==h&&"lookup"!=h.fieldType&&(h.parentVals=W(h),ua(h,d));d=a[f];if(h="undefined"!==typeof __FRMCALC){h=d.type;g=!1;if("text"==h||"hidden"==h||"number"==h)g=!0;h=g}if(h){h=__FRMCALC;g=d.name;k=d.id.replace("field_","");if(3<=g.split("][").length)for(g=k.split("-"),k="",m=0;m<g.length-1;m++)k=""===k?g[m]:k+"-"+g[m];g=k;k=null;3<=d.name.split("][").length&&(k="hidden"!=d.type?jQuery(d).closest(".frm_form_field"):
26
- jQuery(d));d=k;void 0!==h.calc[g]&&X(h,g,[],d)}d=a[f]}}function T(a,b){var c=q(a,!0);return B("frm_field_"+c+"_container",b)}function P(a,b){if(!B(a.containerId,a.formId)){if(b){jQuery("#"+a.containerId).hide();var c=na(a.containerId)}else c=pa(a);Y(c);va(a.containerId,a.formId)}}function Y(a){if(!(1>a.length)){for(var b,c=!0,d=0,e=a.length;d<e;d++)0<d&&b.name!=a[d].name&&!0===c&&u(jQuery(b)),c=!0,"radio"==a[d].type||"checkbox"==a[d].type?a[d].checked=!1:"SELECT"==a[d].tagName?(0===a[d].selectedIndex?
27
- c=!1:a[d].selectedIndex=0,b=a[d].id.replace(/[^\w]/g,"_"),null!==document.getElementById(b+"_chosen")&&jQuery(a[d]).trigger("chosen:updated")):a[d].value="",b=a[d];!0===c&&u(jQuery(b))}}function B(a,b){var c=!1;-1<E(b).indexOf(a)&&(c=!0);return c}function va(a,b){var c=E(b);if(!(-1<c.indexOf(a))){c.push(a);var c=JSON.stringify(c),d=document.getElementById("frm_hide_fields_"+b);null!==d&&(d.value=c)}}function E(a){var b=[];a=document.getElementById("frm_hide_fields_"+a);return null===a?b:b=(b=a.value)?
28
- JSON.parse(b):[]}function D(a,b){var c=E(b),d=c.indexOf(a);-1<d&&(c.splice(d,1),c=JSON.stringify(c),document.getElementById("frm_hide_fields_"+b).value=c)}function fa(a,b,c){if(!("undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]||1>__FRMLOOKUP[a].dependents.length||null===b||"undefined"===typeof b)){a=__FRMLOOKUP[a];b=H(b[0].name);for(var d=0,e=a.dependents.length;d<e;d++)Z(a.dependents[d],b,c)}}function Z(a,b,c){a=V(a);if(!(!1===a||1>a.parents.length))if("lookup"==a.fieldType){if(""!==
29
- b.repeatRow){c=[];var d="frm_field_"+a.fieldId+"-",d=d+(b.repeatingSection+"-"+b.repeatRow+"_container");b=document.getElementById(d);null!==b&&c.push(b);b=c}else b=[],a.isRepeating?b=document.querySelectorAll(".frm_field_"+a.fieldId+"_container"):(c=document.getElementById("frm_field_"+a.fieldId+"_container"),null!==c&&b.push(c));c=0;for(d=b.length;c<d;c++){ka(a,b[c].id);var e=a,f=b[c];e.parentVals=W(e);if("select"==e.inputType)Va(e,f);else if("radio"==e.inputType||"checkbox"==e.inputType)if(!1===
30
- e.parentVals){var h=f.getElementsByTagName("input");wa(e,f);Y(h)}else Wa(e,f)}}else if("value changed"===c)for(c="field_"+a.fieldKey,c=a.isRepeating?""!==b.repeatingSection?'[id="'+c+"-"+b.repeatRow+'"]':'[id^="'+c+'-"]':'[id="'+c+'"]',b=document.querySelectorAll(c),c=0,d=b.length;c<d;c++)e=a,f=H(b[c].name),e.repeatRow=""!==f.repeatRow?f.repeatRow:"",e=a,f=b[c],e.parentVals=W(e),ua(e,f)}function V(a){return"undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]?!1:__FRMLOOKUP[a]}function W(a){for(var b=
31
- [],c=a.parents,d,e=0,f=c.length;e<f;e++){d=V(c[e]);d=qa(d,a);if(""===d||!1===d){b=!1;break}b[e]=d}return b}function sa(a){for(var b=!1,c=a.length,d=0;d<c;d++)if("hidden"==a[d].type||a[d].checked){b=a[d].value;break}return b}function Va(a,b){var c=b.getElementsByTagName("SELECT")[0];if(null!==c){var d=c.value;!1===a.parentVals?(c.options.length=1,""!==d&&(c.value="",U(c),u(jQuery(c),a.fieldKey))):(Xa(c),jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_lookup_field_options",parent_fields:a.parents,
32
- parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(b){var d=a.fieldKey,e=c.value;b=JSON.parse(b);for(var g=c.options.length;0<g;g--)c.remove(g);for(var k=b.length,g=0;g<k;g++)c.options[g+1]=new Option(b[g],b[g],!1,!1);c.value=e;""===c.value&&(b=c.getAttribute("data-frmval"),null!==b&&(c.value=b));U(c);c.value!=e&&u(jQuery(c),d)}}))}}function U(a){-1<a.className.indexOf("frm_chzn")&&jQuery().chosen&&jQuery(a).trigger("chosen:updated")}function Xa(a){a.value||(a.options.length=
33
- 1,a.options[1]=new Option(frm_js.loading,"",!1,!1))}function Wa(a,b){var c=b.getElementsByClassName("frm_opt_container")[0],d=c.getElementsByTagName("input");Ya(b,c);var e="",e="radio"==a.inputType?sa(d):R(d);jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_cb_radio_lookup_options",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,row_index:a.repeatRow,current_value:e,nonce:frm_js.nonce},success:function(e){c.innerHTML=e;e=b.getElementsByClassName("frm-loading-img")[0];
34
- null!==e&&void 0!==e&&e.parentNode.removeChild(e);c.style.display="block";1==d.length&&""===d[0].value?wa(a,b):!1!==B(b.id,a.formId)&&(e=N(a.fieldId),!1===e||1>e.conditions.length?(D(b.id,a.formId),jQuery("#"+b.id).show()):(e.containerId=b.id,e.repeatRow=a.repeatRow,la(e)));u(jQuery(d[0]),a.fieldKey)}})}function wa(a,b){B(b.id,a.formId)||(jQuery("#"+b.id).hide(),va(b.id,a.formId))}function ua(a,b){if(!T(b,a.formId))if(!1===a.parentVals){var c=b.getAttribute("data-frmval");null===c&&(c="");xa(a,b,
35
- c)}else jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_get_lookup_text_value",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(c){b.value!=c&&xa(a.fieldKey,b,c)}})}function xa(a,b,c){b.value=c;u(jQuery(b),a)}function Ra(a,b){if(b){var c=jQuery("#"+a.containerId);ya(c)}jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:a.dataLogic.actualValue,current_field:a.fieldId,hide_id:a.containerId,
36
- nonce:frm_js.nonce},success:function(d){if(b){var e=c.find(".frm_opt_container");e.html(d);var f=e.children("input"),h=f.val();za(e);""===d||""===h?P(a,!0):Aa(a,c,f,!0)}else e="field_"+a.fieldKey,""!==a.repeatRow&&(e+="-"+a.repeatRow),e=document.getElementById(e),e.value=d,B(a.containerId,a.formId)&&D(a.containerId,a.formId),u(jQuery(e))}})}function Sa(a,b){var c=jQuery("#"+a.containerId),d=c.find('select[name^="item_meta"], input[name^="item_meta"]'),e=Ba(d),d=d.data("frmval"),f=c.closest("form").find('input[name="id"]').val();
37
- ya(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_data_options",trigger_field_id:a.dataLogic.fieldId,entry_id:a.dataLogic.actualValue,field_id:a.fieldId,default_value:d,container_id:a.containerId,editing_entry:f,prev_val:e,nonce:frm_js.nonce},success:function(b){var d=c.find(".frm_opt_container");d.html(b);var f=d.find('select, input[type="checkbox"], input[type="radio"]');za(d);""===b||1>f.length?P(a,!0):(b=Ba(f),Aa(a,c,f,e!==b))}})}function ya(a){var b=a.html();-1<
38
- b.indexOf("frm-loading-img")||(a.html(b+'<span class="frm-loading-img"></span>'),a.find(".frm_opt_container").hide())}function Ya(a,b){if(!(-1<a.innerHTML.indexOf("frm-loading-img"))){b.style.display="none";var c=document.createElement("span");c.setAttribute("class","frm-loading-img");a.insertBefore(c,b.nextSibling)}}function za(a){a.parent().children(".frm-loading-img").remove();a.show()}function Ba(a){var b=[],c="";a.each(function(){c=this.value;"radio"===this.type||"checkbox"===this.type?!0===
39
- this.checked&&b.push(c):""!==c&&b.push(c)});0===b.length&&(b="");return b}function Aa(a,b,c,d){B(a.containerId,a.formId)&&(D(a.containerId,a.formId),b.show());c.hasClass("frm_chzn")&&aa();!0===d&&u(c)}function L(a,b){if("undefined"!==typeof __FRMCALC){var c=__FRMCALC,d=c.fields[a];if("undefined"!==typeof d)for(var d=d.total,e=[],f=0,h=d.length;f<h;f++){var g;g=c.calc[d[f]];var k=b.attr("name"),m=!1,l=g.field_id,n=E(g.form_id);1>n.length||("0"===g.inSection&&"0"===g.inEmbedForm?m=J(l,n):(k=H(k),J(l,
40
- n)?m=!0:Ca(l,k,n)?m=!0:"0"!==g.inSection&&"0"!==g.inEmbedForm?m=Ca(g.inSection,k,n):"0"!==g.inSection?m=J(g.inSection,n):"0"!==g.inEmbedForm&&(m=J(g.inEmbedForm,n))));g=m;!1===g&&X(c,d[f],e,b)}}}function J(a,b){return-1<b.indexOf("frm_field_"+a+"_container")}function Ca(a,b,c){var d=!1;b.repeatingSection&&(a="frm_field_"+a+"-"+b.repeatingSection,a+="-"+b.repeatRow+"_container",d=-1<c.indexOf(a));return d}function X(a,b,c,d){var e=a.calc[b],f=e.calc,h=jQuery(document.getElementById("field_"+b)),g=
41
- {triggerField:d,inSection:!1,thisFieldCall:'input[id^="field_'+b+'-"]'};1>h.length&&"undefined"!==typeof d&&(g.inSection=!0,g.thisFieldId=Za(a.fieldsWithCalc,b),h=Da(g));if(!(1>h.length)){f=$a(e,f,a,c,g);if("text"!=e.calc_type){a=e.calc_dec;-1<f.indexOf(").toFixed(")&&(c=f.split(").toFixed("),Ea(c[1])&&(a=c[1],f=f.replace(").toFixed("+a,"")));f=parseFloat(eval(f));if("undefined"===typeof f||isNaN(f))f=0;Ea(a)&&(f=f.toFixed(a))}h.val()!=f&&(h.val(f),u(h,b))}}function $a(a,b,c,d,e){for(var f=0,h=a.fields.length;f<
42
- h;f++){var g={triggerField:e.triggerField,thisFieldId:a.fields[f],inSection:e.inSection,valKey:e.inSection+""+a.fields[f],thisField:c.fields[a.fields[f]],thisFieldCall:"input"+c.fieldKeys[a.fields[f]]},k=c;"checkbox"==g.thisField.type||"radio"==g.thisField.type||"scale"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,"+g.thisFieldCall+"[type=hidden]":"select"==g.thisField.type||"time"==g.thisField.type?g.thisFieldCall="select"+k.fieldKeys[g.thisFieldId]+" option:selected,"+g.thisFieldCall+
43
- "[type=hidden]":"textarea"==g.thisField.type&&(g.thisFieldCall=g.thisFieldCall+",textarea"+k.fieldKeys[g.thisFieldId]);if("text"==a.calc_type)g.valKey="text"+g.valKey,d=ab(g,d),"undefined"===typeof d[g.valKey]&&(d[g.valKey]="");else{g.valKey="num"+g.valKey;d=bb(g,c,d);if("undefined"===typeof d[g.valKey]||isNaN(d[g.valKey]))d[g.valKey]=0;"date"==g.thisField.type&&0===d[g.valKey]&&(b="")}k="["+g.thisFieldId+"]";k=k.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");b=b.replace(new RegExp(k,"g"),d[g.valKey])}return b}
44
- function bb(a,b,c){if("undefined"!==typeof c[a.valKey]&&0!==c[a.valKey])return c;c[a.valKey]=0;var d=Fa(a);if(!1===d)return c;d.each(function(){var d=Ga(a.thisField,this);if("date"==a.thisField.type){var f;f=b.date;var h=0;if(d)if("undefined"===typeof jQuery.datepicker){h="-";-1<f.indexOf("/")&&(h="/");f=f.split(h);var d=d.split(h),g,k;g=h=k="";for(var m=0;m<f.length;m++)if("y"==f[m])g=((new Date).getFullYear()+15).toString().substr(2,2),g=d[m]>g?"19"+d[m]:"20"+d[m];else if("yy"==f[m])g=d[m];else if("m"==
45
- f[m]||"mm"==f[m])h=d[m],2>h.length&&(h="0"+h);else if("d"==f[m]||"dd"==f[m])k=d[m],2>k.length&&(k="0"+k);h=Date.parse(g+"-"+h+"-"+k)}else h=jQuery.datepicker.parseDate(f,d);f=h;null!==f&&(c[a.valKey]=Math.ceil(f/864E5))}else{f=d;""!==f&&0!==f&&(f=f.trim(),f=parseFloat(f.replace(/,/g,"").match(/-?[\d\.]+$/)));if("undefined"===typeof f||isNaN(f)||""===f)f=0;c[a.valKey]+=f}});return c}function ab(a,b){if("undefined"!==typeof b[a.valKey]&&""!==b[a.valKey])return b;b[a.valKey]="";var c=Fa(a);if(!1===c)return b;
46
- c.each(function(){var c=Ga(a.thisField,this),c=c.trim();b[a.valKey]+=c});return b}function Fa(a){var b;if(!1===a.inSection)b=jQuery(a.thisFieldCall);else if(b=Da(a),null===b||"undefined"===typeof b)b=jQuery(a.thisFieldCall);if(null===b||"undefined"===typeof b||1>b.length)b=!1;return b}function Da(a){if("undefined"===typeof a.triggerField)return null;var b=a.triggerField.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");return b.length?(a=a.thisFieldCall.replace("[id=","[id^="),b.find(a)):
47
- null}function Ga(a,b){var c;c=!1;if("hidden"==b.type)""!==ba(b)&&(c=!0);else if("select"==a.type){var d=b.className;d&&-1<d.indexOf("frm_other_trigger")&&(c=!0)}else("checkbox"==a.type||"radio"==a.type)&&-1<b.id.indexOf("-other_")&&0>b.id.indexOf("-otext")&&(c=!0);c?(c=0,"select"==a.type?"hidden"==b.type?(d=!1,2<b.name.split("[").length&&(d=!0),d||(c=ba(b))):c=jQuery(b).closest(".frm_other_container").find(".frm_other_input").val():"checkbox"!=a.type&&"radio"!=a.type||"hidden"==b.type||(c=ba(b))):
48
- c="checkbox"!==b.type&&"radio"!==b.type||!b.checked?jQuery(b).val():b.value;"undefined"===typeof c&&(c="");return c}function ba(a){var b="";a=document.getElementById(a.id+"-otext");null!==a&&""!==a.value&&(b=a.value);return b}function Ha(a){var b=!1;a=jQuery(a).find(".frm_saving_draft");a.length&&(b=a.val());return b}function Ia(a){var b=!1,c=jQuery(a).find(".frm_next_page");if(c.length&&c.val()){var d=jQuery(a).find('input[name="form_id"]').val();a=jQuery(a).find('input[name="frm_page_order_'+d+
49
- '"]');a=a.length?a.val():0;if(!a||c.val()<a)b=!0}return b}function ga(a,b){var c=a.getAttribute("data-frmfile");if("hidden"==a.type&&null===c)return b;var d="",e="";if("checkbox"==a.type||"radio"==a.type)c=jQuery('input[name="'+a.name+'"]').closest(".frm_required_field").find("input:checked"),jQuery(c).each(function(){d=this.value});else if("file"==a.type||c)"undefined"===typeof c&&(c=q(a,!0),c=c.replace("file","")),"undefined"===typeof b[c]&&(d=cb(c)),e=c;else{e=a.className;if(-1!==e.indexOf("frm_pos_none"))return b;
50
- d=jQuery(a).val();if("string"!==typeof d)for(var c=d,d="",f=0;f<c.length;f++)""!==c[f]&&(d=c[f]);e=-1===e.indexOf("frm_other_input")?q(a,!0):q(a,!1)}""===d&&(""===e&&(e=q(a,!0)),e in b||(b[e]=F(a,"data-reqmsg")));return b}function cb(a){var b="";jQuery('input[name="file'+a+'"], input[name="file'+a+'[]"], input[name^="item_meta['+a+']"]').each(function(){""===b&&(b=this.value)});return b}function ha(a,b,c){var d=a.value,e=q(a,!0);if(e in b)return b;var f=0===e.indexOf("conf_");if(""!==d||f){var h=
51
- /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i,g=F(a,"data-invmsg");""!==d&&!1===h.test(d)?(b[e]=g,f&&(b[e.replace("conf_","")]="")):f&&(a=a.name.replace("conf_",""),c.filter('[name="'+a+'"]').val()!==d&&(b[e]="",b[e.replace("conf_","")]=""))}return b}function ia(a,b){var c=a.value;""!==c&&!1!==isNaN(c/1)&&(c=q(a,!0),c in b||(b[c]=F(a,"data-invmsg")));return b}function ja(a,b){var c=a.value,
52
- d=F(a,"pattern");if(""!==d&&""!==c){var e=q(a,!0);e in b||(d=new RegExp("^"+d+"$","i"),!1===d.test(c)&&(b[e]=F(a,"data-invmsg")))}return b}function F(a,b){var c=a.getAttribute(b);null===c&&(c="");return c}function db(a,b){"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){var c={content:"",errors:{},pass:!1};null===b&&(b=c);b=b.replace(/^\s+|\s+$/g,
53
- "");b=0===b.indexOf("{")?jQuery.parseJSON(b):c;if("undefined"!=typeof b.redirect)window.location=b.redirect;else if(""!==b.content){jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");var e=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest("#frm_form_"+e+"_container").replaceWith(b.content);frmFrontForm.scrollMsg(e);"function"==typeof frmThemeOverride_frmAfterSubmit&&(e=jQuery('input[name="frm_page_order_'+e+'"]').val(),c=jQuery(b.content).find('input[name="form_id"]').val(),
54
- frmThemeOverride_frmAfterSubmit(c,e,b.content,a));e=jQuery(a).find('input[name="id"]');e.length&&jQuery(document.getElementById("frm_edit_"+e.val())).find("a").addClass("frm_ajax_edited").click();jQuery(b.content).find(".frm_message").length&&ca("pageLoad");da()}else if(Object.keys(b.errors).length){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");c=!0;Ja();var f=!1,h;for(e in b.errors)if(h=jQuery(a).find("#frm_field_"+
55
- e+"_container"),h.length){if(!h.is(":visible")){var g=h.closest(".frm_toggle_container");g.length&&(g=g.prev(),g.hasClass("frm_trigger")||(g=g.prev(".frm_trigger")),g.click())}h.is(":visible")&&(M(h,e,b.errors),c=!1,h=jQuery(a).find("#frm_field_"+e+"_container .frm-g-recaptcha, #frm_field_"+e+"_container .g-recaptcha"),h.length&&(f=!0,h=h.data("rid"),jQuery().grecaptcha&&(h?grecaptcha.reset(h):grecaptcha.reset())))}Ka(a);!0!==f&&La(a,!1);c?a.submit():jQuery(a).prepend(b.error_message)}else eb(a),
56
- La(a,!0),a.submit()},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}function M(a,b,c){a.length&&a.is(":visible")&&(a.addClass("frm_blank_field"),"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,c):a.append('<div class="frm_error">'+c[b]+"</div>"))}function Ja(){jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}
57
- function Ka(a){var b=jQuery(a).find(".frm_blank_field:first");b.length&&frmFrontForm.scrollMsg(b,a,!0)}function eb(a){var b=document.getElementById("frm_loading");null!==b&&(a=jQuery(a).find("input[type=file]").val(),"undefined"!=typeof a&&""!==a&&setTimeout(function(){jQuery(b).fadeIn("slow")},2E3))}function La(a,b){var c=jQuery(a).find(".frm-g-recaptcha, .g-recaptcha");c.length&&(!b||1>jQuery(a).find(".frm_next_page").length||1>jQuery(a).find(".frm_next_page").val())&&c.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+
58
- frm_js.nonce+'">')}function fb(){Ma(jQuery(this),"clear")}function gb(){Ma(jQuery(this),"replace")}function Ma(a,b){var c=a.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"==typeof c)return!1;var d=a.val().replace(/(\n|\r\n)/g,"\r");"replace"==b?""===d&&a.addClass("frm_default").val(c):d==c&&a.removeClass("frm_default").val("")}function hb(){var a=jQuery(this),b=a.data("eid"),c=a.data("fid");a.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",
59
- url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:b,form_id:c,nonce:frm_js.nonce},success:function(b){a.replaceWith(b)}});return!1}function ib(a,b){google.load("visualization","1.0",{packages:[b],callback:function(){var b=new google.visualization.DataTable,d=!1;-1!==jQuery.inArray("id",a.options.fields)&&(d=!0,b.addColumn("number",frm_js.id));for(var e=a.fields.length,f,h=0,g=e;h<g;h++){var k=a.fields[h];f=Na(k);b.addColumn(f,k.name)}h=!1;a.options.edit_link&&(h=!0,b.addColumn("string",
60
- a.options.edit_link));g=!1;a.options.delete_link&&(g=!0,b.addColumn("string",a.options.delete_link));if(null!==a.entries){var m=a.entries.length;b.addRows(m);for(var l=0,n=0;n<m;n++){var k=0,p=a.entries[n];d&&(b.setCell(l,k,p.id),k++);for(var q=0,r=e;q<r;q++){var t=a.fields[q];f=Na(t);t=p.metas[t.id];"number"!=f||null!==t&&""!==t?"boolean"==f&&(t=null===t||"false"==t||!1===t?!1:!0):t=0;b.setCell(l,k,t);k++}h&&("undefined"!==typeof p.editLink?b.setCell(l,k,'<a href="'+p.editLink+'">'+a.options.edit_link+
61
- "</a>"):b.setCell(l,k,""),k++);g&&("undefined"!==typeof p.deleteLink?b.setCell(l,k,'<a href="'+p.deleteLink+'" class="frm_delete_link" data-frmconfirm="'+a.options.confirm+'">'+a.options.delete_link+"</a>"):b.setCell(l,k,""));l++}}else for(b.addRows(1),h=k=0,g=e;h<g;h++)0<k?b.setCell(0,k,""):b.setCell(0,k,a.options.no_entries),k++;(new google.visualization.Table(document.getElementById("frm_google_table_"+a.options.form_id))).draw(b,a.graphOpts)}})}function jb(a){google.load("visualization","1.0",
62
- {packages:[a["package"]],callback:function(){var b;new google.visualization.DataTable;b=google.visualization.arrayToDataTable(a.data);var c=document.getElementById("chart_"+a.graph_id);if(null!==c){var d=a.type.charAt(0).toUpperCase()+a.type.slice(1);"Histogram"!==d&&"Table"!==d&&(d+="Chart");(new google.visualization[d](c)).draw(b,a.options)}}})}function Na(a){var b="string";if("number"==a.type)b="number";else if("checkbox"==a.type||"select"==a.type){var c=a.options.length;"select"==a.type&&""===
63
- a.options[0]&&(c="post_status"==a.field_options.post_field?3:c-1);1==c&&(b="boolean")}return b}function kb(){var a=jQuery(this).data("key"),b=jQuery(this).data("parent"),c="frm_section_"+b+"-"+a,d=jQuery(document.getElementById(c)),e=d.find("input, select, textarea"),f=jQuery(this).closest("form").find('input[name="form_id"]').val();d.fadeOut("slow",function(){d.remove();e.each(function(){var c=q(this,!1);"file"!=this.type&&L(c,jQuery(this));D("frm_field_"+c+"-"+b+"-"+a+"_container",f)});"function"==
64
- typeof frmThemeOverride_frmRemoveRow&&frmThemeOverride_frmRemoveRow(c,d)});return!1}function lb(){if(!0===K)return!1;K=!0;var a=jQuery(this).data("parent"),b=0;if(0<jQuery(".frm_repeat_"+a).length)var c=jQuery(".frm_repeat_"+a+":last").attr("id").replace("frm_section_"+a+"-",""),b=-1<c.indexOf("i")?1:1+parseInt(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_add_form_row",field_id:a,i:b,nonce:frm_js.nonce},success:function(c){var d=c.html,f=jQuery(d).hide().fadeIn("slow");
65
- jQuery(".frm_repeat_"+a+":last").after(f);var h=["other"],g,k,m={repeatingSection:a.toString(),repeatRow:b.toString()};jQuery(d).find("input, select, textarea").each(function(){if("file"!=this.type){if(""===this.name)return!0;g=this.name.replace("item_meta[","").split("]")[2].replace("[","");-1==jQuery.inArray(g,h)&&!1!==this.id&&""!==this.id&&(k=jQuery("#"+this.id),h.push(g),I(g,m),Z(g,m,"value changed"),ea(g,k),fa(g,k,"value changed"),L(g,k))}});v(m.repeatRow);Oa();aa();"function"==typeof frmThemeOverride_frmAddRow&&
66
- frmThemeOverride_frmAddRow(a,c);K=!1},error:function(){K=!1}});return!1}function mb(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("pageid"),e=a.data("formid"),f=a.data("cancel"),h=a.data("fields"),g=a.data("excludefields"),k=jQuery(document.getElementById(c+b)),m=k.html();k.html('<span class="frm-loading-img" id="'+c+b+'"></span><div class="frm_orig_content" style="display:none">'+m+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",
67
- post_id:d,entry_id:b,id:e,nonce:frm_js.nonce,fields:h,exclude_fields:g},success:function(b){k.children(".frm-loading-img").replaceWith(b);a.removeClass("frm_inplace_edit").addClass("frm_cancel_edit");a.html(f);ca("editInPlace");jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',G);da()}});return!1}function nb(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("edit");a.hasClass("frm_ajax_edited")||
68
- (b=jQuery(document.getElementById(c+b)),b.children(".frm_forms").replaceWith(""),b.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));a.removeClass("frm_cancel_edit").addClass("frm_inplace_edit");a.html(d);return!1}function ob(){var a=jQuery(this),b=a.data("deleteconfirm");if(confirm(b)){var c=a.data("entryid"),d=a.data("prefix");a.replaceWith('<span class="frm-loading-img" id="frm_delete_'+c+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",
69
- entry:c,nonce:frm_js.nonce},success:function(a){"success"==a.replace(/^\s+|\s+$/g,"")?(jQuery(document.getElementById(d+c)).fadeOut("slow"),jQuery(document.getElementById("frm_delete_"+c)).fadeOut("slow")):jQuery(document.getElementById("frm_delete_"+c)).replaceWith(a)}})}return!1}function da(){"undefined"!==typeof __frmHideFields&&frmFrontForm.hidePreviouslyHiddenFields();jQuery(document).on("focusin",".frm_date",r);if("undefined"!==typeof __frmUniqueTimes)for(var a=__frmUniqueTimes,b=0;b<a.length;b++)jQuery(document.getElementById(a[b].dateID)).change(p);
70
- if("undefined"!==typeof __frmMasks)for(a=__frmMasks,b=0;b<a.length;b++)jQuery(a[b].trigger).attr("data-frmmask",a[b].mask);Oa();aa();"undefined"!==typeof __frmDepDynamicFields&&frmFrontForm.checkDependentDynamicFields(__frmDepDynamicFields);"undefined"!==typeof __frmDepLookupFields&&frmFrontForm.checkDependentLookupFields(__frmDepLookupFields);if("undefined"!==typeof __FRMCALC){(a=__FRMCALC.triggers)&&jQuery(a.join()).trigger({type:"change",selfTriggered:!0});var a=__FRMCALC.calc,b=[],c;for(c in a)if(1>
71
- a[c].fields.length){var d=document.getElementById("field_"+c);null===d||T(d,a[c].form_id)||X(__FRMCALC,c,b)}}v()}function aa(){if(jQuery().chosen){var a={allow_single_deselect:!0,no_results_text:frm_js.no_results};"undefined"!==typeof __frmChosen&&(a="{"+__frmChosen+"}");jQuery(".frm_chzn").chosen(a)}}function Oa(){if(jQuery().rating){var a=jQuery(".star");a.length&&a.rating()}}function ca(a){"undefined"!==typeof __frmHideOrShowFields&&frmFrontForm.hideOrShowFields(__frmHideOrShowFields,a)}function u(a,
72
- b){"undefined"===typeof b&&(b="dependent");1<a.length&&(a=a.eq(0));a.trigger({type:"change",selfTriggered:!0,frmTriggered:b})}function H(a){var b={repeatingSection:"",repeatRow:""};"undefined"!==typeof a&&3<=a.split("][").length&&(a=a.split("]["),b.repeatingSection=a[0].replace("item_meta[",""),b.repeatRow=a[1]);return b}function Pa(a){a.fadeOut("slow",function(){a.remove()})}function pb(){var a=jQuery(this).data("frmconfirm");return confirm(a)}function qb(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?
73
- jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function Za(a,b){for(var c in a)if(a.hasOwnProperty(c)&&a[c]===b)return c;return null}function Ea(a){return!jQuery.isArray(a)&&0<=a-parseFloat(a)+1}function rb(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,d=Number(b)||0,d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1})}function sb(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=
74
- function(){return this.replace(/^\s+|\s+$/g,"")})}function tb(){Array.prototype.filter||(Array.prototype.filter=function(a,b){if(void 0===this||null===this)throw new TypeError;var c=Object(this),d=c.length>>>0;if("function"!==typeof a)throw new TypeError;for(var e=[],f=0;f<d;f++)if(f in c){var h=c[f];a.call(b,h,f,c)&&e.push(h)}return e})}function ub(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b})}var K=!1,C="",x=[];return{init:function(){jQuery(document).off("submit.formidable",
75
- ".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(document).on("click",".frm_trigger",n);var a=jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",
76
- ".frm_toggle_default",fb);jQuery(document).on("blur",".frm_toggle_default",gb);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(hb);jQuery(document).on("click",".frm_remove_link",w);jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',
77
- G);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',l);jQuery(document).on("change",'.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',A);jQuery(document).on("click",".frm_remove_form_row",kb);jQuery(document).on("click",".frm_add_form_row",lb);jQuery(document).on("click","a[data-frmconfirm]",pb);jQuery("a[data-frmtoggle]").click(qb);jQuery(".frm_edit_link_container").on("click",
78
- "a.frm_inplace_edit",mb);jQuery(".frm_edit_link_container").on("click","a.frm_cancel_edit",nb);jQuery(document).on("click",".frm_ajax_delete",ob);jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");a.hasClass("ui-icon-triangle-1-e")?(a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):(a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),
79
- jQuery(this).next(".frm_toggle_container").hide())});ca("pageLoad");da();rb();sb();tb();ub()},submitForm:function(a){frmFrontForm.submitFormManual(a,this)},submitFormManual:function(a,b){var c=b.className.trim().split(/\s+/gi);if((!c||-1<c.indexOf("frm_pro_form"))&&!jQuery("body").hasClass("wp-admin")){a.preventDefault();var d=frmFrontForm.validateFormSubmit(b);0===Object.keys(d).length&&(jQuery(b).find(".frm_ajax_loading").addClass("frm_loading_now"),jQuery(b).find('input[type="submit"], input[type="button"]').attr("disabled",
80
- "disabled"),-1<c.indexOf("frm_ajax_submit")?1>jQuery(b).find('input[type="file"]').length?(C=jQuery(b).find('input[name="frm_action"]').val(),frmFrontForm.checkFormErrors(b,C)):b.submit():b.submit())}},validateFormSubmit:function(a){"undefined"!=typeof tinyMCE&&jQuery(this).find(".wp-editor-wrap").length&&tinyMCE.triggerSave();x=[];var b=jQuery(a).hasClass("frm_js_validate");b&&(Ha(a)||Ia(a))&&(b=!1);b&&(frmFrontForm.getAjaxFormErrors(a),Object.keys(x).length&&frmFrontForm.addAjaxFormErrors(a));return x},
81
- getAjaxFormErrors:function(a){var b=[],c=jQuery(a).find(".frm_required_field:visible input, .frm_required_field:visible select, .frm_required_field:visible textarea").filter(":not(.frm_optional)");if(c.length)for(var d=0,e=c.length;d<e;d++)b=ga(c[d],b);c=jQuery(a).find("input[type=email]").filter(":visible");d=jQuery(a).find("input,select,textarea");if(d.length)for(var e=0,f=d.length;e<f;e++){var h=d[e];""!==h.value&&"hidden"!=h.type&&("number"==h.type?b=ia(h,b):"email"==h.type?b=ha(h,b,c):null!==
82
- h.pattern&&(b=ja(h,b)))}c=jQuery(a).find(".frm-g-recaptcha");c.length&&(d=c.data("rid"),0===grecaptcha.getResponse(d).length&&(c=c.closest(".frm_form_field").attr("id").replace("frm_field_","").replace("_container",""),b[c]=""));x=b;if("function"==typeof frmThemeOverride_jsErrors&&(C=jQuery(a).find('input[name="frm_action"]').val(),a=frmThemeOverride_jsErrors(C,a),Object.keys(a).length))for(var g in a)x[g]=a[g];return x},addAjaxFormErrors:function(a){Ja();for(var b in x){var c=jQuery(a).find("#frm_field_"+
83
- b+"_container");c.length?M(c,b,x):delete x[b]}Ka(a)},checkFormErrors:function(a,b){db(a,b)},scrollToID:function(a){a=jQuery(document.getElementById(a));frmFrontForm.scrollMsg(a,!1)},scrollMsg:function(a,b,c){if("undefined"==typeof b){if(a=jQuery(document.getElementById("frm_form_"+a+"_container")),1>a.length)return}else a="string"==typeof a?jQuery(b).find("#frm_field_"+a+"_container"):a;if(a=a.offset().top){a-=frm_js.offset;b=jQuery("html").css("margin-top");var d=jQuery("body").css("margin-top");
84
- if(b||d)a=a-parseInt(b)-parseInt(d);if(a&&window.innerHeight&&(b=document.documentElement.scrollTop||document.body.scrollTop,a>b+window.innerHeight||a<b))return"undefined"===typeof c?jQuery(window).scrollTop(a):jQuery("html,body").animate({scrollTop:a},500),!1}},savingDraft:function(a){return Ha(a)},goingToPreviousPage:function(a){return Ia(a)},hideOrShowFields:function(a,b){if("pageLoad"===b){var c=document.querySelectorAll('[id^="frm_hide_fields_"]');Y(c)}for(var c={repeatingSection:"",repeatRow:""},
85
- d=0,e=a.length;d<e;d++)I(a[d],c)},hidePreviouslyHiddenFields:function(){var a;a=[];for(var b=document.querySelectorAll('*[id^="frm_hide_fields_"]'),c=b.length,d,e=0;e<c;e++)d=b[e].id.replace("frm_hide_fields_",""),a=a.concat(E(d));b=0;for(c=a.length;b<c;b++)d=document.getElementById(a[b]),null!==d&&(d.style.display="none")},checkDependentDynamicFields:function(a){for(var b={repeatingSection:"",repeatRow:""},c=0,d=a.length;c<d;c++)I(a[c],b)},checkDependentLookupFields:function(a){for(var b,c={repeatingSection:"",
86
- repeatRow:""},d=0,e=a.length;d<e;d++)b=a[d],Z(b,c,"value changed")},loadGoogle:function(){if("undefined"!==typeof google&&google&&google.load)for(var a=__FRMTABLES,b=Object.keys(a),c=0;c<b.length;c++)if("graphs"===b[c])for(var d=a[b[c]],e=0,f=d.length;e<f;e++)jb(d[e]);else for(d=a[b[c]],e=b[c],f=0;f<d.length;f++)ib(d[f],e);else setTimeout(frmFrontForm.loadGoogle,30)},removeUsedTimes:function(a,b){var c=jQuery(a).parents("form:first").find('input[name="id"]');jQuery.ajax({type:"POST",url:frm_js.ajax_url,
87
- dataType:"json",data:{action:"frm_fields_ajax_time_options",time_field:b,date_field:a.id,entry_id:c?c.val():"",date:jQuery(a).val(),nonce:frm_js.nonce},success:function(a){var c=jQuery(document.getElementById(b));c.find("option").removeAttr("disabled");if(a&&""!==a)for(var d in a)c.find('option[value="'+d+'"]').attr("disabled","disabled")}})},escapeHtml:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(a){jQuery(a).css("visibility",
88
- "hidden")},visible:function(a){jQuery(a).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(l){frmFrontForm.init()});function frmRecaptcha(){for(var l=jQuery(".frm-g-recaptcha"),n=0,p=l.length;n<p;n++){var r=grecaptcha.render(l[n].id,{sitekey:l[n].getAttribute("data-sitekey"),size:l[n].getAttribute("data-size"),theme:l[n].getAttribute("data-theme")});l[n].setAttribute("data-rid",r)}}
89
- function frmUpdateField(l,n,p,r,v){jQuery(document.getElementById("frm_update_field_"+l+"_"+n)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:l,field_id:n,value:p,nonce:frm_js.nonce},success:function(){""===r.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+v)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+v)).replaceWith(r)}})}
90
- function frmEditEntry(l,n,p,r,v,z){console.warn("DEPRECATED: function frmEditEntry in v2.0.13 use frmFrontForm.editEntry");var y=jQuery(document.getElementById("frm_edit_"+l)),w=y.html(),A=jQuery(document.getElementById(n+l)),G=A.html();A.html('<span class="frm-loading-img" id="'+n+l+'"></span><div class="frm_orig_content" style="display:none">'+G+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:p,entry_id:l,id:r,nonce:frm_js.nonce},
91
- success:function(q){A.children(".frm-loading-img").replaceWith(q);y.replaceWith('<span id="frm_edit_'+l+'"><a onclick="frmCancelEdit('+l+",'"+n+"','"+frmFrontForm.escapeHtml(w)+"',"+p+","+r+",'"+z+'\')" class="'+z+'">'+v+"</a></span>")}})}
92
- function frmCancelEdit(l,n,p,r,v,z){console.warn("DEPRECATED: function frmCancelEdit in v2.0.13 use frmFrontForm.cancelEdit");var y=jQuery(document.getElementById("frm_edit_"+l)),w=y.find("a"),A=w.html();w.hasClass("frm_ajax_edited")||(w=jQuery(document.getElementById(n+l)),w.children(".frm_forms").replaceWith(""),w.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));y.replaceWith('<a id="frm_edit_'+l+'" class="frm_edit_link '+z+'" href="javascript:frmEditEntry('+l+",'"+
93
- n+"',"+r+","+v+",'"+frmFrontForm.escapeHtml(A)+"','"+z+"')\">"+p+"</a>")}
94
- function frmDeleteEntry(l,n){console.warn("DEPRECATED: function frmDeleteEntry in v2.0.13 use frmFrontForm.deleteEntry");jQuery(document.getElementById("frm_delete_"+l)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+l+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:l,nonce:frm_js.nonce},success:function(p){"success"==p.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(n+l)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+
95
- l)).replaceWith(p)}})}function frmOnSubmit(l){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(l,this)}
96
- function frm_resend_email(l,n){console.warn("DEPRECATED: function frm_resend_email in v2.0");$link=jQuery(document.getElementById("frm_resend_email"));$link.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:l,form_id:n,nonce:frm_js.nonce},success:function(l){$link.replaceWith(l)}})};
 
1
+ function frmFrontFormJS(){function l(a){var b=jQuery(this),c=b.attr("type");"submit"!==c&&a.preventDefault();a=b.parents("form:first");var d=b="",e=this.name;if("frm_prev_page"===e||-1!==this.className.indexOf("frm_prev_page"))b=jQuery(a).find(".frm_next_page").attr("id").replace("frm_next_p_","");else if("frm_save_draft"===e||-1!==this.className.indexOf("frm_save_draft"))d=1;jQuery(".frm_next_page").val(b);jQuery(".frm_saving_draft").val(d);"submit"!==c&&a.trigger("submit")}function m(){jQuery(this).parent().children(".frm_toggle_container").slideToggle("fast");
2
+ jQuery(this).toggleClass("active").children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-e")}function q(){for(var a=__frmUniqueTimes,b=0;b<a.length;b++)a[b].dateID==this.id&&frmFrontForm.removeUsedTimes(this,a[b].timeID)}function r(){if(-1===this.className.indexOf("frm_custom_date")&&"undefined"!==typeof __frmDatepicker){var a=__frmDatepicker,b=this.id,c=b.split("-");c.pop();c='input[id^="'+c.join("-")+'"]';jQuery.datepicker.setDefaults(jQuery.datepicker.regional[""]);
3
  for(var d=0,e=0;e<a.length;e++)if(a[e].triggerID=="#"+b||a[e].triggerID==c)d=e;""!==a[d].options.defaultDate&&(a[d].options.defaultDate=new Date(a[d].options.defaultDate));jQuery(this).datepicker(jQuery.extend(jQuery.datepicker.regional[a[d].locale],a[d].options))}}function v(a){if("undefined"!==typeof __frmDropzone)for(var b=__frmDropzone,c=0;c<b.length;c++)z(c,a)}function z(a,b){var c=__frmDropzone,d="#"+c[a].htmlID+"_dropzone",e=c[a].fieldName;"undefined"!==typeof b&&-1!==d.indexOf("-0_dropzone")&&
4
  (d=d.replace("-0_dropzone","-"+b+"_dropzone"),e=e.replace("[0]","["+b+"]"),delete c[a].mockFiles);d=jQuery(d);if(!(1>d.length||d.hasClass("dz-clickable"))){var f=c[a].maxFiles;if("undefined"!==typeof c[a].mockFiles){var h=c[a].mockFiles.length;0<f&&(f-=h)}var h=d.closest("form"),g=h.find('input[type="submit"], .frm_submit input[type="button"]'),k=h.find(".frm_ajax_loading");d.dropzone({url:frm_js.ajax_url,addRemoveLinks:!0,paramName:d.attr("id").replace("_dropzone",""),maxFilesize:c[a].maxFilesize,
5
+ maxFiles:f,uploadMultiple:c[a].uploadMultiple,hiddenInputContainer:"#"+h.attr("id"),dictDefaultMessage:c[a].defaultMessage,dictFallbackMessage:c[a].fallbackMessage,dictFallbackText:c[a].fallbackText,dictFileTooBig:c[a].fileTooBig,dictInvalidFileType:c[a].invalidFileType,dictResponseError:c[a].responseError,dictCancelUpload:c[a].cancel,dictCancelUploadConfirmation:c[a].cancelConfirm,dictRemoveFile:c[a].remove,dictMaxFilesExceeded:c[a].maxFilesExceeded,fallback:function(){jQuery(this.element).closest("form").removeClass("frm_ajax_submit")},
6
  init:function(){this.on("sending",function(b,d,e){e.append("action","frm_submit_dropzone");e.append("field_id",c[a].fieldID);e.append("form_id",c[a].formID)});this.on("success",function(b,d){for(var f=jQuery.parseJSON(d),g=0;g<f.length;g++)!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val(f[g])});this.on("successmultiple",function(b,d){for(var f=jQuery.parseJSON(d),g=0;g<b.length;g++)jQuery(b[g].previewElement).append(y(c[a],f[g],e))});this.on("complete",function(b){if("undefined"!==typeof b.mediaID){c[a].uploadMultiple&&
7
  jQuery(b.previewElement).append(y(c[a],b.mediaID,e));for(var d=b.previewElement.querySelectorAll("[data-dz-name]"),f=0,g=d.length;f<g;f++)d[f].innerHTML='<a href="'+b.url+'">'+b.name+"</a>"}});this.on("addedfile",function(){k.addClass("frm_loading_now");g.attr("disabled","disabled")});this.on("queuecomplete",function(){k.removeClass("frm_loading_now");g.removeAttr("disabled")});this.on("removedfile",function(b){!1!==b.accepted&&!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val("");!1!==
8
  b.accepted&&"undefined"!==typeof b.mediaID&&(jQuery(b.previewElement).remove(),this.options.maxFiles=c[a].maxFiles-this.files.length)});if("undefined"!==typeof c[a].mockFiles)for(var b=0;b<c[a].mockFiles.length;b++){var d={name:c[a].mockFiles[b].name,size:c[a].mockFiles[b].size,url:c[a].mockFiles[b].file_url,mediaID:c[a].mockFiles[b].id};this.emit("addedfile",d);this.emit("thumbnail",d,c[a].mockFiles[b].url);this.emit("complete",d);this.files.push(d)}}})}}function y(a,b,c){return'<input name="'+c+
9
+ '[]" type="hidden" value="'+b+'" data-frmfile="'+a.fieldID+'" />'}function w(){var a=jQuery(this).data("frm-remove");Qa(jQuery(this).parent(".dz-preview"));a=jQuery('input[name="'+a+'"]');a.length&&a.val("")}function A(){var a=this.type,b=!1,c=!1;if("select-one"===a)c=!0,"frm_other_trigger"===this.options[this.selectedIndex].className&&(b=!0);else if("select-multiple"===a)for(var c=!0,d=this.options,b=!1,e=0;e<d.length;e++)if("frm_other_trigger"===d[e].className&&d[e].selected){b=!0;break}c?(a=jQuery(this).parent().children(".frm_other_input"),
10
  a.length&&(b?a[0].className=a[0].className.replace("frm_pos_none",""):(1>a[0].className.indexOf("frm_pos_none")&&(a[0].className+=" frm_pos_none"),a[0].value=""))):"radio"===a?jQuery(this).is(":checked")&&(jQuery(this).closest(".frm_radio").children(".frm_other_input").removeClass("frm_pos_none"),jQuery(this).closest(".frm_radio").siblings().children(".frm_other_input").addClass("frm_pos_none").val("")):"checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):
11
+ jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function G(a){var b=n(this,!1);if(b&&"undefined"!==typeof b&&(!a.frmTriggered||a.frmTriggered!=b)&&(fa(b,jQuery(this)),a="undefined"!==typeof a.originalEvent||-1<a.currentTarget.className.indexOf("frm_chzn")?"value changed":"other",ga(b,jQuery(this),a),M(b,jQuery(this)),jQuery(this).closest("form").hasClass("frm_js_validate"))){b=[];a=jQuery(this).closest(".frm_form_field");a.hasClass("frm_required_field")&&
12
+ !jQuery(this).hasClass("frm_optional")&&(b=ha(this,b));if(1>b.length)if("email"==this.type)var c=jQuery(this).closest("form").find("input[type=email]"),b=ia(this,b,c);else"number"==this.type?b=ja(this,b):null!==this.pattern&&(b=ka(this,b));a.removeClass("frm_blank_field");a.find(".frm_error").remove();if(0<Object.keys(b).length)for(var d in b)N(a,d,b)}}function n(a,b){var c="",c=a instanceof jQuery?a.attr("name"):a.name;if(""===c)return c=a instanceof jQuery?a.data("name"):a.getAttribute("data-name"),
13
+ ""!==c&&c?c:0;c=c.replace("item_meta[","").replace("[]","").split("]");if(1>c.length)return 0;var c=c.filter(function(a){return""!==a}),d=c[0],e=!1;if(1===c.length)return d;if("[form"===c[1]||"[row_ids"===c[1])return 0;jQuery('input[name="item_meta['+d+'][form]"]').length&&(d=c[2].replace("[",""),e=!0);"other"===d&&(d=e?c[3].replace("[",""):c[1].replace("[",""));!0===b&&(d=d===c[0]?d+"-"+c[1].replace("[",""):d+"-"+c[0]+"-"+c[1].replace("[",""));return d}function fa(a,b){if(!("undefined"===typeof __FRMRULES||
14
+ "undefined"===typeof __FRMRULES[a]||1>__FRMRULES[a].dependents.length||null===b||"undefined"===typeof b))for(var c=__FRMRULES[a],d=H(b[0].name),e=0,f=c.dependents.length;e<f;e++)I(c.dependents[e],d)}function I(a,b){var c=O(a);if(!(!1===c||1>c.conditions.length)){var d;d=[];if(c.isRepeating)if(""!==b.repeatingSection){var e="frm_field_"+c.fieldId+"-",e=e+(b.repeatingSection+"-"+b.repeatRow+"_container");d.push(e)}else if(d=P(c),null!==document.getElementById("frm_field_"+d+"_container")){d=[];for(var e=
15
+ document.querySelectorAll(".frm_field_"+c.fieldId+"_container"),f=0,h=e.length;f<h;f++)d.push(e[f].id)}else{d=[];for(var f=P(c),e="frm_field_"+c.fieldId+"-"+f+"-",f=document.querySelectorAll('[name="item_meta['+f+'][row_ids][]"]'),h=0,g=f.length;h<g;h++)""!==f[h].value&&d.push(e+f[h].value+"_container");1>d.length&&d.push(e+"0_container")}else d.push("frm_field_"+c.fieldId+"_container");e=d.length;for(f=0;f<e;f++)c.containerId=d[f],la(c,d[f]),ma(c)}}function P(a){var b="";"0"!==a.inEmbedForm?b=a.inEmbedForm:
16
+ "0"!==a.inSection&&(b=a.inSection);return b}function la(a,b){if(a.isRepeating){var c=b.replace("_container","").split("-");a.repeatRow=c[2]}else a.repeatRow=""}function ma(a){for(var b=[],c=a.conditions.length,d=0;d<c;d++)b.push(Ra(a.conditions[d],a));c=C="any"==a.anyAll?-1<b.indexOf(!0)?a.showHide:na(a.showHide):-1<b.indexOf(!1)?na(a.showHide):a.showHide;b=null!==document.getElementById(a.containerId);"show"==c?"data"==a.fieldType&&a.hasOwnProperty("dataLogic")?(a={fieldId:a.fieldId,fieldKey:a.fieldKey,
17
+ formId:a.formId,containerId:a.containerId,repeatRow:a.repeatRow,dataLogic:{actualValue:a.dataLogic.actualValue,fieldId:a.dataLogic.fieldId},children:"",inputType:a.inputType},"data"==a.inputType?Sa(a,b):b&&Ta(a)):!1!==B(a.containerId,a.formId)&&(D(a.containerId,a.formId),b?(b=oa(a.containerId),pa(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId),jQuery("#"+a.containerId).show()):(b=qa(a),pa(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId))):Q(a,b)}function O(a){return"undefined"===typeof __FRMRULES||
18
+ "undefined"===typeof __FRMRULES[a]?!1:__FRMRULES[a]}function Ra(a,b){var c=O(a.fieldId),d=ra(c,b);"data"==b.fieldType&&"data"==c.fieldType?(c=""===a.value?""===d||1==d.length&&""===d[0]?!1:!0:R(a.operator,a.value,d),b.dataLogic=a,b.dataLogic.actualValue=d,d=c):d=R(a.operator,a.value,d);return d}function ra(a,b){var c;if("radio"==a.inputType||"checkbox"==a.inputType)c=sa(a,b),c=document.querySelectorAll('input[name^="'+c+'"]'),c="checkbox"==a.inputType?J(c):S(c);else if(c="",!0===a.isMultiSelect){c=
19
+ sa(a,b);var d=document.querySelectorAll('[name^="'+c+'"]');1==d.length&&"hidden"!=d[0].type?(c=jQuery('[name^="'+c+'"]').val(),null===c&&(c="")):c=J(d)}else d="field_"+a.fieldKey,a.isRepeating&&(d+="-"+b.repeatRow),d=document.getElementById(d),null!==d&&(c=d.value);"undefined"===typeof c?c="":"string"===typeof c&&(c=c.trim());return c}function sa(a,b){return a.isRepeating?"item_meta["+("0"!==b.inEmbedForm?b.inEmbedForm:b.inSection)+"]["+b.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]"}function J(a){for(var b=
20
+ [],c=0,d=a.length;c<d;c++)("hidden"==a[c].type||a[c].checked)&&b.push(a[c].value);0===b.length&&(b=!1);return b}function R(a,b,c){b=Ua(b);c=Va(b,c);return"string"===typeof b&&"-1"!=b.indexOf("&quot;")&&R(a,b.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){if(!b)return!1;a=T(a);b=ta(a,b);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;a=T(a);b=ta(a,b);return-1==
21
+ b.indexOf(a)}}[a](b,c)}function Ua(a){-1!==String(a).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)?a=parseFloat(a):"string"===typeof a&&(a=a.trim());return a}function Va(a,b){"undefined"===typeof b&&(b="");jQuery.isArray(b)&&-1<jQuery.inArray(String(a),b)&&(b=a);"number"===typeof a&&"string"===typeof b&&(b=parseFloat(b));"string"===typeof b&&(b=b.trim());return b}function ta(a,b){b=T(b);var c;if(jQuery.isArray(b))for(var d=0,e=b.length;d<e;d++)if(c=b[d].toLowerCase(),-1<c.indexOf(a)){b=a;break}return b}
22
+ function T(a){"string"===typeof a?a=a.toLowerCase():"number"===typeof a&&(a=a.toString());return a}function na(a){return"show"==a?"hide":"show"}function oa(a){return document.getElementById(a).querySelectorAll('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]')}function qa(a){if("divider"==a.fieldType){var b=[];"divider"==a.fieldType&&(b=document.querySelectorAll('[data-sectionid="'+a.fieldId+'"]'));a=b}else"form"==a.fieldType?a=document.querySelectorAll('[id^="field_'+
23
+ a.fieldKey+'-"]'):(a=a.isRepeating?"item_meta["+P(a)+"]["+a.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]",a=document.querySelectorAll('[name^="'+a+'"]'));return a}function pa(a,b,c){if(a.length)for(var d,e=["checkbox","radio"],f=0;f<a.length;f++)if(!(0<f&&"undefined"!==typeof d&&d.name==a[f].name&&-1<e.indexOf(d.type)||b&&U(a[f],c))){d=a[f];var h=jQuery(d),g=h.data("frmval");if("undefined"!==typeof g){if("checkbox"==d.type||"radio"==d.type)ua(d.name,g);else if(-1<d.name.indexOf("[]")){var k=
24
+ document.getElementsByName(d.name);if(jQuery.isArray(g))for(var p=0,l=g.length;p<l;p++)p in k&&(k[p].value=g[p]);else null!==k[0]&&(k[0].value=g)}else g.constructor===Object&&(k=d.getAttribute("name").split("[").slice(-1)[0],null!==k&&(k=k.replace("]",""),g=g[k],"undefined"==typeof g&&(g=""))),d.value=g;"SELECT"==d.tagName&&V(d);t(h)}d=a[f];h=n(d,!1);h=W(h);!1!==h&&"lookup"!=h.fieldType&&(h.parentVals=X(h),va(h,d));d=a[f];if(h="undefined"!==typeof __FRMCALC){h=d.type;g=!1;if("text"==h||"hidden"==
25
+ h||"number"==h)g=!0;h=g}if(h){h=__FRMCALC;g=d.name;k=d.id.replace("field_","");if(3<=g.split("][").length)for(g=k.split("-"),k="",p=0;p<g.length-1;p++)k=""===k?g[p]:k+"-"+g[p];g=k;k=null;3<=d.name.split("][").length&&(k="hidden"!=d.type?jQuery(d).closest(".frm_form_field"):jQuery(d));d=k;void 0!==h.calc[g]&&Y(h,g,[],d)}d=a[f]}}function U(a,b){var c=n(a,!0);return B("frm_field_"+c+"_container",b)}function Q(a,b){if(!B(a.containerId,a.formId)){if(b){jQuery("#"+a.containerId).hide();var c=oa(a.containerId)}else c=
26
+ qa(a);Z(c);wa(a.containerId,a.formId)}}function Z(a){if(!(1>a.length)){for(var b,c=!0,d=0,e=a.length;d<e;d++)0<d&&b.name!=a[d].name&&!0===c&&t(jQuery(b)),c=!0,"radio"==a[d].type||"checkbox"==a[d].type?a[d].checked=!1:"SELECT"==a[d].tagName?(0===a[d].selectedIndex?c=!1:a[d].selectedIndex=0,b=a[d].id.replace(/[^\w]/g,"_"),null!==document.getElementById(b+"_chosen")&&jQuery(a[d]).trigger("chosen:updated")):a[d].value="",b=a[d];!0===c&&t(jQuery(b))}}function B(a,b){var c=!1;-1<E(b).indexOf(a)&&(c=!0);
27
+ return c}function wa(a,b){var c=E(b);if(!(-1<c.indexOf(a))){c.push(a);var c=JSON.stringify(c),d=document.getElementById("frm_hide_fields_"+b);null!==d&&(d.value=c)}}function E(a){var b=[];a=document.getElementById("frm_hide_fields_"+a);return null===a?b:b=(b=a.value)?JSON.parse(b):[]}function ua(a,b){for(var c=document.getElementsByName(a),d=0,e=c.length;d<e;d++)if("hidden"==c[d].type)jQuery.isArray(b)&&null!==b[d]?c[d].value=b[d]:c[d].value=b;else if(c[d].value==b||jQuery.isArray(b)&&-1<b.indexOf(c[d].value))if(c[d].checked=
28
+ !0,"radio"==c[d].type)break}function D(a,b){var c=E(b),d=c.indexOf(a);-1<d&&(c.splice(d,1),c=JSON.stringify(c),document.getElementById("frm_hide_fields_"+b).value=c)}function ga(a,b,c){if(!("undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]||1>__FRMLOOKUP[a].dependents.length||null===b||"undefined"===typeof b)){a=__FRMLOOKUP[a];b=H(b[0].name);for(var d=0,e=a.dependents.length;d<e;d++)aa(a.dependents[d],b,c)}}function aa(a,b,c){a=W(a);if(!(!1===a||1>a.parents.length))if("lookup"==
29
+ a.fieldType){if(""!==b.repeatRow){c=[];var d="frm_field_"+a.fieldId+"-",d=d+(b.repeatingSection+"-"+b.repeatRow+"_container");b=document.getElementById(d);null!==b&&c.push(b);b=c}else b=[],a.isRepeating?b=document.querySelectorAll(".frm_field_"+a.fieldId+"_container"):(c=document.getElementById("frm_field_"+a.fieldId+"_container"),null!==c&&b.push(c));c=0;for(d=b.length;c<d;c++){la(a,b[c].id);var e=a,f=b[c];e.parentVals=X(e);if("select"==e.inputType)Wa(e,f);else if("radio"==e.inputType||"checkbox"==
30
+ e.inputType)if(!1===e.parentVals){var h=f.getElementsByTagName("input");xa(e,f);Z(h)}else Xa(e,f)}}else if("value changed"===c)for(c="field_"+a.fieldKey,c=a.isRepeating?""!==b.repeatingSection?'[id="'+c+"-"+b.repeatRow+'"]':'[id^="'+c+'-"]':'[id="'+c+'"]',b=document.querySelectorAll(c),c=0,d=b.length;c<d;c++)e=a,f=H(b[c].name),e.repeatRow=""!==f.repeatRow?f.repeatRow:"",e=a,f=b[c],e.parentVals=X(e),va(e,f)}function W(a){return"undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]?!1:
31
+ __FRMLOOKUP[a]}function X(a){for(var b=[],c=a.parents,d,e=0,f=c.length;e<f;e++){d=W(c[e]);d=ra(d,a);if(""===d||!1===d){b=!1;break}b[e]=d}return b}function S(a){for(var b=!1,c=a.length,d=0;d<c;d++)if("hidden"==a[d].type||a[d].checked){b=a[d].value;break}return b}function Wa(a,b){var c=b.getElementsByTagName("SELECT")[0];if(null!==c){var d=c.value;!1===a.parentVals?(c.options.length=1,""!==d&&(c.value="",V(c),t(jQuery(c),a.fieldKey))):(Ya(c),jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_lookup_field_options",
32
+ parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(b){var d=a.fieldKey,e=c.value;b=JSON.parse(b);for(var g=c.options.length;0<g;g--)c.remove(g);for(var k=b.length,g=0;g<k;g++)c.options[g+1]=new Option(b[g],b[g],!1,!1);c.value=e;""===c.value&&(b=c.getAttribute("data-frmval"),null!==b&&(c.value=b));V(c);c.disabled=!1;c.className=c.className.replace(" frm_loading_lookup","");c.value!=e&&t(jQuery(c),d)}}))}}function V(a){-1<a.className.indexOf("frm_chzn")&&
33
+ jQuery().chosen&&jQuery(a).trigger("chosen:updated")}function Ya(a){a.className+=" frm_loading_lookup";a.disabled=!0}function Xa(a,b){var c=b.getElementsByClassName("frm_opt_container")[0],d=c.getElementsByTagName("input");Za(b,c);var e="",e="radio"==a.inputType?S(d):J(d),f=jQuery(d[0]).data("frmval");jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_cb_radio_lookup_options",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,row_index:a.repeatRow,current_value:e,
34
+ default_value:f,nonce:frm_js.nonce},success:function(e){c.innerHTML=e;e=b.getElementsByClassName("frm-loading-img")[0];null!==e&&void 0!==e&&e.parentNode.removeChild(e);c.style.display="block";1==d.length&&""===d[0].value?xa(a,b):(!1!==B(b.id,a.formId)&&(e=O(a.fieldId),!1===e||1>e.conditions.length?(D(b.id,a.formId),jQuery("#"+b.id).show()):(e.containerId=b.id,e.repeatRow=a.repeatRow,ma(e))),void 0!==f&&(!1!==("radio"==a.inputType?S(d):J(d))||1>d.length||ua(d[0].name,f)));t(jQuery(d[0]),a.fieldKey)}})}
35
+ function xa(a,b){B(b.id,a.formId)||(jQuery("#"+b.id).hide(),wa(b.id,a.formId))}function va(a,b){if(!U(b,a.formId))if(!1===a.parentVals){var c=b.getAttribute("data-frmval");null===c&&(c="");ya(a,b,c)}else jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_get_lookup_text_value",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(c){b.value!=c&&ya(a.fieldKey,b,c)}})}function ya(a,b,c){b.value=c;t(jQuery(b),a)}function Sa(a,b){if(b){var c=
36
+ jQuery("#"+a.containerId);za(c)}jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:a.dataLogic.actualValue,current_field:a.fieldId,hide_id:a.containerId,nonce:frm_js.nonce},success:function(d){if(b){var e=c.find(".frm_opt_container");e.html(d);var f=e.children("input"),h=f.val();Aa(e);""===d||""===h?Q(a,!0):Ba(a,c,f,!0)}else e="field_"+a.fieldKey,""!==a.repeatRow&&(e+="-"+a.repeatRow),e=document.getElementById(e),e.value=d,B(a.containerId,a.formId)&&D(a.containerId,
37
+ a.formId),t(jQuery(e))}})}function Ta(a,b){var c=jQuery("#"+a.containerId),d=c.find('select[name^="item_meta"], input[name^="item_meta"]'),e=Ca(d),d=d.data("frmval"),f=c.closest("form").find('input[name="id"]').val();za(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_data_options",trigger_field_id:a.dataLogic.fieldId,entry_id:a.dataLogic.actualValue,field_id:a.fieldId,default_value:d,container_id:a.containerId,editing_entry:f,prev_val:e,nonce:frm_js.nonce},success:function(b){var d=
38
+ c.find(".frm_opt_container");d.html(b);var f=d.find('select, input[type="checkbox"], input[type="radio"]');Aa(d);""===b||1>f.length?Q(a,!0):(b=Ca(f),Ba(a,c,f,e!==b))}})}function za(a){var b=a.html();-1<b.indexOf("frm-loading-img")||(a.html(b+'<span class="frm-loading-img"></span>'),a.find(".frm_opt_container").hide())}function Za(a,b){if(!(-1<a.innerHTML.indexOf("frm-loading-img"))){b.style.display="none";var c=document.createElement("span");c.setAttribute("class","frm-loading-img");a.insertBefore(c,
39
+ b.nextSibling)}}function Aa(a){a.parent().children(".frm-loading-img").remove();a.show()}function Ca(a){var b=[],c="";a.each(function(){c=this.value;"radio"===this.type||"checkbox"===this.type?!0===this.checked&&b.push(c):""!==c&&b.push(c)});0===b.length&&(b="");return b}function Ba(a,b,c,d){B(a.containerId,a.formId)&&(D(a.containerId,a.formId),b.show());c.hasClass("frm_chzn")&&ba();!0===d&&t(c)}function M(a,b){if("undefined"!==typeof __FRMCALC){var c=__FRMCALC,d=c.fields[a];if("undefined"!==typeof d)for(var d=
40
+ d.total,e=[],f=0,h=d.length;f<h;f++){var g;g=c.calc[d[f]];var k=b.attr("name"),p=!1,l=g.field_id,m=E(g.form_id);1>m.length||("0"===g.inSection&&"0"===g.inEmbedForm?p=K(l,m):(k=H(k),K(l,m)?p=!0:Da(l,k,m)?p=!0:"0"!==g.inSection&&"0"!==g.inEmbedForm?p=Da(g.inSection,k,m):"0"!==g.inSection?p=K(g.inSection,m):"0"!==g.inEmbedForm&&(p=K(g.inEmbedForm,m))));g=p;!1===g&&Y(c,d[f],e,b)}}}function K(a,b){return-1<b.indexOf("frm_field_"+a+"_container")}function Da(a,b,c){var d=!1;b.repeatingSection&&(a="frm_field_"+
41
+ a+"-"+b.repeatingSection,a+="-"+b.repeatRow+"_container",d=-1<c.indexOf(a));return d}function Y(a,b,c,d){var e=a.calc[b],f=e.calc,h=jQuery(document.getElementById("field_"+b)),g={triggerField:d,inSection:!1,thisFieldCall:'input[id^="field_'+b+'-"]'};1>h.length&&"undefined"!==typeof d&&(g.inSection=!0,g.thisFieldId=$a(a.fieldsWithCalc,b),h=Ea(g));if(!(1>h.length)){f=ab(e,f,a,c,g);if("text"!=e.calc_type){a=e.calc_dec;-1<f.indexOf(").toFixed(")&&(c=f.split(").toFixed("),Fa(c[1])&&(a=c[1],f=f.replace(").toFixed("+
42
+ a,"")));f=parseFloat(eval(f));if("undefined"===typeof f||isNaN(f))f=0;Fa(a)&&(f=f.toFixed(a))}h.val()!=f&&(h.val(f),t(h,b))}}function ab(a,b,c,d,e){for(var f=0,h=a.fields.length;f<h;f++){var g={triggerField:e.triggerField,thisFieldId:a.fields[f],inSection:e.inSection,valKey:e.inSection+""+a.fields[f],thisField:c.fields[a.fields[f]],thisFieldCall:"input"+c.fieldKeys[a.fields[f]]},k=c;"checkbox"==g.thisField.type||"radio"==g.thisField.type||"scale"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+
43
+ ":checked,"+g.thisFieldCall+"[type=hidden]":"select"==g.thisField.type||"time"==g.thisField.type?g.thisFieldCall="select"+k.fieldKeys[g.thisFieldId]+" option:selected,"+g.thisFieldCall+"[type=hidden]":"textarea"==g.thisField.type&&(g.thisFieldCall=g.thisFieldCall+",textarea"+k.fieldKeys[g.thisFieldId]);if("text"==a.calc_type)g.valKey="text"+g.valKey,d=bb(g,d),"undefined"===typeof d[g.valKey]&&(d[g.valKey]="");else{g.valKey="num"+g.valKey;d=cb(g,c,d);if("undefined"===typeof d[g.valKey]||isNaN(d[g.valKey]))d[g.valKey]=
44
+ 0;"date"==g.thisField.type&&0===d[g.valKey]&&(b="")}k="["+g.thisFieldId+"]";k=k.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");b=b.replace(new RegExp(k,"g"),d[g.valKey])}return b}function cb(a,b,c){if("undefined"!==typeof c[a.valKey]&&0!==c[a.valKey])return c;c[a.valKey]=0;var d=Ga(a);if(!1===d)return c;d.each(function(){var d=Ha(a.thisField,this);if("date"==a.thisField.type){var f;f=b.date;var h=0;if(d)if("undefined"===typeof jQuery.datepicker){h="-";-1<f.indexOf("/")&&(h="/");f=f.split(h);var d=
45
+ d.split(h),g,k;g=h=k="";for(var l=0;l<f.length;l++)if("y"==f[l])g=((new Date).getFullYear()+15).toString().substr(2,2),g=d[l]>g?"19"+d[l]:"20"+d[l];else if("yy"==f[l])g=d[l];else if("m"==f[l]||"mm"==f[l])h=d[l],2>h.length&&(h="0"+h);else if("d"==f[l]||"dd"==f[l])k=d[l],2>k.length&&(k="0"+k);h=Date.parse(g+"-"+h+"-"+k)}else h=jQuery.datepicker.parseDate(f,d);f=h;null!==f&&(c[a.valKey]=Math.ceil(f/864E5))}else{f=d;""!==f&&0!==f&&(f=f.trim(),f=parseFloat(f.replace(/,/g,"").match(/-?[\d\.]+$/)));if("undefined"===
46
+ typeof f||isNaN(f)||""===f)f=0;c[a.valKey]+=f}});return c}function bb(a,b){if("undefined"!==typeof b[a.valKey]&&""!==b[a.valKey])return b;b[a.valKey]="";var c=Ga(a);if(!1===c)return b;var d=0,e="";c.each(function(){var c=Ha(a.thisField,this),c=c.trim();0<d&&(e=", ");""!==c&&(b[a.valKey]+=e+c,d++)});return b}function Ga(a){var b;if(!1===a.inSection)b=jQuery(a.thisFieldCall);else if(b=Ea(a),null===b||"undefined"===typeof b)b=jQuery(a.thisFieldCall);if(null===b||"undefined"===typeof b||1>b.length)b=
47
+ !1;return b}function Ea(a){if("undefined"===typeof a.triggerField)return null;var b=a.triggerField.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");return b.length?(a=a.thisFieldCall.replace("[id=","[id^="),b.find(a)):null}function Ha(a,b){var c;c=!1;if("hidden"==b.type)""!==ca(b)&&(c=!0);else if("select"==a.type){var d=b.className;d&&-1<d.indexOf("frm_other_trigger")&&(c=!0)}else("checkbox"==a.type||"radio"==a.type)&&-1<b.id.indexOf("-other_")&&0>b.id.indexOf("-otext")&&(c=!0);c?
48
+ (c=0,"select"==a.type?"hidden"==b.type?(d=!1,2<b.name.split("[").length&&(d=!0),d||(c=ca(b))):c=jQuery(b).closest(".frm_other_container").find(".frm_other_input").val():"checkbox"!=a.type&&"radio"!=a.type||"hidden"==b.type||(c=ca(b))):c="checkbox"!==b.type&&"radio"!==b.type||!b.checked?jQuery(b).val():b.value;"undefined"===typeof c&&(c="");return c}function ca(a){var b="";a=document.getElementById(a.id+"-otext");null!==a&&""!==a.value&&(b=a.value);return b}function Ia(a){var b=!1;a=jQuery(a).find(".frm_saving_draft");
49
+ a.length&&(b=a.val());return b}function Ja(a){var b=!1,c=jQuery(a).find(".frm_next_page");if(c.length&&c.val()){var d=jQuery(a).find('input[name="form_id"]').val();a=jQuery(a).find('input[name="frm_page_order_'+d+'"]');a=a.length?a.val():0;if(!a||c.val()<a)b=!0}return b}function ha(a,b){var c=a.getAttribute("data-frmfile");if("hidden"==a.type&&null===c)return b;var d="",e="";if("checkbox"==a.type||"radio"==a.type)c=jQuery('input[name="'+a.name+'"]').closest(".frm_required_field").find("input:checked"),
50
+ jQuery(c).each(function(){d=this.value});else if("file"==a.type||c)"undefined"===typeof c&&(c=n(a,!0),c=c.replace("file","")),"undefined"===typeof b[c]&&(d=db(c)),e=c;else{e=a.className;if(-1!==e.indexOf("frm_pos_none"))return b;d=jQuery(a).val();if("string"!==typeof d)for(var c=d,d="",f=0;f<c.length;f++)""!==c[f]&&(d=c[f]);e=-1===e.indexOf("frm_other_input")?n(a,!0):n(a,!1)}""===d&&(""===e&&(e=n(a,!0)),e in b||(b[e]=F(a,"data-reqmsg")));return b}function db(a){var b="";jQuery('input[name="file'+
51
+ a+'"], input[name="file'+a+'[]"], input[name^="item_meta['+a+']"]').each(function(){""===b&&(b=this.value)});return b}function ia(a,b,c){var d=a.value,e=n(a,!0);if(e in b)return b;var f=0===e.indexOf("conf_");if(""!==d||f){var h=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i,g=F(a,"data-invmsg");""!==d&&!1===h.test(d)?(b[e]=g,f&&(b[e.replace("conf_","")]="")):f&&(a=a.name.replace("conf_",""),
52
+ c.filter('[name="'+a+'"]').val()!==d&&(b[e]="",b[e.replace("conf_","")]=""))}return b}function ja(a,b){var c=a.value;""!==c&&!1!==isNaN(c/1)&&(c=n(a,!0),c in b||(b[c]=F(a,"data-invmsg")));return b}function ka(a,b){var c=a.value,d=F(a,"pattern");if(""!==d&&""!==c){var e=n(a,!0);e in b||(d=new RegExp("^"+d+"$","i"),!1===d.test(c)&&(b[e]=F(a,"data-invmsg")))}return b}function F(a,b){var c=a.getAttribute(b);null===c&&(c="");return c}function eb(a,b){"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();
53
+ jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){var c={content:"",errors:{},pass:!1};null===b&&(b=c);b=b.replace(/^\s+|\s+$/g,"");b=0===b.indexOf("{")?jQuery.parseJSON(b):c;if("undefined"!=typeof b.redirect)window.location=b.redirect;else if(""!==b.content){jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");var e=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest(".frm_forms").replaceWith(b.content);
54
+ -1!=frm_js.offset&&frmFrontForm.scrollMsg(e,jQuery(a));"function"==typeof frmThemeOverride_frmAfterSubmit&&(e=jQuery('input[name="frm_page_order_'+e+'"]').val(),c=jQuery(b.content).find('input[name="form_id"]').val(),frmThemeOverride_frmAfterSubmit(c,e,b.content,a));e=jQuery(a).find('input[name="id"]');e.length&&jQuery(document.getElementById("frm_edit_"+e.val())).find("a").addClass("frm_ajax_edited").click();jQuery(b.content).find(".frm_message").length&&da("pageLoad");ea()}else if(Object.keys(b.errors).length){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");
55
+ jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");c=!0;Ka();var f=!1,h;for(e in b.errors)if(h=jQuery(a).find("#frm_field_"+e+"_container"),h.length){if(!h.is(":visible")){var g=h.closest(".frm_toggle_container");g.length&&(g=g.prev(),g.hasClass("frm_trigger")||(g=g.prev(".frm_trigger")),g.click())}h.is(":visible")&&(N(h,e,b.errors),c=!1,h=jQuery(a).find("#frm_field_"+e+"_container .frm-g-recaptcha, #frm_field_"+e+"_container .g-recaptcha"),h.length&&(f=!0,h=h.data("rid"),jQuery().grecaptcha&&
56
+ (h?grecaptcha.reset(h):grecaptcha.reset())))}La(a);!0!==f&&Ma(a,!1);c?a.submit():jQuery(a).prepend(b.error_message)}else fb(a),Ma(a,!0),a.submit()},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}function N(a,b,c){a.length&&a.is(":visible")&&(a.addClass("frm_blank_field"),"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,c):a.append('<div class="frm_error">'+c[b]+"</div>"))}function Ka(){jQuery(".form-field").removeClass("frm_blank_field");
57
+ jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function La(a){var b=jQuery(a).find(".frm_blank_field:first");b.length&&frmFrontForm.scrollMsg(b,a,!0)}function fb(a){var b=document.getElementById("frm_loading");null!==b&&(a=jQuery(a).find("input[type=file]").val(),"undefined"!=typeof a&&""!==a&&setTimeout(function(){jQuery(b).fadeIn("slow")},2E3))}function Ma(a,b){var c=jQuery(a).find(".frm-g-recaptcha, .g-recaptcha");c.length&&(!b||1>jQuery(a).find(".frm_next_page").length||
58
+ 1>jQuery(a).find(".frm_next_page").val())&&c.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}function gb(){Na(jQuery(this),"clear")}function hb(){Na(jQuery(this),"replace")}function Na(a,b){var c=a.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"==typeof c)return!1;var d=a.val().replace(/(\n|\r\n)/g,"\r");"replace"==b?""===d&&a.addClass("frm_default").val(c):d==c&&a.removeClass("frm_default").val("")}function ib(){var a=
59
+ jQuery(this),b=a.data("eid"),c=a.data("fid");a.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:b,form_id:c,nonce:frm_js.nonce},success:function(b){a.replaceWith(b)}});return!1}function jb(a,b){google.load("visualization","1.0",{packages:[b],callback:function(){var b=new google.visualization.DataTable,d=!1;-1!==jQuery.inArray("id",a.options.fields)&&(d=!0,b.addColumn("number",frm_js.id));for(var e=
60
+ a.fields.length,f,h=0,g=e;h<g;h++){var k=a.fields[h];f=Oa(k);b.addColumn(f,k.name)}h=!1;a.options.edit_link&&(h=!0,b.addColumn("string",a.options.edit_link));g=!1;a.options.delete_link&&(g=!0,b.addColumn("string",a.options.delete_link));if(null!==a.entries){var l=a.entries.length;b.addRows(l);for(var m=0,q=0;q<l;q++){var k=0,n=a.entries[q];d&&(b.setCell(m,k,n.id),k++);for(var r=0,t=e;r<t;r++){var u=a.fields[r];f=Oa(u);u=n.metas[u.id];"number"!=f||null!==u&&""!==u?"boolean"==f&&(u=null===u||"false"==
61
+ u||!1===u?!1:!0):u=0;b.setCell(m,k,u);k++}h&&("undefined"!==typeof n.editLink?b.setCell(m,k,'<a href="'+n.editLink+'">'+a.options.edit_link+"</a>"):b.setCell(m,k,""),k++);g&&("undefined"!==typeof n.deleteLink?b.setCell(m,k,'<a href="'+n.deleteLink+'" class="frm_delete_link" data-frmconfirm="'+a.options.confirm+'">'+a.options.delete_link+"</a>"):b.setCell(m,k,""));m++}}else for(b.addRows(1),h=k=0,g=e;h<g;h++)0<k?b.setCell(0,k,""):b.setCell(0,k,a.options.no_entries),k++;(new google.visualization.Table(document.getElementById("frm_google_table_"+
62
+ a.options.form_id))).draw(b,a.graphOpts)}})}function kb(a){google.load("visualization","1.0",{packages:[a["package"]],callback:function(){var b;new google.visualization.DataTable;b=google.visualization.arrayToDataTable(a.data);var c=document.getElementById("chart_"+a.graph_id);if(null!==c){var d=a.type.charAt(0).toUpperCase()+a.type.slice(1);"Histogram"!==d&&"Table"!==d&&(d+="Chart");(new google.visualization[d](c)).draw(b,a.options)}}})}function Oa(a){var b="string";if("number"==a.type)b="number";
63
+ else if("checkbox"==a.type||"select"==a.type){var c=a.options.length;"select"==a.type&&""===a.options[0]&&(c="post_status"==a.field_options.post_field?3:c-1);1==c&&(b="boolean")}return b}function lb(){var a=jQuery(this).data("key"),b=jQuery(this).data("parent"),c="frm_section_"+b+"-"+a,d=jQuery(document.getElementById(c)),e=d.find("input, select, textarea"),f=jQuery(this).closest("form").find('input[name="form_id"]').val();d.fadeOut("slow",function(){d.remove();e.each(function(){var c=n(this,!1);
64
+ "file"!=this.type&&M(c,jQuery(this));D("frm_field_"+c+"-"+b+"-"+a+"_container",f)});"function"==typeof frmThemeOverride_frmRemoveRow&&frmThemeOverride_frmRemoveRow(c,d)});return!1}function mb(){if(!0===L)return!1;L=!0;var a=jQuery(this).data("parent"),b=0;if(0<jQuery(".frm_repeat_"+a).length)var c=jQuery(".frm_repeat_"+a+":last").attr("id").replace("frm_section_"+a+"-",""),b=-1<c.indexOf("i")?1:1+parseInt(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_add_form_row",
65
+ field_id:a,i:b,nonce:frm_js.nonce},success:function(c){var d=c.html,f=jQuery(d).hide().fadeIn("slow");jQuery(".frm_repeat_"+a+":last").after(f);var h=["other"],g,k,l={repeatingSection:a.toString(),repeatRow:b.toString()};jQuery(d).find("input, select, textarea").each(function(){if("file"!=this.type){if(""===this.name)return!0;g=this.name.replace("item_meta[","").split("]")[2].replace("[","");-1==jQuery.inArray(g,h)&&!1!==this.id&&""!==this.id&&(k=jQuery("#"+this.id),h.push(g),I(g,l),aa(g,l,"value changed"),
66
+ fa(g,k),ga(g,k,"value changed"),M(g,k))}});v(l.repeatRow);Pa();ba();"function"==typeof frmThemeOverride_frmAddRow&&frmThemeOverride_frmAddRow(a,c);L=!1},error:function(){L=!1}});return!1}function nb(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("pageid"),e=a.data("formid"),f=a.data("cancel"),h=a.data("fields"),g=a.data("excludefields"),k=jQuery(document.getElementById(c+b)),l=k.html();k.html('<span class="frm-loading-img" id="'+c+b+'"></span><div class="frm_orig_content" style="display:none">'+
67
+ l+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:d,entry_id:b,id:e,nonce:frm_js.nonce,fields:h,exclude_fields:g},success:function(b){k.children(".frm-loading-img").replaceWith(b);a.removeClass("frm_inplace_edit").addClass("frm_cancel_edit");a.html(f);da("editInPlace");jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',
68
+ G);ea()}});return!1}function ob(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("edit");a.hasClass("frm_ajax_edited")||(b=jQuery(document.getElementById(c+b)),b.children(".frm_forms").replaceWith(""),b.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));a.removeClass("frm_cancel_edit").addClass("frm_inplace_edit");a.html(d);return!1}function pb(){var a=jQuery(this),b=a.data("deleteconfirm");if(confirm(b)){var c=a.data("entryid"),d=a.data("prefix");a.replaceWith('<span class="frm-loading-img" id="frm_delete_'+
69
+ c+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:c,nonce:frm_js.nonce},success:function(a){if("success"==a.replace(/^\s+|\s+$/g,"")){var b=jQuery(document.getElementById(d+c));b.fadeOut("slow",function(){b.remove()});jQuery(document.getElementById("frm_delete_"+c)).fadeOut("slow")}else jQuery(document.getElementById("frm_delete_"+c)).replaceWith(a)}})}return!1}function ea(){"undefined"!==typeof __frmHideFields&&frmFrontForm.hidePreviouslyHiddenFields();
70
+ jQuery(document).on("focusin",".frm_date",r);if("undefined"!==typeof __frmUniqueTimes)for(var a=__frmUniqueTimes,b=0;b<a.length;b++)jQuery(document.getElementById(a[b].dateID)).change(q);if("undefined"!==typeof __frmMasks)for(a=__frmMasks,b=0;b<a.length;b++)jQuery(a[b].trigger).attr("data-frmmask",a[b].mask);Pa();ba();"undefined"!==typeof __frmDepDynamicFields&&frmFrontForm.checkDependentDynamicFields(__frmDepDynamicFields);"undefined"!==typeof __frmDepLookupFields&&frmFrontForm.checkDependentLookupFields(__frmDepLookupFields);
71
+ if("undefined"!==typeof __FRMCALC){(a=__FRMCALC.triggers)&&jQuery(a.join()).trigger({type:"change",selfTriggered:!0});var a=__FRMCALC.calc,b=[],c;for(c in a)if(1>a[c].fields.length){var d=document.getElementById("field_"+c);null===d||U(d,a[c].form_id)||Y(__FRMCALC,c,b)}}v()}function ba(){if(jQuery().chosen){var a={allow_single_deselect:!0,no_results_text:frm_js.no_results};"undefined"!==typeof __frmChosen&&(a="{"+__frmChosen+"}");jQuery(".frm_chzn").chosen(a)}}function Pa(){if(jQuery().rating){var a=
72
+ jQuery(".star");a.length&&a.rating()}}function da(a){"undefined"!==typeof __frmHideOrShowFields&&frmFrontForm.hideOrShowFields(__frmHideOrShowFields,a)}function t(a,b){"undefined"===typeof b&&(b="dependent");1<a.length&&(a=a.eq(0));a.trigger({type:"change",selfTriggered:!0,frmTriggered:b})}function H(a){var b={repeatingSection:"",repeatRow:""};"undefined"!==typeof a&&3<=a.split("][").length&&(a=a.split("]["),b.repeatingSection=a[0].replace("item_meta[",""),b.repeatRow=a[1]);return b}function Qa(a){a.fadeOut("slow",
73
+ function(){a.remove()})}function qb(){var a=jQuery(this).data("frmconfirm");return confirm(a)}function rb(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function $a(a,b){for(var c in a)if(a.hasOwnProperty(c)&&a[c]===b)return c;return null}function Fa(a){return!jQuery.isArray(a)&&0<=a-parseFloat(a)+1}function sb(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,d=Number(b)||0,d=0>d?
74
+ Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1})}function tb(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})}function ub(){Array.prototype.filter||(Array.prototype.filter=function(a,b){if(void 0===this||null===this)throw new TypeError;var c=Object(this),d=c.length>>>0;if("function"!==typeof a)throw new TypeError;for(var e=[],f=0;f<d;f++)if(f in c){var h=c[f];a.call(b,h,f,c)&&e.push(h)}return e})}
75
+ function vb(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b})}var L=!1,C="",x=[];return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(document).on("click",".frm_trigger",m);var a=jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():
76
+ jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",gb);jQuery(document).on("blur",".frm_toggle_default",hb);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(ib);jQuery(document).on("click",".frm_remove_link",w);jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});
77
+ jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',G);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',l);jQuery(document).on("change",'.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',A);jQuery(document).on("click",".frm_remove_form_row",
78
+ lb);jQuery(document).on("click",".frm_add_form_row",mb);jQuery(document).on("click","a[data-frmconfirm]",qb);jQuery("a[data-frmtoggle]").click(rb);jQuery(".frm_edit_link_container").on("click","a.frm_inplace_edit",nb);jQuery(".frm_edit_link_container").on("click","a.frm_cancel_edit",ob);jQuery(document).on("click",".frm_ajax_delete",pb);jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");a.hasClass("ui-icon-triangle-1-e")?
79
+ (a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):(a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),jQuery(this).next(".frm_toggle_container").hide())});da("pageLoad");ea();sb();tb();ub();vb()},submitForm:function(a){frmFrontForm.submitFormManual(a,this)},submitFormManual:function(a,b){var c=b.className.trim().split(/\s+/gi);if((!c||-1<c.indexOf("frm_pro_form"))&&!jQuery("body").hasClass("wp-admin")){a.preventDefault();
80
+ var d=frmFrontForm.validateFormSubmit(b);0===Object.keys(d).length&&(jQuery(b).find(".frm_ajax_loading").addClass("frm_loading_now"),jQuery(b).find('input[type="submit"], input[type="button"]').attr("disabled","disabled"),-1<c.indexOf("frm_ajax_submit")?1>jQuery(b).find('input[type="file"]').length?(C=jQuery(b).find('input[name="frm_action"]').val(),frmFrontForm.checkFormErrors(b,C)):b.submit():b.submit())}},validateFormSubmit:function(a){"undefined"!=typeof tinyMCE&&jQuery(this).find(".wp-editor-wrap").length&&
81
+ tinyMCE.triggerSave();x=[];var b=jQuery(a).hasClass("frm_js_validate");b&&(Ia(a)||Ja(a))&&(b=!1);b&&(frmFrontForm.getAjaxFormErrors(a),Object.keys(x).length&&frmFrontForm.addAjaxFormErrors(a));return x},getAjaxFormErrors:function(a){var b=[],c=jQuery(a).find(".frm_required_field:visible input, .frm_required_field:visible select, .frm_required_field:visible textarea").filter(":not(.frm_optional)");if(c.length)for(var d=0,e=c.length;d<e;d++)b=ha(c[d],b);c=jQuery(a).find("input[type=email]").filter(":visible");
82
+ d=jQuery(a).find("input,select,textarea");if(d.length)for(var e=0,f=d.length;e<f;e++){var h=d[e];""!==h.value&&"hidden"!=h.type&&("number"==h.type?b=ja(h,b):"email"==h.type?b=ia(h,b,c):null!==h.pattern&&(b=ka(h,b)))}c=jQuery(a).find(".frm-g-recaptcha");c.length&&(d=c.data("rid"),0===grecaptcha.getResponse(d).length&&(c=c.closest(".frm_form_field").attr("id").replace("frm_field_","").replace("_container",""),b[c]=""));x=b;if("function"==typeof frmThemeOverride_jsErrors&&(C=jQuery(a).find('input[name="frm_action"]').val(),
83
+ a=frmThemeOverride_jsErrors(C,a),Object.keys(a).length))for(var g in a)x[g]=a[g];return x},addAjaxFormErrors:function(a){Ka();for(var b in x){var c=jQuery(a).find("#frm_field_"+b+"_container");c.length?N(c,b,x):delete x[b]}La(a)},checkFormErrors:function(a,b){eb(a,b)},scrollToID:function(a){a=jQuery(document.getElementById(a));frmFrontForm.scrollMsg(a,!1)},scrollMsg:function(a,b,c){if("undefined"==typeof b){if(a=jQuery(document.getElementById("frm_form_"+a+"_container")),1>a.length)return}else a=
84
+ "string"==typeof a?jQuery(b).find("#frm_field_"+a+"_container"):a;if(a=a.offset().top){a-=frm_js.offset;b=jQuery("html").css("margin-top");var d=jQuery("body").css("margin-top");if(b||d)a=a-parseInt(b)-parseInt(d);if(a&&window.innerHeight&&(b=document.documentElement.scrollTop||document.body.scrollTop,a>b+window.innerHeight||a<b))return"undefined"===typeof c?jQuery(window).scrollTop(a):jQuery("html,body").animate({scrollTop:a},500),!1}},savingDraft:function(a){return Ia(a)},goingToPreviousPage:function(a){return Ja(a)},
85
+ hideOrShowFields:function(a,b){if("pageLoad"===b){var c=document.querySelectorAll('[id^="frm_hide_fields_"]');Z(c)}for(var c={repeatingSection:"",repeatRow:""},d=0,e=a.length;d<e;d++)I(a[d],c)},hidePreviouslyHiddenFields:function(){var a;a=[];for(var b=document.querySelectorAll('*[id^="frm_hide_fields_"]'),c=b.length,d,e=0;e<c;e++)d=b[e].id.replace("frm_hide_fields_",""),a=a.concat(E(d));b=0;for(c=a.length;b<c;b++)d=document.getElementById(a[b]),null!==d&&(d.style.display="none")},checkDependentDynamicFields:function(a){for(var b=
86
+ {repeatingSection:"",repeatRow:""},c=0,d=a.length;c<d;c++)I(a[c],b)},checkDependentLookupFields:function(a){for(var b,c={repeatingSection:"",repeatRow:""},d=0,e=a.length;d<e;d++)b=a[d],aa(b,c,"value changed")},loadGoogle:function(){if("undefined"!==typeof google&&google&&google.load)for(var a=__FRMTABLES,b=Object.keys(a),c=0;c<b.length;c++)if("graphs"===b[c])for(var d=a[b[c]],e=0,f=d.length;e<f;e++)kb(d[e]);else for(d=a[b[c]],e=b[c],f=0;f<d.length;f++)jb(d[f],e);else setTimeout(frmFrontForm.loadGoogle,
87
+ 30)},removeUsedTimes:function(a,b){var c=jQuery(a).parents("form:first").find('input[name="id"]');jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_fields_ajax_time_options",time_field:b,date_field:a.id,entry_id:c?c.val():"",date:jQuery(a).val(),nonce:frm_js.nonce},success:function(a){var c=jQuery(document.getElementById(b));c.find("option").removeAttr("disabled");if(a&&""!==a)for(var d in a)c.find('option[value="'+d+'"]').attr("disabled","disabled")}})},escapeHtml:function(a){return a.replace(/&/g,
88
+ "&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(a){jQuery(a).css("visibility","hidden")},visible:function(a){jQuery(a).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(l){frmFrontForm.init()});
89
+ function frmRecaptcha(){for(var l=jQuery(".frm-g-recaptcha"),m=0,q=l.length;m<q;m++){var r=grecaptcha.render(l[m].id,{sitekey:l[m].getAttribute("data-sitekey"),size:l[m].getAttribute("data-size"),theme:l[m].getAttribute("data-theme")});l[m].setAttribute("data-rid",r)}}
90
+ function frmUpdateField(l,m,q,r,v){jQuery(document.getElementById("frm_update_field_"+l+"_"+m)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:l,field_id:m,value:q,nonce:frm_js.nonce},success:function(){""===r.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+l+"_"+m+"_"+v)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+l+"_"+m+"_"+v)).replaceWith(r)}})}
91
+ function frmEditEntry(l,m,q,r,v,z){console.warn("DEPRECATED: function frmEditEntry in v2.0.13 use frmFrontForm.editEntry");var y=jQuery(document.getElementById("frm_edit_"+l)),w=y.html(),A=jQuery(document.getElementById(m+l)),G=A.html();A.html('<span class="frm-loading-img" id="'+m+l+'"></span><div class="frm_orig_content" style="display:none">'+G+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:q,entry_id:l,id:r,nonce:frm_js.nonce},
92
+ success:function(n){A.children(".frm-loading-img").replaceWith(n);y.replaceWith('<span id="frm_edit_'+l+'"><a onclick="frmCancelEdit('+l+",'"+m+"','"+frmFrontForm.escapeHtml(w)+"',"+q+","+r+",'"+z+'\')" class="'+z+'">'+v+"</a></span>")}})}
93
+ function frmCancel