Form Maker by WD – user-friendly drag & drop Form Builder plugin - Version 1.14.7

Version Description

  • Added: Provide a function to show popup form on button click.
  • Improved: Make it possible to change currency with none payment.
  • Improved: Translatable recaptcha.
  • Fixed: Condition hidden address field failed the form submissions if marked as required.
  • Fixed: Payment options default values.
  • Fixed: Privacy policy links.
Download this release

Release Info

Developer 10web
Plugin Icon 128x128 Form Maker by WD – user-friendly drag & drop Form Builder plugin
Version 1.14.7
Comparing to
See all releases

Code changes from version 1.14.6 to 1.14.7

admin/controllers/Manage_fm.php CHANGED
@@ -908,6 +908,10 @@ class FMControllerManage_fm extends FMAdminController {
908
  'privacy' => $privacy,
909
  );
910
 
 
 
 
 
911
  $data = array();
912
 
913
  $data['privacy'] = $privacy;
@@ -1093,6 +1097,11 @@ class FMControllerManage_fm extends FMAdminController {
1093
  return $delay;
1094
  }
1095
 
 
 
 
 
 
1096
  public function save_dis_options() {
1097
  $theme = WDW_FM_Library(self::PLUGIN)->get('theme', $this->model->get_default_theme_id(), 'intval');
1098
  $where = array('form_id' => WDW_FM_Library(self::PLUGIN)->get('current_id', 0, 'intval'));
@@ -1108,7 +1117,7 @@ class FMControllerManage_fm extends FMAdminController {
1108
  'scrollbox_minimize' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_minimize', 1, 'intval'),
1109
  'scrollbox_minimize_text' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_minimize_text', ''),
1110
  'popover_animate_effect' => WDW_FM_Library(self::PLUGIN)->get('popover_animate_effect', ''),
1111
- 'popover_loading_delay' => $this->set_delay_freq_positive_val(WDW_FM_Library(self::PLUGIN)->get('popover_loading_delay', 0, 'intval')),
1112
  'popover_frequency' => $this->set_delay_freq_positive_val(WDW_FM_Library(self::PLUGIN)->get('popover_frequency', 0, 'intval')),
1113
  'topbar_position' => WDW_FM_Library(self::PLUGIN)->get('topbar_position', 1, 'intval'),
1114
  'topbar_remain_top' => WDW_FM_Library(self::PLUGIN)->get('topbar_remain_top', 1, 'intval'),
908
  'privacy' => $privacy,
909
  );
910
 
911
+ // Keep the chosen Payment currency value with None Payment method also.
912
+ if ( ($paypal_mode != 1 && $paypal_mode != 2) && $payment_currency == '' ) {
913
+ unset($form_options['payment_currency']);
914
+ }
915
  $data = array();
916
 
917
  $data['privacy'] = $privacy;
1097
  return $delay;
1098
  }
1099
 
1100
+ public function set_delay_freq_positive_val_or_minus_one( $delay = 0 ) {
1101
+ if( $delay < -1 ) return 0;
1102
+ return $delay;
1103
+ }
1104
+
1105
  public function save_dis_options() {
1106
  $theme = WDW_FM_Library(self::PLUGIN)->get('theme', $this->model->get_default_theme_id(), 'intval');
1107
  $where = array('form_id' => WDW_FM_Library(self::PLUGIN)->get('current_id', 0, 'intval'));
1117
  'scrollbox_minimize' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_minimize', 1, 'intval'),
1118
  'scrollbox_minimize_text' => WDW_FM_Library(self::PLUGIN)->get('scrollbox_minimize_text', ''),
1119
  'popover_animate_effect' => WDW_FM_Library(self::PLUGIN)->get('popover_animate_effect', ''),
1120
+ 'popover_loading_delay' => $this->set_delay_freq_positive_val_or_minus_one(WDW_FM_Library(self::PLUGIN)->get('popover_loading_delay', 0, 'intval')),
1121
  'popover_frequency' => $this->set_delay_freq_positive_val(WDW_FM_Library(self::PLUGIN)->get('popover_frequency', 0, 'intval')),
1122
  'topbar_position' => WDW_FM_Library(self::PLUGIN)->get('topbar_position', 1, 'intval'),
1123
  'topbar_remain_top' => WDW_FM_Library(self::PLUGIN)->get('topbar_remain_top', 1, 'intval'),
admin/views/Manage_fm.php CHANGED
@@ -2004,7 +2004,7 @@ class FMViewManage_fm extends FMAdminView {
2004
  }
2005
  }
2006
  if ( in_array($types[$key_select_or_input], array('type_address', 'type_country')) ) {
2007
- $w_countries = WDW_FM_Library(self::PLUGIN)::get_countries();
2008
  foreach ( $w_countries as $w_country ) {
2009
  $selected = ( in_array($w_country, $multiselect) ) ? 'selected="selected"' : '';
2010
  echo '<option value="' . $w_country . '" ' . $selected . '>' . $w_country . '</option>';
@@ -2150,7 +2150,7 @@ class FMViewManage_fm extends FMAdminView {
2150
  <label class="wd-label" for="fm_go-gdpr_checkbox_text"><?php _e('GDPR compliance text.', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2151
  <input type="text" id="fm_go-gdpr_checkbox_text" name="gdpr_checkbox_text" value="<?php echo $row->gdpr_checkbox_text; ?>">
2152
  <p class="description"><?php _e('This text will be used for GDPR compliance checkbox. Place {{privacy_policy}} placeholder to place "Privacy Policy page" link.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2153
- <p class="description"><?php echo sprintf(__('You can manage your privacy settings %s.', WDFMInstance(self::PLUGIN)->prefix), '<a href="' . admin_url('privacy.php') . '" target="_blank">' . __('here', WDFMInstance(self::PLUGIN)->prefix)) . '</a>'; ?></p>
2154
  </div>
2155
  <div class="wd-group">
2156
  <label class="wd-label"><?php _e('Save User IP Address to Database', WDFMInstance(self::PLUGIN)->prefix); ?></label>
@@ -2449,6 +2449,7 @@ class FMViewManage_fm extends FMAdminView {
2449
  <div>
2450
  <?php _e('Define the amount of time before the form popup appears after the page loads.', WDFMInstance(self::PLUGIN)->prefix); ?>
2451
  <?php _e('Set 0 for no delay.', WDFMInstance(self::PLUGIN)->prefix); ?>
 
2452
  </div>
2453
  </span>
2454
  <span class="wd-group fm-popover <?php echo $row->type == 'popover' ? 'fm-show' : 'fm-hide' ?>">
2004
  }
2005
  }
2006
  if ( in_array($types[$key_select_or_input], array('type_address', 'type_country')) ) {
2007
+ $w_countries = WDW_FM_Library(self::PLUGIN)->get_countries();
2008
  foreach ( $w_countries as $w_country ) {
2009
  $selected = ( in_array($w_country, $multiselect) ) ? 'selected="selected"' : '';
2010
  echo '<option value="' . $w_country . '" ' . $selected . '>' . $w_country . '</option>';
2150
  <label class="wd-label" for="fm_go-gdpr_checkbox_text"><?php _e('GDPR compliance text.', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2151
  <input type="text" id="fm_go-gdpr_checkbox_text" name="gdpr_checkbox_text" value="<?php echo $row->gdpr_checkbox_text; ?>">
2152
  <p class="description"><?php _e('This text will be used for GDPR compliance checkbox. Place {{privacy_policy}} placeholder to place "Privacy Policy page" link.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2153
+ <p class="description"><?php echo sprintf(__('You can manage your privacy settings %s.', WDFMInstance(self::PLUGIN)->prefix), '<a href="' . admin_url('options-privacy.php') . '" target="_blank">' . __('here', WDFMInstance(self::PLUGIN)->prefix)) . '</a>'; ?></p>
2154
  </div>
2155
  <div class="wd-group">
2156
  <label class="wd-label"><?php _e('Save User IP Address to Database', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2449
  <div>
2450
  <?php _e('Define the amount of time before the form popup appears after the page loads.', WDFMInstance(self::PLUGIN)->prefix); ?>
2451
  <?php _e('Set 0 for no delay.', WDFMInstance(self::PLUGIN)->prefix); ?>
2452
+ <?php _e('Set -1 for show only after show_popup_form_' . $row->form_id . '() function\'s call', WDFMInstance(self::PLUGIN)->prefix); ?>
2453
  </div>
2454
  </span>
2455
  <span class="wd-group fm-popover <?php echo $row->type == 'popover' ? 'fm-show' : 'fm-hide' ?>">
form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://10web.io/plugins/wordpress-form-maker/?utm_source=form_maker&utm_medium=free_plugin
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
- * Version: 1.14.6
7
  * Author: 10Web Form Builder Team
8
  * Author URI: https://10web.io/plugins/?utm_source=form_maker&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -104,8 +104,8 @@ final class WDFM {
104
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
105
  $this->front_urls = $this->get_front_urls();
106
  $this->main_file = plugin_basename(__FILE__);
107
- $this->plugin_version = '1.14.6';
108
- $this->db_version = '2.14.6';
109
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
110
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
111
  $this->menu_slug = 'manage' . $this->menu_postfix;
@@ -1164,9 +1164,11 @@ final class WDFM {
1164
  wp_register_style($this->handle_prefix . '-googlefonts', WDW_FM_Library(self::PLUGIN)->get_all_used_google_fonts(), null, null);
1165
  wp_register_script($this->handle_prefix . '-signaturepad', $this->plugin_url . '/js/jquery.signaturepad.min.js', array(), '2.5.2');
1166
 
1167
- wp_register_script($this->handle_prefix . '-g-recaptcha', 'https://www.google.com/recaptcha/api.js?onload=fmRecaptchaInit&render=explicit');
 
 
1168
  if ( isset($fm_settings['public_key']) ) {
1169
- wp_register_script($this->handle_prefix . '-g-recaptcha-v3', 'https://www.google.com/recaptcha/api.js?onload=fmRecaptchaInit&render=' . $fm_settings['public_key']);
1170
  }
1171
  // Register admin styles to use in frontend submissions.
1172
  wp_register_script('gmap_form_back', $front_plugin_url . '/js/if_gmap_back_end.js', array(), $this->plugin_version);
@@ -1569,25 +1571,80 @@ final class WDFM {
1569
  * Check extensions version compatibility with FM.
1570
  *
1571
  */
1572
- function fm_check_addons_compatibility() {
1573
- // Extension last version(version which is compatible with current version of form maker).
 
1574
  $add_ons = array(
1575
- 'form-maker-calculator' => array('version' => '1.1.8', 'file' => 'fm_calculator.php'),
1576
- 'form-maker-conditional-emails' => array('version' => '1.1.6', 'file' => 'fm_conditional_emails.php'),
1577
- 'form-maker-dropbox-integration' => array('version' => '1.2.8', 'file' => 'fm_dropbox_integration.php'),
1578
- 'form-maker-export-import' => array('version' => '2.1.11', 'file' => 'fm_exp_imp.php'),
1579
- 'form-maker-gdrive-integration' => array('version' => '1.1.7', 'file' => 'fm_gdrive_integration.php'),
1580
- 'form-maker-mailchimp' => array('version' => '1.1.11', 'file' => 'fm_mailchimp.php'),
1581
- 'form-maker-pdf-integration' => array('version' => '1.1.7', 'file' => 'fm_pdf_integration.php'),
1582
- 'form-maker-post-generation' => array('version' => '1.1.10', 'file' => 'fm_post_generation.php'),
1583
- 'form-maker-pushover' => array('version' => '1.1.7', 'file' => 'fm_pushover.php'),
1584
- 'form-maker-reg' => array('version' => '1.2.11', 'file' => 'fm_reg.php'),
1585
- 'form-maker-save-progress' => array('version' => '1.1.11', 'file' => 'fm_save.php'),
1586
- 'form-maker-stripe' => array('version' => '1.2.8', 'file' => 'fm_stripe.php'),
1587
- 'form-maker-webhooks' => array('version' => '1.0.5', 'file' => 'fm_webhooks.php'),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1588
  );
1589
 
1590
  $add_ons_notice = array();
 
 
1591
  include_once($this->abspath . 'wp-admin/includes/plugin.php');
1592
 
1593
  foreach ( $add_ons as $add_on_key => $add_on_value ) {
@@ -1599,11 +1656,20 @@ final class WDFM {
1599
  array_push($add_ons_notice, $addon['Name']);
1600
  }
1601
  }
 
 
 
 
 
 
1602
  }
1603
 
1604
  if ( !empty($add_ons_notice) ) {
1605
  $this->fm_addons_compatibility_notice($add_ons_notice);
1606
  }
 
 
 
1607
  }
1608
 
1609
  /**
@@ -1611,45 +1677,51 @@ final class WDFM {
1611
  *
1612
  * @param $add_ons_notice
1613
  */
1614
- function fm_addons_compatibility_notice($add_ons_notice) {
1615
  $addon_names = implode(', ', $add_ons_notice);
1616
  $count = count($add_ons_notice);
1617
  $single = __('The current version of %s extension is not compatible with Form Maker. Some functions may not work correctly. Please update the extension to fully use its features.', $this->prefix);
1618
  $plural = __('The current version of %s extensions are not compatible with Form Maker. Some functions may not work correctly. Please update the extensions to fully use its features.', $this->prefix);
1619
- echo '<div class="error"><p>' . sprintf( _n($single, $plural, $count, $this->prefix), $addon_names ) .'</p></div>';
1620
  }
1621
 
1622
- public function add_query_vars_seo($vars) {
1623
- $vars[] = 'form_id';
1624
- return $vars;
1625
- }
1626
-
1627
- /**
1628
- * Prevent adding shortcode conflict with some builders.
1629
- */
1630
- private function before_shortcode_add_builder_editor() {
1631
- if ( defined('ELEMENTOR_VERSION') ) {
1632
- add_action('elementor/editor/before_enqueue_scripts', array( $this, 'form_maker_admin_ajax' ));
1633
- }
1634
- if ( class_exists('FLBuilder') ) {
1635
- add_action('wp_enqueue_scripts', array( $this, 'form_maker_admin_ajax' ));
1636
- }
1637
- }
 
 
 
 
 
 
1638
 
1639
  public function webinar_banner() {
1640
  // Webinar banner
1641
- if ( !class_exists( 'TWFMWebinar' ) ) {
1642
- require_once( $this->plugin_dir . '/framework/TWWebinar.php' );
1643
  }
1644
  new TWFMWebinar(array(
1645
- 'menu_postfix' => $this->menu_postfix,
1646
- 'title' => 'Join the Webinar',
1647
- 'description' => 'How to Create a Fully Functional WP Website with Various Forms in Just an Hour + SPECIAL GIFT FOR WEBINAR ATTENDEES',
1648
- 'preview_type' => 'youtube',
1649
- 'preview_url' => 'Ry2hDk3LtPk',
1650
- 'button_text' => 'SIGN UP',
1651
- 'button_link' => 'https://my.demio.com/ref/qWIW655LXhVTdRoY',
1652
- ));
1653
  }
1654
 
1655
  /**
@@ -1679,15 +1751,16 @@ final class WDFM {
1679
  require_once WD_FM_STRIPE_DIR . '/model.php';
1680
  }
1681
  $model = new WD_FM_STRIPE_model();
1682
- if ( $endpoint_object->amount !== $endpoint_object->amount_captured ) {
1683
- $capture_less_data = array(
1684
- 'amount' => strtoupper( $endpoint_object->currency ) . " " . $endpoint_object->amount / 100,
1685
- 'amount_captured' => strtoupper( $endpoint_object->currency ) . " " . $endpoint_object->amount_captured / 100,
1686
- );
1687
- } else {
1688
- $capture_less_data = array();
1689
- }
1690
- $model->update_stripe_status( $group_id, $capture_less_data );
 
1691
  }
1692
  break;
1693
  default:
@@ -1701,7 +1774,7 @@ final class WDFM {
1701
  public function register_endpoint_for_stripe_events() {
1702
  register_rest_route('form_maker/v1', 'stripe_events', array(
1703
  'methods' => "POST",
1704
- 'callback' => array($this, 'stripe_events_processing_logic'),
1705
  'permission_callback' => '__return_true',
1706
  ));
1707
  }
@@ -1712,40 +1785,39 @@ final class WDFM {
1712
  *
1713
  * @return WDFM The main instance to prevent the need to use globals.
1714
  */
1715
- if (!function_exists('WDFMInstance')) {
1716
  function WDFMInstance( $version ) {
1717
  if ( $version == 2 ) {
1718
  return WDCFM::instance();
1719
  }
 
1720
  return WDFM::instance();
1721
  }
1722
  }
1723
-
1724
  WDFMInstance(1);
1725
-
1726
- if (!function_exists('WDW_FM_Library')) {
1727
  function WDW_FM_Library( $version = 1 ) {
1728
  if ( $version == 2 ) {
1729
  return WDW_FMC_Library::instance();
1730
  }
 
1731
  return WDW_FM_Library::instance();
1732
  }
1733
  }
1734
-
1735
  /**
1736
  * Form maker output.
1737
  *
1738
- * @param $id
1739
  * @param string $type
1740
  */
1741
- function wd_form_maker($id, $type = 'embedded') {
1742
- require_once (WDFMInstance(1)->plugin_dir . '/frontend/controllers/form_maker.php');
1743
  $controller = new FMControllerForm_maker();
1744
  $form = $controller->execute($id, $type);
1745
  echo $form;
1746
  }
1747
 
1748
- function fm_add_plugin_meta_links($meta_fields, $file) {
1749
  if ( plugin_basename(__FILE__) == $file ) {
1750
  $plugin_url = "https://wordpress.org/support/plugin/form-maker";
1751
  $prefix = WDFMInstance(1)->prefix;
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://10web.io/plugins/wordpress-form-maker/?utm_source=form_maker&utm_medium=free_plugin
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
+ * Version: 1.14.7
7
  * Author: 10Web Form Builder Team
8
  * Author URI: https://10web.io/plugins/?utm_source=form_maker&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
104
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
105
  $this->front_urls = $this->get_front_urls();
106
  $this->main_file = plugin_basename(__FILE__);
107
+ $this->plugin_version = '1.14.7';
108
+ $this->db_version = '2.14.7';
109
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
110
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
111
  $this->menu_slug = 'manage' . $this->menu_postfix;
1164
  wp_register_style($this->handle_prefix . '-googlefonts', WDW_FM_Library(self::PLUGIN)->get_all_used_google_fonts(), null, null);
1165
  wp_register_script($this->handle_prefix . '-signaturepad', $this->plugin_url . '/js/jquery.signaturepad.min.js', array(), '2.5.2');
1166
 
1167
+ /* Getting admin language to show recaptcha language */
1168
+ $lng = get_locale();
1169
+ wp_register_script($this->handle_prefix . '-g-recaptcha', 'https://www.google.com/recaptcha/api.js?hl='.$lng.'&onload=fmRecaptchaInit&render=explicit');
1170
  if ( isset($fm_settings['public_key']) ) {
1171
+ wp_register_script($this->handle_prefix . '-g-recaptcha-v3', 'https://www.google.com/recaptcha/api.js?hl='.$lng.'&onload=fmRecaptchaInit&render=' . $fm_settings['public_key']);
1172
  }
1173
  // Register admin styles to use in frontend submissions.
1174
  wp_register_script('gmap_form_back', $front_plugin_url . '/js/if_gmap_back_end.js', array(), $this->plugin_version);
1571
  * Check extensions version compatibility with FM.
1572
  *
1573
  */
1574
+ function fm_check_addons_compatibility() {
1575
+ // version - addon maximal version which is compatible with current version of form maker.
1576
+ // fm_version - form maker minimal version which is compatible with current version of addon.
1577
  $add_ons = array(
1578
+ 'form-maker-calculator' => array(
1579
+ 'version' => '1.1.8',
1580
+ 'fm_version' => '2.13.0',
1581
+ 'file' => 'fm_calculator.php',
1582
+ ),
1583
+ 'form-maker-conditional-emails' => array(
1584
+ 'version' => '1.1.6',
1585
+ 'fm_version' => '2.13.0',
1586
+ 'file' => 'fm_conditional_emails.php',
1587
+ ),
1588
+ 'form-maker-dropbox-integration' => array(
1589
+ 'version' => '1.2.8',
1590
+ 'fm_version' => '2.14.0',
1591
+ 'file' => 'fm_dropbox_integration.php',
1592
+ ),
1593
+ 'form-maker-export-import' => array(
1594
+ 'version' => '2.1.11',
1595
+ 'fm_version' => '2.14.0',
1596
+ 'file' => 'fm_exp_imp.php',
1597
+ ),
1598
+ 'form-maker-gdrive-integration' => array(
1599
+ 'version' => '1.1.7',
1600
+ 'fm_version' => '2.14.0',
1601
+ 'file' => 'fm_gdrive_integration.php',
1602
+ ),
1603
+ 'form-maker-mailchimp' => array(
1604
+ 'version' => '1.1.11',
1605
+ 'fm_version' => '2.14.0',
1606
+ 'file' => 'fm_mailchimp.php',
1607
+ ),
1608
+ 'form-maker-pdf-integration' => array(
1609
+ 'version' => '1.1.7',
1610
+ 'fm_version' => '2.13.0',
1611
+ 'file' => 'fm_pdf_integration.php',
1612
+ ),
1613
+ 'form-maker-post-generation' => array(
1614
+ 'version' => '1.1.10',
1615
+ 'fm_version' => '2.14.0',
1616
+ 'file' => 'fm_post_generation.php',
1617
+ ),
1618
+ 'form-maker-pushover' => array(
1619
+ 'version' => '1.1.7',
1620
+ 'fm_version' => '2.14.0',
1621
+ 'file' => 'fm_pushover.php',
1622
+ ),
1623
+ 'form-maker-reg' => array(
1624
+ 'version' => '1.2.11',
1625
+ 'fm_version' => '2.14.0',
1626
+ 'file' => 'fm_reg.php',
1627
+ ),
1628
+ 'form-maker-save-progress' => array(
1629
+ 'version' => '1.1.11',
1630
+ 'fm_version' => '2.14.6',
1631
+ 'file' => 'fm_save.php',
1632
+ ),
1633
+ 'form-maker-stripe' => array(
1634
+ 'version' => '1.2.8',
1635
+ 'fm_version' => '2.14.0',
1636
+ 'file' => 'fm_stripe.php',
1637
+ ),
1638
+ 'form-maker-webhooks' => array(
1639
+ 'version' => '1.0.5',
1640
+ 'fm_version' => '2.14.0',
1641
+ 'file' => 'fm_webhooks.php',
1642
+ ),
1643
  );
1644
 
1645
  $add_ons_notice = array();
1646
+ $add_ons_need_higher_version = array();
1647
+ $max_required_version = $this->db_version;
1648
  include_once($this->abspath . 'wp-admin/includes/plugin.php');
1649
 
1650
  foreach ( $add_ons as $add_on_key => $add_on_value ) {
1656
  array_push($add_ons_notice, $addon['Name']);
1657
  }
1658
  }
1659
+ if ( version_compare($this->db_version, $add_on_value['fm_version']) == -1 ) {
1660
+ array_push($add_ons_need_higher_version, $add_on_key);
1661
+ }
1662
+ if ( version_compare($max_required_version, $add_on_value['fm_version']) == -1 ) {
1663
+ $max_required_version = $add_on_value['fm_version'];
1664
+ }
1665
  }
1666
 
1667
  if ( !empty($add_ons_notice) ) {
1668
  $this->fm_addons_compatibility_notice($add_ons_notice);
1669
  }
1670
+ if ( !empty($add_ons_need_higher_version) ) {
1671
+ $this->fm_compatibility_notice($max_required_version);
1672
+ }
1673
  }
1674
 
1675
  /**
1677
  *
1678
  * @param $add_ons_notice
1679
  */
1680
+ function fm_addons_compatibility_notice( $add_ons_notice ) {
1681
  $addon_names = implode(', ', $add_ons_notice);
1682
  $count = count($add_ons_notice);
1683
  $single = __('The current version of %s extension is not compatible with Form Maker. Some functions may not work correctly. Please update the extension to fully use its features.', $this->prefix);
1684
  $plural = __('The current version of %s extensions are not compatible with Form Maker. Some functions may not work correctly. Please update the extensions to fully use its features.', $this->prefix);
1685
+ echo '<div class="error"><p>' . sprintf(_n($single, $plural, $count, $this->prefix), $addon_names) . '</p></div>';
1686
  }
1687
 
1688
+ function fm_compatibility_notice( $max_required_version ) {
1689
+ $message = __('Please install %s plugin version %s and higher to start using add-on.', 'form_maker');
1690
+ echo '<div class="error"><p>' . sprintf($message, 'Form Maker', $max_required_version) . '</p></div>';
1691
+ }
1692
+
1693
+ public function add_query_vars_seo( $vars ) {
1694
+ $vars[] = 'form_id';
1695
+
1696
+ return $vars;
1697
+ }
1698
+
1699
+ /**
1700
+ * Prevent adding shortcode conflict with some builders.
1701
+ */
1702
+ private function before_shortcode_add_builder_editor() {
1703
+ if ( defined('ELEMENTOR_VERSION') ) {
1704
+ add_action('elementor/editor/before_enqueue_scripts', array( $this, 'form_maker_admin_ajax' ));
1705
+ }
1706
+ if ( class_exists('FLBuilder') ) {
1707
+ add_action('wp_enqueue_scripts', array( $this, 'form_maker_admin_ajax' ));
1708
+ }
1709
+ }
1710
 
1711
  public function webinar_banner() {
1712
  // Webinar banner
1713
+ if ( !class_exists('TWFMWebinar') ) {
1714
+ require_once($this->plugin_dir . '/framework/TWWebinar.php');
1715
  }
1716
  new TWFMWebinar(array(
1717
+ 'menu_postfix' => $this->menu_postfix,
1718
+ 'title' => 'Join the Webinar',
1719
+ 'description' => 'How to Create a Fully Functional WP Website with Various Forms in Just an Hour + SPECIAL GIFT FOR WEBINAR ATTENDEES',
1720
+ 'preview_type' => 'youtube',
1721
+ 'preview_url' => 'Ry2hDk3LtPk',
1722
+ 'button_text' => 'SIGN UP',
1723
+ 'button_link' => 'https://my.demio.com/ref/qWIW655LXhVTdRoY',
1724
+ ));
1725
  }
1726
 
1727
  /**
1751
  require_once WD_FM_STRIPE_DIR . '/model.php';
1752
  }
1753
  $model = new WD_FM_STRIPE_model();
1754
+ if ( $endpoint_object->amount !== $endpoint_object->amount_captured ) {
1755
+ $capture_less_data = array(
1756
+ 'amount' => strtoupper($endpoint_object->currency) . " " . $endpoint_object->amount / 100,
1757
+ 'amount_captured' => strtoupper($endpoint_object->currency) . " " . $endpoint_object->amount_captured / 100,
1758
+ );
1759
+ }
1760
+ else {
1761
+ $capture_less_data = array();
1762
+ }
1763
+ $model->update_stripe_status($group_id, $capture_less_data);
1764
  }
1765
  break;
1766
  default:
1774
  public function register_endpoint_for_stripe_events() {
1775
  register_rest_route('form_maker/v1', 'stripe_events', array(
1776
  'methods' => "POST",
1777
+ 'callback' => array( $this, 'stripe_events_processing_logic' ),
1778
  'permission_callback' => '__return_true',
1779
  ));
1780
  }
1785
  *
1786
  * @return WDFM The main instance to prevent the need to use globals.
1787
  */
1788
+ if ( !function_exists('WDFMInstance') ) {
1789
  function WDFMInstance( $version ) {
1790
  if ( $version == 2 ) {
1791
  return WDCFM::instance();
1792
  }
1793
+
1794
  return WDFM::instance();
1795
  }
1796
  }
 
1797
  WDFMInstance(1);
1798
+ if ( !function_exists('WDW_FM_Library') ) {
 
1799
  function WDW_FM_Library( $version = 1 ) {
1800
  if ( $version == 2 ) {
1801
  return WDW_FMC_Library::instance();
1802
  }
1803
+
1804
  return WDW_FM_Library::instance();
1805
  }
1806
  }
 
1807
  /**
1808
  * Form maker output.
1809
  *
1810
+ * @param $id
1811
  * @param string $type
1812
  */
1813
+ function wd_form_maker( $id, $type = 'embedded' ) {
1814
+ require_once(WDFMInstance(1)->plugin_dir . '/frontend/controllers/form_maker.php');
1815
  $controller = new FMControllerForm_maker();
1816
  $form = $controller->execute($id, $type);
1817
  echo $form;
1818
  }
1819
 
1820
+ function fm_add_plugin_meta_links( $meta_fields, $file ) {
1821
  if ( plugin_basename(__FILE__) == $file ) {
1822
  $plugin_url = "https://wordpress.org/support/plugin/form-maker";
1823
  $prefix = WDFMInstance(1)->prefix;
form_maker_update.php CHANGED
@@ -357,7 +357,7 @@ class WDFMUpdate {
357
  $error = ob_get_clean();
358
  $grants = $wpdb->get_results( "SHOW GRANTS" );
359
  $message = array_values( (array) $grants[0] )[0];
360
- if ( !( strpos( $message, 'GRANT ALL PRIVILEGES ON' ) === 0 || strpos( $message, 'GRANT USAGE ON' ) === 0 ) && ( strpos( $message, 'ALTER, ' ) === FALSE ) ) {
361
  update_option( 'fm_db_full_privileged', 0 );
362
  if ( FALSE === get_option( "fm_db_full_privileged_notice", FALSE ) ) {
363
  update_option( 'fm_db_full_privileged_notice', 1 );
357
  $error = ob_get_clean();
358
  $grants = $wpdb->get_results( "SHOW GRANTS" );
359
  $message = array_values( (array) $grants[0] )[0];
360
+ if ( !( strpos( $message, 'GRANT ALL PRIVILEGES ON' ) === 0 || strpos( $message, 'GRANT USAGE ON' ) === 0 ) && !( strpos( $message, 'ALTER, ' ) === FALSE || strpos( $message, 'ALTER ON' ) === FALSE) ) {
361
  update_option( 'fm_db_full_privileged', 0 );
362
  if ( FALSE === get_option( "fm_db_full_privileged_notice", FALSE ) ) {
363
  update_option( 'fm_db_full_privileged_notice', 1 );
framework/WDW_FM_Library.php CHANGED
@@ -1893,46 +1893,57 @@ class WDW_FM_Library {
1893
  $if = ltrim($if, ' && ');
1894
  if ( $if ) {
1895
  $condition_js .= '
1896
- if(' . $if . ') {
1897
- jQuery("#form' . $form_id . '' . $selector . '").' . $display . ';
1898
- }
1899
- else {
1900
- jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1901
- }';
1902
  }
1903
  if ( $keyup ) {
1904
  $condition_js .= '
1905
- jQuery("' . substr($keyup, 0, -2) . '").on("keyup change", function() {
1906
- if(' . $if . ') {
1907
- jQuery("#form' . $form_id . '' . $selector . '").' . $display . ';
1908
- }
1909
- else {
1910
- jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1911
- }
1912
- set_total_value(' . $form_id . ');
1913
- });';
 
 
 
1914
  }
1915
  if ( $change ) {
1916
  $condition_js .= '
1917
- jQuery("' . substr($change, 0, -2) . '").change(function() {
1918
- if(' . $if . ') {
1919
- jQuery("#form' . $form_id . '' . $selector . '").' . $display . ';
1920
- }
1921
- else {
1922
- jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1923
- }
1924
- set_total_value(' . $form_id . ');
1925
- });';
 
 
 
1926
  }
1927
  if ( $blur ) {
1928
  $condition_js .= '
1929
- jQuery("' . substr($blur, 0, -2) . '").blur(function() {
1930
- if(' . $if . ')
1931
- jQuery("#form' . $form_id . '' . $selector . '").' . $display . ';
1932
- else
1933
- jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1934
- set_total_value(' . $form_id . ');
1935
- });';
 
 
 
 
 
1936
  }
1937
  if ( $click ) {
1938
  $condition_js .= '
@@ -1944,19 +1955,25 @@ class WDW_FM_Library {
1944
  jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1945
  }
1946
  set_total_value(' . $form_id . ');
 
 
 
1947
  });';
1948
  }
1949
  if ( $ui_slider ) {
1950
  $condition_js .= '
1951
- jQuery("' . substr($ui_slider, 0, -2) . '").on( "slidestop", function() {
1952
- if(' . $if . ') {
1953
- jQuery("#form' . $form_id . '' . $selector . '").' . $display . ';
1954
- }
1955
- else {
1956
- jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1957
- }
1958
- set_total_value(' . $form_id . ');
1959
- });';
 
 
 
1960
  }
1961
  if ( $documentOn ) {
1962
  $condition_js .= '
@@ -4243,8 +4260,8 @@ set_total_value(' . $form_id . ');
4243
  break;
4244
  }
4245
  case 'type_paypal_total': {
4246
- $onload_js .= 'set_total_value(' . $form_id . ');';
4247
- break;
4248
  }
4249
  case 'type_signature': {
4250
  $params_names = array(
@@ -4268,54 +4285,80 @@ set_total_value(' . $form_id . ');
4268
  if ( $required ) {
4269
  array_push($req_fields, $id1);
4270
  }
4271
- $signature_tmp_resize_js .='
4272
- var $canvas_' . $id1 . ',
4273
- onResize_' . $id1 . ' = function(event) {
 
 
4274
  if ( $canvas_' . $id1 . ' && $canvas_' . $id1 . '.offsetWidth ) {
 
 
 
 
 
 
4275
  var ratio = Math.max(window.devicePixelRatio || 1, 1);
4276
  $canvas_' . $id1 . '.width = $canvas_' . $id1 . '.offsetWidth * ratio;
4277
  $canvas_' . $id1 . '.height = $canvas_' . $id1 . '.offsetHeight * ratio;
4278
  $canvas_' . $id1 . '.getContext("2d").scale(ratio, ratio);
 
 
4279
  }
4280
- };';
4281
- $signature_tmp_ready_js .='
4282
- $canvas_' . $id1 . ' = jQuery("#wdform_' . $id1 . '_element' . $form_id . '")[0];
4283
- window.addEventListener("orientationchange", onResize_' . $id1 . ', false);
4284
- window.addEventListener("resize", onResize_' . $id1 . ', false);
4285
- setTimeout(function(){ onResize_' . $id1 . '(); }, 300);
4286
- jQuery(".wdform_signature-canvas-' . $id1 . '").signaturePad({
4287
- drawOnly: true,
4288
- defaultAction: "drawIt",
4289
- validateFields: false,
4290
- lineWidth: 0,
4291
- output: "",
4292
- sigNav: null,
4293
- name: null,
4294
- typed: null,
4295
- lineColour: "#000",
4296
- penColour: "#000",
4297
- clear: "#signature-clear-wdform_' . $id1 . '_element' . $form_id . '",
4298
- typeIt: null,
4299
- drawIt: null,
4300
- typeItDesc: null,
4301
- drawItDesc: null,
4302
- onDrawEnd: function(){
4303
- jQuery("#signature-file-wdform_' . $id1 . '_element' . $form_id . '").val(this.getSignatureImage());
4304
- }
4305
- });
4306
- ';
 
4307
  break;
4308
  }
4309
  }
4310
  }
4311
  }
4312
- $signature_js = (!empty($signature_tmp_resize_js) && !empty($signature_tmp_ready_js) ) ? 'function signature_init() { ' . $signature_tmp_resize_js . ' jQuery(document).ready(function() {' . $signature_tmp_ready_js . '}) }' : '';
4313
  $onsubmit_js .= '
4314
  var disabled_fields = "";
4315
  jQuery("#form' . $form_id . ' div[wdid]").each(function() {
4316
  if(jQuery(this).css("display") == "none") {
4317
- disabled_fields += jQuery(this).attr("wdid");
4318
- disabled_fields += ",";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4319
  }
4320
  })
4321
  if(disabled_fields) {
@@ -4346,6 +4389,34 @@ set_total_value(' . $form_id . ');
4346
  var update_first_field_id<?php echo $form_id; ?> = <?php echo !empty($first_field_id[0]) ? $first_field_id[0] : 0; ?>;
4347
  var form_view_count<?php echo $form_id ?> = 0;
4348
  <?php echo preg_replace($pattern, ' ', $row->javascript); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4349
  function onload_js<?php echo $form_id ?>() {<?php
4350
  echo $onload_js; ?>
4351
  }
@@ -4490,7 +4561,7 @@ set_total_value(' . $form_id . ');
4490
  ajax_similarity<?php echo $form_id ?>( ajaxObj<?php echo $form_id ?>, update_first_field_id<?php echo $form_id; ?> );
4491
  }
4492
  form_load_actions();
4493
- <?php echo !empty($signature_js) ? 'signature_init();' : ''; ?>
4494
  }
4495
  jQuery(function () {
4496
  fm_script_ready<?php echo $form_id ?>();
1893
  $if = ltrim($if, ' && ');
1894
  if ( $if ) {
1895
  $condition_js .= '
1896
+ if(' . $if . ') {
1897
+ jQuery("#form' . $form_id . '' . $selector . '").' . $display . ';
1898
+ }
1899
+ else {
1900
+ jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1901
+ }';
1902
  }
1903
  if ( $keyup ) {
1904
  $condition_js .= '
1905
+ jQuery("' . substr($keyup, 0, -2) . '").on("keyup change", function() {
1906
+ if(' . $if . ') {
1907
+ jQuery("#form' . $form_id . '' . $selector . '").' . $display . ';
1908
+ }
1909
+ else {
1910
+ jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1911
+ }
1912
+ set_total_value(' . $form_id . ');
1913
+ if ( jQuery("#form' . $form_id . ' div[type=\'type_signature\']").length && typeof fm_signature_init != \'undefined\' ) {
1914
+ fm_signature_init();
1915
+ }
1916
+ });';
1917
  }
1918
  if ( $change ) {
1919
  $condition_js .= '
1920
+ jQuery("' . substr($change, 0, -2) . '").change(function() {
1921
+ if(' . $if . ') {
1922
+ jQuery("#form' . $form_id . '' . $selector . '").' . $display . ';
1923
+ }
1924
+ else {
1925
+ jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1926
+ }
1927
+ set_total_value(' . $form_id . ');
1928
+ if ( jQuery("#form' . $form_id . ' div[type=\'type_signature\']").length && typeof fm_signature_init != \'undefined\' ) {
1929
+ fm_signature_init();
1930
+ }
1931
+ });';
1932
  }
1933
  if ( $blur ) {
1934
  $condition_js .= '
1935
+ jQuery("' . substr($blur, 0, -2) . '").blur(function() {
1936
+ if(' . $if . ') {
1937
+ jQuery("#form' . $form_id . '' . $selector . '").' . $display . ';
1938
+ }
1939
+ else {
1940
+ jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1941
+ }
1942
+ set_total_value(' . $form_id . ');
1943
+ if ( jQuery("#form' . $form_id . ' div[type=\'type_signature\']").length && typeof fm_signature_init != \'undefined\' ) {
1944
+ fm_signature_init();
1945
+ }
1946
+ });';
1947
  }
1948
  if ( $click ) {
1949
  $condition_js .= '
1955
  jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1956
  }
1957
  set_total_value(' . $form_id . ');
1958
+ if ( jQuery("#form' . $form_id . ' div[type=\'type_signature\']").length && typeof fm_signature_init != \'undefined\' ) {
1959
+ fm_signature_init();
1960
+ }
1961
  });';
1962
  }
1963
  if ( $ui_slider ) {
1964
  $condition_js .= '
1965
+ jQuery("' . substr($ui_slider, 0, -2) . '").on( "slidestop", function() {
1966
+ if(' . $if . ') {
1967
+ jQuery("#form' . $form_id . '' . $selector . '").' . $display . ';
1968
+ }
1969
+ else {
1970
+ jQuery("#form' . $form_id . '' . $selector . '").' . $display_none . ';
1971
+ }
1972
+ set_total_value(' . $form_id . ');
1973
+ if ( jQuery("#form' . $form_id . ' div[type=\'type_signature\']").length && typeof fm_signature_init != \'undefined\' ) {
1974
+ fm_signature_init();
1975
+ }
1976
+ });';
1977
  }
1978
  if ( $documentOn ) {
1979
  $condition_js .= '
4260
  break;
4261
  }
4262
  case 'type_paypal_total': {
4263
+ $onload_js .= 'set_total_value(' . $form_id . ');';
4264
+ break;
4265
  }
4266
  case 'type_signature': {
4267
  $params_names = array(
4285
  if ( $required ) {
4286
  array_push($req_fields, $id1);
4287
  }
4288
+ $signature_tmp_resize_js .= '
4289
+ var $canvas_' . $id1 . ';
4290
+ var onResize_' . $id1 . ' = function(event) {
4291
+ $canvas_' . $id1 . ' = jQuery("#wdform_' . $id1 . '_element' . $form_id . '")[0];
4292
+ var signature_resize_check_interval_' . $id1 . '_' . $form_id . ' = setInterval(function() {
4293
  if ( $canvas_' . $id1 . ' && $canvas_' . $id1 . '.offsetWidth ) {
4294
+ var signs = jQuery("#signature-signs-wdform_' . $id1 . '_element' . $form_id . '").val();
4295
+ if(signs !== "") {
4296
+ signs = JSON.parse(signs);
4297
+ } else {
4298
+ signs = {};
4299
+ }
4300
  var ratio = Math.max(window.devicePixelRatio || 1, 1);
4301
  $canvas_' . $id1 . '.width = $canvas_' . $id1 . '.offsetWidth * ratio;
4302
  $canvas_' . $id1 . '.height = $canvas_' . $id1 . '.offsetHeight * ratio;
4303
  $canvas_' . $id1 . '.getContext("2d").scale(ratio, ratio);
4304
+ jQuery(".wdform_' . $id1 . '_signature-canvas-' . $form_id . '").signaturePad({displayOnly:true}).regenerate(signs);
4305
+ clearInterval(signature_resize_check_interval_' . $id1 . '_' . $form_id . ');
4306
  }
4307
+ },300)
4308
+ };';
4309
+ $signature_tmp_ready_js .= '
4310
+ window.addEventListener("orientationchange", onResize_' . $id1 . ', false);
4311
+ window.addEventListener("resize", onResize_' . $id1 . ', false);
4312
+ setTimeout(function(){ onResize_' . $id1 . '(); }, 300);
4313
+ jQuery(".wdform_' . $id1 . '_signature-canvas-' . $form_id . '").signaturePad({
4314
+ drawOnly: true,
4315
+ defaultAction: "drawIt",
4316
+ validateFields: false,
4317
+ lineWidth: 0,
4318
+ output: "",
4319
+ sigNav: null,
4320
+ name: null,
4321
+ typed: null,
4322
+ lineColour: "#000",
4323
+ penColour: "#000",
4324
+ clear: "#signature-clear-wdform_' . $id1 . '_element' . $form_id . '",
4325
+ typeIt: null,
4326
+ drawIt: null,
4327
+ typeItDesc: null,
4328
+ drawItDesc: null,
4329
+ onDrawEnd: function(){
4330
+ jQuery("#signature-file-wdform_' . $id1 . '_element' . $form_id . '").val(this.getSignatureImage());
4331
+ jQuery("#signature-signs-wdform_' . $id1 . '_element' . $form_id . '").val(JSON.stringify(this.getSignature()));
4332
+ }
4333
+ });
4334
+ ';
4335
  break;
4336
  }
4337
  }
4338
  }
4339
  }
4340
+ $signature_js = (!empty($signature_tmp_resize_js) && !empty($signature_tmp_ready_js) ) ? 'function fm_signature_init() { ' . $signature_tmp_resize_js . ' jQuery(document).ready(function() {' . $signature_tmp_ready_js . '}) }' : '';
4341
  $onsubmit_js .= '
4342
  var disabled_fields = "";
4343
  jQuery("#form' . $form_id . ' div[wdid]").each(function() {
4344
  if(jQuery(this).css("display") == "none") {
4345
+
4346
+ if( jQuery(this).children().first().attr("type") === "type_address" ) {
4347
+ var ids = get_adress_fields_ids( this );
4348
+ if( ids.length > 0 ) {
4349
+ disabled_fields += ids.join(",");
4350
+ disabled_fields += ",";
4351
+ }
4352
+ } else {
4353
+ disabled_fields += jQuery(this).attr("wdid");
4354
+ disabled_fields += ",";
4355
+ }
4356
+ } else if( jQuery(this).children().first().attr("type") === "type_address" ) {
4357
+ var ids = get_adress_fields_ids( this );
4358
+ if( ids.length > 0 ) {
4359
+ disabled_fields += ids.join(",");
4360
+ disabled_fields += ",";
4361
+ }
4362
  }
4363
  })
4364
  if(disabled_fields) {
4389
  var update_first_field_id<?php echo $form_id; ?> = <?php echo !empty($first_field_id[0]) ? $first_field_id[0] : 0; ?>;
4390
  var form_view_count<?php echo $form_id ?> = 0;
4391
  <?php echo preg_replace($pattern, ' ', $row->javascript); ?>
4392
+
4393
+ function get_adress_fields_ids( that ) {
4394
+ var id = jQuery(that).attr("wdid");
4395
+ var disabled = [];
4396
+ if( !jQuery(that).is(':visible') ) {
4397
+ for (var i = 0; i <= 5; i++) {
4398
+ var name = jQuery(that).find(".wdform_" + id + "_address_" + i).attr("name");
4399
+ if (typeof name !== "undefined") {
4400
+ var temp = name.split("_");
4401
+ disabled.push(temp[1]);
4402
+ }
4403
+ }
4404
+ } else {
4405
+ for (var i = 0; i <= 5; i++) {
4406
+ var field = jQuery(that).find(".wdform_" + id + "_address_" + i);
4407
+ if( !field.is(':visible') ) {
4408
+ var name = field.attr("name");
4409
+ if (typeof name !== "undefined") {
4410
+ var temp = name.split("_");
4411
+ disabled.push(temp[1]);
4412
+ }
4413
+ }
4414
+ }
4415
+ }
4416
+ return disabled;
4417
+ }
4418
+
4419
+
4420
  function onload_js<?php echo $form_id ?>() {<?php
4421
  echo $onload_js; ?>
4422
  }
4561
  ajax_similarity<?php echo $form_id ?>( ajaxObj<?php echo $form_id ?>, update_first_field_id<?php echo $form_id; ?> );
4562
  }
4563
  form_load_actions();
4564
+ <?php echo !empty($signature_js) ? 'fm_signature_init();' : ''; ?>
4565
  }
4566
  jQuery(function () {
4567
  fm_script_ready<?php echo $form_id ?>();
frontend/models/form_maker.php CHANGED
@@ -33,8 +33,8 @@ class FMModelForm_maker {
33
  }
34
 
35
  $row = WDW_FM_Library::convert_json_options_to_old( $row, 'form_options' );
36
-
37
- $form_preview = (WDW_FM_Library(self::PLUGIN)->get( 'wdform_id') == $id) ? TRUE : FALSE;
38
  if ( !$form_preview && !$row->published ) {
39
  // If the form has been unpublished.
40
  if ( current_user_can( 'manage_options' ) ) {
@@ -4239,7 +4239,7 @@ class FMModelForm_maker {
4239
  // PDF output for extension.
4240
  $pdf_data = array('attach_to_admin' => 0, 'attach_to_user' => 0, 'pdf_url' => '');
4241
  if ( WDFMInstance(self::PLUGIN)->is_free != 2 ) {
4242
- $pdf_data = apply_filters( 'fm_pdf_data_frontend', $pdf_data, array( 'attachment' => $attachment_user, 'custom_fields' => $this->custom_fields, 'form_id' => $id ) );
4243
  }
4244
  if ( $pdf_data['attach_to_user'] ) {
4245
  array_push( $attachment_user, $pdf_data['pdf_url'] );
@@ -4604,7 +4604,7 @@ class FMModelForm_maker {
4604
  * @param int $file_upload_link
4605
  * @return null|string $new_value
4606
  */
4607
- public static function custom_fields_mail( $type = '', $key = '', $id = 0, $attachment = array(), $form_currency = '', $file_upload_link = 0, $mail_mode = 1 ) {
4608
  $front_urls = WDFMInstance(self::PLUGIN)->get_front_urls();
4609
  $new_value = "";
4610
  if ( $type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_arithmetic_captcha" or $type != "type_recaptcha" or $type != "type_button" ) {
@@ -4627,6 +4627,17 @@ class FMModelForm_maker {
4627
  }
4628
  break;
4629
  }
 
 
 
 
 
 
 
 
 
 
 
4630
  case 'type_date_range' : {
4631
  $element0 = WDW_FM_Library(self::PLUGIN)->get( 'wdform_' . $key . "_element" . $id . "0", NULL, 'esc_html' );
4632
  $element1 = WDW_FM_Library(self::PLUGIN)->get( 'wdform_' . $key . "_element" . $id . "1", NULL, 'esc_html' );
33
  }
34
 
35
  $row = WDW_FM_Library::convert_json_options_to_old( $row, 'form_options' );
36
+ //we use current_id parameter on form submit with ajax
37
+ $form_preview = ( WDW_FM_Library(self::PLUGIN)->get('wdform_id') == $id || WDW_FM_Library(self::PLUGIN)->get('current_id') == $id ) ? TRUE : FALSE;
38
  if ( !$form_preview && !$row->published ) {
39
  // If the form has been unpublished.
40
  if ( current_user_can( 'manage_options' ) ) {
4239
  // PDF output for extension.
4240
  $pdf_data = array('attach_to_admin' => 0, 'attach_to_user' => 0, 'pdf_url' => '');
4241
  if ( WDFMInstance(self::PLUGIN)->is_free != 2 ) {
4242
+ $pdf_data = apply_filters( 'fm_pdf_data_frontend', $pdf_data, array( 'attachment' => $attachment_user, 'custom_fields' => $this->custom_fields, 'form_id' => $id, 'key_value_placeholders' => $key_value_placeholders ) );
4243
  }
4244
  if ( $pdf_data['attach_to_user'] ) {
4245
  array_push( $attachment_user, $pdf_data['pdf_url'] );
4604
  * @param int $file_upload_link
4605
  * @return null|string $new_value
4606
  */
4607
+ public static function custom_fields_mail( $type = '', $key = '', $id = 0, $attachment = array(), $form_currency = '', $file_upload_link = 0, $mail_mode = 1, $key_value_placeholders = array() ) {
4608
  $front_urls = WDFMInstance(self::PLUGIN)->get_front_urls();
4609
  $new_value = "";
4610
  if ( $type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_arithmetic_captcha" or $type != "type_recaptcha" or $type != "type_button" ) {
4627
  }
4628
  break;
4629
  }
4630
+ case "type_signature":
4631
+ {
4632
+ $element = WDW_FM_Library(self::PLUGIN)->get('wdform_' . $key . '_element' . $id, NULL, 'esc_html');
4633
+ if ( !empty($key_value_placeholders) && !empty($key_value_placeholders[$key]) ) {
4634
+ $new_value = '<img src="' . $key_value_placeholders[$key] . '">';
4635
+ }
4636
+ else {
4637
+ $new_value = '<img src="' . $element . '">';
4638
+ }
4639
+ break;
4640
+ }
4641
  case 'type_date_range' : {
4642
  $element0 = WDW_FM_Library(self::PLUGIN)->get( 'wdform_' . $key . "_element" . $id . "0", NULL, 'esc_html' );
4643
  $element1 = WDW_FM_Library(self::PLUGIN)->get( 'wdform_' . $key . "_element" . $id . "1", NULL, 'esc_html' );
frontend/views/form_maker.php CHANGED
@@ -2079,16 +2079,19 @@ class FMViewForm_maker {
2079
  }
2080
  else {
2081
  $onload_js .= '
 
 
 
 
 
 
2082
  if(' . $frequency . ' == 0){
2083
  localStorage.removeItem("hide-"+' . $id . ');
2084
  }
2085
  var hide_popover = localStorage.getItem("hide-"+' . $id . ');
2086
- if(hide_popover == null || fm_currentDate.getTime() >= hide_popover || ' . $show_for_admin . '){
2087
  setTimeout(function(){
2088
- jQuery("#fm-popover-background' . $id . '").css("display", "block");
2089
- jQuery("#fm-popover' . $id . '").css("visibility", "");
2090
- jQuery(".fm-popover-content").addClass("fm-animated ' . ($animate_effect) . '");
2091
- jQuery("#fm-popover' . $id . ' .fm-header-img").addClass("fm-animated ' . ($form->header_image_animation) . '");
2092
  }, ' . ($loading_delay * 1000) . ');
2093
  }';
2094
  }
@@ -4041,15 +4044,16 @@ class FMViewForm_maker {
4041
  }
4042
 
4043
  $param['id'] = $id1;
4044
- $param['w_class'] .= ' wd-flex-column wdform_signature wdform_signature-'. $param['id'];
4045
  $field_id = 'wdform_' . $param['id'] . '_element' . $form_id;
4046
 
4047
- $html = '<div class="wd-width-100 wdform_signature-canvas wdform_signature-canvas-' . $param['id'] . '">';
4048
- $html .= '<canvas id="' . $field_id . '" class="fm-signature fm-signature-' . $param['id'] . '" style="max-width: ' . $param['w_canvas_width'] . 'px; width:100%; height: ' . $param['w_canvas_height'] . 'px;"></canvas>';
4049
- $html .= '<input type="hidden" id="signature-file-' . $field_id . '" name="' . $field_id . '" class="fm-hide" />';
4050
- $html .= '<button id="signature-clear-' . $field_id . '" onclick="jQuery(\'#signature-file-' . $field_id . '\').val(\'\'); return false;">' . __('Clear', WDFMInstance(self::PLUGIN)->prefix) . '</button>';
 
4051
  $html .= '</div>';
4052
- // Generate field.
4053
  $rep = $this->wdform_field($type, $param, $row, $html);
4054
  return $rep;
4055
  }
2079
  }
2080
  else {
2081
  $onload_js .= '
2082
+ function show_popup_form_'. $id . '() {
2083
+ jQuery("#fm-popover-background' . $id . '").css("display", "block");
2084
+ jQuery("#fm-popover' . $id . '").css("visibility", "");
2085
+ jQuery(".fm-popover-content").addClass("fm-animated ' . ($animate_effect) . '");
2086
+ jQuery("#fm-popover' . $id . ' .fm-header-img").addClass("fm-animated ' . ($form->header_image_animation) . '");
2087
+ }
2088
  if(' . $frequency . ' == 0){
2089
  localStorage.removeItem("hide-"+' . $id . ');
2090
  }
2091
  var hide_popover = localStorage.getItem("hide-"+' . $id . ');
2092
+ if((hide_popover == null || fm_currentDate.getTime() >= hide_popover || ' . $show_for_admin . ') && ' . ((int)$form->popover_loading_delay >= 0 ? 'true' : 'false') . '){
2093
  setTimeout(function(){
2094
+ show_popup_form_'. $id . '()
 
 
 
2095
  }, ' . ($loading_delay * 1000) . ');
2096
  }';
2097
  }
4044
  }
4045
 
4046
  $param['id'] = $id1;
4047
+ $param['w_class'] .= ' wd-flex-column wdform_signature wdform_' . $param['id'] . '_signature-' . $form_id;
4048
  $field_id = 'wdform_' . $param['id'] . '_element' . $form_id;
4049
 
4050
+ $html = '<div class="wd-width-100 wdform_signature-canvas wdform_' . $param['id'] . '_signature-canvas-' . $form_id . '">';
4051
+ $html .= '<canvas id="' . $field_id . '" class="fm-signature fm-signature-' . $param['id'] . '" style="max-width: ' . $param['w_canvas_width'] . 'px; width:100%; height: ' . $param['w_canvas_height'] . 'px;"></canvas>';
4052
+ $html .= '<input type="hidden" id="signature-file-' . $field_id . '" name="' . $field_id . '" class="fm-hide" />';
4053
+ $html .= '<input type="hidden" id="signature-signs-' . $field_id . '" name="' . $field_id . '-signature" class="fm-hide" />';
4054
+ $html .= '<button id="signature-clear-' . $field_id . '" onclick="jQuery(\'#signature-file-' . $field_id . '\').val(\'\'); jQuery(\'#signature-signs-' . $field_id . '\').val(\'\'); return false;">' . __('Clear', WDFMInstance(self::PLUGIN)->prefix) . '</button>';
4055
  $html .= '</div>';
4056
+ // Generate field.
4057
  $rep = $this->wdform_field($type, $param, $row, $html);
4058
  return $rep;
4059
  }
js/main_div_front_end.js CHANGED
@@ -297,7 +297,6 @@ jQuery(document).on('change', '.wdform-element-section input[type="checkbox"],.w
297
  var getDataLimitText = jQuery(this).closest(".wdform-field").attr( "data-limit-text" );
298
  var countCheckedOptions = jQuery(this).closest(".wdform-element-section").find("input[type='checkbox']:checked").length;
299
  var findOtherField = jQuery(this).closest(".wdform-element-section").find(".other_input");
300
-
301
  if (countCheckedOptions > getDataLimit) {
302
  this.checked = false;
303
  if(this.getAttribute('other')==1) {
@@ -640,6 +639,9 @@ function fm_initilize_form(form_id) {
640
  }
641
  }
642
  });
 
 
 
643
  }
644
 
645
  function display_none_form_views_all(form_id) {
@@ -2226,6 +2228,10 @@ function fm_reset_form(form_id) {
2226
  jQuery('#wd_captcha_input'+form_id).val('');
2227
  case 'type_arithmetic_captcha':
2228
  jQuery('#wd_arithmetic_captcha_input'+form_id).val('');
 
 
 
 
2229
  break;
2230
  default:
2231
  break;
297
  var getDataLimitText = jQuery(this).closest(".wdform-field").attr( "data-limit-text" );
298
  var countCheckedOptions = jQuery(this).closest(".wdform-element-section").find("input[type='checkbox']:checked").length;
299
  var findOtherField = jQuery(this).closest(".wdform-element-section").find(".other_input");
 
300
  if (countCheckedOptions > getDataLimit) {
301
  this.checked = false;
302
  if(this.getAttribute('other')==1) {
639
  }
640
  }
641
  });
642
+ if ( jQuery("#form" + form_id + " div[type='type_signature']").length && typeof fm_signature_init != 'undefined' ) {
643
+ fm_signature_init();
644
+ }
645
  }
646
 
647
  function display_none_form_views_all(form_id) {
2228
  jQuery('#wd_captcha_input'+form_id).val('');
2229
  case 'type_arithmetic_captcha':
2230
  jQuery('#wd_arithmetic_captcha_input'+form_id).val('');
2231
+ case 'type_signature':
2232
+ jQuery('#signature-file-wdform_' + index + '_element' + form_id).val('');
2233
+ jQuery('#signature-signs-wdform_' + index + '_element' + form_id).val('');
2234
+ jQuery('#signature-clear-wdform_'+ index +'_element' + form_id).trigger('click');
2235
  break;
2236
  default:
2237
  break;
js/scripts.min.js CHANGED
@@ -1 +1 @@
1
- var fm_rated=!1;function form_load_actions(){jQuery(".wd-datepicker").each(function(){jQuery(this).datepicker(),jQuery(this).datepicker("option","dateFormat",jQuery(this).data("format"))});var e=jQuery(".fm-form").find(".fm-message");0!==e.length&&0==e.closest(".fm-popover-content").length&&0==e.closest(".fm-scrollbox-form").length&&0==e.closest(".fm-topbar").length&&(jQuery(window).scrollTop(jQuery(".fm-message").offset().top-100),-1<navigator.userAgent.toLowerCase().indexOf("safari/")&&(document.scrollingElement.scrollTop=jQuery(".fm-message").offset().top-100));if(0!==jQuery(".fm-form").find(".message_captcha").length){var t=jQuery(".fm-form").attr("name").split("form")[1];if(0!==jQuery("#form"+t+" .message_captcha").length){var i=jQuery(jQuery("#form"+t+" .message_captcha")).offset().top;jQuery(".fm-form").find(".message_captcha").parents(".wdform-field").find(".wdform-label").addClass("error_label"),jQuery("html").animate({scrollTop:i-150},500),document.scrollingElement.scrollTop=i-150}}}function set_total_value(form_id){var getDataHideCurreny=jQuery(".paypal_total"+form_id).parent().parent().attr("data-hide-currency");if("yes"==getDataHideCurreny)var toggle_currency="wd-hidden",FormCurrency="";else var toggle_currency="wd-inline-block",FormCurrency=window["FormCurrency_"+form_id]+" ";if(0!=jQuery(".paypal_total"+form_id).length){var div_paypal_show=jQuery(".paypal_total"+form_id),div_paypal_products=jQuery(".paypal_products"+form_id),div_paypal_tax=jQuery(".paypal_tax"+form_id),input_paypal_total=jQuery(".input_paypal_total"+form_id),total=0,total_shipping=0;div_paypal_products.html(""),div_paypal_tax.html(""),n=parseInt(jQuery("#counter"+form_id).val()),jQuery("#form"+form_id+" div[type='type_paypal_checkbox'], #form"+form_id+" div[type='type_paypal_radio']").each(function(){var e=jQuery(this).parent();if("none"!=e.css("display")){var t=e.attr("wdid");paypal_checkbox_qty=jQuery("#wdform_"+t+"_element_quantity"+form_id).val()?jQuery("#wdform_"+t+"_element_quantity"+form_id).val():0,jQuery(this).find("input:checked").each(function(){label=jQuery("label[for='"+jQuery(this).attr("id")+"']").html(),span_value='<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+jQuery(this).val()+(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?" x "+paypal_checkbox_qty:""),total+=jQuery(this).val()*parseInt(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?paypal_checkbox_qty:1),div_paypal_products.html(div_paypal_products.html()+"<div>"+label+" - "+span_value+"</div>")})}}),jQuery("#form"+form_id+" div[type='type_paypal_shipping']").each(function(){var e=jQuery(this).parent();if("none"!=e.css("display")){var t=e.attr("wdid");paypal_shipping_qty=jQuery("#wdform_"+t+"_element_quantity"+form_id).val()?jQuery("#wdform_"+t+"_element_quantity"+form_id).val():0,jQuery(this).find("input:checked").each(function(){label=jQuery("label[for='"+jQuery(this).attr("id")+"']").html(),span_value='<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+jQuery(this).val()+(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?" x "+paypal_shipping_qty:""),total_shipping+=jQuery(this).val()*parseInt(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?paypal_shipping_qty:1),div_paypal_products.html(div_paypal_products.html()+"<div>"+label+" - "+span_value+"</div>")})}}),jQuery("#form"+form_id+" div[type='type_paypal_select']").each(function(){var e=jQuery(this).parent();if("none"!=e.css("display")){var t=e.attr("wdid");paypal_select_qty=jQuery("#wdform_"+t+"_element_quantity"+form_id).val()?jQuery("#wdform_"+t+"_element_quantity"+form_id).val():0,""!=jQuery(this).find("select").val()&&(label=jQuery(this).find("select option:selected").html(),span_value='<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+jQuery(this).find("select").val()+(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?" x "+paypal_select_qty:""),total+=jQuery(this).find("select").val()*parseInt(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?paypal_select_qty:1),div_paypal_products.html(div_paypal_products.html()+"<div>"+label+" - "+span_value+"</div>"))}}),jQuery("#form"+form_id+" div[type='type_paypal_price']").each(function(){var e=jQuery(this).parent();if("none"!=e.css("display")){var t=e.attr("wdid");label=jQuery(this).find(".wdform-label").html(),cents="00",dollars="0",""!=jQuery("#wdform_"+t+"_element_dollars"+form_id).val()&&(dollars=jQuery("#wdform_"+t+"_element_dollars"+form_id).val()),""!=jQuery("#wdform_"+t+"_element_cents"+form_id).val()&&(1==jQuery("#wdform_"+t+"_element_cents"+form_id).val().length?cents="0"+jQuery("#wdform_"+t+"_element_cents"+form_id).val():cents=jQuery("#wdform_"+t+"_element_cents"+form_id).val(),span_value='<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+dollars+"."+cents,total+=parseFloat(dollars+"."+cents),div_paypal_products.html(div_paypal_products.html()+"<div>"+label+" - "+span_value+"</div>"))}}),jQuery("#form"+form_id+" div[type='type_paypal_price_new']").each(function(){var e=jQuery(this).parent();if("none"!=e.css("display")){var t=e.attr("wdid");label=jQuery(this).find(".wdform-label").html(),dollars="0",""!=jQuery("#wdform_"+t+"_element"+form_id).val()&&(dollars=jQuery("#wdform_"+t+"_element"+form_id).val()),span_value='<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+dollars,total+=parseFloat(dollars),div_paypal_products.html(div_paypal_products.html()+"<div>"+label+" - "+span_value+"</div>")}});var FormPaypalTax=eval("FormPaypalTax_"+form_id);0!=FormPaypalTax&&div_paypal_tax.html("Tax: "+FormCurrency+(total*FormPaypalTax/100).toFixed(2)),jQuery(".div_total"+form_id).html('<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+(parseFloat((total*(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2)),input_paypal_total.val(FormCurrency+(parseFloat((total*(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2))}}function check_isnum_or_minus(e){var t=e.which||e.keyCode;return!(45!=t&&31<t&&(t<48||57<t))}function sum_grading_values(e,t){for(var i=0,r=0;r<100;r++)document.getElementById(e+"_element"+t+"_"+r)&&document.getElementById(e+"_element"+t+"_"+r).value&&(i+=parseInt(document.getElementById(e+"_element"+t+"_"+r).value)),document.getElementById(e+"_total_element"+t)&&(i>document.getElementById(e+"_total_element"+t).innerHTML?document.getElementById(e+"_text_element"+t).innerHTML=" "+fm_objectL10n.fm_grading_text+" "+document.getElementById(e+"_total_element"+t).innerHTML:document.getElementById(e+"_text_element"+t).innerHTML="");document.getElementById(e+"_sum_element"+t)&&(document.getElementById(e+"_sum_element"+t).innerHTML=i)}function change_src(e,t,i,r){if(0==fm_rated)for(var a=0;a<=e;a++)document.getElementById(t+"_star_"+a+"_"+i).src=fm_objectL10n.plugin_url+"/images/star_"+r+".png"}function reset_src(e,t,i){if(0==fm_rated)for(var r=0;r<=e;r++)document.getElementById(t+"_star_"+r+"_"+i).src=fm_objectL10n.plugin_url+"/images/star.png"}function select_star_rating(e,t,i,r,a){fm_rated=!0;for(var n=0;n<=e;n++)document.getElementById(t+"_star_"+n+"_"+i).src=fm_objectL10n.plugin_url+"/images/star_"+r+".png";for(var o=e+1;o<=a-1;o++)document.getElementById(t+"_star_"+o+"_"+i).src=fm_objectL10n.plugin_url+"/images/star.png";document.getElementById(t+"_selected_star_amount"+i).value=e+1,jQuery("#"+t+"_selected_star_amount"+i).trigger("change")}function show_other_input(e,t){var i=jQuery(".form"+t+" [id^="+e+"_element"+t+'][other="1"]').parent(),r=document.createElement("br");r.setAttribute("id",e+"_other_br"+t);var a=e.split("_")[1],n=document.createElement("input");n.setAttribute("id",e+"_other_input"+t),n.setAttribute("name",e+"_other_input"+t),n.setAttribute("type","text"),n.setAttribute("class","other_input"),n.setAttribute("onchange","other_input_change(this, '"+t+"', '"+a+"')"),i.children("input").length<2&&(i.append(r),i.append(n))}function other_input_change(e,t,i){""==jQuery(e).val()?wd_is_filled(t,i):(jQuery("#form"+t+" #wd_required_"+i).remove(),jQuery("#form"+t+" div[wdid='"+i+"'] .wdform-label-section:first .error_label").removeClass("error_label"))}function check_isnum(e){var t=e.which||e.keyCode;return-1!=jQuery.inArray(t,[46,8,9,27,13,190])||!0===e.ctrlKey||35<=t&&t<39||45==t||!(31<t&&(t<48||57<t))}function captcha_refresh(e,t){srcArr=document.getElementById(e+t).src.split("&r="),document.getElementById(e+t).src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_input"+t).value="",document.getElementById(e+t).style.display="inline-block"}function set_checked(e,t,i){return checking=document.getElementById(e+"_element"+i+t),!(checking.getAttribute("other")&&1==checking.getAttribute("other")&&!checking.checked)||(document.getElementById(e+"_other_input"+i)&&(document.getElementById(e+"_other_input"+i).parentNode.removeChild(document.getElementById(e+"_other_br"+i)),document.getElementById(e+"_other_input"+i).parentNode.removeChild(document.getElementById(e+"_other_input"+i))),!1)}function set_default(e,t,i){document.getElementById(e+"_other_input"+i)&&(document.getElementById(e+"_other_input"+i).parentNode.removeChild(document.getElementById(e+"_other_br"+i)),document.getElementById(e+"_other_input"+i).parentNode.removeChild(document.getElementById(e+"_other_input"+i)))}function add_0(e){1==jQuery(e).val().length&&jQuery(e).val("0"+jQuery(e).val())}function wd_validate(e,t){if(!jQuery(e).is("input"))return!0;var i,r,a,n=jQuery(e).val(),o=(jQuery(e).attr("id"),jQuery(e).parent().find(".hidden_date")),d=jQuery(e).data("valid-type"),l=jQuery(e).data("form-id"),s=jQuery(e).data("wdid"),u=o.data("format"),c=new Date(o.data("min")),m=new Date(o.data("max")),_=parseInt(jQuery(e).attr("from")),f=parseInt(jQuery(e).attr("to"));if(void 0===t)t=jQuery(e).data("addiotional-fields");var p="#form"+l+" div[wdid='"+s+"']",y=jQuery(p+" .wdform-label-section:first .wdform-label"),h=jQuery(p+" .wdform-element-section");switch(d){case"hour24":i=fm_objectL10n.time_validation,a=/^(0?[0-1]?[0-9]|2[0-3])?$/;break;case"hour12":i=fm_objectL10n.time_validation,a=/^(0?[0-9]|1[0-2])?$/;break;case"minute":case"second":i=fm_objectL10n.time_validation,a=/^([0-5]?[0-9])?$/;break;case"number":i=fm_objectL10n.number_validation,a=/^\-{0,1}\d+(.\d+){0,1}$/;break;case"quantity":i=fm_objectL10n.number_validation,a=/^[+]?\d+([.]\d+)?$/;break;case"day":i=fm_objectL10n.date_validation,a=/^(0?[0-2]?[0-9]|3[0-1])?$/;break;case"month":i=fm_objectL10n.date_validation,a=/^(0?[0-9]|1[0-2])?$/;break;case"year":i=fm_objectL10n.date_validation,a=/^([1-2]?[0-9]?[0-9]?[0-9])?$/;break;case"date":a="mm/dd/yy"==u?(i=fm_objectL10n.date_validation,/^(0[1-9]|1[0-2])\/(0[1-9]|[1-2][0-9]|3[01])\/\d{4}$/):(i="",/^$/)}if(r=a.test(n),""!=n&&"mm/dd/yy"==u||(r=!0),r)for(var v in t)if(!(r=wd_validate("#"+t[v],"")))break;return"year"==d&&(parseInt(n)<_||parseInt(n)>f)&&(r=!1,i=fm_objectL10n.year_validation.replace("%%start%%",_).replace("%%end%%",f)),"date"==d&&(new Date(n)<c||new Date(n)>m)&&(r=!1,i=fm_objectL10n.date_validation),jQuery("#check_email_"+s+"_"+l).remove(),r?(y.removeClass("wd-error-label"),delete window["check_before_submit"+l][s+"_"+l]):(h.parent().parent().append("<div id='check_email_"+s+"_"+l+"' class='fm-not-filled'>"+i+"</div>"),y.addClass("wd-error-label"),window["check_before_submit"+l][s+"_"+l]=!1),r}function check_isnum_interval(e,t,i,r){var a=e.which||e.keyCode;return-1!=jQuery.inArray(a,[46,8,9,27,13,190])||!0===e.ctrlKey||35<=a&&a<39||!(31<a&&(a<48||57<a))&&(val1=""+jQuery(t).val()+String.fromCharCode(a),!(2<val1.length)&&("00"!=val1&&!(val1<i||val1>r)))}function destroyChildren(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function generate_page_nav(e,t,i){var r;if(form_view=e,page_nav=document.getElementById(t+"page_nav"+e),destroyChildren(page_nav),form_view_elemet=document.getElementById(t+"form_view"+e),remove_whitespace(form_view_elemet.parentNode.parentNode),display_none_form_views_all(t),form_view_elemet.parentNode.style.display="",(r=document.createElement("div")).setAttribute("valign","middle"),r.setAttribute("align","left"),r.style.display="table-cell",r.style.width="40%",page_nav.appendChild(r),form_view_elemet.parentNode.previousSibling&&-1!=form_view_elemet.parentNode.previousSibling.className.indexOf("wdform-page-and-images")&&form_view_elemet.parentNode.previousSibling.previousSibling&&("DIV"==form_view_elemet.parentNode.previousSibling.tagName?table=form_view_elemet.parentNode.previousSibling:"DIV"==form_view_elemet.parentNode.previousSibling.previousSibling.tagName?table=form_view_elemet.parentNode.previousSibling.previousSibling:table="none","none"!=table&&(table.firstChild.tagName||table.removeChild(table.firstChild),previous_title=form_view_elemet.getAttribute("previous_title"),previous_type=form_view_elemet.getAttribute("previous_type"),"text"==previous_type&&r.setAttribute("class","previous-page"),previous_class=form_view_elemet.getAttribute("previous_class"),previous_checkable=form_view_elemet.getAttribute("previous_checkable"),next_or_previous="previous",previous=make_pagebreak_button(next_or_previous,previous_title,previous_type,previous_class,previous_checkable,e,t,i),r.appendChild(previous))),(r=document.createElement("div")).setAttribute("id",t+"page_numbers"+form_view),r.setAttribute("valign","middle"),r.setAttribute("class","page-numbers"),r.setAttribute("align","center"),r.style.display="table-cell","true"==document.getElementById("fm-pages"+t).getAttribute("show_numbers")){var a=document.createElement("span");a.setAttribute("class","page_numbers"),r.appendChild(a)}page_nav.appendChild(r),(r=document.createElement("div")).setAttribute("valign","middle"),r.setAttribute("align","right"),r.style.cssText="display:table-cell; width:40%; text-align:right;",page_nav.appendChild(r),not_next=!1,form_view_elemet.parentNode.nextSibling?("DIV"==form_view_elemet.parentNode.nextSibling.tagName&&-1!=form_view_elemet.parentNode.nextSibling.className.indexOf("wdform-page-and-images")?table=form_view_elemet.parentNode.nextSibling:form_view_elemet.parentNode.nextSibling.nextSibling&&"DIV"==form_view_elemet.parentNode.nextSibling.nextSibling.tagName?table=form_view_elemet.parentNode.nextSibling.nextSibling:table="none","none"!=table?(next_title=form_view_elemet.getAttribute("next_title"),next_type=form_view_elemet.getAttribute("next_type"),"text"==next_type&&r.setAttribute("class","next-page"),next_class=form_view_elemet.getAttribute("next_class"),next_checkable=form_view_elemet.getAttribute("next_checkable"),next_or_previous="next",next=make_pagebreak_button(next_or_previous,next_title,next_type,next_class,next_checkable,e,t,i),r.appendChild(next)):not_next=!0):not_next=!0,generate_page_bar(e,t,i),fm_initilize_form(t)}function fm_initilize_form(e){jQuery("#form"+e+" div[type='type_map']").each(function(){for(id=jQuery(this).parent().attr("wdid"),if_gmap_init("wdform_"+id,e),q=0;q<20;q++)jQuery("#wdform_"+id+"_element"+e)[0].getAttribute("long"+q)&&(w_long=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("long"+q)),w_lat=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("lat"+q)),w_info=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("info"+q)),add_marker_on_map("wdform_"+id,q,w_long,w_lat,w_info,e,!1))}),jQuery("#form"+e+" div[type='type_mark_map']").each(function(){id=jQuery(this).parent().attr("wdid"),if_gmap_init("wdform_"+id,e),q=0,jQuery("#wdform_"+id+"_element"+e)[0].getAttribute("long"+q)&&(w_long=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("long"+q)),w_lat=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("lat"+q)),w_info=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("info"+q)),add_marker_on_map("wdform_"+id,q,w_long,w_lat,w_info,e,!0))}),jQuery(".wdform-element-section").each(function(){if("type_stripe"==jQuery(this).parent().attr("type")){jQuery(this).parent().parent().find(".stripe_more_info .wdform-label-section").removeClass("wd-hidden");return!0}jQuery(this).parent()[0].style.width||0==parseInt(jQuery(this).width())||0==jQuery(this).parent().find(jQuery(".wdform-label-section")).length||"table-cell"==jQuery(this).css("display")&&("type_captcha"!=jQuery(this).parent().attr("type")?jQuery(this).parent().css("width",parseInt(jQuery(this).width())+parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15):jQuery(this).parent().css("width",2*parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width)+50+parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15))})}function display_none_form_views_all(e){jQuery("#form"+e+" .wdform-page-and-images").css("display","none")}function generate_page_bar(t,i,e){if("steps"==document.getElementById("fm-pages"+i).getAttribute("type")?make_page_steps_front(t,i,e):"percentage"==document.getElementById("fm-pages"+i).getAttribute("type")?make_page_percentage_front(t,i,e):make_page_none_front(i),"true"==document.getElementById("fm-pages"+i).getAttribute("show_numbers")){if(td=document.getElementById(i+"page_numbers"+t),td){destroyChildren(td);var r=0,a=0;jQuery("#form"+i+" .wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id");j=e.split("form_view")[1],document.getElementById(i+"form_view"+j)&&(r++,j==t&&(a=r))});var n=document.createElement("span");n.setAttribute("class","page_numbers"),n.innerHTML=a+"/"+r,td.appendChild(n)}}else td=document.getElementById(i+"page_numbers"+t),td&&destroyChildren(document.getElementById(i+"page_numbers"+t))}function make_page_steps_front(t,i,r){destroyChildren(document.getElementById("fm-pages"+i)),show_title="true"==document.getElementById("fm-pages"+i).getAttribute("show_title"),next_checkable="true"==document.getElementById(i+"form_view"+t).getAttribute("next_checkable"),previous_checkable="true"==document.getElementById(i+"form_view"+t).getAttribute("previous_checkable"),k=0,jQuery("#form"+i+" .wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id");j=e.split("form_view")[1],document.getElementById(i+"form_view"+j)&&(document.getElementById(i+"form_view"+j).getAttribute("page_title")?w_pages=document.getElementById(i+"form_view"+j).getAttribute("page_title"):w_pages="",k++,page_number=document.createElement("span"),page_number.setAttribute("id","page_"+j),j<t&&(previous_checkable?page_number.setAttribute("onClick","if(fm_check("+t+", "+i+', false)) generate_page_nav("'+j+'", "'+i+'", "'+r+'")'):page_number.setAttribute("onClick",'generate_page_nav("'+j+'", "'+i+'", "'+r+'")')),j>t&&(next_checkable?page_number.setAttribute("onClick","if(fm_check("+t+", "+i+', false)) generate_page_nav("'+j+'", "'+i+'", "'+r+'")'):page_number.setAttribute("onClick",'generate_page_nav("'+j+'", "'+i+'", "'+r+'")')),j==t?page_number.setAttribute("class","page_active"):page_number.setAttribute("class","page_deactive"),show_title?page_number.innerHTML=w_pages:page_number.innerHTML=k,document.getElementById("fm-pages"+i).appendChild(page_number))})}function make_page_percentage_front(t,i,e){destroyChildren(document.getElementById("fm-pages"+i)),show_title="true"==document.getElementById("fm-pages"+i).getAttribute("show_title");var r=document.createElement("div");r.setAttribute("class","page_percentage_deactive");var a=document.createElement("div");a.setAttribute("id","div_percentage"),a.setAttribute("class","page_percentage_active"),a.setAttribute("align","right");var n=document.createElement("div");n.setAttribute("class","wdform_percentage_arrow");var o=document.createElement("b");o.setAttribute("class","wdform_percentage_text"),a.appendChild(o),k=0,cur_page_title="",jQuery(".form"+i+" .wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id");j=e.split("form_view")[1],document.getElementById(i+"form_view"+j)&&(document.getElementById(i+"form_view"+j).getAttribute("page_title")?w_pages=document.getElementById(i+"form_view"+j).getAttribute("page_title"):w_pages="",k++,j==t&&(show_title&&(cur_page_title=document.createElement("div"),cur_page_title.innerHTML=w_pages,cur_page_title.innerHTML=w_pages,cur_page_title.setAttribute("class","wdform_percentage_title")),page_number=k))}),o.innerHTML=Math.round((page_number-1)/(k-1)*100)+"%",a.style.width=(page_number-1)/(k-1)*100+"%",1==page_number&&(n.style.display="none"),r.appendChild(a),r.appendChild(n),cur_page_title&&r.appendChild(cur_page_title),document.getElementById("fm-pages"+i).appendChild(r)}function make_page_none_front(e){destroyChildren(document.getElementById("fm-pages"+e))}function make_pagebreak_button(e,t,i,r,a,n,o,d){switch(i){case"text":return(l=document.createElement("div")).setAttribute("id","page_"+e+"_"+n+"_"+o),l.setAttribute("class",r),"true"==a?l.setAttribute("onClick","if(fm_check("+n+", "+o+", false)) page_"+e+"("+n+","+o+","+d+")"):l.setAttribute("onClick","page_"+e+"("+n+","+o+","+d+")"),l.innerHTML=t,l;case"img":var l;return(l=document.createElement("img")).setAttribute("id","page_"+e+"_"+n),l.setAttribute("class",r),"true"==a?l.setAttribute("onClick","if(fm_check("+n+", "+o+", false)) page_"+e+"("+n+","+o+","+d+")"):l.setAttribute("onClick","page_"+e+"("+n+","+o+","+d+")"),0==t.indexOf("http")?l.src=t:l.src=fm_objectL10n.plugin_url+"/"+t,l}}function form_maker_findPos(e){var t=0;if(e.offsetParent){for(;t+=e.offsetTop,e=e.offsetParent;);return[t]}}function page_previous(e,t,i){form_view_elemet=document.getElementById(t+"form_view"+e),form_view_elemet.parentNode.previousSibling&&form_view_elemet.parentNode.previousSibling.previousSibling&&("DIV"==form_view_elemet.parentNode.previousSibling.tagName?table=form_view_elemet.parentNode.previousSibling:table=form_view_elemet.parentNode.previousSibling.previousSibling),table.firstChild.tagName||table.removeChild(table.firstChild),generate_page_nav(table.firstChild.id.replace(t+"form_view",""),t,i),form=jQuery("#form"+t),form.parent().hasClass("fm-scrollbox-form")||(jQuery("html").animate({scrollTop:form.offset().top-150},500),document.scrollingElement.scrollTop=form.offset().top-150)}function page_next(e,t,i){form_view_elemet=document.getElementById(t+"form_view"+e),form_view_elemet.parentNode.nextSibling&&("DIV"==form_view_elemet.parentNode.nextSibling.tagName?table=form_view_elemet.parentNode.nextSibling:table=form_view_elemet.parentNode.nextSibling.nextSibling),table.firstChild.tagName||table.removeChild(table.firstChild),generate_page_nav(table.firstChild.id.replace(t+"form_view",""),t,i),form=jQuery("#form"+t),form.parent().hasClass("fm-scrollbox-form")||(jQuery("html").animate({scrollTop:form.offset().top-150},500),document.scrollingElement.scrollTop=form.offset().top-150)}function fm_go_to_page(e,t,i){form_view_elemet=document.getElementById(t+"form_view"+e),table=form_view_elemet.parentNode,table.firstChild.tagName||table.removeChild(table.firstChild),generate_page_nav(table.firstChild.id.replace(t+"form_view",""),t,i),form=jQuery("#form"+t),form.parent().hasClass("fm-scrollbox-form")||(jQuery("html").animate({scrollTop:form.offset().top-150},500),document.scrollingElement.scrollTop=form.offset().top-150)}function getfileextension(e,t){if(void 0===e||0==e.length)return!0;var i=e.lastIndexOf("."),r=e.substr(i+1,e.length);t=t.split(",");for(var a=0;a<t.length;a++)if(t[a]=t[a].replace(/\./g,""),t[a]=t[a].replace(/ /g,""),r.toLowerCase()==t[a].toLowerCase())return!0;return!1}function reselect(e,t){t=void 0!==t?t:"",jQuery(e).wrap('<div class="sel-wrap '+t+'"/>');var i="",r=!1;jQuery(e).children("option").each(function(){jQuery(this).is(":selected")&&(r=jQuery(this).index()),i=i+'<div class="sel-option" value="'+jQuery(this).val()+'">'+jQuery(this).html()+"</div>"}),w=jQuery(e)[0].style.width,"100%"==w?w="100%":w=jQuery(e).width()+32+"px";var a='<div class="sel-imul" style="width:'+w+'"> <div class="sel-selected"> <div class="selected-text">'+jQuery(e).children("option").eq(r).html()+'</div> <div class="sel-arraw"></div> </div> <div class="sel-options">'+i+"</div> </div>";jQuery(e).addClass("no-width"),jQuery(e).before(a)}jQuery(window).on("load",function(){0<jQuery(".g-recaptcha").length&&1!=jQuery(".g-recaptcha").data("render")&&fmRecaptchaInit(0),validate_received_data_from_url(),jQuery(".submissions").length&&jQuery(".submissions td").each(function(){"0"==jQuery(this).data("status")&&jQuery(this).parent().hide()})}),jQuery(document).on("change",'.wdform-element-section input[type="checkbox"],.wdform-element-section input[type="radio"], .wdform-quantity',function(){var e=jQuery(this).closest(".wdform-field").attr("data-limit"),t=jQuery(this).closest(".wdform-field").attr("data-limit-text"),i=jQuery(this).closest(".wdform-element-section").find("input[type='checkbox']:checked").length,r=jQuery(this).closest(".wdform-element-section").find(".other_input");e<i?(this.checked=!1,1==this.getAttribute("other")&&(i.checked||r&&(r.prev("br").remove(),r.remove())),jQuery(this).closest(".wdform-field").find(".wdform-label").addClass("error_label"),0==jQuery(".fm-error").length&&jQuery(this).closest(".wdform_row").append("<div class='fm-error'>"+t+"</div>")):(jQuery(this).closest(".wdform-field").find(".wdform-label").removeClass("error_label"),jQuery(".fm-error").remove())}),jQuery(document).on("change",".wdform-element-section select",function(){var e=jQuery(this).children("option:selected").text();jQuery(this).parent(".sel-wrap ").children(".sel-imul").children(".sel-selected").children(".selected-text").html(e),jQuery(this).parent(".sel-wrap ").children(".sel-imul").children(".sel-options").children(".sel-option").removeClass("sel-ed"),jQuery(this).addClass("sel-ed"),jQuery(this).parent(".sel-wrap ").children(".sel-imul").children(".sel-options").each(function(){jQuery(this).html()==e&&jQuery(this).addClass("sel-ed")})}),jQuery(document).on("change",'div[type="type_date_fields"]',function(){2<jQuery(this).find("select.sel-ed").length&&(jQuery(this).next(".fm-not-valid-date, .fm-not-filled").remove(),jQuery(this).find(".wdform-label").removeClass("error_label"))}),jQuery(document).on("click",".sel-imul",function(){jQuery(".sel-imul").removeClass("act"),jQuery(this).addClass("act"),jQuery(this).children(".sel-options").is(":visible")?jQuery(".sel-options").hide():(jQuery(".sel-options").hide(),jQuery(this).children(".sel-options").show(),jQuery(this).children(".sel-options").css("width",jQuery(this).width()))}),jQuery(document).on("click",".sel-option",function(){var e=jQuery(this).html();jQuery(this).parent(".sel-options").parent(".sel-imul").children(".sel-selected").children(".selected-text").html(e),jQuery(this).parent(".sel-options").children(".sel-option").removeClass("sel-ed"),jQuery(this).addClass("sel-ed");var t=jQuery(this).attr("value");t=void 0!==t?t:e,jQuery(this).parent(".sel-options").parent(".sel-imul").parent(".sel-wrap").children("select").children("option").prop("selected",!1).each(function(){jQuery(this).html()==e&&jQuery(this).attr("selected","select")}),jQuery(this).parent(".sel-options").parent(".sel-imul").parent(".sel-wrap").children("select").change()});var selenter=!1;function remove_whitespace(e){var t;for(t=0;t<e.childNodes.length;t++)e.childNodes[t]&&"3"==e.childNodes[t].nodeType&&!/\S/.test(e.childNodes[t].nodeValue)?(e.removeChild(e.childNodes[t]),t--):e.childNodes[t].childNodes.length&&remove_whitespace(e.childNodes[t])}function change_value_range(e,t,i,r,a){i?jQuery("#"+e).datepicker("option",t,i):"today"==r?jQuery("#"+e).datepicker("option",t,new Date):(-1==r.indexOf("d")&&-1==r.indexOf("m")&&-1==r.indexOf("y")&&-1==r.indexOf("w")&&""!=r&&(r=jQuery.datepicker.formatDate(a,new Date(r))),jQuery("#"+e).datepicker("option",t,r))}function wd_check_confirmation_email(e,t,i,r){var a=jQuery("#wdform_"+e+"_element"+t),n=jQuery("#wdform_"+e+"_1_element"+t);0==window["check_before_submit"+t][e+"_"+t]||jQuery(a).val()!=jQuery(n).val()?(jQuery("#confirm_"+e+"_"+t).remove(),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm"),jQuery(a).val()!=jQuery(n).val()&&(jQuery(n).parent().parent().parent().append("<div id='confirm_"+e+"_"+t+"' class='fm-not-filled'>"+i+"</div>"),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_confirm")),window["check_before_submit"+t][e+"_"+t]=!(e+"_"+t in window["check_before_submit"+t])||window["check_before_submit"+t][e+"_"+t]):(jQuery("#confirm_"+e+"_"+t).remove(),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm"),1==window["check_before_submit"+t][e+"_"+t]&&delete window["check_before_submit"+t][e+"_"+t])}function wd_check_email(e,t,i){var r=jQuery("#wdform_"+e+"_element"+t),a=jQuery("#wdform_"+e+"_1_element"+t);if(""==jQuery(r).val()||/^[\u0400-\u04FFa-zA-Z0-9'.+_-]+@[\u0400-\u04FFa-zA-Z0-9.-]+\.[\u0400-\u04FFa-zA-Z]{2,61}$/.test(jQuery.trim(jQuery(r).val()))||jQuery(r).attr("title")==jQuery(r).val())jQuery("#check_email_"+e+"_"+t).remove(),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:first .error_label_check_mail").removeClass("error_label_check_mail"),window["check_before_submit"+t][e+"_"+t]=!0,void 0===a.val()&&delete window["check_before_submit"+t][e+"_"+t];else{jQuery("#check_email_"+e+"_"+t).remove();var n=jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:first"),o=0;n.hasClass("wd-width-30")&&!n.hasClass("wd-hidden")&&(o=n.width()),jQuery(r).parent().parent().parent().append("<div id='check_email_"+e+"_"+t+"' class='fm-not-filled' style='margin-left: "+o+"px'>"+i+"</div>"),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_check_mail"),r.val()==a.val()&&(jQuery("#confirm_"+e+"_"+t).remove(),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm")),delete window["check_before_submit"+t][e+"_"+t],window["check_before_submit"+t][e+"_"+t]=!1}}function wd_check_confirmation_pass(e,t,i){var r,a=jQuery("#wdform_"+e+"_element"+t),n=jQuery("#wdform_"+e+"_1_element"+t);r=a.val()!==n.val();var o=jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:first"),d=0;o.hasClass("wd-width-30")&&!o.hasClass("wd-hidden")&&(d=o.width()),r?(jQuery("#confirm_"+e+"_"+t).remove(),jQuery(n).parent().parent().parent().append("<div id='confirm_"+e+"_"+t+"' class='fm-not-filled' style='margin-left: "+d+"px'>"+i+"</div>"),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_check_pass"),window["check_before_submit"+t][e+"_"+t]=!1):(jQuery("#confirm_"+e+"_"+t).remove(),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .error_label_check_pass").removeClass("error_label_check_pass"),delete window["check_before_submit"+t][e+"_"+t])}function minimize_form(e){jQuery("#fm-scrollbox"+e).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown fm-minimized"),jQuery("#fm-minimize-text"+e).removeClass("fm-animated fadeOutDown").addClass("fm-show fm-animated fadeInUp")}function fm_show_scrollbox(e){jQuery("#fm-minimize-text"+e).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown"),jQuery("#fm-scrollbox"+e).removeClass("fm-animated fadeOutDown fm-minimized").addClass("fm-show fm-animated fadeInUp")}function fm_hide_form(e,t,i){var r=new Date;r.setDate(r.getDate()+t),0<t&&localStorage.setItem("hide-"+e,r.getTime()),"function"==typeof i&&i()}function wd_check_regExp(o,d){var l=jQuery("#form"+o),s=!1,e=d||window["check_regExp_all"+o];return jQuery.each(e,function(e,t){var i="#wdform_"+e+"_element"+o,r="",a=unescape(t[0]),n=l.find(jQuery("div[wdid='"+e+"']"));r=t[1].length<=0?new RegExp(a):new RegExp(a,t[1]),0!=l.find(jQuery("div[wdid='"+e+"']")).length&&"none"!=l.find(jQuery("div[wdid='"+e+"']")).css("display")&&(jQuery("#form"+o+" #wd_exp_"+e).remove(),""==jQuery(i).val()&&0==n.find(".wdform-required").length?(s=!0,l.find(jQuery("div[wdid='"+e+"'] .wdform-element-section")).parent().parent().append("<div id='wd_exp_"+e+"' class='fm-not-filled'>"+t[2]+"</div>"),jQuery("#form"+o+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_exp"),scroll_on_element(o)):jQuery(i).val()!=jQuery(i).attr("title")&&1!=r.test(jQuery(i).val())&&(l.find(jQuery("div[wdid='"+e+"'] .wdform-element-section")).parent().parent().append("<div id='wd_exp_"+e+"' class='fm-not-filled'>"+t[2]+"</div>"),jQuery("#form"+o+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_exp"),s=!0,d||scroll_on_element(o)))}),!1===s}function scroll_on_element(e){if(0==jQuery("#form"+e+" .fm-not-filled").length)return!0;var t=!0;0==jQuery("#fm_shake"+e).val()&&(t=!1);var i=jQuery("#form"+e+" .fm-not-filled").closest(".wdform_row"),r=i.closest(".wdform_page");if("none"==r.parent().css("display")){var a=jQuery("#form"+e+" .wdform-page-and-images").length,n=jQuery("#form"+e+" .wdform_page").last().attr("id");n=n.split("form_view");var o=r.attr("id");fm_go_to_page(o=o.split("form_view")[1],e,a,n[1])}var d=jQuery(document).scrollTop(),l=document.body.clientHeight,s=jQuery("#form"+e+" .fm-not-filled").closest("div[wdid]").height(),u=jQuery("#form"+e+" .fm-not-filled").offset().top,c=function(){document.body.clientHeight!==l&&(l=document.body.clientHeight,s=jQuery("#form"+e+" .fm-not-filled").closest("div[wdid]").height(),u=jQuery("#form"+e+" .fm-not-filled").offset().top,jQuery("html").stop(),_())};function m(e){e&&(old_bg=jQuery(i).css("background-color"),jQuery(i).effect("shake",{},500).css("background-color","#FF8F8B").animate({backgroundColor:old_bg},{duration:500,queue:!1}))}function _(){jQuery("html").animate({scrollTop:u-(s+40)},500,function(){document.scrollingElement.scrollTop=u-(s+40),jQuery(window).off("scroll",c),m(t)})}jQuery(window).on("scroll",c),u<d?_():m(t)}function wd_file_upload_check(r,e){var a=jQuery("#form"+r),n=!1,t=e||window["file_upload_check"+r];return jQuery.each(t,function(e,t){var i="#wdform_"+e+"_element"+r;0!=a.find(jQuery("div[wdid='"+e+"']")).length&&"none"!=a.find(jQuery("div[wdid='"+e+"']")).css("display")&&(ext_available=getfileextension(jQuery(i).val(),t),ext_available?(jQuery("#form"+r+" #wd_upload_type_"+e).remove(),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .error_label_upload").removeClass("error_label_upload")):(jQuery("#form"+r+" #wd_upload_type_"+e).remove(),a.find(jQuery("div[wdid='"+e+"'] .wdform-element-section")).parent().parent().append("<div id='wd_upload_type_"+e+"' class='fm-not-filled'>"+fm_objectL10n.fm_file_type_error+"</div>"),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_upload"),n=!0))}),e||!0!==n||scroll_on_element(r),!1===n}function wd_is_filled(s,u,c){null==c&&(c=!0);var m=jQuery("#form"+s),e=u?u.split():window["required_fields"+s],_={};return jQuery(e).each(function(e,r){if("none"===m.find(jQuery("div[wdid='"+r+"']")).css("display")&&(m.find(jQuery("div[wdid='"+r+"']")).find(".fm-not-filled").remove(),m.find(jQuery("div[wdid='"+r+"']")).css("background-color",""),m.find(jQuery("div[wdid='"+r+"'] label")).removeClass("error_label")),0!=m.find(jQuery("div[wdid='"+r+"']")).length&&"none"!==m.find(jQuery("div[wdid='"+r+"']")).css("display"))switch(window["labels_and_ids"+s][r]){case"type_text":case"type_textarea":case"type_paypal_price_new":case"type_spinner":case"type_number":case"type_phone_new":case"type_submitter_mail":var t="#wdform_"+r+"_element"+s,i=jQuery(t).val();i=jQuery.trim(i),(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==i&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)});break;case"type_own_select":case"type_country":case"type_paypal_select":t="#wdform_"+r+"_element"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&(""==jQuery(t).val()||0<jQuery("#wdform_"+r+"_element_quantity"+s).length&&!parseInt(jQuery("#wdform_"+r+"_element_quantity"+s).val()))&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)}).change(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),wd_is_filled(s,r)});break;case"type_phone":t=["#wdform_"+r+"_element_first"+s,"#wdform_"+r+"_element_last"+s];jQuery.each(t,function(e,t){(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)})});break;case"type_name":t=["#wdform_"+r+"_element_title"+s,"#wdform_"+r+"_element_first"+s,"#wdform_"+r+"_element_last"+s,"#wdform_"+r+"_element_middle"+s];jQuery.each(t,function(e,t){if((c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&jQuery(t).length){var i=jQuery(t).val();""==(i=jQuery.trim(i))&&void 0!==i&&(_[r]=t)}u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).blur(function(){wd_is_filled(s,r)})});break;case"type_address":t=["#wdform_"+r+"_street1"+s,"#wdform_"+r+"_city"+s,"#wdform_"+r+"_state"+s,"#wdform_"+r+"_postal"+s,"#wdform_"+r+"_country"+s];jQuery.each(t,function(e,t){if(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display")){var i=jQuery(t).val();void 0!==i&&(i=jQuery.trim(i)),""==i&&void 0!==jQuery(t).closest(".wd-address").css("display")&&"none"!=jQuery(t).closest(".wd-address").css("display")&&0<jQuery(t).length&&(_[r]=t)}u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).blur(function(){wd_is_filled(s,r)})});break;case"type_checkbox":case"type_radio":case"type_scale_rating":case"type_paypal_checkbox":case"type_paypal_radio":case"type_paypal_shipping":(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&(0==m.find(jQuery("div[wdid='"+r+"'] input:checked")).length||""==jQuery("#wdform_"+r+"_other_input"+s).val()||0<jQuery("#wdform_"+r+"_element_quantity"+s).length&&!parseInt(jQuery("#wdform_"+r+"_element_quantity"+s).val()))&&(_[r]=!0),u||window["check_submit"+s]||jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] input"),function(e,t){jQuery(this).change(function(){0==m.find(jQuery("div[wdid='"+r+"'] input:checked")).length||""==jQuery("#wdform_"+r+"_other_input"+s).val()||0<jQuery("#wdform_"+r+"_element_quantity"+s).length&&!parseInt(jQuery("#wdform_"+r+"_element_quantity"+s).val())?wd_is_filled(s,r):(jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"))})});break;case"type_star_rating":t="#wdform_"+r+"_selected_star_amount"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=!0),u||window["check_submit"+s]||jQuery("#wdform_"+r+"_element"+s).click(function(){""!=jQuery(t).val()&&(jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove())});break;case"type_range":t=["#wdform_"+r+"_element"+s+"0","#wdform_"+r+"_element"+s+"1"];jQuery.each(t,function(e,t){(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).blur(function(){wd_is_filled(s,r)})});break;case"type_grading":if(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display")){var a=0;jQuery.each(jQuery("#wdform_"+r+"_element"+s+" input"),function(e,t){""!=jQuery(this).val()&&a++}),0==a&&(_[r]=!0)}u||window["check_submit"+s]||jQuery.each(jQuery("#wdform_"+r+"_element"+s+" input"),function(e,t){jQuery(this).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).blur(function(){wd_is_filled(s,r)})});break;case"type_slider":var n="#wdform_"+r+"_element"+s,o=(t="#wdform_"+r+"_slider_value"+s,"#wdform_"+r+"_element_min"+s);(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&jQuery(t).val()==jQuery(o).html()&&(_[r]=!0),u||window["check_submit"+s]||jQuery(n).slider({change:function(e,t){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove(),wd_is_filled(s,r)}});break;case"type_date":case"type_date_new":t="#wdform_"+r+"_element"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove()}).change(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),wd_is_filled(s,r)});break;case"type_date_range":t=["#wdform_"+r+"_element"+s+"0","#wdform_"+r+"_element"+s+"1"];jQuery.each(t,function(e,t){(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).change(function(){wd_is_filled(s,r)})});break;case"type_date_fields":t=["#wdform_"+r+"_day"+s,"#wdform_"+r+"_month"+s,"#wdform_"+r+"_year"+s];jQuery.each(t,function(e,t){(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+"div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+"#wd_required_"+r).remove(),jQuery("#check_min_date_"+r+"_"+s).remove()}).blur(function(){wd_is_filled(s,r)}).change(function(){wd_is_filled(s,r)})});break;case"type_time":t=["#wdform_"+r+"_hh"+s,"#wdform_"+r+"_mm"+s,"#wdform_"+r+"_ss"+s];jQuery.each(t,function(e,t){(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&void 0!==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).blur(function(){wd_is_filled(s,r)})});break;case"type_password":t="#wdform_"+r+"_element"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)});break;case"type_file_upload":t="#wdform_"+r+"_element"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).change(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),wd_is_filled(s,r)});break;case"type_matrix":if(jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),"radio"==jQuery("#form"+s+" div[wdid='"+r+"'] input").attr("type")||"checkbox"==jQuery("#form"+s+" div[wdid='"+r+"'] input").attr("type"))(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&(0==m.find(jQuery("div[wdid='"+r+"'] input:checked")).length&&(_[r]=!0),"radio"==jQuery("#form"+s+" div[wdid='"+r+"'] input").attr("type")&&jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] div[class^='wdform-matrix-row']"),function(e,t){0==jQuery(t).find('input[type="radio"]:checked').length&&(_[r]=!0)})),"checkbox"==jQuery("#form"+s+" div[wdid='"+r+"'] input").attr("type")&&(u||window["check_submit"+s]||jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] input"),function(e,t){jQuery(this).change(function(){0==m.find(jQuery("div[wdid='"+r+"'] input:checked")).length?wd_is_filled(s,r):(jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove())})}));else if("text"==jQuery("#form"+s+" div[wdid='"+r+"'] input").attr("type")){if(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display")){var d=0;jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] input"),function(e,t){""!=jQuery(this).val()&&d++}),0==d&&(_[r]=!0)}u||window["check_submit"+s]||jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] input"),function(e,t){jQuery(this).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)})})}else{if(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display")){var l=0;jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] select"),function(e,t){""!=jQuery(this).val()&&l++}),0==l&&(_[r]=!0)}u||window["check_submit"+s]||jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] select"),function(e,t){jQuery(this).focus(function(){""==jQuery(this).val()&&(jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"))}).change(function(){wd_is_filled(s,r)}).blur(function(){wd_is_filled(s,r)})})}break;case"type_send_copy":(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&0==jQuery("div[wdid='"+r+"'] input:checked").length&&(_[r]=!0),u||window["check_submit"+s]||jQuery("#form"+s+" div[wdid='"+r+"'] input").change(function(){0==jQuery("div[wdid='"+r+"'] input:checked").length?wd_is_filled(s,r):(jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"))});break;case"type_captcha":case"type_arithmetic_captcha":t="";t="type_captcha"==window["labels_and_ids"+s][r]?"#wd_captcha_input"+s:"#wd_arithmetic_captcha_input"+s,(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(jQuery(".message_captcha").html(""),_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)});break;case"type_signature":jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .wdform-label").removeClass("error_label");t="#signature-file-wdform_"+r+"_element"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .wdform-label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).change(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .wdform-label").removeClass("error_label"),wd_is_filled(s,r)})}}),0===Object.keys(_).length&&0===Object.keys(window["check_before_submit"+s]).length||(0!==Object.keys(_).length&&jQuery.each(_,function(e,t){var i=jQuery("#form"+s+" div[wdid='"+e+"'] .wdform-label-section:first"),r=0;i.hasClass("wd-width-30")&&!i.hasClass("wd-hidden")&&(r=i.width()),jQuery("#form"+s+" #wd_required_"+e).remove(),jQuery("#form"+s+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label"),"type_password"===window["labels_and_ids"+s][e]||"type_submitter_mail"===window["labels_and_ids"+s][e]?jQuery("#form"+s+" div[wdid='"+e+"'] .wdform-element-section:first").parent().after("<div id='wd_required_"+e+"' class='fm-not-filled fm-password-not-filled' style='margin-left: "+r+"px'>"+fm_objectL10n.fm_field_is_required+"</div>"):jQuery("#form"+s+" div[wdid='"+e+"'] .wdform-element-section:first").parent().parent().append("<div id='wd_required_"+e+"' class='fm-not-filled' style='margin-left: "+r+"px'>"+fm_objectL10n.fm_field_is_required+"</div>")}),u||scroll_on_element(s),!(window["check_submit"+s]=1))}function wd_check_price_min_max(n,o){var d=jQuery("#form"+n),e=o||window["check_paypal_price_min_max"+n],l=!1;return jQuery.each(e,function(e,t){var i="#wdform_"+e+"_element"+n,r=t[3]?t[3]:0,a=t[4]?t[4]:-1;!t[2]&&jQuery(i).val()==t[1]||(-1!=a&&parseFloat(jQuery(i).val())>a||parseFloat(jQuery(i).val())<r)&&(jQuery("#form"+n+" #wd_price_"+e).remove(),d.find(jQuery("div[wdid='"+e+"'] .wdform-element-section")).parent().parent().append("<div id='wd_price_"+e+"' class='fm-not-filled'>"+fm_objectL10n.fm_min_max_check_1+t[0]+fm_objectL10n.fm_min_max_check_2+(t[3]?t[3]:0)+"-"+(t[4]?t[4]:"any")+"</div>"),jQuery("#form"+n+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price"),l=!0,o||scroll_on_element(n))}),!1===l}function wd_check_min_date_dob(u){var c=!0;return jQuery("#form"+u+" div[type='type_date_fields']").each(function(){var e=parseInt(jQuery(this).data("min-day"));if(!e)return!0;var t=jQuery(this).parent(),i=t.attr("wdid"),r=parseInt(jQuery("#wdform_"+i+"_day"+u).val()),a=parseInt(jQuery("#wdform_"+i+"_month"+u).val()),n=parseInt(jQuery("#wdform_"+i+"_year"+u).val());if(!(r||a||n))return!0;var o=parseInt(jQuery(this).data("min-month")),d=parseInt(jQuery(this).data("min-year")),l=new Date(n+"-"+a+"-"+r),s=new Date(d+"-"+o+"-"+e);(isNaN(l)||isNaN(n)||l-s<0)&&(c=!1,jQuery("#check_min_date_"+i+"_"+u).remove(),t.append("<div id='check_min_date_"+i+"_"+u+"' class='fm-not-valid-date'>"+jQuery(this).attr("data-min-date-alert")+"</div>"),t.find(".wdform-label").addClass("error_label"),scroll_on_element(u))}),c}function wd_spinner_check(r,a){var n=jQuery("#form"+r),o=!1,e=a||window["spinner_check"+r];return jQuery.each(e,function(e,t){var i="#wdform_"+e+"_element"+r;0!=n.find(jQuery("div[wdid='"+e+"']")).length&&"none"!=n.find(jQuery("div[wdid='"+e+"']")).css("display")&&(parseInt(jQuery(i).val())<parseInt(t[0])||parseInt(jQuery(i).val())>parseInt(t[1]))&&(jQuery("#form"+r+" #wd_price_"+e).remove(),n.find(jQuery("div[wdid='"+e+"'] .wdform-element-section")).parent().parent().append("<div id='wd_price_"+e+"' class='fm-not-filled'>"+fm_objectL10n.fm_spinner_check+(t[0]?t[0]:0)+"-"+(t[1]?t[1]:"any")+"</div>"),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price"),o=!0,a||scroll_on_element(r))}),!1===o}function fmscrollHandler(e){var t=100*jQuery(window).scrollTop()/(jQuery(document).height()-jQuery(window).height());!jQuery("#fm-scrollbox"+e).hasClass("fm-minimized")&&t>=window["scrollbox_trigger_point"+e]?setTimeout(function(){jQuery("#fm-scrollbox"+e).removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp"),jQuery("#fm-scrollbox"+e).css("visibility",""),jQuery("#fm-scrollbox"+e+" .fm-header-img").addClass("fm-animated "+window["header_image_animation"+e])},1e3*window["scrollbox_loading_delay"+e]):"1"==window["scrollbox_auto_hide"+e]&&(jQuery("#fm-scrollbox"+e+" .fm-header-img").removeClass("fm-animated "+window["header_image_animation"+e]),jQuery("#fm-scrollbox"+e).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown"))}function fm_submit_form(e){if("function"==typeof window["before_submit"+e]&&window["before_submit"+e]())return!1;if(!fm_check(0,e))return!1;(jQuery("#form"+e+" button").each(function(){jQuery(this).attr("disabled","disabled")}),jQuery('<input type="hidden" name="save_or_submit'+e+'" value ="submit" />').appendTo("#form"+e),window["onsubmit_js"+e](),1==window["checkStripe"+e])?"none"!=jQuery("form[id='form"+e+"']").find(".StripeElement").first().parents(".wdform_row").css("display")?wdfm_call_stripe(!0):0<jQuery("#form"+e).find(".g-recaptcha[data-size=invisible]").length?grecaptcha.execute():fm_submit(e):0<jQuery("#form"+e).find(".g-recaptcha[data-size=invisible]").length?grecaptcha.execute():fm_submit(e)}function getHostName(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null}function isJson(e){try{JSON.parse(e)}catch(e){return!1}return!0}function fm_submit(u){if(fm_set_input_value("fm_empty_field_validation"+u,jQuery("#fm_empty_field_validation"+u).attr("data-value")),"0"!=jQuery("#form"+u+" .button-submit:not(.save_button)").attr("data-ajax")){jQuery("#form"+u+" .fm-submit-loading").css("display","inline-block");var e=jQuery("#form"+u)[0],t=new FormData(e),i=jQuery("#fm_ajax_url"+u).data("ajax_url"),c=jQuery("#form"+u+" #fm_ajax_redirect_url"+u).data("ajax_redirect_url");jQuery.ajax({type:"POST",enctype:"multipart/form-data",url:i,data:t,contentType:!1,processData:!1,success:function(e){if(isJson(e)){var t=JSON.parse(e);if(void 0!==t.after_submit_redirect_url&&""!=jQuery.trim(t.after_submit_redirect_url))return void window.location.replace(t.after_submit_redirect_url);var i=new Date,r=window.location.href,a=i.getTime();if(void 0!==t.success&&(a=t.success),-1<r.indexOf("&succes="))r=r.split("&succes=")[0];else if(-1<r.indexOf("?succes=")){r=r.split("?succes=")[0]}r=-1<r.indexOf("?")?r+"&succes="+a:r+"?succes="+a;var n="&return="+encodeURIComponent(r);if(void 0!==t.paypal_url){var o=t.paypal_url+n;return void window.location.replace(o)}}if(0==c){jQuery("#form"+u+" .button-submit").prop("disabled",!1),jQuery("#form"+u+" .fm-submit-loading").hide();var d=jQuery(e).find("#form"+u).html();jQuery("#form"+u).html(d),"function"==typeof window["fm_save_progress_buttons_"+u]&&window["fm_save_progress_buttons_"+u](),0<jQuery(document).find(".g-recaptcha").length&&fmRecaptchaInit(1);var l="fm_script_ready"+u;if(void 0!==window[l]&&window[l](),0<jQuery(d).find(".fm-not-filled.message_captcha").length){var s=jQuery(d).find(".fm-not-filled.message_captcha").text();jQuery("#form"+u+" .fm-message").remove(),jQuery("#form"+u).prepend('<div class="fm-message fm-notice-error">'+s+"</div>")}window["check_submit"+u]=0}else window.location.replace(c)},complete:function(){0==jQuery("#form"+u+" .fm-message").length?(jQuery("#closing-form"+u).remove(),jQuery("#fm-popover-background"+u).css("display","none")):jQuery("#fm-popover-container"+u).addClass("fm-submit-message"),"function"!=typeof window["after_submit"+u]||jQuery("#form"+u).find(".message_captcha").length||window["after_submit"+u]()}})}else jQuery("#form"+u).submit()}function fm_reset_form(form_id){"function"==typeof window["before_reset"+form_id]&&window["before_reset"+form_id]();var privacy_policy_check=jQuery("#fm_privacy_policy"+form_id);privacy_policy_check&&(privacy_policy_check.prop("checked",!1),fm_privacy_policy_check(privacy_policy_check)),jQuery.each(window["labels_and_ids"+form_id],function(index,elem){switch(elem){case"type_text":case"type_textarea":case"type_number":case"type_spinner":case"type_own_select":case"type_country":case"type_date":case"type_date_new":case"type_hidden":case"type_paypal_price_new":case"type_phone_new":case"type_time":jQuery("#wdform_"+index+"_element"+form_id).val("");break;case"type_submitter_mail":case"type_password":jQuery("#wdform_"+index+"_element"+form_id).val(""),jQuery("#wdform_"+index+"_1_element"+form_id)&&(jQuery("#wdform_"+index+"_1_element"+form_id).val(""),jQuery("#confirm_"+index+"_"+form_id)&&jQuery("#confirm_"+index+"_"+form_id).remove(),"type_submitter_mail"==elem&&jQuery("#check_email_"+index+"_"+form_id)&&jQuery("#check_email_"+index+"_"+form_id).remove());break;case"type_date_range":jQuery("#wdform_"+index+"_element"+form_id+"0").val(""),jQuery("#wdform_"+index+"_element"+form_id+"1").val("");break;case"type_send_copy":jQuery("#wdform_"+index+"_element"+form_id).prop("checked",!1);break;case"type_phone":jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id).val("");break;case"type_name":jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id+", #wdform_"+index+"_element_title"+form_id+", #wdform_"+index+"_element_middle"+form_id).val("");break;case"type_address":jQuery("#wdform_"+index+"_street1"+form_id+", #wdform_"+index+"_street2"+form_id+", #wdform_"+index+"_city"+form_id+", #wdform_"+index+"_state"+form_id+", #wdform_"+index+"_postal"+form_id+", #wdform_"+index+"_country"+form_id).val("");break;case"type_checkbox":jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop("checked",!1),jQuery("#wdform_"+index+"_other_br"+form_id).remove(),jQuery("#wdform_"+index+"_other_input"+form_id).remove();break;case"type_radio":jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop("checked",!1),jQuery("#wdform_"+index+"_other_br"+form_id).remove(),jQuery("#wdform_"+index+"_other_input"+form_id).remove();break;case"type_time":jQuery("#wdform_"+index+"_hh"+form_id+", #wdform_"+index+"_mm"+form_id+", #wdform_"+index+"_ss"+form_id+", #wdform_"+index+"_am_pm"+form_id).val("");break;case"type_date_fields":jQuery("#wdform_"+index+"_day"+form_id+", #wdform_"+index+"_month"+form_id+", #wdform_"+index+"_year"+form_id).val("");break;case"type_file_upload":jQuery("#wdform_"+index+"_element"+form_id+"_save").remove();break;case"type_paypal_price":jQuery("#wdform_"+index+"_element_dollars"+form_id+", #wdform_"+index+"_element_cents"+form_id).val("");break;case"type_paypal_select":jQuery("#wdform_"+index+"_element"+form_id+", #wdform_"+index+"_element_quantity"+form_id+", #form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val("");break;case"type_paypal_radio":jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val(""),jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop("checked",!1);break;case"type_paypal_shipping":jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop("checked",!1);break;case"type_paypal_checkbox":jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val(""),jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop("checked",!1);break;case"type_star_rating":jQuery("#wdform_"+index+"_selected_star_amount"+form_id).val(""),jQuery("#wdform_"+index+"_element"+form_id+" img").attr("src",fm_objectL10n.plugin_url+"/images/star.png");break;case"type_scale_rating":jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop("checked",!1);break;case"type_slider":jQuery("#wdform_"+index+"_element"+form_id).slider({value:eval(0)}),jQuery("#wdform_"+index+"_element_value"+form_id).html("0");break;case"type_range":jQuery("#wdform_"+index+"_element"+form_id+"0, #wdform_"+index+"_element"+form_id+"1").val("");break;case"type_grading":jQuery("#wdform_"+index+"_element"+form_id+" input").val("");break;case"type_matrix":jQuery("#wdform_"+index+"_element"+form_id+" .radio-div input").prop("checked",!1),jQuery("#wdform_"+index+"_element"+form_id+" .checkbox-div input").prop("checked",!1),jQuery("#wdform_"+index+"_element"+form_id+" input[type='text']").val(""),jQuery("#wdform_"+index+"_element"+form_id+" select").val("");break;case"type_paypal_total":jQuery("#wdform_"+index+"div_total"+form_id).html("$0"),jQuery("#wdform_"+index+"paypal_products"+form_id).empty();break;case"type_captcha":jQuery("#wd_captcha_input"+form_id).val("");case"type_arithmetic_captcha":jQuery("#wd_arithmetic_captcha_input"+form_id).val("")}})}function fm_save_form(e){jQuery('<input type="hidden" name="save_or_submit'+e+'" value ="save" />').appendTo("#form"+e),window["onsubmit_js"+e](),jQuery("#form"+e+" button").each(function(){jQuery(this).attr("disabled","disabled")}),fm_set_input_value("fm_empty_field_validation"+e,jQuery("#fm_empty_field_validation"+e).attr("data-value")),jQuery("#form"+e).submit()}function fm_clear_form(e){1==confirm(fm_objectL10n.fm_clear_data)&&(jQuery("#form"+e+" button").each(function(){jQuery(this).attr("disabled","disabled")}),jQuery.get(fm_objectL10n.form_maker_admin_ajax+"?action=FMClearProg&addon_task=clear_data&nonce="+fm_ajax.ajaxnonce+"&form_id="+e).done(function(){window.location=jQuery("#form"+e).attr("action")}))}function fm_set_input_value(e,t){jQuery("#"+e).val(t)}function formOnload(r){var a;-1!=navigator.userAgent.toLowerCase().indexOf("msie")&&8===parseInt(navigator.userAgent.toLowerCase().split("msie")[1])&&(jQuery("#form"+r).find(jQuery("input[type='radio']")).click(function(){jQuery("input[type='radio']+label").removeClass("if-ie-div-label"),jQuery("input[type='radio']:checked+label").addClass("if-ie-div-label")}),jQuery("#form"+r).find(jQuery("input[type='radio']:checked+label")).addClass("if-ie-div-label"),jQuery("#form"+r).find(jQuery("input[type='checkbox']")).click(function(){jQuery("input[type='checkbox']+label").removeClass("if-ie-div-label"),jQuery("input[type='checkbox']:checked+label").addClass("if-ie-div-label")}),jQuery("#form"+r).find(jQuery("input[type='checkbox']:checked+label")).addClass("if-ie-div-label")),jQuery.each(window["check_regExp_all"+r],function(e,t){var i={};i[e]=t,jQuery("div[wdid='"+e+"'] input").blur(function(){wd_check_regExp(r,i)}).focus(function(){jQuery("#form"+r+" #wd_exp_"+e).remove(),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .error_label_exp").removeClass("error_label_exp")})}),jQuery.each(window["check_paypal_price_min_max"+r],function(e,t){var i={};i[e]=t,jQuery("div[wdid='"+e+"'] input").blur(function(){wd_check_price_min_max(r,i)}).focus(function(){jQuery("#form"+r+" #wd_price_"+e).remove(),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")})}),jQuery.each(window["spinner_check"+r],function(e,t){var i={};i[e]=t,jQuery("div[wdid='"+e+"'] input").blur(function(){wd_spinner_check(r,i)}).focus(function(){jQuery("#form"+r+" #wd_price_"+e).remove(),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")})}),jQuery.each(window["file_upload_check"+r],function(e,t){var i={};i[e]=t,jQuery("div[wdid='"+e+"'] input").change(function(){wd_file_upload_check(r,i)})}),jQuery("#form"+r+" input").on("keypress",function(e){if(13==(e.keyCode?e.keyCode:e.which))return!1}),jQuery("div[type='type_number'] input, div[type='type_phone'] input, div[type='type_spinner'] input, div[type='type_range'] input, .wdform-quantity, div[type='type_paypal_price_new'] input").keypress(function(e){return check_isnum(e)}),jQuery("div[type='type_grading'] input").keypress(function(e){return check_isnum_or_minus(e)}),jQuery("div[type='type_paypal_checkbox'] input[type='checkbox'], div[type='type_paypal_radio'] input[type='radio'], div[type='type_paypal_shipping'] input[type='radio']").click(function(){set_total_value(r)}),jQuery("div[type='type_paypal_select'] select, div[type='type_paypal_price'] input, div[type='type_paypal_price_new'] input").change(function(){set_total_value(r)}),jQuery(".wdform-quantity").change(function(){set_total_value(r)}),jQuery("div[type='type_address'] select").change(function(){set_total_value(r)}),jQuery("div[type='type_time'] input").blur(function(){add_0(this)}),jQuery(".wdform-element-section").each(function(){if("type_stripe"==jQuery(this).parent().parent().attr("type"))return!0;jQuery(this).parent()[0].style.width||0==parseInt(jQuery(this).width())||0==jQuery(this).parent().find(jQuery(".wdform-label-section")).length||"table-cell"==jQuery(this).css("display")&&("type_captcha"!=jQuery(this).parent().attr("type")?jQuery(this).parent().css("width",parseInt(jQuery(this).width())+parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15):jQuery(this).parent().css("width",2*parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width)+50+parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15)),parseInt(jQuery(this)[0].style.width.replace("px",""))<parseInt(jQuery(this).css("min-width").replace("px",""))&&jQuery(this).css("min-width",parseInt(jQuery(this)[0].style.width.replace("px",""))-10)}),jQuery(".wdform-label").each(function(){parseInt(jQuery(this).height())>=2*parseInt(jQuery(this).css("line-height").replace("px",""))&&(jQuery(this).parent().css("max-width",jQuery(this).parent().width()),jQuery(this).parent().css("width",""))}),(a=jQuery).fn.shuffle=function(){var r=a(this).find(".wd-choice"),t=a.map(r,function(){var e,t=(e=r.length,Math.floor(Math.random()*e)),i=a(r[parseInt(t)]).clone(!0)[0];return r.splice(t,1),i});return a(this).find(".wd-choice").each(function(e){a(this).replaceWith(a(t[e]))}),a(t)},"function"==typeof window["onload_js"+r]&&window["onload_js"+r](),"function"==typeof window["before_load"+r]&&window["before_load"+r]()}function fm_document_ready(e){jQuery("#form"+e).hasClass("fm-form-submitted")&&!jQuery("#form"+e).find(".message_captcha").length&&"function"==typeof window["after_submit"+e]&&window["after_submit"+e]();var t=jQuery("#form"+e+" .wdform-page-and-images").length;window["form_view_count"+e]=t,1<window["form_view_count"+e]&&(firstid=jQuery("#form"+e+" .wdform_page").first().attr("id"),firstid=firstid.split("form_view"),window["first_form_view"+e]=firstid[1],generate_page_nav(window["first_form_view"+e],e,window["form_view_count"+e])),fm_initilize_form(e),window["condition_js"+e](),jQuery(document).trigger("fm_document_ready")}function fm_check(e,t,i){if(!wd_is_filled(t,void 0,i))return!1;if(1==window["checkStripe"+t]){var r=jQuery("form[id='form"+t+"']");if("none"!=r.find(".StripeElement").first().closest(".wdform-page-and-images").css("display")&&"none"!=r.find(".StripeElement").first().parents(".wdform_row").css("display")&&0==wdfm_call_stripe(!1))return!1}return!!wd_check_regExp(t)&&(!!wd_check_price_min_max(t)&&(!!wd_spinner_check(t)&&(!!wd_file_upload_check(t)&&(!!wd_check_min_date_dob(t)&&0!=window["check_js"+t](e,t)))))}function fmRecaptchaInit(e){void 0===e&&(e=0),jQuery(".g-recaptcha").each(function(){if(type=jQuery(this).attr("data-size"),jQuery(this).attr("data-render",1),"invisible"==type)i=jQuery(this).attr("data-form_id"),grecaptcha.render(jQuery(this).attr("id"),{sitekey:jQuery(this).attr("data-sitekey"),badge:jQuery(this).attr("data-badge"),callback:function(){fm_submit(i)}});else if("v3"==type){if("undefined"==jQuery(this).attr("data-sitekey")||""==jQuery(this).attr("data-sitekey"))return;var t=jQuery(this).attr("data-id"),i=jQuery(this).attr("data-form-id"),e=jQuery(this).attr("data-sitekey");grecaptcha.ready(function(){grecaptcha.execute(e).then(function(e){document.getElementById("recaptchaV3Response_"+i+t).value=e})})}else grecaptcha.render(jQuery(this).attr("id"),{sitekey:jQuery(this).attr("data-sitekey"),theme:"light"})})}function wd_change_state_input(e,t){if(document.getElementById(e+"_country"+t)&&document.getElementById(e+"_state"+t)){var i=!1,r=document.getElementById(e+"_state"+t);if("United States"==document.getElementById(e+"_country"+t).value){var a=document.createElement("select"),n=fm_objectL10n.states;for(var o in n){(d=document.createElement("option")).setAttribute("value",o),d.innerHTML=n[o],a.appendChild(d)}i=!0}else if("Canada"==document.getElementById(e+"_country"+t).value){a=document.createElement("select"),n=fm_objectL10n.provinces;for(var o in n){var d;(d=document.createElement("option")).setAttribute("value",o),d.innerHTML=n[o],a.appendChild(d)}i=!0}else if("SELECT"==document.getElementById(e+"_state"+t).tagName){a=document.createElement("input");i=!0}if(i){a.setAttribute("type","text"),a.setAttribute("id",e+"_state"+t),a.setAttribute("name","wdform_"+(parseInt(e.replace("wdform_",""))+3)+"_state"+t),a.setAttribute("class","wd-width-100");var l=r.parentNode;l.removeChild(r),l.insertBefore(a,l.firstChild)}}}function fm_privacy_policy_check(e){var t=jQuery(e),i=t.parents(".wdform_row").find(".button-submit");t.is(":checked")?i.prop("disabled",!1):i.prop("disabled",!0)}function fm_html_entities(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function validate_received_data_from_url(){new URLSearchParams(window.location.search).forEach(function(e,t){jQuery("#"+t).each(function(){jQuery(this).keyup(),jQuery(this).keydown(),jQuery(this).trigger("change")})})}jQuery(document).on("mouseenter",".sel-imul",function(){selenter=!0}),jQuery(document).on("mouseleave",".sel-imul",function(){selenter=!1}),jQuery(document).click(function(){selenter||(jQuery(".sel-options").hide(),jQuery(".sel-imul").removeClass("act"))}),function(e){"object"==typeof module&&module.exports?module.exports=e():window.intlTelInput=e()}(function(m){"use strict";return function(){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}for(var n=[["Afghanistan (‫افغانستان‬‎)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (‫الجزائر‬‎)","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua and Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain (‫البحرين‬‎)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros (‫جزر القمر‬‎)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (‫مصر‬‎)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (‫ایران‬‎)","ir","98"],["Iraq (‫العراق‬‎)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel (‫ישראל‬‎)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan (‫الأردن‬‎)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (‫الكويت‬‎)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (‫لبنان‬‎)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (‫ليبيا‬‎)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Macedonia (FYROM) (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (‫موريتانيا‬‎)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco (‫المغرب‬‎)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway (Norge)","no","47",0],["Oman (‫عُمان‬‎)","om","968"],["Pakistan (‫پاکستان‬‎)","pk","92"],["Palau","pw","680"],["Palestine (‫فلسطين‬‎)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (‫قطر‬‎)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1",18,["869"]],["Saint Lucia","lc","1",19,["758"]],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1",20,["784"]],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (‫المملكة العربية السعودية‬‎)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (‫جنوب السودان‬‎)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්‍රී ලංකාව)","lk","94"],["Sudan (‫السودان‬‎)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1,["79"]],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (‫سوريا‬‎)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1",22,["868"]],["Tunisia (‫تونس‬‎)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1",24,["340"]],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (‫الصحراء الغربية‬‎)","eh","212",1,["5288","5289"]],["Yemen (‫اليمن‬‎)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],e=0;e<n.length;e++){var t=n[e];n[e]={name:t[0],iso2:t[1],dialCode:t[2],priority:t[3]||0,areaCodes:t[4]||null}}var i={getInstance:function(e){var t=e.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[t]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=i);var o=0,d={allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:"polite",customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,utilsScript:""},l=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],s=function(e,t){for(var i=Object.keys(e),r=0;r<i.length;r++)t(i[r],e[i[r]])},u=function(t){s(window.intlTelInputGlobals.instances,function(e){window.intlTelInputGlobals.instances[e][t]()})},a=function(){function a(e,t){var i=this;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,a),this.id=o++,this.a=e,this.b=null,this.c=null;var r=t||{};this.d={},s(d,function(e,t){i.d[e]=r.hasOwnProperty(e)?r[e]:t}),this.e=Boolean(e.getAttribute("placeholder"))}return e=a,(t=[{key:"_init",value:function(){var i=this;if(this.d.nationalMode&&(this.d.autoHideDialCode=!1),this.d.separateDialCode&&(this.d.autoHideDialCode=this.d.nationalMode=!1),this.g=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.g&&(document.body.classList.add("iti-mobile"),this.d.dropdownContainer||(this.d.dropdownContainer=document.body)),"undefined"!=typeof Promise){var e=new Promise(function(e,t){i.h=e,i.i=t}),t=new Promise(function(e,t){i.i0=e,i.i1=t});this.promise=Promise.all([e,t])}else this.h=this.i=function(){},this.i0=this.i1=function(){};this.s={},this._b(),this._f(),this._h(),this._i(),this._i3()}},{key:"_b",value:function(){this._d(),this._d2(),this._e(),this.d.localizedCountries&&this._d0(),(this.d.onlyCountries.length||this.d.localizedCountries)&&this.p.sort(this._d1)}},{key:"_c",value:function(e,t,i){t.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=t.length),this.q.hasOwnProperty(t)||(this.q[t]=[]);for(var r=0;r<this.q[t].length;r++)if(this.q[t][r]===e)return;var a=i!==m?i:this.q[t].length;this.q[t][a]=e}},{key:"_d",value:function(){if(this.d.onlyCountries.length){var t=this.d.onlyCountries.map(function(e){return e.toLowerCase()});this.p=n.filter(function(e){return-1<t.indexOf(e.iso2)})}else if(this.d.excludeCountries.length){var i=this.d.excludeCountries.map(function(e){return e.toLowerCase()});this.p=n.filter(function(e){return-1===i.indexOf(e.iso2)})}else this.p=n}},{key:"_d0",value:function(){for(var e=0;e<this.p.length;e++){var t=this.p[e].iso2.toLowerCase();this.d.localizedCountries.hasOwnProperty(t)&&(this.p[e].name=this.d.localizedCountries[t])}}},{key:"_d1",value:function(e,t){return e.name.localeCompare(t.name)}},{key:"_d2",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.q={};for(var e=0;e<this.p.length;e++){var t=this.p[e];this.dialCodes[t.dialCode]||(this.dialCodes[t.dialCode]=!0),this._c(t.iso2,t.dialCode,t.priority)}for(var i=0;i<this.p.length;i++){var r=this.p[i];if(r.areaCodes)for(var a=this.q[r.dialCode][0],n=0;n<r.areaCodes.length;n++){for(var o=r.areaCodes[n],d=1;d<o.length;d++){var l=r.dialCode+o.substr(0,d);this._c(a,l),this._c(r.iso2,l)}this._c(r.iso2,r.dialCode+o)}}}},{key:"_e",value:function(){this.preferredCountries=[];for(var e=0;e<this.d.preferredCountries.length;e++){var t=this.d.preferredCountries[e].toLowerCase(),i=this._y(t,!1,!0);i&&this.preferredCountries.push(i)}}},{key:"_e2",value:function(e,t,i){var r=document.createElement(e);return t&&s(t,function(e,t){return r.setAttribute(e,t)}),i&&i.appendChild(r),r}},{key:"_f",value:function(){this.a.hasAttribute("autocomplete")||this.a.form&&this.a.form.hasAttribute("autocomplete")||this.a.setAttribute("autocomplete","off");var e="iti";this.d.allowDropdown&&(e+=" iti--allow-dropdown"),this.d.separateDialCode&&(e+=" iti--separate-dial-code"),this.d.customContainer&&(e+=" ",e+=this.d.customContainer);var t=this._e2("div",{class:e});if(this.a.parentNode.insertBefore(t,this.a),this.k=this._e2("div",{class:"iti__flag-container"},t),t.appendChild(this.a),this.selectedFlag=this._e2("div",{class:"iti__selected-flag",role:"combobox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-owns":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false"},this.k),this.l=this._e2("div",{class:"iti__flag"},this.selectedFlag),this.d.separateDialCode&&(this.t=this._e2("div",{class:"iti__selected-dial-code"},this.selectedFlag)),this.d.allowDropdown&&(this.selectedFlag.setAttribute("tabindex","0"),this.u=this._e2("div",{class:"iti__arrow"},this.selectedFlag),this.m=this._e2("ul",{class:"iti__country-list iti__hide",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"}),this.preferredCountries.length&&(this._g(this.preferredCountries,"iti__preferred",!0),this._e2("li",{class:"iti__divider",role:"separator","aria-disabled":"true"},this.m)),this._g(this.p,"iti__standard"),this.d.dropdownContainer?(this.dropdown=this._e2("div",{class:"iti iti--container"}),this.dropdown.appendChild(this.m)):this.k.appendChild(this.m)),this.d.hiddenInput){var i=this.d.hiddenInput,r=this.a.getAttribute("name");if(r){var a=r.lastIndexOf("[");-1!==a&&(i="".concat(r.substr(0,a),"[").concat(i,"]"))}this.hiddenInput=this._e2("input",{type:"hidden",name:i}),t.appendChild(this.hiddenInput)}}},{key:"_g",value:function(e,t,i){for(var r="",a=0;a<e.length;a++){var n=e[a],o=i?"-preferred":"";r+="<li class='iti__country ".concat(t,"' tabIndex='-1' id='iti-").concat(this.id,"__item-").concat(n.iso2).concat(o,"' role='option' data-dial-code='").concat(n.dialCode,"' data-country-code='").concat(n.iso2,"' aria-selected='false'>"),r+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(n.iso2,"'></div></div>"),r+="<span class='iti__country-name'>".concat(n.name,"</span>"),r+="<span class='iti__dial-code'>+".concat(n.dialCode,"</span>"),r+="</li>"}this.m.insertAdjacentHTML("beforeend",r)}},{key:"_h",value:function(){var e=this.a.getAttribute("value"),t=this.a.value,i=e&&"+"===e.charAt(0)&&(!t||"+"!==t.charAt(0))?e:t,r=this._5(i),a=this._w(i),n=this.d,o=n.initialCountry,d=n.nationalMode,l=n.autoHideDialCode,s=n.separateDialCode;r&&!a?this._v(i):"auto"!==o&&(o?this._z(o.toLowerCase()):r&&a?this._z("us"):(this.j=this.preferredCountries.length?this.preferredCountries[0].iso2:this.p[0].iso2,i||this._z(this.j)),i||d||l||s||(this.a.value="+".concat(this.s.dialCode))),i&&this._u(i)}},{key:"_i",value:function(){this._j(),this.d.autoHideDialCode&&this._l(),this.d.allowDropdown&&this._i2(),this.hiddenInput&&this._i0()}},{key:"_i0",value:function(){var e=this;this._a14=function(){e.hiddenInput.value=e.getNumber()},this.a.form&&this.a.form.addEventListener("submit",this._a14)}},{key:"_i1",value:function(){for(var e=this.a;e&&"LABEL"!==e.tagName;)e=e.parentNode;return e}},{key:"_i2",value:function(){var t=this;this._a9=function(e){t.m.classList.contains("iti__hide")?t.a.focus():e.preventDefault()};var e=this._i1();e&&e.addEventListener("click",this._a9),this._a10=function(){!t.m.classList.contains("iti__hide")||t.a.disabled||t.a.readOnly||t._n()},this.selectedFlag.addEventListener("click",this._a10),this._a11=function(e){t.m.classList.contains("iti__hide")&&-1!==["ArrowUp","Up","ArrowDown","Down"," ","Enter"].indexOf(e.key)&&(e.preventDefault(),e.stopPropagation(),t._n()),"Tab"===e.key&&t._2()},this.k.addEventListener("keydown",this._a11)}},{key:"_i3",value:function(){var e=this;this.d.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.d.utilsScript):window.addEventListener("load",function(){window.intlTelInputGlobals.loadUtils(e.d.utilsScript)}):this.i0(),"auto"===this.d.initialCountry?this._i4():this.h()}},{key:"_i4",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.d.geoIpLookup&&this.d.geoIpLookup(function(e){window.intlTelInputGlobals.autoCountry=e.toLowerCase(),setTimeout(function(){return u("handleAutoCountry")})},function(){return u("rejectAutoCountryPromise")}))}},{key:"_j",value:function(){var e=this;this._a12=function(){e._v(e.a.value)&&e._m2CountryChange()},this.a.addEventListener("keyup",this._a12),this._a13=function(){setTimeout(e._a12)},this.a.addEventListener("cut",this._a13),this.a.addEventListener("paste",this._a13)}},{key:"_j2",value:function(e){var t=this.a.getAttribute("maxlength");return t&&e.length>t?e.substr(0,t):e}},{key:"_l",value:function(){var e=this;this._a8=function(){e._l2()},this.a.form&&this.a.form.addEventListener("submit",this._a8),this.a.addEventListener("blur",this._a8)}},{key:"_l2",value:function(){if("+"===this.a.value.charAt(0)){var e=this._m(this.a.value);e&&this.s.dialCode!==e||(this.a.value="")}}},{key:"_m",value:function(e){return e.replace(/\D/g,"")}},{key:"_m2",value:function(e){var t=document.createEvent("Event");t.initEvent(e,!0,!0),this.a.dispatchEvent(t)}},{key:"_n",value:function(){this.m.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._o(),this.b&&(this._x(this.b,!1),this._3(this.b,!0)),this._p(),this.u.classList.add("iti__arrow--up"),this._m2("open:countrydropdown")}},{key:"_n2",value:function(e,t,i){i&&!e.classList.contains(t)?e.classList.add(t):!i&&e.classList.contains(t)&&e.classList.remove(t)}},{key:"_o",value:function(){var e=this;if(this.d.dropdownContainer&&this.d.dropdownContainer.appendChild(this.dropdown),!this.g){var t=this.a.getBoundingClientRect(),i=window.pageYOffset||document.documentElement.scrollTop,r=t.top+i,a=this.m.offsetHeight,n=r+this.a.offsetHeight+a<i+window.innerHeight,o=i<r-a;if(this._n2(this.m,"iti__country-list--dropup",!n&&o),this.d.dropdownContainer){var d=!n&&o?0:this.a.offsetHeight;this.dropdown.style.top="".concat(r+d,"px"),this.dropdown.style.left="".concat(t.left+document.body.scrollLeft,"px"),this._a4=function(){return e._2()},window.addEventListener("scroll",this._a4)}}}},{key:"_o2",value:function(e){for(var t=e;t&&t!==this.m&&!t.classList.contains("iti__country");)t=t.parentNode;return t===this.m?null:t}},{key:"_p",value:function(){var i=this;this._a0=function(e){var t=i._o2(e.target);t&&i._x(t,!1)},this.m.addEventListener("mouseover",this._a0),this._a1=function(e){var t=i._o2(e.target);t&&i._1(t)},this.m.addEventListener("click",this._a1);var e=!0;this._a2=function(){e||i._2(),e=!1},document.documentElement.addEventListener("click",this._a2);var t="",r=null;this._a3=function(e){e.preventDefault(),"ArrowUp"===e.key||"Up"===e.key||"ArrowDown"===e.key||"Down"===e.key?i._q(e.key):"Enter"===e.key?i._r():"Escape"===e.key?i._2():/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)&&(r&&clearTimeout(r),t+=e.key.toLowerCase(),i._s(t),r=setTimeout(function(){t=""},1e3))},document.addEventListener("keydown",this._a3)}},{key:"_q",value:function(e){var t="ArrowUp"===e||"Up"===e?this.c.previousElementSibling:this.c.nextElementSibling;t&&(t.classList.contains("iti__divider")&&(t="ArrowUp"===e||"Up"===e?t.previousElementSibling:t.nextElementSibling),this._x(t,!0))}},{key:"_r",value:function(){this.c&&this._1(this.c)}},{key:"_s",value:function(e){for(var t=0;t<this.p.length;t++)if(this._t(this.p[t].name,e)){var i=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(this.p[t].iso2));this._x(i,!1),this._3(i,!0);break}}},{key:"_t",value:function(e,t){return e.substr(0,t.length).toLowerCase()===t}},{key:"_u",value:function(e){var t=e;if(this.d.formatOnDisplay&&window.intlTelInputUtils&&this.s){var i=!this.d.separateDialCode&&(this.d.nationalMode||"+"!==t.charAt(0)),r=intlTelInputUtils.numberFormat,a=r.NATIONAL,n=r.INTERNATIONAL,o=i?a:n;t=intlTelInputUtils.formatNumber(t,this.s.iso2,o)}t=this._7(t),this.a.value=t}},{key:"_v",value:function(e){var t=e,i=this.s.dialCode,r="1"===i;t&&this.d.nationalMode&&r&&"+"!==t.charAt(0)&&("1"!==t.charAt(0)&&(t="1".concat(t)),t="+".concat(t)),this.d.separateDialCode&&i&&"+"!==t.charAt(0)&&(t="+".concat(i).concat(t));var a=this._5(t,!0),n=this._m(t),o=null;if(a){var d=this.q[this._m(a)],l=-1!==d.indexOf(this.s.iso2)&&n.length<=a.length-1;if(!("1"===i&&this._w(n)||l))for(var s=0;s<d.length;s++)if(d[s]){o=d[s];break}}else"+"===t.charAt(0)&&n.length?o="":t&&"+"!==t||(o=this.j);return null!==o&&this._z(o)}},{key:"_w",value:function(e){var t=this._m(e);if("1"!==t.charAt(0))return!1;var i=t.substr(1,3);return-1!==l.indexOf(i)}},{key:"_x",value:function(e,t){var i=this.c;i&&i.classList.remove("iti__highlight"),this.c=e,this.c.classList.add("iti__highlight"),t&&this.c.focus()}},{key:"_y",value:function(e,t,i){for(var r=t?n:this.p,a=0;a<r.length;a++)if(r[a].iso2===e)return r[a];if(i)return null;throw new Error("No country data for '".concat(e,"'"))}},{key:"_z",value:function(e){var t=this.s.iso2?this.s:{};this.s=e?this._y(e,!1,!1):{},this.s.iso2&&(this.j=this.s.iso2),this.l.setAttribute("class","iti__flag iti__".concat(e));var i=e?"".concat(this.s.name,": +").concat(this.s.dialCode):"Unknown";if(this.selectedFlag.setAttribute("title",i),this.d.separateDialCode){var r=this.s.dialCode?"+".concat(this.s.dialCode):"";this.t.innerHTML=r;var a=this.selectedFlag.offsetWidth||this._z2();this.a.style.paddingLeft="".concat(a+6,"px")}if(this._0(),this.d.allowDropdown){var n=this.b;if(n&&(n.classList.remove("iti__active"),n.setAttribute("aria-selected","false")),e){var o=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(e,"-preferred"))||this.m.querySelector("#iti-".concat(this.id,"__item-").concat(e));o.setAttribute("aria-selected","true"),o.classList.add("iti__active"),this.b=o,this.selectedFlag.setAttribute("aria-activedescendant",o.getAttribute("id"))}}return t.iso2!==e}},{key:"_z2",value:function(){var e=this.a.parentNode.cloneNode();e.style.visibility="hidden",document.body.appendChild(e);var t=this.k.cloneNode();e.appendChild(t);var i=this.selectedFlag.cloneNode(!0);t.appendChild(i);var r=i.offsetWidth;return e.parentNode.removeChild(e),r}},{key:"_0",value:function(){var e="aggressive"===this.d.autoPlaceholder||!this.e&&"polite"===this.d.autoPlaceholder;if(window.intlTelInputUtils&&e){var t=intlTelInputUtils.numberType[this.d.placeholderNumberType],i=this.s.iso2?intlTelInputUtils.getExampleNumber(this.s.iso2,this.d.nationalMode,t):"";i=this._7(i),"function"==typeof this.d.customPlaceholder&&(i=this.d.customPlaceholder(i,this.s)),this.a.setAttribute("placeholder",i)}}},{key:"_1",value:function(e){var t=this._z(e.getAttribute("data-country-code"));this._2(),this._4(e.getAttribute("data-dial-code"),!0),this.a.focus();var i=this.a.value.length;this.a.setSelectionRange(i,i),t&&this._m2CountryChange()}},{key:"_2",value:function(){this.m.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.u.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._a3),document.documentElement.removeEventListener("click",this._a2),this.m.removeEventListener("mouseover",this._a0),this.m.removeEventListener("click",this._a1),this.d.dropdownContainer&&(this.g||window.removeEventListener("scroll",this._a4),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._m2("close:countrydropdown")}},{key:"_3",value:function(e,t){var i=this.m,r=window.pageYOffset||document.documentElement.scrollTop,a=i.offsetHeight,n=i.getBoundingClientRect().top+r,o=n+a,d=e.offsetHeight,l=e.getBoundingClientRect().top+r,s=l+d,u=l-n+i.scrollTop,c=a/2-d/2;if(l<n)t&&(u-=c),i.scrollTop=u;else if(o<s){t&&(u+=c);var m=a-d;i.scrollTop=u-m}}},{key:"_4",value:function(e,t){var i,r=this.a.value,a="+".concat(e);if("+"===r.charAt(0)){var n=this._5(r);i=n?r.replace(n,a):a}else{if(this.d.nationalMode||this.d.separateDialCode)return;if(r)i=a+r;else{if(!t&&this.d.autoHideDialCode)return;i=a}}this.a.value=i}},{key:"_5",value:function(e,t){var i="";if("+"===e.charAt(0))for(var r="",a=0;a<e.length;a++){var n=e.charAt(a);if(!isNaN(parseInt(n,10))){if(r+=n,t)this.q[r]&&(i=e.substr(0,a+1));else if(this.dialCodes[r]){i=e.substr(0,a+1);break}if(r.length===this.countryCodeMaxLen)break}}return i}},{key:"_6",value:function(){var e=this.a.value.trim(),t=this.s.dialCode,i=this._m(e);return(this.d.separateDialCode&&"+"!==e.charAt(0)&&t&&i?"+".concat(t):"")+e}},{key:"_7",value:function(e){var t=e;if(this.d.separateDialCode){var i=this._5(t);if(i){var r=" "===t[(i="+".concat(this.s.dialCode)).length]||"-"===t[i.length]?i.length+1:i.length;t=t.substr(r)}}return this._j2(t)}},{key:"_m2CountryChange",value:function(){this._m2("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.d.initialCountry&&(this.j=window.intlTelInputGlobals.autoCountry,this.a.value||this.setCountry(this.j),this.h())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.a.value&&this._u(this.a.value),this._0()),this.i0()}},{key:"destroy",value:function(){var e=this.a.form;if(this.d.allowDropdown){this._2(),this.selectedFlag.removeEventListener("click",this._a10),this.k.removeEventListener("keydown",this._a11);var t=this._i1();t&&t.removeEventListener("click",this._a9)}this.hiddenInput&&e&&e.removeEventListener("submit",this._a14),this.d.autoHideDialCode&&(e&&e.removeEventListener("submit",this._a8),this.a.removeEventListener("blur",this._a8)),this.a.removeEventListener("keyup",this._a12),this.a.removeEventListener("cut",this._a13),this.a.removeEventListener("paste",this._a13),this.a.removeAttribute("data-intl-tel-input-id");var i=this.a.parentNode;i.parentNode.insertBefore(this.a,i),i.parentNode.removeChild(i),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._6(),this.s.iso2):""}},{key:"getNumber",value:function(e){if(window.intlTelInputUtils){var t=this.s.iso2;return intlTelInputUtils.formatNumber(this._6(),t,e)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._6(),this.s.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.s}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var e=this.s.iso2;return intlTelInputUtils.getValidationError(this._6(),e)}return-99}},{key:"isValidNumber",value:function(){var e=this._6().trim(),t=this.d.nationalMode?this.s.iso2:"";return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(e,t):null}},{key:"setCountry",value:function(e){var t=e.toLowerCase();this.l.classList.contains("iti__".concat(t))||(this._z(t),this._4(this.s.dialCode,!1),this._m2CountryChange())}},{key:"setNumber",value:function(e){var t=this._v(e);this._u(e),t&&this._m2CountryChange()}},{key:"setPlaceholderNumberType",value:function(e){this.d.placeholderNumberType=e,this._0()}}])&&r(e.prototype,t),i&&r(e,i),a;var e,t,i}();i.getCountryData=function(){return n};var c=function(e,t,i){var r=document.createElement("script");r.onload=function(){u("handleUtils"),t&&t()},r.onerror=function(){u("rejectUtilsScriptPromise"),i&&i()},r.className="iti-load-utils",r.async=!0,r.src=e,document.body.appendChild(r)};return i.loadUtils=function(i){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise(function(e,t){return c(i,e,t)});c(i)}return null},i.defaults=d,i.version="17.0.13",function(e,t){var i=new a(e,t);return i._init(),e.setAttribute("data-intl-tel-input-id",i.id),window.intlTelInputGlobals.instances[i.id]=i}}()});var gmapdata=new Array,gmapmarker=new Array;function if_gmap_init(e,t){if(document.getElementById(e+"_element"+t)){map=document.getElementById(e+"_element"+t);var i=parseInt(map.getAttribute("zoom")),r=map.getAttribute("center_x"),a=map.getAttribute("center_y"),n=new google.maps.LatLng(a,r);return gmapdata[e]=new google.maps.Map(document.getElementById(e+"_element"+t),{center:n,zoom:i,mapTypeId:"roadmap"}),gmapmarker[e]=new Array,!1}draggab=!1,map=document.getElementById(e);i=parseInt(map.getAttribute("zoom")),r=map.getAttribute("long"),a=map.getAttribute("lat"),n=new google.maps.LatLng(a,r);return gmapdata=new google.maps.Map(document.getElementById(e),{center:n,zoom:i,mapTypeId:"roadmap"}),geocoder=new google.maps.Geocoder,(gmapmarker=new google.maps.Marker({map:gmapdata,position:n,draggable:draggab})).setDraggable(draggab),infoW=new google.maps.InfoWindow,google.maps.event.addListener(gmapdata,"mouseover",function(e){document.getElementById("longval")||(gmapmarker.draggable=!1)}),google.maps.event.addListener(gmapdata,"click",function(e){document.getElementById("longval")&&(document.getElementById("longval").value=e.latLng.lng().toFixed(6),document.getElementById("latval").value=e.latLng.lat().toFixed(6),gmapmarker.setPosition(e.latLng),if_gmap_updateMap(),geocoder.geocode({latLng:gmapmarker.getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval")&&(document.getElementById("addrval").value=e[0].formatted_address)}))}),google.maps.event.addListener(gmapmarker,"drag",function(){document.getElementById("longval")&&(geocoder.geocode({latLng:gmapmarker.getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval")&&(document.getElementById("addrval").value=e[0].formatted_address)}),if_gmap_updateMap(),document.getElementById("latval").value=gmapmarker.getPosition().lat().toFixed(6),document.getElementById("longval").value=gmapmarker.getPosition().lng().toFixed(6))}),google.maps.event.addListener(gmapmarker,"click",function(){infoW.setContent('<div style="overflow: hidden;">'+document.getElementById(e).getAttribute("info")+"</div>");infoW.setOptions({maxWidth:"300"}),infoW.open(this.getMap(),this)}),document.getElementById("longval")&&(document.getElementById("longval").value=r,document.getElementById("latval").value=a,geocoder.geocode({latLng:gmapmarker.getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval")&&(document.getElementById("addrval").value=e[0].formatted_address)})),!1}function add_marker_on_map(e,t,i,r,a,n,o){var d=new google.maps.LatLng(r,i);return gmapmarker[e][t]=new google.maps.Marker({map:gmapdata[e],position:d,draggable:o}),gmapmarker[e][t].setDraggable(o),o&&google.maps.event.addListener(gmapmarker[e][t],"drag",function(){document.getElementById(e+"_lat"+n).value=gmapmarker[e][t].getPosition().lat().toFixed(6),document.getElementById(e+"_long"+n).value=gmapmarker[e][t].getPosition().lng().toFixed(6)}),infoW=new google.maps.InfoWindow,google.maps.event.addListener(gmapmarker[e][t],"click",function(){infoW.setContent('<div style="overflow: hidden;">'+document.getElementById(e+"_element"+n).getAttribute("info"+t)+"</div>");infoW.setOptions({maxWidth:"300"}),infoW.open(this.getMap(),this)}),!1}!function(L){function i(e,t){var n=this,o=L.extend({},L.fn.signaturePad.defaults,t),d=L(e),i=L(o.canvas,d),l=i.get(0),s=null,u={x:null,y:null},c=[],m=!1,r=!1,a=!1,_=!1,f=30,p=f,y=0;function h(){clearTimeout(m),r=m=!1}function v(e,t){var i,r,a;if(e.preventDefault(),i=L(e.target).offset(),clearTimeout(m),m=!1,a=void 0!==e.targetTouches?(r=Math.floor(e.targetTouches[0].pageX-i.left),Math.floor(e.targetTouches[0].pageY-i.top)):(r=Math.floor(e.pageX-i.left),Math.floor(e.pageY-i.top)),u.x===r&&u.y===a)return!0;null===u.x&&(u.x=r),null===u.y&&(u.y=a),t&&(a+=t),s.beginPath(),s.moveTo(u.x,u.y),s.lineTo(r,a),s.lineCap=o.penCap,s.stroke(),s.closePath(),c.push({lx:r,ly:a,mx:u.x,my:u.y}),u.x=r,u.y=a,o.onDraw&&"function"==typeof o.onDraw&&o.onDraw.apply(n)}function w(){g()}function g(e){e?v(e,1):(a?i.each(function(){this.removeEventListener("touchmove",v)}):i.unbind("mousemove.signaturepad"),0<c.length&&o.onDrawEnd&&"function"==typeof o.onDrawEnd&&o.onDrawEnd.apply(n)),u.x=null,u.y=null,o.output&&0<c.length&&L(o.output,d).val(JSON.stringify(c))}function b(){s.clearRect(0,0,l.width,l.height),s.fillStyle=o.bgColour,s.fillRect(0,0,l.width,l.height),o.displayOnly||o.lineWidth&&(s.beginPath(),s.lineWidth=o.lineWidth,s.strokeStyle=o.lineColour,s.moveTo(o.lineMargin,o.lineTop),s.lineTo(l.width-o.lineMargin,o.lineTop),s.stroke(),s.closePath()),s.lineWidth=o.penWidth,s.strokeStyle=o.penColour,L(o.output,d).val(""),c=[],g()}function j(e,t){null==u.x?v(e,1):v(e,t)}function Q(e,t){a?t.addEventListener("touchmove",j,!1):i.bind("mousemove.signaturepad",j),v(e,1)}function k(e){if(_)return!1;_=!0,L("input").blur(),void 0!==e.targetTouches&&(a=!0),a?(i.each(function(){this.addEventListener("touchend",w,!1),this.addEventListener("touchcancel",w,!1)}),i.unbind("mousedown.signaturepad")):(L(document).bind("mouseup.signaturepad",function(){r&&(g(),h())}),i.bind("mouseleave.signaturepad",function(e){r&&g(e),r&&!m&&(m=setTimeout(function(){g(),h()},500))}),i.each(function(){this.ontouchstart=null}))}function C(){L(o.typed,d).hide(),b(),i.each(function(){this.addEventListener("touchstart",function(e){e.preventDefault(),r=!0,k(e),Q(e,this)})}),i.bind("mousedown.signaturepad",function(e){if(e.preventDefault(),1<e.which)return!1;r=!0,k(e),Q(e)}),L(o.clear,d).bind("click.signaturepad",function(e){e.preventDefault(),b()}),L(o.typeIt,d).bind("click.signaturepad",function(e){e.preventDefault(),x()}),L(o.drawIt,d).unbind("click.signaturepad"),L(o.drawIt,d).bind("click.signaturepad",function(e){e.preventDefault()}),L(o.typeIt,d).removeClass(o.currentClass),L(o.drawIt,d).addClass(o.currentClass),L(o.sig,d).addClass(o.currentClass),L(o.typeItDesc,d).hide(),L(o.drawItDesc,d).show(),L(o.clear,d).show()}function x(){b(),_=!1,i.each(function(){this.removeEventListener&&(this.removeEventListener("touchend",w),this.removeEventListener("touchcancel",w),this.removeEventListener("touchmove",v)),this.ontouchstart&&(this.ontouchstart=null)}),L(document).unbind("mouseup.signaturepad"),i.unbind("mousedown.signaturepad"),i.unbind("mousemove.signaturepad"),i.unbind("mouseleave.signaturepad"),L(o.clear,d).unbind("click.signaturepad"),L(o.typed,d).show(),L(o.drawIt,d).bind("click.signaturepad",function(e){e.preventDefault(),C()}),L(o.typeIt,d).unbind("click.signaturepad"),L(o.typeIt,d).bind("click.signaturepad",function(e){e.preventDefault()}),L(o.output,d).val(""),L(o.drawIt,d).removeClass(o.currentClass),L(o.typeIt,d).addClass(o.currentClass),L(o.sig,d).removeClass(o.currentClass),L(o.drawItDesc,d).hide(),L(o.clear,d).hide(),L(o.typeItDesc,d).show(),p=f=L(o.typed,d).css("font-size").replace(/px/,"")}function I(e){var t=L(o.typed,d),i=L.trim(e.replace(/>/g,"&gt;").replace(/</g,"&lt;")),r=y,a=.5*p;if(y=i.length,t.html(i),i){if(r<y&&t.outerWidth()>l.width)for(;t.outerWidth()>l.width;)p--,t.css("font-size",p+"px");if(y<r&&t.outerWidth()+a<l.width&&p<f)for(;t.outerWidth()+a<l.width&&p<f;)p++,t.css("font-size",p+"px")}else t.css("font-size",f+"px")}function E(){var e=!0,t={drawInvalid:!1,nameInvalid:!1},i=[d,o],r=[t,d,o];return o.onBeforeValidate&&"function"==typeof o.onBeforeValidate?o.onBeforeValidate.apply(n,i):function(e,t){L("p."+t.errorClass,e).remove(),e.removeClass(t.errorClass),L("input, label",e).removeClass(t.errorClass)}.apply(n,i),o.drawOnly&&c.length<1&&(e=!(t.drawInvalid=!0)),""===L(o.name,d).val()&&(e=!(t.nameInvalid=!0)),o.onFormError&&"function"==typeof o.onFormError?o.onFormError.apply(n,r):function(e,t,i){e.nameInvalid&&(t.prepend(['<p class="',i.errorClass,'">',i.errorMessage,"</p>"].join("")),L(i.name,t).focus(),L(i.name,t).addClass(i.errorClass),L("label[for="+L(i.name).attr("id")+"]",t).addClass(i.errorClass)),e.drawInvalid&&t.prepend(['<p class="',i.errorClass,'">',i.errorMessageDraw,"</p>"].join(""))}.apply(n,r),e}function A(e,t,i){for(var r in e)"object"==typeof e[r]&&(t.beginPath(),t.moveTo(e[r].mx,e[r].my),t.lineTo(e[r].lx,e[r].ly),t.lineCap=o.penCap,t.stroke(),t.closePath(),i&&e[r].lx&&c.push({lx:e[r].lx,ly:e[r].ly,mx:e[r].mx,my:e[r].my}))}L.extend(n,{signaturePad:"2.5.2",init:function(){parseFloat((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)||[0,"4_2"])[1].replace("_","."))<4.1&&(L.fn.Oldoffset=L.fn.offset,L.fn.offset=function(){var e=L(this).Oldoffset();return e.top-=window.scrollY,e.left-=window.scrollX,e}),L(o.typed,d).bind("selectstart.signaturepad",function(e){return L(e.target).is(":input")}),i.bind("selectstart.signaturepad",function(e){return L(e.target).is(":input")}),!l.getContext&&FlashCanvas&&FlashCanvas.initElement(l),l.getContext&&(s=l.getContext("2d"),L(o.sig,d).show(),o.displayOnly||(o.drawOnly||(L(o.name,d).bind("keyup.signaturepad",function(){I(L(this).val())}),L(o.name,d).bind("blur.signaturepad",function(){I(L(this).val())}),L(o.drawIt,d).bind("click.signaturepad",function(e){e.preventDefault(),C()})),o.drawOnly||"drawIt"===o.defaultAction?C():x(),o.validateFields&&(L(e).is("form")?L(e).bind("submit.signaturepad",function(){return E()}):L(e).parents("form").bind("submit.signaturepad",function(){return E()})),L(o.sigNav,d).show()))},updateOptions:function(e){L.extend(o,e)},regenerate:function(e){n.clearCanvas(),L(o.typed,d).hide(),"string"==typeof e&&(e=JSON.parse(e)),A(e,s,!0),o.output&&0<L(o.output,d).length&&L(o.output,d).val(JSON.stringify(c))},clearCanvas:function(){b()},getSignature:function(){return c},getSignatureString:function(){return JSON.stringify(c)},getSignatureImage:function(){var e,t=document.createElement("canvas"),i=null;return t.style.position="absolute",t.style.top="-999em",t.width=l.width,t.height=l.height,document.body.appendChild(t),!t.getContext&&FlashCanvas&&FlashCanvas.initElement(t),(i=t.getContext("2d")).fillStyle=o.bgColour,i.fillRect(0,0,l.width,l.height),i.lineWidth=o.penWidth,i.strokeStyle=o.penColour,A(c,i),e=t.toDataURL.apply(t,arguments),document.body.removeChild(t),t=null,e},validateForm:function(){return E()}})}L.fn.signaturePad=function(e){var t=null;return this.each(function(){L.data(this,"plugin-signaturePad")?(t=L.data(this,"plugin-signaturePad")).updateOptions(e):((t=new i(this,e)).init(),L.data(this,"plugin-signaturePad",t))}),t},L.fn.signaturePad.defaults={defaultAction:"typeIt",displayOnly:!1,drawOnly:!1,canvas:"canvas",sig:".sig",sigNav:".sigNav",bgColour:"#ffffff",penColour:"#145394",penWidth:2,penCap:"round",lineColour:"#ccc",lineWidth:2,lineMargin:5,lineTop:35,name:".name",typed:".typed",clear:".clearButton",typeIt:".typeIt a",drawIt:".drawIt a",typeItDesc:".typeItDesc",drawItDesc:".drawItDesc",output:".output",currentClass:"current",validateFields:!0,errorClass:"error",errorMessage:"Please enter your name",errorMessageDraw:"Please sign the document",onBeforeValidate:null,onFormError:null,onDraw:null,onDrawEnd:null}}(jQuery);
1
+ var fm_rated=!1;function form_load_actions(){jQuery(".wd-datepicker").each(function(){jQuery(this).datepicker(),jQuery(this).datepicker("option","dateFormat",jQuery(this).data("format"))});var e=jQuery(".fm-form").find(".fm-message");0!==e.length&&0==e.closest(".fm-popover-content").length&&0==e.closest(".fm-scrollbox-form").length&&0==e.closest(".fm-topbar").length&&(jQuery(window).scrollTop(jQuery(".fm-message").offset().top-100),-1<navigator.userAgent.toLowerCase().indexOf("safari/")&&(document.scrollingElement.scrollTop=jQuery(".fm-message").offset().top-100));if(0!==jQuery(".fm-form").find(".message_captcha").length){var t=jQuery(".fm-form").attr("name").split("form")[1];if(0!==jQuery("#form"+t+" .message_captcha").length){var i=jQuery(jQuery("#form"+t+" .message_captcha")).offset().top;jQuery(".fm-form").find(".message_captcha").parents(".wdform-field").find(".wdform-label").addClass("error_label"),jQuery("html").animate({scrollTop:i-150},500),document.scrollingElement.scrollTop=i-150}}}function set_total_value(form_id){var getDataHideCurreny=jQuery(".paypal_total"+form_id).parent().parent().attr("data-hide-currency");if("yes"==getDataHideCurreny)var toggle_currency="wd-hidden",FormCurrency="";else var toggle_currency="wd-inline-block",FormCurrency=window["FormCurrency_"+form_id]+" ";if(0!=jQuery(".paypal_total"+form_id).length){var div_paypal_show=jQuery(".paypal_total"+form_id),div_paypal_products=jQuery(".paypal_products"+form_id),div_paypal_tax=jQuery(".paypal_tax"+form_id),input_paypal_total=jQuery(".input_paypal_total"+form_id),total=0,total_shipping=0;div_paypal_products.html(""),div_paypal_tax.html(""),n=parseInt(jQuery("#counter"+form_id).val()),jQuery("#form"+form_id+" div[type='type_paypal_checkbox'], #form"+form_id+" div[type='type_paypal_radio']").each(function(){var e=jQuery(this).parent();if("none"!=e.css("display")){var t=e.attr("wdid");paypal_checkbox_qty=jQuery("#wdform_"+t+"_element_quantity"+form_id).val()?jQuery("#wdform_"+t+"_element_quantity"+form_id).val():0,jQuery(this).find("input:checked").each(function(){label=jQuery("label[for='"+jQuery(this).attr("id")+"']").html(),span_value='<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+jQuery(this).val()+(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?" x "+paypal_checkbox_qty:""),total+=jQuery(this).val()*parseInt(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?paypal_checkbox_qty:1),div_paypal_products.html(div_paypal_products.html()+"<div>"+label+" - "+span_value+"</div>")})}}),jQuery("#form"+form_id+" div[type='type_paypal_shipping']").each(function(){var e=jQuery(this).parent();if("none"!=e.css("display")){var t=e.attr("wdid");paypal_shipping_qty=jQuery("#wdform_"+t+"_element_quantity"+form_id).val()?jQuery("#wdform_"+t+"_element_quantity"+form_id).val():0,jQuery(this).find("input:checked").each(function(){label=jQuery("label[for='"+jQuery(this).attr("id")+"']").html(),span_value='<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+jQuery(this).val()+(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?" x "+paypal_shipping_qty:""),total_shipping+=jQuery(this).val()*parseInt(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?paypal_shipping_qty:1),div_paypal_products.html(div_paypal_products.html()+"<div>"+label+" - "+span_value+"</div>")})}}),jQuery("#form"+form_id+" div[type='type_paypal_select']").each(function(){var e=jQuery(this).parent();if("none"!=e.css("display")){var t=e.attr("wdid");paypal_select_qty=jQuery("#wdform_"+t+"_element_quantity"+form_id).val()?jQuery("#wdform_"+t+"_element_quantity"+form_id).val():0,""!=jQuery(this).find("select").val()&&(label=jQuery(this).find("select option:selected").html(),span_value='<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+jQuery(this).find("select").val()+(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?" x "+paypal_select_qty:""),total+=jQuery(this).find("select").val()*parseInt(0!=jQuery("#wdform_"+t+"_element_quantity"+form_id).length?paypal_select_qty:1),div_paypal_products.html(div_paypal_products.html()+"<div>"+label+" - "+span_value+"</div>"))}}),jQuery("#form"+form_id+" div[type='type_paypal_price']").each(function(){var e=jQuery(this).parent();if("none"!=e.css("display")){var t=e.attr("wdid");label=jQuery(this).find(".wdform-label").html(),cents="00",dollars="0",""!=jQuery("#wdform_"+t+"_element_dollars"+form_id).val()&&(dollars=jQuery("#wdform_"+t+"_element_dollars"+form_id).val()),""!=jQuery("#wdform_"+t+"_element_cents"+form_id).val()&&(1==jQuery("#wdform_"+t+"_element_cents"+form_id).val().length?cents="0"+jQuery("#wdform_"+t+"_element_cents"+form_id).val():cents=jQuery("#wdform_"+t+"_element_cents"+form_id).val(),span_value='<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+dollars+"."+cents,total+=parseFloat(dollars+"."+cents),div_paypal_products.html(div_paypal_products.html()+"<div>"+label+" - "+span_value+"</div>"))}}),jQuery("#form"+form_id+" div[type='type_paypal_price_new']").each(function(){var e=jQuery(this).parent();if("none"!=e.css("display")){var t=e.attr("wdid");label=jQuery(this).find(".wdform-label").html(),dollars="0",""!=jQuery("#wdform_"+t+"_element"+form_id).val()&&(dollars=jQuery("#wdform_"+t+"_element"+form_id).val()),span_value='<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+dollars,total+=parseFloat(dollars),div_paypal_products.html(div_paypal_products.html()+"<div>"+label+" - "+span_value+"</div>")}});var FormPaypalTax=eval("FormPaypalTax_"+form_id);0!=FormPaypalTax&&div_paypal_tax.html("Tax: "+FormCurrency+(total*FormPaypalTax/100).toFixed(2)),jQuery(".div_total"+form_id).html('<span class="'+toggle_currency+'">'+FormCurrency+"</span>"+(parseFloat((total*(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2)),input_paypal_total.val(FormCurrency+(parseFloat((total*(1+FormPaypalTax/100)).toFixed(2))+total_shipping).toFixed(2))}}function check_isnum_or_minus(e){var t=e.which||e.keyCode;return!(45!=t&&31<t&&(t<48||57<t))}function sum_grading_values(e,t){for(var i=0,r=0;r<100;r++)document.getElementById(e+"_element"+t+"_"+r)&&document.getElementById(e+"_element"+t+"_"+r).value&&(i+=parseInt(document.getElementById(e+"_element"+t+"_"+r).value)),document.getElementById(e+"_total_element"+t)&&(i>document.getElementById(e+"_total_element"+t).innerHTML?document.getElementById(e+"_text_element"+t).innerHTML=" "+fm_objectL10n.fm_grading_text+" "+document.getElementById(e+"_total_element"+t).innerHTML:document.getElementById(e+"_text_element"+t).innerHTML="");document.getElementById(e+"_sum_element"+t)&&(document.getElementById(e+"_sum_element"+t).innerHTML=i)}function change_src(e,t,i,r){if(0==fm_rated)for(var a=0;a<=e;a++)document.getElementById(t+"_star_"+a+"_"+i).src=fm_objectL10n.plugin_url+"/images/star_"+r+".png"}function reset_src(e,t,i){if(0==fm_rated)for(var r=0;r<=e;r++)document.getElementById(t+"_star_"+r+"_"+i).src=fm_objectL10n.plugin_url+"/images/star.png"}function select_star_rating(e,t,i,r,a){fm_rated=!0;for(var n=0;n<=e;n++)document.getElementById(t+"_star_"+n+"_"+i).src=fm_objectL10n.plugin_url+"/images/star_"+r+".png";for(var o=e+1;o<=a-1;o++)document.getElementById(t+"_star_"+o+"_"+i).src=fm_objectL10n.plugin_url+"/images/star.png";document.getElementById(t+"_selected_star_amount"+i).value=e+1,jQuery("#"+t+"_selected_star_amount"+i).trigger("change")}function show_other_input(e,t){var i=jQuery(".form"+t+" [id^="+e+"_element"+t+'][other="1"]').parent(),r=document.createElement("br");r.setAttribute("id",e+"_other_br"+t);var a=e.split("_")[1],n=document.createElement("input");n.setAttribute("id",e+"_other_input"+t),n.setAttribute("name",e+"_other_input"+t),n.setAttribute("type","text"),n.setAttribute("class","other_input"),n.setAttribute("onchange","other_input_change(this, '"+t+"', '"+a+"')"),i.children("input").length<2&&(i.append(r),i.append(n))}function other_input_change(e,t,i){""==jQuery(e).val()?wd_is_filled(t,i):(jQuery("#form"+t+" #wd_required_"+i).remove(),jQuery("#form"+t+" div[wdid='"+i+"'] .wdform-label-section:first .error_label").removeClass("error_label"))}function check_isnum(e){var t=e.which||e.keyCode;return-1!=jQuery.inArray(t,[46,8,9,27,13,190])||!0===e.ctrlKey||35<=t&&t<39||45==t||!(31<t&&(t<48||57<t))}function captcha_refresh(e,t){srcArr=document.getElementById(e+t).src.split("&r="),document.getElementById(e+t).src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_input"+t).value="",document.getElementById(e+t).style.display="inline-block"}function set_checked(e,t,i){return checking=document.getElementById(e+"_element"+i+t),!(checking.getAttribute("other")&&1==checking.getAttribute("other")&&!checking.checked)||(document.getElementById(e+"_other_input"+i)&&(document.getElementById(e+"_other_input"+i).parentNode.removeChild(document.getElementById(e+"_other_br"+i)),document.getElementById(e+"_other_input"+i).parentNode.removeChild(document.getElementById(e+"_other_input"+i))),!1)}function set_default(e,t,i){document.getElementById(e+"_other_input"+i)&&(document.getElementById(e+"_other_input"+i).parentNode.removeChild(document.getElementById(e+"_other_br"+i)),document.getElementById(e+"_other_input"+i).parentNode.removeChild(document.getElementById(e+"_other_input"+i)))}function add_0(e){1==jQuery(e).val().length&&jQuery(e).val("0"+jQuery(e).val())}function wd_validate(e,t){if(!jQuery(e).is("input"))return!0;var i,r,a,n=jQuery(e).val(),o=(jQuery(e).attr("id"),jQuery(e).parent().find(".hidden_date")),d=jQuery(e).data("valid-type"),l=jQuery(e).data("form-id"),s=jQuery(e).data("wdid"),u=o.data("format"),c=new Date(o.data("min")),m=new Date(o.data("max")),_=parseInt(jQuery(e).attr("from")),f=parseInt(jQuery(e).attr("to"));if(void 0===t)t=jQuery(e).data("addiotional-fields");var p="#form"+l+" div[wdid='"+s+"']",y=jQuery(p+" .wdform-label-section:first .wdform-label"),h=jQuery(p+" .wdform-element-section");switch(d){case"hour24":i=fm_objectL10n.time_validation,a=/^(0?[0-1]?[0-9]|2[0-3])?$/;break;case"hour12":i=fm_objectL10n.time_validation,a=/^(0?[0-9]|1[0-2])?$/;break;case"minute":case"second":i=fm_objectL10n.time_validation,a=/^([0-5]?[0-9])?$/;break;case"number":i=fm_objectL10n.number_validation,a=/^\-{0,1}\d+(.\d+){0,1}$/;break;case"quantity":i=fm_objectL10n.number_validation,a=/^[+]?\d+([.]\d+)?$/;break;case"day":i=fm_objectL10n.date_validation,a=/^(0?[0-2]?[0-9]|3[0-1])?$/;break;case"month":i=fm_objectL10n.date_validation,a=/^(0?[0-9]|1[0-2])?$/;break;case"year":i=fm_objectL10n.date_validation,a=/^([1-2]?[0-9]?[0-9]?[0-9])?$/;break;case"date":a="mm/dd/yy"==u?(i=fm_objectL10n.date_validation,/^(0[1-9]|1[0-2])\/(0[1-9]|[1-2][0-9]|3[01])\/\d{4}$/):(i="",/^$/)}if(r=a.test(n),""!=n&&"mm/dd/yy"==u||(r=!0),r)for(var v in t)if(!(r=wd_validate("#"+t[v],"")))break;return"year"==d&&(parseInt(n)<_||parseInt(n)>f)&&(r=!1,i=fm_objectL10n.year_validation.replace("%%start%%",_).replace("%%end%%",f)),"date"==d&&(new Date(n)<c||new Date(n)>m)&&(r=!1,i=fm_objectL10n.date_validation),jQuery("#check_email_"+s+"_"+l).remove(),r?(y.removeClass("wd-error-label"),delete window["check_before_submit"+l][s+"_"+l]):(h.parent().parent().append("<div id='check_email_"+s+"_"+l+"' class='fm-not-filled'>"+i+"</div>"),y.addClass("wd-error-label"),window["check_before_submit"+l][s+"_"+l]=!1),r}function check_isnum_interval(e,t,i,r){var a=e.which||e.keyCode;return-1!=jQuery.inArray(a,[46,8,9,27,13,190])||!0===e.ctrlKey||35<=a&&a<39||!(31<a&&(a<48||57<a))&&(val1=""+jQuery(t).val()+String.fromCharCode(a),!(2<val1.length)&&("00"!=val1&&!(val1<i||val1>r)))}function destroyChildren(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function generate_page_nav(e,t,i){var r;if(form_view=e,page_nav=document.getElementById(t+"page_nav"+e),destroyChildren(page_nav),form_view_elemet=document.getElementById(t+"form_view"+e),remove_whitespace(form_view_elemet.parentNode.parentNode),display_none_form_views_all(t),form_view_elemet.parentNode.style.display="",(r=document.createElement("div")).setAttribute("valign","middle"),r.setAttribute("align","left"),r.style.display="table-cell",r.style.width="40%",page_nav.appendChild(r),form_view_elemet.parentNode.previousSibling&&-1!=form_view_elemet.parentNode.previousSibling.className.indexOf("wdform-page-and-images")&&form_view_elemet.parentNode.previousSibling.previousSibling&&("DIV"==form_view_elemet.parentNode.previousSibling.tagName?table=form_view_elemet.parentNode.previousSibling:"DIV"==form_view_elemet.parentNode.previousSibling.previousSibling.tagName?table=form_view_elemet.parentNode.previousSibling.previousSibling:table="none","none"!=table&&(table.firstChild.tagName||table.removeChild(table.firstChild),previous_title=form_view_elemet.getAttribute("previous_title"),previous_type=form_view_elemet.getAttribute("previous_type"),"text"==previous_type&&r.setAttribute("class","previous-page"),previous_class=form_view_elemet.getAttribute("previous_class"),previous_checkable=form_view_elemet.getAttribute("previous_checkable"),next_or_previous="previous",previous=make_pagebreak_button(next_or_previous,previous_title,previous_type,previous_class,previous_checkable,e,t,i),r.appendChild(previous))),(r=document.createElement("div")).setAttribute("id",t+"page_numbers"+form_view),r.setAttribute("valign","middle"),r.setAttribute("class","page-numbers"),r.setAttribute("align","center"),r.style.display="table-cell","true"==document.getElementById("fm-pages"+t).getAttribute("show_numbers")){var a=document.createElement("span");a.setAttribute("class","page_numbers"),r.appendChild(a)}page_nav.appendChild(r),(r=document.createElement("div")).setAttribute("valign","middle"),r.setAttribute("align","right"),r.style.cssText="display:table-cell; width:40%; text-align:right;",page_nav.appendChild(r),not_next=!1,form_view_elemet.parentNode.nextSibling?("DIV"==form_view_elemet.parentNode.nextSibling.tagName&&-1!=form_view_elemet.parentNode.nextSibling.className.indexOf("wdform-page-and-images")?table=form_view_elemet.parentNode.nextSibling:form_view_elemet.parentNode.nextSibling.nextSibling&&"DIV"==form_view_elemet.parentNode.nextSibling.nextSibling.tagName?table=form_view_elemet.parentNode.nextSibling.nextSibling:table="none","none"!=table?(next_title=form_view_elemet.getAttribute("next_title"),next_type=form_view_elemet.getAttribute("next_type"),"text"==next_type&&r.setAttribute("class","next-page"),next_class=form_view_elemet.getAttribute("next_class"),next_checkable=form_view_elemet.getAttribute("next_checkable"),next_or_previous="next",next=make_pagebreak_button(next_or_previous,next_title,next_type,next_class,next_checkable,e,t,i),r.appendChild(next)):not_next=!0):not_next=!0,generate_page_bar(e,t,i),fm_initilize_form(t)}function fm_initilize_form(e){jQuery("#form"+e+" div[type='type_map']").each(function(){for(id=jQuery(this).parent().attr("wdid"),if_gmap_init("wdform_"+id,e),q=0;q<20;q++)jQuery("#wdform_"+id+"_element"+e)[0].getAttribute("long"+q)&&(w_long=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("long"+q)),w_lat=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("lat"+q)),w_info=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("info"+q)),add_marker_on_map("wdform_"+id,q,w_long,w_lat,w_info,e,!1))}),jQuery("#form"+e+" div[type='type_mark_map']").each(function(){id=jQuery(this).parent().attr("wdid"),if_gmap_init("wdform_"+id,e),q=0,jQuery("#wdform_"+id+"_element"+e)[0].getAttribute("long"+q)&&(w_long=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("long"+q)),w_lat=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("lat"+q)),w_info=parseFloat(document.getElementById("wdform_"+id+"_element"+e).getAttribute("info"+q)),add_marker_on_map("wdform_"+id,q,w_long,w_lat,w_info,e,!0))}),jQuery(".wdform-element-section").each(function(){if("type_stripe"==jQuery(this).parent().attr("type")){jQuery(this).parent().parent().find(".stripe_more_info .wdform-label-section").removeClass("wd-hidden");return!0}jQuery(this).parent()[0].style.width||0==parseInt(jQuery(this).width())||0==jQuery(this).parent().find(jQuery(".wdform-label-section")).length||"table-cell"==jQuery(this).css("display")&&("type_captcha"!=jQuery(this).parent().attr("type")?jQuery(this).parent().css("width",parseInt(jQuery(this).width())+parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15):jQuery(this).parent().css("width",2*parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width)+50+parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15))}),jQuery("#form"+e+" div[type='type_signature']").length&&"undefined"!=typeof fm_signature_init&&fm_signature_init()}function display_none_form_views_all(e){jQuery("#form"+e+" .wdform-page-and-images").css("display","none")}function generate_page_bar(t,i,e){if("steps"==document.getElementById("fm-pages"+i).getAttribute("type")?make_page_steps_front(t,i,e):"percentage"==document.getElementById("fm-pages"+i).getAttribute("type")?make_page_percentage_front(t,i,e):make_page_none_front(i),"true"==document.getElementById("fm-pages"+i).getAttribute("show_numbers")){if(td=document.getElementById(i+"page_numbers"+t),td){destroyChildren(td);var r=0,a=0;jQuery("#form"+i+" .wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id");j=e.split("form_view")[1],document.getElementById(i+"form_view"+j)&&(r++,j==t&&(a=r))});var n=document.createElement("span");n.setAttribute("class","page_numbers"),n.innerHTML=a+"/"+r,td.appendChild(n)}}else td=document.getElementById(i+"page_numbers"+t),td&&destroyChildren(document.getElementById(i+"page_numbers"+t))}function make_page_steps_front(t,i,r){destroyChildren(document.getElementById("fm-pages"+i)),show_title="true"==document.getElementById("fm-pages"+i).getAttribute("show_title"),next_checkable="true"==document.getElementById(i+"form_view"+t).getAttribute("next_checkable"),previous_checkable="true"==document.getElementById(i+"form_view"+t).getAttribute("previous_checkable"),k=0,jQuery("#form"+i+" .wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id");j=e.split("form_view")[1],document.getElementById(i+"form_view"+j)&&(document.getElementById(i+"form_view"+j).getAttribute("page_title")?w_pages=document.getElementById(i+"form_view"+j).getAttribute("page_title"):w_pages="",k++,page_number=document.createElement("span"),page_number.setAttribute("id","page_"+j),j<t&&(previous_checkable?page_number.setAttribute("onClick","if(fm_check("+t+", "+i+', false)) generate_page_nav("'+j+'", "'+i+'", "'+r+'")'):page_number.setAttribute("onClick",'generate_page_nav("'+j+'", "'+i+'", "'+r+'")')),j>t&&(next_checkable?page_number.setAttribute("onClick","if(fm_check("+t+", "+i+', false)) generate_page_nav("'+j+'", "'+i+'", "'+r+'")'):page_number.setAttribute("onClick",'generate_page_nav("'+j+'", "'+i+'", "'+r+'")')),j==t?page_number.setAttribute("class","page_active"):page_number.setAttribute("class","page_deactive"),show_title?page_number.innerHTML=w_pages:page_number.innerHTML=k,document.getElementById("fm-pages"+i).appendChild(page_number))})}function make_page_percentage_front(t,i,e){destroyChildren(document.getElementById("fm-pages"+i)),show_title="true"==document.getElementById("fm-pages"+i).getAttribute("show_title");var r=document.createElement("div");r.setAttribute("class","page_percentage_deactive");var a=document.createElement("div");a.setAttribute("id","div_percentage"),a.setAttribute("class","page_percentage_active"),a.setAttribute("align","right");var n=document.createElement("div");n.setAttribute("class","wdform_percentage_arrow");var o=document.createElement("b");o.setAttribute("class","wdform_percentage_text"),a.appendChild(o),k=0,cur_page_title="",jQuery(".form"+i+" .wdform-page-and-images").each(function(){var e=jQuery(this).find(".wdform_page").attr("id");j=e.split("form_view")[1],document.getElementById(i+"form_view"+j)&&(document.getElementById(i+"form_view"+j).getAttribute("page_title")?w_pages=document.getElementById(i+"form_view"+j).getAttribute("page_title"):w_pages="",k++,j==t&&(show_title&&(cur_page_title=document.createElement("div"),cur_page_title.innerHTML=w_pages,cur_page_title.innerHTML=w_pages,cur_page_title.setAttribute("class","wdform_percentage_title")),page_number=k))}),o.innerHTML=Math.round((page_number-1)/(k-1)*100)+"%",a.style.width=(page_number-1)/(k-1)*100+"%",1==page_number&&(n.style.display="none"),r.appendChild(a),r.appendChild(n),cur_page_title&&r.appendChild(cur_page_title),document.getElementById("fm-pages"+i).appendChild(r)}function make_page_none_front(e){destroyChildren(document.getElementById("fm-pages"+e))}function make_pagebreak_button(e,t,i,r,a,n,o,d){switch(i){case"text":return(l=document.createElement("div")).setAttribute("id","page_"+e+"_"+n+"_"+o),l.setAttribute("class",r),"true"==a?l.setAttribute("onClick","if(fm_check("+n+", "+o+", false)) page_"+e+"("+n+","+o+","+d+")"):l.setAttribute("onClick","page_"+e+"("+n+","+o+","+d+")"),l.innerHTML=t,l;case"img":var l;return(l=document.createElement("img")).setAttribute("id","page_"+e+"_"+n),l.setAttribute("class",r),"true"==a?l.setAttribute("onClick","if(fm_check("+n+", "+o+", false)) page_"+e+"("+n+","+o+","+d+")"):l.setAttribute("onClick","page_"+e+"("+n+","+o+","+d+")"),0==t.indexOf("http")?l.src=t:l.src=fm_objectL10n.plugin_url+"/"+t,l}}function form_maker_findPos(e){var t=0;if(e.offsetParent){for(;t+=e.offsetTop,e=e.offsetParent;);return[t]}}function page_previous(e,t,i){form_view_elemet=document.getElementById(t+"form_view"+e),form_view_elemet.parentNode.previousSibling&&form_view_elemet.parentNode.previousSibling.previousSibling&&("DIV"==form_view_elemet.parentNode.previousSibling.tagName?table=form_view_elemet.parentNode.previousSibling:table=form_view_elemet.parentNode.previousSibling.previousSibling),table.firstChild.tagName||table.removeChild(table.firstChild),generate_page_nav(table.firstChild.id.replace(t+"form_view",""),t,i),form=jQuery("#form"+t),form.parent().hasClass("fm-scrollbox-form")||(jQuery("html").animate({scrollTop:form.offset().top-150},500),document.scrollingElement.scrollTop=form.offset().top-150)}function page_next(e,t,i){form_view_elemet=document.getElementById(t+"form_view"+e),form_view_elemet.parentNode.nextSibling&&("DIV"==form_view_elemet.parentNode.nextSibling.tagName?table=form_view_elemet.parentNode.nextSibling:table=form_view_elemet.parentNode.nextSibling.nextSibling),table.firstChild.tagName||table.removeChild(table.firstChild),generate_page_nav(table.firstChild.id.replace(t+"form_view",""),t,i),form=jQuery("#form"+t),form.parent().hasClass("fm-scrollbox-form")||(jQuery("html").animate({scrollTop:form.offset().top-150},500),document.scrollingElement.scrollTop=form.offset().top-150)}function fm_go_to_page(e,t,i){form_view_elemet=document.getElementById(t+"form_view"+e),table=form_view_elemet.parentNode,table.firstChild.tagName||table.removeChild(table.firstChild),generate_page_nav(table.firstChild.id.replace(t+"form_view",""),t,i),form=jQuery("#form"+t),form.parent().hasClass("fm-scrollbox-form")||(jQuery("html").animate({scrollTop:form.offset().top-150},500),document.scrollingElement.scrollTop=form.offset().top-150)}function getfileextension(e,t){if(void 0===e||0==e.length)return!0;var i=e.lastIndexOf("."),r=e.substr(i+1,e.length);t=t.split(",");for(var a=0;a<t.length;a++)if(t[a]=t[a].replace(/\./g,""),t[a]=t[a].replace(/ /g,""),r.toLowerCase()==t[a].toLowerCase())return!0;return!1}function reselect(e,t){t=void 0!==t?t:"",jQuery(e).wrap('<div class="sel-wrap '+t+'"/>');var i="",r=!1;jQuery(e).children("option").each(function(){jQuery(this).is(":selected")&&(r=jQuery(this).index()),i=i+'<div class="sel-option" value="'+jQuery(this).val()+'">'+jQuery(this).html()+"</div>"}),w=jQuery(e)[0].style.width,"100%"==w?w="100%":w=jQuery(e).width()+32+"px";var a='<div class="sel-imul" style="width:'+w+'"> <div class="sel-selected"> <div class="selected-text">'+jQuery(e).children("option").eq(r).html()+'</div> <div class="sel-arraw"></div> </div> <div class="sel-options">'+i+"</div> </div>";jQuery(e).addClass("no-width"),jQuery(e).before(a)}jQuery(window).on("load",function(){0<jQuery(".g-recaptcha").length&&1!=jQuery(".g-recaptcha").data("render")&&fmRecaptchaInit(0),validate_received_data_from_url(),jQuery(".submissions").length&&jQuery(".submissions td").each(function(){"0"==jQuery(this).data("status")&&jQuery(this).parent().hide()})}),jQuery(document).on("change",'.wdform-element-section input[type="checkbox"],.wdform-element-section input[type="radio"], .wdform-quantity',function(){var e=jQuery(this).closest(".wdform-field").attr("data-limit"),t=jQuery(this).closest(".wdform-field").attr("data-limit-text"),i=jQuery(this).closest(".wdform-element-section").find("input[type='checkbox']:checked").length,r=jQuery(this).closest(".wdform-element-section").find(".other_input");e<i?(this.checked=!1,1==this.getAttribute("other")&&(i.checked||r&&(r.prev("br").remove(),r.remove())),jQuery(this).closest(".wdform-field").find(".wdform-label").addClass("error_label"),0==jQuery(".fm-error").length&&jQuery(this).closest(".wdform_row").append("<div class='fm-error'>"+t+"</div>")):(jQuery(this).closest(".wdform-field").find(".wdform-label").removeClass("error_label"),jQuery(".fm-error").remove())}),jQuery(document).on("change",".wdform-element-section select",function(){var e=jQuery(this).children("option:selected").text();jQuery(this).parent(".sel-wrap ").children(".sel-imul").children(".sel-selected").children(".selected-text").html(e),jQuery(this).parent(".sel-wrap ").children(".sel-imul").children(".sel-options").children(".sel-option").removeClass("sel-ed"),jQuery(this).addClass("sel-ed"),jQuery(this).parent(".sel-wrap ").children(".sel-imul").children(".sel-options").each(function(){jQuery(this).html()==e&&jQuery(this).addClass("sel-ed")})}),jQuery(document).on("change",'div[type="type_date_fields"]',function(){2<jQuery(this).find("select.sel-ed").length&&(jQuery(this).next(".fm-not-valid-date, .fm-not-filled").remove(),jQuery(this).find(".wdform-label").removeClass("error_label"))}),jQuery(document).on("click",".sel-imul",function(){jQuery(".sel-imul").removeClass("act"),jQuery(this).addClass("act"),jQuery(this).children(".sel-options").is(":visible")?jQuery(".sel-options").hide():(jQuery(".sel-options").hide(),jQuery(this).children(".sel-options").show(),jQuery(this).children(".sel-options").css("width",jQuery(this).width()))}),jQuery(document).on("click",".sel-option",function(){var e=jQuery(this).html();jQuery(this).parent(".sel-options").parent(".sel-imul").children(".sel-selected").children(".selected-text").html(e),jQuery(this).parent(".sel-options").children(".sel-option").removeClass("sel-ed"),jQuery(this).addClass("sel-ed");var t=jQuery(this).attr("value");t=void 0!==t?t:e,jQuery(this).parent(".sel-options").parent(".sel-imul").parent(".sel-wrap").children("select").children("option").prop("selected",!1).each(function(){jQuery(this).html()==e&&jQuery(this).attr("selected","select")}),jQuery(this).parent(".sel-options").parent(".sel-imul").parent(".sel-wrap").children("select").change()});var selenter=!1;function remove_whitespace(e){var t;for(t=0;t<e.childNodes.length;t++)e.childNodes[t]&&"3"==e.childNodes[t].nodeType&&!/\S/.test(e.childNodes[t].nodeValue)?(e.removeChild(e.childNodes[t]),t--):e.childNodes[t].childNodes.length&&remove_whitespace(e.childNodes[t])}function change_value_range(e,t,i,r,a){i?jQuery("#"+e).datepicker("option",t,i):"today"==r?jQuery("#"+e).datepicker("option",t,new Date):(-1==r.indexOf("d")&&-1==r.indexOf("m")&&-1==r.indexOf("y")&&-1==r.indexOf("w")&&""!=r&&(r=jQuery.datepicker.formatDate(a,new Date(r))),jQuery("#"+e).datepicker("option",t,r))}function wd_check_confirmation_email(e,t,i,r){var a=jQuery("#wdform_"+e+"_element"+t),n=jQuery("#wdform_"+e+"_1_element"+t);0==window["check_before_submit"+t][e+"_"+t]||jQuery(a).val()!=jQuery(n).val()?(jQuery("#confirm_"+e+"_"+t).remove(),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm"),jQuery(a).val()!=jQuery(n).val()&&(jQuery(n).parent().parent().parent().append("<div id='confirm_"+e+"_"+t+"' class='fm-not-filled'>"+i+"</div>"),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_confirm")),window["check_before_submit"+t][e+"_"+t]=!(e+"_"+t in window["check_before_submit"+t])||window["check_before_submit"+t][e+"_"+t]):(jQuery("#confirm_"+e+"_"+t).remove(),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm"),1==window["check_before_submit"+t][e+"_"+t]&&delete window["check_before_submit"+t][e+"_"+t])}function wd_check_email(e,t,i){var r=jQuery("#wdform_"+e+"_element"+t),a=jQuery("#wdform_"+e+"_1_element"+t);if(""==jQuery(r).val()||/^[\u0400-\u04FFa-zA-Z0-9'.+_-]+@[\u0400-\u04FFa-zA-Z0-9.-]+\.[\u0400-\u04FFa-zA-Z]{2,61}$/.test(jQuery.trim(jQuery(r).val()))||jQuery(r).attr("title")==jQuery(r).val())jQuery("#check_email_"+e+"_"+t).remove(),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:first .error_label_check_mail").removeClass("error_label_check_mail"),window["check_before_submit"+t][e+"_"+t]=!0,void 0===a.val()&&delete window["check_before_submit"+t][e+"_"+t];else{jQuery("#check_email_"+e+"_"+t).remove();var n=jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:first"),o=0;n.hasClass("wd-width-30")&&!n.hasClass("wd-hidden")&&(o=n.width()),jQuery(r).parent().parent().parent().append("<div id='check_email_"+e+"_"+t+"' class='fm-not-filled' style='margin-left: "+o+"px'>"+i+"</div>"),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_check_mail"),r.val()==a.val()&&(jQuery("#confirm_"+e+"_"+t).remove(),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .error_label_confirm").removeClass("error_label_confirm")),delete window["check_before_submit"+t][e+"_"+t],window["check_before_submit"+t][e+"_"+t]=!1}}function wd_check_confirmation_pass(e,t,i){var r,a=jQuery("#wdform_"+e+"_element"+t),n=jQuery("#wdform_"+e+"_1_element"+t);r=a.val()!==n.val();var o=jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:first"),d=0;o.hasClass("wd-width-30")&&!o.hasClass("wd-hidden")&&(d=o.width()),r?(jQuery("#confirm_"+e+"_"+t).remove(),jQuery(n).parent().parent().parent().append("<div id='confirm_"+e+"_"+t+"' class='fm-not-filled' style='margin-left: "+d+"px'>"+i+"</div>"),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .wdform-label").addClass("error_label_check_pass"),window["check_before_submit"+t][e+"_"+t]=!1):(jQuery("#confirm_"+e+"_"+t).remove(),jQuery("#form"+t+" div[wdid='"+e+"'] .wdform-label-section:eq( 1 ) .error_label_check_pass").removeClass("error_label_check_pass"),delete window["check_before_submit"+t][e+"_"+t])}function minimize_form(e){jQuery("#fm-scrollbox"+e).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown fm-minimized"),jQuery("#fm-minimize-text"+e).removeClass("fm-animated fadeOutDown").addClass("fm-show fm-animated fadeInUp")}function fm_show_scrollbox(e){jQuery("#fm-minimize-text"+e).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown"),jQuery("#fm-scrollbox"+e).removeClass("fm-animated fadeOutDown fm-minimized").addClass("fm-show fm-animated fadeInUp")}function fm_hide_form(e,t,i){var r=new Date;r.setDate(r.getDate()+t),0<t&&localStorage.setItem("hide-"+e,r.getTime()),"function"==typeof i&&i()}function wd_check_regExp(o,d){var l=jQuery("#form"+o),s=!1,e=d||window["check_regExp_all"+o];return jQuery.each(e,function(e,t){var i="#wdform_"+e+"_element"+o,r="",a=unescape(t[0]),n=l.find(jQuery("div[wdid='"+e+"']"));r=t[1].length<=0?new RegExp(a):new RegExp(a,t[1]),0!=l.find(jQuery("div[wdid='"+e+"']")).length&&"none"!=l.find(jQuery("div[wdid='"+e+"']")).css("display")&&(jQuery("#form"+o+" #wd_exp_"+e).remove(),""==jQuery(i).val()&&0==n.find(".wdform-required").length?(s=!0,l.find(jQuery("div[wdid='"+e+"'] .wdform-element-section")).parent().parent().append("<div id='wd_exp_"+e+"' class='fm-not-filled'>"+t[2]+"</div>"),jQuery("#form"+o+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_exp"),scroll_on_element(o)):jQuery(i).val()!=jQuery(i).attr("title")&&1!=r.test(jQuery(i).val())&&(l.find(jQuery("div[wdid='"+e+"'] .wdform-element-section")).parent().parent().append("<div id='wd_exp_"+e+"' class='fm-not-filled'>"+t[2]+"</div>"),jQuery("#form"+o+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_exp"),s=!0,d||scroll_on_element(o)))}),!1===s}function scroll_on_element(e){if(0==jQuery("#form"+e+" .fm-not-filled").length)return!0;var t=!0;0==jQuery("#fm_shake"+e).val()&&(t=!1);var i=jQuery("#form"+e+" .fm-not-filled").closest(".wdform_row"),r=i.closest(".wdform_page");if("none"==r.parent().css("display")){var a=jQuery("#form"+e+" .wdform-page-and-images").length,n=jQuery("#form"+e+" .wdform_page").last().attr("id");n=n.split("form_view");var o=r.attr("id");fm_go_to_page(o=o.split("form_view")[1],e,a,n[1])}var d=jQuery(document).scrollTop(),l=document.body.clientHeight,s=jQuery("#form"+e+" .fm-not-filled").closest("div[wdid]").height(),u=jQuery("#form"+e+" .fm-not-filled").offset().top,c=function(){document.body.clientHeight!==l&&(l=document.body.clientHeight,s=jQuery("#form"+e+" .fm-not-filled").closest("div[wdid]").height(),u=jQuery("#form"+e+" .fm-not-filled").offset().top,jQuery("html").stop(),_())};function m(e){e&&(old_bg=jQuery(i).css("background-color"),jQuery(i).effect("shake",{},500).css("background-color","#FF8F8B").animate({backgroundColor:old_bg},{duration:500,queue:!1}))}function _(){jQuery("html").animate({scrollTop:u-(s+40)},500,function(){document.scrollingElement.scrollTop=u-(s+40),jQuery(window).off("scroll",c),m(t)})}jQuery(window).on("scroll",c),u<d?_():m(t)}function wd_file_upload_check(r,e){var a=jQuery("#form"+r),n=!1,t=e||window["file_upload_check"+r];return jQuery.each(t,function(e,t){var i="#wdform_"+e+"_element"+r;0!=a.find(jQuery("div[wdid='"+e+"']")).length&&"none"!=a.find(jQuery("div[wdid='"+e+"']")).css("display")&&(ext_available=getfileextension(jQuery(i).val(),t),ext_available?(jQuery("#form"+r+" #wd_upload_type_"+e).remove(),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .error_label_upload").removeClass("error_label_upload")):(jQuery("#form"+r+" #wd_upload_type_"+e).remove(),a.find(jQuery("div[wdid='"+e+"'] .wdform-element-section")).parent().parent().append("<div id='wd_upload_type_"+e+"' class='fm-not-filled'>"+fm_objectL10n.fm_file_type_error+"</div>"),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_upload"),n=!0))}),e||!0!==n||scroll_on_element(r),!1===n}function wd_is_filled(s,u,c){null==c&&(c=!0);var m=jQuery("#form"+s),e=u?u.split():window["required_fields"+s],_={};return jQuery(e).each(function(e,r){if("none"===m.find(jQuery("div[wdid='"+r+"']")).css("display")&&(m.find(jQuery("div[wdid='"+r+"']")).find(".fm-not-filled").remove(),m.find(jQuery("div[wdid='"+r+"']")).css("background-color",""),m.find(jQuery("div[wdid='"+r+"'] label")).removeClass("error_label")),0!=m.find(jQuery("div[wdid='"+r+"']")).length&&"none"!==m.find(jQuery("div[wdid='"+r+"']")).css("display"))switch(window["labels_and_ids"+s][r]){case"type_text":case"type_textarea":case"type_paypal_price_new":case"type_spinner":case"type_number":case"type_phone_new":case"type_submitter_mail":var t="#wdform_"+r+"_element"+s,i=jQuery(t).val();i=jQuery.trim(i),(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==i&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)});break;case"type_own_select":case"type_country":case"type_paypal_select":t="#wdform_"+r+"_element"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&(""==jQuery(t).val()||0<jQuery("#wdform_"+r+"_element_quantity"+s).length&&!parseInt(jQuery("#wdform_"+r+"_element_quantity"+s).val()))&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)}).change(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),wd_is_filled(s,r)});break;case"type_phone":t=["#wdform_"+r+"_element_first"+s,"#wdform_"+r+"_element_last"+s];jQuery.each(t,function(e,t){(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)})});break;case"type_name":t=["#wdform_"+r+"_element_title"+s,"#wdform_"+r+"_element_first"+s,"#wdform_"+r+"_element_last"+s,"#wdform_"+r+"_element_middle"+s];jQuery.each(t,function(e,t){if((c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&jQuery(t).length){var i=jQuery(t).val();""==(i=jQuery.trim(i))&&void 0!==i&&(_[r]=t)}u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).blur(function(){wd_is_filled(s,r)})});break;case"type_address":t=["#wdform_"+r+"_street1"+s,"#wdform_"+r+"_city"+s,"#wdform_"+r+"_state"+s,"#wdform_"+r+"_postal"+s,"#wdform_"+r+"_country"+s];jQuery.each(t,function(e,t){if(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display")){var i=jQuery(t).val();void 0!==i&&(i=jQuery.trim(i)),""==i&&void 0!==jQuery(t).closest(".wd-address").css("display")&&"none"!=jQuery(t).closest(".wd-address").css("display")&&0<jQuery(t).length&&(_[r]=t)}u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).blur(function(){wd_is_filled(s,r)})});break;case"type_checkbox":case"type_radio":case"type_scale_rating":case"type_paypal_checkbox":case"type_paypal_radio":case"type_paypal_shipping":(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&(0==m.find(jQuery("div[wdid='"+r+"'] input:checked")).length||""==jQuery("#wdform_"+r+"_other_input"+s).val()||0<jQuery("#wdform_"+r+"_element_quantity"+s).length&&!parseInt(jQuery("#wdform_"+r+"_element_quantity"+s).val()))&&(_[r]=!0),u||window["check_submit"+s]||jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] input"),function(e,t){jQuery(this).change(function(){0==m.find(jQuery("div[wdid='"+r+"'] input:checked")).length||""==jQuery("#wdform_"+r+"_other_input"+s).val()||0<jQuery("#wdform_"+r+"_element_quantity"+s).length&&!parseInt(jQuery("#wdform_"+r+"_element_quantity"+s).val())?wd_is_filled(s,r):(jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"))})});break;case"type_star_rating":t="#wdform_"+r+"_selected_star_amount"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=!0),u||window["check_submit"+s]||jQuery("#wdform_"+r+"_element"+s).click(function(){""!=jQuery(t).val()&&(jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove())});break;case"type_range":t=["#wdform_"+r+"_element"+s+"0","#wdform_"+r+"_element"+s+"1"];jQuery.each(t,function(e,t){(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).blur(function(){wd_is_filled(s,r)})});break;case"type_grading":if(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display")){var a=0;jQuery.each(jQuery("#wdform_"+r+"_element"+s+" input"),function(e,t){""!=jQuery(this).val()&&a++}),0==a&&(_[r]=!0)}u||window["check_submit"+s]||jQuery.each(jQuery("#wdform_"+r+"_element"+s+" input"),function(e,t){jQuery(this).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).blur(function(){wd_is_filled(s,r)})});break;case"type_slider":var n="#wdform_"+r+"_element"+s,o=(t="#wdform_"+r+"_slider_value"+s,"#wdform_"+r+"_element_min"+s);(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&jQuery(t).val()==jQuery(o).html()&&(_[r]=!0),u||window["check_submit"+s]||jQuery(n).slider({change:function(e,t){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove(),wd_is_filled(s,r)}});break;case"type_date":case"type_date_new":t="#wdform_"+r+"_element"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove()}).change(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),wd_is_filled(s,r)});break;case"type_date_range":t=["#wdform_"+r+"_element"+s+"0","#wdform_"+r+"_element"+s+"1"];jQuery.each(t,function(e,t){(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).change(function(){wd_is_filled(s,r)})});break;case"type_date_fields":t=["#wdform_"+r+"_day"+s,"#wdform_"+r+"_month"+s,"#wdform_"+r+"_year"+s];jQuery.each(t,function(e,t){(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+"div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+"#wd_required_"+r).remove(),jQuery("#check_min_date_"+r+"_"+s).remove()}).blur(function(){wd_is_filled(s,r)}).change(function(){wd_is_filled(s,r)})});break;case"type_time":t=["#wdform_"+r+"_hh"+s,"#wdform_"+r+"_mm"+s,"#wdform_"+r+"_ss"+s];jQuery.each(t,function(e,t){(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&void 0!==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).blur(function(){wd_is_filled(s,r)})});break;case"type_password":t="#wdform_"+r+"_element"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)});break;case"type_file_upload":t="#wdform_"+r+"_element"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).change(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),wd_is_filled(s,r)});break;case"type_matrix":if(jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),"radio"==jQuery("#form"+s+" div[wdid='"+r+"'] input").attr("type")||"checkbox"==jQuery("#form"+s+" div[wdid='"+r+"'] input").attr("type"))(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&(0==m.find(jQuery("div[wdid='"+r+"'] input:checked")).length&&(_[r]=!0),"radio"==jQuery("#form"+s+" div[wdid='"+r+"'] input").attr("type")&&jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] div[class^='wdform-matrix-row']"),function(e,t){0==jQuery(t).find('input[type="radio"]:checked').length&&(_[r]=!0)})),"checkbox"==jQuery("#form"+s+" div[wdid='"+r+"'] input").attr("type")&&(u||window["check_submit"+s]||jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] input"),function(e,t){jQuery(this).change(function(){0==m.find(jQuery("div[wdid='"+r+"'] input:checked")).length?wd_is_filled(s,r):(jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove())})}));else if("text"==jQuery("#form"+s+" div[wdid='"+r+"'] input").attr("type")){if(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display")){var d=0;jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] input"),function(e,t){""!=jQuery(this).val()&&d++}),0==d&&(_[r]=!0)}u||window["check_submit"+s]||jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] input"),function(e,t){jQuery(this).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)})})}else{if(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display")){var l=0;jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] select"),function(e,t){""!=jQuery(this).val()&&l++}),0==l&&(_[r]=!0)}u||window["check_submit"+s]||jQuery.each(jQuery("#form"+s+" div[wdid='"+r+"'] select"),function(e,t){jQuery(this).focus(function(){""==jQuery(this).val()&&(jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"))}).change(function(){wd_is_filled(s,r)}).blur(function(){wd_is_filled(s,r)})})}break;case"type_send_copy":(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&0==jQuery("div[wdid='"+r+"'] input:checked").length&&(_[r]=!0),u||window["check_submit"+s]||jQuery("#form"+s+" div[wdid='"+r+"'] input").change(function(){0==jQuery("div[wdid='"+r+"'] input:checked").length?wd_is_filled(s,r):(jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label"))});break;case"type_captcha":case"type_arithmetic_captcha":t="";t="type_captcha"==window["labels_and_ids"+s][r]?"#wd_captcha_input"+s:"#wd_arithmetic_captcha_input"+s,(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(jQuery(".message_captcha").html(""),_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .error_label").removeClass("error_label")}).blur(function(){wd_is_filled(s,r)});break;case"type_signature":jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .wdform-label").removeClass("error_label");t="#signature-file-wdform_"+r+"_element"+s;(c||"none"!=m.find(jQuery("div[wdid='"+r+"']")).closest(".wdform-page-and-images").css("display"))&&""==jQuery(t).val()&&(_[r]=t),u||window["check_submit"+s]||jQuery(t).focus(function(){jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .wdform-label").removeClass("error_label"),jQuery("#form"+s+" #wd_required_"+r).remove()}).change(function(){jQuery("#form"+s+" #wd_required_"+r).remove(),jQuery("#form"+s+" div[wdid='"+r+"'] .wdform-label-section:first .wdform-label").removeClass("error_label"),wd_is_filled(s,r)})}}),0===Object.keys(_).length&&0===Object.keys(window["check_before_submit"+s]).length||(0!==Object.keys(_).length&&jQuery.each(_,function(e,t){var i=jQuery("#form"+s+" div[wdid='"+e+"'] .wdform-label-section:first"),r=0;i.hasClass("wd-width-30")&&!i.hasClass("wd-hidden")&&(r=i.width()),jQuery("#form"+s+" #wd_required_"+e).remove(),jQuery("#form"+s+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label"),"type_password"===window["labels_and_ids"+s][e]||"type_submitter_mail"===window["labels_and_ids"+s][e]?jQuery("#form"+s+" div[wdid='"+e+"'] .wdform-element-section:first").parent().after("<div id='wd_required_"+e+"' class='fm-not-filled fm-password-not-filled' style='margin-left: "+r+"px'>"+fm_objectL10n.fm_field_is_required+"</div>"):jQuery("#form"+s+" div[wdid='"+e+"'] .wdform-element-section:first").parent().parent().append("<div id='wd_required_"+e+"' class='fm-not-filled' style='margin-left: "+r+"px'>"+fm_objectL10n.fm_field_is_required+"</div>")}),u||scroll_on_element(s),!(window["check_submit"+s]=1))}function wd_check_price_min_max(n,o){var d=jQuery("#form"+n),e=o||window["check_paypal_price_min_max"+n],l=!1;return jQuery.each(e,function(e,t){var i="#wdform_"+e+"_element"+n,r=t[3]?t[3]:0,a=t[4]?t[4]:-1;!t[2]&&jQuery(i).val()==t[1]||(-1!=a&&parseFloat(jQuery(i).val())>a||parseFloat(jQuery(i).val())<r)&&(jQuery("#form"+n+" #wd_price_"+e).remove(),d.find(jQuery("div[wdid='"+e+"'] .wdform-element-section")).parent().parent().append("<div id='wd_price_"+e+"' class='fm-not-filled'>"+fm_objectL10n.fm_min_max_check_1+t[0]+fm_objectL10n.fm_min_max_check_2+(t[3]?t[3]:0)+"-"+(t[4]?t[4]:"any")+"</div>"),jQuery("#form"+n+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price"),l=!0,o||scroll_on_element(n))}),!1===l}function wd_check_min_date_dob(u){var c=!0;return jQuery("#form"+u+" div[type='type_date_fields']").each(function(){var e=parseInt(jQuery(this).data("min-day"));if(!e)return!0;var t=jQuery(this).parent(),i=t.attr("wdid"),r=parseInt(jQuery("#wdform_"+i+"_day"+u).val()),a=parseInt(jQuery("#wdform_"+i+"_month"+u).val()),n=parseInt(jQuery("#wdform_"+i+"_year"+u).val());if(!(r||a||n))return!0;var o=parseInt(jQuery(this).data("min-month")),d=parseInt(jQuery(this).data("min-year")),l=new Date(n+"-"+a+"-"+r),s=new Date(d+"-"+o+"-"+e);(isNaN(l)||isNaN(n)||l-s<0)&&(c=!1,jQuery("#check_min_date_"+i+"_"+u).remove(),t.append("<div id='check_min_date_"+i+"_"+u+"' class='fm-not-valid-date'>"+jQuery(this).attr("data-min-date-alert")+"</div>"),t.find(".wdform-label").addClass("error_label"),scroll_on_element(u))}),c}function wd_spinner_check(r,a){var n=jQuery("#form"+r),o=!1,e=a||window["spinner_check"+r];return jQuery.each(e,function(e,t){var i="#wdform_"+e+"_element"+r;0!=n.find(jQuery("div[wdid='"+e+"']")).length&&"none"!=n.find(jQuery("div[wdid='"+e+"']")).css("display")&&(parseInt(jQuery(i).val())<parseInt(t[0])||parseInt(jQuery(i).val())>parseInt(t[1]))&&(jQuery("#form"+r+" #wd_price_"+e).remove(),n.find(jQuery("div[wdid='"+e+"'] .wdform-element-section")).parent().parent().append("<div id='wd_price_"+e+"' class='fm-not-filled'>"+fm_objectL10n.fm_spinner_check+(t[0]?t[0]:0)+"-"+(t[1]?t[1]:"any")+"</div>"),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .wdform-label").addClass("error_label_price"),o=!0,a||scroll_on_element(r))}),!1===o}function fmscrollHandler(e){var t=100*jQuery(window).scrollTop()/(jQuery(document).height()-jQuery(window).height());!jQuery("#fm-scrollbox"+e).hasClass("fm-minimized")&&t>=window["scrollbox_trigger_point"+e]?setTimeout(function(){jQuery("#fm-scrollbox"+e).removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp"),jQuery("#fm-scrollbox"+e).css("visibility",""),jQuery("#fm-scrollbox"+e+" .fm-header-img").addClass("fm-animated "+window["header_image_animation"+e])},1e3*window["scrollbox_loading_delay"+e]):"1"==window["scrollbox_auto_hide"+e]&&(jQuery("#fm-scrollbox"+e+" .fm-header-img").removeClass("fm-animated "+window["header_image_animation"+e]),jQuery("#fm-scrollbox"+e).removeClass("fm-animated fadeInUp").addClass("fm-animated fadeOutDown"))}function fm_submit_form(e){if("function"==typeof window["before_submit"+e]&&window["before_submit"+e]())return!1;if(!fm_check(0,e))return!1;(jQuery("#form"+e+" button").each(function(){jQuery(this).attr("disabled","disabled")}),jQuery('<input type="hidden" name="save_or_submit'+e+'" value ="submit" />').appendTo("#form"+e),window["onsubmit_js"+e](),1==window["checkStripe"+e])?"none"!=jQuery("form[id='form"+e+"']").find(".StripeElement").first().parents(".wdform_row").css("display")?wdfm_call_stripe(!0):0<jQuery("#form"+e).find(".g-recaptcha[data-size=invisible]").length?grecaptcha.execute():fm_submit(e):0<jQuery("#form"+e).find(".g-recaptcha[data-size=invisible]").length?grecaptcha.execute():fm_submit(e)}function getHostName(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null}function isJson(e){try{JSON.parse(e)}catch(e){return!1}return!0}function fm_submit(u){if(fm_set_input_value("fm_empty_field_validation"+u,jQuery("#fm_empty_field_validation"+u).attr("data-value")),"0"!=jQuery("#form"+u+" .button-submit:not(.save_button)").attr("data-ajax")){jQuery("#form"+u+" .fm-submit-loading").css("display","inline-block");var e=jQuery("#form"+u)[0],t=new FormData(e),i=jQuery("#fm_ajax_url"+u).data("ajax_url"),c=jQuery("#form"+u+" #fm_ajax_redirect_url"+u).data("ajax_redirect_url");jQuery.ajax({type:"POST",enctype:"multipart/form-data",url:i,data:t,contentType:!1,processData:!1,success:function(e){if(isJson(e)){var t=JSON.parse(e);if(void 0!==t.after_submit_redirect_url&&""!=jQuery.trim(t.after_submit_redirect_url))return void window.location.replace(t.after_submit_redirect_url);var i=new Date,r=window.location.href,a=i.getTime();if(void 0!==t.success&&(a=t.success),-1<r.indexOf("&succes="))r=r.split("&succes=")[0];else if(-1<r.indexOf("?succes=")){r=r.split("?succes=")[0]}r=-1<r.indexOf("?")?r+"&succes="+a:r+"?succes="+a;var n="&return="+encodeURIComponent(r);if(void 0!==t.paypal_url){var o=t.paypal_url+n;return void window.location.replace(o)}}if(0==c){jQuery("#form"+u+" .button-submit").prop("disabled",!1),jQuery("#form"+u+" .fm-submit-loading").hide();var d=jQuery(e).find("#form"+u).html();jQuery("#form"+u).html(d),"function"==typeof window["fm_save_progress_buttons_"+u]&&window["fm_save_progress_buttons_"+u](),0<jQuery(document).find(".g-recaptcha").length&&fmRecaptchaInit(1);var l="fm_script_ready"+u;if(void 0!==window[l]&&window[l](),0<jQuery(d).find(".fm-not-filled.message_captcha").length){var s=jQuery(d).find(".fm-not-filled.message_captcha").text();jQuery("#form"+u+" .fm-message").remove(),jQuery("#form"+u).prepend('<div class="fm-message fm-notice-error">'+s+"</div>")}window["check_submit"+u]=0}else window.location.replace(c)},complete:function(){0==jQuery("#form"+u+" .fm-message").length?(jQuery("#closing-form"+u).remove(),jQuery("#fm-popover-background"+u).css("display","none")):jQuery("#fm-popover-container"+u).addClass("fm-submit-message"),"function"!=typeof window["after_submit"+u]||jQuery("#form"+u).find(".message_captcha").length||window["after_submit"+u]()}})}else jQuery("#form"+u).submit()}function fm_reset_form(form_id){"function"==typeof window["before_reset"+form_id]&&window["before_reset"+form_id]();var privacy_policy_check=jQuery("#fm_privacy_policy"+form_id);privacy_policy_check&&(privacy_policy_check.prop("checked",!1),fm_privacy_policy_check(privacy_policy_check)),jQuery.each(window["labels_and_ids"+form_id],function(index,elem){switch(elem){case"type_text":case"type_textarea":case"type_number":case"type_spinner":case"type_own_select":case"type_country":case"type_date":case"type_date_new":case"type_hidden":case"type_paypal_price_new":case"type_phone_new":case"type_time":jQuery("#wdform_"+index+"_element"+form_id).val("");break;case"type_submitter_mail":case"type_password":jQuery("#wdform_"+index+"_element"+form_id).val(""),jQuery("#wdform_"+index+"_1_element"+form_id)&&(jQuery("#wdform_"+index+"_1_element"+form_id).val(""),jQuery("#confirm_"+index+"_"+form_id)&&jQuery("#confirm_"+index+"_"+form_id).remove(),"type_submitter_mail"==elem&&jQuery("#check_email_"+index+"_"+form_id)&&jQuery("#check_email_"+index+"_"+form_id).remove());break;case"type_date_range":jQuery("#wdform_"+index+"_element"+form_id+"0").val(""),jQuery("#wdform_"+index+"_element"+form_id+"1").val("");break;case"type_send_copy":jQuery("#wdform_"+index+"_element"+form_id).prop("checked",!1);break;case"type_phone":jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id).val("");break;case"type_name":jQuery("#wdform_"+index+"_element_first"+form_id+", #wdform_"+index+"_element_last"+form_id+", #wdform_"+index+"_element_title"+form_id+", #wdform_"+index+"_element_middle"+form_id).val("");break;case"type_address":jQuery("#wdform_"+index+"_street1"+form_id+", #wdform_"+index+"_street2"+form_id+", #wdform_"+index+"_city"+form_id+", #wdform_"+index+"_state"+form_id+", #wdform_"+index+"_postal"+form_id+", #wdform_"+index+"_country"+form_id).val("");break;case"type_checkbox":jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop("checked",!1),jQuery("#wdform_"+index+"_other_br"+form_id).remove(),jQuery("#wdform_"+index+"_other_input"+form_id).remove();break;case"type_radio":jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop("checked",!1),jQuery("#wdform_"+index+"_other_br"+form_id).remove(),jQuery("#wdform_"+index+"_other_input"+form_id).remove();break;case"type_time":jQuery("#wdform_"+index+"_hh"+form_id+", #wdform_"+index+"_mm"+form_id+", #wdform_"+index+"_ss"+form_id+", #wdform_"+index+"_am_pm"+form_id).val("");break;case"type_date_fields":jQuery("#wdform_"+index+"_day"+form_id+", #wdform_"+index+"_month"+form_id+", #wdform_"+index+"_year"+form_id).val("");break;case"type_file_upload":jQuery("#wdform_"+index+"_element"+form_id+"_save").remove();break;case"type_paypal_price":jQuery("#wdform_"+index+"_element_dollars"+form_id+", #wdform_"+index+"_element_cents"+form_id).val("");break;case"type_paypal_select":jQuery("#wdform_"+index+"_element"+form_id+", #wdform_"+index+"_element_quantity"+form_id+", #form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val("");break;case"type_paypal_radio":jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val(""),jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop("checked",!1);break;case"type_paypal_shipping":jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop("checked",!1);break;case"type_paypal_checkbox":jQuery("#wdform_"+index+"_element_quantity"+form_id+",#form"+form_id+" div[wdid='"+index+"'] .paypal-property select").val(""),jQuery("#form"+form_id+" div[wdid='"+index+"'] .checkbox-div input").prop("checked",!1);break;case"type_star_rating":jQuery("#wdform_"+index+"_selected_star_amount"+form_id).val(""),jQuery("#wdform_"+index+"_element"+form_id+" img").attr("src",fm_objectL10n.plugin_url+"/images/star.png");break;case"type_scale_rating":jQuery("#form"+form_id+" div[wdid='"+index+"'] .radio-div input").prop("checked",!1);break;case"type_slider":jQuery("#wdform_"+index+"_element"+form_id).slider({value:eval(0)}),jQuery("#wdform_"+index+"_element_value"+form_id).html("0");break;case"type_range":jQuery("#wdform_"+index+"_element"+form_id+"0, #wdform_"+index+"_element"+form_id+"1").val("");break;case"type_grading":jQuery("#wdform_"+index+"_element"+form_id+" input").val("");break;case"type_matrix":jQuery("#wdform_"+index+"_element"+form_id+" .radio-div input").prop("checked",!1),jQuery("#wdform_"+index+"_element"+form_id+" .checkbox-div input").prop("checked",!1),jQuery("#wdform_"+index+"_element"+form_id+" input[type='text']").val(""),jQuery("#wdform_"+index+"_element"+form_id+" select").val("");break;case"type_paypal_total":jQuery("#wdform_"+index+"div_total"+form_id).html("$0"),jQuery("#wdform_"+index+"paypal_products"+form_id).empty();break;case"type_captcha":jQuery("#wd_captcha_input"+form_id).val("");case"type_arithmetic_captcha":jQuery("#wd_arithmetic_captcha_input"+form_id).val("");case"type_signature":jQuery("#signature-file-wdform_"+index+"_element"+form_id).val(""),jQuery("#signature-signs-wdform_"+index+"_element"+form_id).val(""),jQuery("#signature-clear-wdform_"+index+"_element"+form_id).trigger("click")}})}function fm_save_form(e){jQuery('<input type="hidden" name="save_or_submit'+e+'" value ="save" />').appendTo("#form"+e),window["onsubmit_js"+e](),jQuery("#form"+e+" button").each(function(){jQuery(this).attr("disabled","disabled")}),fm_set_input_value("fm_empty_field_validation"+e,jQuery("#fm_empty_field_validation"+e).attr("data-value")),jQuery("#form"+e).submit()}function fm_clear_form(e){1==confirm(fm_objectL10n.fm_clear_data)&&(jQuery("#form"+e+" button").each(function(){jQuery(this).attr("disabled","disabled")}),jQuery.get(fm_objectL10n.form_maker_admin_ajax+"?action=FMClearProg&addon_task=clear_data&nonce="+fm_ajax.ajaxnonce+"&form_id="+e).done(function(){window.location=jQuery("#form"+e).attr("action")}))}function fm_set_input_value(e,t){jQuery("#"+e).val(t)}function formOnload(r){var a;-1!=navigator.userAgent.toLowerCase().indexOf("msie")&&8===parseInt(navigator.userAgent.toLowerCase().split("msie")[1])&&(jQuery("#form"+r).find(jQuery("input[type='radio']")).click(function(){jQuery("input[type='radio']+label").removeClass("if-ie-div-label"),jQuery("input[type='radio']:checked+label").addClass("if-ie-div-label")}),jQuery("#form"+r).find(jQuery("input[type='radio']:checked+label")).addClass("if-ie-div-label"),jQuery("#form"+r).find(jQuery("input[type='checkbox']")).click(function(){jQuery("input[type='checkbox']+label").removeClass("if-ie-div-label"),jQuery("input[type='checkbox']:checked+label").addClass("if-ie-div-label")}),jQuery("#form"+r).find(jQuery("input[type='checkbox']:checked+label")).addClass("if-ie-div-label")),jQuery.each(window["check_regExp_all"+r],function(e,t){var i={};i[e]=t,jQuery("div[wdid='"+e+"'] input").blur(function(){wd_check_regExp(r,i)}).focus(function(){jQuery("#form"+r+" #wd_exp_"+e).remove(),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .error_label_exp").removeClass("error_label_exp")})}),jQuery.each(window["check_paypal_price_min_max"+r],function(e,t){var i={};i[e]=t,jQuery("div[wdid='"+e+"'] input").blur(function(){wd_check_price_min_max(r,i)}).focus(function(){jQuery("#form"+r+" #wd_price_"+e).remove(),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")})}),jQuery.each(window["spinner_check"+r],function(e,t){var i={};i[e]=t,jQuery("div[wdid='"+e+"'] input").blur(function(){wd_spinner_check(r,i)}).focus(function(){jQuery("#form"+r+" #wd_price_"+e).remove(),jQuery("#form"+r+" div[wdid='"+e+"'] .wdform-label-section:first .error_label_price").removeClass("error_label_price")})}),jQuery.each(window["file_upload_check"+r],function(e,t){var i={};i[e]=t,jQuery("div[wdid='"+e+"'] input").change(function(){wd_file_upload_check(r,i)})}),jQuery("#form"+r+" input").on("keypress",function(e){if(13==(e.keyCode?e.keyCode:e.which))return!1}),jQuery("div[type='type_number'] input, div[type='type_phone'] input, div[type='type_spinner'] input, div[type='type_range'] input, .wdform-quantity, div[type='type_paypal_price_new'] input").keypress(function(e){return check_isnum(e)}),jQuery("div[type='type_grading'] input").keypress(function(e){return check_isnum_or_minus(e)}),jQuery("div[type='type_paypal_checkbox'] input[type='checkbox'], div[type='type_paypal_radio'] input[type='radio'], div[type='type_paypal_shipping'] input[type='radio']").click(function(){set_total_value(r)}),jQuery("div[type='type_paypal_select'] select, div[type='type_paypal_price'] input, div[type='type_paypal_price_new'] input").change(function(){set_total_value(r)}),jQuery(".wdform-quantity").change(function(){set_total_value(r)}),jQuery("div[type='type_address'] select").change(function(){set_total_value(r)}),jQuery("div[type='type_time'] input").blur(function(){add_0(this)}),jQuery(".wdform-element-section").each(function(){if("type_stripe"==jQuery(this).parent().parent().attr("type"))return!0;jQuery(this).parent()[0].style.width||0==parseInt(jQuery(this).width())||0==jQuery(this).parent().find(jQuery(".wdform-label-section")).length||"table-cell"==jQuery(this).css("display")&&("type_captcha"!=jQuery(this).parent().attr("type")?jQuery(this).parent().css("width",parseInt(jQuery(this).width())+parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15):jQuery(this).parent().css("width",2*parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width)+50+parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15)),parseInt(jQuery(this)[0].style.width.replace("px",""))<parseInt(jQuery(this).css("min-width").replace("px",""))&&jQuery(this).css("min-width",parseInt(jQuery(this)[0].style.width.replace("px",""))-10)}),jQuery(".wdform-label").each(function(){parseInt(jQuery(this).height())>=2*parseInt(jQuery(this).css("line-height").replace("px",""))&&(jQuery(this).parent().css("max-width",jQuery(this).parent().width()),jQuery(this).parent().css("width",""))}),(a=jQuery).fn.shuffle=function(){var r=a(this).find(".wd-choice"),t=a.map(r,function(){var e,t=(e=r.length,Math.floor(Math.random()*e)),i=a(r[parseInt(t)]).clone(!0)[0];return r.splice(t,1),i});return a(this).find(".wd-choice").each(function(e){a(this).replaceWith(a(t[e]))}),a(t)},"function"==typeof window["onload_js"+r]&&window["onload_js"+r](),"function"==typeof window["before_load"+r]&&window["before_load"+r]()}function fm_document_ready(e){jQuery("#form"+e).hasClass("fm-form-submitted")&&!jQuery("#form"+e).find(".message_captcha").length&&"function"==typeof window["after_submit"+e]&&window["after_submit"+e]();var t=jQuery("#form"+e+" .wdform-page-and-images").length;window["form_view_count"+e]=t,1<window["form_view_count"+e]&&(firstid=jQuery("#form"+e+" .wdform_page").first().attr("id"),firstid=firstid.split("form_view"),window["first_form_view"+e]=firstid[1],generate_page_nav(window["first_form_view"+e],e,window["form_view_count"+e])),fm_initilize_form(e),window["condition_js"+e](),jQuery(document).trigger("fm_document_ready")}function fm_check(e,t,i){if(!wd_is_filled(t,void 0,i))return!1;if(1==window["checkStripe"+t]){var r=jQuery("form[id='form"+t+"']");if("none"!=r.find(".StripeElement").first().closest(".wdform-page-and-images").css("display")&&"none"!=r.find(".StripeElement").first().parents(".wdform_row").css("display")&&0==wdfm_call_stripe(!1))return!1}return!!wd_check_regExp(t)&&(!!wd_check_price_min_max(t)&&(!!wd_spinner_check(t)&&(!!wd_file_upload_check(t)&&(!!wd_check_min_date_dob(t)&&0!=window["check_js"+t](e,t)))))}function fmRecaptchaInit(e){void 0===e&&(e=0),jQuery(".g-recaptcha").each(function(){if(type=jQuery(this).attr("data-size"),jQuery(this).attr("data-render",1),"invisible"==type)i=jQuery(this).attr("data-form_id"),grecaptcha.render(jQuery(this).attr("id"),{sitekey:jQuery(this).attr("data-sitekey"),badge:jQuery(this).attr("data-badge"),callback:function(){fm_submit(i)}});else if("v3"==type){if("undefined"==jQuery(this).attr("data-sitekey")||""==jQuery(this).attr("data-sitekey"))return;var t=jQuery(this).attr("data-id"),i=jQuery(this).attr("data-form-id"),e=jQuery(this).attr("data-sitekey");grecaptcha.ready(function(){grecaptcha.execute(e).then(function(e){document.getElementById("recaptchaV3Response_"+i+t).value=e})})}else grecaptcha.render(jQuery(this).attr("id"),{sitekey:jQuery(this).attr("data-sitekey"),theme:"light"})})}function wd_change_state_input(e,t){if(document.getElementById(e+"_country"+t)&&document.getElementById(e+"_state"+t)){var i=!1,r=document.getElementById(e+"_state"+t);if("United States"==document.getElementById(e+"_country"+t).value){var a=document.createElement("select"),n=fm_objectL10n.states;for(var o in n){(d=document.createElement("option")).setAttribute("value",o),d.innerHTML=n[o],a.appendChild(d)}i=!0}else if("Canada"==document.getElementById(e+"_country"+t).value){a=document.createElement("select"),n=fm_objectL10n.provinces;for(var o in n){var d;(d=document.createElement("option")).setAttribute("value",o),d.innerHTML=n[o],a.appendChild(d)}i=!0}else if("SELECT"==document.getElementById(e+"_state"+t).tagName){a=document.createElement("input");i=!0}if(i){a.setAttribute("type","text"),a.setAttribute("id",e+"_state"+t),a.setAttribute("name","wdform_"+(parseInt(e.replace("wdform_",""))+3)+"_state"+t),a.setAttribute("class","wd-width-100");var l=r.parentNode;l.removeChild(r),l.insertBefore(a,l.firstChild)}}}function fm_privacy_policy_check(e){var t=jQuery(e),i=t.parents(".wdform_row").find(".button-submit");t.is(":checked")?i.prop("disabled",!1):i.prop("disabled",!0)}function fm_html_entities(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function validate_received_data_from_url(){new URLSearchParams(window.location.search).forEach(function(e,t){jQuery("#"+t).each(function(){jQuery(this).keyup(),jQuery(this).keydown(),jQuery(this).trigger("change")})})}jQuery(document).on("mouseenter",".sel-imul",function(){selenter=!0}),jQuery(document).on("mouseleave",".sel-imul",function(){selenter=!1}),jQuery(document).click(function(){selenter||(jQuery(".sel-options").hide(),jQuery(".sel-imul").removeClass("act"))}),function(e){"object"==typeof module&&module.exports?module.exports=e():window.intlTelInput=e()}(function(m){"use strict";return function(){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}for(var n=[["Afghanistan (‫افغانستان‬‎)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (‫الجزائر‬‎)","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua and Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain (‫البحرين‬‎)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros (‫جزر القمر‬‎)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (‫مصر‬‎)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (‫ایران‬‎)","ir","98"],["Iraq (‫العراق‬‎)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel (‫ישראל‬‎)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan (‫الأردن‬‎)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (‫الكويت‬‎)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (‫لبنان‬‎)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (‫ليبيا‬‎)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Macedonia (FYROM) (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (‫موريتانيا‬‎)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco (‫المغرب‬‎)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway (Norge)","no","47",0],["Oman (‫عُمان‬‎)","om","968"],["Pakistan (‫پاکستان‬‎)","pk","92"],["Palau","pw","680"],["Palestine (‫فلسطين‬‎)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (‫قطر‬‎)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1",18,["869"]],["Saint Lucia","lc","1",19,["758"]],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1",20,["784"]],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (‫المملكة العربية السعودية‬‎)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (‫جنوب السودان‬‎)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්‍රී ලංකාව)","lk","94"],["Sudan (‫السودان‬‎)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1,["79"]],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (‫سوريا‬‎)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1",22,["868"]],["Tunisia (‫تونس‬‎)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1",24,["340"]],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (‫الصحراء الغربية‬‎)","eh","212",1,["5288","5289"]],["Yemen (‫اليمن‬‎)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],e=0;e<n.length;e++){var t=n[e];n[e]={name:t[0],iso2:t[1],dialCode:t[2],priority:t[3]||0,areaCodes:t[4]||null}}var i={getInstance:function(e){var t=e.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[t]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=i);var o=0,d={allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:"polite",customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,utilsScript:""},l=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],s=function(e,t){for(var i=Object.keys(e),r=0;r<i.length;r++)t(i[r],e[i[r]])},u=function(t){s(window.intlTelInputGlobals.instances,function(e){window.intlTelInputGlobals.instances[e][t]()})},a=function(){function a(e,t){var i=this;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,a),this.id=o++,this.a=e,this.b=null,this.c=null;var r=t||{};this.d={},s(d,function(e,t){i.d[e]=r.hasOwnProperty(e)?r[e]:t}),this.e=Boolean(e.getAttribute("placeholder"))}return e=a,(t=[{key:"_init",value:function(){var i=this;if(this.d.nationalMode&&(this.d.autoHideDialCode=!1),this.d.separateDialCode&&(this.d.autoHideDialCode=this.d.nationalMode=!1),this.g=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.g&&(document.body.classList.add("iti-mobile"),this.d.dropdownContainer||(this.d.dropdownContainer=document.body)),"undefined"!=typeof Promise){var e=new Promise(function(e,t){i.h=e,i.i=t}),t=new Promise(function(e,t){i.i0=e,i.i1=t});this.promise=Promise.all([e,t])}else this.h=this.i=function(){},this.i0=this.i1=function(){};this.s={},this._b(),this._f(),this._h(),this._i(),this._i3()}},{key:"_b",value:function(){this._d(),this._d2(),this._e(),this.d.localizedCountries&&this._d0(),(this.d.onlyCountries.length||this.d.localizedCountries)&&this.p.sort(this._d1)}},{key:"_c",value:function(e,t,i){t.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=t.length),this.q.hasOwnProperty(t)||(this.q[t]=[]);for(var r=0;r<this.q[t].length;r++)if(this.q[t][r]===e)return;var a=i!==m?i:this.q[t].length;this.q[t][a]=e}},{key:"_d",value:function(){if(this.d.onlyCountries.length){var t=this.d.onlyCountries.map(function(e){return e.toLowerCase()});this.p=n.filter(function(e){return-1<t.indexOf(e.iso2)})}else if(this.d.excludeCountries.length){var i=this.d.excludeCountries.map(function(e){return e.toLowerCase()});this.p=n.filter(function(e){return-1===i.indexOf(e.iso2)})}else this.p=n}},{key:"_d0",value:function(){for(var e=0;e<this.p.length;e++){var t=this.p[e].iso2.toLowerCase();this.d.localizedCountries.hasOwnProperty(t)&&(this.p[e].name=this.d.localizedCountries[t])}}},{key:"_d1",value:function(e,t){return e.name.localeCompare(t.name)}},{key:"_d2",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.q={};for(var e=0;e<this.p.length;e++){var t=this.p[e];this.dialCodes[t.dialCode]||(this.dialCodes[t.dialCode]=!0),this._c(t.iso2,t.dialCode,t.priority)}for(var i=0;i<this.p.length;i++){var r=this.p[i];if(r.areaCodes)for(var a=this.q[r.dialCode][0],n=0;n<r.areaCodes.length;n++){for(var o=r.areaCodes[n],d=1;d<o.length;d++){var l=r.dialCode+o.substr(0,d);this._c(a,l),this._c(r.iso2,l)}this._c(r.iso2,r.dialCode+o)}}}},{key:"_e",value:function(){this.preferredCountries=[];for(var e=0;e<this.d.preferredCountries.length;e++){var t=this.d.preferredCountries[e].toLowerCase(),i=this._y(t,!1,!0);i&&this.preferredCountries.push(i)}}},{key:"_e2",value:function(e,t,i){var r=document.createElement(e);return t&&s(t,function(e,t){return r.setAttribute(e,t)}),i&&i.appendChild(r),r}},{key:"_f",value:function(){this.a.hasAttribute("autocomplete")||this.a.form&&this.a.form.hasAttribute("autocomplete")||this.a.setAttribute("autocomplete","off");var e="iti";this.d.allowDropdown&&(e+=" iti--allow-dropdown"),this.d.separateDialCode&&(e+=" iti--separate-dial-code"),this.d.customContainer&&(e+=" ",e+=this.d.customContainer);var t=this._e2("div",{class:e});if(this.a.parentNode.insertBefore(t,this.a),this.k=this._e2("div",{class:"iti__flag-container"},t),t.appendChild(this.a),this.selectedFlag=this._e2("div",{class:"iti__selected-flag",role:"combobox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-owns":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false"},this.k),this.l=this._e2("div",{class:"iti__flag"},this.selectedFlag),this.d.separateDialCode&&(this.t=this._e2("div",{class:"iti__selected-dial-code"},this.selectedFlag)),this.d.allowDropdown&&(this.selectedFlag.setAttribute("tabindex","0"),this.u=this._e2("div",{class:"iti__arrow"},this.selectedFlag),this.m=this._e2("ul",{class:"iti__country-list iti__hide",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"}),this.preferredCountries.length&&(this._g(this.preferredCountries,"iti__preferred",!0),this._e2("li",{class:"iti__divider",role:"separator","aria-disabled":"true"},this.m)),this._g(this.p,"iti__standard"),this.d.dropdownContainer?(this.dropdown=this._e2("div",{class:"iti iti--container"}),this.dropdown.appendChild(this.m)):this.k.appendChild(this.m)),this.d.hiddenInput){var i=this.d.hiddenInput,r=this.a.getAttribute("name");if(r){var a=r.lastIndexOf("[");-1!==a&&(i="".concat(r.substr(0,a),"[").concat(i,"]"))}this.hiddenInput=this._e2("input",{type:"hidden",name:i}),t.appendChild(this.hiddenInput)}}},{key:"_g",value:function(e,t,i){for(var r="",a=0;a<e.length;a++){var n=e[a],o=i?"-preferred":"";r+="<li class='iti__country ".concat(t,"' tabIndex='-1' id='iti-").concat(this.id,"__item-").concat(n.iso2).concat(o,"' role='option' data-dial-code='").concat(n.dialCode,"' data-country-code='").concat(n.iso2,"' aria-selected='false'>"),r+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(n.iso2,"'></div></div>"),r+="<span class='iti__country-name'>".concat(n.name,"</span>"),r+="<span class='iti__dial-code'>+".concat(n.dialCode,"</span>"),r+="</li>"}this.m.insertAdjacentHTML("beforeend",r)}},{key:"_h",value:function(){var e=this.a.getAttribute("value"),t=this.a.value,i=e&&"+"===e.charAt(0)&&(!t||"+"!==t.charAt(0))?e:t,r=this._5(i),a=this._w(i),n=this.d,o=n.initialCountry,d=n.nationalMode,l=n.autoHideDialCode,s=n.separateDialCode;r&&!a?this._v(i):"auto"!==o&&(o?this._z(o.toLowerCase()):r&&a?this._z("us"):(this.j=this.preferredCountries.length?this.preferredCountries[0].iso2:this.p[0].iso2,i||this._z(this.j)),i||d||l||s||(this.a.value="+".concat(this.s.dialCode))),i&&this._u(i)}},{key:"_i",value:function(){this._j(),this.d.autoHideDialCode&&this._l(),this.d.allowDropdown&&this._i2(),this.hiddenInput&&this._i0()}},{key:"_i0",value:function(){var e=this;this._a14=function(){e.hiddenInput.value=e.getNumber()},this.a.form&&this.a.form.addEventListener("submit",this._a14)}},{key:"_i1",value:function(){for(var e=this.a;e&&"LABEL"!==e.tagName;)e=e.parentNode;return e}},{key:"_i2",value:function(){var t=this;this._a9=function(e){t.m.classList.contains("iti__hide")?t.a.focus():e.preventDefault()};var e=this._i1();e&&e.addEventListener("click",this._a9),this._a10=function(){!t.m.classList.contains("iti__hide")||t.a.disabled||t.a.readOnly||t._n()},this.selectedFlag.addEventListener("click",this._a10),this._a11=function(e){t.m.classList.contains("iti__hide")&&-1!==["ArrowUp","Up","ArrowDown","Down"," ","Enter"].indexOf(e.key)&&(e.preventDefault(),e.stopPropagation(),t._n()),"Tab"===e.key&&t._2()},this.k.addEventListener("keydown",this._a11)}},{key:"_i3",value:function(){var e=this;this.d.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.d.utilsScript):window.addEventListener("load",function(){window.intlTelInputGlobals.loadUtils(e.d.utilsScript)}):this.i0(),"auto"===this.d.initialCountry?this._i4():this.h()}},{key:"_i4",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.d.geoIpLookup&&this.d.geoIpLookup(function(e){window.intlTelInputGlobals.autoCountry=e.toLowerCase(),setTimeout(function(){return u("handleAutoCountry")})},function(){return u("rejectAutoCountryPromise")}))}},{key:"_j",value:function(){var e=this;this._a12=function(){e._v(e.a.value)&&e._m2CountryChange()},this.a.addEventListener("keyup",this._a12),this._a13=function(){setTimeout(e._a12)},this.a.addEventListener("cut",this._a13),this.a.addEventListener("paste",this._a13)}},{key:"_j2",value:function(e){var t=this.a.getAttribute("maxlength");return t&&e.length>t?e.substr(0,t):e}},{key:"_l",value:function(){var e=this;this._a8=function(){e._l2()},this.a.form&&this.a.form.addEventListener("submit",this._a8),this.a.addEventListener("blur",this._a8)}},{key:"_l2",value:function(){if("+"===this.a.value.charAt(0)){var e=this._m(this.a.value);e&&this.s.dialCode!==e||(this.a.value="")}}},{key:"_m",value:function(e){return e.replace(/\D/g,"")}},{key:"_m2",value:function(e){var t=document.createEvent("Event");t.initEvent(e,!0,!0),this.a.dispatchEvent(t)}},{key:"_n",value:function(){this.m.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._o(),this.b&&(this._x(this.b,!1),this._3(this.b,!0)),this._p(),this.u.classList.add("iti__arrow--up"),this._m2("open:countrydropdown")}},{key:"_n2",value:function(e,t,i){i&&!e.classList.contains(t)?e.classList.add(t):!i&&e.classList.contains(t)&&e.classList.remove(t)}},{key:"_o",value:function(){var e=this;if(this.d.dropdownContainer&&this.d.dropdownContainer.appendChild(this.dropdown),!this.g){var t=this.a.getBoundingClientRect(),i=window.pageYOffset||document.documentElement.scrollTop,r=t.top+i,a=this.m.offsetHeight,n=r+this.a.offsetHeight+a<i+window.innerHeight,o=i<r-a;if(this._n2(this.m,"iti__country-list--dropup",!n&&o),this.d.dropdownContainer){var d=!n&&o?0:this.a.offsetHeight;this.dropdown.style.top="".concat(r+d,"px"),this.dropdown.style.left="".concat(t.left+document.body.scrollLeft,"px"),this._a4=function(){return e._2()},window.addEventListener("scroll",this._a4)}}}},{key:"_o2",value:function(e){for(var t=e;t&&t!==this.m&&!t.classList.contains("iti__country");)t=t.parentNode;return t===this.m?null:t}},{key:"_p",value:function(){var i=this;this._a0=function(e){var t=i._o2(e.target);t&&i._x(t,!1)},this.m.addEventListener("mouseover",this._a0),this._a1=function(e){var t=i._o2(e.target);t&&i._1(t)},this.m.addEventListener("click",this._a1);var e=!0;this._a2=function(){e||i._2(),e=!1},document.documentElement.addEventListener("click",this._a2);var t="",r=null;this._a3=function(e){e.preventDefault(),"ArrowUp"===e.key||"Up"===e.key||"ArrowDown"===e.key||"Down"===e.key?i._q(e.key):"Enter"===e.key?i._r():"Escape"===e.key?i._2():/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)&&(r&&clearTimeout(r),t+=e.key.toLowerCase(),i._s(t),r=setTimeout(function(){t=""},1e3))},document.addEventListener("keydown",this._a3)}},{key:"_q",value:function(e){var t="ArrowUp"===e||"Up"===e?this.c.previousElementSibling:this.c.nextElementSibling;t&&(t.classList.contains("iti__divider")&&(t="ArrowUp"===e||"Up"===e?t.previousElementSibling:t.nextElementSibling),this._x(t,!0))}},{key:"_r",value:function(){this.c&&this._1(this.c)}},{key:"_s",value:function(e){for(var t=0;t<this.p.length;t++)if(this._t(this.p[t].name,e)){var i=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(this.p[t].iso2));this._x(i,!1),this._3(i,!0);break}}},{key:"_t",value:function(e,t){return e.substr(0,t.length).toLowerCase()===t}},{key:"_u",value:function(e){var t=e;if(this.d.formatOnDisplay&&window.intlTelInputUtils&&this.s){var i=!this.d.separateDialCode&&(this.d.nationalMode||"+"!==t.charAt(0)),r=intlTelInputUtils.numberFormat,a=r.NATIONAL,n=r.INTERNATIONAL,o=i?a:n;t=intlTelInputUtils.formatNumber(t,this.s.iso2,o)}t=this._7(t),this.a.value=t}},{key:"_v",value:function(e){var t=e,i=this.s.dialCode,r="1"===i;t&&this.d.nationalMode&&r&&"+"!==t.charAt(0)&&("1"!==t.charAt(0)&&(t="1".concat(t)),t="+".concat(t)),this.d.separateDialCode&&i&&"+"!==t.charAt(0)&&(t="+".concat(i).concat(t));var a=this._5(t,!0),n=this._m(t),o=null;if(a){var d=this.q[this._m(a)],l=-1!==d.indexOf(this.s.iso2)&&n.length<=a.length-1;if(!("1"===i&&this._w(n)||l))for(var s=0;s<d.length;s++)if(d[s]){o=d[s];break}}else"+"===t.charAt(0)&&n.length?o="":t&&"+"!==t||(o=this.j);return null!==o&&this._z(o)}},{key:"_w",value:function(e){var t=this._m(e);if("1"!==t.charAt(0))return!1;var i=t.substr(1,3);return-1!==l.indexOf(i)}},{key:"_x",value:function(e,t){var i=this.c;i&&i.classList.remove("iti__highlight"),this.c=e,this.c.classList.add("iti__highlight"),t&&this.c.focus()}},{key:"_y",value:function(e,t,i){for(var r=t?n:this.p,a=0;a<r.length;a++)if(r[a].iso2===e)return r[a];if(i)return null;throw new Error("No country data for '".concat(e,"'"))}},{key:"_z",value:function(e){var t=this.s.iso2?this.s:{};this.s=e?this._y(e,!1,!1):{},this.s.iso2&&(this.j=this.s.iso2),this.l.setAttribute("class","iti__flag iti__".concat(e));var i=e?"".concat(this.s.name,": +").concat(this.s.dialCode):"Unknown";if(this.selectedFlag.setAttribute("title",i),this.d.separateDialCode){var r=this.s.dialCode?"+".concat(this.s.dialCode):"";this.t.innerHTML=r;var a=this.selectedFlag.offsetWidth||this._z2();this.a.style.paddingLeft="".concat(a+6,"px")}if(this._0(),this.d.allowDropdown){var n=this.b;if(n&&(n.classList.remove("iti__active"),n.setAttribute("aria-selected","false")),e){var o=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(e,"-preferred"))||this.m.querySelector("#iti-".concat(this.id,"__item-").concat(e));o.setAttribute("aria-selected","true"),o.classList.add("iti__active"),this.b=o,this.selectedFlag.setAttribute("aria-activedescendant",o.getAttribute("id"))}}return t.iso2!==e}},{key:"_z2",value:function(){var e=this.a.parentNode.cloneNode();e.style.visibility="hidden",document.body.appendChild(e);var t=this.k.cloneNode();e.appendChild(t);var i=this.selectedFlag.cloneNode(!0);t.appendChild(i);var r=i.offsetWidth;return e.parentNode.removeChild(e),r}},{key:"_0",value:function(){var e="aggressive"===this.d.autoPlaceholder||!this.e&&"polite"===this.d.autoPlaceholder;if(window.intlTelInputUtils&&e){var t=intlTelInputUtils.numberType[this.d.placeholderNumberType],i=this.s.iso2?intlTelInputUtils.getExampleNumber(this.s.iso2,this.d.nationalMode,t):"";i=this._7(i),"function"==typeof this.d.customPlaceholder&&(i=this.d.customPlaceholder(i,this.s)),this.a.setAttribute("placeholder",i)}}},{key:"_1",value:function(e){var t=this._z(e.getAttribute("data-country-code"));this._2(),this._4(e.getAttribute("data-dial-code"),!0),this.a.focus();var i=this.a.value.length;this.a.setSelectionRange(i,i),t&&this._m2CountryChange()}},{key:"_2",value:function(){this.m.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.u.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._a3),document.documentElement.removeEventListener("click",this._a2),this.m.removeEventListener("mouseover",this._a0),this.m.removeEventListener("click",this._a1),this.d.dropdownContainer&&(this.g||window.removeEventListener("scroll",this._a4),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._m2("close:countrydropdown")}},{key:"_3",value:function(e,t){var i=this.m,r=window.pageYOffset||document.documentElement.scrollTop,a=i.offsetHeight,n=i.getBoundingClientRect().top+r,o=n+a,d=e.offsetHeight,l=e.getBoundingClientRect().top+r,s=l+d,u=l-n+i.scrollTop,c=a/2-d/2;if(l<n)t&&(u-=c),i.scrollTop=u;else if(o<s){t&&(u+=c);var m=a-d;i.scrollTop=u-m}}},{key:"_4",value:function(e,t){var i,r=this.a.value,a="+".concat(e);if("+"===r.charAt(0)){var n=this._5(r);i=n?r.replace(n,a):a}else{if(this.d.nationalMode||this.d.separateDialCode)return;if(r)i=a+r;else{if(!t&&this.d.autoHideDialCode)return;i=a}}this.a.value=i}},{key:"_5",value:function(e,t){var i="";if("+"===e.charAt(0))for(var r="",a=0;a<e.length;a++){var n=e.charAt(a);if(!isNaN(parseInt(n,10))){if(r+=n,t)this.q[r]&&(i=e.substr(0,a+1));else if(this.dialCodes[r]){i=e.substr(0,a+1);break}if(r.length===this.countryCodeMaxLen)break}}return i}},{key:"_6",value:function(){var e=this.a.value.trim(),t=this.s.dialCode,i=this._m(e);return(this.d.separateDialCode&&"+"!==e.charAt(0)&&t&&i?"+".concat(t):"")+e}},{key:"_7",value:function(e){var t=e;if(this.d.separateDialCode){var i=this._5(t);if(i){var r=" "===t[(i="+".concat(this.s.dialCode)).length]||"-"===t[i.length]?i.length+1:i.length;t=t.substr(r)}}return this._j2(t)}},{key:"_m2CountryChange",value:function(){this._m2("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.d.initialCountry&&(this.j=window.intlTelInputGlobals.autoCountry,this.a.value||this.setCountry(this.j),this.h())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.a.value&&this._u(this.a.value),this._0()),this.i0()}},{key:"destroy",value:function(){var e=this.a.form;if(this.d.allowDropdown){this._2(),this.selectedFlag.removeEventListener("click",this._a10),this.k.removeEventListener("keydown",this._a11);var t=this._i1();t&&t.removeEventListener("click",this._a9)}this.hiddenInput&&e&&e.removeEventListener("submit",this._a14),this.d.autoHideDialCode&&(e&&e.removeEventListener("submit",this._a8),this.a.removeEventListener("blur",this._a8)),this.a.removeEventListener("keyup",this._a12),this.a.removeEventListener("cut",this._a13),this.a.removeEventListener("paste",this._a13),this.a.removeAttribute("data-intl-tel-input-id");var i=this.a.parentNode;i.parentNode.insertBefore(this.a,i),i.parentNode.removeChild(i),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._6(),this.s.iso2):""}},{key:"getNumber",value:function(e){if(window.intlTelInputUtils){var t=this.s.iso2;return intlTelInputUtils.formatNumber(this._6(),t,e)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._6(),this.s.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.s}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var e=this.s.iso2;return intlTelInputUtils.getValidationError(this._6(),e)}return-99}},{key:"isValidNumber",value:function(){var e=this._6().trim(),t=this.d.nationalMode?this.s.iso2:"";return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(e,t):null}},{key:"setCountry",value:function(e){var t=e.toLowerCase();this.l.classList.contains("iti__".concat(t))||(this._z(t),this._4(this.s.dialCode,!1),this._m2CountryChange())}},{key:"setNumber",value:function(e){var t=this._v(e);this._u(e),t&&this._m2CountryChange()}},{key:"setPlaceholderNumberType",value:function(e){this.d.placeholderNumberType=e,this._0()}}])&&r(e.prototype,t),i&&r(e,i),a;var e,t,i}();i.getCountryData=function(){return n};var c=function(e,t,i){var r=document.createElement("script");r.onload=function(){u("handleUtils"),t&&t()},r.onerror=function(){u("rejectUtilsScriptPromise"),i&&i()},r.className="iti-load-utils",r.async=!0,r.src=e,document.body.appendChild(r)};return i.loadUtils=function(i){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise(function(e,t){return c(i,e,t)});c(i)}return null},i.defaults=d,i.version="17.0.13",function(e,t){var i=new a(e,t);return i._init(),e.setAttribute("data-intl-tel-input-id",i.id),window.intlTelInputGlobals.instances[i.id]=i}}()});var gmapdata=new Array,gmapmarker=new Array;function if_gmap_init(e,t){if(document.getElementById(e+"_element"+t)){map=document.getElementById(e+"_element"+t);var i=parseInt(map.getAttribute("zoom")),r=map.getAttribute("center_x"),a=map.getAttribute("center_y"),n=new google.maps.LatLng(a,r);return gmapdata[e]=new google.maps.Map(document.getElementById(e+"_element"+t),{center:n,zoom:i,mapTypeId:"roadmap"}),gmapmarker[e]=new Array,!1}draggab=!1,map=document.getElementById(e);i=parseInt(map.getAttribute("zoom")),r=map.getAttribute("long"),a=map.getAttribute("lat"),n=new google.maps.LatLng(a,r);return gmapdata=new google.maps.Map(document.getElementById(e),{center:n,zoom:i,mapTypeId:"roadmap"}),geocoder=new google.maps.Geocoder,(gmapmarker=new google.maps.Marker({map:gmapdata,position:n,draggable:draggab})).setDraggable(draggab),infoW=new google.maps.InfoWindow,google.maps.event.addListener(gmapdata,"mouseover",function(e){document.getElementById("longval")||(gmapmarker.draggable=!1)}),google.maps.event.addListener(gmapdata,"click",function(e){document.getElementById("longval")&&(document.getElementById("longval").value=e.latLng.lng().toFixed(6),document.getElementById("latval").value=e.latLng.lat().toFixed(6),gmapmarker.setPosition(e.latLng),if_gmap_updateMap(),geocoder.geocode({latLng:gmapmarker.getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval")&&(document.getElementById("addrval").value=e[0].formatted_address)}))}),google.maps.event.addListener(gmapmarker,"drag",function(){document.getElementById("longval")&&(geocoder.geocode({latLng:gmapmarker.getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval")&&(document.getElementById("addrval").value=e[0].formatted_address)}),if_gmap_updateMap(),document.getElementById("latval").value=gmapmarker.getPosition().lat().toFixed(6),document.getElementById("longval").value=gmapmarker.getPosition().lng().toFixed(6))}),google.maps.event.addListener(gmapmarker,"click",function(){infoW.setContent('<div style="overflow: hidden;">'+document.getElementById(e).getAttribute("info")+"</div>");infoW.setOptions({maxWidth:"300"}),infoW.open(this.getMap(),this)}),document.getElementById("longval")&&(document.getElementById("longval").value=r,document.getElementById("latval").value=a,geocoder.geocode({latLng:gmapmarker.getPosition()},function(e,t){t==google.maps.GeocoderStatus.OK&&e[0]&&document.getElementById("addrval")&&(document.getElementById("addrval").value=e[0].formatted_address)})),!1}function add_marker_on_map(e,t,i,r,a,n,o){var d=new google.maps.LatLng(r,i);return gmapmarker[e][t]=new google.maps.Marker({map:gmapdata[e],position:d,draggable:o}),gmapmarker[e][t].setDraggable(o),o&&google.maps.event.addListener(gmapmarker[e][t],"drag",function(){document.getElementById(e+"_lat"+n).value=gmapmarker[e][t].getPosition().lat().toFixed(6),document.getElementById(e+"_long"+n).value=gmapmarker[e][t].getPosition().lng().toFixed(6)}),infoW=new google.maps.InfoWindow,google.maps.event.addListener(gmapmarker[e][t],"click",function(){infoW.setContent('<div style="overflow: hidden;">'+document.getElementById(e+"_element"+n).getAttribute("info"+t)+"</div>");infoW.setOptions({maxWidth:"300"}),infoW.open(this.getMap(),this)}),!1}!function(L){function i(e,t){var n=this,o=L.extend({},L.fn.signaturePad.defaults,t),d=L(e),i=L(o.canvas,d),l=i.get(0),s=null,u={x:null,y:null},c=[],m=!1,r=!1,a=!1,_=!1,f=30,p=f,y=0;function h(){clearTimeout(m),r=m=!1}function v(e,t){var i,r,a;if(e.preventDefault(),i=L(e.target).offset(),clearTimeout(m),m=!1,a=void 0!==e.targetTouches?(r=Math.floor(e.targetTouches[0].pageX-i.left),Math.floor(e.targetTouches[0].pageY-i.top)):(r=Math.floor(e.pageX-i.left),Math.floor(e.pageY-i.top)),u.x===r&&u.y===a)return!0;null===u.x&&(u.x=r),null===u.y&&(u.y=a),t&&(a+=t),s.beginPath(),s.moveTo(u.x,u.y),s.lineTo(r,a),s.lineCap=o.penCap,s.stroke(),s.closePath(),c.push({lx:r,ly:a,mx:u.x,my:u.y}),u.x=r,u.y=a,o.onDraw&&"function"==typeof o.onDraw&&o.onDraw.apply(n)}function w(){g()}function g(e){e?v(e,1):(a?i.each(function(){this.removeEventListener("touchmove",v)}):i.unbind("mousemove.signaturepad"),0<c.length&&o.onDrawEnd&&"function"==typeof o.onDrawEnd&&o.onDrawEnd.apply(n)),u.x=null,u.y=null,o.output&&0<c.length&&L(o.output,d).val(JSON.stringify(c))}function b(){s.clearRect(0,0,l.width,l.height),s.fillStyle=o.bgColour,s.fillRect(0,0,l.width,l.height),o.displayOnly||o.lineWidth&&(s.beginPath(),s.lineWidth=o.lineWidth,s.strokeStyle=o.lineColour,s.moveTo(o.lineMargin,o.lineTop),s.lineTo(l.width-o.lineMargin,o.lineTop),s.stroke(),s.closePath()),s.lineWidth=o.penWidth,s.strokeStyle=o.penColour,L(o.output,d).val(""),c=[],g()}function j(e,t){null==u.x?v(e,1):v(e,t)}function Q(e,t){a?t.addEventListener("touchmove",j,!1):i.bind("mousemove.signaturepad",j),v(e,1)}function k(e){if(_)return!1;_=!0,L("input").blur(),void 0!==e.targetTouches&&(a=!0),a?(i.each(function(){this.addEventListener("touchend",w,!1),this.addEventListener("touchcancel",w,!1)}),i.unbind("mousedown.signaturepad")):(L(document).bind("mouseup.signaturepad",function(){r&&(g(),h())}),i.bind("mouseleave.signaturepad",function(e){r&&g(e),r&&!m&&(m=setTimeout(function(){g(),h()},500))}),i.each(function(){this.ontouchstart=null}))}function C(){L(o.typed,d).hide(),b(),i.each(function(){this.addEventListener("touchstart",function(e){e.preventDefault(),r=!0,k(e),Q(e,this)})}),i.bind("mousedown.signaturepad",function(e){if(e.preventDefault(),1<e.which)return!1;r=!0,k(e),Q(e)}),L(o.clear,d).bind("click.signaturepad",function(e){e.preventDefault(),b()}),L(o.typeIt,d).bind("click.signaturepad",function(e){e.preventDefault(),x()}),L(o.drawIt,d).unbind("click.signaturepad"),L(o.drawIt,d).bind("click.signaturepad",function(e){e.preventDefault()}),L(o.typeIt,d).removeClass(o.currentClass),L(o.drawIt,d).addClass(o.currentClass),L(o.sig,d).addClass(o.currentClass),L(o.typeItDesc,d).hide(),L(o.drawItDesc,d).show(),L(o.clear,d).show()}function x(){b(),_=!1,i.each(function(){this.removeEventListener&&(this.removeEventListener("touchend",w),this.removeEventListener("touchcancel",w),this.removeEventListener("touchmove",v)),this.ontouchstart&&(this.ontouchstart=null)}),L(document).unbind("mouseup.signaturepad"),i.unbind("mousedown.signaturepad"),i.unbind("mousemove.signaturepad"),i.unbind("mouseleave.signaturepad"),L(o.clear,d).unbind("click.signaturepad"),L(o.typed,d).show(),L(o.drawIt,d).bind("click.signaturepad",function(e){e.preventDefault(),C()}),L(o.typeIt,d).unbind("click.signaturepad"),L(o.typeIt,d).bind("click.signaturepad",function(e){e.preventDefault()}),L(o.output,d).val(""),L(o.drawIt,d).removeClass(o.currentClass),L(o.typeIt,d).addClass(o.currentClass),L(o.sig,d).removeClass(o.currentClass),L(o.drawItDesc,d).hide(),L(o.clear,d).hide(),L(o.typeItDesc,d).show(),p=f=L(o.typed,d).css("font-size").replace(/px/,"")}function I(e){var t=L(o.typed,d),i=L.trim(e.replace(/>/g,"&gt;").replace(/</g,"&lt;")),r=y,a=.5*p;if(y=i.length,t.html(i),i){if(r<y&&t.outerWidth()>l.width)for(;t.outerWidth()>l.width;)p--,t.css("font-size",p+"px");if(y<r&&t.outerWidth()+a<l.width&&p<f)for(;t.outerWidth()+a<l.width&&p<f;)p++,t.css("font-size",p+"px")}else t.css("font-size",f+"px")}function E(){var e=!0,t={drawInvalid:!1,nameInvalid:!1},i=[d,o],r=[t,d,o];return o.onBeforeValidate&&"function"==typeof o.onBeforeValidate?o.onBeforeValidate.apply(n,i):function(e,t){L("p."+t.errorClass,e).remove(),e.removeClass(t.errorClass),L("input, label",e).removeClass(t.errorClass)}.apply(n,i),o.drawOnly&&c.length<1&&(e=!(t.drawInvalid=!0)),""===L(o.name,d).val()&&(e=!(t.nameInvalid=!0)),o.onFormError&&"function"==typeof o.onFormError?o.onFormError.apply(n,r):function(e,t,i){e.nameInvalid&&(t.prepend(['<p class="',i.errorClass,'">',i.errorMessage,"</p>"].join("")),L(i.name,t).focus(),L(i.name,t).addClass(i.errorClass),L("label[for="+L(i.name).attr("id")+"]",t).addClass(i.errorClass)),e.drawInvalid&&t.prepend(['<p class="',i.errorClass,'">',i.errorMessageDraw,"</p>"].join(""))}.apply(n,r),e}function A(e,t,i){for(var r in e)"object"==typeof e[r]&&(t.beginPath(),t.moveTo(e[r].mx,e[r].my),t.lineTo(e[r].lx,e[r].ly),t.lineCap=o.penCap,t.stroke(),t.closePath(),i&&e[r].lx&&c.push({lx:e[r].lx,ly:e[r].ly,mx:e[r].mx,my:e[r].my}))}L.extend(n,{signaturePad:"2.5.2",init:function(){parseFloat((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)||[0,"4_2"])[1].replace("_","."))<4.1&&(L.fn.Oldoffset=L.fn.offset,L.fn.offset=function(){var e=L(this).Oldoffset();return e.top-=window.scrollY,e.left-=window.scrollX,e}),L(o.typed,d).bind("selectstart.signaturepad",function(e){return L(e.target).is(":input")}),i.bind("selectstart.signaturepad",function(e){return L(e.target).is(":input")}),!l.getContext&&FlashCanvas&&FlashCanvas.initElement(l),l.getContext&&(s=l.getContext("2d"),L(o.sig,d).show(),o.displayOnly||(o.drawOnly||(L(o.name,d).bind("keyup.signaturepad",function(){I(L(this).val())}),L(o.name,d).bind("blur.signaturepad",function(){I(L(this).val())}),L(o.drawIt,d).bind("click.signaturepad",function(e){e.preventDefault(),C()})),o.drawOnly||"drawIt"===o.defaultAction?C():x(),o.validateFields&&(L(e).is("form")?L(e).bind("submit.signaturepad",function(){return E()}):L(e).parents("form").bind("submit.signaturepad",function(){return E()})),L(o.sigNav,d).show()))},updateOptions:function(e){L.extend(o,e)},regenerate:function(e){n.clearCanvas(),L(o.typed,d).hide(),"string"==typeof e&&(e=JSON.parse(e)),A(e,s,!0),o.output&&0<L(o.output,d).length&&L(o.output,d).val(JSON.stringify(c))},clearCanvas:function(){b()},getSignature:function(){return c},getSignatureString:function(){return JSON.stringify(c)},getSignatureImage:function(){var e,t=document.createElement("canvas"),i=null;return t.style.position="absolute",t.style.top="-999em",t.width=l.width,t.height=l.height,document.body.appendChild(t),!t.getContext&&FlashCanvas&&FlashCanvas.initElement(t),(i=t.getContext("2d")).fillStyle=o.bgColour,i.fillRect(0,0,l.width,l.height),i.lineWidth=o.penWidth,i.strokeStyle=o.penColour,A(c,i),e=t.toDataURL.apply(t,arguments),document.body.removeChild(t),t=null,e},validateForm:function(){return E()}})}L.fn.signaturePad=function(e){var t=null;return this.each(function(){L.data(this,"plugin-signaturePad")?(t=L.data(this,"plugin-signaturePad")).updateOptions(e):((t=new i(this,e)).init(),L.data(this,"plugin-signaturePad",t))}),t},L.fn.signaturePad.defaults={defaultAction:"typeIt",displayOnly:!1,drawOnly:!1,canvas:"canvas",sig:".sig",sigNav:".sigNav",bgColour:"#ffffff",penColour:"#145394",penWidth:2,penCap:"round",lineColour:"#ccc",lineWidth:2,lineMargin:5,lineTop:35,name:".name",typed:".typed",clear:".clearButton",typeIt:".typeIt a",drawIt:".drawIt a",typeItDesc:".typeItDesc",drawItDesc:".drawItDesc",output:".output",currentClass:"current",validateFields:!0,errorClass:"error",errorMessage:"Please enter your name",errorMessageDraw:"Please sign the document",onBeforeValidate:null,onFormError:null,onDraw:null,onDrawEnd:null}}(jQuery);
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,10web,wdsupport,formmakersupport
3
  Tags: form, forms, form builder, contact form, feedback, custom form, contact, web contact form, captcha, email, form manager, survey
4
  Requires at least: 4.6
5
  Tested up to: 5.8
6
- Stable tag: 1.14.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -561,6 +561,14 @@ Where **{{field_id}}** is the ID of the field you wish to prefill. Also, **{{par
561
 
562
 
563
  == Changelog ==
 
 
 
 
 
 
 
 
564
  = 1.14.6 =
565
  * Improved: Updated js libs.
566
  * Improved: Show Stripe payment transaction ID on submissions page.
3
  Tags: form, forms, form builder, contact form, feedback, custom form, contact, web contact form, captcha, email, form manager, survey
4
  Requires at least: 4.6
5
  Tested up to: 5.8
6
+ Stable tag: 1.14.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
561
 
562
 
563
  == Changelog ==
564
+ = 1.14.7 =
565
+ * Added: Provide a function to show popup form on button click.
566
+ * Improved: Make it possible to change currency with none payment.
567
+ * Improved: Translatable recaptcha.
568
+ * Fixed: Condition hidden address field failed the form submissions if marked as required.
569
+ * Fixed: Payment options default values.
570
+ * Fixed: Privacy policy links.
571
+
572
  = 1.14.6 =
573
  * Improved: Updated js libs.
574
  * Improved: Show Stripe payment transaction ID on submissions page.