Formidable Forms – Form Builder for WordPress - Version 2.02.13

Version Description

  • New: Add frm_send_separate_emails filter. If there are multiple emails in the "to" box, this hook will send one email per address.
  • Fixed: Prevent field option reset when a style is included with the imported form
  • Pro Version *
  • New: Add dynamic Lookup population options to paragraph fields
  • New: Allow no_link=1 for [25 truncate=20 no_link=1]. By default, when a value is truncated in a view, it shows a link to show more content. This shortcode option can remove the link.
  • New: Add does_not_contain filter to stats shortcode
  • New: Add frm_filter_view hook for modifying View object
  • New: Add frm_graph_default_colors hook
  • Tweak: Replace all formidablepro.com links with formidableforms.com
  • Improved: Remove arrows on read-only HTML5 number field
  • Improved: Apply Formidable styling to Dynamic List fields
  • Improved: Allow Lookup fields with repeating section values to filter based on parent value
  • Improved: Arrows on read-only number field removed from Firefox
  • Fixed: Do not enable read-only dependent Lookup fields
  • Fixed: Form scrolls correctly on page turn
  • Fixed: JavaScript errors caused by file upload field in Woocommerce form
  • Fixed: Allow ajax submit if there are no file fields on the page with a value
  • Fixed: Correctly import address values into Address field
  • Fixed: [created_at] conditionals take timezone into account
  • Fixed: Do not urlencode GET variables that are set in form shortcode
  • Fixed: Prevent WordPress auto paragraphs from adding unwanted paragraph tags in calendar View headings
  • Fixed: Removed repeating fields from non-repeating field logic
Download this release

Release Info

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

Code changes from version 2.02.12 to 2.02.13

Files changed (45) hide show
  1. classes/controllers/FrmAddonsController.php +2 -2
  2. classes/controllers/FrmAppController.php +2 -2
  3. classes/controllers/FrmEntriesController.php +2 -2
  4. classes/helpers/FrmAppHelper.php +1 -1
  5. classes/helpers/FrmTipsHelper.php +33 -28
  6. classes/models/FrmAddon.php +3 -3
  7. classes/models/FrmAntiSpam.php +268 -0
  8. classes/models/FrmForm.php +1 -1
  9. classes/models/FrmNotification.php +69 -34
  10. classes/models/FrmPointers.php +2 -2
  11. classes/views/addons/upgrade_to_pro.php +4 -4
  12. classes/views/frm-entries/no_entries.php +1 -1
  13. classes/views/frm-settings/license_box.php +2 -2
  14. css/_single_theme.css.php +11 -2
  15. css/custom_theme.css.php +5 -0
  16. formidable.php +4 -4
  17. js/formidable.js +27 -13
  18. js/formidable.min.js +96 -96
  19. js/formidable_admin.js +60 -21
  20. languages/formidable-az_AZ.mo +0 -0
  21. languages/formidable-az_AZ.po +215 -215
  22. languages/formidable-de_DE.mo +0 -0
  23. languages/formidable-de_DE.po +226 -231
  24. languages/formidable-es_ES.mo +0 -0
  25. languages/formidable-es_ES.po +221 -223
  26. languages/formidable-hu_HU.mo +0 -0
  27. languages/formidable-hu_HU.po +215 -215
  28. languages/formidable-it_IT.mo +0 -0
  29. languages/formidable-it_IT.po +235 -242
  30. languages/formidable-ja_JP.mo +0 -0
  31. languages/formidable-ja_JP.po +215 -215
  32. languages/formidable-nb_NO.mo +0 -0
  33. languages/formidable-nb_NO.po +230 -234
  34. languages/formidable-nl_NL.mo +0 -0
  35. languages/formidable-nl_NL.po +215 -215
  36. languages/formidable-pl_PL.mo +0 -0
  37. languages/formidable-pl_PL.po +215 -215
  38. languages/formidable-pt_BR.mo +0 -0
  39. languages/formidable-pt_BR.po +215 -215
  40. languages/formidable-ro_RO.mo +0 -0
  41. languages/formidable-ro_RO.po +215 -215
  42. languages/formidable-sr_RS.mo +0 -0
  43. languages/formidable-sr_RS.po +221 -223
  44. languages/formidable.pot +215 -215
  45. readme.txt +26 -2
classes/controllers/FrmAddonsController.php CHANGED
@@ -16,7 +16,7 @@ class FrmAddonsController {
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
  }
@@ -185,7 +185,7 @@ class FrmAddonsController {
185
 
186
  $license = get_option('frmpro-credentials');
187
  if ( $license && is_array( $license ) && isset( $license['license'] ) ) {
188
- $url = 'http://formidablepro.com/frm-edd-api/licenses?l=' . urlencode( base64_encode( $license['license'] ) );
189
  $licenses = self::send_api_request( $url, array( 'name' => 'frm_api_licence', 'expires' => 60 * 60 * 5 ) );
190
  echo json_encode( $licenses );
191
  }
16
  $addons = self::get_api_addons();
17
  self::prepare_addons( $addons );
18
 
19
+ $site_url = 'https://formidableforms.com/';
20
 
21
  include( FrmAppHelper::plugin_path() . '/classes/views/addons/list.php' );
22
  }
185
 
186
  $license = get_option('frmpro-credentials');
187
  if ( $license && is_array( $license ) && isset( $license['license'] ) ) {
188
+ $url = 'https://formidableforms.com/frm-edd-api/licenses?l=' . urlencode( base64_encode( $license['license'] ) );
189
  $licenses = self::send_api_request( $url, array( 'name' => 'frm_api_licence', 'expires' => 60 * 60 * 5 ) );
190
  echo json_encode( $licenses );
191
  }
classes/controllers/FrmAppController.php CHANGED
@@ -105,7 +105,7 @@ class FrmAppController {
105
  FrmAppHelper::load_admin_wide_js();
106
 
107
  // user is authorized, but running free version
108
- $inst_install_url = 'https://formidablepro.com/knowledgebase/install-formidable-forms/';
109
  ?>
110
  <div class="error" class="frm_previous_install">
111
  <?php
@@ -138,7 +138,7 @@ class FrmAppController {
138
  <div class="update-nag frm-update-to-pro">
139
  <?php echo FrmAppHelper::kses( $tip['tip'] ) ?>
140
  <span><?php echo FrmAppHelper::kses( $tip['call'] ) ?></span>
141
- <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com?banner=1&tip=' . absint( $tip['num'] ) ) ) ?>" class="button">Upgrade to Pro</a>
142
  </div>
143
  <?php
144
  }
105
  FrmAppHelper::load_admin_wide_js();
106
 
107
  // user is authorized, but running free version
108
+ $inst_install_url = 'https://formidableforms.com/knowledgebase/install-formidable-forms/';
109
  ?>
110
  <div class="error" class="frm_previous_install">
111
  <?php
138
  <div class="update-nag frm-update-to-pro">
139
  <?php echo FrmAppHelper::kses( $tip['tip'] ) ?>
140
  <span><?php echo FrmAppHelper::kses( $tip['call'] ) ?></span>
141
+ <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidableforms.com?banner=1&tip=' . absint( $tip['num'] ) ) ) ?>" class="button">Upgrade to Pro</a>
142
  </div>
143
  <?php
144
  }
classes/controllers/FrmEntriesController.php CHANGED
@@ -57,8 +57,8 @@ class FrmEntriesController {
57
 
58
  $screen->set_help_sidebar(
59
  '<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' .
60
- '<p><a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'http://formidablepro.com/knowledgebase/manage-entries-from-the-back-end/' ) ) . '" target="_blank">' . esc_html__( 'Documentation on Entries', 'formidable' ) . '</a></p>' .
61
- '<p><a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'http://formidablepro.com/help-desk/' ) ) . '" target="_blank">' . esc_html__( 'Support', 'formidable' ) . '</a></p>'
62
  );
63
 
64
  return $help;
57
 
58
  $screen->set_help_sidebar(
59
  '<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' .
60
+ '<p><a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/knowledgebase/manage-entries-from-the-back-end/' ) ) . '" target="_blank">' . esc_html__( 'Documentation on Entries', 'formidable' ) . '</a></p>' .
61
+ '<p><a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/help-desk/' ) ) . '" target="_blank">' . esc_html__( 'Support', 'formidable' ) . '</a></p>'
62
  );
63
 
64
  return $help;
classes/helpers/FrmAppHelper.php CHANGED
@@ -10,7 +10,7 @@ class FrmAppHelper {
10
  /**
11
  * @since 2.0
12
  */
13
- public static $plug_version = '2.02.12';
14
 
15
  /**
16
  * @since 1.07.02
10
  /**
11
  * @since 2.0
12
  */
13
+ public static $plug_version = '2.02.13';
14
 
15
  /**
16
  * @since 1.07.02
classes/helpers/FrmTipsHelper.php CHANGED
@@ -13,8 +13,9 @@ class FrmTipsHelper {
13
  if ( $html == 'p' ) {
14
  echo '<p>';
15
  }
 
16
  ?>
17
- <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( $tip['link'] ) ) ?>" target="_blank" class="frm_pro_tip">
18
  <span><i class="frm_icon_font frm_check1_icon"></i> Pro Tip:</span>
19
  <?php echo esc_html( $tip['tip'] ) ?>
20
  <?php if ( isset( $tip['call'] ) ) { ?>
@@ -27,35 +28,39 @@ class FrmTipsHelper {
27
  }
28
  }
29
 
 
 
 
 
30
  public static function get_builder_tip() {
31
  $tips = array(
32
  array(
33
- 'link' => 'https://formidablepro.com/section-tip',
34
  'tip' => __( 'Long forms can still be beautiful with sections.', 'formidable' ),
35
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
36
  ),
37
  array(
38
- 'link' => 'https://formidablepro.com/conditional-logic-tip',
39
  'tip' => __( 'Use conditional logic to shorten your forms and increase conversions.', 'formidable' ),
40
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
41
  ),
42
  array(
43
- 'link' => 'https://formidablepro.com/page-break-tip',
44
  'tip' => __( 'Stop intimidating users with long forms.', 'formidable' ),
45
  'call' => __( 'Use page breaks.', 'formidable' ),
46
  ),
47
  array(
48
- 'link' => 'https://formidablepro.com/file-upload-tip',
49
  'tip' => __( 'Cut down on back-and-forth with clients.', 'formidable' ),
50
  'call' => __( 'Allow file uploads in your form.', 'formidable' ),
51
  ),
52
  array(
53
- 'link' => 'https://formidablepro.com/calculations-total-tip',
54
  'tip' => __( 'Need to calculate a total?', 'formidable' ),
55
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
56
  ),
57
  array(
58
- 'link' => 'https://formidablepro.com/prefill-fields',
59
  'tip' => __( 'Save time.', 'formidable' ),
60
  'call' => __( 'Prefill fields with user info.', 'formidable' ),
61
  ),
@@ -68,17 +73,17 @@ class FrmTipsHelper {
68
  public static function get_form_settings_tip() {
69
  $tips = array(
70
  array(
71
- 'link' => 'https://formidablepro.com/front-end-editing-tip',
72
  'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
73
  'call' => __( 'Add front-end editing.', 'formidable' ),
74
  ),
75
  array(
76
- 'link' => 'https://formidablepro.com/front-end-editing-b-tip',
77
  'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
78
  'call' => __( 'Add front-end editing.', 'formidable' ),
79
  ),
80
  array(
81
- 'link' => 'https://formidablepro.com/save-drafts-tip',
82
  'tip' => __( 'Have a long form that takes time to complete?', 'formidable' ),
83
  'call' => __( 'Let logged-in users save a draft and return later.', 'formidable' ),
84
  ),
@@ -89,57 +94,57 @@ class FrmTipsHelper {
89
  public static function get_form_action_tip() {
90
  $tips = array(
91
  array(
92
- 'link' => 'https://formidablepro.com/email-routing-tip',
93
  'tip' => __( 'Save time by sending the email to the right person automatically.', 'formidable' ),
94
  'call' => __( 'Add email routing.', 'formidable' ),
95
  ),
96
  array(
97
- 'link' => 'https://formidablepro.com/create-posts-tip',
98
  'tip' => __( 'Create blog posts or pages from the front-end.', 'formidable' ),
99
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
100
  ),
101
  array(
102
- 'link' => 'https://formidablepro.com/front-end-posting-tip',
103
  'tip' => __( 'Make front-end posting easy.', 'formidable' ),
104
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
105
  ),
106
  array(
107
- 'link' => 'https://formidablepro.com/mailchimp-tip',
108
  'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
109
  'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
110
  ),
111
  array(
112
- 'link' => 'https://formidablepro.com/paypal-tip',
113
  'tip' => __( 'Save hours and increase revenue by collecting payments with every submission.', 'formidable' ),
114
  'call' => __( 'Use PayPal with this form.', 'formidable' ),
115
  ),
116
  array(
117
- 'link' => 'https://formidablepro.com/paypal-increase-revenue-tip',
118
  'tip' => __( 'Increase revenue.', 'formidable' ),
119
  'call' => __( 'Use PayPal with this form.', 'formidable' ),
120
  ),
121
  array(
122
- 'link' => 'https://formidablepro.com/paypal-save-time-tip',
123
  'tip' => __( 'Get paid more quickly.', 'formidable' ),
124
  'call' => __( 'Use Paypal with this form.', 'formidable' ),
125
  ),
126
  array(
127
- 'link' => 'https://formidablepro.com/registration-tip',
128
  'tip' => __( 'Boost your site membership.', 'formidable' ),
129
  'call' => __( 'Automatically create user accounts.', 'formidable' ),
130
  ),
131
  array(
132
- 'link' => 'https://formidablepro.com/registration-profile-editing-tip',
133
  'tip' => __( 'Make front-end profile editing possible.', 'formidable' ),
134
  'call' => __( 'Add user registration.', 'formidable' ),
135
  ),
136
  array(
137
- 'link' => 'https://formidablepro.com/twilio-tip',
138
  'tip' => __( 'Want a text when this form is submitted or when a payment is received?', 'formidable' ),
139
  'call' => __( 'Use Twilio with this form.', 'formidable' ),
140
  ),
141
  array(
142
- 'link' => 'https://formidablepro.com/twilio-send-tip',
143
  'tip' => __( 'Send a text when this form is submitted.', 'formidable' ),
144
  'call' => __( 'Get Twilio.', 'formidable' ),
145
  ),
@@ -151,7 +156,7 @@ class FrmTipsHelper {
151
  public static function get_styling_tip() {
152
  $tips = array(
153
  array(
154
- 'link' => 'https://formidablepro.com/visual-styling-tip',
155
  'tip' => __( 'Make your sidebar or footer form stand out.', 'formidable' ),
156
  'call' => __( 'Use multiple style templates.', 'formidable' ),
157
  ),
@@ -162,12 +167,12 @@ class FrmTipsHelper {
162
  public static function get_entries_tip() {
163
  $tips = array(
164
  array(
165
- 'link' => 'https://formidablepro.com/manage-entries-tip',
166
  'tip' => __( 'Want to edit or delete form submissions?', 'formidable' ),
167
  'call' => __( 'Add entry management.', 'formidable' ),
168
  ),
169
  array(
170
- 'link' => 'https://formidablepro.com/search-entries-tip',
171
  'tip' => __( 'Want to search submitted entries?', 'formidable' ),
172
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
173
  ),
@@ -179,7 +184,7 @@ class FrmTipsHelper {
179
  public static function get_import_tip() {
180
  $tips = array(
181
  array(
182
- 'link' => 'https://formidablepro.com/import-entries-tip/',
183
  'tip' => __( 'Want to import entries into your forms?', 'formidable' ),
184
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
185
  ),
@@ -190,17 +195,17 @@ class FrmTipsHelper {
190
  public static function get_banner_tip() {
191
  $tips = array(
192
  array(
193
- 'link' => 'https://formidablepro.com/',
194
  'tip' => __( 'Looking for more options to get professional results?', 'formidable' ),
195
  'call' => __( 'Take your forms to the next level.', 'formidable' ),
196
  ),
197
  array(
198
- 'link' => 'https://formidablepro.com/',
199
  'tip' => __( 'Increase conversions in your long forms.', 'formidable' ),
200
  'call' => __( 'Add conditional logic, page breaks, and section headings.', 'formidable' ),
201
  ),
202
  array(
203
- 'link' => 'https://formidablepro.com/',
204
  'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
205
  'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ),
206
  ),
13
  if ( $html == 'p' ) {
14
  echo '<p>';
15
  }
16
+
17
  ?>
18
+ <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( self::base_url() . $tip['link'] ) ) ?>" target="_blank" class="frm_pro_tip">
19
  <span><i class="frm_icon_font frm_check1_icon"></i> Pro Tip:</span>
20
  <?php echo esc_html( $tip['tip'] ) ?>
21
  <?php if ( isset( $tip['call'] ) ) { ?>
28
  }
29
  }
30
 
31
+ private static function base_url() {
32
+ return 'https://formidableforms.com/';
33
+ }
34
+
35
  public static function get_builder_tip() {
36
  $tips = array(
37
  array(
38
+ 'link' => 'section-tip',
39
  'tip' => __( 'Long forms can still be beautiful with sections.', 'formidable' ),
40
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
41
  ),
42
  array(
43
+ 'link' => 'conditional-logic-tip',
44
  'tip' => __( 'Use conditional logic to shorten your forms and increase conversions.', 'formidable' ),
45
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
46
  ),
47
  array(
48
+ 'link' => 'page-break-tip',
49
  'tip' => __( 'Stop intimidating users with long forms.', 'formidable' ),
50
  'call' => __( 'Use page breaks.', 'formidable' ),
51
  ),
52
  array(
53
+ 'link' => 'file-upload-tip',
54
  'tip' => __( 'Cut down on back-and-forth with clients.', 'formidable' ),
55
  'call' => __( 'Allow file uploads in your form.', 'formidable' ),
56
  ),
57
  array(
58
+ 'link' => 'calculations-total-tip',
59
  'tip' => __( 'Need to calculate a total?', 'formidable' ),
60
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
61
  ),
62
  array(
63
+ 'link' => 'prefill-fields',
64
  'tip' => __( 'Save time.', 'formidable' ),
65
  'call' => __( 'Prefill fields with user info.', 'formidable' ),
66
  ),
73
  public static function get_form_settings_tip() {
74
  $tips = array(
75
  array(
76
+ 'link' => 'front-end-editing-tip',
77
  'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
78
  'call' => __( 'Add front-end editing.', 'formidable' ),
79
  ),
80
  array(
81
+ 'link' => 'front-end-editing-b-tip',
82
  'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
83
  'call' => __( 'Add front-end editing.', 'formidable' ),
84
  ),
85
  array(
86
+ 'link' => 'save-drafts-tip',
87
  'tip' => __( 'Have a long form that takes time to complete?', 'formidable' ),
88
  'call' => __( 'Let logged-in users save a draft and return later.', 'formidable' ),
89
  ),
94
  public static function get_form_action_tip() {
95
  $tips = array(
96
  array(
97
+ 'link' => 'email-routing-tip',
98
  'tip' => __( 'Save time by sending the email to the right person automatically.', 'formidable' ),
99
  'call' => __( 'Add email routing.', 'formidable' ),
100
  ),
101
  array(
102
+ 'link' => 'create-posts-tip',
103
  'tip' => __( 'Create blog posts or pages from the front-end.', 'formidable' ),
104
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
105
  ),
106
  array(
107
+ 'link' => 'front-end-posting-tip',
108
  'tip' => __( 'Make front-end posting easy.', 'formidable' ),
109
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
110
  ),
111
  array(
112
+ 'link' => 'mailchimp-tip',
113
  'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
114
  'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
115
  ),
116
  array(
117
+ 'link' => 'paypal-tip',
118
  'tip' => __( 'Save hours and increase revenue by collecting payments with every submission.', 'formidable' ),
119
  'call' => __( 'Use PayPal with this form.', 'formidable' ),
120
  ),
121
  array(
122
+ 'link' => 'paypal-increase-revenue-tip',
123
  'tip' => __( 'Increase revenue.', 'formidable' ),
124
  'call' => __( 'Use PayPal with this form.', 'formidable' ),
125
  ),
126
  array(
127
+ 'link' => 'paypal-save-time-tip',
128
  'tip' => __( 'Get paid more quickly.', 'formidable' ),
129
  'call' => __( 'Use Paypal with this form.', 'formidable' ),
130
  ),
131
  array(
132
+ 'link' => 'registration-tip',
133
  'tip' => __( 'Boost your site membership.', 'formidable' ),
134
  'call' => __( 'Automatically create user accounts.', 'formidable' ),
135
  ),
136
  array(
137
+ 'link' => 'registration-profile-editing-tip',
138
  'tip' => __( 'Make front-end profile editing possible.', 'formidable' ),
139
  'call' => __( 'Add user registration.', 'formidable' ),
140
  ),
141
  array(
142
+ 'link' => 'twilio-tip',
143
  'tip' => __( 'Want a text when this form is submitted or when a payment is received?', 'formidable' ),
144
  'call' => __( 'Use Twilio with this form.', 'formidable' ),
145
  ),
146
  array(
147
+ 'link' => 'twilio-send-tip',
148
  'tip' => __( 'Send a text when this form is submitted.', 'formidable' ),
149
  'call' => __( 'Get Twilio.', 'formidable' ),
150
  ),
156
  public static function get_styling_tip() {
157
  $tips = array(
158
  array(
159
+ 'link' => 'visual-styling-tip',
160
  'tip' => __( 'Make your sidebar or footer form stand out.', 'formidable' ),
161
  'call' => __( 'Use multiple style templates.', 'formidable' ),
162
  ),
167
  public static function get_entries_tip() {
168
  $tips = array(
169
  array(
170
+ 'link' => 'manage-entries-tip',
171
  'tip' => __( 'Want to edit or delete form submissions?', 'formidable' ),
172
  'call' => __( 'Add entry management.', 'formidable' ),
173
  ),
174
  array(
175
+ 'link' => 'search-entries-tip',
176
  'tip' => __( 'Want to search submitted entries?', 'formidable' ),
177
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
178
  ),
184
  public static function get_import_tip() {
185
  $tips = array(
186
  array(
187
+ 'link' => 'import-entries-tip/',
188
  'tip' => __( 'Want to import entries into your forms?', 'formidable' ),
189
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
190
  ),
195
  public static function get_banner_tip() {
196
  $tips = array(
197
  array(
198
+ 'link' => '',
199
  'tip' => __( 'Looking for more options to get professional results?', 'formidable' ),
200
  'call' => __( 'Take your forms to the next level.', 'formidable' ),
201
  ),
202
  array(
203
+ 'link' => '',
204
  'tip' => __( 'Increase conversions in your long forms.', 'formidable' ),
205
  'call' => __( 'Add conditional logic, page breaks, and section headings.', 'formidable' ),
206
  ),
207
  array(
208
+ 'link' => '',
209
  'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
210
  'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ),
211
  ),
classes/models/FrmAddon.php CHANGED
@@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
5
  }
6
 
7
  class FrmAddon {
8
- public $store_url = 'https://formidablepro.com';
9
  public $download_id;
10
  public $plugin_file;
11
  public $plugin_folder;
@@ -317,10 +317,10 @@ class FrmAddon {
317
 
318
  $message = __( 'Your License Key was invalid', 'formidable' );
319
  if ( is_wp_error( $resp ) ) {
320
- $message = sprintf( __( 'You had an error communicating with Formidable Pro\'s API. %1$sClick here%2$s for more information.', 'formidable' ), '<a href="http://formidablepro.com/knowledgebase/why-cant-i-activate-formidable-pro/" target="_blank">', '</a>');
321
  $message .= ' ' . $resp->get_error_message();
322
  } else if ( $body == 'error' || is_wp_error( $body ) ) {
323
- $message = __( 'You had an HTTP error connecting to Formidable Pro\'s API', 'formidable' );
324
  } else {
325
  $json_res = json_decode( $body, true );
326
  if ( null !== $json_res ) {
5
  }
6
 
7
  class FrmAddon {
8
+ public $store_url = 'https://formidableforms.com';
9
  public $download_id;
10
  public $plugin_file;
11
  public $plugin_folder;
317
 
318
  $message = __( 'Your License Key was invalid', 'formidable' );
319
  if ( is_wp_error( $resp ) ) {
320
+ $message = sprintf( __( 'You had an error communicating with the Formidable API. %1$sClick here%2$s for more information.', 'formidable' ), '<a href="https://formidableforms.com/knowledgebase/why-cant-i-activate-formidable-pro/" target="_blank">', '</a>');
321
  $message .= ' ' . $resp->get_error_message();
322
  } else if ( $body == 'error' || is_wp_error( $body ) ) {
323
+ $message = __( 'You had an HTTP error connecting to the Formidable API', 'formidable' );
324
  } else {
325
  $json_res = json_decode( $body, true );
326
  if ( null !== $json_res ) {
classes/models/FrmAntiSpam.php ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ die( 'You are not allowed to call this page directly.' );
5
+ }
6
+
7
+ class FrmAntiSpam {
8
+
9
+ private static function is_spam( $comment ) {
10
+ $url = $email = $author = $body = $comment; // TODO: get values from form
11
+ $options = array(
12
+ 'time_check' => 1, 'bbcode_check' => 1,
13
+ 'advanced_check' => 1, 'regexp_check' => 1,
14
+ 'dnsbl_check' => 1,
15
+ );
16
+
17
+ $response = array( 'spam' => false );
18
+
19
+ /* Check if logged in */
20
+ if ( is_user_logged_in() ) {
21
+ return $response;
22
+ }
23
+
24
+ /* Honeypot */
25
+ if ( ! empty( $_POST['ab_spam__hidden_field'] ) ) {
26
+ $response['reason'] = 'css';
27
+ return $response;
28
+ }
29
+
30
+ $ip = FrmAppHelper::get_ip_address();
31
+ if ( empty( $ip ) ) {
32
+ $response['reason'] = 'empty';
33
+ return $response;
34
+ }
35
+
36
+ /* Action time */
37
+ if ( $options['time_check'] && self::_is_shortest_time() ) {
38
+ $response['reason'] = 'time';
39
+ return $response;
40
+ }
41
+
42
+ /* BBCode Spam */
43
+ if ( $options['bbcode_check'] && self::_is_bbcode_spam( $body ) ) {
44
+ $response['reason'] = 'bbcode';
45
+ return $response;
46
+ }
47
+
48
+ if ( $options['advanced_check'] && self::_is_fake_ip( $ip ) ) {
49
+ $response['reason'] = 'server';
50
+ return $response;
51
+ }
52
+
53
+ /* Regexp for Spam */
54
+ if ( $options['regexp_check'] ) {
55
+ $is_spam = self::_is_regexp_spam( array(
56
+ 'ip' => $ip,
57
+ 'host' => parse_url( $url, PHP_URL_HOST ),
58
+ 'body' => $body,
59
+ 'email' => $email,
60
+ 'author' => $author,
61
+ ) );
62
+ if ( $is_spam ) {
63
+ $response['reason'] = 'regexp';
64
+ return $response;
65
+ }
66
+ }
67
+
68
+ /* DNSBL Spam */
69
+ if ( $options['dnsbl_check'] && self::_is_dnsbl_spam( $ip ) ) {
70
+ $response['reason'] = 'dnsbl';
71
+ return $response;
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Check for form submission time
77
+ *
78
+ * @return boolean TRUE if the action time is less than 5 seconds
79
+ */
80
+
81
+ private static function _is_shortest_time() {
82
+ $too_short = false;
83
+ $start_time = FrmAppHelper::get_post_param( 'ab_init_time', 0, 'absint' );
84
+
85
+ if ( $start_time ) {
86
+ // Compare time values
87
+ $min_seconds = apply_filters( 'frm_spam_time_limit', 5 );
88
+ $total_time = time() - $start_time;
89
+ if ( $total_time < $min_seconds ) {
90
+ $too_short = true;
91
+ }
92
+ }
93
+
94
+ return $too_short;
95
+ }
96
+
97
+ private static function _is_bbcode_spam( $body ) {
98
+ return (bool) preg_match( '/\[url[=\]].*\[\/url\]/is', $body );
99
+ }
100
+
101
+ private static function _is_fake_ip( $client_ip, $client_host = false ) {
102
+ /* Remote Host */
103
+ $host_by_ip = gethostbyaddr( $client_ip );
104
+
105
+ /* IPv6 */
106
+ if ( self::_is_ipv6( $client_ip ) ) {
107
+ return $client_ip != $host_by_ip;
108
+ }
109
+
110
+ /* IPv4 */
111
+ if ( empty( $client_host ) ) {
112
+ $ip_by_host = gethostbyname( $host_by_ip );
113
+
114
+ if ( $ip_by_host === $host_by_ip ) {
115
+ return false;
116
+ }
117
+ } else {
118
+ /* IPv4 / API */
119
+ if ( $host_by_ip === $client_ip ) {
120
+ return true;
121
+ }
122
+
123
+ $ip_by_host = gethostbyname( $client_host );
124
+ }
125
+
126
+ if ( strpos( $client_ip, self::_cut_ip( $ip_by_host ) ) === false ) {
127
+ return true;
128
+ }
129
+
130
+ return false;
131
+ }
132
+
133
+ /**
134
+ * Check for an IPv6 address
135
+ *
136
+ * @param string $ip IP to validate
137
+ * @return boolean TRUE if IPv6
138
+ */
139
+
140
+ private static function _is_ipv6( $ip ) {
141
+ if ( function_exists('filter_var') ) {
142
+ return filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) !== false;
143
+ } else {
144
+ return ! self::_is_ipv4( $ip );
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Check for an IPv4 address
150
+ *
151
+ * @param string $ip IP to validate
152
+ * @return integer TRUE if IPv4
153
+ */
154
+ private static function _is_ipv4( $ip ) {
155
+ if ( function_exists('filter_var') ) {
156
+ return filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) !== false;
157
+ } else {
158
+ return preg_match( '/^\d{1,3}(\.\d{1,3}){3,3}$/', $ip );
159
+ }
160
+ }
161
+
162
+ private static function _cut_ip( $ip, $cut_end = true ) {
163
+ $separator = ( self::_is_ipv4( $ip ) ? '.' : ':' );
164
+ $part = ( $cut_end ? strrchr( $ip, $separator ) : strstr( $ip, $separator ) );
165
+
166
+ return str_replace( $part, '', $ip );
167
+ }
168
+
169
+ private static function _is_regexp_spam( $comment ) {
170
+ /* Felder */
171
+ $fields = array(
172
+ 'ip',
173
+ 'host',
174
+ 'body',
175
+ 'email',
176
+ 'author',
177
+ );
178
+
179
+ /* Regexp */
180
+ $patterns = array(
181
+ 0 => array(
182
+ 'host' => '^(www\.)?\d+\w+\.com$',
183
+ 'body' => '^\w+\s\d+$',
184
+ 'email' => '@gmail.com$',
185
+ ),
186
+ 1 => array(
187
+ 'body' => '\<\!.+?mfunc.+?\>',
188
+ ),
189
+ );
190
+
191
+ /* Spammy author */
192
+ if ( $quoted_author = preg_quote( $comment['author'], '/' ) ) {
193
+ $patterns[] = array(
194
+ 'body' => sprintf( '<a.+?>%s<\/a>$', $quoted_author ),
195
+ );
196
+ $patterns[] = array(
197
+ 'body' => sprintf( '%s https?:.+?$', $quoted_author ),
198
+ );
199
+ $patterns[] = array(
200
+ 'email' => '@gmail.com$',
201
+ 'author' => '^[a-z0-9-\.]+\.[a-z]{2,6}$',
202
+ 'host' => sprintf( '^%s$', $quoted_author ),
203
+ );
204
+ }
205
+
206
+ /* Hook */
207
+ $patterns = apply_filters( 'antispam_bee_patterns', $patterns );
208
+
209
+ if ( ! $patterns ) {
210
+ return false;
211
+ }
212
+
213
+ foreach ( $patterns as $pattern ) {
214
+ $hits = array();
215
+
216
+ foreach ( $pattern as $field => $regexp ) {
217
+ $is_empty = ( empty( $field ) || ! in_array( $field, $fields ) || empty( $regexp ) );
218
+ if ( $is_empty ) {
219
+ continue;
220
+ }
221
+
222
+ /* Ignore non utf-8 chars */
223
+ $comment[ $field ] = ( function_exists('iconv') ? iconv( 'utf-8', 'utf-8//TRANSLIT', $comment[ $field ] ) : $comment[ $field ] );
224
+
225
+ if ( empty( $comment[ $field ] ) ) {
226
+ continue;
227
+ }
228
+
229
+ /* Perform regex */
230
+ if ( preg_match( '/' . $regexp . '/isu', $comment[ $field ] ) ) {
231
+ $hits[ $field ] = true;
232
+ }
233
+ }
234
+
235
+ if ( count( $hits ) === count( $pattern ) ) {
236
+ return true;
237
+ }
238
+ }
239
+
240
+ return false;
241
+ }
242
+
243
+ private static function _is_dnsbl_spam( $ip ) {
244
+
245
+ $response = wp_safe_remote_request(
246
+ esc_url_raw(
247
+ sprintf( 'http://www.stopforumspam.com/api?ip=%s&f=json', $ip ),
248
+ 'http'
249
+ )
250
+ );
251
+
252
+ if ( is_wp_error( $response ) ) {
253
+ return false;
254
+ }
255
+
256
+ /* Get JSON */
257
+ $json = wp_remote_retrieve_body( $response );
258
+
259
+ $result = json_decode( $json );
260
+
261
+ if ( empty( $result->success ) ) {
262
+ return false;
263
+ }
264
+
265
+ $status = (bool) $result->ip->appears;
266
+ return $status;
267
+ }
268
+ }
classes/models/FrmForm.php CHANGED
@@ -191,7 +191,7 @@ class FrmForm {
191
  */
192
  public static function update_fields( $id, $values ) {
193
 
194
- if ( ! isset($values['options']) && ! isset($values['item_meta']) && ! isset($values['field_options']) ) {
195
  return $values;
196
  }
197
 
191
  */
192
  public static function update_fields( $id, $values ) {
193
 
194
+ if ( ! isset($values['item_meta']) && ! isset($values['field_options']) ) {
195
  return $values;
196
  }
197
 
classes/models/FrmNotification.php CHANGED
@@ -125,6 +125,12 @@ class FrmNotification {
125
  }
126
  }
127
 
 
 
 
 
 
 
128
  // Send the email now
129
  $sent_to = self::send_email( array(
130
  'to_email' => $to_emails,
@@ -136,6 +142,7 @@ class FrmNotification {
136
  'attachments' => $attachments,
137
  'cc' => $cc,
138
  'bcc' => $bcc,
 
139
  ) );
140
 
141
  return $sent_to;
@@ -307,13 +314,13 @@ class FrmNotification {
307
  'plain_text' => true,
308
  'reply_to' => $admin_email,
309
  'attachments' => array(),
 
310
  );
311
  $atts = wp_parse_args($atts, $defaults);
312
 
313
  // Put To, BCC, CC, Reply To, and From fields in the correct format
314
  self::format_email_fields( $atts, $admin_email );
315
 
316
- $recipient = $atts['to_email']; //recipient
317
  $header = array();
318
  $header[] = 'From: ' . $atts['from'];
319
 
@@ -337,67 +344,95 @@ class FrmNotification {
337
  }
338
 
339
  $content_type = $atts['plain_text'] ? 'text/plain' : 'text/html';
340
- $charset = get_option('blog_charset');
341
 
342
  $header[] = 'Reply-To: ' . $atts['reply_to'];
343
- $header[] = 'Content-Type: ' . $content_type . '; charset="' . esc_attr( $charset ) . '"';
344
- $atts['subject'] = wp_specialchars_decode(strip_tags(stripslashes($atts['subject'])), ENT_QUOTES );
345
 
346
- $message = do_shortcode($atts['message']);
347
 
348
  if ( $atts['plain_text'] ) {
349
- //$message = wordwrap($message, 70, "\r\n"); //in case any lines are longer than 70 chars
350
- $message = wp_specialchars_decode(strip_tags($message), ENT_QUOTES );
351
  } else {
352
  // remove line breaks in HTML emails to prevent conflicts with Mandrill
353
  add_filter( 'mandrill_nl2br', 'FrmNotification::remove_mandrill_br' );
354
  }
355
- $message = apply_filters( 'frm_email_message', $message, $atts );
356
-
357
- $header = apply_filters('frm_email_header', $header, array(
358
- 'to_email' => $atts['to_email'], 'subject' => $atts['subject'],
359
- ) );
360
 
361
  /**
362
  * Stop an email based on the message, subject, recipient,
363
  * or any information included in the email header
364
  * @since 2.2.8
365
  */
366
- $continue_sending = apply_filters( 'frm_send_email', true, compact( 'message', 'subject', 'recipient', 'header' ) );
 
 
 
367
  if ( ! $continue_sending ) {
368
  return;
369
  }
370
 
371
- if ( apply_filters('frm_encode_subject', 1, $atts['subject'] ) ) {
372
- $atts['subject'] = '=?' . $charset . '?B?' . base64_encode( $atts['subject'] ) . '?=';
373
- }
374
-
375
- remove_filter('wp_mail_from', 'bp_core_email_from_address_filter' );
376
- remove_filter('wp_mail_from_name', 'bp_core_email_from_name_filter');
377
 
378
- $sent = wp_mail($recipient, $atts['subject'], $message, $header, $atts['attachments']);
379
- if ( ! $sent ) {
380
- $header = 'From: ' . $atts['from'] . "\r\n";
381
- $recipient = implode(',', (array) $recipient);
382
- $sent = mail($recipient, $atts['subject'], $message, $header);
383
- }
 
 
384
 
385
  // remove the filter now so other emails can still use it
386
  remove_filter( 'mandrill_nl2br', 'FrmNotification::remove_mandrill_br' );
387
 
388
- do_action('frm_notification', $recipient, $atts['subject'], $message);
389
-
390
  if ( $sent ) {
391
- $sent_to = array_merge( (array) $atts['to_email'], (array) $atts['cc'], (array) $atts['bcc'] );
392
- $sent_to = array_filter( $sent_to );
393
- if ( apply_filters('frm_echo_emails', false) ) {
394
- $temp = str_replace('<', '&lt;', $sent_to);
395
- echo ' ' . FrmAppHelper::kses( implode(', ', (array) $temp ) );
396
- }
397
- return $sent_to;
398
  }
399
  }
400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  /**
402
  * This function should only be fired when Mandrill is sending an HTML email
403
  * This will make sure Mandrill doesn't mess with our HTML emails
125
  }
126
  }
127
 
128
+ /**
129
+ * Send a separate email for email address in the "to" section
130
+ * @since 2.2.13
131
+ */
132
+ $send_single_recipient = apply_filters( 'frm_send_separate_emails', false, compact( 'action', 'entry', 'form' ) );
133
+
134
  // Send the email now
135
  $sent_to = self::send_email( array(
136
  'to_email' => $to_emails,
142
  'attachments' => $attachments,
143
  'cc' => $cc,
144
  'bcc' => $bcc,
145
+ 'single_recipient' => $send_single_recipient,
146
  ) );
147
 
148
  return $sent_to;
314
  'plain_text' => true,
315
  'reply_to' => $admin_email,
316
  'attachments' => array(),
317
+ 'single_recipient' => false,
318
  );
319
  $atts = wp_parse_args($atts, $defaults);
320
 
321
  // Put To, BCC, CC, Reply To, and From fields in the correct format
322
  self::format_email_fields( $atts, $admin_email );
323
 
 
324
  $header = array();
325
  $header[] = 'From: ' . $atts['from'];
326
 
344
  }
345
 
346
  $content_type = $atts['plain_text'] ? 'text/plain' : 'text/html';
347
+ $atts['charset'] = get_option('blog_charset');
348
 
349
  $header[] = 'Reply-To: ' . $atts['reply_to'];
350
+ $header[] = 'Content-Type: ' . $content_type . '; charset="' . esc_attr( $atts['charset'] ) . '"';
351
+ $atts['subject'] = wp_specialchars_decode( strip_tags( stripslashes( $atts['subject'] ) ), ENT_QUOTES );
352
 
353
+ $atts['message'] = do_shortcode( $atts['message'] );
354
 
355
  if ( $atts['plain_text'] ) {
356
+ $atts['message'] = wp_specialchars_decode( strip_tags( $atts['message'] ), ENT_QUOTES );
 
357
  } else {
358
  // remove line breaks in HTML emails to prevent conflicts with Mandrill
359
  add_filter( 'mandrill_nl2br', 'FrmNotification::remove_mandrill_br' );
360
  }
361
+ $atts['message'] = apply_filters( 'frm_email_message', $atts['message'], $atts );
 
 
 
 
362
 
363
  /**
364
  * Stop an email based on the message, subject, recipient,
365
  * or any information included in the email header
366
  * @since 2.2.8
367
  */
368
+ $continue_sending = apply_filters( 'frm_send_email', true, array(
369
+ 'message' => $atts['message'], 'subject' => $atts['subject'],
370
+ 'recipient' => $atts['to_email'], 'header' => $header,
371
+ ) );
372
  if ( ! $continue_sending ) {
373
  return;
374
  }
375
 
376
+ self::remove_buddypress_filters();
 
 
 
 
 
377
 
378
+ $sent = '';
379
+ if ( is_array( $atts['to_email'] ) && $atts['single_recipient'] ) {
380
+ foreach ( $atts['to_email'] as $recipient ) {
381
+ $sent = self::send_single_email( $recipient, $atts, $header );
382
+ }
383
+ } else {
384
+ $sent = self::send_single_email( $atts['to_email'], $atts, $header );
385
+ }
386
 
387
  // remove the filter now so other emails can still use it
388
  remove_filter( 'mandrill_nl2br', 'FrmNotification::remove_mandrill_br' );
389
 
 
 
390
  if ( $sent ) {
391
+ return self::return_emails_sent( $atts );
 
 
 
 
 
 
392
  }
393
  }
394
 
395
+ private static function send_single_email( $recipient, $atts, $header ) {
396
+ $header = apply_filters( 'frm_email_header', $header, array(
397
+ 'to_email' => $recipient, 'subject' => $atts['subject'],
398
+ ) );
399
+
400
+ self::encode_subject( $atts['charset'], $atts['subject'] );
401
+
402
+ $sent = wp_mail( $recipient, $atts['subject'], $atts['message'], $header, $atts['attachments'] );
403
+ if ( ! $sent ) {
404
+ $header = 'From: ' . $atts['from'] . "\r\n";
405
+ $recipient = implode( ',', (array) $recipient );
406
+ $sent = mail( $recipient, $atts['subject'], $atts['message'], $header );
407
+ }
408
+
409
+ do_action( 'frm_notification', $recipient, $atts['subject'], $atts['message'] );
410
+
411
+ return $sent;
412
+ }
413
+
414
+ private static function encode_subject( $charset, &$subject ) {
415
+ if ( apply_filters('frm_encode_subject', 1, $subject ) ) {
416
+ $subject = '=?' . $charset . '?B?' . base64_encode( $subject ) . '?=';
417
+ }
418
+ }
419
+
420
+ private static function remove_buddypress_filters() {
421
+ remove_filter( 'wp_mail_from', 'bp_core_email_from_address_filter' );
422
+ remove_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
423
+ }
424
+
425
+ private static function return_emails_sent( $atts ) {
426
+ $sent_to = array_merge( (array) $atts['to_email'], (array) $atts['cc'], (array) $atts['bcc'] );
427
+ $sent_to = array_filter( $sent_to );
428
+
429
+ if ( apply_filters( 'frm_echo_emails', false ) ) {
430
+ $temp = str_replace( '<', '&lt;', $sent_to );
431
+ echo ' ' . FrmAppHelper::kses( implode(', ', (array) $temp ) );
432
+ }
433
+ return $sent_to;
434
+ }
435
+
436
  /**
437
  * This function should only be fired when Mandrill is sending an HTML email
438
  * This will make sure Mandrill doesn't mess with our HTML emails
classes/models/FrmPointers.php CHANGED
@@ -327,10 +327,10 @@ class FrmPointers {
327
  private function addons_pointer() {
328
  return array(
329
  'content' => '<h3>' . __( 'Addons', 'formidable' ) . '</h3>'
330
- . '<p>' . sprintf( __( 'The powerful functions of %1$s can be extended with %2$spremium plugins%3$s. You can read all about the Formidable Premium Plugins %2$shere%3$s.', 'formidable' ), 'Formidable', '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/' ) ) . '">', '</a>' )
331
  . '</p>'
332
  . '<p><strong>' . __( 'Like this plugin?', 'formidable' ) . '</strong><br/>' . sprintf( __( 'So, we&#8217;ve come to the end of the tour. If you like the plugin, please %1$srate it 5 stars on WordPress.org%2$s!', 'formidable' ), '<a target="_blank" href="https://wordpress.org/plugins/formidable/">', '</a>' ) . '</p>'
333
- . '<p>' . sprintf( __( 'Thank you for using our plugin and good luck with your forms!<br/><br/>Best,<br/>Team Formidable - %1$sformidablepro.com%2$s', 'formidable' ), '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/' ) ) . '">', '</a>' ) . '</p>',
334
  'prev_page' => 'settings',
335
  );
336
  }
327
  private function addons_pointer() {
328
  return array(
329
  'content' => '<h3>' . __( 'Addons', 'formidable' ) . '</h3>'
330
+ . '<p>' . sprintf( __( 'The powerful functions of %1$s can be extended with %2$spremium plugins%3$s. You can read all about the Formidable Premium Plugins %2$shere%3$s.', 'formidable' ), 'Formidable', '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/' ) ) . '">', '</a>' )
331
  . '</p>'
332
  . '<p><strong>' . __( 'Like this plugin?', 'formidable' ) . '</strong><br/>' . sprintf( __( 'So, we&#8217;ve come to the end of the tour. If you like the plugin, please %1$srate it 5 stars on WordPress.org%2$s!', 'formidable' ), '<a target="_blank" href="https://wordpress.org/plugins/formidable/">', '</a>' ) . '</p>'
333
+ . '<p>' . sprintf( __( 'Thank you for using our plugin and good luck with your forms!<br/><br/>Best,<br/>Team Formidable - %1$sformidableforms.com%2$s', 'formidable' ), '<a target="_blank" href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/' ) ) . '">', '</a>' ) . '</p>',
334
  'prev_page' => 'settings',
335
  );
336
  }
classes/views/addons/upgrade_to_pro.php CHANGED
@@ -19,7 +19,7 @@
19
  <th>
20
  <h3><?php echo esc_attr( ucfirst( $price_info['name'] ) ) ?></h3>
21
  <h4>$<?php echo esc_attr( $price_info['price'] ) ?></h4>
22
- <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/checkout?edd_action=add_to_cart&download_id=93790' ) ) ?>&amp;edd_options[price_id]=<?php echo absint( $price_info['id'] ) ?>" class="button-primary" target="_blank">
23
  <?php _e( 'Get Started', 'formidable' ) ?>
24
  </a>
25
  </th>
@@ -58,9 +58,9 @@
58
  <tr>
59
  <th>Included AddOns</th>
60
  <td>None</td>
61
- <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Premium Addons</a></td>
62
- <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Advanced Addons</a></td>
63
- <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Enterprise Addons</a></td>
64
  </tr>
65
  </tbody>
66
  </table>
19
  <th>
20
  <h3><?php echo esc_attr( ucfirst( $price_info['name'] ) ) ?></h3>
21
  <h4>$<?php echo esc_attr( $price_info['price'] ) ?></h4>
22
+ <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/checkout?edd_action=add_to_cart&download_id=93790' ) ) ?>&amp;edd_options[price_id]=<?php echo absint( $price_info['id'] ) ?>" class="button-primary" target="_blank">
23
  <?php _e( 'Get Started', 'formidable' ) ?>
24
  </a>
25
  </th>
58
  <tr>
59
  <th>Included AddOns</th>
60
  <td>None</td>
61
+ <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidableforms.com/pricing/#addon-lists') ) ?>" target="_blank">Premium Addons</a></td>
62
+ <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidableforms.com/pricing/#addon-lists') ) ?>" target="_blank">Advanced Addons</a></td>
63
+ <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidableforms.com/pricing/#addon-lists') ) ?>" target="_blank">Enterprise Addons</a></td>
64
  </tr>
65
  </tbody>
66
  </table>
classes/views/frm-entries/no_entries.php CHANGED
@@ -7,7 +7,7 @@ if ( $form && isset($form->options['no_save']) && $form->options['no_save'] ) {
7
  } else if ( $form ) {
8
  ?>
9
  <div class="frm_no_entries_header"><?php printf(__( 'No Entries for form: %s', 'formidable' ), $form->name); ?></div>
10
- <p class="frm_no_entries_text"><?php printf( __( 'For instructions on publishing your form see %1$sthis page%2$s <br/> or click "%3$sAdd New%4$s" above to add an entry from here (Requires License)', 'formidable' ), '<a href="https://formidablepro.com/knowledgebase/publish-your-forms/" target="_blank">', '</a>', '<a href="' . esc_url( admin_url('admin.php?page=formidable-entries&frm_action=new&form=' . $form->id ) ) . '">', '</a>' ); ?></p>
11
  <?php
12
  } else {
13
  ?>
7
  } else if ( $form ) {
8
  ?>
9
  <div class="frm_no_entries_header"><?php printf(__( 'No Entries for form: %s', 'formidable' ), $form->name); ?></div>
10
+ <p class="frm_no_entries_text"><?php printf( __( 'For instructions on publishing your form see %1$sthe docs%2$s or click "%3$sAdd New%4$s" above to add an entry from here (Requires License)', 'formidable' ), '<a href="https://formidableforms.com/knowledgebase/publish-your-forms/" target="_blank">', '</a> <br/>', '<a href="' . esc_url( admin_url('admin.php?page=formidable-entries&frm_action=new&form=' . $form->id ) ) . '">', '</a>' ); ?></p>
11
  <?php
12
  } else {
13
  ?>
classes/views/frm-settings/license_box.php CHANGED
@@ -2,10 +2,10 @@
2
  <?php if ( ! is_multisite() || is_super_admin() ) { ?>
3
  <div class="postbox">
4
  <div class="inside">
5
- <p class="alignright"><?php printf( __( '%1$sClick here%2$s to get it now', 'formidable' ), '<a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'http://formidablepro.com' ) ) . '">', '</a>' ) ?> &#187;</p>
6
  <p><?php _e( 'Ready to take your forms to the next level?<br/>Formidable Forms will help you create views, manage data, and get reports.', 'formidable' ) ?></p>
7
 
8
- <p>Already signed up? <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/knowledgebase/install-formidable-forms/' ) ) ?>" target="_blank"><?php _e( 'Click here', 'formidable' ) ?></a> to get installation instructions and download the pro version.</p>
9
  </div>
10
  </div>
11
  <?php } ?>
2
  <?php if ( ! is_multisite() || is_super_admin() ) { ?>
3
  <div class="postbox">
4
  <div class="inside">
5
+ <p class="alignright"><?php printf( __( '%1$sClick here%2$s to get it now', 'formidable' ), '<a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com' ) ) . '">', '</a>' ) ?> &#187;</p>
6
  <p><?php _e( 'Ready to take your forms to the next level?<br/>Formidable Forms will help you create views, manage data, and get reports.', 'formidable' ) ?></p>
7
 
8
+ <p>Already signed up? <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/knowledgebase/install-formidable-forms/' ) ) ?>" target="_blank"><?php _e( 'Click here', 'formidable' ) ?></a> to get installation instructions and download the pro version.</p>
9
  </div>
10
  </div>
11
  <?php } ?>
css/_single_theme.css.php CHANGED
@@ -140,10 +140,19 @@ if ( ! isset( $center_form ) ) {
140
  display:block;
141
  }
142
 
 
 
 
 
 
 
143
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_html_container{
144
- font-family:<?php echo FrmAppHelper::kses( $font ) ?>;
145
  font-size:<?php echo esc_html( $form_desc_size . $important ) ?>;
146
- color:#<?php echo esc_html( $form_desc_color . $important ) ?>;
 
 
 
 
147
  }
148
 
149
  .<?php echo esc_html( $style_class ) ?> .frm_icon_font{
140
  display:block;
141
  }
142
 
143
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_html_container,
144
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field .frm_show_it{
145
+ font-family:<?php echo FrmAppHelper::kses( $font . $important ) ?>;
146
+ color:#<?php echo esc_html( $form_desc_color . $important ) ?>;
147
+ }
148
+
149
  .<?php echo esc_html( $style_class ) ?> .frm_form_field.frm_html_container{
 
150
  font-size:<?php echo esc_html( $form_desc_size . $important ) ?>;
151
+ }
152
+
153
+ .<?php echo esc_html( $style_class ) ?> .frm_form_field .frm_show_it{
154
+ font-size:<?php echo esc_html( $field_font_size . $important ) ?>;
155
+ font-weight:<?php echo esc_html( $field_weight ) ?>;
156
  }
157
 
158
  .<?php echo esc_html( $style_class ) ?> .frm_icon_font{
css/custom_theme.css.php CHANGED
@@ -112,6 +112,10 @@ legend.frm_hidden{
112
  display:block;
113
  }
114
 
 
 
 
 
115
  .with_frm_style select[multiple="multiple"]{
116
  height:auto;
117
  line-height:normal;
@@ -537,6 +541,7 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
537
  filter:progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=180, Color='#<?php echo esc_html( $defaults['border_color_active'] ) ?>');
538
  }
539
 
 
540
  .frmcal_num{
541
  display:inline;
542
  }
112
  display:block;
113
  }
114
 
115
+ .with_frm_style input[type=number][readonly]{
116
+ -moz-appearance: textfield;
117
+ }
118
+
119
  .with_frm_style select[multiple="multiple"]{
120
  height:auto;
121
  line-height:normal;
541
  filter:progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=180, Color='#<?php echo esc_html( $defaults['border_color_active'] ) ?>');
542
  }
543
 
544
+ .frmcal_day_name,
545
  .frmcal_num{
546
  display:inline;
547
  }
formidable.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
  /*
3
- Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 2.02.12
6
- Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
9
  Text Domain: formidable
10
  */
11
 
12
- /* Copyright 2010 Strategy11 (email : support@strategy11.com)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License, version 2, as
1
  <?php
2
  /*
3
+ Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 2.02.13
6
+ Plugin URI: https://formidableforms.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
9
  Text Domain: formidable
10
  */
11
 
12
+ /* Copyright 2010 Formidable Forms
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License, version 2, as
js/formidable.js CHANGED
@@ -132,6 +132,11 @@ function frmFrontFormJS(){
132
  var form = field.closest('form');
133
  var submitButton = form.find('input[type="submit"], .frm_submit input[type="button"]');
134
  var loading = form.find('.frm_ajax_loading');
 
 
 
 
 
135
 
136
  field.dropzone({
137
  url:frm_js.ajax_url,
@@ -140,7 +145,7 @@ function frmFrontFormJS(){
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,
@@ -1690,6 +1695,7 @@ function frmFrontFormJS(){
1690
  triggerChange(jQuery(childSelect), childFieldArgs.fieldKey);
1691
  }
1692
  } else {
 
1693
  disableLookup( childSelect );
1694
 
1695
  // If all parents have values, check for updated options
@@ -1704,7 +1710,7 @@ function frmFrontFormJS(){
1704
  nonce:frm_js.nonce
1705
  },
1706
  success:function(newOptions){
1707
- replaceSelectLookupFieldOptions( childFieldArgs.fieldKey, childSelect, newOptions );
1708
  }
1709
  });
1710
  }
@@ -1734,9 +1740,12 @@ function frmFrontFormJS(){
1734
  *
1735
  * @since 2.02.11
1736
  * @param {object} childSelect
 
1737
  */
1738
- function enableLookup( childSelect ) {
1739
- childSelect.disabled = false;
 
 
1740
  childSelect.className = childSelect.className.replace( ' frm_loading_lookup', '' );
1741
  }
1742
 
@@ -1744,11 +1753,13 @@ function frmFrontFormJS(){
1744
  * Replace the options in a Select Lookup field
1745
  *
1746
  * @since 2.01.0
1747
- * @param {string} fieldKey
 
 
1748
  * @param {object} childSelect
1749
  * @param {Array} newOptions
1750
  */
1751
- function replaceSelectLookupFieldOptions( fieldKey, childSelect, newOptions ) {
1752
  var origVal = childSelect.value;
1753
 
1754
  newOptions = JSON.parse( newOptions );
@@ -1766,13 +1777,13 @@ function frmFrontFormJS(){
1766
 
1767
  setSelectLookupVal( childSelect, origVal );
1768
 
1769
- enableLookup( childSelect );
1770
 
1771
  maybeUpdateChosenOptions( childSelect );
1772
 
1773
  // Trigger a change if the new value is different from the old value
1774
  if ( childSelect.value != origVal ) {
1775
- triggerChange( jQuery(childSelect), fieldKey );
1776
  }
1777
  }
1778
 
@@ -1794,6 +1805,7 @@ function frmFrontFormJS(){
1794
  *
1795
  * @since 2.01.01
1796
  * @param {Object} childFieldArgs
 
1797
  * @param {object} childDiv
1798
  */
1799
  function maybeReplaceCbRadioLookupOptions( childFieldArgs, childDiv ) {
@@ -3127,11 +3139,11 @@ function frmFrontFormJS(){
3127
  // the form or success message was returned
3128
 
3129
  jQuery(object).find('.frm_ajax_loading').removeClass('frm_loading_now');
3130
- var formID = jQuery(object).find('input[name="form_id"]').val();
3131
- jQuery(object).closest( '.frm_forms' ).replaceWith( response.content );
3132
  if ( frm_js.offset != -1 ) {
3133
  frmFrontForm.scrollMsg( jQuery(object), false );
3134
  }
 
 
3135
 
3136
  if(typeof(frmThemeOverride_frmAfterSubmit) == 'function'){
3137
  var pageOrder = jQuery('input[name="frm_page_order_'+ formID +'"]').val();
@@ -4006,7 +4018,9 @@ function frmFrontFormJS(){
4006
  jQuery(object).find('input[type="submit"], input[type="button"]').attr('disabled','disabled');
4007
 
4008
  if ( classList.indexOf('frm_ajax_submit') > -1 ) {
4009
- var hasFileFields = jQuery(object).find('input[type="file"]').length;
 
 
4010
  if ( hasFileFields < 1 ) {
4011
  action = jQuery(object).find('input[name="frm_action"]').val();
4012
  frmFrontForm.checkFormErrors( object, action );
@@ -4090,9 +4104,9 @@ function frmFrontFormJS(){
4090
  } else {
4091
  scrollObj = id;
4092
  }
4093
- var newPos = scrollObj.offset().top;
4094
 
4095
- if(!newPos){
 
4096
  return;
4097
  }
4098
  newPos = newPos-frm_js.offset;
132
  var form = field.closest('form');
133
  var submitButton = form.find('input[type="submit"], .frm_submit input[type="button"]');
134
  var loading = form.find('.frm_ajax_loading');
135
+ var formID = '#'+ form.attr('id');
136
+ if ( formID == '#undefined' ) {
137
+ // use a class if there is not id for WooCommerce
138
+ formID = 'form.' + form.attr('class').replace(' ', '.');
139
+ }
140
 
141
  field.dropzone({
142
  url:frm_js.ajax_url,
145
  maxFilesize: uploadFields[i].maxFilesize,
146
  maxFiles: max,
147
  uploadMultiple: uploadFields[i].uploadMultiple,
148
+ hiddenInputContainer:formID,
149
  dictDefaultMessage: uploadFields[i].defaultMessage,
150
  dictFallbackMessage: uploadFields[i].fallbackMessage,
151
  dictFallbackText: uploadFields[i].fallbackText,
1695
  triggerChange(jQuery(childSelect), childFieldArgs.fieldKey);
1696
  }
1697
  } else {
1698
+ childFieldArgs.isReadOnly = childSelect.disabled;
1699
  disableLookup( childSelect );
1700
 
1701
  // If all parents have values, check for updated options
1710
  nonce:frm_js.nonce
1711
  },
1712
  success:function(newOptions){
1713
+ replaceSelectLookupFieldOptions( childFieldArgs, childSelect, newOptions );
1714
  }
1715
  });
1716
  }
1740
  *
1741
  * @since 2.02.11
1742
  * @param {object} childSelect
1743
+ * @pparam {boolean} isReadOnly
1744
  */
1745
+ function enableLookup( childSelect, isReadOnly ) {
1746
+ if ( isReadOnly === false ) {
1747
+ childSelect.disabled = false;
1748
+ }
1749
  childSelect.className = childSelect.className.replace( ' frm_loading_lookup', '' );
1750
  }
1751
 
1753
  * Replace the options in a Select Lookup field
1754
  *
1755
  * @since 2.01.0
1756
+ * @param {Object} fieldArgs
1757
+ * @param {string} fieldArgs.fieldKey
1758
+ * @param {boolean} fieldArgs.isReadOnly
1759
  * @param {object} childSelect
1760
  * @param {Array} newOptions
1761
  */
1762
+ function replaceSelectLookupFieldOptions( fieldArgs, childSelect, newOptions ) {
1763
  var origVal = childSelect.value;
1764
 
1765
  newOptions = JSON.parse( newOptions );
1777
 
1778
  setSelectLookupVal( childSelect, origVal );
1779
 
1780
+ enableLookup( childSelect, fieldArgs.isReadOnly );
1781
 
1782
  maybeUpdateChosenOptions( childSelect );
1783
 
1784
  // Trigger a change if the new value is different from the old value
1785
  if ( childSelect.value != origVal ) {
1786
+ triggerChange( jQuery(childSelect), fieldArgs.fieldKey );
1787
  }
1788
  }
1789
 
1805
  *
1806
  * @since 2.01.01
1807
  * @param {Object} childFieldArgs
1808
+ * @param {Array} childFieldArgs.parentVals
1809
  * @param {object} childDiv
1810
  */
1811
  function maybeReplaceCbRadioLookupOptions( childFieldArgs, childDiv ) {
3139
  // the form or success message was returned
3140
 
3141
  jQuery(object).find('.frm_ajax_loading').removeClass('frm_loading_now');
 
 
3142
  if ( frm_js.offset != -1 ) {
3143
  frmFrontForm.scrollMsg( jQuery(object), false );
3144
  }
3145
+ var formID = jQuery(object).find('input[name="form_id"]').val();
3146
+ jQuery(object).closest( '.frm_forms' ).replaceWith( response.content );
3147
 
3148
  if(typeof(frmThemeOverride_frmAfterSubmit) == 'function'){
3149
  var pageOrder = jQuery('input[name="frm_page_order_'+ formID +'"]').val();
4018
  jQuery(object).find('input[type="submit"], input[type="button"]').attr('disabled','disabled');
4019
 
4020
  if ( classList.indexOf('frm_ajax_submit') > -1 ) {
4021
+ var hasFileFields = jQuery(object).find('input[type="file"]').filter(function () {
4022
+ return !!this.value;
4023
+ }).length;
4024
  if ( hasFileFields < 1 ) {
4025
  action = jQuery(object).find('input[name="frm_action"]').val();
4026
  frmFrontForm.checkFormErrors( object, action );
4104
  } else {
4105
  scrollObj = id;
4106
  }
 
4107
 
4108
+ var newPos = scrollObj.offset().top;
4109
+ if ( !newPos ){
4110
  return;
4111
  }
4112
  newPos = newPos-frm_js.offset;
js/formidable.min.js CHANGED
@@ -1,97 +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 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),N(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)O(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=P(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=Q(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=Q(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 Q(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))):R(a,b)}function P(a){return"undefined"===typeof __FRMRULES||
18
- "undefined"===typeof __FRMRULES[a]?!1:__FRMRULES[a]}function Ra(a,b){var c=P(a.fieldId),d=ra(c,b);"data"==b.fieldType&&"data"==c.fieldType?(c=""===a.value?""===d||1==d.length&&""===d[0]?!1:!0:S(a.operator,a.value,d),b.dataLogic=a,b.dataLogic.actualValue=d,d=c):d=S(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):T(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 S(a,b,c){b=Ua(b);c=Va(b,c);return"string"===typeof b&&"-1"!=b.indexOf("&quot;")&&S(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=U(a);b=ta(a,b);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;a=U(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=U(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 U(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["+Q(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&&V(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&&K(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 V(a,b){var c=n(a,!0);return B("frm_field_"+c+"_container",b)}function R(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 T(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="",K(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));c.disabled=!1;c.className=c.className.replace(" frm_loading_lookup","");K(c);c.value!=e&&t(jQuery(c),d)}}))}}function K(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;K(a)}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?T(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=P(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?T(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(!V(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?R(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?R(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 N(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=L(l,m):(k=H(k),L(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=L(g.inSection,m):"0"!==g.inEmbedForm&&(p=L(g.inEmbedForm,m))));g=p;!1===g&&Y(c,d[f],e,b)}}}function L(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(jQuery(a),!1);"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")&&(O(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 O(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&&N(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===M)return!1;M=!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"),N(g,k))}});v(l.repeatRow);Pa();ba();"function"==typeof frmThemeOverride_frmAddRow&&frmThemeOverride_frmAddRow(a,c);M=!1},error:function(){M=!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||V(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 M=!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?O(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 frmCancelEdit(l,m,q,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(m+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+",'"+
94
- m+"',"+r+","+v+",'"+frmFrontForm.escapeHtml(A)+"','"+z+"')\">"+q+"</a>")}
95
- function frmDeleteEntry(l,m){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(q){"success"==q.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(m+l)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+
96
- l)).replaceWith(q)}})}function frmOnSubmit(l){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(l,this)}
97
- function frm_resend_email(l,m){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:m,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 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"),m="#"+h.attr("id");"#undefined"==m&&(m="form."+h.attr("class").replace(" ","."));d.dropzone({url:frm_js.ajax_url,addRemoveLinks:!0,
5
+ paramName:d.attr("id").replace("_dropzone",""),maxFilesize:c[a].maxFilesize,maxFiles:f,uploadMultiple:c[a].uploadMultiple,hiddenInputContainer:m,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,
6
+ fallback:function(){jQuery(this.element).closest("form").removeClass("frm_ajax_submit")},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),h=0;h<f.length;h++)!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val(f[h])});this.on("successmultiple",function(b,d){for(var f=jQuery.parseJSON(d),h=0;h<b.length;h++)jQuery(b[h].previewElement).append(y(c[a],
7
+ f[h],e))});this.on("complete",function(b){if("undefined"!==typeof b.mediaID){c[a].uploadMultiple&&jQuery(b.previewElement).append(y(c[a],b.mediaID,e));for(var d=b.previewElement.querySelectorAll("[data-dz-name]"),f=0,h=d.length;f<h;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",
8
+ function(b){!1!==b.accepted&&!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val("");!1!==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);
9
+ this.emit("complete",d);this.files.push(d)}}})}}function y(a,b,c){return'<input name="'+c+'[]" 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<
10
+ 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"),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("")):
11
+ "checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):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)&&(fa(b,jQuery(this)),a="undefined"!==typeof a.originalEvent||-1<a.currentTarget.className.indexOf("frm_chzn")?"value changed":"other",ga(b,jQuery(this),a),N(b,jQuery(this)),jQuery(this).closest("form").hasClass("frm_js_validate"))){b=
12
+ [];a=jQuery(this).closest(".frm_form_field");a.hasClass("frm_required_field")&&!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)O(a,d,b)}}function q(a,b){var c="",c=a instanceof jQuery?a.attr("name"):a.name;
13
+ if(""===c)return c=a instanceof jQuery?a.data("name"):a.getAttribute("data-name"),""!==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]+
14
+ "-"+c[1].replace("[",""));return d}function fa(a,b){if(!("undefined"===typeof __FRMRULES||"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=P(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=
15
+ Q(c),null!==document.getElementById("frm_field_"+d+"_container")){d=[];for(var e=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=Q(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=
16
+ d[f],la(c,d[f]),ma(c)}}function Q(a){var b="";"0"!==a.inEmbedForm?b=a.inEmbedForm:"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"==
17
+ a.fieldType&&a.hasOwnProperty("dataLogic")?(a={fieldId:a.fieldId,fieldKey:a.fieldKey,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||
18
+ "form"==a.fieldType,a.formId))):R(a,b)}function P(a){return"undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[a]?!1:__FRMRULES[a]}function Ra(a,b){var c=P(a.fieldId),d=ra(c,b);"data"==b.fieldType&&"data"==c.fieldType?(c=""===a.value?""===d||1==d.length&&""===d[0]?!1:!0:S(a.operator,a.value,d),b.dataLogic=a,b.dataLogic.actualValue=d,d=c):d=S(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^="'+
19
+ c+'"]'),c="checkbox"==a.inputType?J(c):T(c);else if(c="",!0===a.isMultiSelect){c=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:
20
+ b.inSection)+"]["+b.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]"}function J(a){for(var b=[],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 S(a,b,c){b=Ua(b);c=Va(b,c);return"string"===typeof b&&"-1"!=b.indexOf("&quot;")&&S(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=U(a);
21
+ b=ta(a,b);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;a=U(a);b=ta(a,b);return-1==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=U(b);var c;if(jQuery.isArray(b))for(var d=
22
+ 0,e=b.length;d<e;d++)if(c=b[d].toLowerCase(),-1<c.indexOf(a)){b=a;break}return b}function U(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+
23
+ '"]'));a=b}else"form"==a.fieldType?a=document.querySelectorAll('[id^="field_'+a.fieldKey+'-"]'):(a=a.isRepeating?"item_meta["+Q(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&&V(a[f],c))){d=a[f];var h=jQuery(d),g=h.data("frmval");if("undefined"!==typeof g){if("checkbox"==
24
+ d.type||"radio"==d.type)ua(d.name,g);else if(-1<d.name.indexOf("[]")){var k=document.getElementsByName(d.name);if(jQuery.isArray(g))for(var 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("]",""),g=g[k],"undefined"==typeof g&&(g=""))),d.value=g;"SELECT"==d.tagName&&K(d);u(h)}d=a[f];h=q(d,!1);h=W(h);!1!==h&&"lookup"!=h.fieldType&&(h.parentVals=X(h),va(h,d));d=a[f];
25
+ 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"):jQuery(d));d=k;void 0!==h.calc[g]&&Y(h,g,[],d)}d=a[f]}}function V(a,b){var c=q(a,!0);return B("frm_field_"+c+"_container",b)}function R(a,b){if(!B(a.containerId,
26
+ a.formId)){if(b){jQuery("#"+a.containerId).hide();var c=oa(a.containerId)}else c=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&&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?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="",
27
+ 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 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=
28
+ 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=!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<
29
+ 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"==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=
30
+ a,f=b[c];e.parentVals=X(e);if("select"==e.inputType)Wa(e,f);else if("radio"==e.inputType||"checkbox"==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),
31
+ va(e,f)}function W(a){return"undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]?!1:__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 T(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=
32
+ "",K(c),u(jQuery(c),a.fieldKey))):(a.isReadOnly=c.disabled,Ya(c),jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_lookup_field_options",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(b){var d=c.value;b=JSON.parse(b);for(var e=c.options.length;0<e;e--)c.remove(e);for(var g=b.length,e=0;e<g;e++)c.options[e+1]=new Option(b[e],b[e],!1,!1);c.value=d;""===c.value&&(b=c.getAttribute("data-frmval"),null!==b&&(c.value=b));!1===
33
+ a.isReadOnly&&(c.disabled=!1);c.className=c.className.replace(" frm_loading_lookup","");K(c);c.value!=d&&u(jQuery(c),a.fieldKey)}}))}}function K(a){-1<a.className.indexOf("frm_chzn")&&jQuery().chosen&&jQuery(a).trigger("chosen:updated")}function Ya(a){a.className+=" frm_loading_lookup";a.disabled=!0;K(a)}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?T(d):J(d),f=jQuery(d[0]).data("frmval");jQuery.ajax({type:"POST",
34
+ 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,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=P(a.fieldId),!1===e||1>e.conditions.length?(D(b.id,a.formId),jQuery("#"+
35
+ b.id).show()):(e.containerId=b.id,e.repeatRow=a.repeatRow,ma(e))),void 0!==f&&(!1!==("radio"==a.inputType?T(d):J(d))||1>d.length||ua(d[0].name,f)));u(jQuery(d[0]),a.fieldKey)}})}function xa(a,b){B(b.id,a.formId)||(jQuery("#"+b.id).hide(),wa(b.id,a.formId))}function va(a,b){if(!V(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,
36
+ 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;u(jQuery(b),a)}function Sa(a,b){if(b){var c=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||
37
+ ""===h?R(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,a.formId),u(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,
38
+ 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"]');Aa(d);""===b||1>f.length?R(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,
39
+ 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 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,
40
+ a.formId),b.show());c.hasClass("frm_chzn")&&ba();!0===d&&u(c)}function N(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=L(l,n):(k=H(k),L(l,n)?m=!0:Da(l,k,n)?m=!0:"0"!==g.inSection&&"0"!==g.inEmbedForm?m=Da(g.inSection,k,n):"0"!==g.inSection?m=L(g.inSection,n):"0"!==g.inEmbedForm&&
41
+ (m=L(g.inEmbedForm,n))));g=m;!1===g&&Y(c,d[f],e,b)}}}function L(a,b){return-1<b.indexOf("frm_field_"+a+"_container")}function Da(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 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,
42
+ 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("+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),u(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]],
43
+ 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+"[type=hidden]":"textarea"==g.thisField.type&&(g.thisFieldCall=g.thisFieldCall+",textarea"+k.fieldKeys[g.thisFieldId]);if("text"==a.calc_type)g.valKey=
44
+ "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]=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=
45
+ 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=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"==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,
46
+ 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 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=
47
+ 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=!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&&
48
+ -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=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=
49
+ "";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");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===
50
+ 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=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")?
51
+ q(a,!0):q(a,!1)}""===d&&(""===e&&(e=q(a,!0)),e in b||(b[e]=F(a,"data-reqmsg")));return b}function db(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 ia(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=/^(([^<>()\[\]\\.,;:\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,
52
+ 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 ja(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 ka(a,b){var c=a.value,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=
53
+ a.getAttribute(b);null===c&&(c="");return c}function eb(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,"");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");
54
+ -1!=frm_js.offset&&frmFrontForm.scrollMsg(jQuery(a),!1);var e=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest(".frm_forms").replaceWith(b.content);"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();
55
+ 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");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")&&
56
+ (O(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())))}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 O(a,b,c){a.length&&a.is(":visible")&&(a.addClass("frm_blank_field"),
57
+ "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");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(),
58
+ "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||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,
59
+ "\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=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,
60
+ 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=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 m=a.entries.length;b.addRows(m);
61
+ 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=Oa(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+"</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="'+
62
+ 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 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_"+
63
+ 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";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=
64
+ "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&&N(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===M)return!1;M=!0;var a=jQuery(this).data("parent"),b=0;if(0<jQuery(".frm_repeat_"+
65
+ 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");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"!=
66
+ 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"),fa(g,k),ga(g,k,"value changed"),N(g,k))}});v(l.repeatRow);Pa();ba();"function"==typeof frmThemeOverride_frmAddRow&&frmThemeOverride_frmAddRow(a,c);M=!1},error:function(){M=!1}});return!1}function nb(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("pageid"),e=
67
+ 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">'+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");
68
+ 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"]',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");
69
+ 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_'+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_"+
70
+ c)).fadeOut("slow")}else jQuery(document.getElementById("frm_delete_"+c)).replaceWith(a)}})}return!1}function ea(){"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);if("undefined"!==typeof __frmMasks)for(a=__frmMasks,b=0;b<a.length;b++)jQuery(a[b].trigger).attr("data-frmmask",a[b].mask);
71
+ Pa();ba();"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>a[c].fields.length){var d=document.getElementById("field_"+c);null===d||V(d,a[c].form_id)||Y(__FRMCALC,c,b)}}v()}function ba(){if(jQuery().chosen){var a=
72
+ {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=jQuery(".star");a.length&&a.rating()}}function da(a){"undefined"!==typeof __frmHideOrShowFields&&frmFrontForm.hideOrShowFields(__frmHideOrShowFields,a)}function u(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=
73
+ {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",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]===
74
+ 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?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,
75
+ 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 vb(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b})}var M=!1,C="",x=[];return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);
76
+ 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",".frm_toggle_default",gb);jQuery(document).on("blur",".frm_toggle_default",
77
+ 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())});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',
78
+ 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",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",
79
+ ".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")?(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,
80
+ 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","disabled"),-1<c.indexOf("frm_ajax_submit")?1>jQuery(b).find('input[type="file"]').filter(function(){return!!this.value}).length?
81
+ (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&&(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)");
82
+ 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");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",
83
+ ""),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){Ka();for(var b in x){var c=jQuery(a).find("#frm_field_"+b+"_container");c.length?O(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,
84
+ 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");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):
85
+ jQuery("html,body").animate({scrollTop:a},500),!1}},savingDraft:function(a){return Ia(a)},goingToPreviousPage:function(a){return Ja(a)},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_",
86
+ ""),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:"",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"===
87
+ 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,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));
88
+ 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","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"),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)}}
90
+ 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)}})}
91
+ 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},
92
+ 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>")}})}
93
+ 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+",'"+
94
+ n+"',"+r+","+v+",'"+frmFrontForm.escapeHtml(A)+"','"+z+"')\">"+p+"</a>")}
95
+ 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_"+
96
+ l)).replaceWith(p)}})}function frmOnSubmit(l){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(l,this)}
97
+ 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)}})};
js/formidable_admin.js CHANGED
@@ -664,31 +664,70 @@ function frmAdminBuildJS(){
664
  return false;
665
  }
666
 
667
- function clearOnFocus(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
668
  var switch_to = '0';
669
- var t = frm_admin_js.no_clear_default;
670
- if(this.className.indexOf('frm_inactive_icon') !== -1){
671
  switch_to = '1';
672
- t = frm_admin_js.clear_default;
673
  }
674
- var field_id=jQuery(this).closest('li.form-field').data('fid');
675
- jQuery(this).toggleClass('frm_inactive_icon').attr('title', t).tooltip('destroy').tooltip('show');
676
- jQuery('input[name="field_options[clear_on_focus_'+ field_id +']"]').val(switch_to);
677
- return false;
 
 
 
 
 
678
  }
679
 
680
- function defaultBlank(){
681
- var switch_to = '0';
682
- var t = frm_admin_js.valid_default;
683
- if(this.className.indexOf('frm_inactive_icon') !== -1){
684
- switch_to = '1';
685
- t = frm_admin_js.no_valid_default;
 
 
 
 
 
 
 
 
 
 
686
  }
687
- var field_id = jQuery(this).closest('li.form-field').data('fid');
688
- jQuery(this).toggleClass('frm_inactive_icon').attr('title', t).tooltip('destroy').next('.tooltip').remove();
689
- jQuery(this).tooltip('show');
690
- jQuery('input[name="field_options[default_blank_'+ field_id +']"]').val(switch_to);
691
- return false;
 
 
 
 
 
 
 
 
 
 
692
  }
693
 
694
  function deleteFieldOption(){
@@ -2272,8 +2311,8 @@ function frmAdminBuildJS(){
2272
  $newFields.on('click', 'input.frm_req_field', markRequired);
2273
  $newFields.on('click', 'a.frm_req_field', clickRequired);
2274
  $newFields.on('click', '.frm_mark_unique', markUnique);
2275
- $newFields.on('click', '.frm_reload_icon', clearOnFocus);
2276
- $newFields.on('click', '.frm_error_icon', defaultBlank);
2277
 
2278
  $newFields.on('click', '.frm_repeat_field', toggleRepeat);
2279
  $newFields.on('change', '.frm_repeat_format', toggleRepeatButtons);
664
  return false;
665
  }
666
 
667
+ /**
668
+ * Toggle a default value icon
669
+ *
670
+ * @since 2.02.13
671
+ *
672
+ * @param {Object} event
673
+ * @param {string} event.data.iconType
674
+ */
675
+ function toggleDefaultValueIcon( event ) {
676
+ var type = event.data.iconType;
677
+ var messages = getTooltipMessages( type );
678
+ if ( ! ( 'active' in messages ) ) {
679
+ return;
680
+ }
681
+
682
  var switch_to = '0';
683
+ var tooltipMessage = messages.active;
684
+ if ( this.className.indexOf( 'frm_inactive_icon' ) !== -1 ) {
685
  switch_to = '1';
686
+ tooltipMessage = messages.inactive;
687
  }
688
+
689
+ var $icon = jQuery(this);
690
+
691
+ $icon.toggleClass( 'frm_inactive_icon' );
692
+
693
+ changeBootstrapTooltipText( $icon, tooltipMessage );
694
+
695
+ var field_id = $icon.closest( 'li.form-field') .data( 'fid' );
696
+ jQuery('input[name="field_options[' + type + '_'+ field_id + ']"]').val( switch_to );
697
  }
698
 
699
+ /**
700
+ * Get the tooltip messages for a specific icon
701
+ *
702
+ * @since 2.02.13
703
+ * @param {string} type
704
+ * @returns {Object}
705
+ */
706
+ function getTooltipMessages( type ) {
707
+ var messages = {};
708
+
709
+ if( type === 'clear_on_focus' ) {
710
+ messages.active = frm_admin_js.no_clear_default;
711
+ messages.inactive = frm_admin_js.clear_default;
712
+ } else if ( type === 'default_blank' ) {
713
+ messages.active = frm_admin_js.valid_default;
714
+ messages.inactive = frm_admin_js.no_valid_default;
715
  }
716
+
717
+ return messages;
718
+ }
719
+
720
+ /**
721
+ * Change the text on a Bootstrap tooltip
722
+ *
723
+ * @since 2.02.13
724
+ * @param {Object} $element
725
+ * @param {string} newText
726
+ */
727
+ function changeBootstrapTooltipText( $element, newText ) {
728
+ $element.attr('title', newText );
729
+ $element.tooltip('fixTitle');
730
+ $element.tooltip('show');
731
  }
732
 
733
  function deleteFieldOption(){
2311
  $newFields.on('click', 'input.frm_req_field', markRequired);
2312
  $newFields.on('click', 'a.frm_req_field', clickRequired);
2313
  $newFields.on('click', '.frm_mark_unique', markUnique);
2314
+ $newFields.on('click', '.frm_reload_icon', { iconType: 'clear_on_focus' }, toggleDefaultValueIcon);
2315
+ $newFields.on('click', '.frm_error_icon', { iconType: 'default_blank' }, toggleDefaultValueIcon);
2316
 
2317
  $newFields.on('click', '.frm_repeat_field', toggleRepeat);
2318
  $newFields.on('change', '.frm_repeat_format', toggleRepeatButtons);
languages/formidable-az_AZ.mo CHANGED
Binary file
languages/formidable-az_AZ.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Formidable v2.02.12\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2016-09-01 03:07+0000\n"
6
- "PO-Revision-Date: Tue Dec 13 2016 16:58:43 GMT-0800 (PST)\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "Language: Azerbaijani (Azerbaijan)\n"
@@ -273,7 +273,7 @@ msgstr ""
273
 
274
  #: ../classes/controllers/FrmFormsController.php:719 ../classes/views/frm-
275
  #: entries/sidebar-shared.php:23 ../pro/classes/controllers/FrmProFormsController.
276
- #: php:546 ../pro/classes/helpers/FrmProEntriesListHelper.php:58 ..
277
  #: pro/classes/helpers/FrmProEntriesListHelper.php:69 ..
278
  #: pro/classes/helpers/FrmProFieldsHelper.php:2535 ..
279
  #: pro/classes/views/displays/order_row.php:3 ..
@@ -350,7 +350,7 @@ msgstr ""
350
  #: php:24 ../classes/views/shared/form-nav.php:20 ../classes/views/styles/manage.
351
  #: php:31 ../classes/views/xml/import_form.php:85 ..
352
  #: pro/classes/controllers/FrmProDisplaysController.php:101 ..
353
- #: pro/classes/controllers/FrmProFormsController.php:426 ..
354
  #: pro/classes/views/xml/csv_opts.php:13
355
  msgid "(no title)"
356
  msgstr ""
@@ -477,7 +477,7 @@ msgid "Add/Edit Views"
477
  msgstr ""
478
 
479
  #: ../classes/helpers/FrmAppHelper.php:1080 ../classes/helpers/FrmFieldsHelper.
480
- #: php:175 ../pro/classes/controllers/FrmProFieldsController.php:1524
481
  #, php-format
482
  msgid "%s is invalid"
483
  msgstr ""
@@ -1203,187 +1203,187 @@ msgstr ""
1203
  msgid "Manage Form Styles"
1204
  msgstr ""
1205
 
1206
- #: ../classes/helpers/FrmTipsHelper.php:34
1207
  msgid "Long forms can still be beautiful with sections."
1208
  msgstr ""
1209
 
1210
- #: ../classes/helpers/FrmTipsHelper.php:35 ../classes/helpers/FrmTipsHelper.php:
1211
- #: 40 ../classes/helpers/FrmTipsHelper.php:55 ../classes/helpers/FrmTipsHelper.
1212
- #: php:99 ../classes/helpers/FrmTipsHelper.php:104 ..
1213
- #: classes/helpers/FrmTipsHelper.php:172 ../classes/helpers/FrmTipsHelper.php:184
1214
  msgid "Upgrade to Pro."
1215
  msgstr ""
1216
 
1217
- #: ../classes/helpers/FrmTipsHelper.php:39
1218
  msgid "Use conditional logic to shorten your forms and increase conversions."
1219
  msgstr ""
1220
 
1221
- #: ../classes/helpers/FrmTipsHelper.php:44
1222
  msgid "Stop intimidating users with long forms."
1223
  msgstr ""
1224
 
1225
- #: ../classes/helpers/FrmTipsHelper.php:45
1226
  msgid "Use page breaks."
1227
  msgstr ""
1228
 
1229
- #: ../classes/helpers/FrmTipsHelper.php:49
1230
  msgid "Cut down on back-and-forth with clients."
1231
  msgstr ""
1232
 
1233
- #: ../classes/helpers/FrmTipsHelper.php:50
1234
  msgid "Allow file uploads in your form."
1235
  msgstr ""
1236
 
1237
- #: ../classes/helpers/FrmTipsHelper.php:54
1238
  msgid "Need to calculate a total?"
1239
  msgstr ""
1240
 
1241
- #: ../classes/helpers/FrmTipsHelper.php:59
1242
  msgid "Save time."
1243
  msgstr ""
1244
 
1245
- #: ../classes/helpers/FrmTipsHelper.php:60
1246
  msgid "Prefill fields with user info."
1247
  msgstr ""
1248
 
1249
- #: ../classes/helpers/FrmTipsHelper.php:72 ../classes/helpers/FrmTipsHelper.php:77
1250
  msgid "A site with dynamic, user-generated content is within reach."
1251
  msgstr ""
1252
 
1253
- #: ../classes/helpers/FrmTipsHelper.php:73 ../classes/helpers/FrmTipsHelper.php:78
1254
  msgid "Add front-end editing."
1255
  msgstr ""
1256
 
1257
- #: ../classes/helpers/FrmTipsHelper.php:82
1258
  msgid "Have a long form that takes time to complete?"
1259
  msgstr ""
1260
 
1261
- #: ../classes/helpers/FrmTipsHelper.php:83
1262
  msgid "Let logged-in users save a draft and return later."
1263
  msgstr ""
1264
 
1265
- #: ../classes/helpers/FrmTipsHelper.php:93
1266
  msgid "Save time by sending the email to the right person automatically."
1267
  msgstr ""
1268
 
1269
- #: ../classes/helpers/FrmTipsHelper.php:94
1270
  msgid "Add email routing."
1271
  msgstr ""
1272
 
1273
- #: ../classes/helpers/FrmTipsHelper.php:98
1274
  msgid "Create blog posts or pages from the front-end."
1275
  msgstr ""
1276
 
1277
- #: ../classes/helpers/FrmTipsHelper.php:103
1278
  msgid "Make front-end posting easy."
1279
  msgstr ""
1280
 
1281
- #: ../classes/helpers/FrmTipsHelper.php:108
1282
  msgid "Grow your business with automated email follow-up."
1283
  msgstr ""
1284
 
1285
- #: ../classes/helpers/FrmTipsHelper.php:109
1286
  msgid "Send leads straight to MailChimp."
1287
  msgstr ""
1288
 
1289
- #: ../classes/helpers/FrmTipsHelper.php:113
1290
  msgid "Save hours and increase revenue by collecting payments with every submission."
1291
  msgstr ""
1292
 
1293
- #: ../classes/helpers/FrmTipsHelper.php:114 ../classes/helpers/FrmTipsHelper.php:
1294
- #: 119
1295
  msgid "Use PayPal with this form."
1296
  msgstr ""
1297
 
1298
- #: ../classes/helpers/FrmTipsHelper.php:118
1299
  msgid "Increase revenue."
1300
  msgstr ""
1301
 
1302
- #: ../classes/helpers/FrmTipsHelper.php:123
1303
  msgid "Get paid more quickly."
1304
  msgstr ""
1305
 
1306
- #: ../classes/helpers/FrmTipsHelper.php:124
1307
  msgid "Use Paypal with this form."
1308
  msgstr ""
1309
 
1310
- #: ../classes/helpers/FrmTipsHelper.php:128
1311
  msgid "Boost your site membership."
1312
  msgstr ""
1313
 
1314
- #: ../classes/helpers/FrmTipsHelper.php:129
1315
  msgid "Automatically create user accounts."
1316
  msgstr ""
1317
 
1318
- #: ../classes/helpers/FrmTipsHelper.php:133
1319
  msgid "Make front-end profile editing possible."
1320
  msgstr ""
1321
 
1322
- #: ../classes/helpers/FrmTipsHelper.php:134
1323
  msgid "Add user registration."
1324
  msgstr ""
1325
 
1326
- #: ../classes/helpers/FrmTipsHelper.php:138
1327
  msgid "Want a text when this form is submitted or when a payment is received?"
1328
  msgstr ""
1329
 
1330
- #: ../classes/helpers/FrmTipsHelper.php:139
1331
  msgid "Use Twilio with this form."
1332
  msgstr ""
1333
 
1334
- #: ../classes/helpers/FrmTipsHelper.php:143
1335
  msgid "Send a text when this form is submitted."
1336
  msgstr ""
1337
 
1338
- #: ../classes/helpers/FrmTipsHelper.php:144
1339
  msgid "Get Twilio."
1340
  msgstr ""
1341
 
1342
- #: ../classes/helpers/FrmTipsHelper.php:155
1343
  msgid "Make your sidebar or footer form stand out."
1344
  msgstr ""
1345
 
1346
- #: ../classes/helpers/FrmTipsHelper.php:156
1347
  msgid "Use multiple style templates."
1348
  msgstr ""
1349
 
1350
- #: ../classes/helpers/FrmTipsHelper.php:166
1351
  msgid "Want to edit or delete form submissions?"
1352
  msgstr ""
1353
 
1354
- #: ../classes/helpers/FrmTipsHelper.php:167
1355
  msgid "Add entry management."
1356
  msgstr ""
1357
 
1358
- #: ../classes/helpers/FrmTipsHelper.php:171
1359
  msgid "Want to search submitted entries?"
1360
  msgstr ""
1361
 
1362
- #: ../classes/helpers/FrmTipsHelper.php:183
1363
  msgid "Want to import entries into your forms?"
1364
  msgstr ""
1365
 
1366
- #: ../classes/helpers/FrmTipsHelper.php:194
1367
  msgid "Looking for more options to get professional results?"
1368
  msgstr ""
1369
 
1370
- #: ../classes/helpers/FrmTipsHelper.php:195
1371
  msgid "Take your forms to the next level."
1372
  msgstr ""
1373
 
1374
- #: ../classes/helpers/FrmTipsHelper.php:199
1375
  msgid "Increase conversions in your long forms."
1376
  msgstr ""
1377
 
1378
- #: ../classes/helpers/FrmTipsHelper.php:200
1379
  msgid "Add conditional logic, page breaks, and section headings."
1380
  msgstr ""
1381
 
1382
- #: ../classes/helpers/FrmTipsHelper.php:204
1383
  msgid "Automate your business and increase revenue."
1384
  msgstr ""
1385
 
1386
- #: ../classes/helpers/FrmTipsHelper.php:205
1387
  msgid "Collect instant payments, and send leads to MailChimp."
1388
  msgstr ""
1389
 
@@ -1518,23 +1518,23 @@ msgid "There was an error deactivating your license."
1518
  msgstr ""
1519
 
1520
  #: ../classes/models/FrmAddon.php:318 ..
1521
- #: pro/classes/controllers/FrmUpdatesController.php:356
1522
  msgid "Your License Key was invalid"
1523
  msgstr ""
1524
 
1525
  #: ../classes/models/FrmAddon.php:320
1526
  #, php-format
1527
  msgid ""
1528
- "You had an error communicating with Formidable Pro's API. %1$sClick here%2$s "
1529
  "for more information."
1530
  msgstr ""
1531
 
1532
  #: ../classes/models/FrmAddon.php:323
1533
- msgid "You had an HTTP error connecting to Formidable Pro's API"
1534
  msgstr ""
1535
 
1536
  #: ../classes/models/FrmAddon.php:333 ..
1537
- #: pro/classes/controllers/FrmUpdatesController.php:352
1538
  #, php-format
1539
  msgid "There was a %1$s error: %2$s"
1540
  msgstr ""
@@ -1685,7 +1685,7 @@ msgstr ""
1685
 
1686
  #: ../classes/models/FrmFormAction.php:686 ../classes/views/frm-
1687
  #: forms/_publish_box.php:9 ../pro/classes/controllers/FrmProFormsController.php:
1688
- #: 206
1689
  msgid "Save Draft"
1690
  msgstr ""
1691
 
@@ -1798,7 +1798,7 @@ msgstr ""
1798
  #, php-format
1799
  msgid ""
1800
  "Thank you for using our plugin and good luck with your forms!<br/><br/>Best,"
1801
- "<br/>Team Formidable - %1$sformidablepro.com%2$s"
1802
  msgstr ""
1803
 
1804
  #: ../classes/models/FrmSettings.php:88
@@ -1905,8 +1905,8 @@ msgstr ""
1905
  #: ../classes/views/frm-entries/no_entries.php:10
1906
  #, php-format
1907
  msgid ""
1908
- "For instructions on publishing your form see %1$sthis page%2$s <br/> or "
1909
- "click \"%3$sAdd New%4$s\" above to add an entry from here (Requires License)"
1910
  msgstr ""
1911
 
1912
  #: ../classes/views/frm-entries/no_entries.php:14
@@ -2241,7 +2241,7 @@ msgid "Drag fields from your form or the sidebar into this section"
2241
  msgstr ""
2242
 
2243
  #: ../classes/views/frm-forms/add_field_links.php:18 ..
2244
- #: pro/classes/controllers/FrmProGraphsController.php:1114
2245
  msgid "Fields"
2246
  msgstr ""
2247
 
@@ -2888,8 +2888,8 @@ msgid "Dynamic field options"
2888
  msgstr ""
2889
 
2890
  #: ../classes/views/shared/mb_adv_info.php:207 ..
2891
- #: pro/classes/controllers/FrmProGraphsController.php:1653 ..
2892
- #: pro/classes/controllers/FrmProGraphsController.php:1685
2893
  msgid "Creation Date"
2894
  msgstr ""
2895
 
@@ -3565,7 +3565,7 @@ msgid "Option Label"
3565
  msgstr ""
3566
 
3567
  #: ../pro/classes/controllers/FrmProFieldsController.php:531 ..
3568
- #: pro/classes/controllers/FrmProFormsController.php:262
3569
  msgid "Saved Value"
3570
  msgstr ""
3571
 
@@ -3645,22 +3645,22 @@ msgid "Login"
3645
  msgstr ""
3646
 
3647
  #: ../pro/classes/controllers/FrmProFormsController.php:58 ..
3648
- #: pro/classes/controllers/FrmProFormsController.php:276
3649
  msgid "Display Name"
3650
  msgstr ""
3651
 
3652
  #: ../pro/classes/controllers/FrmProFormsController.php:59 ..
3653
- #: pro/classes/controllers/FrmProFormsController.php:274
3654
  msgid "First Name"
3655
  msgstr ""
3656
 
3657
  #: ../pro/classes/controllers/FrmProFormsController.php:60 ..
3658
- #: pro/classes/controllers/FrmProFormsController.php:275
3659
  msgid "Last Name"
3660