WC Vendors - Version 2.0.3

Version Description

Download this release

Release Info

Developer digitalchild
Plugin Icon 128x128 WC Vendors
Version 2.0.3
Comparing to
See all releases

Code changes from version 2.0.2 to 2.0.3

Files changed (116) hide show
  1. changelog.txt +7 -0
  2. class-wc-vendors.php +2 -2
  3. classes/admin/class-product-meta.php +2 -2
  4. classes/admin/class-vendor-applicants.php +1 -1
  5. classes/admin/class-wcv-admin-setup.php +29 -0
  6. classes/admin/class-wcv-commissions-page.php +2 -1
  7. classes/admin/class-wcv-commissions-sum-csv-exporter.php +85 -0
  8. classes/admin/emails/class-emails.php +1 -1
  9. classes/admin/emails/class-wc-notify-admin.php +1 -1
  10. classes/admin/emails/class-wcv-admin-notify-application.php +3 -3
  11. classes/admin/emails/class-wcv-admin-notify-product.php +3 -3
  12. classes/admin/emails/class-wcv-admin-notify-shipped.php +2 -2
  13. classes/admin/emails/class-wcv-customer-notify-shipped.php +2 -2
  14. classes/admin/emails/class-wcv-vendor-notify-application.php +5 -5
  15. classes/admin/emails/class-wcv-vendor-notify-approved.php +3 -3
  16. classes/admin/emails/class-wcv-vendor-notify-denied.php +4 -4
  17. classes/admin/emails/class-wcv-vendor-notify-order.php +1 -1
  18. classes/admin/settings/class-wcv-settings-capabilities.php +23 -23
  19. classes/admin/settings/class-wcv-settings-commission.php +1 -1
  20. classes/admin/settings/class-wcv-settings-display.php +37 -21
  21. classes/admin/settings/class-wcv-settings-general.php +5 -5
  22. classes/admin/settings/class-wcv-settings-payments.php +3 -3
  23. classes/admin/views/notices/html-notice-update.php +1 -1
  24. classes/admin/views/setup/capabilities.php +8 -8
  25. classes/admin/views/setup/general.php +4 -4
  26. classes/admin/views/setup/pages.php +5 -5
  27. classes/class-commission.php +47 -0
  28. classes/class-install.php +4 -0
  29. classes/class-vendor-post-types.php +1 -1
  30. classes/class-vendors.php +1 -1
  31. classes/front/orders/class-orders.php +2 -2
  32. classes/includes/class-functions.php +15 -6
  33. classes/includes/wcv-update-functions.php +10 -0
  34. languages/wc-vendors.pot +225 -162
  35. package-lock.json +6058 -0
  36. readme.txt +13 -4
  37. templates/emails/vendor-notify-order.php +1 -1
  38. trunk/assets/banner-1544x500.png +0 -0
  39. trunk/assets/banner-772x250.png +0 -0
  40. trunk/assets/css/_variables.scss +23 -0
  41. trunk/assets/css/admin-orders.css +7 -0
  42. trunk/assets/css/select2.min.css +1 -0
  43. trunk/assets/css/wcv-activation.css +21 -0
  44. trunk/assets/css/wcv-activation.min.css +1 -0
  45. trunk/assets/css/wcv-activation.scss +68 -0
  46. trunk/assets/css/wcv-admin.css +162 -0
  47. trunk/assets/css/wcv-admin.min.css +1 -0
  48. trunk/assets/css/wcv-admin.scss +474 -0
  49. trunk/assets/css/wcv-frontend.css +547 -0
  50. trunk/assets/css/wcv-setup.css +185 -0
  51. trunk/assets/css/wcv-setup.min.css +1 -0
  52. trunk/assets/css/wcv-setup.scss +540 -0
  53. trunk/assets/icon-128x128.png +0 -0
  54. trunk/assets/icon-256x256.png +0 -0
  55. trunk/assets/icon.svg +115 -0
  56. trunk/assets/images/extensions/screenshot-1.png +0 -0
  57. trunk/assets/images/extensions/screenshot-2.png +0 -0
  58. trunk/assets/images/extensions/screenshot-3.png +0 -0
  59. trunk/assets/images/icons/truck.png +0 -0
  60. trunk/assets/images/wcvendors_logo.png +0 -0
  61. trunk/assets/js/admin/settings.js +40 -0
  62. trunk/assets/js/admin/wcv-setup.js +0 -0
  63. trunk/assets/js/front-orders.js +8 -0
  64. trunk/assets/js/select2.min.js +3 -0
  65. trunk/assets/js/wcv-admin-login.js +9 -0
  66. trunk/assets/js/wcv-admin-quick-edit.js +34 -0
  67. trunk/assets/js/wcv-commissions.js +11 -0
  68. trunk/assets/screenshot-1.png +0 -0
  69. trunk/assets/screenshot-2.png +0 -0
  70. trunk/assets/screenshot-3.png +0 -0
  71. trunk/assets/screenshot-4.png +0 -0
  72. trunk/assets/screenshot-5.png +0 -0
  73. trunk/assets/screenshot-6.png +0 -0
  74. trunk/assets/screenshot-7.png +0 -0
  75. trunk/changelog.txt +700 -0
  76. trunk/class-wc-vendors.php +425 -0
  77. trunk/classes/admin/class-admin-menus.php +185 -0
  78. trunk/classes/admin/class-admin-page.php +882 -0
  79. trunk/classes/admin/class-admin-reports.php +544 -0
  80. trunk/classes/admin/class-admin-users.php +425 -0
  81. trunk/classes/admin/class-product-meta.php +268 -0
  82. trunk/classes/admin/class-setup-wizard.php +348 -0
  83. trunk/classes/admin/class-vendor-admin-dashboard.php +724 -0
  84. trunk/classes/admin/class-vendor-applicants.php +104 -0
  85. trunk/classes/admin/class-vendor-reports.php +121 -0
  86. trunk/classes/admin/class-wcv-admin-extensions.php +25 -0
  87. trunk/classes/admin/class-wcv-admin-help.php +120 -0
  88. trunk/classes/admin/class-wcv-admin-notices.php +249 -0
  89. trunk/classes/admin/class-wcv-admin-settings.php +668 -0
  90. trunk/classes/admin/class-wcv-admin-setup.php +304 -0
  91. trunk/classes/admin/class-wcv-commissions-csv-exporter.php +175 -0
  92. trunk/classes/admin/class-wcv-commissions-page.php +554 -0
  93. trunk/classes/admin/class-wcv-commissions-sum-csv-exporter.php +85 -0
  94. trunk/classes/admin/emails/class-emails.php +244 -0
  95. trunk/classes/admin/emails/class-wc-approve-vendor.php +165 -0
  96. trunk/classes/admin/emails/class-wc-notify-admin.php +176 -0
  97. trunk/classes/admin/emails/class-wc-notify-shipped.php +201 -0
  98. trunk/classes/admin/emails/class-wc-notify-vendor.php +355 -0
  99. trunk/classes/admin/emails/class-wcv-admin-notify-application.php +185 -0
  100. trunk/classes/admin/emails/class-wcv-admin-notify-product.php +192 -0
  101. trunk/classes/admin/emails/class-wcv-admin-notify-shipped.php +181 -0
  102. trunk/classes/admin/emails/class-wcv-customer-notify-shipped.php +235 -0
  103. trunk/classes/admin/emails/class-wcv-vendor-notify-application.php +167 -0
  104. trunk/classes/admin/emails/class-wcv-vendor-notify-approved.php +185 -0
  105. trunk/classes/admin/emails/class-wcv-vendor-notify-denied.php +203 -0
  106. trunk/classes/admin/emails/class-wcv-vendor-notify-order.php +213 -0
  107. trunk/classes/admin/settings/README.md +126 -0
  108. trunk/classes/admin/settings/assets/css/sf-styles.css +167 -0
  109. trunk/classes/admin/settings/assets/img/tip.png +0 -0
  110. trunk/classes/admin/settings/assets/js/bootstrap-tooltip.js +126 -0
  111. trunk/classes/admin/settings/assets/js/js.iml +10 -0
  112. trunk/classes/admin/settings/assets/js/select2/select2-bootstrap.css +87 -0
  113. trunk/classes/admin/settings/assets/js/select2/select2-spinner.gif +0 -0
  114. trunk/classes/admin/settings/assets/js/select2/select2.css +704 -0
  115. trunk/classes/admin/settings/assets/js/select2/select2.js +3541 -0
  116. trunk/classes/admin/settings/assets/js/select2/select2.min.js +23 -0
changelog.txt CHANGED
@@ -1,5 +1,12 @@
1
  Changelog for WC Vendors
2
 
 
 
 
 
 
 
 
3
  Version 2.0.2
4
 
5
  * Fixed: Corrected settings conditional checks across classes
1
  Changelog for WC Vendors
2
 
3
+ Version 2.0.3
4
+
5
+ * Added: Export Commission Sum Totals
6
+ * Added: New setting to rename vendors store wide
7
+ * Fixed: Update Dialog is stuck #409
8
+ * Updated: Langage file
9
+
10
  Version 2.0.2
11
 
12
  * Fixed: Corrected settings conditional checks across classes
class-wc-vendors.php CHANGED
@@ -7,7 +7,7 @@
7
  * Author URI: https://www.wcvendors.com
8
  * GitHub Plugin URI: https://github.com/wcvendors/wcvendors
9
  *
10
- * Version: 2.0.2
11
  * Requires at least: 4.4.0
12
  * Tested up to: 4.9.5
13
  * WC requires at least: 3.0.0
@@ -80,7 +80,7 @@ if ( wcv_is_woocommerce_activated() ) {
80
  class WC_Vendors
81
  {
82
 
83
- public $version = '2.0.2';
84
 
85
  /**
86
  * @var
7
  * Author URI: https://www.wcvendors.com
8
  * GitHub Plugin URI: https://github.com/wcvendors/wcvendors
9
  *
10
+ * Version: 2.0.3
11
  * Requires at least: 4.4.0
12
  * Tested up to: 4.9.5
13
  * WC requires at least: 3.0.0
80
  class WC_Vendors
81
  {
82
 
83
+ public $version = '2.0.3';
84
 
85
  /**
86
  * @var
classes/admin/class-product-meta.php CHANGED
@@ -43,7 +43,7 @@ class WCV_Product_Meta
43
  public function change_author_meta_box_title()
44
  {
45
  global $wp_meta_boxes;
46
- $wp_meta_boxes[ 'product' ][ 'normal' ][ 'core' ][ 'authordiv' ][ 'title' ] = __( 'Vendor', 'wc-vendors' );;
47
  }
48
 
49
 
@@ -184,7 +184,7 @@ class WCV_Product_Meta
184
  * Rename the Authors column to Vendor on products page
185
  */
186
  public function vendor_column_quickedit($posts_columns) {
187
- $posts_columns['author'] = __( 'Vendor', 'wc-vendors' );
188
 
189
  return $posts_columns;
190
  }
43
  public function change_author_meta_box_title()
44
  {
45
  global $wp_meta_boxes;
46
+ $wp_meta_boxes[ 'product' ][ 'normal' ][ 'core' ][ 'authordiv' ][ 'title' ] = wcv_get_vendor_name();
47
  }
48
 
49
 
184
  * Rename the Authors column to Vendor on products page
185
  */
186
  public function vendor_column_quickedit($posts_columns) {
187
+ $posts_columns['author'] = wcv_get_vendor_name();
188
 
189
  return $posts_columns;
190
  }
classes/admin/class-vendor-applicants.php CHANGED
@@ -71,7 +71,7 @@ class WCV_Vendor_Applicants
71
  public function denied()
72
  {
73
  echo '<div class="updated">';
74
- echo '<p>' . __( 'Vendor has been <b>denied</b>.', 'wc-vendors' ) . '</p>';
75
  echo '</div>';
76
  }
77
 
71
  public function denied()
72
  {
73
  echo '<div class="updated">';
74
+ echo '<p>' . sprintf( __( '%s has been <b>denied</b>.', 'wc-vendors' ), wcv_get_vendor_name( ) ) . '</p>';
75
  echo '</div>';
76
  }
77
 
classes/admin/class-wcv-admin-setup.php CHANGED
@@ -26,6 +26,7 @@ class WCV_Admin_Setup {
26
 
27
  add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
28
  add_action( 'admin_init', array( $this, 'export_commissions' ) );
 
29
  add_filter( 'woocommerce_screen_ids', array( $this, 'wcv_screen_ids' ) );
30
  add_action( 'wcvendors_update_options_capabilities', array( $this, 'update_vendor_role' ) );
31
 
@@ -192,6 +193,34 @@ class WCV_Admin_Setup {
192
 
193
  }
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  /**
196
  * Add wc vendors screens to woocommerce screen ids to utilise js and css assets from woocommerce.
197
  *
26
 
27
  add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
28
  add_action( 'admin_init', array( $this, 'export_commissions' ) );
29
+ add_action( 'admin_init', array( $this, 'export_sum_commissions' ) );
30
  add_filter( 'woocommerce_screen_ids', array( $this, 'wcv_screen_ids' ) );
31
  add_action( 'wcvendors_update_options_capabilities', array( $this, 'update_vendor_role' ) );
32
 
193
 
194
  }
195
 
196
+ /*
197
+ * Export sum commissions via csv
198
+ */
199
+ public function export_sum_commissions(){
200
+
201
+ // prepare the items to export
202
+
203
+
204
+ if ( isset( $_GET['action'], $_GET['nonce'] ) && wp_verify_nonce( wp_unslash( $_GET['nonce'] ), 'export_commission_totals' ) && 'export_commission_totals' === wp_unslash( $_GET['action'] ) ) {
205
+
206
+ include_once( 'class-wcv-commissions-sum-csv-exporter.php' );
207
+
208
+ $exporter = new WCV_Commissions_Sum_CSV_Export();
209
+
210
+ $date = date( 'Y-M-d' );
211
+
212
+ if ( ! empty( $_GET['com_status'] ) ) { // WPCS: input var ok.
213
+ $exporter->set_filename( 'wcv_commissions_sum_'. wp_unslash( $_GET['com_status'] ) . '-' . $date . '.csv' ); // WPCS: input var ok, sanitization ok.
214
+ } else {
215
+ $exporter->set_filename( 'wcv_commissions_sum-' . $date . '.csv' ); // WPCS: input var ok, sanitization ok.
216
+ }
217
+
218
+ $exporter->export();
219
+ }
220
+
221
+ }
222
+
223
+
224
  /**
225
  * Add wc vendors screens to woocommerce screen ids to utilise js and css assets from woocommerce.
226
  *
classes/admin/class-wcv-commissions-page.php CHANGED
@@ -203,7 +203,8 @@ class WCVendors_Commissions_Page extends WP_List_Table {
203
  submit_button( __( 'Filter', 'wc-vendors' ), false, false, false, array( 'id' => "post-query-submit", 'name' => 'do-filter' ) );
204
  submit_button( __( 'Clear', 'wc-vendors' ), 'secondary', 'reset', false, array( 'type' => 'reset' ) );
205
 
206
- echo '<a class="button" style="width: 110px; float: left;" href="' . wp_nonce_url( admin_url( 'admin.php?page=wcv-commissions&action=export_commissions'. $args_url ), 'export_commissions', 'nonce' ) . '">' . __('Export to CSV') . '</a>';
 
207
  echo '</div>';
208
 
209
  }
203
  submit_button( __( 'Filter', 'wc-vendors' ), false, false, false, array( 'id' => "post-query-submit", 'name' => 'do-filter' ) );
204
  submit_button( __( 'Clear', 'wc-vendors' ), 'secondary', 'reset', false, array( 'type' => 'reset' ) );
205
 
206
+ echo '<a class="button" style="width: 110px; float: left;" href="' . wp_nonce_url( admin_url( 'admin.php?page=wcv-commissions&action=export_commissions'. $args_url ), 'export_commissions', 'nonce' ) . '">' . __('Export to CSV', 'wc-vendors' ) . '</a>';
207
+ echo '<a class="button" style="width: 150px; float: left;" href="' . wp_nonce_url( admin_url( 'admin.php?page=wcv-commissions&action=export_commission_totals'. $args_url ), 'export_commission_totals', 'nonce' ) . '">' . __('Export Totals to CSV', 'wc-vendors' ) . '</a>';
208
  echo '</div>';
209
 
210
  }
classes/admin/class-wcv-commissions-sum-csv-exporter.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Handles commission CSV export.
4
+ *
5
+ * @version 1.9.14
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ /**
13
+ * Include dependencies.
14
+ */
15
+ if ( ! class_exists( 'WC_CSV_Exporter', false ) ) {
16
+ include_once WC_ABSPATH . 'includes/export/abstract-wc-csv-exporter.php';
17
+ }
18
+
19
+ /**
20
+ * WCV_Commissions_CSV_Export Class.
21
+ */
22
+ class WCV_Commissions_Sum_CSV_Export extends WC_CSV_Exporter {
23
+
24
+ /**
25
+ * Constructor.
26
+ */
27
+ public function __construct() {
28
+ $this->column_names = $this->get_default_column_names();
29
+ }
30
+
31
+
32
+ /**
33
+ * Return an array of columns to export.
34
+ *
35
+ * @since 1.9.14
36
+ * @return array
37
+ */
38
+ public function get_default_column_names() {
39
+
40
+ return apply_filters( 'wcv_commissions_sum_export_columns', array(
41
+ 'vendor_id' => __( 'Vendor', 'wc-vendors' ),
42
+ 'total_due' => __( 'Total', 'wc-vendors' ),
43
+ 'status' => __( 'Commission Status', 'wc-vendors' ),
44
+ ) );
45
+ }
46
+
47
+ /**
48
+ * Prepare data for export.
49
+ *
50
+ * @since 1.9.14
51
+ */
52
+ public function prepare_data_to_export() {
53
+
54
+ global $wpdb;
55
+
56
+ $columns = $this->get_column_names();
57
+
58
+ if ( ! current_user_can( 'manage_options' ) ) return;
59
+
60
+ $sum_totals = WCV_Commission::get_sum_vendor_totals();
61
+ $this->total_rows = count( $sum_totals );
62
+ $this->row_data = array();
63
+
64
+ foreach ( $sum_totals as $status => $totals ) {
65
+ $row = array();
66
+ foreach ( $totals as $vendor_id => $total ) {
67
+
68
+ foreach ( $columns as $column_id => $column_name ) {
69
+ if ( $column_id == 'vendor_id' ) {
70
+ $value = WCV_Vendors::get_vendor_shop_name( $vendor_id );
71
+ } elseif ( $column_id == 'total_due' ){
72
+ $value = wc_format_localized_price( $total );
73
+ } else {
74
+ $value = $status;
75
+ }
76
+
77
+ $row[ $column_id ] = $value;
78
+ }
79
+
80
+ $this->row_data[] = apply_filters( 'wcv_sum_commissions_export_row_data', $row, $vendor_id, $total, $status );
81
+ }
82
+ }
83
+
84
+ }
85
+ }
classes/admin/emails/class-emails.php CHANGED
@@ -144,7 +144,7 @@ class WCV_Emails
144
  *
145
  */
146
  public function order_actions( $order_actions ){
147
- $order_actions[ 'send_vvendor_new_order' ] = sprintf( __( 'Resend %s new order notification', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) );
148
  return $order_actions;
149
  }
150
 
144
  *
145
  */
146
  public function order_actions( $order_actions ){
147
+ $order_actions[ 'send_vvendor_new_order' ] = sprintf( __( 'Resend %s new order notification', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
148
  return $order_actions;
149
  }
150
 
classes/admin/emails/class-wc-notify-admin.php CHANGED
@@ -139,7 +139,7 @@ class WC_Email_Notify_Admin extends WC_Email
139
  'recipient' => array(
140
  'title' => __( 'Recipient(s)', 'woocommerce' ),
141
  'type' => 'text',
142
- 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', 'woocommerce' ), esc_attr( get_option( 'admin_email' ) ) ),
143
  'placeholder' => '',
144
  'default' => ''
145
  ),
139
  'recipient' => array(
140
  'title' => __( 'Recipient(s)', 'woocommerce' ),
141
  'type' => 'text',
142
+ 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', 'wc-vendors' ), esc_attr( get_option( 'admin_email' ) ) ),
143
  'placeholder' => '',
144
  'default' => ''
145
  ),
classes/admin/emails/class-wcv-admin-notify-application.php CHANGED
@@ -24,8 +24,8 @@ class WCVendors_Admin_Notify_Application extends WC_Email {
24
  */
25
  public function __construct() {
26
  $this->id = 'admin_notify_application';
27
- $this->title = sprintf( __( 'Admin notify vendor application', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
- $this->description = sprintf( __( 'Notification is sent to chosen recipient(s) when a user applies to be a %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
29
  $this->template_html = 'emails/admin-notify-application.php';
30
  $this->template_plain = 'emails/plain/admin-notify-application.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
@@ -48,7 +48,7 @@ class WCVendors_Admin_Notify_Application extends WC_Email {
48
  * @return string
49
  */
50
  public function get_default_subject() {
51
- return sprintf( __( '[{site_title}] {user_name} has applied to be a %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
52
  }
53
 
54
  /**
24
  */
25
  public function __construct() {
26
  $this->id = 'admin_notify_application';
27
+ $this->title = sprintf( __( 'Admin notify %s application', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
28
+ $this->description = sprintf( __( 'Notification is sent to chosen recipient(s) when a user applies to be a %s', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
  $this->template_html = 'emails/admin-notify-application.php';
30
  $this->template_plain = 'emails/plain/admin-notify-application.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
48
  * @return string
49
  */
50
  public function get_default_subject() {
51
+ return sprintf( __( '[{site_title}] {user_name} has applied to be a %s', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
52
  }
53
 
54
  /**
classes/admin/emails/class-wcv-admin-notify-product.php CHANGED
@@ -24,7 +24,7 @@ class WCVendors_Admin_Notify_Product extends WC_Email {
24
  */
25
  public function __construct() {
26
  $this->id = 'admin_notify_product';
27
- $this->title = sprintf( __( 'Admin new %s product', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) );
28
  $this->description = sprintf( __( 'Notification is sent to chosen recipient(s) when a %s submits a product for approval.', 'wc-vendors' ), wcv_get_vendor_name() );
29
  $this->template_html = 'emails/admin-notify-product.php';
30
  $this->template_plain = 'emails/plain/admin-notify-product.php';
@@ -54,7 +54,7 @@ class WCVendors_Admin_Notify_Product extends WC_Email {
54
  * @return string
55
  */
56
  public function get_default_subject() {
57
- return sprintf( __( '[{site_title}] New %s product submitted by {vendor_name} - {product_name}', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) );
58
  }
59
 
60
  /**
@@ -64,7 +64,7 @@ class WCVendors_Admin_Notify_Product extends WC_Email {
64
  * @return string
65
  */
66
  public function get_default_heading() {
67
- return sprintf( __( 'New %s product submitted: {product_name}', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) );
68
  }
69
 
70
  /**
24
  */
25
  public function __construct() {
26
  $this->id = 'admin_notify_product';
27
+ $this->title = sprintf( __( 'Admin new %s product', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
28
  $this->description = sprintf( __( 'Notification is sent to chosen recipient(s) when a %s submits a product for approval.', 'wc-vendors' ), wcv_get_vendor_name() );
29
  $this->template_html = 'emails/admin-notify-product.php';
30
  $this->template_plain = 'emails/plain/admin-notify-product.php';
54
  * @return string
55
  */
56
  public function get_default_subject() {
57
+ return sprintf( __( '[{site_title}] New %s product submitted by {vendor_name} - {product_name}', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
58
  }
59
 
60
  /**
64
  * @return string
65
  */
66
  public function get_default_heading() {
67
+ return sprintf( __( 'New %s product submitted: {product_name}', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
68
  }
69
 
70
  /**
classes/admin/emails/class-wcv-admin-notify-shipped.php CHANGED
@@ -24,8 +24,8 @@ class WCVendors_Admin_Notify_Shipped extends WC_Email {
24
  */
25
  public function __construct() {
26
  $this->id = 'admin_notify_shipped';
27
- $this->title = sprintf( __( 'Admin notify %s shipped', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
- $this->description = sprintf( __( 'Notification is sent to chosen recipient(s) when a %s marks an order shipped.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
29
  $this->template_html = 'emails/admin-notify-shipped.php';
30
  $this->template_plain = 'emails/plain/admin-notify-shipped.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
24
  */
25
  public function __construct() {
26
  $this->id = 'admin_notify_shipped';
27
+ $this->title = sprintf( __( 'Admin notify %s shipped', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
28
+ $this->description = sprintf( __( 'Notification is sent to chosen recipient(s) when a %s marks an order shipped.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
  $this->template_html = 'emails/admin-notify-shipped.php';
30
  $this->template_plain = 'emails/plain/admin-notify-shipped.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
classes/admin/emails/class-wcv-customer-notify-shipped.php CHANGED
@@ -25,8 +25,8 @@ class WCVendors_Customer_Notify_Shipped extends WC_Email {
25
  public function __construct() {
26
  $this->id = 'customer_notify_shipped';
27
  $this->customer_email = true;
28
- $this->title = sprintf( __( 'Customer %s shipped', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
29
- $this->description = sprintf( __( 'Email is sent to the customer when a %s marks an order received/paid by a customer.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
30
  $this->template_html = 'emails/customer-notify-shipped.php';
31
  $this->template_plain = 'emails/plain/customer-notify-shipped.php';
32
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
25
  public function __construct() {
26
  $this->id = 'customer_notify_shipped';
27
  $this->customer_email = true;
28
+ $this->title = sprintf( __( 'Customer %s shipped', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
+ $this->description = sprintf( __( 'Email is sent to the customer when a %s marks an order received/paid by a customer.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
30
  $this->template_html = 'emails/customer-notify-shipped.php';
31
  $this->template_plain = 'emails/plain/customer-notify-shipped.php';
32
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
classes/admin/emails/class-wcv-vendor-notify-application.php CHANGED
@@ -24,8 +24,8 @@ class WCVendors_Vendor_Notify_Application extends WC_Email {
24
  */
25
  public function __construct() {
26
  $this->id = 'vendor_notify_application';
27
- $this->title = sprintf( __( 'Vendor notify application', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
- $this->description = sprintf( __( 'Notification is sent to the vendor that their application has been received', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
29
  $this->template_html = 'emails/vendor-notify-application.php';
30
  $this->template_plain = 'emails/plain/vendor-notify-application.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
@@ -45,7 +45,7 @@ class WCVendors_Vendor_Notify_Application extends WC_Email {
45
  * @return string
46
  */
47
  public function get_default_subject() {
48
- return __( '[{site_title}] Your vendor application has been received', 'wc-vendors' );
49
  }
50
 
51
  /**
@@ -55,11 +55,11 @@ class WCVendors_Vendor_Notify_Application extends WC_Email {
55
  * @return string
56
  */
57
  public function get_default_heading() {
58
- return __( 'Vendor application received', 'wc-vendors' );
59
  }
60
 
61
  public function get_default_content() {
62
- return sprintf( __( 'Hi there. This is a notification about a %s application on %s.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ), get_option( 'blogname' ) );
63
  }
64
 
65
  /**
24
  */
25
  public function __construct() {
26
  $this->id = 'vendor_notify_application';
27
+ $this->title = sprintf( __( '%s notify application', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
+ $this->description = sprintf( __( 'Notification is sent to the %s that their application has been received', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
  $this->template_html = 'emails/vendor-notify-application.php';
30
  $this->template_plain = 'emails/plain/vendor-notify-application.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
45
  * @return string
46
  */
47
  public function get_default_subject() {
48
+ return sprintf( __( '[{site_title}] Your %s application has been received', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
49
  }
50
 
51
  /**
55
  * @return string
56
  */
57
  public function get_default_heading() {
58
+ return sprintf( __( '%s application received', 'wc-vendors' ), wcv_get_vendor_name( ) );
59
  }
60
 
61
  public function get_default_content() {
62
+ return sprintf( __( 'Hi there. This is a notification about a %s application on %s.', 'wc-vendors' ), wcv_get_vendor_name( true, false ), get_option( 'blogname' ) );
63
  }
64
 
65
  /**
classes/admin/emails/class-wcv-vendor-notify-approved.php CHANGED
@@ -25,7 +25,7 @@ class WCVendors_Notify_Vendor_Approved extends WC_Email {
25
  public function __construct() {
26
  $this->id = 'vendor_notify_approved';
27
  $this->title = sprintf( __( '%s notify approved', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
- $this->description = sprintf( __( 'Notification is sent to the %s that their application has been approved', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
29
  $this->template_html = 'emails/vendor-notify-approved.php';
30
  $this->template_plain = 'emails/plain/vendor-notify-approved.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
@@ -65,7 +65,7 @@ class WCVendors_Notify_Vendor_Approved extends WC_Email {
65
  * @return string
66
  */
67
  public function get_default_content(){
68
- return sprintf( __( 'Your application to become a %s has been approved.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
69
  }
70
 
71
  /**
@@ -154,7 +154,7 @@ class WCVendors_Notify_Vendor_Approved extends WC_Email {
154
  'type' => 'textarea',
155
  'desc_tip' => true,
156
  /* translators: %s: list of placeholders */
157
- 'description' => sprintf( __( 'Email body to be included when sent to the %s.', '' ), lcfirst( wcv_get_vendor_name( ) ) ),
158
  'placeholder' => $this->get_default_content(),
159
  'default' => '',
160
  ),
25
  public function __construct() {
26
  $this->id = 'vendor_notify_approved';
27
  $this->title = sprintf( __( '%s notify approved', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
+ $this->description = sprintf( __( 'Notification is sent to the %s that their application has been approved', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
  $this->template_html = 'emails/vendor-notify-approved.php';
30
  $this->template_plain = 'emails/plain/vendor-notify-approved.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
65
  * @return string
66
  */
67
  public function get_default_content(){
68
+ return sprintf( __( 'Your application to become a %s has been approved.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
69
  }
70
 
71
  /**
154
  'type' => 'textarea',
155
  'desc_tip' => true,
156
  /* translators: %s: list of placeholders */
157
+ 'description' => sprintf( __( 'Email body to be included when sent to the %s.', '' ), wcv_get_vendor_name( true, false ) ),
158
  'placeholder' => $this->get_default_content(),
159
  'default' => '',
160
  ),
classes/admin/emails/class-wcv-vendor-notify-denied.php CHANGED
@@ -25,7 +25,7 @@ class WCVendors_Vendor_Notify_Denied extends WC_Email {
25
  public function __construct() {
26
  $this->id = 'vendor_notify_denied';
27
  $this->title = sprintf( __( '%s notify denied', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
- $this->description = sprintf( __( 'Notification is sent to the %s that their application has been denied', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
29
  $this->template_html = 'emails/vendor-notify-denied.php';
30
  $this->template_plain = 'emails/plain/vendor-notify-denied.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
@@ -45,7 +45,7 @@ class WCVendors_Vendor_Notify_Denied extends WC_Email {
45
  * @return string
46
  */
47
  public function get_default_subject() {
48
- return sprintf( __( '[{site_title}] Your %s application has been denied', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
49
  }
50
 
51
  /**
@@ -65,7 +65,7 @@ class WCVendors_Vendor_Notify_Denied extends WC_Email {
65
  * @return string
66
  */
67
  public function get_default_content(){
68
- return sprintf( __( 'Your application to become a %s has been denied.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) );
69
  }
70
 
71
  /**
@@ -172,7 +172,7 @@ class WCVendors_Vendor_Notify_Denied extends WC_Email {
172
  'title' => __( 'Reason', 'wc-vendors' ),
173
  'type' => 'textarea',
174
  'desc_tip' => true,
175
- 'description' => sprintf( __( 'Provide a reason for denying the %s application', 'wc-vendors'), lcfirst( wcv_get_vendor_name( ) ) ),
176
  'placeholder' => $this->get_default_reason(),
177
  'default' => $this->get_default_reason(),
178
  ),
25
  public function __construct() {
26
  $this->id = 'vendor_notify_denied';
27
  $this->title = sprintf( __( '%s notify denied', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
+ $this->description = sprintf( __( 'Notification is sent to the %s that their application has been denied', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
  $this->template_html = 'emails/vendor-notify-denied.php';
30
  $this->template_plain = 'emails/plain/vendor-notify-denied.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
45
  * @return string
46
  */
47
  public function get_default_subject() {
48
+ return sprintf( __( '[{site_title}] Your %s application has been denied', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
49
  }
50
 
51
  /**
65
  * @return string
66
  */
67
  public function get_default_content(){
68
+ return sprintf( __( 'Your application to become a %s has been denied.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
69
  }
70
 
71
  /**
172
  'title' => __( 'Reason', 'wc-vendors' ),
173
  'type' => 'textarea',
174
  'desc_tip' => true,
175
+ 'description' => sprintf( __( 'Provide a reason for denying the %s application', 'wc-vendors'), wcv_get_vendor_name( true, false ) ),
176
  'placeholder' => $this->get_default_reason(),
177
  'default' => $this->get_default_reason(),
178
  ),
classes/admin/emails/class-wcv-vendor-notify-order.php CHANGED
@@ -25,7 +25,7 @@ class WCVendors_Vendor_Notify_Order extends WC_Email {
25
  public function __construct() {
26
  $this->id = 'vendor_notify_order';
27
  $this->title = sprintf( __( '%s notify order', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
- $this->description = sprintf( __( 'Notification is sent to %s when an order is paid.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) );
29
  $this->template_html = 'emails/vendor-notify-order.php';
30
  $this->template_plain = 'emails/plain/vendor-notify-order.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
25
  public function __construct() {
26
  $this->id = 'vendor_notify_order';
27
  $this->title = sprintf( __( '%s notify order', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
+ $this->description = sprintf( __( 'Notification is sent to %s when an order is paid.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
  $this->template_html = 'emails/vendor-notify-order.php';
30
  $this->template_plain = 'emails/plain/vendor-notify-order.php';
31
  $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
classes/admin/settings/class-wcv-settings-capabilities.php CHANGED
@@ -62,13 +62,13 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
62
  array(
63
  'title' => __( 'Add / Edit Product', 'wc-vendors' ),
64
  'type' => 'title',
65
- 'desc' => sprintf( __( 'Configure what product information to hide from a %s when creating or editing a product', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
66
  'id' => 'product_add_options',
67
  ),
68
 
69
  array(
70
  'title' => __( 'Product Types', 'wc-vendors' ),
71
- 'desc' => sprintf( __( 'This controls what product types a %s can create', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
72
  'id' => 'wcvendors_capability_product_types',
73
  'class' => 'wc-enhanced-select',
74
  'css' => 'min-width:300px;',
@@ -80,7 +80,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
80
 
81
  array(
82
  'title' => __( 'Product Type Options', 'wc-vendors' ),
83
- 'desc' => sprintf( __( 'This controls what product type options a %s can use', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
84
  'id' => 'wcvendors_capability_product_type_options',
85
  'class' => 'wc-enhanced-select',
86
  'css' => 'min-width:300px;',
@@ -95,7 +95,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
95
 
96
  array(
97
  'title' => __( 'Product Data Tabs', 'wc-vendors' ),
98
- 'desc' => sprintf( __( 'This controls what product data tabs a %s can use', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
99
  'id' => 'wcvendors_capability_product_data_tabs',
100
  'class' => 'wc-enhanced-select',
101
  'css' => 'min-width:300px;',
@@ -116,7 +116,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
116
 
117
  array(
118
  'title' => __( 'Featured Product', 'wc-vendors' ),
119
- 'desc' => sprintf( __( 'Allow %s to use the featured product option', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
120
  'id' => 'wcvendors_capability_product_featured',
121
  'default' => 'no',
122
  'type' => 'checkbox',
@@ -124,7 +124,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
124
 
125
  array(
126
  'title' => __( 'Duplicate Product', 'wc-vendors' ),
127
- 'desc' => sprintf( __( 'Allow %s to duplicate products', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
128
  'id' => 'wcvendors_capability_product_duplicate',
129
  'default' => 'no',
130
  'type' => 'checkbox',
@@ -132,7 +132,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
132
 
133
  array(
134
  'title' => __( 'SKU', 'wc-vendors' ),
135
- 'desc' => sprintf( __( 'Hide sku field from %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
136
  'id' => 'wcvendors_capability_product_sku',
137
  'default' => 'no',
138
  'type' => 'checkbox',
@@ -140,7 +140,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
140
 
141
  array(
142
  'title' => __( 'Taxes', 'wc-vendors' ),
143
- 'desc' => sprintf( __( 'Hide tax fields from %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
144
  'id' => 'wcvendors_capability_product_taxes',
145
  'default' => 'no',
146
  'type' => 'checkbox',
@@ -156,13 +156,13 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
156
 
157
  array(
158
  'type' => 'title',
159
- 'desc' => sprintf( __( 'Configure what order information a %s can view from an order', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) ),
160
  'id' => 'order_view_options',
161
  ),
162
 
163
  array(
164
  'title' => __( 'View Order Notes', 'wc-vendors' ),
165
- 'desc' => sprintf( __( 'Allow %s to view order notes', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
166
  'id' => 'wcvendors_capability_order_read_notes',
167
  'default' => 'yes',
168
  'type' => 'checkbox',
@@ -170,7 +170,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
170
 
171
  array(
172
  'title' => __( 'Add Order notes', 'wc-vendors' ),
173
- 'desc' => sprintf( __( 'Allow %s to add order notes.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
174
  'id' => 'wcvendors_capability_order_update_notes',
175
  'default' => 'yes',
176
  'type' => 'checkbox',
@@ -178,7 +178,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
178
 
179
  array(
180
  'title' => __( 'Customer Name', 'wc-vendors' ),
181
- 'desc' => sprintf( __( 'Allow %s to view customer name fields', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
182
  'id' => 'wcvendors_capability_order_customer_name',
183
  'default' => 'yes',
184
  'type' => 'checkbox',
@@ -186,7 +186,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
186
 
187
  array(
188
  'title' => __( 'Customer Billing Address', 'wc-vendors' ),
189
- 'desc' => sprintf( __( 'Allow %s to view customer billing address fields', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
190
  'id' => 'wcvendors_capability_order_customer_billling',
191
  'default' => 'yes',
192
  'type' => 'checkbox',
@@ -194,7 +194,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
194
 
195
  array(
196
  'title' => __( 'Customer Shipping Address', 'wc-vendors' ),
197
- 'desc' => sprintf( __( 'Allow %s to view the customer shipping fields', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
198
  'id' => 'wcvendors_capability_order_customer_shipping',
199
  'default' => 'yes',
200
  'type' => 'checkbox',
@@ -202,7 +202,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
202
 
203
  array(
204
  'title' => __( 'Customer Email', 'wc-vendors' ),
205
- 'desc' => sprintf( __( 'Allow %s to view the customer email address', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
206
  'id' => 'wcvendors_capability_order_customer_email',
207
  'default' => 'yes',
208
  'type' => 'checkbox',
@@ -210,7 +210,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
210
 
211
  array(
212
  'title' => __( 'Customer Phone', 'wc-vendors' ),
213
- 'desc' => sprintf( __( 'Allow %s to view the customer phone number', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
214
  'id' => 'wcvendors_capability_order_customer_phone',
215
  'default' => 'yes',
216
  'type' => 'checkbox',
@@ -227,7 +227,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
227
  array(
228
  'title' => __( 'Permissions', 'wc-vendors' ),
229
  'type' => 'title',
230
- 'desc' => sprintf( __( 'Enable or disable functionality for your %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
231
  'id' => 'capabilities_options',
232
  ),
233
 
@@ -242,7 +242,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
242
 
243
  array(
244
  'title' => __( 'Submit Products', 'wc-vendors' ),
245
- 'desc' => sprintf( __( 'Allow %s to add/edit products', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
246
  'id' => 'wcvendors_capability_products_enabled',
247
  'default' => 'yes',
248
  'type' => 'checkbox',
@@ -250,7 +250,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
250
 
251
  array(
252
  'title' => __( 'Edit Live Products', 'wc-vendors' ),
253
- 'desc' => sprintf( __( 'Allow %s to edit published (live) products', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
254
  'id' => 'wcvendors_capability_products_edit',
255
  'default' => 'yes',
256
  'type' => 'checkbox',
@@ -258,7 +258,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
258
 
259
  array(
260
  'title' => __( 'Publish Approval', 'wc-vendors' ),
261
- 'desc' => sprintf( __( 'Allow %s to publish products directly to the marketplace without requiring approval.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
262
  'id' => 'wcvendors_capability_products_live',
263
  'default' => 'yes',
264
  'type' => 'checkbox',
@@ -275,7 +275,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
275
 
276
  array(
277
  'title' => __( 'View Orders', 'wc-vendors' ),
278
- 'desc' => sprintf( __( 'Allow %s to view orders', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
279
  'id' => 'wcvendors_capability_orders_enabled',
280
  'default' => 'yes',
281
  'type' => 'checkbox',
@@ -283,7 +283,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
283
 
284
  array(
285
  'title' => __( 'Export Orders', 'wc-vendors' ),
286
- 'desc' => sprintf( __( 'Allow %s to export their orders to a CSV file', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
287
  'id' => 'wcvendors_capability_orders_export',
288
  'default' => 'yes',
289
  'type' => 'checkbox',
@@ -291,7 +291,7 @@ class WCVendors_Settings_Capabilities extends WCVendors_Settings_Page {
291
 
292
  array(
293
  'title' => __( 'Front End Sales Reports', 'wc-vendors' ),
294
- 'desc' => sprintf( __( 'Allow %s to view sales table on the frontend on the %s dashboard page.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ), lcfirst( wcv_get_vendor_name( false ) ) ),
295
  'id' => 'wcvendors_capability_frontend_reports',
296
  'default' => 'yes',
297
  'type' => 'checkbox',
62
  array(
63
  'title' => __( 'Add / Edit Product', 'wc-vendors' ),
64
  'type' => 'title',
65
+ 'desc' => sprintf( __( 'Configure what product information to hide from the %s when creating or editing a product', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
66
  'id' => 'product_add_options',
67
  ),
68
 
69
  array(
70
  'title' => __( 'Product Types', 'wc-vendors' ),
71
+ 'desc' => sprintf( __( 'This controls what product types the %s can create', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
72
  'id' => 'wcvendors_capability_product_types',
73
  'class' => 'wc-enhanced-select',
74
  'css' => 'min-width:300px;',
80
 
81
  array(
82
  'title' => __( 'Product Type Options', 'wc-vendors' ),
83
+ 'desc' => sprintf( __( 'This controls what product type options the %s can use', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
84
  'id' => 'wcvendors_capability_product_type_options',
85
  'class' => 'wc-enhanced-select',
86
  'css' => 'min-width:300px;',
95
 
96
  array(
97
  'title' => __( 'Product Data Tabs', 'wc-vendors' ),
98
+ 'desc' => sprintf( __( 'This controls what product data tabs the %s can use', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
99
  'id' => 'wcvendors_capability_product_data_tabs',
100
  'class' => 'wc-enhanced-select',
101
  'css' => 'min-width:300px;',
116
 
117
  array(
118
  'title' => __( 'Featured Product', 'wc-vendors' ),
119
+ 'desc' => sprintf( __( 'Allow %s to use the featured product option', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
120
  'id' => 'wcvendors_capability_product_featured',
121
  'default' => 'no',
122
  'type' => 'checkbox',
124
 
125
  array(
126
  'title' => __( 'Duplicate Product', 'wc-vendors' ),
127
+ 'desc' => sprintf( __( 'Allow %s to duplicate products', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
128
  'id' => 'wcvendors_capability_product_duplicate',
129
  'default' => 'no',
130
  'type' => 'checkbox',
132
 
133
  array(
134
  'title' => __( 'SKU', 'wc-vendors' ),
135
+ 'desc' => sprintf( __( 'Hide sku field from %s', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
136
  'id' => 'wcvendors_capability_product_sku',
137
  'default' => 'no',
138
  'type' => 'checkbox',
140
 
141
  array(
142
  'title' => __( 'Taxes', 'wc-vendors' ),
143
+ 'desc' => sprintf( __( 'Hide tax fields from %s', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
144
  'id' => 'wcvendors_capability_product_taxes',
145
  'default' => 'no',
146
  'type' => 'checkbox',
156
 
157
  array(
158
  'type' => 'title',
159
+ 'desc' => sprintf( __( 'Configure what order information a %s can view from an order', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
160
  'id' => 'order_view_options',
161
  ),
162
 
163
  array(
164
  'title' => __( 'View Order Notes', 'wc-vendors' ),
165
+ 'desc' => sprintf( __( 'Allow %s to view order notes', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
166
  'id' => 'wcvendors_capability_order_read_notes',
167
  'default' => 'yes',
168
  'type' => 'checkbox',
170
 
171
  array(
172
  'title' => __( 'Add Order notes', 'wc-vendors' ),
173
+ 'desc' => sprintf( __( 'Allow %s to add order notes.', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
174
  'id' => 'wcvendors_capability_order_update_notes',
175
  'default' => 'yes',
176
  'type' => 'checkbox',
178
 
179
  array(
180
  'title' => __( 'Customer Name', 'wc-vendors' ),
181
+ 'desc' => sprintf( __( 'Allow %s to view customer name fields', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
182
  'id' => 'wcvendors_capability_order_customer_name',
183
  'default' => 'yes',
184
  'type' => 'checkbox',
186
 
187
  array(
188
  'title' => __( 'Customer Billing Address', 'wc-vendors' ),
189
+ 'desc' => sprintf( __( 'Allow %s to view customer billing address fields', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
190
  'id' => 'wcvendors_capability_order_customer_billling',
191
  'default' => 'yes',
192
  'type' => 'checkbox',
194
 
195
  array(
196
  'title' => __( 'Customer Shipping Address', 'wc-vendors' ),
197
+ 'desc' => sprintf( __( 'Allow %s to view the customer shipping fields', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
198
  'id' => 'wcvendors_capability_order_customer_shipping',
199
  'default' => 'yes',
200
  'type' => 'checkbox',
202
 
203
  array(
204
  'title' => __( 'Customer Email', 'wc-vendors' ),
205
+ 'desc' => sprintf( __( 'Allow %s to view the customer email address', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
206
  'id' => 'wcvendors_capability_order_customer_email',
207
  'default' => 'yes',
208
  'type' => 'checkbox',
210
 
211
  array(
212
  'title' => __( 'Customer Phone', 'wc-vendors' ),
213
+ 'desc' => sprintf( __( 'Allow %s to view the customer phone number', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
214
  'id' => 'wcvendors_capability_order_customer_phone',
215
  'default' => 'yes',
216
  'type' => 'checkbox',
227
  array(
228
  'title' => __( 'Permissions', 'wc-vendors' ),
229
  'type' => 'title',
230
+ 'desc' => sprintf( __( 'Enable or disable functionality for your %s', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
231
  'id' => 'capabilities_options',
232
  ),
233
 
242
 
243
  array(
244
  'title' => __( 'Submit Products', 'wc-vendors' ),
245
+ 'desc' => sprintf( __( 'Allow %s to add/edit products', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
246
  'id' => 'wcvendors_capability_products_enabled',
247
  'default' => 'yes',
248
  'type' => 'checkbox',
250
 
251
  array(
252
  'title' => __( 'Edit Live Products', 'wc-vendors' ),
253
+ 'desc' => sprintf( __( 'Allow %s to edit published (live) products', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
254
  'id' => 'wcvendors_capability_products_edit',
255
  'default' => 'yes',
256
  'type' => 'checkbox',
258
 
259
  array(
260
  'title' => __( 'Publish Approval', 'wc-vendors' ),
261
+ 'desc' => sprintf( __( 'Allow %s to publish products directly to the marketplace without requiring approval.', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
262
  'id' => 'wcvendors_capability_products_live',
263
  'default' => 'yes',
264
  'type' => 'checkbox',
275
 
276
  array(
277
  'title' => __( 'View Orders', 'wc-vendors' ),
278
+ 'desc' => sprintf( __( 'Allow %s to view orders', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
279
  'id' => 'wcvendors_capability_orders_enabled',
280
  'default' => 'yes',
281
  'type' => 'checkbox',
283
 
284
  array(
285
  'title' => __( 'Export Orders', 'wc-vendors' ),
286
+ 'desc' => sprintf( __( 'Allow %s to export their orders to a CSV file', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
287
  'id' => 'wcvendors_capability_orders_export',
288
  'default' => 'yes',
289
  'type' => 'checkbox',
291
 
292
  array(
293
  'title' => __( 'Front End Sales Reports', 'wc-vendors' ),
294
+ 'desc' => sprintf( __( 'Allow %s to view sales table on the frontend on the %s dashboard page.', 'wc-vendors' ), wcv_get_vendor_name( false, false ), wcv_get_vendor_name( false, false ) ),
295
  'id' => 'wcvendors_capability_frontend_reports',
296
  'default' => 'yes',
297
  'type' => 'checkbox',
classes/admin/settings/class-wcv-settings-commission.php CHANGED
@@ -67,7 +67,7 @@ class WCVendors_Settings_Commission extends WCVendors_Settings_Page {
67
  ),
68
  array(
69
  'title' => sprintf( __( '%s Commission %%', 'wc-vendors' ), wcv_get_vendor_name() ),
70
- 'desc' => sprintf( __( 'The global commission rate for your %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
71
  'id' => 'wcvendors_vendor_commission_rate',
72
  'css' => 'width:50px;',
73
  'default' => '50',
67
  ),
68
  array(
69
  'title' => sprintf( __( '%s Commission %%', 'wc-vendors' ), wcv_get_vendor_name() ),
70
+ 'desc' => sprintf( __( 'The global commission rate for your %s', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ),
71
  'id' => 'wcvendors_vendor_commission_rate',
72
  'css' => 'width:50px;',
73
  'default' => '50',
classes/admin/settings/class-wcv-settings-display.php CHANGED
@@ -63,13 +63,13 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
63
  array(
64
  'title' => __( '', 'wc-vendors' ),
65
  'type' => 'title',
66
- 'desc' => sprintf( __( 'Advanced options provide extra display options', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
67
  'id' => 'advanced_options',
68
  ),
69
  array(
70
  'title' => __( 'Product Page Stylesheet', 'wc-vendors' ),
71
- 'desc' => __( 'You can add CSS in this textarea, which will be loaded on the product add/edit page for vendors', 'wc-vendors' ),
72
- 'desc_tip' => sprintf( __( 'This enables the sold by labels used to show which %s shop the product belongs to', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
73
  'id' => 'wcvendors_display_advanced_stylesheet',
74
  'css' => 'width: 700px;min-height:100px',
75
  'default' => '',
@@ -88,14 +88,30 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
88
  array(
89
  'title' => __( '', 'wc-vendors' ),
90
  'type' => 'title',
91
- 'desc' => sprintf( __( 'Labels are shown on the front end, in orders or emails.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
92
  'id' => 'label_options',
93
  ),
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  array(
96
  'title' => __( 'Sold by', 'wc-vendors' ),
97
  'desc' => __( 'Enable sold by labels', 'wc-vendors' ),
98
- 'desc_tip' => sprintf( __( 'This enables the sold by labels used to show which %s shop the product belongs to', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
99
  'id' => 'wcvendors_display_label_sold_by_enable',
100
  'default' => 'yes',
101
  'type' => 'checkbox',
@@ -111,7 +127,7 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
111
 
112
  array(
113
  'title' => sprintf( __( '%s Store Info', 'wc-vendors' ), wcv_get_vendor_name() ),
114
- 'desc' => sprintf( __( 'Enable %s store info tab on the single product page', 'wc-vendors' ), wcv_get_vendor_name() ),
115
  'id' => 'wcvendors_label_store_info_enable',
116
  'default' => 'yes',
117
  'type' => 'checkbox',
@@ -119,7 +135,7 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
119
 
120
  array(
121
  'title' => sprintf( __( '%s store Info label', 'wc-vendors' ), wcv_get_vendor_name() ),
122
- 'desc' => sprintf( __( 'The %s store info label', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) ),
123
  'id' => 'wcvendors_display_label_store_info',
124
  'type' => 'text',
125
  'default' => __( 'Store Info', 'wc-vendors' ),
@@ -137,7 +153,7 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
137
  array(
138
  'title' => __( 'Pages', 'wc-vendors' ),
139
  'type' => 'title',
140
- 'desc' => sprintf( __( 'These pages used on the front end by %s.', 'wc-vendors'), lcfirst( wcv_get_vendor_name( false ) ) ),
141
  'id' => 'page_options',
142
  ),
143
  array(
@@ -147,7 +163,7 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
147
  'default' => '',
148
  'class' => 'wc-enhanced-select-nostd',
149
  'css' => 'min-width:300px;',
150
- 'desc' => sprintf( __( '<br />This sets the page used to display the front end %s dashboard. This page should contain the following shortcode. <code>[wcv_vendor_dashboard]</code>', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
151
  ),
152
  array(
153
  'title' => __( 'Shop Settings', 'wc-vendors' ),
@@ -156,7 +172,7 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
156
  'default' => '',
157
  'class' => 'wc-enhanced-select-nostd',
158
  'css' => 'min-width:300px;',
159
- 'desc' => sprintf( __( '<br />This sets the page used to display the %s shop settings page. This page should contain the following shortcode. <code>[wcv_shop_settings]</code>', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
160
  ),
161
  array(
162
  'title' => __( 'Orders', 'wc-vendors' ),
@@ -165,16 +181,16 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
165
  'default' => '',
166
  'class' => 'wc-enhanced-select-nostd',
167
  'css' => 'min-width:300px;',
168
- 'desc' => sprintf( __( '<br />This sets the page used to display the %s orders page. This page should contain the following shortcode. <code>[wcv_orders]</code>', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
169
  ),
170
  array(
171
- 'title' => sprintf( __( '%s', 'wc-vendors' ), ucfirst( wcv_get_vendor_name( false ) ) ),
172
  'id' => 'wcvendors_vendors_page_id',
173
  'type' => 'single_select_page',
174
  'default' => '',
175
  'class' => 'wc-enhanced-select-nostd',
176
  'css' => 'min-width:300px;',
177
- 'desc' => sprintf( __( '<br />This sets the page used to display a paginated list of all %1$s stores. Your %1$s stores will be available at <code>%2$s/page-slug/store-name/</code><br />This page should contain the following shortcode. <code>[wcv_vendorslist]</code>', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ), esc_html( home_url() ) ),
178
  ),
179
  array(
180
  'title' => __( 'Terms and Conditions', 'wc-vendors' ),
@@ -183,7 +199,7 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
183
  'default' => '',
184
  'class' => 'wc-enhanced-select-nostd',
185
  'css' => 'min-width:300px;',
186
- 'desc' => sprintf( __( '<br />This sets the page used to display the terms and conditions when a %s signs up.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( ) ) ),
187
  ),
188
 
189
  array( 'type' => 'sectionend', 'id' => 'page_options' ),
@@ -192,13 +208,13 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
192
  array(
193
  'title' => __( 'Store Settings', 'wc-vendors' ),
194
  'type' => 'title',
195
- 'desc' => __( 'These are the settings for the individual vendor stores.', 'wc-vendors' ),
196
  'id' => 'shop_options',
197
  ),
198
 
199
  array(
200
  'title' => sprintf( __( '%s Store URL', 'wc-vendors' ), wcv_get_vendor_name() ),
201
- 'desc' => sprintf( __( 'If you enter "vendors" your %s store will be %s/vendors/store-name/', 'wc-vendors' ), ucfirst( wcv_get_vendor_name( false ) ), esc_html( home_url() ) ),
202
  'id' => 'wcvendors_vendor_shop_permalink',
203
  'default' => 'vendors',
204
  'type' => 'text',
@@ -206,8 +222,8 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
206
 
207
  array(
208
  'title' => __( 'Shop Header', 'wc-vendors' ),
209
- 'desc' => sprintf( __( 'Enable %s shop headers', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
210
- 'desc_tip' => sprintf( __( 'This enables the %s shop header template and disables the shop description text.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
211
  'id' => 'wcvendors_display_shop_headers',
212
  'default' => 'no',
213
  'type' => 'checkbox',
@@ -215,8 +231,8 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
215
 
216
  array(
217
  'title' => __( 'Shop HTML', 'wc-vendors' ),
218
- 'desc' => sprintf( __( 'Allow HTML in %s shop desription', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
219
- 'desc_tip' => sprintf( __( 'Enable HTML for a %s shop description. You can enable or disable this per vendor by editing the vendors user account.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ),
220
  'id' => 'wcvendors_display_shop_description_html',
221
  'default' => 'no',
222
  'type' => 'checkbox',
@@ -225,7 +241,7 @@ class WCVendors_Settings_Display extends WCVendors_Settings_Page {
225
  array(
226
  'title' => __( 'Display Name', 'wc-vendors' ),
227
  'id' => 'wcvendors_display_shop_display_name',
228
- 'desc_tip' => sprintf( __( 'Select what will be used to display the %s name throughout the marketplace.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
229
  'default' => 'shop_name',
230
  'type' => 'select',
231
  'class' => 'wc-enhanced-select',
63
  array(
64
  'title' => __( '', 'wc-vendors' ),
65
  'type' => 'title',
66
+ 'desc' => sprintf( __( 'Advanced options provide extra display options', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
67
  'id' => 'advanced_options',
68
  ),
69
  array(
70
  'title' => __( 'Product Page Stylesheet', 'wc-vendors' ),
71
+ 'desc' => sprintf( __( 'You can add CSS in this textarea, which will be loaded on the product add/edit page for %s', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
72
+ 'desc_tip' => sprintf( __( 'This enables the sold by labels used to show which %s shop the product belongs to', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
73
  'id' => 'wcvendors_display_advanced_stylesheet',
74
  'css' => 'width: 700px;min-height:100px',
75
  'default' => '',
88
  array(
89
  'title' => __( '', 'wc-vendors' ),
90
  'type' => 'title',
91
+ 'desc' => sprintf( __( 'Labels are shown on the front end, in orders or emails.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
92
  'id' => 'label_options',
93
  ),
94
 
95
+ array(
96
+ 'title' => __( 'Vendor singluar term', 'wc-vendors' ),
97
+ 'desc_tip' => __( 'Change all references to vendor to this term', 'wc-vendors' ),
98
+ 'id' => 'wcvendors_vendor_singular',
99
+ 'type' => 'text',
100
+ 'default' => __( 'Vendor', 'wc-vendors' ),
101
+ ),
102
+
103
+ array(
104
+ 'title' => __( 'Vendor plural term', 'wc-vendors' ),
105
+ 'desc_tip' => __( 'Change all references to vendors to this term', 'wc-vendors' ),
106
+ 'id' => 'wcvendors_vendor_plural',
107
+ 'type' => 'text',
108
+ 'default' => __( 'Vendors', 'wc-vendors' ),
109
+ ),
110
+
111
  array(
112
  'title' => __( 'Sold by', 'wc-vendors' ),
113
  'desc' => __( 'Enable sold by labels', 'wc-vendors' ),
114
+ 'desc_tip' => sprintf( __( 'This enables the sold by labels used to show which %s shop the product belongs to', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
115
  'id' => 'wcvendors_display_label_sold_by_enable',
116
  'default' => 'yes',
117
  'type' => 'checkbox',
127
 
128
  array(
129
  'title' => sprintf( __( '%s Store Info', 'wc-vendors' ), wcv_get_vendor_name() ),
130
+ 'desc' => sprintf( __( 'Enable %s store info tab on the single product page', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
131
  'id' => 'wcvendors_label_store_info_enable',
132
  'default' => 'yes',
133
  'type' => 'checkbox',
135
 
136
  array(
137
  'title' => sprintf( __( '%s store Info label', 'wc-vendors' ), wcv_get_vendor_name() ),
138
+ 'desc' => sprintf( __( 'The %s store info label', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
139
  'id' => 'wcvendors_display_label_store_info',
140
  'type' => 'text',
141
  'default' => __( 'Store Info', 'wc-vendors' ),
153
  array(
154
  'title' => __( 'Pages', 'wc-vendors' ),
155
  'type' => 'title',
156
+ 'desc' => sprintf( __( 'These pages used on the front end by %s.', 'wc-vendors'), wcv_get_vendor_name( true, false ) ),
157
  'id' => 'page_options',
158
  ),
159
  array(
163
  'default' => '',
164
  'class' => 'wc-enhanced-select-nostd',
165
  'css' => 'min-width:300px;',
166
+ 'desc' => sprintf( __( '<br />This sets the page used to display the front end %s dashboard. This page should contain the following shortcode. <code>[wcv_vendor_dashboard]</code>', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
167
  ),
168
  array(
169
  'title' => __( 'Shop Settings', 'wc-vendors' ),
172
  'default' => '',
173
  'class' => 'wc-enhanced-select-nostd',
174
  'css' => 'min-width:300px;',
175
+ 'desc' => sprintf( __( '<br />This sets the page used to display the %s shop settings page. This page should contain the following shortcode. <code>[wcv_shop_settings]</code>', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
176
  ),
177
  array(
178
  'title' => __( 'Orders', 'wc-vendors' ),
181
  'default' => '',
182
  'class' => 'wc-enhanced-select-nostd',
183
  'css' => 'min-width:300px;',
184
+ 'desc' => sprintf( __( '<br />This sets the page used to display the %s orders page. This page should contain the following shortcode. <code>[wcv_orders]</code>', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
185
  ),
186
  array(
187
+ 'title' => sprintf( __( '%s', 'wc-vendors' ), wcv_get_vendor_name( false ) ),
188
  'id' => 'wcvendors_vendors_page_id',
189
  'type' => 'single_select_page',
190
  'default' => '',
191
  'class' => 'wc-enhanced-select-nostd',
192
  'css' => 'min-width:300px;',
193
+ 'desc' => sprintf( __( '<br />This sets the page used to display a paginated list of all %1$s stores. Your %1$s stores will be available at <code>%2$s/page-slug/store-name/</code><br />This page should contain the following shortcode. <code>[wcv_vendorslist]</code>', 'wc-vendors' ), wcv_get_vendor_name( true, false ), esc_html( home_url() ) ),
194
  ),
195
  array(
196
  'title' => __( 'Terms and Conditions', 'wc-vendors' ),
199
  'default' => '',
200
  'class' => 'wc-enhanced-select-nostd',
201
  'css' => 'min-width:300px;',
202
+ 'desc' => sprintf( __( '<br />This sets the page used to display the terms and conditions when a %s signs up.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
203
  ),
204
 
205
  array( 'type' => 'sectionend', 'id' => 'page_options' ),
208
  array(
209
  'title' => __( 'Store Settings', 'wc-vendors' ),
210
  'type' => 'title',
211
+ 'desc' => sprintf( __( 'These are the settings for the individual %s stores.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
212
  'id' => 'shop_options',
213
  ),
214
 
215
  array(
216
  'title' => sprintf( __( '%s Store URL', 'wc-vendors' ), wcv_get_vendor_name() ),
217
+ 'desc' => sprintf( __( 'If you enter "vendors" your %1$s store will be %1$s/vendors/store-name/', 'wc-vendors' ), wcv_get_vendor_name( true, false ), esc_html( home_url() ) ),
218
  'id' => 'wcvendors_vendor_shop_permalink',
219
  'default' => 'vendors',
220
  'type' => 'text',
222
 
223
  array(
224
  'title' => __( 'Shop Header', 'wc-vendors' ),
225
+ 'desc' => sprintf( __( 'Enable %s shop headers', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
226
+ 'desc_tip' => sprintf( __( 'This enables the %s shop header template and disables the shop description text.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
227
  'id' => 'wcvendors_display_shop_headers',
228
  'default' => 'no',
229
  'type' => 'checkbox',
231
 
232
  array(
233
  'title' => __( 'Shop HTML', 'wc-vendors' ),
234
+ 'desc' => sprintf( __( 'Allow HTML in %s shop desription', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
235
+ 'desc_tip' => sprintf( __( 'Enable HTML for the %1$s shop description. You can enable or disable this per %1$s by editing the %1$s user account.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
236
  'id' => 'wcvendors_display_shop_description_html',
237
  'default' => 'no',
238
  'type' => 'checkbox',
241
  array(
242
  'title' => __( 'Display Name', 'wc-vendors' ),
243
  'id' => 'wcvendors_display_shop_display_name',
244
+ 'desc_tip' => sprintf( __( 'Select what will be used to display the %s name throughout the marketplace.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
245
  'default' => 'shop_name',
246
  'type' => 'select',
247
  'class' => 'wc-enhanced-select',
classes/admin/settings/class-wcv-settings-general.php CHANGED
@@ -58,7 +58,7 @@ class WCVendors_Settings_General extends WCVendors_Settings_Page {
58
  if ( '' === $current_section ) {
59
 
60
  $settings = apply_filters( 'wcvendors_settings', array(
61
-
62
  // General Options
63
  array(
64
  'title' => __( 'Marketplace Options', 'wc-vendors' ),
@@ -68,28 +68,28 @@ class WCVendors_Settings_General extends WCVendors_Settings_Page {
68
  ),
69
  array(
70
  'title' => sprintf( __( '%s Registration', 'wc-vendors' ), wcv_get_vendor_name() ),
71
- 'desc' => sprintf( __( 'Allow users to apply to become a %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
72
  'id' => 'wcvendors_vendor_allow_registration',
73
  'default' => 'yes',
74
  'type' => 'checkbox',
75
  ),
76
  array(
77
  'title' => sprintf( __( '%s Approval', 'wc-vendors' ), wcv_get_vendor_name() ),
78
- 'desc' => sprintf( __( 'Manually approve all %s applications', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
79
  'id' => 'wcvendors_vendor_approve_registration',
80
  'default' => 'no',
81
  'type' => 'checkbox',
82
  ),
83
  array(
84
  'title' => sprintf( __( '%s Taxes', 'wc-vendors' ), wcv_get_vendor_name() ),
85
- 'desc' => sprintf( __( 'Give any taxes to the %s', 'wc-vendors' ), wcv_get_vendor_name() ),
86
  'id' => 'wcvendors_vendor_give_taxes',
87
  'default' => 'no',
88
  'type' => 'checkbox',
89
  ),
90
  array(
91
  'title' => sprintf( __( '%s Shipping', 'wc-vendors' ), wcv_get_vendor_name() ),
92
- 'desc' => sprintf( __( 'Give any shipping to the %s', 'wc-vendors' ), wcv_get_vendor_name() ),
93
  'id' => 'wcvendors_vendor_give_shipping',
94
  'default' => 'no',
95
  'type' => 'checkbox',
58
  if ( '' === $current_section ) {
59
 
60
  $settings = apply_filters( 'wcvendors_settings', array(
61
+
62
  // General Options
63
  array(
64
  'title' => __( 'Marketplace Options', 'wc-vendors' ),
68
  ),
69
  array(
70
  'title' => sprintf( __( '%s Registration', 'wc-vendors' ), wcv_get_vendor_name() ),
71
+ 'desc' => sprintf( __( 'Allow users to apply to become a %s', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
72
  'id' => 'wcvendors_vendor_allow_registration',
73
  'default' => 'yes',
74
  'type' => 'checkbox',
75
  ),
76
  array(
77
  'title' => sprintf( __( '%s Approval', 'wc-vendors' ), wcv_get_vendor_name() ),
78
+ 'desc' => sprintf( __( 'Manually approve all %s applications', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
79
  'id' => 'wcvendors_vendor_approve_registration',
80
  'default' => 'no',
81
  'type' => 'checkbox',
82
  ),
83
  array(
84
  'title' => sprintf( __( '%s Taxes', 'wc-vendors' ), wcv_get_vendor_name() ),
85
+ 'desc' => sprintf( __( 'Give any taxes to the %s', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
86
  'id' => 'wcvendors_vendor_give_taxes',
87
  'default' => 'no',
88
  'type' => 'checkbox',
89
  ),
90
  array(
91
  'title' => sprintf( __( '%s Shipping', 'wc-vendors' ), wcv_get_vendor_name() ),
92
+ 'desc' => sprintf( __( 'Give any shipping to the %s', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
93
  'id' => 'wcvendors_vendor_give_shipping',
94
  'default' => 'no',
95
  'type' => 'checkbox',
classes/admin/settings/class-wcv-settings-payments.php CHANGED
@@ -64,7 +64,7 @@ class WCVendors_Settings_Payments extends WCVendors_Settings_Page {
64
  array(
65
  'title' => __( '', 'wc-vendors' ),
66
  'type' => 'title',
67
- 'desc' => sprintf( __( '<h3>PayPal Adaptive Payments - Please Note: PayPal Adaptive Payments has been depreciated by PayPal as of September 2017. These options are for existing users only. This will be completely removed in a future version.</h3>', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
68
  'id' => 'paypal_options',
69
  ),
70
 
@@ -79,7 +79,7 @@ class WCVendors_Settings_Payments extends WCVendors_Settings_Page {
79
  array(
80
  'title' => __( 'Instant Pay', 'wc-vendors' ),
81
  'desc' => __( 'Enable instantpay', 'wc-vendors' ),
82
- 'desc_tip' => sprintf( __( 'Instantly pay %s their commission when an order is made, and if a %s has a valid PayPal email added on their Shop Settings page.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ), lcfirst( wcv_get_vendor_name() ) ),
83
  'id' => 'wcvendors_payments_paypal_instantpay_enable',
84
  'default' => 'no',
85
  'type' => 'checkbox',
@@ -122,7 +122,7 @@ class WCVendors_Settings_Payments extends WCVendors_Settings_Page {
122
  array(
123
  'title' => __( '', 'wc-vendors' ),
124
  'type' => 'title',
125
- 'desc' => sprintf( __( '<strong>Payments controls how your %s commission is paid out. These settings only function if you are using a supported gateway.</strong> ', 'wc-vendors' ), lcfirst( wcv_get_vendor_name() ) ),
126
  'id' => 'payment_general_options',
127
  ),
128
 
64
  array(
65
  'title' => __( '', 'wc-vendors' ),
66
  'type' => 'title',
67
+ 'desc' => sprintf( __( '<h3>PayPal Adaptive Payments - Please Note: PayPal Adaptive Payments has been depreciated by PayPal as of September 2017. These options are for existing users only. This will be completely removed in a future version.</h3>', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
68
  'id' => 'paypal_options',
69
  ),
70
 
79
  array(
80
  'title' => __( 'Instant Pay', 'wc-vendors' ),
81
  'desc' => __( 'Enable instantpay', 'wc-vendors' ),
82
+ 'desc_tip' => sprintf( __( 'Instantly pay %1s their commission when an order is made, and if a %1s has a valid PayPal email added on their Shop Settings page.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
83
  'id' => 'wcvendors_payments_paypal_instantpay_enable',
84
  'default' => 'no',
85
  'type' => 'checkbox',
122
  array(
123
  'title' => __( '', 'wc-vendors' ),
124
  'type' => 'title',
125
+ 'desc' => sprintf( __( '<strong>Payments controls how your %s commission is paid out. These settings only function if you are using a supported gateway.</strong> ', 'wc-vendors' ), wcv_get_vendor_name( true, false ) ),
126
  'id' => 'payment_general_options',
127
  ),
128
 
classes/admin/views/notices/html-notice-update.php CHANGED
@@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
8
  }
9
 
10
  ?>
11
- <div id="message" class="updated wcvendors-message wc-connect">
12
  <p><?php _e( '<strong>WC Vendors Update Required.</strong> &#8211; We need to upgrade your configuration to the latest version.', 'wc-vendors' ); ?></p>
13
  <p class="submit"><a class="wcv-update-now button-primary" href="<?php echo esc_url( add_query_arg( 'do_update_wcvendors', 'true', admin_url( 'admin.php?page=wcv-settings' ) ) ); ?>" class="button-primary"><?php _e( 'Run the update', 'wc-vendors' ); ?></a></p>
14
  </div>
8
  }
9
 
10
  ?>
11
+ <div id="message" class="updated wcvendors-message wc-connect is-dismissible">
12
  <p><?php _e( '<strong>WC Vendors Update Required.</strong> &#8211; We need to upgrade your configuration to the latest version.', 'wc-vendors' ); ?></p>
13
  <p class="submit"><a class="wcv-update-now button-primary" href="<?php echo esc_url( add_query_arg( 'do_update_wcvendors', 'true', admin_url( 'admin.php?page=wcv-settings' ) ) ); ?>" class="button-primary"><?php _e( 'Run the update', 'wc-vendors' ); ?></a></p>
14
  </div>
classes/admin/views/setup/capabilities.php CHANGED
@@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
11
 
12
  <form method="post">
13
  <?php wp_nonce_field( 'wcv-setup' ); ?>
14
- <p class="store-setup"><?php printf( __( 'Enable and disable capabilites of the %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></p>
15
 
16
  <table class="wcv-setup-table">
17
  <thead>
@@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
22
  </thead>
23
  <tbody>
24
  <tr>
25
- <td class="table-desc"><?php printf( __( 'Allow %s to add/edit products', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></td>
26
  <td class="table-check">
27
  <input
28
  type="checkbox"
@@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) {
35
  </td>
36
  </tr>
37
  <tr>
38
- <td class="table-desc"><?php printf( __( 'Allow %s to edit published (live) products', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></td>
39
  <td class="table-check">
40
  <input
41
  type="checkbox"
@@ -48,7 +48,7 @@ if ( ! defined( 'ABSPATH' ) ) {
48
  </td>
49
  </tr>
50
  <tr>
51
- <td class="table-desc"><?php printf( __( 'Allow %s to publish products without requiring approval.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) )?></td>
52
  <td class="table-check">
53
  <input
54
  type="checkbox"
@@ -73,7 +73,7 @@ if ( ! defined( 'ABSPATH' ) ) {
73
  </thead>
74
  <tbody>
75
  <tr>
76
- <td class="table-desc"><?php printf( __( 'Allow %s to view orders', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></td>
77
  <td class="table-check">
78
  <input
79
  type="checkbox"
@@ -86,7 +86,7 @@ if ( ! defined( 'ABSPATH' ) ) {
86
  </td>
87
  </tr>
88
  <tr>
89
- <td class="table-desc"><?php printf( __( 'Allow %s to export their orders to a CSV file', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></td>
90
  <td class="table-check">
91
  <input
92
  type="checkbox"
@@ -99,7 +99,7 @@ if ( ! defined( 'ABSPATH' ) ) {
99
  </td>
100
  </tr>
101
  <tr>
102
- <td class="table-desc"><?php printf( __( 'Allow %s to view order notes', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></td>
103
  <td class="table-check">
104
  <input
105
  type="checkbox"
@@ -112,7 +112,7 @@ if ( ! defined( 'ABSPATH' ) ) {
112
  </td>
113
  </tr>
114
  <tr>
115
- <td class="table-desc"><?php printf( __( 'Allow %s to add order notes.', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></td>
116
  <td class="table-check">
117
  <input
118
  type="checkbox"
11
 
12
  <form method="post">
13
  <?php wp_nonce_field( 'wcv-setup' ); ?>
14
+ <p class="store-setup"><?php printf( __( 'Enable and disable capabilites of the %s', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></p>
15
 
16
  <table class="wcv-setup-table">
17
  <thead>
22
  </thead>
23
  <tbody>
24
  <tr>
25
+ <td class="table-desc"><?php printf( __( 'Allow %s to add/edit products', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></td>
26
  <td class="table-check">
27
  <input
28
  type="checkbox"
35
  </td>
36
  </tr>
37
  <tr>
38
+ <td class="table-desc"><?php printf( __( 'Allow %s to edit published (live) products', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></td>
39
  <td class="table-check">
40
  <input
41
  type="checkbox"
48
  </td>
49
  </tr>
50
  <tr>
51
+ <td class="table-desc"><?php printf( __( 'Allow %s to publish products without requiring approval.', 'wc-vendors' ), wcv_get_vendor_name( false, false ) )?></td>
52
  <td class="table-check">
53
  <input
54
  type="checkbox"
73
  </thead>
74
  <tbody>
75
  <tr>
76
+ <td class="table-desc"><?php printf( __( 'Allow %s to view orders', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></td>
77
  <td class="table-check">
78
  <input
79
  type="checkbox"
86
  </td>
87
  </tr>
88
  <tr>
89
+ <td class="table-desc"><?php printf( __( 'Allow %s to export their orders to a CSV file', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></td>
90
  <td class="table-check">
91
  <input
92
  type="checkbox"
99
  </td>
100
  </tr>
101
  <tr>
102
+ <td class="table-desc"><?php printf( __( 'Allow %s to view order notes', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></td>
103
  <td class="table-check">
104
  <input
105
  type="checkbox"
112
  </td>
113
  </tr>
114
  <tr>
115
+ <td class="table-desc"><?php printf( __( 'Allow %s to add order notes.', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></td>
116
  <td class="table-check">
117
  <input
118
  type="checkbox"
classes/admin/views/setup/general.php CHANGED
@@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
22
  </thead>
23
  <tbody>
24
  <tr>
25
- <td class="table-desc"><?php printf( __( 'Allow users to apply to become a %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></td>
26
  <td class="table-check">
27
  <input
28
  type="checkbox"
@@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) {
35
  </td>
36
  </tr>
37
  <tr>
38
- <td class="table-desc"><?php printf( __( 'Manually approve %s applications', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></td>
39
  <td class="table-check">
40
  <input
41
  type="checkbox"
@@ -48,7 +48,7 @@ if ( ! defined( 'ABSPATH' ) ) {
48
  </td>
49
  </tr>
50
  <tr>
51
- <td class="table-desc"><?php printf( __( 'Give any taxes to %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></td></td>
52
  <td class="table-check">
53
  <input
54
  type="checkbox"
@@ -61,7 +61,7 @@ if ( ! defined( 'ABSPATH' ) ) {
61
  </td>
62
  </tr>
63
  <tr>
64
- <td class="table-desc"><?php printf( __( 'Give any shipping to %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></td></td>
65
  <td class="table-check">
66
  <input
67
  type="checkbox"
22
  </thead>
23
  <tbody>
24
  <tr>
25
+ <td class="table-desc"><?php printf( __( 'Allow users to apply to become a %s', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></td>
26
  <td class="table-check">
27
  <input
28
  type="checkbox"
35
  </td>
36
  </tr>
37
  <tr>
38
+ <td class="table-desc"><?php printf( __( 'Manually approve %s applications', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></td>
39
  <td class="table-check">
40
  <input
41
  type="checkbox"
48
  </td>
49
  </tr>
50
  <tr>
51
+ <td class="table-desc"><?php printf( __( 'Give any taxes to %s', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></td></td>
52
  <td class="table-check">
53
  <input
54
  type="checkbox"
61
  </td>
62
  </tr>
63
  <tr>
64
+ <td class="table-desc"><?php printf( __( 'Give any shipping to %s', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></td></td>
65
  <td class="table-check">
66
  <input
67
  type="checkbox"
classes/admin/views/setup/pages.php CHANGED
@@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
11
 
12
  <form method="post">
13
  <?php wp_nonce_field( 'wcv-setup' ); ?>
14
- <p class="store-setup"><?php printf( __( 'Select the pages for relevant frontend features for %s', 'wc-vendors' ), lcfirst( wcv_get_vendor_name( false ) ) ); ?></p>
15
 
16
  <table class="wcv-setup-table-pages">
17
  <thead>
@@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) {
35
  </td>
36
  </tr>
37
  <tr>
38
- <td class="table-desc"><?php printf( __( '%s Shop Settings', 'wc-vendors' ), ucfirst( wcv_get_vendor_name( false ) ) ); ?></td>
39
  <td class="table-check">
40
  <?php wcv_single_select_page( 'wcvendors_shop_settings_page_id', $shop_settings_page_id, 'wc-enhanced-select' ); ?>
41
  </td>
@@ -57,7 +57,7 @@ if ( ! defined( 'ABSPATH' ) ) {
57
  </td>
58
  </tr>
59
  <tr>
60
- <td class="table-desc"><?php printf( __( '%s List Page', 'wc-vendors' ), ucfirst( wcv_get_vendor_name( false ) ) ); ?></td></td>
61
  <td class="table-check">
62
  <?php wcv_single_select_page( 'wcvendors_vendors_page_id', $vendors_page_id, 'wc-enhanced-select' ); ?>
63
  </td>
@@ -68,14 +68,14 @@ if ( ! defined( 'ABSPATH' ) ) {
68
  </td>
69
  </tr>
70
  <tr>
71
- <td class="table-desc"><?php printf( __( '%s Terms Page', 'wc-vendors' ), ucfirst( wcv_get_vendor_name( true ) ) ); ?></td></td>
72
  <td class="table-check">
73
  <?php wcv_single_select_page( 'wcvendors_vendor_terms_page_id', $terms_page_id, 'wc-enhanced-select' ); ?>
74
  </td>
75
  </tr>
76
  <tr>
77
  <td colspan="3" class="tool-tip">
78
- <?php printf( __( 'This optional page allows you to define terms and conidtions %s need to agree to before applying to your marketplace. ', 'wc-vendors' ), ucfirst( wcv_get_vendor_name( false ) ) ); ?>
79
  </td>
80
  </tr>
81
 
11
 
12
  <form method="post">
13
  <?php wp_nonce_field( 'wcv-setup' ); ?>
14
+ <p class="store-setup"><?php printf( __( 'Select the pages for relevant frontend features for %s', 'wc-vendors' ), wcv_get_vendor_name( false, false ) ); ?></p>
15
 
16
  <table class="wcv-setup-table-pages">
17
  <thead>
35
  </td>
36
  </tr>
37
  <tr>
38
+ <td class="table-desc"><?php printf( __( '%s Shop Settings', 'wc-vendors' ), wcv_get_vendor_name( false ) ); ?></td>
39
  <td class="table-check">
40
  <?php wcv_single_select_page( 'wcvendors_shop_settings_page_id', $shop_settings_page_id, 'wc-enhanced-select' ); ?>
41
  </td>
57
  </td>
58
  </tr>
59
  <tr>
60
+ <td class="table-desc"><?php printf( __( '%s List Page', 'wc-vendors' ), wcv_get_vendor_name( false ) ); ?></td></td>
61
  <td class="table-check">
62
  <?php wcv_single_select_page( 'wcvendors_vendors_page_id', $vendors_page_id, 'wc-enhanced-select' ); ?>
63
  </td>
68
  </td>
69
  </tr>
70
  <tr>
71
+ <td class="table-desc"><?php printf( __( '%s Terms Page', 'wc-vendors' ), wcv_get_vendor_name() ); ?></td></td>
72
  <td class="table-check">
73
  <?php wcv_single_select_page( 'wcvendors_vendor_terms_page_id', $terms_page_id, 'wc-enhanced-select' ); ?>
74
  </td>
75
  </tr>
76
  <tr>
77
  <td colspan="3" class="tool-tip">
78
+ <?php printf( __( 'This optional page allows you to define terms and conidtions %s need to agree to before applying to your marketplace. ', 'wc-vendors' ), wcv_get_vendor_name( false ) ); ?>
79
  </td>
80
  </tr>
81
 
classes/class-commission.php CHANGED
@@ -570,4 +570,51 @@ class WCV_Commission
570
 
571
  }
572
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
573
  }
570
 
571
  }
572
 
573
+ /*
574
+ * Get the summed total for each vendor based on the status
575
+ * @since 2.0.3
576
+ * @access public
577
+ */
578
+ public static function get_sum_vendor_totals(){
579
+
580
+ global $wpdb;
581
+
582
+ $due = array();
583
+ $paid = array();
584
+ $reversed = array();
585
+
586
+ $table_name = $wpdb->prefix . "pv_commission";
587
+ $query = "SELECT `id`, `total_due`, `total_shipping`, `tax`, `vendor_id`, `status`
588
+ FROM `{$table_name}`";
589
+
590
+ $results = $wpdb->get_results( $query );
591
+
592
+ foreach ( $results as $commission ) {
593
+
594
+ switch ( $commission->status ) {
595
+ case 'due':
596
+ $due[ $commission->vendor_id ] = !empty( $due[ $commission->vendor_id ] ) ? ( $due[ $commission->vendor_id ] + ( $commission->total_due + $commission->total_shipping + $commission->tax ) ) : ( $commission->total_due + $commission->total_shipping + $commission->tax );
597
+ break;
598
+ case 'paid':
599
+ $paid[ $commission->vendor_id ] = !empty( $paid[ $commission->vendor_id ] ) ? ( $paid[ $commission->vendor_id ] + ( $commission->total_due + $commission->total_shipping + $commission->tax ) ) : ( $commission->total_due + $commission->total_shipping + $commission->tax );
600
+ break;
601
+ case 'reversed':
602
+ $reversed[ $commission->vendor_id ] = !empty( $reversed[ $commission->vendor_id ] ) ? ( $reversed[ $commission->vendor_id ] + ( $commission->total_due + $commission->total_shipping + $commission->tax ) ) : ( $commission->total_due + $commission->total_shipping + $commission->tax );
603
+ break;
604
+ default:
605
+ # code...
606
+ break;
607
+ }
608
+ }
609
+
610
+ $sum_totals = array(
611
+ 'due' => $due,
612
+ 'paid' => $paid,
613
+ 'reversed' => $reversed
614
+ );
615
+
616
+ return $sum_totals;
617
+
618
+ }
619
+
620
  }
classes/class-install.php CHANGED
@@ -15,6 +15,9 @@ class WCVendors_Install {
15
  'wcv_migrate_settings',
16
  'wcv_update_200_db_version',
17
  'wcv_enable_legacy_emails'
 
 
 
18
  )
19
  );
20
 
@@ -422,6 +425,7 @@ class WCVendors_Install {
422
  'docs' => '<a href="' . esc_url( apply_filters( 'wcvendors_docs_url', 'https://docs.wc-vendors.com/' ) ) . '" aria-label="' . esc_attr__( 'View WC Vendors documentation', 'wc-vendors' ) . '">' . esc_html__( 'Docs', 'wc-vendors' ) . '</a>',
423
  'free-support' => '<a href="' . esc_url( apply_filters( 'wcvendors_free_support_url', 'https://wordpress.org/plugins/wc-vendors' ) ) . '" aria-label="' . esc_attr__( 'Visit community forums', 'wc-vendors' ) . '">' . esc_html__( 'Free support', 'wc-vendors' ) . '</a>',
424
  'support' => '<a href="' . esc_url( apply_filters( 'wcvendors_support_url', 'https://wc-vendors.com/support/' ) ) . '" aria-label="' . esc_attr__( 'Visit premium customer support', 'wc-vendors' ) . '">' . esc_html__( 'Premium support', 'wc-vendors' ) . '</a>',
 
425
  );
426
 
427
  return array_merge( $links, $row_meta );
15
  'wcv_migrate_settings',
16
  'wcv_update_200_db_version',
17
  'wcv_enable_legacy_emails'
18
+ ),
19
+ '2.0.3' => array(
20
+ 'wcv_update_203_db_version',
21
  )
22
  );
23
 
425
  'docs' => '<a href="' . esc_url( apply_filters( 'wcvendors_docs_url', 'https://docs.wc-vendors.com/' ) ) . '" aria-label="' . esc_attr__( 'View WC Vendors documentation', 'wc-vendors' ) . '">' . esc_html__( 'Docs', 'wc-vendors' ) . '</a>',
426
  'free-support' => '<a href="' . esc_url( apply_filters( 'wcvendors_free_support_url', 'https://wordpress.org/plugins/wc-vendors' ) ) . '" aria-label="' . esc_attr__( 'Visit community forums', 'wc-vendors' ) . '">' . esc_html__( 'Free support', 'wc-vendors' ) . '</a>',
427
  'support' => '<a href="' . esc_url( apply_filters( 'wcvendors_support_url', 'https://wc-vendors.com/support/' ) ) . '" aria-label="' . esc_attr__( 'Visit premium customer support', 'wc-vendors' ) . '">' . esc_html__( 'Premium support', 'wc-vendors' ) . '</a>',
428
+ 'pro' => '<strong><a href="https://www.wcvendors.com/product/wc-vendors-pro/?utm_source=plugin&utm_campaign=upgrade_promo" target="_blank">'.__( 'Upgrade to Pro', 'wcvendors').'</a></strong>',
429
  );
430
 
431
  return array_merge( $links, $row_meta );
classes/class-vendor-post-types.php CHANGED
@@ -31,7 +31,7 @@ class WCV_Post_types {
31
  'shop_order_vendor',
32
  apply_filters( 'woocommerce_register_post_type_shop_order_vendor',
33
  array(
34
- 'label' => __( 'Vendor Orders', 'wc-vendors' ),
35
  'capability_type' => 'shop_order',
36
  'public' => false,
37
  'hierarchical' => false,
31
  'shop_order_vendor',
32
  apply_filters( 'woocommerce_register_post_type_shop_order_vendor',
33
  array(
34
+ 'label' => sprintf( __( '%s Orders', 'wc-vendors' ), wcv_get_vendor_name() ),
35
  'capability_type' => 'shop_order',
36
  'public' => false,
37
  'hierarchical' => false,
classes/class-vendors.php CHANGED
@@ -566,7 +566,7 @@ class WCV_Vendors
566
  $vendor_order_data['post_author'] = get_current_user_id();
567
  $vendor_order_data['post_password'] = uniqid( 'vendor_' ); // password = 20 char max! (uniqid = 13)
568
  $vendor_order_data['post_parent'] = absint( $args['order_id'] );
569
- $vendor_order_data['post_title'] = sprintf( __( 'Vendor Order &ndash; %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Order date parsed by strftime', 'woocommerce' ) ) );
570
  $vendor_order_data['post_date'] = $args['date'];
571
  }
572
 
566
  $vendor_order_data['post_author'] = get_current_user_id();
567
  $vendor_order_data['post_password'] = uniqid( 'vendor_' ); // password = 20 char max! (uniqid = 13)
568
  $vendor_order_data['post_parent'] = absint( $args['order_id'] );
569
+ $vendor_order_data['post_title'] = sprintf( __( '%s Order &ndash; %s', 'wc-vendors' ), wcv_get_vendor_name(), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Order date parsed by strftime', 'wc-vendors' ) ) );
570
  $vendor_order_data['post_date'] = $args['date'];
571
  }
572
 
classes/front/orders/class-orders.php CHANGED
@@ -52,7 +52,7 @@ class WCV_Orders
52
 
53
  if ( empty( $_GET[ 'orders_for_product' ] ) ) {
54
 
55
- return __( 'You haven\'t selected a product\'s orders to view! Please go back to the Vendor Dashboard and click Show Orders on the product you\'d like to view.', 'wc-vendors' );
56
 
57
  } else {
58
  $this->product_id = !empty( $_GET[ 'orders_for_product' ] ) ? (int) $_GET[ 'orders_for_product' ] : false;
@@ -118,7 +118,7 @@ class WCV_Orders
118
 
119
  if ( empty( $_GET[ 'orders_for_product' ] ) ) {
120
 
121
- return __( 'You haven\'t selected a product\'s orders to view! Please go back to the Vendor Dashboard and click Show Orders on the product you\'d like to view.', 'wc-vendors' );
122
 
123
  } else {
124
  $this->product_id = !empty( $_GET[ 'orders_for_product' ] ) ? (int) $_GET[ 'orders_for_product' ] : false;
52
 
53
  if ( empty( $_GET[ 'orders_for_product' ] ) ) {
54
 
55
+ return sprintf( __( 'You haven\'t selected a product\'s orders to view! Please go back to the %s Dashboard and click Show Orders on the product you\'d like to view.', 'wc-vendors' ), wcv_get_vendor_name() );
56
 
57
  } else {
58
  $this->product_id = !empty( $_GET[ 'orders_for_product' ] ) ? (int) $_GET[ 'orders_for_product' ] : false;
118
 
119
  if ( empty( $_GET[ 'orders_for_product' ] ) ) {
120
 
121
+ return sprintf( __( 'You haven\'t selected a product\'s orders to view! Please go back to the %s Dashboard and click Show Orders on the product you\'d like to view.', 'wc-vendors' ), wcv_get_vendor_name() );
122
 
123
  } else {
124
  $this->product_id = !empty( $_GET[ 'orders_for_product' ] ) ? (int) $_GET[ 'orders_for_product' ] : false;
classes/includes/class-functions.php CHANGED
@@ -30,12 +30,21 @@ if (!function_exists('wcv_get_user_role')) {
30
  /**
31
  * This function gets the vendor name used throughout the interface on the front and backend
32
  */
33
- function wcv_get_vendor_name( $singluar = true ){
34
- if ( $singluar ){
35
- return apply_filters( 'wcv_vendor_display_name_singluar', __( 'Vendor', 'wc-vendors' ) );
36
- } else {
37
- return apply_filters( 'wcv_vendor_display_name_plural', __( 'Vendors', 'wc-vendors' ) );
38
- }
 
 
 
 
 
 
 
 
 
39
  }
40
 
41
  // Output a single select page drop down
30
  /**
31
  * This function gets the vendor name used throughout the interface on the front and backend
32
  */
33
+ function wcv_get_vendor_name( $singluar = true, $upper_case = true ){
34
+
35
+ $vendor_singular = get_option( 'wcvendors_vendor_singular', __( 'Vendor', 'wc-vendors' ) );
36
+ $vendor_plural = get_option( 'wcvendors_vendor_plural', __( 'Vendors', 'wc-vendors' ) );
37
+
38
+ $vendor_label = $singluar ? $vendor_singular : $vendor_plural;
39
+ $vendor_label = $upper_case ? ucfirst( $vendor_label ) : lcfirst( $vendor_label );
40
+
41
+ return apply_filters( 'wcv_vendor_display_name', $vendor_label, $vendor_singular, $vendor_plural, $singluar, $upper_case );
42
+
43
+ // if ( $singluar ){
44
+ // return apply_filters( 'wcv_vendor_display_name_singluar', $vendor_singular );
45
+ // } else {
46
+ // return apply_filters( 'wcv_vendor_display_name_plural', $vendor_plural );
47
+ // }
48
  }
49
 
50
  // Output a single select page drop down
classes/includes/wcv-update-functions.php CHANGED
@@ -113,3 +113,13 @@ function wcv_enable_legacy_emails(){
113
  function wcv_update_200_db_version(){
114
  WCVendors_Install::update_db_version( '2.0.0' );
115
  }
 
 
 
 
 
 
 
 
 
 
113
  function wcv_update_200_db_version(){
114
  WCVendors_Install::update_db_version( '2.0.0' );
115
  }
116
+
117
+
118
+ /**
119
+ * Finish Settings update
120
+ *
121
+ * @since 2.0.3
122
+ */
123
+ function wcv_update_203_db_version(){
124
+ WCVendors_Install::update_db_version( '2.0.3' );
125
+ }
languages/wc-vendors.pot CHANGED
@@ -16,35 +16,35 @@ msgstr ""
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
- #: class-wc-vendors.php:53
20
  msgid "WC Vendors requires WooCommerce to run. Please install WooCommerce and activate before attempting to activate again."
21
  msgstr ""
22
 
23
- #: class-wc-vendors.php:101, classes/admin/class-admin-menus.php:45, classes/admin/class-admin-menus.php:45, classes/admin/class-admin-reports.php:41, classes/admin/class-wcv-admin-setup.php:235, classes/admin/views/html-vendor-meta.php:1
24
  msgid "WC Vendors"
25
  msgstr ""
26
 
27
- #: class-wc-vendors.php:136
28
  msgid "<b>WC Vendors is inactive</b>. WC Vendors requires a minimum of WooCommerce 3.0.0 to operate."
29
  msgstr ""
30
 
31
- #: class-wc-vendors.php:396
32
  msgid "WC Vendors 2.0 is a major update. This is not compatible with any of our existing extensions. You should test this update on a staging server before updating. Backup your site and update your theme and extensions, and <a href=\"%s\">review update details here</a> before upgrading."
33
  msgstr ""
34
 
35
- #: class-wc-vendors.php:409
36
  msgid "WC Vendors Pro 1.5.0 is required to run WC Vendors 2.0.0. Your current version %s will be deactivated. Please upgrade to the latest version."
37
  msgstr ""
38
 
39
- #: classes/class-commission.php:55, classes/admin/class-admin-reports.php:348, classes/admin/class-admin-reports.php:441, classes/admin/class-wcv-commissions-page.php:277, classes/admin/class-wcv-commissions-page.php:543
40
  msgid "Due"
41
  msgstr ""
42
 
43
- #: classes/class-commission.php:56, classes/admin/class-admin-reports.php:347, classes/admin/class-admin-reports.php:442, classes/admin/class-wcv-commissions-page.php:278, classes/admin/class-wcv-commissions-page.php:544
44
  msgid "Paid"
45
  msgstr ""
46
 
47
- #: classes/class-commission.php:57, classes/admin/class-admin-reports.php:346, classes/admin/class-admin-reports.php:443, classes/admin/class-wcv-commissions-page.php:279, classes/admin/class-wcv-commissions-page.php:545
48
  msgid "Reversed"
49
  msgstr ""
50
 
@@ -52,88 +52,97 @@ msgstr ""
52
  msgid "Payment total: %s"
53
  msgstr ""
54
 
55
- #: classes/class-install.php:139, classes/admin/class-wcv-admin-setup.php:142
56
  msgid "Pending Vendor"
57
  msgstr ""
58
 
59
- #: classes/class-install.php:146, classes/admin/class-admin-reports.php:173, classes/admin/class-admin-reports.php:456, classes/admin/class-product-meta.php:46, classes/admin/class-product-meta.php:187, classes/admin/class-product-meta.php:223, classes/admin/class-wcv-admin-setup.php:139, classes/admin/class-wcv-admin-setup.php:270, classes/admin/class-wcv-commissions-csv-exporter.php:43, classes/admin/class-wcv-commissions-page.php:118, classes/includes/class-functions.php:35
60
  msgid "Vendor"
61
  msgstr ""
62
 
63
- #: classes/class-install.php:193
64
  msgctxt "Page slug"
65
  msgid "vendor_dashboard"
66
  msgstr ""
67
 
68
- #: classes/class-install.php:195
69
  msgctxt "Page title"
70
  msgid "%s Dashboard"
71
  msgstr ""
72
 
73
- #: classes/class-install.php:201
74
  msgctxt "Page slug"
75
  msgid "vendors"
76
  msgstr ""
77
 
78
- #: classes/class-install.php:203
79
  msgctxt "Page title"
80
  msgid "%s"
81
  msgstr ""
82
 
83
- #: classes/class-install.php:211
84
  msgctxt "Page slug"
85
  msgid "shop_settings"
86
  msgstr ""
87
 
88
- #: classes/class-install.php:212
89
  msgctxt "Page title"
90
  msgid "Shop Settings"
91
  msgstr ""
92
 
93
- #: classes/class-install.php:217
94
  msgctxt "Page slug"
95
  msgid "product_orders"
96
  msgstr ""
97
 
98
- #: classes/class-install.php:218
99
  msgctxt "Page title"
100
  msgid "Orders"
101
  msgstr ""
102
 
103
- #: classes/class-install.php:401
104
  msgid "View WC Vendors settings"
105
  msgstr ""
106
 
107
- #: classes/class-install.php:401, templates/dashboard/settings/settings.php:1
108
  msgid "Settings"
109
  msgstr ""
110
 
111
- #: classes/class-install.php:418
112
  msgid "View WC Vendors documentation"
113
  msgstr ""
114
 
115
- #: classes/class-install.php:418
116
  msgid "Docs"
117
  msgstr ""
118
 
119
- #: classes/class-install.php:419
120
  msgid "Visit community forums"
121
  msgstr ""
122
 
123
- #: classes/class-install.php:419
124
  msgid "Free support"
125
  msgstr ""
126
 
127
- #: classes/class-install.php:420
128
  msgid "Visit premium customer support"
129
  msgstr ""
130
 
131
- #: classes/class-install.php:420
132
  msgid "Premium support"
133
  msgstr ""
134
 
135
  #: classes/class-vendor-post-types.php:34
136
- msgid "Vendor Orders"
 
 
 
 
 
 
 
 
 
137
  msgstr ""
138
 
139
  #: classes/admin/class-admin-menus.php:52
@@ -168,15 +177,15 @@ msgstr ""
168
  msgid "Commission totals for all vendors includes shipping and taxes. By default no date range is used and all due commissions are returned. Use the date range to filter."
169
  msgstr ""
170
 
171
- #: classes/admin/class-admin-reports.php:119, classes/admin/class-admin-reports.php:435, templates/dashboard/date-picker.php:3
172
  msgid "From:"
173
  msgstr ""
174
 
175
- #: classes/admin/class-admin-reports.php:121, classes/admin/class-admin-reports.php:437, templates/dashboard/date-picker.php:7
176
  msgid "To:"
177
  msgstr ""
178
 
179
- #: classes/admin/class-admin-reports.php:123, classes/admin/class-admin-reports.php:281, classes/admin/class-admin-reports.php:446, templates/dashboard/date-picker.php:12
180
  msgid "Show"
181
  msgstr ""
182
 
@@ -200,15 +209,15 @@ msgstr ""
200
  msgid "Recent Commission"
201
  msgstr ""
202
 
203
- #: classes/admin/class-admin-reports.php:171, templates/dashboard/orders.php:44, classes/front/orders/class-orders.php:204
204
  msgid "Order"
205
  msgstr ""
206
 
207
- #: classes/admin/class-admin-reports.php:172, classes/admin/class-wcv-commissions-csv-exporter.php:41, classes/admin/class-wcv-commissions-page.php:116, templates/dashboard/reports.php:17, templates/emails/notify-vendor-shipped.php:27, templates/emails/vendor-new-order.php:31, templates/emails/vendor-order-details.php:36, classes/admin/emails/class-wcv-vendor-notify-order.php:187
208
  msgid "Product"
209
  msgstr ""
210
 
211
- #: classes/admin/class-admin-reports.php:174, classes/admin/class-admin-reports.php:372, classes/admin/class-vendor-admin-dashboard.php:351, classes/admin/class-wcv-commissions-csv-exporter.php:47, classes/admin/class-wcv-commissions-page.php:122, templates/dashboard/orders.php:46
212
  msgid "Total"
213
  msgstr ""
214
 
@@ -225,7 +234,7 @@ msgid "N/A"
225
  msgstr ""
226
 
227
  #: classes/admin/class-admin-reports.php:189
228
- msgid "D j M Y \a h:ia"
229
  msgstr ""
230
 
231
  #: classes/admin/class-admin-reports.php:198
@@ -252,7 +261,7 @@ msgstr ""
252
  msgid "Tax"
253
  msgstr ""
254
 
255
- #: classes/admin/class-admin-reports.php:345, classes/admin/class-wcv-commissions-csv-exporter.php:45, classes/admin/class-wcv-commissions-page.php:120, templates/dashboard/orders.php:45, templates/orders/orders.php:113, classes/admin/settings/class-wcv-settings-capabilities.php:107
256
  msgid "Shipping"
257
  msgstr ""
258
 
@@ -272,7 +281,11 @@ msgstr ""
272
  msgid "No commissions found."
273
  msgstr ""
274
 
275
- #: classes/admin/class-product-meta.php:151, classes/admin/class-product-meta.php:167, classes/admin/class-wcv-commissions-csv-exporter.php:44, classes/admin/class-wcv-commissions-page.php:119, templates/dashboard/reports.php:19, templates/emails/vendor-order-details.php:39, classes/admin/emails/class-wcv-vendor-notify-order.php:186, classes/admin/settings/class-wcv-settings-commission.php:31, classes/admin/views/html-admin-commission-page.php:23, classes/admin/views/setup/general.php:79
 
 
 
 
276
  msgid "Commission"
277
  msgstr ""
278
 
@@ -288,7 +301,7 @@ msgstr ""
288
  msgid "Capabilities"
289
  msgstr ""
290
 
291
- #: classes/admin/class-setup-wizard.php:79, classes/admin/settings/class-wcv-settings-display.php:138, classes/admin/views/setup/pages.php:19
292
  msgid "Pages"
293
  msgstr ""
294
 
@@ -296,15 +309,16 @@ msgstr ""
296
  msgid "Ready!"
297
  msgstr ""
298
 
 
299
  #: classes/admin/class-setup-wizard.php:339
300
  msgid "Don't forget to check our <a href=\"%1$s\" target=\"_blank\">documentation</a> to learn more about setting up WC Vendors and if you need help, be sure to visit our <a href=\"%2$s\" target=\"_blank\">free support forums</a>."
301
  msgstr ""
302
 
303
- #: classes/admin/class-vendor-admin-dashboard.php:22, classes/admin/class-vendor-admin-dashboard.php:22, classes/admin/settings/class-wcv-settings-display.php:153
304
  msgid "Shop Settings"
305
  msgstr ""
306
 
307
- #: classes/admin/class-vendor-admin-dashboard.php:23, classes/admin/class-vendor-admin-dashboard.php:23, classes/admin/class-vendor-admin-dashboard.php:209, templates/dashboard/orders.php:35, classes/admin/settings/class-wcv-settings-capabilities.php:45, classes/admin/settings/class-wcv-settings-capabilities.php:271, classes/admin/settings/class-wcv-settings-display.php:162, classes/admin/views/setup/capabilities.php:70
308
  msgid "Orders"
309
  msgstr ""
310
 
@@ -340,15 +354,15 @@ msgstr ""
340
  msgid "Products"
341
  msgstr ""
342
 
343
- #: classes/admin/class-vendor-admin-dashboard.php:353, classes/admin/class-wcv-commissions-csv-exporter.php:49, classes/admin/class-wcv-commissions-page.php:124, templates/dashboard/orders.php:47, classes/front/orders/class-orders.php:212
344
  msgid "Date"
345
  msgstr ""
346
 
347
- #: classes/admin/class-vendor-admin-dashboard.php:354, templates/dashboard/orders.php:106
348
  msgid "Shipped"
349
  msgstr ""
350
 
351
- #: classes/admin/class-vendor-admin-dashboard.php:390, templates/dashboard/orders.php:99
352
  msgid "Mark shipped"
353
  msgstr ""
354
 
@@ -365,7 +379,7 @@ msgid "No"
365
  msgstr ""
366
 
367
  #: classes/admin/class-vendor-applicants.php:74
368
- msgid "Vendor has been <b>denied</b>."
369
  msgstr ""
370
 
371
  #: classes/admin/class-vendor-applicants.php:85
@@ -384,10 +398,12 @@ msgstr ""
384
  msgid "Welcome to WC Vendors Help &amp; Support"
385
  msgstr ""
386
 
 
387
  #: classes/admin/class-wcv-admin-help.php:53
388
  msgid "Should you need any help with using or extending WC Vendors, <a href=\"%s\">please read our documentation</a>. You will find all kinds of resources including code snippets, guides and much more."
389
  msgstr ""
390
 
 
391
  #: classes/admin/class-wcv-admin-help.php:58
392
  msgid "Do you have a question about WC Vendors? For assistance please see our <a href=\"%1$s\">community forum</a>. If you need help with premium extensions sold by WC Vendors, please <a href=\"%2$s\">submit a ticket</a>."
393
  msgstr ""
@@ -424,6 +440,7 @@ msgstr ""
424
  msgid "Found a bug?"
425
  msgstr ""
426
 
 
427
  #: classes/admin/class-wcv-admin-help.php:81
428
  msgid "If you think you have found a bug in WC Vendors you can create a ticket via <a href=\"%1$s\">Github issues</a>. To help us solve your issue, please be as descriptive as possible and include your <a href=\"%2$s\">system status report</a>."
429
  msgstr ""
@@ -492,7 +509,7 @@ msgstr ""
492
  msgid "The changes you made will be lost if you navigate away from this page."
493
  msgstr ""
494
 
495
- #: classes/admin/class-wcv-admin-settings.php:432, classes/includes/class-functions.php:55
496
  msgid "Select a page&hellip;"
497
  msgstr ""
498
 
@@ -528,51 +545,52 @@ msgstr ""
528
  msgid "Upload an image for the %s"
529
  msgstr ""
530
 
531
- #: classes/admin/class-wcv-admin-setup.php:42
532
  msgid "Vendors shipped"
533
  msgstr ""
534
 
535
- #: classes/admin/class-wcv-admin-setup.php:67
536
  msgid "Vendors Shipped"
537
  msgstr ""
538
 
539
- #: classes/admin/class-wcv-admin-setup.php:93
540
  msgid "Reset WC Vendors roles "
541
  msgstr ""
542
 
543
- #: classes/admin/class-wcv-admin-setup.php:94
544
  msgid "Reset WC Vendor Roles"
545
  msgstr ""
546
 
547
- #: classes/admin/class-wcv-admin-setup.php:95
548
  msgid "This will reset the wcvendors roles ( vendor & pending_vendor ), back to the default capabilities."
549
  msgstr ""
550
 
551
- #: classes/admin/class-wcv-admin-setup.php:100
552
  msgid "Reset WC Vendors "
553
  msgstr ""
554
 
555
- #: classes/admin/class-wcv-admin-setup.php:101
556
  msgid "Reset WC Vendors Settings"
557
  msgstr ""
558
 
559
- #: classes/admin/class-wcv-admin-setup.php:102
560
  msgid "This will reset wcvendors back to defaults. This DELETES ALL YOUR Settings."
561
  msgstr ""
562
 
563
- #: classes/admin/class-wcv-admin-setup.php:148
564
  msgid "WC Vendor roles successfully reset."
565
  msgstr ""
566
 
567
- #: classes/admin/class-wcv-admin-setup.php:162
568
  msgid "WC Vendors was successfully reset. All settings have been reset."
569
  msgstr ""
570
 
571
- #: classes/admin/class-wcv-admin-setup.php:234
 
572
  msgid "If you like %1$s please leave us a %2$s rating. A huge thanks in advance!"
573
  msgstr ""
574
 
575
- #: classes/admin/class-wcv-admin-setup.php:236
576
  msgid "Thanks :)"
577
  msgstr ""
578
 
@@ -596,31 +614,43 @@ msgstr ""
596
  msgid "Clear"
597
  msgstr ""
598
 
599
- #: classes/admin/class-wcv-commissions-page.php:241
 
 
 
 
 
 
 
 
600
  msgid "Show all dates"
601
  msgstr ""
602
 
603
- #: classes/admin/class-wcv-commissions-page.php:276
604
  msgid "Show all Statuses"
605
  msgstr ""
606
 
607
- #: classes/admin/class-wcv-commissions-page.php:332
608
  msgid "Commission marked paid."
609
  msgstr ""
610
 
611
- #: classes/admin/class-wcv-commissions-page.php:339
612
  msgid "Commission marked due."
613
  msgstr ""
614
 
615
- #: classes/admin/class-wcv-commissions-page.php:346
616
  msgid "Commission marked reversed."
617
  msgstr ""
618
 
619
- #: classes/admin/class-wcv-commissions-page.php:542
620
  msgid "All"
621
  msgstr ""
622
 
623
- #: classes/includes/class-functions.php:37
 
 
 
 
624
  msgid "Vendors"
625
  msgstr ""
626
 
@@ -652,87 +682,87 @@ msgstr ""
652
  msgid "WC Vendors legacy emails are enabled. Please migrate your email templates to the new system. <a href=\"%s\">Click here to view your email settings.</a>"
653
  msgstr ""
654
 
655
- #: templates/dashboard/denied.php:5
656
  msgid "Your account has not yet been approved to become a vendor. When it is, you will receive an email telling you that your account is approved!"
657
  msgstr ""
658
 
659
- #: templates/dashboard/denied.php:9
660
  msgid "Your account is not setup as a vendor."
661
  msgstr ""
662
 
663
- #: templates/dashboard/denied.php:19, classes/front/signup/views/html-vendor-signup.php:22
664
  msgid "Apply to become a vendor? "
665
  msgstr ""
666
 
667
- #: templates/dashboard/denied.php:30
668
  msgid "I have read and accepted the <a href=\"%s\">terms and conditions</a>"
669
  msgstr ""
670
 
671
- #: templates/dashboard/denied.php:50
672
  msgid "Submit"
673
  msgstr ""
674
 
675
- #: templates/dashboard/links.php:3
676
  msgid "View Your Store"
677
  msgstr ""
678
 
679
- #: templates/dashboard/links.php:4, classes/admin/settings/class-wcv-settings-display.php:193
680
  msgid "Store Settings"
681
  msgstr ""
682
 
683
- #: templates/dashboard/links.php:7
684
  msgid "Add New Product"
685
  msgstr ""
686
 
687
- #: templates/dashboard/links.php:8
688
  msgid "Edit Products"
689
  msgstr ""
690
 
691
- #: templates/dashboard/orders.php:18, templates/dashboard/orders.php:21
692
  msgid "Hide items"
693
  msgstr ""
694
 
695
- #: templates/dashboard/orders.php:19, templates/dashboard/orders.php:93
696
  msgid "View items"
697
  msgstr ""
698
 
699
- #: templates/dashboard/orders.php:48
700
  msgid "Links"
701
  msgstr ""
702
 
703
- #: templates/dashboard/orders.php:114
704
  msgid "Tracking"
705
  msgstr ""
706
 
707
- #: templates/dashboard/orders.php:188
708
  msgid "You have no orders during this period."
709
  msgstr ""
710
 
711
- #: templates/dashboard/reports.php:1
712
  msgid "Sales Report"
713
  msgstr ""
714
 
715
- #: templates/dashboard/reports.php:18, templates/emails/notify-vendor-shipped.php:28, templates/emails/vendor-new-order.php:32, templates/emails/vendor-order-details.php:37, classes/front/orders/class-export-csv.php:19
716
  msgid "Quantity"
717
  msgstr ""
718
 
719
- #: templates/dashboard/reports.php:20
720
  msgid "Rate"
721
  msgstr ""
722
 
723
- #: templates/dashboard/reports.php:47
724
  msgid "Show Orders"
725
  msgstr ""
726
 
727
- #: templates/dashboard/reports.php:56
728
  msgid "Totals"
729
  msgstr ""
730
 
731
- #: templates/dashboard/reports.php:71
732
  msgid "You have no sales during this period."
733
  msgstr ""
734
 
735
- #: templates/dashboard/reports.php:82
736
  msgid "You haven't made any sales yet."
737
  msgstr ""
738
 
@@ -808,6 +838,10 @@ msgstr ""
808
  msgid "Your application is currently: %s"
809
  msgstr ""
810
 
 
 
 
 
811
  #. translators: %s: Order ID.
812
  #: templates/emails/vendor-order-details.php:28
813
  msgid "Order #%s"
@@ -821,11 +855,11 @@ msgstr ""
821
  msgid "Product image"
822
  msgstr ""
823
 
824
- #: templates/orders/csv-export.php:6
825
  msgid "Export orders"
826
  msgstr ""
827
 
828
- #: templates/orders/orders.php:82
829
  msgid "Comments (%s)"
830
  msgstr ""
831
 
@@ -873,7 +907,7 @@ msgstr ""
873
  msgid "Enable this email notification"
874
  msgstr ""
875
 
876
- #: classes/admin/emails/class-wc-approve-vendor.php:131
877
  msgid "Enter recipients (comma separated) for this email. Defaults to <code>%s</code>."
878
  msgstr ""
879
 
@@ -986,7 +1020,7 @@ msgid "Show the commission due/paid as the product totals instead of the product
986
  msgstr ""
987
 
988
  #: classes/admin/emails/class-wcv-admin-notify-application.php:27
989
- msgid "Admin notify vendor application"
990
  msgstr ""
991
 
992
  #: classes/admin/emails/class-wcv-admin-notify-application.php:28
@@ -997,7 +1031,7 @@ msgstr ""
997
  msgid "[{site_title}] {user_name} has applied to be a %s"
998
  msgstr ""
999
 
1000
- #: classes/admin/emails/class-wcv-admin-notify-application.php:61
1001
  msgid "%s application received"
1002
  msgstr ""
1003
 
@@ -1009,6 +1043,23 @@ msgstr ""
1009
  msgid "Enter recipients (comma separated) for this email. Defaults to %s."
1010
  msgstr ""
1011
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1012
  #: classes/admin/emails/class-wcv-admin-notify-application.php:145, classes/admin/emails/class-wcv-admin-notify-application.php:154, classes/admin/emails/class-wcv-admin-notify-product.php:164, classes/admin/emails/class-wcv-admin-notify-product.php:173, classes/admin/emails/class-wcv-admin-notify-shipped.php:153, classes/admin/emails/class-wcv-admin-notify-shipped.php:162, classes/admin/emails/class-wcv-customer-notify-shipped.php:152, classes/admin/emails/class-wcv-customer-notify-shipped.php:161, classes/admin/emails/class-wcv-vendor-notify-application.php:139, classes/admin/emails/class-wcv-vendor-notify-application.php:148, classes/admin/emails/class-wcv-vendor-notify-approved.php:148, classes/admin/emails/class-wcv-vendor-notify-approved.php:166, classes/admin/emails/class-wcv-vendor-notify-denied.php:158, classes/admin/emails/class-wcv-vendor-notify-denied.php:167, classes/admin/emails/class-wcv-vendor-notify-denied.php:184, classes/admin/emails/class-wcv-vendor-notify-order.php:165, classes/admin/emails/class-wcv-vendor-notify-order.php:174
1013
  msgid "Available placeholders: %s"
1014
  msgstr ""
@@ -1074,19 +1125,15 @@ msgid "Email is sent to the customer when a %s marks an order received/paid by a
1074
  msgstr ""
1075
 
1076
  #: classes/admin/emails/class-wcv-vendor-notify-application.php:27
1077
- msgid "Vendor notify application"
1078
  msgstr ""
1079
 
1080
  #: classes/admin/emails/class-wcv-vendor-notify-application.php:28
1081
- msgid "Notification is sent to the vendor that their application has been received"
1082
  msgstr ""
1083
 
1084
  #: classes/admin/emails/class-wcv-vendor-notify-application.php:48
1085
- msgid "[{site_title}] Your vendor application has been received"
1086
- msgstr ""
1087
-
1088
- #: classes/admin/emails/class-wcv-vendor-notify-application.php:58
1089
- msgid "Vendor application received"
1090
  msgstr ""
1091
 
1092
  #: classes/admin/emails/class-wcv-vendor-notify-application.php:62
@@ -1198,7 +1245,7 @@ msgid "Add / Edit Product"
1198
  msgstr ""
1199
 
1200
  #: classes/admin/settings/class-wcv-settings-capabilities.php:65
1201
- msgid "Configure what product information to hide from a %s when creating or editing a product"
1202
  msgstr ""
1203
 
1204
  #: classes/admin/settings/class-wcv-settings-capabilities.php:70
@@ -1206,7 +1253,7 @@ msgid "Product Types"
1206
  msgstr ""
1207
 
1208
  #: classes/admin/settings/class-wcv-settings-capabilities.php:71
1209
- msgid "This controls what product types a %s can create"
1210
  msgstr ""
1211
 
1212
  #: classes/admin/settings/class-wcv-settings-capabilities.php:82
@@ -1214,7 +1261,7 @@ msgid "Product Type Options"
1214
  msgstr ""
1215
 
1216
  #: classes/admin/settings/class-wcv-settings-capabilities.php:83
1217
- msgid "This controls what product type options a %s can use"
1218
  msgstr ""
1219
 
1220
  #: classes/admin/settings/class-wcv-settings-capabilities.php:90
@@ -1230,7 +1277,7 @@ msgid "Product Data Tabs"
1230
  msgstr ""
1231
 
1232
  #: classes/admin/settings/class-wcv-settings-capabilities.php:98
1233
- msgid "This controls what product data tabs a %s can use"
1234
  msgstr ""
1235
 
1236
  #: classes/admin/settings/class-wcv-settings-capabilities.php:106
@@ -1433,10 +1480,10 @@ msgid "Product Page Stylesheet"
1433
  msgstr ""
1434
 
1435
  #: classes/admin/settings/class-wcv-settings-display.php:71
1436
- msgid "You can add CSS in this textarea, which will be loaded on the product add/edit page for vendors"
1437
  msgstr ""
1438
 
1439
- #: classes/admin/settings/class-wcv-settings-display.php:72, classes/admin/settings/class-wcv-settings-display.php:98
1440
  msgid "This enables the sold by labels used to show which %s shop the product belongs to"
1441
  msgstr ""
1442
 
@@ -1445,138 +1492,154 @@ msgid "Labels are shown on the front end, in orders or emails."
1445
  msgstr ""
1446
 
1447
  #: classes/admin/settings/class-wcv-settings-display.php:96
1448
- msgid "Sold by"
1449
  msgstr ""
1450
 
1451
  #: classes/admin/settings/class-wcv-settings-display.php:97
1452
- msgid "Enable sold by labels"
 
 
 
 
1453
  msgstr ""
1454
 
1455
  #: classes/admin/settings/class-wcv-settings-display.php:105
 
 
 
 
 
 
 
 
 
 
 
 
1456
  msgid "Sold by label"
1457
  msgstr ""
1458
 
1459
- #: classes/admin/settings/class-wcv-settings-display.php:106
1460
  msgid "The sold by label"
1461
  msgstr ""
1462
 
1463
- #: classes/admin/settings/class-wcv-settings-display.php:109
1464
  msgid "Sold By"
1465
  msgstr ""
1466
 
1467
- #: classes/admin/settings/class-wcv-settings-display.php:113
1468
  msgid "%s Store Info"
1469
  msgstr ""
1470
 
1471
- #: classes/admin/settings/class-wcv-settings-display.php:114
1472
  msgid "Enable %s store info tab on the single product page"
1473
  msgstr ""
1474
 
1475
- #: classes/admin/settings/class-wcv-settings-display.php:121
1476
  msgid "%s store Info label"
1477
  msgstr ""
1478
 
1479
- #: classes/admin/settings/class-wcv-settings-display.php:122
1480
  msgid "The %s store info label"
1481
  msgstr ""
1482
 
1483
- #: classes/admin/settings/class-wcv-settings-display.php:125
1484
  msgid "Store Info"
1485
  msgstr ""
1486
 
1487
- #: classes/admin/settings/class-wcv-settings-display.php:140
1488
  msgid "These pages used on the front end by %s."
1489
  msgstr ""
1490
 
1491
- #: classes/admin/settings/class-wcv-settings-display.php:144
1492
  msgid "Dashboard"
1493
  msgstr ""
1494
 
1495
- #: classes/admin/settings/class-wcv-settings-display.php:150
1496
  msgid "<br />This sets the page used to display the front end %s dashboard. This page should contain the following shortcode. <code>[wcv_vendor_dashboard]</code>"
1497
  msgstr ""
1498
 
1499
- #: classes/admin/settings/class-wcv-settings-display.php:159
1500
  msgid "<br />This sets the page used to display the %s shop settings page. This page should contain the following shortcode. <code>[wcv_shop_settings]</code>"
1501
  msgstr ""
1502
 
1503
- #: classes/admin/settings/class-wcv-settings-display.php:168
1504
  msgid "<br />This sets the page used to display the %s orders page. This page should contain the following shortcode. <code>[wcv_orders]</code>"
1505
  msgstr ""
1506
 
1507
- #: classes/admin/settings/class-wcv-settings-display.php:171
1508
  msgid "%s"
1509
  msgstr ""
1510
 
1511
- #: classes/admin/settings/class-wcv-settings-display.php:177
1512
  msgid "<br />This sets the page used to display a paginated list of all %1$s stores. Your %1$s stores will be available at <code>%2$s/page-slug/store-name/</code><br />This page should contain the following shortcode. <code>[wcv_vendorslist]</code>"
1513
  msgstr ""
1514
 
1515
- #: classes/admin/settings/class-wcv-settings-display.php:180
1516
  msgid "Terms and Conditions"
1517
  msgstr ""
1518
 
1519
- #: classes/admin/settings/class-wcv-settings-display.php:186
1520
  msgid "<br />This sets the page used to display the terms and conditions when a %s signs up."
1521
  msgstr ""
1522
 
1523
- #: classes/admin/settings/class-wcv-settings-display.php:195
1524
- msgid "These are the settings for the individual vendor stores."
1525
  msgstr ""
1526
 
1527
- #: classes/admin/settings/class-wcv-settings-display.php:200
1528
  msgid "%s Store URL"
1529
  msgstr ""
1530
 
1531
- #: classes/admin/settings/class-wcv-settings-display.php:201
1532
- msgid "If you enter \"vendors\" your %s store will be %s/vendors/store-name/"
1533
  msgstr ""
1534
 
1535
- #: classes/admin/settings/class-wcv-settings-display.php:208
1536
  msgid "Shop Header"
1537
  msgstr ""
1538
 
1539
- #: classes/admin/settings/class-wcv-settings-display.php:209
1540
  msgid "Enable %s shop headers"
1541
  msgstr ""
1542
 
1543
- #: classes/admin/settings/class-wcv-settings-display.php:210
1544
  msgid "This enables the %s shop header template and disables the shop description text."
1545
  msgstr ""
1546
 
1547
- #: classes/admin/settings/class-wcv-settings-display.php:217
1548
  msgid "Shop HTML"
1549
  msgstr ""
1550
 
1551
- #: classes/admin/settings/class-wcv-settings-display.php:218
1552
  msgid "Allow HTML in %s shop desription"
1553
  msgstr ""
1554
 
1555
- #: classes/admin/settings/class-wcv-settings-display.php:219
1556
- msgid "Enable HTML for a %s shop description. You can enable or disable this per vendor by editing the vendors user account."
1557
  msgstr ""
1558
 
1559
- #: classes/admin/settings/class-wcv-settings-display.php:226
1560
  msgid "Display Name"
1561
  msgstr ""
1562
 
1563
- #: classes/admin/settings/class-wcv-settings-display.php:228
1564
  msgid "Select what will be used to display the %s name throughout the marketplace."
1565
  msgstr ""
1566
 
1567
- #: classes/admin/settings/class-wcv-settings-display.php:233
1568
  msgid "Display name"
1569
  msgstr ""
1570
 
1571
- #: classes/admin/settings/class-wcv-settings-display.php:234, classes/admin/views/html-vendor-meta.php:26
1572
  msgid "Shop name"
1573
  msgstr ""
1574
 
1575
- #: classes/admin/settings/class-wcv-settings-display.php:235
1576
  msgid "%s Username"
1577
  msgstr ""
1578
 
1579
- #: classes/admin/settings/class-wcv-settings-display.php:236
1580
  msgid "%s Email"
1581
  msgstr ""
1582
 
@@ -1645,7 +1708,7 @@ msgid "Enable instantpay"
1645
  msgstr ""
1646
 
1647
  #: classes/admin/settings/class-wcv-settings-payments.php:82
1648
- msgid "Instantly pay %s their commission when an order is made, and if a %s has a valid PayPal email added on their Shop Settings page."
1649
  msgstr ""
1650
 
1651
  #: classes/admin/settings/class-wcv-settings-payments.php:89
@@ -1836,15 +1899,15 @@ msgstr ""
1836
  msgid "Bank Account Number"
1837
  msgstr ""
1838
 
1839
- #: classes/admin/views/html-vendor-meta.php:60, classes/admin/views/html-vendor-settings-page.php:36, templates/dashboard/settings/settings.php:27
1840
  msgid "Bank Name"
1841
  msgstr ""
1842
 
1843
- #: classes/admin/views/html-vendor-meta.php:65, classes/admin/views/html-vendor-settings-page.php:41, templates/dashboard/settings/settings.php:30
1844
  msgid "Routing Number"
1845
  msgstr ""
1846
 
1847
- #: classes/admin/views/html-vendor-meta.php:70, classes/admin/views/html-vendor-settings-page.php:46, templates/dashboard/settings/settings.php:31
1848
  msgid "IBAN"
1849
  msgstr ""
1850
 
@@ -1872,7 +1935,7 @@ msgstr ""
1872
  msgid "Shipping override for vendor"
1873
  msgstr ""
1874
 
1875
- #: classes/admin/views/html-vendor-meta.php:133, classes/admin/views/html-vendor-settings-page.php:69, templates/dashboard/settings/seller-info.php:3
1876
  msgid "Seller info"
1877
  msgstr ""
1878
 
@@ -1880,7 +1943,7 @@ msgstr ""
1880
  msgid "Shop description"
1881
  msgstr ""
1882
 
1883
- #: classes/admin/views/html-vendor-settings-page.php:11, templates/dashboard/settings/paypal-email-form.php:2
1884
  msgid "PayPal Address"
1885
  msgstr ""
1886
 
@@ -1888,23 +1951,23 @@ msgstr ""
1888
  msgid "Your PayPal address can be used to send you your commission."
1889
  msgstr ""
1890
 
1891
- #: classes/admin/views/html-vendor-settings-page.php:61, templates/dashboard/settings/shop-name.php:2
1892
  msgid "Shop Name"
1893
  msgstr ""
1894
 
1895
- #: classes/admin/views/html-vendor-settings-page.php:63, templates/dashboard/settings/shop-name.php:3
1896
  msgid "Your shop name is public and must be unique."
1897
  msgstr ""
1898
 
1899
- #: classes/admin/views/html-vendor-settings-page.php:82, templates/dashboard/settings/seller-info.php:4
1900
  msgid "This is displayed on each of your products."
1901
  msgstr ""
1902
 
1903
- #: classes/admin/views/html-vendor-settings-page.php:88, templates/dashboard/settings/shop-description.php:2
1904
  msgid "Shop Description"
1905
  msgstr ""
1906
 
1907
- #: classes/admin/views/html-vendor-settings-page.php:100, templates/dashboard/settings/shop-description.php:3
1908
  msgid "This is displayed on your <a href=\"%s\">shop page</a>."
1909
  msgstr ""
1910
 
@@ -1933,7 +1996,7 @@ msgid "Item Meta"
1933
  msgstr ""
1934
 
1935
  #: classes/front/orders/class-orders.php:55, classes/front/orders/class-orders.php:121
1936
- msgid "You haven't selected a product's orders to view! Please go back to the Vendor Dashboard and click Show Orders on the product you'd like to view."
1937
  msgstr ""
1938
 
1939
  #: classes/front/orders/class-orders.php:78, classes/front/orders/class-orders.php:144
@@ -2180,27 +2243,27 @@ msgstr ""
2180
  msgid "Test gateway transation complete. Order processing."
2181
  msgstr ""
2182
 
2183
- #: templates/dashboard/settings/paypal-email-form.php:3
2184
  msgid "Your PayPal address can be used to manually send you your commission."
2185
  msgstr ""
2186
 
2187
- #: templates/dashboard/settings/settings.php:22
2188
  msgid "Bank Details"
2189
  msgstr ""
2190
 
2191
- #: templates/dashboard/settings/settings.php:25
2192
  msgid "Account Name"
2193
  msgstr ""
2194
 
2195
- #: templates/dashboard/settings/settings.php:26
2196
  msgid "Account Number"
2197
  msgstr ""
2198
 
2199
- #: templates/dashboard/settings/settings.php:32
2200
  msgid "BIC / Swift"
2201
  msgstr ""
2202
 
2203
- #: templates/dashboard/settings/settings.php:69
2204
  msgid "Save"
2205
  msgstr ""
2206
 
@@ -2213,27 +2276,27 @@ msgstr ""
2213
  msgid "Order number: %s"
2214
  msgstr ""
2215
 
2216
- #: templates/orders/comments/add-new-comment.php:11
2217
  msgid "Add comment"
2218
  msgstr ""
2219
 
2220
- #: templates/orders/comments/existing-comments.php:9
2221
  msgid "added %s ago"
2222
  msgstr ""
2223
 
2224
- #: templates/orders/customer-note/customer-note.php:4
2225
  msgid "Customer note"
2226
  msgstr ""
2227
 
2228
- #: templates/orders/customer-note/customer-note.php:8
2229
  msgid "No customer note."
2230
  msgstr ""
2231
 
2232
- #: templates/orders/shipping/shipping-form.php:75
2233
  msgid "Update tracking number"
2234
  msgstr ""
2235
 
2236
- #: templates/orders/shipping/shipping-form.php:77
2237
  msgid "Mark as shipped"
2238
  msgstr ""
2239
 
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
+ #: class-wc-vendors.php:52
20
  msgid "WC Vendors requires WooCommerce to run. Please install WooCommerce and activate before attempting to activate again."
21
  msgstr ""
22
 
23
+ #: class-wc-vendors.php:100, classes/admin/class-admin-menus.php:45, classes/admin/class-admin-menus.php:45, classes/admin/class-admin-reports.php:41, classes/admin/class-wcv-admin-setup.php:264, classes/admin/views/html-vendor-meta.php:1
24
  msgid "WC Vendors"
25
  msgstr ""
26
 
27
+ #: class-wc-vendors.php:137
28
  msgid "<b>WC Vendors is inactive</b>. WC Vendors requires a minimum of WooCommerce 3.0.0 to operate."
29
  msgstr ""
30
 
31
+ #: class-wc-vendors.php:397
32
  msgid "WC Vendors 2.0 is a major update. This is not compatible with any of our existing extensions. You should test this update on a staging server before updating. Backup your site and update your theme and extensions, and <a href=\"%s\">review update details here</a> before upgrading."
33
  msgstr ""
34
 
35
+ #: class-wc-vendors.php:410
36
  msgid "WC Vendors Pro 1.5.0 is required to run WC Vendors 2.0.0. Your current version %s will be deactivated. Please upgrade to the latest version."
37
  msgstr ""
38
 
39
+ #: classes/class-commission.php:55, classes/admin/class-admin-reports.php:348, classes/admin/class-admin-reports.php:441, classes/admin/class-wcv-commissions-page.php:278, classes/admin/class-wcv-commissions-page.php:544
40
  msgid "Due"
41
  msgstr ""
42
 
43
+ #: classes/class-commission.php:56, classes/admin/class-admin-reports.php:347, classes/admin/class-admin-reports.php:442, classes/admin/class-wcv-commissions-page.php:279, classes/admin/class-wcv-commissions-page.php:545
44
  msgid "Paid"
45
  msgstr ""
46
 
47
+ #: classes/class-commission.php:57, classes/admin/class-admin-reports.php:346, classes/admin/class-admin-reports.php:443, classes/admin/class-wcv-commissions-page.php:280, classes/admin/class-wcv-commissions-page.php:546
48
  msgid "Reversed"
49
  msgstr ""
50
 
52
  msgid "Payment total: %s"
53
  msgstr ""
54
 
55
+ #: classes/class-install.php:143, classes/admin/class-wcv-admin-setup.php:143
56
  msgid "Pending Vendor"
57
  msgstr ""
58
 
59
+ #: classes/class-install.php:150, classes/admin/class-admin-reports.php:173, classes/admin/class-admin-reports.php:456, classes/admin/class-product-meta.php:223, classes/admin/class-wcv-admin-setup.php:140, classes/admin/class-wcv-admin-setup.php:299, classes/admin/class-wcv-commissions-csv-exporter.php:43, classes/admin/class-wcv-commissions-page.php:118, classes/admin/class-wcv-commissions-sum-csv-exporter.php:41, classes/includes/class-functions.php:35, classes/admin/settings/class-wcv-settings-display.php:100
60
  msgid "Vendor"
61
  msgstr ""
62
 
63
+ #: classes/class-install.php:198
64
  msgctxt "Page slug"
65
  msgid "vendor_dashboard"
66
  msgstr ""
67
 
68
+ #: classes/class-install.php:200
69
  msgctxt "Page title"
70
  msgid "%s Dashboard"
71
  msgstr ""
72
 
73
+ #: classes/class-install.php:206
74
  msgctxt "Page slug"
75
  msgid "vendors"
76
  msgstr ""
77
 
78
+ #: classes/class-install.php:208
79
  msgctxt "Page title"
80
  msgid "%s"
81
  msgstr ""
82
 
83
+ #: classes/class-install.php:216
84
  msgctxt "Page slug"
85
  msgid "shop_settings"
86
  msgstr ""
87
 
88
+ #: classes/class-install.php:217
89
  msgctxt "Page title"
90
  msgid "Shop Settings"
91
  msgstr ""
92
 
93
+ #: classes/class-install.php:222
94
  msgctxt "Page slug"
95
  msgid "product_orders"
96
  msgstr ""
97
 
98
+ #: classes/class-install.php:223
99
  msgctxt "Page title"
100
  msgid "Orders"
101
  msgstr ""
102
 
103
+ #: classes/class-install.php:408
104
  msgid "View WC Vendors settings"
105
  msgstr ""
106
 
107
+ #: classes/class-install.php:408, templates/dashboard/settings/settings.php:18
108
  msgid "Settings"
109
  msgstr ""
110
 
111
+ #: classes/class-install.php:425
112
  msgid "View WC Vendors documentation"
113
  msgstr ""
114
 
115
+ #: classes/class-install.php:425
116
  msgid "Docs"
117
  msgstr ""
118
 
119
+ #: classes/class-install.php:426
120
  msgid "Visit community forums"
121
  msgstr ""
122
 
123
+ #: classes/class-install.php:426
124
  msgid "Free support"
125
  msgstr ""
126
 
127
+ #: classes/class-install.php:427
128
  msgid "Visit premium customer support"
129
  msgstr ""
130
 
131
+ #: classes/class-install.php:427
132
  msgid "Premium support"
133
  msgstr ""
134
 
135
  #: classes/class-vendor-post-types.php:34
136
+ msgid "%s Orders"
137
+ msgstr ""
138
+
139
+ #: classes/class-vendors.php:569
140
+ msgid "%s Order &ndash; %s"
141
+ msgstr ""
142
+
143
+ #: classes/class-vendors.php:569
144
+ msgctxt "Order date parsed by strftime"
145
+ msgid "%b %d, %Y @ %I:%M %p"
146
  msgstr ""
147
 
148
  #: classes/admin/class-admin-menus.php:52
177
  msgid "Commission totals for all vendors includes shipping and taxes. By default no date range is used and all due commissions are returned. Use the date range to filter."
178
  msgstr ""
179
 
180
+ #: classes/admin/class-admin-reports.php:119, classes/admin/class-admin-reports.php:435, templates/dashboard/date-picker.php:20
181
  msgid "From:"
182
  msgstr ""
183
 
184
+ #: classes/admin/class-admin-reports.php:121, classes/admin/class-admin-reports.php:437, templates/dashboard/date-picker.php:24
185
  msgid "To:"
186
  msgstr ""
187
 
188
+ #: classes/admin/class-admin-reports.php:123, classes/admin/class-admin-reports.php:281, classes/admin/class-admin-reports.php:446, templates/dashboard/date-picker.php:29
189
  msgid "Show"
190
  msgstr ""
191
 
209
  msgid "Recent Commission"
210
  msgstr ""
211
 
212
+ #: classes/admin/class-admin-reports.php:171, templates/dashboard/orders.php:50, classes/front/orders/class-orders.php:204
213
  msgid "Order"
214
  msgstr ""
215
 
216
+ #: classes/admin/class-admin-reports.php:172, classes/admin/class-wcv-commissions-csv-exporter.php:41, classes/admin/class-wcv-commissions-page.php:116, templates/dashboard/reports.php:35, templates/emails/notify-vendor-shipped.php:27, templates/emails/vendor-new-order.php:31, templates/emails/vendor-order-details.php:36, classes/admin/emails/class-wcv-vendor-notify-order.php:187
217
  msgid "Product"
218
  msgstr ""
219
 
220
+ #: classes/admin/class-admin-reports.php:174, classes/admin/class-admin-reports.php:372, classes/admin/class-vendor-admin-dashboard.php:351, classes/admin/class-wcv-commissions-csv-exporter.php:47, classes/admin/class-wcv-commissions-page.php:122, classes/admin/class-wcv-commissions-sum-csv-exporter.php:42, templates/dashboard/orders.php:52
221
  msgid "Total"
222
  msgstr ""
223
 
234
  msgstr ""
235
 
236
  #: classes/admin/class-admin-reports.php:189
237
+ msgid "D j M Y \a\t h:ia"
238
  msgstr ""
239
 
240
  #: classes/admin/class-admin-reports.php:198
261
  msgid "Tax"
262
  msgstr ""
263
 
264
+ #: classes/admin/class-admin-reports.php:345, classes/admin/class-wcv-commissions-csv-exporter.php:45, classes/admin/class-wcv-commissions-page.php:120, templates/dashboard/orders.php:51, templates/orders/orders.php:129, classes/admin/settings/class-wcv-settings-capabilities.php:107
265
  msgid "Shipping"
266
  msgstr ""
267
 
281
  msgid "No commissions found."
282
  msgstr ""
283
 
284
+ #: classes/admin/class-admin-users.php:73
285
+ msgid "You are not allowed to submit products. <a href=\"%s\">Go Back</a>"
286
+ msgstr ""
287
+
288
+ #: classes/admin/class-product-meta.php:151, classes/admin/class-product-meta.php:167, classes/admin/class-wcv-commissions-csv-exporter.php:44, classes/admin/class-wcv-commissions-page.php:119, templates/dashboard/reports.php:37, templates/emails/vendor-order-details.php:39, classes/admin/emails/class-wcv-vendor-notify-order.php:186, classes/admin/settings/class-wcv-settings-commission.php:31, classes/admin/views/html-admin-commission-page.php:23, classes/admin/views/setup/general.php:79
289
  msgid "Commission"
290
  msgstr ""
291
 
301
  msgid "Capabilities"
302
  msgstr ""
303
 
304
+ #: classes/admin/class-setup-wizard.php:79, classes/admin/settings/class-wcv-settings-display.php:154, classes/admin/views/setup/pages.php:19
305
  msgid "Pages"
306
  msgstr ""
307
 
309
  msgid "Ready!"
310
  msgstr ""
311
 
312
+ #. translators: %1$s: link to videos, %2$s: link to docs
313
  #: classes/admin/class-setup-wizard.php:339
314
  msgid "Don't forget to check our <a href=\"%1$s\" target=\"_blank\">documentation</a> to learn more about setting up WC Vendors and if you need help, be sure to visit our <a href=\"%2$s\" target=\"_blank\">free support forums</a>."
315
  msgstr ""
316
 
317
+ #: classes/admin/class-vendor-admin-dashboard.php:22, classes/admin/class-vendor-admin-dashboard.php:22, classes/admin/settings/class-wcv-settings-display.php:169
318
  msgid "Shop Settings"
319
  msgstr ""
320
 
321
+ #: classes/admin/class-vendor-admin-dashboard.php:23, classes/admin/class-vendor-admin-dashboard.php:23, classes/admin/class-vendor-admin-dashboard.php:209, templates/dashboard/orders.php:41, classes/admin/settings/class-wcv-settings-capabilities.php:45, classes/admin/settings/class-wcv-settings-capabilities.php:271, classes/admin/settings/class-wcv-settings-display.php:178, classes/admin/views/setup/capabilities.php:70
322
  msgid "Orders"
323
  msgstr ""
324
 
354
  msgid "Products"
355
  msgstr ""
356
 
357
+ #: classes/admin/class-vendor-admin-dashboard.php:353, classes/admin/class-wcv-commissions-csv-exporter.php:49, classes/admin/class-wcv-commissions-page.php:124, templates/dashboard/orders.php:53, classes/front/orders/class-orders.php:212
358
  msgid "Date"
359
  msgstr ""
360
 
361
+ #: classes/admin/class-vendor-admin-dashboard.php:354, templates/dashboard/orders.php:112
362
  msgid "Shipped"
363
  msgstr ""
364
 
365
+ #: classes/admin/class-vendor-admin-dashboard.php:390, templates/dashboard/orders.php:105
366
  msgid "Mark shipped"
367
  msgstr ""
368
 
379
  msgstr ""
380
 
381
  #: classes/admin/class-vendor-applicants.php:74
382
+ msgid "%s has been <b>denied</b>."
383
  msgstr ""
384
 
385
  #: classes/admin/class-vendor-applicants.php:85
398
  msgid "Welcome to WC Vendors Help &amp; Support"
399
  msgstr ""
400
 
401
+ #. translators: %s: Documentation URL
402
  #: classes/admin/class-wcv-admin-help.php:53
403
  msgid "Should you need any help with using or extending WC Vendors, <a href=\"%s\">please read our documentation</a>. You will find all kinds of resources including code snippets, guides and much more."
404
  msgstr ""
405
 
406
+ #. translators: %s: Forum URL
407
  #: classes/admin/class-wcv-admin-help.php:58
408
  msgid "Do you have a question about WC Vendors? For assistance please see our <a href=\"%1$s\">community forum</a>. If you need help with premium extensions sold by WC Vendors, please <a href=\"%2$s\">submit a ticket</a>."
409
  msgstr ""
440
  msgid "Found a bug?"
441
  msgstr ""
442
 
443
+ #. translators: 1: GitHub issues URL 2: System status report URL
444
  #: classes/admin/class-wcv-admin-help.php:81
445
  msgid "If you think you have found a bug in WC Vendors you can create a ticket via <a href=\"%1$s\">Github issues</a>. To help us solve your issue, please be as descriptive as possible and include your <a href=\"%2$s\">system status report</a>."
446
  msgstr ""
509
  msgid "The changes you made will be lost if you navigate away from this page."
510
  msgstr ""
511
 
512
+ #: classes/admin/class-wcv-admin-settings.php:432, classes/includes/class-functions.php:64
513
  msgid "Select a page&hellip;"
514
  msgstr ""
515
 
545
  msgid "Upload an image for the %s"
546
  msgstr ""
547
 
548
+ #: classes/admin/class-wcv-admin-setup.php:43
549
  msgid "Vendors shipped"
550
  msgstr ""
551
 
552
+ #: classes/admin/class-wcv-admin-setup.php:68
553
  msgid "Vendors Shipped"
554
  msgstr ""
555
 
556
+ #: classes/admin/class-wcv-admin-setup.php:94
557
  msgid "Reset WC Vendors roles "
558
  msgstr ""
559
 
560
+ #: classes/admin/class-wcv-admin-setup.php:95
561
  msgid "Reset WC Vendor Roles"
562
  msgstr ""
563
 
564
+ #: classes/admin/class-wcv-admin-setup.php:96
565
  msgid "This will reset the wcvendors roles ( vendor & pending_vendor ), back to the default capabilities."
566
  msgstr ""
567
 
568
+ #: classes/admin/class-wcv-admin-setup.php:101
569
  msgid "Reset WC Vendors "
570
  msgstr ""
571
 
572
+ #: classes/admin/class-wcv-admin-setup.php:102
573
  msgid "Reset WC Vendors Settings"
574
  msgstr ""
575
 
576
+ #: classes/admin/class-wcv-admin-setup.php:103
577
  msgid "This will reset wcvendors back to defaults. This DELETES ALL YOUR Settings."
578
  msgstr ""
579
 
580
+ #: classes/admin/class-wcv-admin-setup.php:149
581
  msgid "WC Vendor roles successfully reset."
582
  msgstr ""
583
 
584
+ #: classes/admin/class-wcv-admin-setup.php:163
585
  msgid "WC Vendors was successfully reset. All settings have been reset."
586
  msgstr ""
587
 
588
+ #. translators: 1: WooCommerce 2:: five stars
589
+ #: classes/admin/class-wcv-admin-setup.php:263
590
  msgid "If you like %1$s please leave us a %2$s rating. A huge thanks in advance!"
591
  msgstr ""
592
 
593
+ #: classes/admin/class-wcv-admin-setup.php:265
594
  msgid "Thanks :)"
595
  msgstr ""
596
 
614
  msgid "Clear"
615
  msgstr ""
616
 
617
+ #: classes/admin/class-wcv-commissions-page.php:206
618
+ msgid "Export to CSV"
619
+ msgstr ""
620
+
621
+ #: classes/admin/class-wcv-commissions-page.php:207
622
+ msgid "Export Totals to CSV"
623
+ msgstr ""
624
+
625
+ #: classes/admin/class-wcv-commissions-page.php:242
626
  msgid "Show all dates"
627
  msgstr ""
628
 
629
+ #: classes/admin/class-wcv-commissions-page.php:277
630
  msgid "Show all Statuses"
631
  msgstr ""
632
 
633
+ #: classes/admin/class-wcv-commissions-page.php:333
634
  msgid "Commission marked paid."
635
  msgstr ""
636
 
637
+ #: classes/admin/class-wcv-commissions-page.php:340
638
  msgid "Commission marked due."
639
  msgstr ""
640
 
641
+ #: classes/admin/class-wcv-commissions-page.php:347
642
  msgid "Commission marked reversed."
643
  msgstr ""
644
 
645
+ #: classes/admin/class-wcv-commissions-page.php:543
646
  msgid "All"
647
  msgstr ""
648
 
649
+ #: classes/admin/class-wcv-commissions-sum-csv-exporter.php:43
650
+ msgid "Commission Status"
651
+ msgstr ""
652
+
653
+ #: classes/includes/class-functions.php:36, classes/admin/settings/class-wcv-settings-display.php:108
654
  msgid "Vendors"
655
  msgstr ""
656
 
682
  msgid "WC Vendors legacy emails are enabled. Please migrate your email templates to the new system. <a href=\"%s\">Click here to view your email settings.</a>"
683
  msgstr ""
684
 
685
+ #: templates/dashboard/denied.php:22
686
  msgid "Your account has not yet been approved to become a vendor. When it is, you will receive an email telling you that your account is approved!"
687
  msgstr ""
688
 
689
+ #: templates/dashboard/denied.php:26
690
  msgid "Your account is not setup as a vendor."
691
  msgstr ""
692
 
693
+ #: templates/dashboard/denied.php:36, classes/front/signup/views/html-vendor-signup.php:22
694
  msgid "Apply to become a vendor? "
695
  msgstr ""
696
 
697
+ #: templates/dashboard/denied.php:47
698
  msgid "I have read and accepted the <a href=\"%s\">terms and conditions</a>"
699
  msgstr ""
700
 
701
+ #: templates/dashboard/denied.php:67
702
  msgid "Submit"
703
  msgstr ""
704
 
705
+ #: templates/dashboard/links.php:22
706
  msgid "View Your Store"
707
  msgstr ""
708
 
709
+ #: templates/dashboard/links.php:23, classes/admin/settings/class-wcv-settings-display.php:209
710
  msgid "Store Settings"
711
  msgstr ""
712
 
713
+ #: templates/dashboard/links.php:26
714
  msgid "Add New Product"
715
  msgstr ""
716
 
717
+ #: templates/dashboard/links.php:27
718
  msgid "Edit Products"
719
  msgstr ""
720
 
721
+ #: templates/dashboard/orders.php:24, templates/dashboard/orders.php:27
722
  msgid "Hide items"
723
  msgstr ""
724
 
725
+ #: templates/dashboard/orders.php:25, templates/dashboard/orders.php:99
726
  msgid "View items"
727
  msgstr ""
728
 
729
+ #: templates/dashboard/orders.php:54
730
  msgid "Links"
731
  msgstr ""
732
 
733
+ #: templates/dashboard/orders.php:120
734
  msgid "Tracking"
735
  msgstr ""
736
 
737
+ #: templates/dashboard/orders.php:194
738
  msgid "You have no orders during this period."
739
  msgstr ""
740
 
741
+ #: templates/dashboard/reports.php:19
742
  msgid "Sales Report"
743
  msgstr ""
744
 
745
+ #: templates/dashboard/reports.php:36, templates/emails/notify-vendor-shipped.php:28, templates/emails/vendor-new-order.php:32, templates/emails/vendor-order-details.php:37, classes/front/orders/class-export-csv.php:19
746
  msgid "Quantity"
747
  msgstr ""
748
 
749
+ #: templates/dashboard/reports.php:38
750
  msgid "Rate"
751
  msgstr ""
752
 
753
+ #: templates/dashboard/reports.php:65
754
  msgid "Show Orders"
755
  msgstr ""
756
 
757
+ #: templates/dashboard/reports.php:74
758
  msgid "Totals"
759
  msgstr ""
760
 
761
+ #: templates/dashboard/reports.php:89
762
  msgid "You have no sales during this period."
763
  msgstr ""
764
 
765
+ #: templates/dashboard/reports.php:100
766
  msgid "You haven't made any sales yet."
767
  msgstr ""
768
 
838
  msgid "Your application is currently: %s"
839
  msgstr ""
840
 
841
+ #: templates/emails/vendor-notify-order.php:22
842
+ msgid "You have received an order from %s. The order is as follows:"
843
+ msgstr ""
844
+
845
  #. translators: %s: Order ID.
846
  #: templates/emails/vendor-order-details.php:28
847
  msgid "Order #%s"
855
  msgid "Product image"
856
  msgstr ""
857
 
858
+ #: templates/orders/csv-export.php:22
859
  msgid "Export orders"
860
  msgstr ""
861
 
862
+ #: templates/orders/orders.php:98
863
  msgid "Comments (%s)"
864
  msgstr ""
865
 
907
  msgid "Enable this email notification"
908
  msgstr ""
909
 
910
+ #: classes/admin/emails/class-wc-approve-vendor.php:131, classes/admin/emails/class-wc-notify-admin.php:142
911
  msgid "Enter recipients (comma separated) for this email. Defaults to <code>%s</code>."
912
  msgstr ""
913
 
1020
  msgstr ""
1021
 
1022
  #: classes/admin/emails/class-wcv-admin-notify-application.php:27
1023
+ msgid "Admin notify %s application"
1024
  msgstr ""
1025
 
1026
  #: classes/admin/emails/class-wcv-admin-notify-application.php:28
1031
  msgid "[{site_title}] {user_name} has applied to be a %s"
1032
  msgstr ""
1033
 
1034
+ #: classes/admin/emails/class-wcv-admin-notify-application.php:61, classes/admin/emails/class-wcv-vendor-notify-application.php:58
1035
  msgid "%s application received"
1036
  msgstr ""
1037
 
1043
  msgid "Enter recipients (comma separated) for this email. Defaults to %s."
1044
  msgstr ""
1045
 
1046
+ #. translators: %s: list of placeholders
1047
+ #. translators: %s: list of placeholders
1048
+ #. translators: %s: list of placeholders
1049
+ #. translators: %s: list of placeholders
1050
+ #. translators: %s: list of placeholders
1051
+ #. translators: %s: list of placeholders
1052
+ #. translators: %s: list of placeholders
1053
+ #. translators: %s: list of placeholders
1054
+ #. translators: %s: list of placeholders
1055
+ #. translators: %s: list of placeholders
1056
+ #. translators: %s: list of placeholders
1057
+ #. translators: %s: list of placeholders
1058
+ #. translators: %s: list of placeholders
1059
+ #. translators: %s: list of placeholders
1060
+ #. translators: %s: list of placeholders
1061
+ #. translators: %s: list of placeholders
1062
+ #. translators: %s: list of placeholders
1063
  #: classes/admin/emails/class-wcv-admin-notify-application.php:145, classes/admin/emails/class-wcv-admin-notify-application.php:154, classes/admin/emails/class-wcv-admin-notify-product.php:164, classes/admin/emails/class-wcv-admin-notify-product.php:173, classes/admin/emails/class-wcv-admin-notify-shipped.php:153, classes/admin/emails/class-wcv-admin-notify-shipped.php:162, classes/admin/emails/class-wcv-customer-notify-shipped.php:152, classes/admin/emails/class-wcv-customer-notify-shipped.php:161, classes/admin/emails/class-wcv-vendor-notify-application.php:139, classes/admin/emails/class-wcv-vendor-notify-application.php:148, classes/admin/emails/class-wcv-vendor-notify-approved.php:148, classes/admin/emails/class-wcv-vendor-notify-approved.php:166, classes/admin/emails/class-wcv-vendor-notify-denied.php:158, classes/admin/emails/class-wcv-vendor-notify-denied.php:167, classes/admin/emails/class-wcv-vendor-notify-denied.php:184, classes/admin/emails/class-wcv-vendor-notify-order.php:165, classes/admin/emails/class-wcv-vendor-notify-order.php:174
1064
  msgid "Available placeholders: %s"
1065
  msgstr ""
1125
  msgstr ""
1126
 
1127
  #: classes/admin/emails/class-wcv-vendor-notify-application.php:27
1128
+ msgid "%s notify application"
1129
  msgstr ""
1130
 
1131
  #: classes/admin/emails/class-wcv-vendor-notify-application.php:28
1132
+ msgid "Notification is sent to the %s that their application has been received"
1133
  msgstr ""
1134
 
1135
  #: classes/admin/emails/class-wcv-vendor-notify-application.php:48
1136
+ msgid "[{site_title}] Your %s application has been received"
 
 
 
 
1137
  msgstr ""
1138
 
1139
  #: classes/admin/emails/class-wcv-vendor-notify-application.php:62
1245
  msgstr ""
1246
 
1247
  #: classes/admin/settings/class-wcv-settings-capabilities.php:65
1248
+ msgid "Configure what product information to hide from the %s when creating or editing a product"
1249
  msgstr ""
1250
 
1251
  #: classes/admin/settings/class-wcv-settings-capabilities.php:70
1253
  msgstr ""
1254
 
1255
  #: classes/admin/settings/class-wcv-settings-capabilities.php:71
1256
+ msgid "This controls what product types the %s can create"
1257
  msgstr ""
1258
 
1259
  #: classes/admin/settings/class-wcv-settings-capabilities.php:82
1261
  msgstr ""
1262
 
1263
  #: classes/admin/settings/class-wcv-settings-capabilities.php:83
1264
+ msgid "This controls what product type options the %s can use"
1265
  msgstr ""
1266
 
1267
  #: classes/admin/settings/class-wcv-settings-capabilities.php:90
1277
  msgstr ""
1278
 
1279
  #: classes/admin/settings/class-wcv-settings-capabilities.php:98
1280
+ msgid "This controls what product data tabs the %s can use"
1281
  msgstr ""
1282
 
1283
  #: classes/admin/settings/class-wcv-settings-capabilities.php:106
1480
  msgstr ""
1481
 
1482
  #: classes/admin/settings/class-wcv-settings-display.php:71
1483
+ msgid "You can add CSS in this textarea, which will be loaded on the product add/edit page for %s"
1484
  msgstr ""
1485
 
1486
+ #: classes/admin/settings/class-wcv-settings-display.php:72, classes/admin/settings/class-wcv-settings-display.php:114
1487
  msgid "This enables the sold by labels used to show which %s shop the product belongs to"
1488
  msgstr ""
1489
 
1492
  msgstr ""
1493
 
1494
  #: classes/admin/settings/class-wcv-settings-display.php:96
1495
+ msgid "Vendor singluar term"
1496
  msgstr ""
1497
 
1498
  #: classes/admin/settings/class-wcv-settings-display.php:97
1499
+ msgid "Change all references to vendor to this term"
1500
+ msgstr ""
1501
+
1502
+ #: classes/admin/settings/class-wcv-settings-display.php:104
1503
+ msgid "Vendor plural term"
1504
  msgstr ""
1505
 
1506
  #: classes/admin/settings/class-wcv-settings-display.php:105
1507
+ msgid "Change all references to vendors to this term"
1508
+ msgstr ""
1509
+
1510
+ #: classes/admin/settings/class-wcv-settings-display.php:112
1511
+ msgid "Sold by"
1512
+ msgstr ""
1513
+
1514
+ #: classes/admin/settings/class-wcv-settings-display.php:113
1515
+ msgid "Enable sold by labels"
1516
+ msgstr ""
1517
+
1518
+ #: classes/admin/settings/class-wcv-settings-display.php:121
1519
  msgid "Sold by label"
1520
  msgstr ""
1521
 
1522
+ #: classes/admin/settings/class-wcv-settings-display.php:122
1523
  msgid "The sold by label"
1524
  msgstr ""
1525
 
1526
+ #: classes/admin/settings/class-wcv-settings-display.php:125
1527
  msgid "Sold By"
1528
  msgstr ""
1529
 
1530
+ #: classes/admin/settings/class-wcv-settings-display.php:129
1531
  msgid "%s Store Info"
1532
  msgstr ""
1533
 
1534
+ #: classes/admin/settings/class-wcv-settings-display.php:130
1535
  msgid "Enable %s store info tab on the single product page"
1536
  msgstr ""
1537
 
1538
+ #: classes/admin/settings/class-wcv-settings-display.php:137
1539
  msgid "%s store Info label"
1540
  msgstr ""
1541
 
1542
+ #: classes/admin/settings/class-wcv-settings-display.php:138
1543
  msgid "The %s store info label"
1544
  msgstr ""
1545
 
1546
+ #: classes/admin/settings/class-wcv-settings-display.php:141
1547
  msgid "Store Info"
1548
  msgstr ""
1549
 
1550
+ #: classes/admin/settings/class-wcv-settings-display.php:156
1551
  msgid "These pages used on the front end by %s."
1552
  msgstr ""
1553
 
1554
+ #: classes/admin/settings/class-wcv-settings-display.php:160
1555
  msgid "Dashboard"
1556
  msgstr ""
1557
 
1558
+ #: classes/admin/settings/class-wcv-settings-display.php:166
1559
  msgid "<br />This sets the page used to display the front end %s dashboard. This page should contain the following shortcode. <code>[wcv_vendor_dashboard]</code>"
1560
  msgstr ""
1561
 
1562
+ #: classes/admin/settings/class-wcv-settings-display.php:175
1563
  msgid "<br />This sets the page used to display the %s shop settings page. This page should contain the following shortcode. <code>[wcv_shop_settings]</code>"
1564
  msgstr ""
1565
 
1566
+ #: classes/admin/settings/class-wcv-settings-display.php:184
1567
  msgid "<br />This sets the page used to display the %s orders page. This page should contain the following shortcode. <code>[wcv_orders]</code>"
1568
  msgstr ""
1569
 
1570
+ #: classes/admin/settings/class-wcv-settings-display.php:187
1571
  msgid "%s"
1572
  msgstr ""
1573
 
1574
+ #: classes/admin/settings/class-wcv-settings-display.php:193
1575
  msgid "<br />This sets the page used to display a paginated list of all %1$s stores. Your %1$s stores will be available at <code>%2$s/page-slug/store-name/</code><br />This page should contain the following shortcode. <code>[wcv_vendorslist]</code>"
1576
  msgstr ""
1577
 
1578
+ #: classes/admin/settings/class-wcv-settings-display.php:196
1579
  msgid "Terms and Conditions"
1580
  msgstr ""
1581
 
1582
+ #: classes/admin/settings/class-wcv-settings-display.php:202
1583
  msgid "<br />This sets the page used to display the terms and conditions when a %s signs up."
1584
  msgstr ""
1585
 
1586
+ #: classes/admin/settings/class-wcv-settings-display.php:211
1587
+ msgid "These are the settings for the individual %s stores."
1588
  msgstr ""
1589
 
1590
+ #: classes/admin/settings/class-wcv-settings-display.php:216
1591
  msgid "%s Store URL"
1592
  msgstr ""
1593
 
1594
+ #: classes/admin/settings/class-wcv-settings-display.php:217
1595
+ msgid "If you enter \"vendors\" your %1$s store will be %1$s/vendors/store-name/"
1596
  msgstr ""
1597
 
1598
+ #: classes/admin/settings/class-wcv-settings-display.php:224
1599
  msgid "Shop Header"
1600
  msgstr ""
1601
 
1602
+ #: classes/admin/settings/class-wcv-settings-display.php:225
1603
  msgid "Enable %s shop headers"
1604
  msgstr ""
1605
 
1606
+ #: classes/admin/settings/class-wcv-settings-display.php:226
1607
  msgid "This enables the %s shop header template and disables the shop description text."
1608
  msgstr ""
1609
 
1610
+ #: classes/admin/settings/class-wcv-settings-display.php:233
1611
  msgid "Shop HTML"
1612
  msgstr ""
1613
 
1614
+ #: classes/admin/settings/class-wcv-settings-display.php:234
1615
  msgid "Allow HTML in %s shop desription"
1616
  msgstr ""
1617
 
1618
+ #: classes/admin/settings/class-wcv-settings-display.php:235
1619
+ msgid "Enable HTML for the %1$s shop description. You can enable or disable this per %1$s by editing the %1$s user account."
1620
  msgstr ""
1621
 
1622
+ #: classes/admin/settings/class-wcv-settings-display.php:242
1623
  msgid "Display Name"
1624
  msgstr ""
1625
 
1626
+ #: classes/admin/settings/class-wcv-settings-display.php:244
1627
  msgid "Select what will be used to display the %s name throughout the marketplace."
1628
  msgstr ""
1629
 
1630
+ #: classes/admin/settings/class-wcv-settings-display.php:249
1631
  msgid "Display name"
1632
  msgstr ""
1633
 
1634
+ #: classes/admin/settings/class-wcv-settings-display.php:250, classes/admin/views/html-vendor-meta.php:26
1635
  msgid "Shop name"
1636
  msgstr ""
1637
 
1638
+ #: classes/admin/settings/class-wcv-settings-display.php:251
1639
  msgid "%s Username"
1640
  msgstr ""
1641
 
1642
+ #: classes/admin/settings/class-wcv-settings-display.php:252
1643
  msgid "%s Email"
1644
  msgstr ""
1645
 
1708
  msgstr ""
1709
 
1710
  #: classes/admin/settings/class-wcv-settings-payments.php:82
1711
+ msgid "Instantly pay %1s their commission when an order is made, and if a %1s has a valid PayPal email added on their Shop Settings page."
1712
  msgstr ""
1713
 
1714
  #: classes/admin/settings/class-wcv-settings-payments.php:89
1899
  msgid "Bank Account Number"
1900
  msgstr ""
1901
 
1902
+ #: classes/admin/views/html-vendor-meta.php:60, classes/admin/views/html-vendor-settings-page.php:36, templates/dashboard/settings/settings.php:44
1903
  msgid "Bank Name"
1904
  msgstr ""
1905
 
1906
+ #: classes/admin/views/html-vendor-meta.php:65, classes/admin/views/html-vendor-settings-page.php:41, templates/dashboard/settings/settings.php:47
1907
  msgid "Routing Number"
1908
  msgstr ""
1909
 
1910
+ #: classes/admin/views/html-vendor-meta.php:70, classes/admin/views/html-vendor-settings-page.php:46, templates/dashboard/settings/settings.php:48
1911
  msgid "IBAN"
1912
  msgstr ""
1913
 
1935
  msgid "Shipping override for vendor"
1936
  msgstr ""
1937
 
1938
+ #: classes/admin/views/html-vendor-meta.php:133, classes/admin/views/html-vendor-settings-page.php:69, templates/dashboard/settings/seller-info.php:21
1939
  msgid "Seller info"
1940
  msgstr ""
1941
 
1943
  msgid "Shop description"
1944
  msgstr ""
1945
 
1946
+ #: classes/admin/views/html-vendor-settings-page.php:11, templates/dashboard/settings/paypal-email-form.php:19
1947
  msgid "PayPal Address"
1948
  msgstr ""
1949
 
1951
  msgid "Your PayPal address can be used to send you your commission."
1952
  msgstr ""
1953
 
1954
+ #: classes/admin/views/html-vendor-settings-page.php:61, templates/dashboard/settings/shop-name.php:19
1955
  msgid "Shop Name"
1956
  msgstr ""
1957
 
1958
+ #: classes/admin/views/html-vendor-settings-page.php:63, templates/dashboard/settings/shop-name.php:20
1959
  msgid "Your shop name is public and must be unique."
1960
  msgstr ""
1961
 
1962
+ #: classes/admin/views/html-vendor-settings-page.php:82, templates/dashboard/settings/seller-info.php:22
1963
  msgid "This is displayed on each of your products."
1964
  msgstr ""
1965
 
1966
+ #: classes/admin/views/html-vendor-settings-page.php:88, templates/dashboard/settings/shop-description.php:19
1967
  msgid "Shop Description"
1968
  msgstr ""
1969
 
1970
+ #: classes/admin/views/html-vendor-settings-page.php:100, templates/dashboard/settings/shop-description.php:20
1971
  msgid "This is displayed on your <a href=\"%s\">shop page</a>."
1972
  msgstr ""
1973
 
1996
  msgstr ""
1997
 
1998
  #: classes/front/orders/class-orders.php:55, classes/front/orders/class-orders.php:121
1999
+ msgid "You haven't selected a product's orders to view! Please go back to the %s Dashboard and click Show Orders on the product you'd like to view."
2000
  msgstr ""
2001
 
2002
  #: classes/front/orders/class-orders.php:78, classes/front/orders/class-orders.php:144
2243
  msgid "Test gateway transation complete. Order processing."
2244
  msgstr ""
2245
 
2246
+ #: templates/dashboard/settings/paypal-email-form.php:20
2247
  msgid "Your PayPal address can be used to manually send you your commission."
2248
  msgstr ""
2249
 
2250
+ #: templates/dashboard/settings/settings.php:39
2251
  msgid "Bank Details"
2252
  msgstr ""
2253
 
2254
+ #: templates/dashboard/settings/settings.php:42
2255
  msgid "Account Name"
2256
  msgstr ""
2257
 
2258
+ #: templates/dashboard/settings/settings.php:43
2259
  msgid "Account Number"
2260
  msgstr ""
2261
 
2262
+ #: templates/dashboard/settings/settings.php:49
2263
  msgid "BIC / Swift"
2264
  msgstr ""
2265
 
2266
+ #: templates/dashboard/settings/settings.php:86
2267
  msgid "Save"
2268
  msgstr ""
2269
 
2276
  msgid "Order number: %s"
2277
  msgstr ""
2278
 
2279
+ #: templates/orders/comments/add-new-comment.php:27
2280
  msgid "Add comment"
2281
  msgstr ""
2282
 
2283
+ #: templates/orders/comments/existing-comments.php:25
2284
  msgid "added %s ago"
2285
  msgstr ""
2286
 
2287
+ #: templates/orders/customer-note/customer-note.php:20
2288
  msgid "Customer note"
2289
  msgstr ""
2290
 
2291
+ #: templates/orders/customer-note/customer-note.php:24
2292
  msgid "No customer note."
2293
  msgstr ""
2294
 
2295
+ #: templates/orders/shipping/shipping-form.php:91
2296
  msgid "Update tracking number"
2297
  msgstr ""
2298
 
2299
+ #: templates/orders/shipping/shipping-form.php:93
2300
  msgid "Mark as shipped"
2301
  msgstr ""
2302
 
package-lock.json ADDED
@@ -0,0 +1,6058 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "wc-vendors",
3
+ "version": "2.0.0",
4
+ "lockfileVersion": 1,
5
+ "requires": true,
6
+ "dependencies": {
7
+ "abbrev": {
8
+ "version": "1.1.1",
9
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
10
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
11
+ "dev": true
12
+ },
13
+ "amdefine": {
14
+ "version": "1.0.1",
15
+ "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
16
+ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
17
+ "dev": true
18
+ },
19
+ "ansi-colors": {
20
+ "version": "1.1.0",
21
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz",
22
+ "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==",
23
+ "dev": true,
24
+ "requires": {
25
+ "ansi-wrap": "0.1.0"
26
+ }
27
+ },
28
+ "ansi-cyan": {
29
+ "version": "0.1.1",
30
+ "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz",
31
+ "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=",
32
+ "dev": true,
33
+ "requires": {
34
+ "ansi-wrap": "0.1.0"
35
+ }
36
+ },
37
+ "ansi-gray": {
38
+ "version": "0.1.1",
39
+ "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz",
40
+ "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=",
41
+ "dev": true,
42
+ "requires": {
43
+ "ansi-wrap": "0.1.0"
44
+ }
45
+ },
46
+ "ansi-red": {
47
+ "version": "0.1.1",
48
+ "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz",
49
+ "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=",
50
+ "dev": true,
51
+ "requires": {
52
+ "ansi-wrap": "0.1.0"
53
+ }
54
+ },
55
+ "ansi-regex": {
56
+ "version": "2.1.1",
57
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
58
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
59
+ "dev": true
60
+ },
61
+ "ansi-styles": {
62
+ "version": "2.2.1",
63
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
64
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
65
+ "dev": true
66
+ },
67
+ "ansi-wrap": {
68
+ "version": "0.1.0",
69
+ "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz",
70
+ "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=",
71
+ "dev": true
72
+ },
73
+ "aproba": {
74
+ "version": "1.2.0",
75
+ "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
76
+ "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
77
+ "dev": true
78
+ },
79
+ "archy": {
80
+ "version": "1.0.0",
81
+ "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
82
+ "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=",
83
+ "dev": true
84
+ },
85
+ "are-we-there-yet": {
86
+ "version": "1.1.4",
87
+ "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz",
88
+ "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=",
89
+ "dev": true,
90
+ "requires": {
91
+ "delegates": "1.0.0",
92
+ "readable-stream": "2.3.6"
93
+ },
94
+ "dependencies": {
95
+ "isarray": {
96
+ "version": "1.0.0",
97
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
98
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
99
+ "dev": true
100
+ },
101
+ "readable-stream": {
102
+ "version": "2.3.6",
103
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
104
+ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
105
+ "dev": true,
106
+ "requires": {
107
+ "core-util-is": "1.0.2",
108
+ "inherits": "2.0.3",
109
+ "isarray": "1.0.0",
110
+ "process-nextick-args": "2.0.0",
111
+ "safe-buffer": "5.1.2",
112
+ "string_decoder": "1.1.1",
113
+ "util-deprecate": "1.0.2"
114
+ }
115
+ },
116
+ "string_decoder": {
117
+ "version": "1.1.1",
118
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
119
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
120
+ "dev": true,
121
+ "requires": {
122
+ "safe-buffer": "5.1.2"
123
+ }
124
+ }
125
+ }
126
+ },
127
+ "arr-diff": {
128
+ "version": "4.0.0",
129
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
130
+ "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
131
+ "dev": true
132
+ },
133
+ "arr-flatten": {
134
+ "version": "1.1.0",
135
+ "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
136
+ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
137
+ "dev": true
138
+ },
139
+ "arr-union": {
140
+ "version": "3.1.0",
141
+ "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
142
+ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
143
+ "dev": true
144
+ },
145
+ "array-differ": {
146
+ "version": "1.0.0",
147
+ "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz",
148
+ "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=",
149
+ "dev": true
150
+ },
151
+ "array-each": {
152
+ "version": "1.0.1",
153
+ "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
154
+ "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=",
155
+ "dev": true
156
+ },
157
+ "array-find-index": {
158
+ "version": "1.0.2",
159
+ "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
160
+ "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=",
161
+ "dev": true
162
+ },
163
+ "array-slice": {
164
+ "version": "1.1.0",
165
+ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
166
+ "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
167
+ "dev": true
168
+ },
169
+ "array-union": {
170
+ "version": "1.0.2",
171
+ "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
172
+ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
173
+ "dev": true,
174
+ "requires": {
175
+ "array-uniq": "1.0.3"
176
+ }
177
+ },
178
+ "array-uniq": {
179
+ "version": "1.0.3",
180
+ "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
181
+ "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=",
182
+ "dev": true
183
+ },
184
+ "array-unique": {
185
+ "version": "0.3.2",
186
+ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
187
+ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
188
+ "dev": true
189
+ },
190
+ "asn1": {
191
+ "version": "0.2.3",
192
+ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
193
+ "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=",
194
+ "dev": true
195
+ },
196
+ "assert-plus": {
197
+ "version": "0.2.0",
198
+ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz",
199
+ "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=",
200
+ "dev": true
201
+ },
202
+ "assign-symbols": {
203
+ "version": "1.0.0",
204
+ "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
205
+ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
206
+ "dev": true
207
+ },
208
+ "async-foreach": {
209
+ "version": "0.1.3",
210
+ "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz",
211
+ "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=",
212
+ "dev": true
213
+ },
214
+ "asynckit": {
215
+ "version": "0.4.0",
216
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
217
+ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
218
+ "dev": true
219
+ },
220
+ "atob": {
221
+ "version": "2.1.1",
222
+ "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz",
223
+ "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=",
224
+ "dev": true
225
+ },
226
+ "autoprefixer": {
227
+ "version": "8.5.0",
228
+ "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-8.5.0.tgz",
229
+ "integrity": "sha512-buY1XxFoBrXvLsoFb0jP+niSu1tCj2RwMwHj96+RfQ8DJTgb0vUhh0dg6wjJT3JzsFYBrkSj8/sGtarNdlxTFw==",
230
+ "dev": true,
231
+ "requires": {
232
+ "browserslist": "3.2.7",
233
+ "caniuse-lite": "1.0.30000843",
234
+ "normalize-range": "0.1.2",
235
+ "num2fraction": "1.2.2",
236
+ "postcss": "6.0.22",
237
+ "postcss-value-parser": "3.3.0"
238
+ }
239
+ },
240
+ "aws-sign2": {
241
+ "version": "0.6.0",
242
+ "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz",
243
+ "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=",
244
+ "dev": true
245
+ },
246
+ "aws4": {
247
+ "version": "1.7.0",
248
+ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz",
249
+ "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==",
250
+ "dev": true
251
+ },
252
+ "babel-runtime": {
253
+ "version": "6.26.0",
254
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
255
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
256
+ "dev": true,
257
+ "requires": {
258
+ "core-js": "2.5.6",
259
+ "regenerator-runtime": "0.11.1"
260
+ }
261
+ },
262
+ "balanced-match": {
263
+ "version": "1.0.0",
264
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
265
+ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
266
+ "dev": true
267
+ },
268
+ "base": {
269
+ "version": "0.11.2",
270
+ "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
271
+ "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
272
+ "dev": true,
273
+ "requires": {
274
+ "cache-base": "1.0.1",
275
+ "class-utils": "0.3.6",
276
+ "component-emitter": "1.2.1",
277
+ "define-property": "1.0.0",
278
+ "isobject": "3.0.1",
279
+ "mixin-deep": "1.3.1",
280
+ "pascalcase": "0.1.1"
281
+ },
282
+ "dependencies": {
283
+ "define-property": {
284
+ "version": "1.0.0",
285
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
286
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
287
+ "dev": true,
288
+ "requires": {
289
+ "is-descriptor": "1.0.2"
290
+ }
291
+ },
292
+ "is-accessor-descriptor": {
293
+ "version": "1.0.0",
294
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
295
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
296
+ "dev": true,
297
+ "requires": {
298
+ "kind-of": "6.0.2"
299
+ }
300
+ },
301
+ "is-data-descriptor": {
302
+ "version": "1.0.0",
303
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
304
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
305
+ "dev": true,
306
+ "requires": {
307
+ "kind-of": "6.0.2"
308
+ }
309
+ },
310
+ "is-descriptor": {
311
+ "version": "1.0.2",
312
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
313
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
314
+ "dev": true,
315
+ "requires": {
316
+ "is-accessor-descriptor": "1.0.0",
317
+ "is-data-descriptor": "1.0.0",
318
+ "kind-of": "6.0.2"
319
+ }
320
+ }
321
+ }
322
+ },
323
+ "bcrypt-pbkdf": {
324
+ "version": "1.0.1",
325
+ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz",
326
+ "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=",
327
+ "dev": true,
328
+ "optional": true,
329
+ "requires": {
330
+ "tweetnacl": "0.14.5"
331
+ }
332
+ },
333
+ "beeper": {
334
+ "version": "1.1.1",
335
+ "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz",
336
+ "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=",
337
+ "dev": true
338
+ },
339
+ "block-stream": {
340
+ "version": "0.0.9",
341
+ "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
342
+ "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=",
343
+ "dev": true,
344
+ "requires": {
345
+ "inherits": "2.0.3"
346
+ }
347
+ },
348
+ "body": {
349
+ "version": "5.1.0",
350
+ "resolved": "https://registry.npmjs.org/body/-/body-5.1.0.tgz",
351
+ "integrity": "sha1-5LoM5BCkaTYyM2dgnstOZVMSUGk=",
352
+ "dev": true,
353
+ "requires": {
354
+ "continuable-cache": "0.3.1",
355
+ "error": "7.0.2",
356
+ "raw-body": "1.1.7",
357
+ "safe-json-parse": "1.0.1"
358
+ },
359
+ "dependencies": {
360
+ "bytes": {
361
+ "version": "1.0.0",
362
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz",
363
+ "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=",
364
+ "dev": true
365
+ },
366
+ "raw-body": {
367
+ "version": "1.1.7",
368
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.7.tgz",
369
+ "integrity": "sha1-HQJ8K/oRasxmI7yo8AAWVyqH1CU=",
370
+ "dev": true,
371
+ "requires": {
372
+ "bytes": "1.0.0",
373
+ "string_decoder": "0.10.31"
374
+ }
375
+ }
376
+ }
377
+ },
378
+ "body-parser": {
379
+ "version": "1.14.2",
380
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.14.2.tgz",
381
+ "integrity": "sha1-EBXLH+LEQ4WCWVgdtTMy+NDPUPk=",
382
+ "dev": true,
383
+ "requires": {
384
+ "bytes": "2.2.0",
385
+ "content-type": "1.0.4",
386
+ "debug": "2.2.0",
387
+ "depd": "1.1.2",
388
+ "http-errors": "1.3.1",
389
+ "iconv-lite": "0.4.13",
390
+ "on-finished": "2.3.0",
391
+ "qs": "5.2.0",
392
+ "raw-body": "2.1.7",
393
+ "type-is": "1.6.16"
394
+ },
395
+ "dependencies": {
396
+ "debug": {
397
+ "version": "2.2.0",
398
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
399
+ "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=",
400
+ "dev": true,
401
+ "requires": {
402
+ "ms": "0.7.1"
403
+ }
404
+ },
405
+ "ms": {
406
+ "version": "0.7.1",
407
+ "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
408
+ "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=",
409
+ "dev": true
410
+ },
411
+ "qs": {
412
+ "version": "5.2.0",
413
+ "resolved": "https://registry.npmjs.org/qs/-/qs-5.2.0.tgz",
414
+ "integrity": "sha1-qfMRQq9GjLcrJbMBNrokVoNJFr4=",
415
+ "dev": true
416
+ }
417
+ }
418
+ },
419
+ "boom": {
420
+ "version": "2.10.1",
421
+ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
422
+ "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=",
423
+ "dev": true,
424
+ "requires": {
425
+ "hoek": "2.16.3"
426
+ }
427
+ },
428
+ "brace-expansion": {
429
+ "version": "1.1.11",
430
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
431
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
432
+ "dev": true,
433
+ "requires": {
434
+ "balanced-match": "1.0.0",
435
+ "concat-map": "0.0.1"
436
+ }
437
+ },
438
+ "braces": {
439
+ "version": "2.3.2",
440
+ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
441
+ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
442
+ "dev": true,
443
+ "requires": {
444
+ "arr-flatten": "1.1.0",
445
+ "array-unique": "0.3.2",
446
+ "extend-shallow": "2.0.1",
447
+ "fill-range": "4.0.0",
448
+ "isobject": "3.0.1",
449
+ "repeat-element": "1.1.2",
450
+ "snapdragon": "0.8.2",
451
+ "snapdragon-node": "2.1.1",
452
+ "split-string": "3.1.0",
453
+ "to-regex": "3.0.2"
454
+ },
455
+ "dependencies": {
456
+ "extend-shallow": {
457
+ "version": "2.0.1",
458
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
459
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
460
+ "dev": true,
461
+ "requires": {
462
+ "is-extendable": "0.1.1"
463
+ }
464
+ }
465
+ }
466
+ },
467
+ "browserslist": {
468
+ "version": "3.2.7",
469
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.7.tgz",
470
+ "integrity": "sha512-oYVLxFVqpX9uMhOIQBLtZL+CX4uY8ZpWcjNTaxyWl5rO8yA9SSNikFnAfvk8J3P/7z3BZwNmEqFKaJoYltj3MQ==",
471
+ "dev": true,
472
+ "requires": {
473
+ "caniuse-lite": "1.0.30000843",
474
+ "electron-to-chromium": "1.3.47"
475
+ }
476
+ },
477
+ "builtin-modules": {
478
+ "version": "1.1.1",
479
+ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
480
+ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
481
+ "dev": true
482
+ },
483
+ "bytes": {
484
+ "version": "2.2.0",
485
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.2.0.tgz",
486
+ "integrity": "sha1-/TVGSkA/b5EXwt42Cez/nK4ABYg=",
487
+ "dev": true
488
+ },
489
+ "cache-base": {
490
+ "version": "1.0.1",
491
+ "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
492
+ "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
493
+ "dev": true,
494
+ "requires": {
495
+ "collection-visit": "1.0.0",
496
+ "component-emitter": "1.2.1",
497
+ "get-value": "2.0.6",
498
+ "has-value": "1.0.0",
499
+ "isobject": "3.0.1",
500
+ "set-value": "2.0.0",
501
+ "to-object-path": "0.3.0",
502
+ "union-value": "1.0.0",
503
+ "unset-value": "1.0.0"
504
+ }
505
+ },
506
+ "cache-swap": {
507
+ "version": "0.3.0",
508
+ "resolved": "https://registry.npmjs.org/cache-swap/-/cache-swap-0.3.0.tgz",
509
+ "integrity": "sha1-HFQaoQilAQb2ML3Zj+HeyLoTP1E=",
510
+ "dev": true,
511
+ "requires": {
512
+ "graceful-fs": "4.1.11",
513
+ "mkdirp": "0.5.1",
514
+ "object-assign": "4.1.1",
515
+ "rimraf": "2.6.2"
516
+ },
517
+ "dependencies": {
518
+ "graceful-fs": {
519
+ "version": "4.1.11",
520
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
521
+ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
522
+ "dev": true
523
+ }
524
+ }
525
+ },
526
+ "camelcase": {
527
+ "version": "2.1.1",
528
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
529
+ "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=",
530
+ "dev": true
531
+ },
532
+ "camelcase-keys": {
533
+ "version": "2.1.0",
534
+ "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
535
+ "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
536
+ "dev": true,
537
+ "requires": {
538
+ "camelcase": "2.1.1",
539
+ "map-obj": "1.0.1"
540
+ }
541
+ },
542
+ "caniuse-lite": {
543
+ "version": "1.0.30000843",
544
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000843.tgz",
545
+ "integrity": "sha512-1ntiW826MhRBmM0CeI7w1cQr16gxwOoM8doJWh3BFalPZoKWdZXs27Bc04xth/3NR1/wNXn9cpP4F92lVenCvg==",
546
+ "dev": true
547
+ },
548
+ "caseless": {
549
+ "version": "0.11.0",
550
+ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz",
551
+ "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=",
552
+ "dev": true
553
+ },
554
+ "chalk": {
555
+ "version": "1.1.3",
556
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
557
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
558
+ "dev": true,
559
+ "requires": {
560
+ "ansi-styles": "2.2.1",
561
+ "escape-string-regexp": "1.0.5",
562
+ "has-ansi": "2.0.0",
563
+ "strip-ansi": "3.0.1",
564
+ "supports-color": "2.0.0"
565
+ }
566
+ },
567
+ "class-utils": {
568
+ "version": "0.3.6",
569
+ "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
570
+ "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
571
+ "dev": true,
572
+ "requires": {
573
+ "arr-union": "3.1.0",
574
+ "define-property": "0.2.5",
575
+ "isobject": "3.0.1",
576
+ "static-extend": "0.1.2"
577
+ },
578
+ "dependencies": {
579
+ "define-property": {
580
+ "version": "0.2.5",
581
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
582
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
583
+ "dev": true,
584
+ "requires": {
585
+ "is-descriptor": "0.1.6"
586
+ }
587
+ }
588
+ }
589
+ },
590
+ "clean-css": {
591
+ "version": "4.1.11",
592
+ "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.1.11.tgz",
593
+ "integrity": "sha1-Ls3xRaujj1R0DybO/Q/z4D4SXWo=",
594
+ "dev": true,
595
+ "requires": {
596
+ "source-map": "0.5.7"
597
+ }
598
+ },
599
+ "cli": {
600
+ "version": "1.0.1",
601
+ "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz",
602
+ "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=",
603
+ "dev": true,
604
+ "requires": {
605
+ "exit": "0.1.2",
606
+ "glob": "7.1.2"
607
+ }
608
+ },
609
+ "cliui": {
610
+ "version": "3.2.0",
611
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
612
+ "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
613
+ "dev": true,
614
+ "requires": {
615
+ "string-width": "1.0.2",
616
+ "strip-ansi": "3.0.1",
617
+ "wrap-ansi": "2.1.0"
618
+ }
619
+ },
620
+ "clone": {
621
+ "version": "1.0.4",
622
+ "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
623
+ "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
624
+ "dev": true
625
+ },
626
+ "clone-buffer": {
627
+ "version": "1.0.0",
628
+ "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz",
629
+ "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=",
630
+ "dev": true
631
+ },
632
+ "clone-stats": {
633
+ "version": "0.0.1",
634
+ "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz",
635
+ "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=",
636
+ "dev": true
637
+ },
638
+ "cloneable-readable": {
639
+ "version": "1.1.2",
640
+ "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz",
641
+ "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==",
642
+ "dev": true,
643
+ "requires": {
644
+ "inherits": "2.0.3",
645
+ "process-nextick-args": "2.0.0",
646
+ "readable-stream": "2.3.6"
647
+ },
648
+ "dependencies": {
649
+ "isarray": {
650
+ "version": "1.0.0",
651
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
652
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
653
+ "dev": true
654
+ },
655
+ "readable-stream": {
656
+ "version": "2.3.6",
657
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
658
+ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
659
+ "dev": true,
660
+ "requires": {
661
+ "core-util-is": "1.0.2",
662
+ "inherits": "2.0.3",
663
+ "isarray": "1.0.0",
664
+ "process-nextick-args": "2.0.0",
665
+ "safe-buffer": "5.1.2",
666
+ "string_decoder": "1.1.1",
667
+ "util-deprecate": "1.0.2"
668
+ }
669
+ },
670
+ "string_decoder": {
671
+ "version": "1.1.1",
672
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
673
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
674
+ "dev": true,
675
+ "requires": {
676
+ "safe-buffer": "5.1.2"
677
+ }
678
+ }
679
+ }
680
+ },
681
+ "code-point-at": {
682
+ "version": "1.1.0",
683
+ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
684
+ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
685
+ "dev": true
686
+ },
687
+ "collection-visit": {
688
+ "version": "1.0.0",
689
+ "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
690
+ "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=",
691
+ "dev": true,
692
+ "requires": {
693
+ "map-visit": "1.0.0",
694
+ "object-visit": "1.0.1"
695
+ }
696
+ },
697
+ "color-convert": {
698
+ "version": "1.9.1",
699
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz",
700
+ "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==",
701
+ "dev": true,
702
+ "requires": {
703
+ "color-name": "1.1.3"
704
+ }
705
+ },
706
+ "color-name": {
707
+ "version": "1.1.3",
708
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
709
+ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
710
+ "dev": true
711
+ },
712
+ "color-support": {
713
+ "version": "1.1.3",
714
+ "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
715
+ "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
716
+ "dev": true
717
+ },
718
+ "combined-stream": {
719
+ "version": "1.0.6",
720
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
721
+ "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
722
+ "dev": true,
723
+ "requires": {
724
+ "delayed-stream": "1.0.0"
725
+ }
726
+ },
727
+ "commander": {
728
+ "version": "2.15.1",
729
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
730
+ "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
731
+ "dev": true
732
+ },
733
+ "component-emitter": {
734
+ "version": "1.2.1",
735
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
736
+ "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=",
737
+ "dev": true
738
+ },
739
+ "concat-map": {
740
+ "version": "0.0.1",
741
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
742
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
743
+ "dev": true
744
+ },
745
+ "concat-with-sourcemaps": {
746
+ "version": "1.1.0",
747
+ "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz",
748
+ "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==",
749
+ "dev": true,
750
+ "requires": {
751
+ "source-map": "0.6.1"
752
+ },
753
+ "dependencies": {
754
+ "source-map": {
755
+ "version": "0.6.1",
756
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
757
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
758
+ "dev": true
759
+ }
760
+ }
761
+ },
762
+ "console-browserify": {
763
+ "version": "1.1.0",
764
+ "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
765
+ "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=",
766
+ "dev": true,
767
+ "requires": {
768
+ "date-now": "0.1.4"
769
+ }
770
+ },
771
+ "console-control-strings": {
772
+ "version": "1.1.0",
773
+ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
774
+ "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
775
+ "dev": true
776
+ },
777
+ "content-type": {
778
+ "version": "1.0.4",
779
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
780
+ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
781
+ "dev": true
782
+ },
783
+ "continuable-cache": {
784
+ "version": "0.3.1",
785
+ "resolved": "https://registry.npmjs.org/continuable-cache/-/continuable-cache-0.3.1.tgz",
786
+ "integrity": "sha1-vXJ6f67XfnH/OYWskzUakSczrQ8=",
787
+ "dev": true
788
+ },
789
+ "convert-source-map": {
790
+ "version": "1.5.1",
791
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz",
792
+ "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=",
793
+ "dev": true
794
+ },
795
+ "copy-descriptor": {
796
+ "version": "0.1.1",
797
+ "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
798
+ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
799
+ "dev": true
800
+ },
801
+ "core-js": {
802
+ "version": "2.5.6",
803
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.6.tgz",
804
+ "integrity": "sha512-lQUVfQi0aLix2xpyjrrJEvfuYCqPc/HwmTKsC/VNf8q0zsjX7SQZtp4+oRONN5Tsur9GDETPjj+Ub2iDiGZfSQ==",
805
+ "dev": true
806
+ },
807
+ "core-util-is": {
808
+ "version": "1.0.2",
809
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
810
+ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
811
+ "dev": true
812
+ },
813
+ "cross-spawn": {
814
+ "version": "5.1.0",
815
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
816
+ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
817
+ "dev": true,
818
+ "requires": {
819
+ "lru-cache": "4.1.3",
820
+ "shebang-command": "1.2.0",
821
+ "which": "1.3.0"
822
+ },
823
+ "dependencies": {
824
+ "lru-cache": {
825
+ "version": "4.1.3",
826
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz",
827
+ "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==",
828
+ "dev": true,
829
+ "requires": {
830
+ "pseudomap": "1.0.2",
831
+ "yallist": "2.1.2"
832
+ }
833
+ }
834
+ }
835
+ },
836
+ "cryptiles": {
837
+ "version": "2.0.5",
838
+ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz",
839
+ "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=",
840
+ "dev": true,
841
+ "requires": {
842
+ "boom": "2.10.1"
843
+ }
844
+ },
845
+ "currently-unhandled": {
846
+ "version": "0.4.1",
847
+ "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz",
848
+ "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=",
849
+ "dev": true,
850
+ "requires": {
851
+ "array-find-index": "1.0.2"
852
+ }
853
+ },
854
+ "dargs": {
855
+ "version": "3.0.1",
856
+ "resolved": "https://registry.npmjs.org/dargs/-/dargs-3.0.1.tgz",
857
+ "integrity": "sha1-Wh8/QzI0Hz8c0Qgp4N8jmW39Kb4=",
858
+ "dev": true
859
+ },
860
+ "dashdash": {
861
+ "version": "1.14.1",
862
+ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
863
+ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
864
+ "dev": true,
865
+ "requires": {
866
+ "assert-plus": "1.0.0"
867
+ },
868
+ "dependencies": {
869
+ "assert-plus": {
870
+ "version": "1.0.0",
871
+ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
872
+ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
873
+ "dev": true
874
+ }
875
+ }
876
+ },
877
+ "date-now": {
878
+ "version": "0.1.4",
879
+ "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz",
880
+ "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=",
881
+ "dev": true
882
+ },
883
+ "dateformat": {
884
+ "version": "2.2.0",
885
+ "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz",
886
+ "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=",
887
+ "dev": true
888
+ },
889
+ "debug": {
890
+ "version": "2.6.9",
891
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
892
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
893
+ "dev": true,
894
+ "requires": {
895
+ "ms": "2.0.0"
896
+ }
897
+ },
898
+ "decamelize": {
899
+ "version": "1.2.0",
900
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
901
+ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
902
+ "dev": true
903
+ },
904
+ "decode-uri-component": {
905
+ "version": "0.2.0",
906
+ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
907
+ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
908
+ "dev": true
909
+ },
910
+ "defaults": {
911
+ "version": "1.0.3",
912
+ "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
913
+ "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
914
+ "dev": true,
915
+ "requires": {
916
+ "clone": "1.0.4"
917
+ }
918
+ },
919
+ "define-property": {
920
+ "version": "2.0.2",
921
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
922
+ "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
923
+ "dev": true,
924
+ "requires": {
925
+ "is-descriptor": "1.0.2",
926
+ "isobject": "3.0.1"
927
+ },
928
+ "dependencies": {
929
+ "is-accessor-descriptor": {
930
+ "version": "1.0.0",
931
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
932
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
933
+ "dev": true,
934
+ "requires": {
935
+ "kind-of": "6.0.2"
936
+ }
937
+ },
938
+ "is-data-descriptor": {
939
+ "version": "1.0.0",
940
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
941
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
942
+ "dev": true,
943
+ "requires": {
944
+ "kind-of": "6.0.2"
945
+ }
946
+ },
947
+ "is-descriptor": {
948
+ "version": "1.0.2",
949
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
950
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
951
+ "dev": true,
952
+ "requires": {
953
+ "is-accessor-descriptor": "1.0.0",
954
+ "is-data-descriptor": "1.0.0",
955
+ "kind-of": "6.0.2"
956
+ }
957
+ }
958
+ }
959
+ },
960
+ "del": {
961
+ "version": "3.0.0",
962
+ "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz",
963
+ "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=",
964
+ "dev": true,
965
+ "requires": {
966
+ "globby": "6.1.0",
967
+ "is-path-cwd": "1.0.0",
968
+ "is-path-in-cwd": "1.0.1",
969
+ "p-map": "1.2.0",
970
+ "pify": "3.0.0",
971
+ "rimraf": "2.6.2"
972
+ }
973
+ },
974
+ "delayed-stream": {
975
+ "version": "1.0.0",
976
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
977
+ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
978
+ "dev": true
979
+ },
980
+ "delegates": {
981
+ "version": "1.0.0",
982
+ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
983
+ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
984
+ "dev": true
985
+ },
986
+ "depd": {
987
+ "version": "1.1.2",
988
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
989
+ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
990
+ "dev": true
991
+ },
992
+ "deprecated": {
993
+ "version": "0.0.1",
994
+ "resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz",
995
+ "integrity": "sha1-+cmvVGSvoeepcUWKi97yqpTVuxk=",
996
+ "dev": true
997
+ },
998
+ "detect-file": {
999
+ "version": "1.0.0",
1000
+ "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
1001
+ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
1002
+ "dev": true
1003
+ },
1004
+ "dom-serializer": {
1005
+ "version": "0.1.0",
1006
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz",
1007
+ "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=",
1008
+ "dev": true,
1009
+ "requires": {
1010
+ "domelementtype": "1.1.3",
1011
+ "entities": "1.1.1"
1012
+ },
1013
+ "dependencies": {
1014
+ "domelementtype": {
1015
+ "version": "1.1.3",
1016
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz",
1017
+ "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=",
1018
+ "dev": true
1019
+ },
1020
+ "entities": {
1021
+ "version": "1.1.1",
1022
+ "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
1023
+ "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=",
1024
+ "dev": true
1025
+ }
1026
+ }
1027
+ },
1028
+ "domelementtype": {
1029
+ "version": "1.3.0",
1030
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz",
1031
+ "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=",
1032
+ "dev": true
1033
+ },
1034
+ "domhandler": {
1035
+ "version": "2.3.0",
1036
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz",
1037
+ "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=",
1038
+ "dev": true,
1039
+ "requires": {
1040
+ "domelementtype": "1.3.0"
1041
+ }
1042
+ },
1043
+ "domutils": {
1044
+ "version": "1.5.1",
1045
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz",
1046
+ "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
1047
+ "dev": true,
1048
+ "requires": {
1049
+ "dom-serializer": "0.1.0",
1050
+ "domelementtype": "1.3.0"
1051
+ }
1052
+ },
1053
+ "duplexer": {
1054
+ "version": "0.1.1",
1055
+ "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
1056
+ "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=",
1057
+ "dev": true
1058
+ },
1059
+ "duplexer2": {
1060
+ "version": "0.0.2",
1061
+ "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz",
1062
+ "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=",
1063
+ "dev": true,
1064
+ "requires": {
1065
+ "readable-stream": "1.1.14"
1066
+ }
1067
+ },
1068
+ "each-async": {
1069
+ "version": "1.1.1",
1070
+ "resolved": "https://registry.npmjs.org/each-async/-/each-async-1.1.1.tgz",
1071
+ "integrity": "sha1-3uUim98KtrogEqOV4bhpq/iBNHM=",
1072
+ "dev": true,
1073
+ "requires": {
1074
+ "onetime": "1.1.0",
1075
+ "set-immediate-shim": "1.0.1"
1076
+ }
1077
+ },
1078
+ "ecc-jsbn": {
1079
+ "version": "0.1.1",
1080
+ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz",
1081
+ "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=",
1082
+ "dev": true,
1083
+ "optional": true,
1084
+ "requires": {
1085
+ "jsbn": "0.1.1"
1086
+ }
1087
+ },
1088
+ "ee-first": {
1089
+ "version": "1.1.1",
1090
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
1091
+ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=",
1092
+ "dev": true
1093
+ },
1094
+ "electron-to-chromium": {
1095
+ "version": "1.3.47",
1096
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.47.tgz",
1097
+ "integrity": "sha1-dk6IfKkQTQGgrI6r7n38DizhQQQ=",
1098
+ "dev": true
1099
+ },
1100
+ "end-of-stream": {
1101
+ "version": "0.1.5",
1102
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz",
1103
+ "integrity": "sha1-jhdyBsPICDfYVjLouTWd/osvbq8=",
1104
+ "dev": true,
1105
+ "requires": {
1106
+ "once": "1.3.3"
1107
+ },
1108
+ "dependencies": {
1109
+ "once": {
1110
+ "version": "1.3.3",
1111
+ "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz",
1112
+ "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=",
1113
+ "dev": true,
1114
+ "requires": {
1115
+ "wrappy": "1.0.2"
1116
+ }
1117
+ }
1118
+ }
1119
+ },
1120
+ "entities": {
1121
+ "version": "1.0.0",
1122
+ "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz",
1123
+ "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=",
1124
+ "dev": true
1125
+ },
1126
+ "error": {
1127
+ "version": "7.0.2",
1128
+ "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz",
1129
+ "integrity": "sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI=",
1130
+ "dev": true,
1131
+ "requires": {
1132
+ "string-template": "0.2.1",
1133
+ "xtend": "4.0.1"
1134
+ }
1135
+ },
1136
+ "error-ex": {
1137
+ "version": "1.3.1",
1138
+ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz",
1139
+ "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=",
1140
+ "dev": true,
1141
+ "requires": {
1142
+ "is-arrayish": "0.2.1"
1143
+ }
1144
+ },
1145
+ "escape-string-regexp": {
1146
+ "version": "1.0.5",
1147
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
1148
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
1149
+ "dev": true
1150
+ },
1151
+ "event-stream": {
1152
+ "version": "3.3.4",
1153
+ "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
1154
+ "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=",
1155
+ "dev": true,
1156
+ "requires": {
1157
+ "duplexer": "0.1.1",
1158
+ "from": "0.1.7",
1159
+ "map-stream": "0.1.0",
1160
+ "pause-stream": "0.0.11",
1161
+ "split": "0.3.3",
1162
+ "stream-combiner": "0.0.4",
1163
+ "through": "2.3.8"
1164
+ }
1165
+ },
1166
+ "exit": {
1167
+ "version": "0.1.2",
1168
+ "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
1169
+ "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=",
1170
+ "dev": true
1171
+ },
1172
+ "expand-brackets": {
1173
+ "version": "2.1.4",
1174
+ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
1175
+ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
1176
+ "dev": true,
1177
+ "requires": {
1178
+ "debug": "2.6.9",
1179
+ "define-property": "0.2.5",
1180
+ "extend-shallow": "2.0.1",
1181
+ "posix-character-classes": "0.1.1",
1182
+ "regex-not": "1.0.2",
1183
+ "snapdragon": "0.8.2",
1184
+ "to-regex": "3.0.2"
1185
+ },
1186
+ "dependencies": {
1187
+ "define-property": {
1188
+ "version": "0.2.5",
1189
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
1190
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
1191
+ "dev": true,
1192
+ "requires": {
1193
+ "is-descriptor": "0.1.6"
1194
+ }
1195
+ },
1196
+ "extend-shallow": {
1197
+ "version": "2.0.1",
1198
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
1199
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
1200
+ "dev": true,
1201
+ "requires": {
1202
+ "is-extendable": "0.1.1"
1203
+ }
1204
+ }
1205
+ }
1206
+ },
1207
+ "expand-range": {
1208
+ "version": "1.8.2",
1209
+ "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
1210
+ "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
1211
+ "dev": true,
1212
+ "requires": {
1213
+ "fill-range": "2.2.4"
1214
+ },
1215
+ "dependencies": {
1216
+ "fill-range": {
1217
+ "version": "2.2.4",
1218
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz",
1219
+ "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==",
1220
+ "dev": true,
1221
+ "requires": {
1222
+ "is-number": "2.1.0",
1223
+ "isobject": "2.1.0",
1224
+ "randomatic": "3.0.0",
1225
+ "repeat-element": "1.1.2",
1226
+ "repeat-string": "1.6.1"
1227
+ }
1228
+ },
1229
+ "is-number": {
1230
+ "version": "2.1.0",
1231
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz",
1232
+ "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=",
1233
+ "dev": true,
1234
+ "requires": {
1235
+ "kind-of": "3.2.2"
1236
+ }
1237
+ },
1238
+ "isarray": {
1239
+ "version": "1.0.0",
1240
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
1241
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
1242
+ "dev": true
1243
+ },
1244
+ "isobject": {
1245
+ "version": "2.1.0",
1246
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
1247
+ "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
1248
+ "dev": true,
1249
+ "requires": {
1250
+ "isarray": "1.0.0"
1251
+ }
1252
+ },
1253
+ "kind-of": {
1254
+ "version": "3.2.2",
1255
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
1256
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
1257
+ "dev": true,
1258
+ "requires": {
1259
+ "is-buffer": "1.1.6"
1260
+ }
1261
+ }
1262
+ }
1263
+ },
1264
+ "expand-tilde": {
1265
+ "version": "2.0.2",
1266
+ "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
1267
+ "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=",
1268
+ "dev": true,
1269
+ "requires": {
1270
+ "homedir-polyfill": "1.0.1"
1271
+ }
1272
+ },
1273
+ "extend": {
1274
+ "version": "3.0.1",
1275
+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
1276
+ "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=",
1277
+ "dev": true
1278
+ },
1279
+ "extend-shallow": {
1280
+ "version": "3.0.2",
1281
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
1282
+ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
1283
+ "dev": true,
1284
+ "requires": {
1285
+ "assign-symbols": "1.0.0",
1286
+ "is-extendable": "1.0.1"
1287
+ },
1288
+ "dependencies": {
1289
+ "is-extendable": {
1290
+ "version": "1.0.1",
1291
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
1292
+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
1293
+ "dev": true,
1294
+ "requires": {
1295
+ "is-plain-object": "2.0.4"
1296
+ }
1297
+ }
1298
+ }
1299
+ },
1300
+ "extglob": {
1301
+ "version": "2.0.4",
1302
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
1303
+ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
1304
+ "dev": true,
1305
+ "requires": {
1306
+ "array-unique": "0.3.2",
1307
+ "define-property": "1.0.0",
1308
+ "expand-brackets": "2.1.4",
1309
+ "extend-shallow": "2.0.1",
1310
+ "fragment-cache": "0.2.1",
1311
+ "regex-not": "1.0.2",
1312
+ "snapdragon": "0.8.2",
1313
+ "to-regex": "3.0.2"
1314
+ },
1315
+ "dependencies": {
1316
+ "define-property": {
1317
+ "version": "1.0.0",
1318
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
1319
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
1320
+ "dev": true,
1321
+ "requires": {
1322
+ "is-descriptor": "1.0.2"
1323
+ }
1324
+ },
1325
+ "extend-shallow": {
1326
+ "version": "2.0.1",
1327
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
1328
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
1329
+ "dev": true,
1330
+ "requires": {
1331
+ "is-extendable": "0.1.1"
1332
+ }
1333
+ },
1334
+ "is-accessor-descriptor": {
1335
+ "version": "1.0.0",
1336
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
1337
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
1338
+ "dev": true,
1339
+ "requires": {
1340
+ "kind-of": "6.0.2"
1341
+ }
1342
+ },
1343
+ "is-data-descriptor": {
1344
+ "version": "1.0.0",
1345
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
1346
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
1347
+ "dev": true,
1348
+ "requires": {
1349
+ "kind-of": "6.0.2"
1350
+ }
1351
+ },
1352
+ "is-descriptor": {
1353
+ "version": "1.0.2",
1354
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
1355
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
1356
+ "dev": true,
1357
+ "requires": {
1358
+ "is-accessor-descriptor": "1.0.0",
1359
+ "is-data-descriptor": "1.0.0",
1360
+ "kind-of": "6.0.2"
1361
+ }
1362
+ }
1363
+ }
1364
+ },
1365
+ "extsprintf": {
1366
+ "version": "1.3.0",
1367
+ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
1368
+ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
1369
+ "dev": true
1370
+ },
1371
+ "fancy-log": {
1372
+ "version": "1.3.2",
1373
+ "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz",
1374
+ "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=",
1375
+ "dev": true,
1376
+ "requires": {
1377
+ "ansi-gray": "0.1.1",
1378
+ "color-support": "1.1.3",
1379
+ "time-stamp": "1.1.0"
1380
+ }
1381
+ },
1382
+ "faye-websocket": {
1383
+ "version": "0.7.3",
1384
+ "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.3.tgz",
1385
+ "integrity": "sha1-zEB0x/Sk39A69U3WXDVLE1EyzhE=",
1386
+ "dev": true,
1387
+ "requires": {
1388
+ "websocket-driver": "0.7.0"
1389
+ }
1390
+ },
1391
+ "filename-regex": {
1392
+ "version": "2.0.1",
1393
+ "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz",
1394
+ "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=",
1395
+ "dev": true
1396
+ },
1397
+ "fill-range": {
1398
+ "version": "4.0.0",
1399
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
1400
+ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
1401
+ "dev": true,
1402
+ "requires": {
1403
+ "extend-shallow": "2.0.1",
1404
+ "is-number": "3.0.0",
1405
+ "repeat-string": "1.6.1",
1406
+ "to-regex-range": "2.1.1"
1407
+ },
1408
+ "dependencies": {
1409
+ "extend-shallow": {
1410
+ "version": "2.0.1",
1411
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
1412
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
1413
+ "dev": true,
1414
+ "requires": {
1415
+ "is-extendable": "0.1.1"
1416
+ }
1417
+ }
1418
+ }
1419
+ },
1420
+ "find-index": {
1421
+ "version": "0.1.1",
1422
+ "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz",
1423
+ "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=",
1424
+ "dev": true
1425
+ },
1426
+ "find-up": {
1427
+ "version": "1.1.2",
1428
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
1429
+ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
1430
+ "dev": true,
1431
+ "requires": {
1432
+ "path-exists": "2.1.0",
1433
+ "pinkie-promise": "2.0.1"
1434
+ },
1435
+ "dependencies": {
1436
+ "path-exists": {
1437
+ "version": "2.1.0",
1438
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
1439
+ "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
1440
+ "dev": true,
1441
+ "requires": {
1442
+ "pinkie-promise": "2.0.1"
1443
+ }
1444
+ }
1445
+ }
1446
+ },
1447
+ "findup-sync": {
1448
+ "version": "2.0.0",
1449
+ "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz",
1450
+ "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=",
1451
+ "dev": true,
1452
+ "requires": {
1453
+ "detect-file": "1.0.0",
1454
+ "is-glob": "3.1.0",
1455
+ "micromatch": "3.1.10",
1456
+ "resolve-dir": "1.0.1"
1457
+ }
1458
+ },
1459
+ "fined": {
1460
+ "version": "1.1.0",
1461
+ "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz",
1462
+ "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=",
1463
+ "dev": true,
1464
+ "requires": {
1465
+ "expand-tilde": "2.0.2",
1466
+ "is-plain-object": "2.0.4",
1467
+ "object.defaults": "1.1.0",
1468
+ "object.pick": "1.3.0",
1469
+ "parse-filepath": "1.0.2"
1470
+ }
1471
+ },
1472
+ "first-chunk-stream": {
1473
+ "version": "1.0.0",
1474
+ "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz",
1475
+ "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=",
1476
+ "dev": true
1477
+ },
1478
+ "flagged-respawn": {
1479
+ "version": "1.0.0",
1480
+ "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.0.tgz",
1481
+ "integrity": "sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c=",
1482
+ "dev": true
1483
+ },
1484
+ "for-in": {
1485
+ "version": "1.0.2",
1486
+ "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
1487
+ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=",
1488
+ "dev": true
1489
+ },
1490
+ "for-own": {
1491
+ "version": "1.0.0",
1492
+ "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
1493
+ "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=",
1494
+ "dev": true,
1495
+ "requires": {
1496
+ "for-in": "1.0.2"
1497
+ }
1498
+ },
1499
+ "forever-agent": {
1500
+ "version": "0.6.1",
1501
+ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
1502
+ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
1503
+ "dev": true
1504
+ },
1505
+ "form-data": {
1506
+ "version": "2.1.4",
1507
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz",
1508
+ "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=",
1509
+ "dev": true,
1510
+ "requires": {
1511
+ "asynckit": "0.4.0",
1512
+ "combined-stream": "1.0.6",
1513
+ "mime-types": "2.1.18"
1514
+ }
1515
+ },
1516
+ "fragment-cache": {
1517
+ "version": "0.2.1",
1518
+ "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
1519
+ "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=",
1520
+ "dev": true,
1521
+ "requires": {
1522
+ "map-cache": "0.2.2"
1523
+ }
1524
+ },
1525
+ "from": {
1526
+ "version": "0.1.7",
1527
+ "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz",
1528
+ "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=",
1529
+ "dev": true
1530
+ },
1531
+ "fs-exists-sync": {
1532
+ "version": "0.1.0",
1533
+ "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz",
1534
+ "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=",
1535
+ "dev": true
1536
+ },
1537
+ "fs.realpath": {
1538
+ "version": "1.0.0",
1539
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
1540
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
1541
+ "dev": true
1542
+ },
1543
+ "fstream": {
1544
+ "version": "1.0.11",
1545
+ "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
1546
+ "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=",
1547
+ "dev": true,
1548
+ "requires": {
1549
+ "graceful-fs": "4.1.11",
1550
+ "inherits": "2.0.3",
1551
+ "mkdirp": "0.5.1",
1552
+ "rimraf": "2.6.2"
1553
+ },
1554
+ "dependencies": {
1555
+ "graceful-fs": {
1556
+ "version": "4.1.11",
1557
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
1558
+ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
1559
+ "dev": true
1560
+ }
1561
+ }
1562
+ },
1563
+ "gauge": {
1564
+ "version": "2.7.4",
1565
+ "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
1566
+ "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
1567
+ "dev": true,
1568
+ "requires": {
1569
+ "aproba": "1.2.0",
1570
+ "console-control-strings": "1.1.0",
1571
+ "has-unicode": "2.0.1",
1572
+ "object-assign": "4.1.1",
1573
+ "signal-exit": "3.0.2",
1574
+ "string-width": "1.0.2",
1575
+ "strip-ansi": "3.0.1",
1576
+ "wide-align": "1.1.2"
1577
+ }
1578
+ },
1579
+ "gaze": {
1580
+ "version": "0.5.2",
1581
+ "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz",
1582
+ "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=",
1583
+ "dev": true,
1584
+ "requires": {
1585
+ "globule": "0.1.0"
1586
+ }
1587
+ },
1588
+ "generate-function": {
1589
+ "version": "2.0.0",
1590
+ "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz",
1591
+ "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=",
1592
+ "dev": true
1593
+ },
1594
+ "generate-object-property": {
1595
+ "version": "1.2.0",
1596
+ "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
1597
+ "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=",
1598
+ "dev": true,
1599
+ "requires": {
1600
+ "is-property": "1.0.2"
1601
+ }
1602
+ },
1603
+ "get-caller-file": {
1604
+ "version": "1.0.2",
1605
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz",
1606
+ "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=",
1607
+ "dev": true
1608
+ },
1609
+ "get-stdin": {
1610
+ "version": "4.0.1",
1611
+ "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
1612
+ "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",
1613
+ "dev": true
1614
+ },
1615
+ "get-value": {
1616
+ "version": "2.0.6",
1617
+ "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
1618
+ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=",
1619
+ "dev": true
1620
+ },
1621
+ "getpass": {
1622
+ "version": "0.1.7",
1623
+ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
1624
+ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
1625
+ "dev": true,
1626
+ "requires": {
1627
+ "assert-plus": "1.0.0"
1628
+ },
1629
+ "dependencies": {
1630
+ "assert-plus": {
1631
+ "version": "1.0.0",
1632
+ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
1633
+ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
1634
+ "dev": true
1635
+ }
1636
+ }
1637
+ },
1638
+ "glob": {
1639
+ "version": "7.1.2",
1640
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
1641
+ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
1642
+ "dev": true,
1643
+ "requires": {
1644
+ "fs.realpath": "1.0.0",
1645
+ "inflight": "1.0.6",
1646
+ "inherits": "2.0.3",
1647
+ "minimatch": "3.0.4",
1648
+ "once": "1.4.0",
1649
+ "path-is-absolute": "1.0.1"
1650
+ }
1651
+ },
1652
+ "glob-base": {
1653
+ "version": "0.3.0",
1654
+ "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz",
1655
+ "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=",
1656
+ "dev": true,
1657
+ "requires": {
1658
+ "glob-parent": "2.0.0",
1659
+ "is-glob": "2.0.1"
1660
+ },
1661
+ "dependencies": {
1662
+ "is-extglob": {
1663
+ "version": "1.0.0",
1664
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
1665
+ "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
1666
+ "dev": true
1667
+ },
1668
+ "is-glob": {
1669
+ "version": "2.0.1",
1670
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
1671
+ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
1672
+ "dev": true,
1673
+ "requires": {
1674
+ "is-extglob": "1.0.0"
1675
+ }
1676
+ }
1677
+ }
1678
+ },
1679
+ "glob-parent": {
1680
+ "version": "2.0.0",
1681
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
1682
+ "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
1683
+ "dev": true,
1684
+ "requires": {
1685
+ "is-glob": "2.0.1"
1686
+ },
1687
+ "dependencies": {
1688
+ "is-extglob": {
1689
+ "version": "1.0.0",
1690
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
1691
+ "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
1692
+ "dev": true
1693
+ },
1694
+ "is-glob": {
1695
+ "version": "2.0.1",
1696
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
1697
+ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
1698
+ "dev": true,
1699
+ "requires": {
1700
+ "is-extglob": "1.0.0"
1701
+ }
1702
+ }
1703
+ }
1704
+ },
1705
+ "glob-stream": {
1706
+ "version": "3.1.18",
1707
+ "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz",
1708
+ "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=",
1709
+ "dev": true,
1710
+ "requires": {
1711
+ "glob": "4.5.3",
1712
+ "glob2base": "0.0.12",
1713
+ "minimatch": "2.0.10",
1714
+ "ordered-read-streams": "0.1.0",
1715
+ "through2": "0.6.5",
1716
+ "unique-stream": "1.0.0"
1717
+ },
1718
+ "dependencies": {
1719
+ "glob": {
1720
+ "version": "4.5.3",
1721
+ "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz",
1722
+ "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=",
1723
+ "dev": true,
1724
+ "requires": {
1725
+ "inflight": "1.0.6",
1726
+ "inherits": "2.0.3",
1727
+ "minimatch": "2.0.10",
1728
+ "once": "1.4.0"
1729
+ }
1730
+ },
1731
+ "minimatch": {
1732
+ "version": "2.0.10",
1733
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz",
1734
+ "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=",
1735
+ "dev": true,
1736
+ "requires": {
1737
+ "brace-expansion": "1.1.11"
1738
+ }
1739
+ },
1740
+ "readable-stream": {
1741
+ "version": "1.0.34",
1742
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
1743
+ "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
1744
+ "dev": true,
1745
+ "requires": {
1746
+ "core-util-is": "1.0.2",
1747
+ "inherits": "2.0.3",
1748
+ "isarray": "0.0.1",
1749
+ "string_decoder": "0.10.31"
1750
+ }
1751
+ },
1752
+ "through2": {
1753
+ "version": "0.6.5",
1754
+ "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz",
1755
+ "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=",
1756
+ "dev": true,
1757
+ "requires": {
1758
+ "readable-stream": "1.0.34",
1759
+ "xtend": "4.0.1"
1760
+ }
1761
+ }
1762
+ }
1763
+ },
1764
+ "glob-watcher": {
1765
+ "version": "0.0.6",
1766
+ "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz",
1767
+ "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=",
1768
+ "dev": true,
1769
+ "requires": {
1770
+ "gaze": "0.5.2"
1771
+ }
1772
+ },
1773
+ "glob2base": {
1774
+ "version": "0.0.12",
1775
+ "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz",
1776
+ "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=",
1777
+ "dev": true,
1778
+ "requires": {
1779
+ "find-index": "0.1.1"
1780
+ }
1781
+ },
1782
+ "global-modules": {
1783
+ "version": "1.0.0",
1784
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
1785
+ "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
1786
+ "dev": true,
1787
+ "requires": {
1788
+ "global-prefix": "1.0.2",
1789
+ "is-windows": "1.0.2",
1790
+ "resolve-dir": "1.0.1"
1791
+ }
1792
+ },
1793
+ "global-prefix": {
1794
+ "version": "1.0.2",
1795
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
1796
+ "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=",
1797
+ "dev": true,
1798
+ "requires": {
1799
+ "expand-tilde": "2.0.2",
1800
+ "homedir-polyfill": "1.0.1",
1801
+ "ini": "1.3.5",
1802
+ "is-windows": "1.0.2",
1803
+ "which": "1.3.0"
1804
+ }
1805
+ },
1806
+ "globby": {
1807
+ "version": "6.1.0",
1808
+ "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
1809
+ "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
1810
+ "dev": true,
1811
+ "requires": {
1812
+ "array-union": "1.0.2",
1813
+ "glob": "7.1.2",
1814
+ "object-assign": "4.1.1",
1815
+ "pify": "2.3.0",
1816
+ "pinkie-promise": "2.0.1"
1817
+ },
1818
+ "dependencies": {
1819
+ "pify": {
1820
+ "version": "2.3.0",
1821
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
1822
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
1823
+ "dev": true
1824
+ }
1825
+ }
1826
+ },
1827
+ "globule": {
1828
+ "version": "0.1.0",
1829
+ "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz",
1830
+ "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=",
1831
+ "dev": true,
1832
+ "requires": {
1833
+ "glob": "3.1.21",
1834
+ "lodash": "1.0.2",
1835
+ "minimatch": "0.2.14"
1836
+ },
1837
+ "dependencies": {
1838
+ "glob": {
1839
+ "version": "3.1.21",
1840
+ "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz",
1841
+ "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=",
1842
+ "dev": true,
1843
+ "requires": {
1844
+ "graceful-fs": "1.2.3",
1845
+ "inherits": "1.0.2",
1846
+ "minimatch": "0.2.14"
1847
+ }
1848
+ },
1849
+ "graceful-fs": {
1850
+ "version": "1.2.3",
1851
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz",
1852
+ "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=",
1853
+ "dev": true
1854
+ },
1855
+ "inherits": {
1856
+ "version": "1.0.2",
1857
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz",
1858
+ "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=",
1859
+ "dev": true
1860
+ },
1861
+ "minimatch": {
1862
+ "version": "0.2.14",
1863
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
1864
+ "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=",
1865
+ "dev": true,
1866
+ "requires": {
1867
+ "lru-cache": "2.7.3",
1868
+ "sigmund": "1.0.1"
1869
+ }
1870
+ }
1871
+ }
1872
+ },
1873
+ "glogg": {
1874
+ "version": "1.0.1",
1875
+ "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz",
1876
+ "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==",
1877
+ "dev": true,
1878
+ "requires": {
1879
+ "sparkles": "1.0.1"
1880
+ }
1881
+ },
1882
+ "graceful-fs": {
1883
+ "version": "3.0.11",
1884
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz",
1885
+ "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=",
1886
+ "dev": true,
1887
+ "requires": {
1888
+ "natives": "1.1.3"
1889
+ }
1890
+ },
1891
+ "growly": {
1892
+ "version": "1.3.0",
1893
+ "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz",
1894
+ "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=",
1895
+ "dev": true
1896
+ },
1897
+ "gulp": {
1898
+ "version": "3.9.1",
1899
+ "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz",
1900
+ "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=",
1901
+ "dev": true,
1902
+ "requires": {
1903
+ "archy": "1.0.0",
1904
+ "chalk": "1.1.3",
1905
+ "deprecated": "0.0.1",
1906
+ "gulp-util": "3.0.8",
1907
+ "interpret": "1.1.0",
1908
+ "liftoff": "2.5.0",
1909
+ "minimist": "1.2.0",
1910
+ "orchestrator": "0.3.8",
1911
+ "pretty-hrtime": "1.0.3",
1912
+ "semver": "4.3.6",
1913
+ "tildify": "1.2.0",
1914
+ "v8flags": "2.1.1",
1915
+ "vinyl-fs": "0.3.14"
1916
+ }
1917
+ },
1918
+ "gulp-autoprefixer": {
1919
+ "version": "5.0.0",
1920
+ "resolved": "https://registry.npmjs.org/gulp-autoprefixer/-/gulp-autoprefixer-5.0.0.tgz",
1921
+ "integrity": "sha1-gjfCeKaXdScKHK/n1vEBz81YVUQ=",
1922
+ "dev": true,
1923
+ "requires": {
1924
+ "autoprefixer": "8.5.0",
1925
+ "fancy-log": "1.3.2",
1926
+ "plugin-error": "1.0.1",
1927
+ "postcss": "6.0.22",
1928
+ "through2": "2.0.3",
1929
+ "vinyl-sourcemaps-apply": "0.2.1"
1930
+ }
1931
+ },
1932
+ "gulp-cache": {
1933
+ "version": "1.0.2",
1934
+ "resolved": "https://registry.npmjs.org/gulp-cache/-/gulp-cache-1.0.2.tgz",
1935
+ "integrity": "sha512-SFtWmWYARVzbzb6UiRZhZxpGo9oyXCOuXdTa0ML8CWQdFRTYZCfddn/grXG6SzdiY/D4rOnqpDJ8R2Trv0SQRQ==",
1936
+ "dev": true,
1937
+ "requires": {
1938
+ "babel-runtime": "6.26.0",
1939
+ "cache-swap": "0.3.0",
1940
+ "object.pick": "1.3.0",
1941
+ "plugin-error": "0.1.2",
1942
+ "through2": "2.0.3",
1943
+ "vinyl": "2.1.0"
1944
+ },
1945
+ "dependencies": {
1946
+ "arr-diff": {
1947
+ "version": "1.1.0",
1948
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz",
1949
+ "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=",
1950
+ "dev": true,
1951
+ "requires": {
1952
+ "arr-flatten": "1.1.0",
1953
+ "array-slice": "0.2.3"
1954
+ }
1955
+ },
1956
+ "arr-union": {
1957
+ "version": "2.1.0",
1958
+ "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz",
1959
+ "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=",
1960
+ "dev": true
1961
+ },
1962
+ "array-slice": {
1963
+ "version": "0.2.3",
1964
+ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz",
1965
+ "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=",
1966
+ "dev": true
1967
+ },
1968
+ "clone": {
1969
+ "version": "2.1.1",
1970
+ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz",
1971
+ "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=",
1972
+ "dev": true
1973
+ },
1974
+ "clone-stats": {
1975
+ "version": "1.0.0",
1976
+ "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz",
1977
+ "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=",
1978
+ "dev": true
1979
+ },
1980
+ "extend-shallow": {
1981
+ "version": "1.1.4",
1982
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz",
1983
+ "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=",
1984
+ "dev": true,
1985
+ "requires": {
1986
+ "kind-of": "1.1.0"
1987
+ }
1988
+ },
1989
+ "kind-of": {
1990
+ "version": "1.1.0",
1991
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
1992
+ "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=",
1993
+ "dev": true
1994
+ },
1995
+ "plugin-error": {
1996
+ "version": "0.1.2",
1997
+ "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz",
1998
+ "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=",
1999
+ "dev": true,
2000
+ "requires": {
2001
+ "ansi-cyan": "0.1.1",
2002
+ "ansi-red": "0.1.1",
2003
+ "arr-diff": "1.1.0",
2004
+ "arr-union": "2.1.0",
2005
+ "extend-shallow": "1.1.4"
2006
+ }
2007
+ },
2008
+ "replace-ext": {
2009
+ "version": "1.0.0",
2010
+ "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
2011
+ "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=",
2012
+ "dev": true
2013
+ },
2014
+ "vinyl": {
2015
+ "version": "2.1.0",
2016
+ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz",
2017
+ "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=",
2018
+ "dev": true,
2019
+ "requires": {
2020
+ "clone": "2.1.1",
2021
+ "clone-buffer": "1.0.0",
2022
+ "clone-stats": "1.0.0",
2023
+ "cloneable-readable": "1.1.2",
2024
+ "remove-trailing-separator": "1.1.0",
2025
+ "replace-ext": "1.0.0"
2026
+ }
2027
+ }
2028
+ }
2029
+ },
2030
+ "gulp-clean-css": {
2031
+ "version": "3.9.4",
2032
+ "resolved": "https://registry.npmjs.org/gulp-clean-css/-/gulp-clean-css-3.9.4.tgz",
2033
+ "integrity": "sha512-jsbAj65WM08H1jCFOKpIvA1OlACk7OHS2FFTeeBZrSJ5OR1PJzAqi0I2R2LTWYN3oMd/N1JYN9cN2IS/8eYqdg==",
2034
+ "dev": true,
2035
+ "requires": {
2036
+ "clean-css": "4.1.11",
2037
+ "plugin-error": "1.0.1",
2038
+ "through2": "2.0.3",
2039
+ "vinyl-sourcemaps-apply": "0.2.1"
2040
+ }
2041
+ },
2042
+ "gulp-concat": {
2043
+ "version": "2.6.1",
2044
+ "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz",
2045
+ "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=",
2046
+ "dev": true,
2047
+ "requires": {
2048
+ "concat-with-sourcemaps": "1.1.0",
2049
+ "through2": "2.0.3",
2050
+ "vinyl": "2.1.0"
2051
+ },
2052
+ "dependencies": {
2053
+ "clone": {
2054
+ "version": "2.1.1",
2055
+ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz",
2056
+ "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=",
2057
+ "dev": true
2058
+ },
2059
+ "clone-stats": {
2060
+ "version": "1.0.0",
2061
+ "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz",
2062
+ "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=",
2063
+ "dev": true
2064
+ },
2065
+ "replace-ext": {
2066
+ "version": "1.0.0",
2067
+ "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
2068
+ "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=",
2069
+ "dev": true
2070
+ },
2071
+ "vinyl": {
2072
+ "version": "2.1.0",
2073
+ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz",
2074
+ "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=",
2075
+ "dev": true,
2076
+ "requires": {
2077
+ "clone": "2.1.1",
2078
+ "clone-buffer": "1.0.0",
2079
+ "clone-stats": "1.0.0",
2080
+ "cloneable-readable": "1.1.2",
2081
+ "remove-trailing-separator": "1.1.0",
2082
+ "replace-ext": "1.0.0"
2083
+ }
2084
+ }
2085
+ }
2086
+ },
2087
+ "gulp-ignore": {
2088
+ "version": "2.0.2",
2089
+ "resolved": "https://registry.npmjs.org/gulp-ignore/-/gulp-ignore-2.0.2.tgz",
2090
+ "integrity": "sha1-XC6ioKRALgq0orzRLv2SlTRNePI=",
2091
+ "dev": true,
2092
+ "requires": {
2093
+ "gulp-match": "1.0.3",
2094
+ "through2": "2.0.3"
2095
+ }
2096
+ },
2097
+ "gulp-jshint": {
2098
+ "version": "2.1.0",
2099
+ "resolved": "https://registry.npmjs.org/gulp-jshint/-/gulp-jshint-2.1.0.tgz",
2100
+ "integrity": "sha512-sP3NK8Y/1e58O0PH9t6s7DAr/lKDSUbIY207oWSeufM6/VclB7jJrIBcPCsyhrFTCDUl9DauePbt6VqP2vPM5w==",
2101
+ "dev": true,
2102
+ "requires": {
2103
+ "lodash": "4.17.10",
2104
+ "minimatch": "3.0.4",
2105
+ "plugin-error": "0.1.2",
2106
+ "rcloader": "0.2.2",
2107
+ "through2": "2.0.3"
2108
+ },
2109
+ "dependencies": {
2110
+ "arr-diff": {
2111
+ "version": "1.1.0",
2112
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz",
2113
+ "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=",
2114
+ "dev": true,
2115
+ "requires": {
2116
+ "arr-flatten": "1.1.0",
2117
+ "array-slice": "0.2.3"
2118
+ }
2119
+ },
2120
+ "arr-union": {
2121
+ "version": "2.1.0",
2122
+ "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz",
2123
+ "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=",
2124
+ "dev": true
2125
+ },
2126
+ "array-slice": {
2127
+ "version": "0.2.3",
2128
+ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz",
2129
+ "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=",
2130
+ "dev": true
2131
+ },
2132
+ "extend-shallow": {
2133
+ "version": "1.1.4",
2134
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz",
2135
+ "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=",
2136
+ "dev": true,
2137
+ "requires": {
2138
+ "kind-of": "1.1.0"
2139
+ }
2140
+ },
2141
+ "kind-of": {
2142
+ "version": "1.1.0",
2143
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
2144
+ "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=",
2145
+ "dev": true
2146
+ },
2147
+ "lodash": {
2148
+ "version": "4.17.10",
2149
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
2150
+ "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
2151
+ "dev": true
2152
+ },
2153
+ "plugin-error": {
2154
+ "version": "0.1.2",
2155
+ "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz",
2156
+ "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=",
2157
+ "dev": true,
2158
+ "requires": {
2159
+ "ansi-cyan": "0.1.1",
2160
+ "ansi-red": "0.1.1",
2161
+ "arr-diff": "1.1.0",
2162
+ "arr-union": "2.1.0",
2163
+ "extend-shallow": "1.1.4"
2164
+ }
2165
+ }
2166
+ }
2167
+ },
2168
+ "gulp-livereload": {
2169
+ "version": "3.8.1",
2170
+ "resolved": "https://registry.npmjs.org/gulp-livereload/-/gulp-livereload-3.8.1.tgz",
2171
+ "integrity": "sha1-APdEstdJ0+njdGWJyKRKysd5tQ8=",
2172
+ "dev": true,
2173
+ "requires": {
2174
+ "chalk": "0.5.1",
2175
+ "debug": "2.6.9",
2176
+ "event-stream": "3.3.4",
2177
+ "gulp-util": "3.0.8",
2178
+ "lodash.assign": "3.2.0",
2179
+ "mini-lr": "0.1.9"
2180
+ },
2181
+ "dependencies": {
2182
+ "ansi-regex": {
2183
+ "version": "0.2.1",
2184
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz",
2185
+ "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=",
2186
+ "dev": true
2187
+ },
2188
+ "ansi-styles": {
2189
+ "version": "1.1.0",
2190
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz",
2191
+ "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=",
2192
+ "dev": true
2193
+ },
2194
+ "chalk": {
2195
+ "version": "0.5.1",
2196
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
2197
+ "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=",
2198
+ "dev": true,
2199
+ "requires": {
2200
+ "ansi-styles": "1.1.0",
2201
+ "escape-string-regexp": "1.0.5",
2202
+ "has-ansi": "0.1.0",
2203
+ "strip-ansi": "0.3.0",
2204
+ "supports-color": "0.2.0"
2205
+ }
2206
+ },
2207
+ "has-ansi": {
2208
+ "version": "0.1.0",
2209
+ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
2210
+ "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=",
2211
+ "dev": true,
2212
+ "requires": {
2213
+ "ansi-regex": "0.2.1"
2214
+ }
2215
+ },
2216
+ "lodash.assign": {
2217
+ "version": "3.2.0",
2218
+ "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz",
2219
+ "integrity": "sha1-POnwI0tLIiPilrj6CsH+6OvKZPo=",
2220
+ "dev": true,
2221
+ "requires": {
2222
+ "lodash._baseassign": "3.2.0",
2223
+ "lodash._createassigner": "3.1.1",
2224
+ "lodash.keys": "3.1.2"
2225
+ }
2226
+ },
2227
+ "strip-ansi": {
2228
+ "version": "0.3.0",
2229
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
2230
+ "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=",
2231
+ "dev": true,
2232
+ "requires": {
2233
+ "ansi-regex": "0.2.1"
2234
+ }
2235
+ },
2236
+ "supports-color": {
2237
+ "version": "0.2.0",
2238
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz",
2239
+ "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=",
2240
+ "dev": true
2241
+ }
2242
+ }
2243
+ },
2244
+ "gulp-load-plugins": {
2245
+ "version": "1.5.0",
2246
+ "resolved": "https://registry.npmjs.org/gulp-load-plugins/-/gulp-load-plugins-1.5.0.tgz",
2247
+ "integrity": "sha1-TEGffldk2aDjMGG6uWGPgbc9QXE=",
2248
+ "dev": true,
2249
+ "requires": {
2250
+ "array-unique": "0.2.1",
2251
+ "fancy-log": "1.3.2",
2252
+ "findup-sync": "0.4.3",
2253
+ "gulplog": "1.0.0",
2254
+ "has-gulplog": "0.1.0",
2255
+ "micromatch": "2.3.11",
2256
+ "resolve": "1.7.1"
2257
+ },
2258
+ "dependencies": {
2259
+ "arr-diff": {
2260
+ "version": "2.0.0",
2261
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
2262
+ "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
2263
+ "dev": true,
2264
+ "requires": {
2265
+ "arr-flatten": "1.1.0"
2266
+ }
2267
+ },
2268
+ "array-unique": {
2269
+ "version": "0.2.1",
2270
+ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
2271
+ "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
2272
+ "dev": true
2273
+ },
2274
+ "braces": {
2275
+ "version": "1.8.5",
2276
+ "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
2277
+ "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
2278
+ "dev": true,
2279
+ "requires": {
2280
+ "expand-range": "1.8.2",
2281
+ "preserve": "0.2.0",
2282
+ "repeat-element": "1.1.2"
2283
+ }
2284
+ },
2285
+ "detect-file": {
2286
+ "version": "0.1.0",
2287
+ "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz",
2288
+ "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=",
2289
+ "dev": true,
2290
+ "requires": {
2291
+ "fs-exists-sync": "0.1.0"
2292
+ }
2293
+ },
2294
+ "expand-brackets": {
2295
+ "version": "0.1.5",
2296
+ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
2297
+ "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
2298
+ "dev": true,
2299
+ "requires": {
2300
+ "is-posix-bracket": "0.1.1"
2301
+ }
2302
+ },
2303
+ "expand-tilde": {
2304
+ "version": "1.2.2",
2305
+ "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz",
2306
+ "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=",
2307
+ "dev": true,
2308
+ "requires": {
2309
+ "os-homedir": "1.0.2"
2310
+ }
2311
+ },
2312
+ "extglob": {
2313
+ "version": "0.3.2",
2314
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
2315
+ "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
2316
+ "dev": true,
2317
+ "requires": {
2318
+ "is-extglob": "1.0.0"
2319
+ }
2320
+ },
2321
+ "findup-sync": {
2322
+ "version": "0.4.3",
2323
+ "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.3.tgz",
2324
+ "integrity": "sha1-QAQ5Kee8YK3wt/SCfExudaDeyhI=",
2325
+ "dev": true,
2326
+ "requires": {
2327
+ "detect-file": "0.1.0",
2328
+ "is-glob": "2.0.1",
2329
+ "micromatch": "2.3.11",
2330
+ "resolve-dir": "0.1.1"
2331
+ }
2332
+ },
2333
+ "global-modules": {
2334
+ "version": "0.2.3",
2335
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz",
2336
+ "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=",
2337
+ "dev": true,
2338
+ "requires": {
2339
+ "global-prefix": "0.1.5",
2340
+ "is-windows": "0.2.0"
2341
+ }
2342
+ },
2343
+ "global-prefix": {
2344
+ "version": "0.1.5",
2345
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz",
2346
+ "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=",
2347
+ "dev": true,
2348
+ "requires": {
2349
+ "homedir-polyfill": "1.0.1",
2350
+ "ini": "1.3.5",
2351
+ "is-windows": "0.2.0",
2352
+ "which": "1.3.0"
2353
+ }
2354
+ },
2355
+ "is-extglob": {
2356
+ "version": "1.0.0",
2357
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
2358
+ "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
2359
+ "dev": true
2360
+ },
2361
+ "is-glob": {
2362
+ "version": "2.0.1",
2363
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
2364
+ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
2365
+ "dev": true,
2366
+ "requires": {
2367
+ "is-extglob": "1.0.0"
2368
+ }
2369
+ },
2370
+ "is-windows": {
2371
+ "version": "0.2.0",
2372
+ "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz",
2373
+ "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=",
2374
+ "dev": true
2375
+ },
2376
+ "kind-of": {
2377
+ "version": "3.2.2",
2378
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
2379
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
2380
+ "dev": true,
2381
+ "requires": {
2382
+ "is-buffer": "1.1.6"
2383
+ }
2384
+ },
2385
+ "micromatch": {
2386
+ "version": "2.3.11",
2387
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
2388
+ "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
2389
+ "dev": true,
2390
+ "requires": {
2391
+ "arr-diff": "2.0.0",
2392
+ "array-unique": "0.2.1",
2393
+ "braces": "1.8.5",
2394
+ "expand-brackets": "0.1.5",
2395
+ "extglob": "0.3.2",
2396
+ "filename-regex": "2.0.1",
2397
+ "is-extglob": "1.0.0",
2398
+ "is-glob": "2.0.1",
2399
+ "kind-of": "3.2.2",
2400
+ "normalize-path": "2.1.1",
2401
+ "object.omit": "2.0.1",
2402
+ "parse-glob": "3.0.4",
2403
+ "regex-cache": "0.4.4"
2404
+ }
2405
+ },
2406
+ "resolve-dir": {
2407
+ "version": "0.1.1",
2408
+ "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz",
2409
+ "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=",
2410
+ "dev": true,
2411
+ "requires": {
2412
+ "expand-tilde": "1.2.2",
2413
+ "global-modules": "0.2.3"
2414
+ }
2415
+ }
2416
+ }
2417
+ },
2418
+ "gulp-match": {
2419
+ "version": "1.0.3",
2420
+ "resolved": "https://registry.npmjs.org/gulp-match/-/gulp-match-1.0.3.tgz",
2421
+ "integrity": "sha1-kcfA1/Kb7NZgbVfYCn+Hdqh6uo4=",
2422
+ "dev": true,
2423
+ "requires": {
2424
+ "minimatch": "3.0.4"
2425
+ }
2426
+ },
2427
+ "gulp-notify": {
2428
+ "version": "3.2.0",
2429
+ "resolved": "https://registry.npmjs.org/gulp-notify/-/gulp-notify-3.2.0.tgz",
2430
+ "integrity": "sha512-qEocs1UVoDKKUjfsxJNMNwkRla0PbsyJwsqNNXpzYWsLQ29LhxRMY3wnTGZcc4hMHtalnvah/Dwlwb4NijH/0A==",
2431
+ "dev": true,
2432
+ "requires": {
2433
+ "ansi-colors": "1.1.0",
2434
+ "fancy-log": "1.3.2",
2435
+ "lodash.template": "4.4.0",
2436
+ "node-notifier": "5.2.1",
2437
+ "node.extend": "2.0.0",
2438
+ "plugin-error": "0.1.2",
2439
+ "through2": "2.0.3"
2440
+ },
2441
+ "dependencies": {
2442
+ "arr-diff": {
2443
+ "version": "1.1.0",
2444
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz",
2445
+ "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=",
2446
+ "dev": true,
2447
+ "requires": {
2448
+ "arr-flatten": "1.1.0",
2449
+ "array-slice": "0.2.3"
2450
+ }
2451
+ },
2452
+ "arr-union": {
2453
+ "version": "2.1.0",
2454
+ "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz",
2455
+ "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=",
2456
+ "dev": true
2457
+ },
2458
+ "array-slice": {
2459
+ "version": "0.2.3",
2460
+ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz",
2461
+ "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=",
2462
+ "dev": true
2463
+ },
2464
+ "extend-shallow": {
2465
+ "version": "1.1.4",
2466
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz",
2467
+ "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=",
2468
+ "dev": true,
2469
+ "requires": {
2470
+ "kind-of": "1.1.0"
2471
+ }
2472
+ },
2473
+ "kind-of": {
2474
+ "version": "1.1.0",
2475
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
2476
+ "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=",
2477
+ "dev": true
2478
+ },
2479
+ "lodash.template": {
2480
+ "version": "4.4.0",
2481
+ "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz",
2482
+ "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=",
2483
+ "dev": true,
2484
+ "requires": {
2485
+ "lodash._reinterpolate": "3.0.0",
2486
+ "lodash.templatesettings": "4.1.0"
2487
+ }
2488
+ },
2489
+ "lodash.templatesettings": {
2490
+ "version": "4.1.0",
2491
+ "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz",
2492
+ "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=",
2493
+ "dev": true,
2494
+ "requires": {
2495
+ "lodash._reinterpolate": "3.0.0"
2496
+ }
2497
+ },
2498
+ "plugin-error": {
2499
+ "version": "0.1.2",
2500
+ "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz",
2501
+ "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=",
2502
+ "dev": true,
2503
+ "requires": {
2504
+ "ansi-cyan": "0.1.1",
2505
+ "ansi-red": "0.1.1",
2506
+ "arr-diff": "1.1.0",
2507
+ "arr-union": "2.1.0",
2508
+ "extend-shallow": "1.1.4"
2509
+ }
2510
+ }
2511
+ }
2512
+ },
2513
+ "gulp-rename": {
2514
+ "version": "1.2.3",
2515
+ "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.3.tgz",
2516
+ "integrity": "sha512-CmdPM0BjJ105QCX1fk+j7NGhiN/1rCl9HLGss+KllBS/tdYadpjTxqdKyh/5fNV+M3yjT1MFz5z93bXdrTyzAw==",
2517
+ "dev": true
2518
+ },
2519
+ "gulp-ruby-sass": {
2520
+ "version": "3.0.0",
2521
+ "resolved": "https://registry.npmjs.org/gulp-ruby-sass/-/gulp-ruby-sass-3.0.0.tgz",
2522
+ "integrity": "sha1-CuG5LlcjJchBLBeohwtmGUEra40=",
2523
+ "dev": true,
2524
+ "requires": {
2525
+ "chalk": "2.4.1",
2526
+ "convert-source-map": "1.5.1",
2527
+ "cross-spawn": "5.1.0",
2528
+ "dargs": "3.0.1",
2529
+ "each-async": "1.1.1",
2530
+ "escape-string-regexp": "1.0.5",
2531
+ "fancy-log": "1.3.2",
2532
+ "glob": "7.1.2",
2533
+ "glob2base": "0.0.12",
2534
+ "md5-hex": "2.0.0",
2535
+ "path-exists": "3.0.0",
2536
+ "plugin-error": "0.1.2",
2537
+ "replace-ext": "1.0.0",
2538
+ "rimraf": "2.6.2",
2539
+ "vinyl": "2.1.0"
2540
+ },
2541
+ "dependencies": {
2542
+ "ansi-styles": {
2543
+ "version": "3.2.1",
2544
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
2545
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
2546
+ "dev": true,
2547
+ "requires": {
2548
+ "color-convert": "1.9.1"
2549
+ }
2550
+ },
2551
+ "arr-diff": {
2552
+ "version": "1.1.0",
2553
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz",
2554
+ "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=",
2555
+ "dev": true,
2556
+ "requires": {
2557
+ "arr-flatten": "1.1.0",
2558
+ "array-slice": "0.2.3"
2559
+ }
2560
+ },
2561
+ "arr-union": {
2562
+ "version": "2.1.0",
2563
+ "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz",
2564
+ "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=",
2565
+ "dev": true
2566
+ },
2567
+ "array-slice": {
2568
+ "version": "0.2.3",
2569
+ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz",
2570
+ "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=",
2571
+ "dev": true
2572
+ },
2573
+ "chalk": {
2574
+ "version": "2.4.1",
2575
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
2576
+ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
2577
+ "dev": true,
2578
+ "requires": {
2579
+ "ansi-styles": "3.2.1",
2580
+ "escape-string-regexp": "1.0.5",
2581
+ "supports-color": "5.4.0"
2582
+ }
2583
+ },
2584
+ "clone": {
2585
+ "version": "2.1.1",
2586
+ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz",
2587
+ "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=",
2588
+ "dev": true
2589
+ },
2590
+ "clone-stats": {
2591
+ "version": "1.0.0",
2592
+ "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz",
2593
+ "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=",
2594
+ "dev": true
2595
+ },
2596
+ "extend-shallow": {
2597
+ "version": "1.1.4",
2598
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz",
2599
+ "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=",
2600
+ "dev": true,
2601
+ "requires": {
2602
+ "kind-of": "1.1.0"
2603
+ }
2604
+ },
2605
+ "kind-of": {
2606
+ "version": "1.1.0",
2607
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
2608
+ "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=",
2609
+ "dev": true
2610
+ },
2611
+ "plugin-error": {
2612
+ "version": "0.1.2",
2613
+ "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz",
2614
+ "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=",
2615
+ "dev": true,
2616
+ "requires": {
2617
+ "ansi-cyan": "0.1.1",
2618
+ "ansi-red": "0.1.1",
2619
+ "arr-diff": "1.1.0",
2620
+ "arr-union": "2.1.0",
2621
+ "extend-shallow": "1.1.4"
2622
+ }
2623
+ },
2624
+ "replace-ext": {
2625
+ "version": "1.0.0",
2626
+ "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
2627
+ "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=",
2628
+ "dev": true
2629
+ },
2630
+ "supports-color": {
2631
+ "version": "5.4.0",
2632
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
2633
+ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
2634
+ "dev": true,
2635
+ "requires": {
2636
+ "has-flag": "3.0.0"
2637
+ }
2638
+ },
2639
+ "vinyl": {
2640
+ "version": "2.1.0",
2641
+ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz",
2642
+ "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=",
2643
+ "dev": true,
2644
+ "requires": {
2645
+ "clone": "2.1.1",
2646
+ "clone-buffer": "1.0.0",
2647
+ "clone-stats": "1.0.0",
2648
+ "cloneable-readable": "1.1.2",
2649
+ "remove-trailing-separator": "1.1.0",
2650
+ "replace-ext": "1.0.0"
2651
+ }
2652
+ }
2653
+ }
2654
+ },
2655
+ "gulp-sass": {
2656
+ "version": "4.0.1",
2657
+ "resolved": "https://registry.npmjs.org/gulp-sass/-/gulp-sass-4.0.1.tgz",
2658
+ "integrity": "sha512-OMQEgWNggpog8Tc5v1MuI6eo+5iiPkVeLL76iBhDoEEScLUPfZlpvzmgTnLkpcqdrNodZxpz5qcv6mS2rulk3g==",
2659
+ "dev": true,
2660
+ "requires": {
2661
+ "chalk": "2.4.1",
2662
+ "lodash.clonedeep": "4.5.0",
2663
+ "node-sass": "4.9.0",
2664
+ "plugin-error": "1.0.1",
2665
+ "replace-ext": "1.0.0",
2666
+ "strip-ansi": "4.0.0",
2667
+ "through2": "2.0.3",
2668
+ "vinyl-sourcemaps-apply": "0.2.1"
2669
+ },
2670
+ "dependencies": {
2671
+ "ansi-regex": {
2672
+ "version": "3.0.0",
2673
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
2674
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
2675
+ "dev": true
2676
+ },
2677
+ "ansi-styles": {
2678
+ "version": "3.2.1",
2679
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
2680
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
2681
+ "dev": true,
2682
+ "requires": {
2683
+ "color-convert": "1.9.1"
2684
+ }
2685
+ },
2686
+ "chalk": {
2687
+ "version": "2.4.1",
2688
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
2689
+ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
2690
+ "dev": true,
2691
+ "requires": {
2692
+ "ansi-styles": "3.2.1",
2693
+ "escape-string-regexp": "1.0.5",
2694
+ "supports-color": "5.4.0"
2695
+ }
2696
+ },
2697
+ "replace-ext": {
2698
+ "version": "1.0.0",
2699
+ "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
2700
+ "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=",
2701
+ "dev": true
2702
+ },
2703
+ "strip-ansi": {
2704
+ "version": "4.0.0",
2705
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
2706
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
2707
+ "dev": true,
2708
+ "requires": {
2709
+ "ansi-regex": "3.0.0"
2710
+ }
2711
+ },
2712
+ "supports-color": {
2713
+ "version": "5.4.0",
2714
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
2715
+ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
2716
+ "dev": true,
2717
+ "requires": {
2718
+ "has-flag": "3.0.0"
2719
+ }
2720
+ }
2721
+ }
2722
+ },
2723
+ "gulp-sort": {
2724
+ "version": "2.0.0",
2725
+ "resolved": "https://registry.npmjs.org/gulp-sort/-/gulp-sort-2.0.0.tgz",
2726
+ "integrity": "sha1-xnYqLx8N4KP8WVohWZ0/rI26Gso=",
2727
+ "dev": true,
2728
+ "requires": {
2729
+ "through2": "2.0.3"
2730
+ }
2731
+ },
2732
+ "gulp-uglify": {
2733
+ "version": "3.0.0",
2734
+ "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-3.0.0.tgz",
2735
+ "integrity": "sha1-DfAzHXKg0wLj434QlIXd3zPG0co=",
2736
+ "dev": true,
2737
+ "requires": {
2738
+ "gulplog": "1.0.0",
2739
+ "has-gulplog": "0.1.0",
2740
+ "lodash": "4.17.10",
2741
+ "make-error-cause": "1.2.2",
2742
+ "through2": "2.0.3",
2743
+ "uglify-js": "3.3.25",
2744
+ "vinyl-sourcemaps-apply": "0.2.1"
2745
+ },
2746
+ "dependencies": {
2747
+ "lodash": {
2748
+ "version": "4.17.10",
2749
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
2750
+ "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
2751
+ "dev": true
2752
+ }
2753
+ }
2754
+ },
2755
+ "gulp-util": {
2756
+ "version": "3.0.8",
2757
+ "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz",
2758
+ "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=",
2759
+ "dev": true,
2760
+ "requires": {
2761
+ "array-differ": "1.0.0",
2762
+ "array-uniq": "1.0.3",
2763
+ "beeper": "1.1.1",
2764
+ "chalk": "1.1.3",
2765
+ "dateformat": "2.2.0",
2766
+ "fancy-log": "1.3.2",
2767
+ "gulplog": "1.0.0",
2768
+ "has-gulplog": "0.1.0",
2769
+ "lodash._reescape": "3.0.0",
2770
+ "lodash._reevaluate": "3.0.0",
2771
+ "lodash._reinterpolate": "3.0.0",
2772
+ "lodash.template": "3.6.2",
2773
+ "minimist": "1.2.0",
2774
+ "multipipe": "0.1.2",
2775
+ "object-assign": "3.0.0",
2776
+ "replace-ext": "0.0.1",
2777
+ "through2": "2.0.3",
2778
+ "vinyl": "0.5.3"
2779
+ },
2780
+ "dependencies": {
2781
+ "object-assign": {
2782
+ "version": "3.0.0",
2783
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz",
2784
+ "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=",
2785
+ "dev": true
2786
+ }
2787
+ }
2788
+ },
2789
+ "gulp-wp-pot": {
2790
+ "version": "2.3.1",
2791
+ "resolved": "https://registry.npmjs.org/gulp-wp-pot/-/gulp-wp-pot-2.3.1.tgz",
2792
+ "integrity": "sha512-n3tA1hCSCpm/Vc86HWfn3v6o4lIkpwq+/R4chh/Rrl9mZjtCrcJbgR2EvwT4zrfOrNazMBV9KicNSIS/2aTcsw==",
2793
+ "dev": true,
2794
+ "requires": {
2795
+ "plugin-error": "1.0.1",
2796
+ "through2": "2.0.3",
2797
+ "vinyl": "2.1.0",
2798
+ "wp-pot": "1.6.1"
2799
+ },
2800
+ "dependencies": {
2801
+ "clone": {
2802
+ "version": "2.1.1",
2803
+ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz",
2804
+ "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=",
2805
+ "dev": true
2806
+ },
2807
+ "clone-stats": {
2808
+ "version": "1.0.0",
2809
+ "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz",
2810
+ "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=",
2811
+ "dev": true
2812
+ },
2813
+ "replace-ext": {
2814
+ "version": "1.0.0",
2815
+ "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
2816
+ "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=",
2817
+ "dev": true
2818
+ },
2819
+ "vinyl": {
2820
+ "version": "2.1.0",
2821
+ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz",
2822
+ "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=",
2823
+ "dev": true,
2824
+ "requires": {
2825
+ "clone": "2.1.1",
2826
+ "clone-buffer": "1.0.0",
2827
+ "clone-stats": "1.0.0",
2828
+ "cloneable-readable": "1.1.2",
2829
+ "remove-trailing-separator": "1.1.0",
2830
+ "replace-ext": "1.0.0"
2831
+ }
2832
+ }
2833
+ }
2834
+ },
2835
+ "gulplog": {
2836
+ "version": "1.0.0",
2837
+ "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz",
2838
+ "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=",
2839
+ "dev": true,
2840
+ "requires": {
2841
+ "glogg": "1.0.1"
2842
+ }
2843
+ },
2844
+ "har-validator": {
2845
+ "version": "2.0.6",
2846
+ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz",
2847
+ "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=",
2848
+ "dev": true,
2849
+ "requires": {
2850
+ "chalk": "1.1.3",
2851
+ "commander": "2.15.1",
2852
+ "is-my-json-valid": "2.17.2",
2853
+ "pinkie-promise": "2.0.1"
2854
+ }
2855
+ },
2856
+ "has-ansi": {
2857
+ "version": "2.0.0",
2858
+ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
2859
+ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
2860
+ "dev": true,
2861
+ "requires": {
2862
+ "ansi-regex": "2.1.1"
2863
+ }
2864
+ },
2865
+ "has-flag": {
2866
+ "version": "3.0.0",
2867
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
2868
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
2869
+ "dev": true
2870
+ },
2871
+ "has-glob": {
2872
+ "version": "1.0.0",
2873
+ "resolved": "https://registry.npmjs.org/has-glob/-/has-glob-1.0.0.tgz",
2874
+ "integrity": "sha1-mqqe7b/7G6OZCnsAEPtnjuAIEgc=",
2875
+ "dev": true,
2876
+ "requires": {
2877
+ "is-glob": "3.1.0"
2878
+ }
2879
+ },
2880
+ "has-gulplog": {
2881
+ "version": "0.1.0",
2882
+ "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz",
2883
+ "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=",
2884
+ "dev": true,
2885
+ "requires": {
2886
+ "sparkles": "1.0.1"
2887
+ }
2888
+ },
2889
+ "has-unicode": {
2890
+ "version": "2.0.1",
2891
+ "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
2892
+ "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
2893
+ "dev": true
2894
+ },
2895
+ "has-value": {
2896
+ "version": "1.0.0",
2897
+ "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
2898
+ "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=",
2899
+ "dev": true,
2900
+ "requires": {
2901
+ "get-value": "2.0.6",
2902
+ "has-values": "1.0.0",
2903
+ "isobject": "3.0.1"
2904
+ }
2905
+ },
2906
+ "has-values": {
2907
+ "version": "1.0.0",
2908
+ "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
2909
+ "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=",
2910
+ "dev": true,
2911
+ "requires": {
2912
+ "is-number": "3.0.0",
2913
+ "kind-of": "4.0.0"
2914
+ },
2915
+ "dependencies": {
2916
+ "kind-of": {
2917
+ "version": "4.0.0",
2918
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
2919
+ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
2920
+ "dev": true,
2921
+ "requires": {
2922
+ "is-buffer": "1.1.6"
2923
+ }
2924
+ }
2925
+ }
2926
+ },
2927
+ "hawk": {
2928
+ "version": "3.1.3",
2929
+ "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz",
2930
+ "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=",
2931
+ "dev": true,
2932
+ "requires": {
2933
+ "boom": "2.10.1",
2934
+ "cryptiles": "2.0.5",
2935
+ "hoek": "2.16.3",
2936
+ "sntp": "1.0.9"
2937
+ }
2938
+ },
2939
+ "hoek": {
2940
+ "version": "2.16.3",
2941
+ "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
2942
+ "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=",
2943
+ "dev": true
2944
+ },
2945
+ "homedir-polyfill": {
2946
+ "version": "1.0.1",
2947
+ "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz",
2948
+ "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=",
2949
+ "dev": true,
2950
+ "requires": {
2951
+ "parse-passwd": "1.0.0"
2952
+ }
2953
+ },
2954
+ "hosted-git-info": {
2955
+ "version": "2.6.0",
2956
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz",
2957
+ "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==",
2958
+ "dev": true
2959
+ },
2960
+ "htmlparser2": {
2961
+ "version": "3.8.3",
2962
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz",
2963
+ "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=",
2964
+ "dev": true,
2965
+ "requires": {
2966
+ "domelementtype": "1.3.0",
2967
+ "domhandler": "2.3.0",
2968
+ "domutils": "1.5.1",
2969
+ "entities": "1.0.0",
2970
+ "readable-stream": "1.1.14"
2971
+ }
2972
+ },
2973
+ "http-errors": {
2974
+ "version": "1.3.1",
2975
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz",
2976
+ "integrity": "sha1-GX4izevUGYWF6GlO9nhhl7ke2UI=",
2977
+ "dev": true,
2978
+ "requires": {
2979
+ "inherits": "2.0.3",
2980
+ "statuses": "1.5.0"
2981
+ }
2982
+ },
2983
+ "http-parser-js": {
2984
+ "version": "0.4.12",
2985
+ "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.12.tgz",
2986
+ "integrity": "sha1-uc+/Sizybw/DSxDKFImid3HjR08=",
2987
+ "dev": true
2988
+ },
2989
+ "http-signature": {
2990
+ "version": "1.1.1",
2991
+ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz",
2992
+ "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=",
2993
+ "dev": true,
2994
+ "requires": {
2995
+ "assert-plus": "0.2.0",
2996
+ "jsprim": "1.4.1",
2997
+ "sshpk": "1.14.1"
2998
+ }
2999
+ },
3000
+ "iconv-lite": {
3001
+ "version": "0.4.13",
3002
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz",
3003
+ "integrity": "sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=",
3004
+ "dev": true
3005
+ },
3006
+ "in-publish": {
3007
+ "version": "2.0.0",
3008
+ "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz",
3009
+ "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=",
3010
+ "dev": true
3011
+ },
3012
+ "indent-string": {
3013
+ "version": "2.1.0",
3014
+ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
3015
+ "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=",
3016
+ "dev": true,
3017
+ "requires": {
3018
+ "repeating": "2.0.1"
3019
+ }
3020
+ },
3021
+ "inflight": {
3022
+ "version": "1.0.6",
3023
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
3024
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
3025
+ "dev": true,
3026
+ "requires": {
3027
+ "once": "1.4.0",
3028
+ "wrappy": "1.0.2"
3029
+ }
3030
+ },
3031
+ "inherits": {
3032
+ "version": "2.0.3",
3033
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
3034
+ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
3035
+ "dev": true
3036
+ },
3037
+ "ini": {
3038
+ "version": "1.3.5",
3039
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
3040
+ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
3041
+ "dev": true
3042
+ },
3043
+ "interpret": {
3044
+ "version": "1.1.0",
3045
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
3046
+ "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=",
3047
+ "dev": true
3048
+ },
3049
+ "invert-kv": {
3050
+ "version": "1.0.0",
3051
+ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
3052
+ "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=",
3053
+ "dev": true
3054
+ },
3055
+ "is": {
3056
+ "version": "3.2.1",
3057
+ "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz",
3058
+ "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=",
3059
+ "dev": true
3060
+ },
3061
+ "is-absolute": {
3062
+ "version": "1.0.0",
3063
+ "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
3064
+ "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
3065
+ "dev": true,
3066
+ "requires": {
3067
+ "is-relative": "1.0.0",
3068
+ "is-windows": "1.0.2"
3069
+ }
3070
+ },
3071
+ "is-accessor-descriptor": {
3072
+ "version": "0.1.6",
3073
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
3074
+ "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
3075
+ "dev": true,
3076
+ "requires": {
3077
+ "kind-of": "3.2.2"
3078
+ },
3079
+ "dependencies": {
3080
+ "kind-of": {
3081
+ "version": "3.2.2",
3082
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
3083
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
3084
+ "dev": true,
3085
+ "requires": {
3086
+ "is-buffer": "1.1.6"
3087
+ }
3088
+ }
3089
+ }
3090
+ },
3091
+ "is-arrayish": {
3092
+ "version": "0.2.1",
3093
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
3094
+ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
3095
+ "dev": true
3096
+ },
3097
+ "is-buffer": {
3098
+ "version": "1.1.6",
3099
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
3100
+ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
3101
+ "dev": true
3102
+ },
3103
+ "is-builtin-module": {
3104
+ "version": "1.0.0",
3105
+ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
3106
+ "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
3107
+ "dev": true,
3108
+ "requires": {
3109
+ "builtin-modules": "1.1.1"
3110
+ }
3111
+ },
3112
+ "is-data-descriptor": {
3113
+ "version": "0.1.4",
3114
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
3115
+ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
3116
+ "dev": true,
3117
+ "requires": {
3118
+ "kind-of": "3.2.2"
3119
+ },
3120
+ "dependencies": {
3121
+ "kind-of": {
3122
+ "version": "3.2.2",
3123
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
3124
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
3125
+ "dev": true,
3126
+ "requires": {
3127
+ "is-buffer": "1.1.6"
3128
+ }
3129
+ }
3130
+ }
3131
+ },
3132
+ "is-descriptor": {
3133
+ "version": "0.1.6",
3134
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
3135
+ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
3136
+ "dev": true,
3137
+ "requires": {
3138
+ "is-accessor-descriptor": "0.1.6",
3139
+ "is-data-descriptor": "0.1.4",
3140
+ "kind-of": "5.1.0"
3141
+ },
3142
+ "dependencies": {
3143
+ "kind-of": {
3144
+ "version": "5.1.0",
3145
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
3146
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
3147
+ "dev": true
3148
+ }
3149
+ }
3150
+ },
3151
+ "is-dotfile": {
3152
+ "version": "1.0.3",
3153
+ "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz",
3154
+ "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=",
3155
+ "dev": true
3156
+ },
3157
+ "is-equal-shallow": {
3158
+ "version": "0.1.3",
3159
+ "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz",
3160
+ "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=",
3161
+ "dev": true,
3162
+ "requires": {
3163
+ "is-primitive": "2.0.0"
3164
+ }
3165
+ },
3166
+ "is-extendable": {
3167
+ "version": "0.1.1",
3168
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
3169
+ "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=",
3170
+ "dev": true
3171
+ },
3172
+ "is-extglob": {
3173
+ "version": "2.1.1",
3174
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
3175
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
3176
+ "dev": true
3177
+ },
3178
+ "is-finite": {
3179
+ "version": "1.0.2",
3180
+ "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
3181
+ "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
3182
+ "dev": true,
3183
+ "requires": {
3184
+ "number-is-nan": "1.0.1"
3185
+ }
3186
+ },
3187
+ "is-fullwidth-code-point": {
3188
+ "version": "1.0.0",
3189
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
3190
+ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
3191
+ "dev": true,
3192
+ "requires": {
3193
+ "number-is-nan": "1.0.1"
3194
+ }
3195
+ },
3196
+ "is-glob": {
3197
+ "version": "3.1.0",
3198
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
3199
+ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
3200
+ "dev": true,
3201
+ "requires": {
3202
+ "is-extglob": "2.1.1"
3203
+ }
3204
+ },
3205
+ "is-my-ip-valid": {
3206
+ "version": "1.0.0",
3207
+ "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz",
3208
+ "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==",
3209
+ "dev": true
3210
+ },
3211
+ "is-my-json-valid": {
3212
+ "version": "2.17.2",
3213
+ "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz",
3214
+ "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==",
3215
+ "dev": true,
3216
+ "requires": {
3217
+ "generate-function": "2.0.0",
3218
+ "generate-object-property": "1.2.0",
3219
+ "is-my-ip-valid": "1.0.0",
3220
+ "jsonpointer": "4.0.1",
3221
+ "xtend": "4.0.1"
3222
+ }
3223
+ },
3224
+ "is-number": {
3225
+ "version": "3.0.0",
3226
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
3227
+ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
3228
+ "dev": true,
3229
+ "requires": {
3230
+ "kind-of": "3.2.2"
3231
+ },
3232
+ "dependencies": {
3233
+ "kind-of": {
3234
+ "version": "3.2.2",
3235
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
3236
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
3237
+ "dev": true,
3238
+ "requires": {
3239
+ "is-buffer": "1.1.6"
3240
+ }
3241
+ }
3242
+ }
3243
+ },
3244
+ "is-odd": {
3245
+ "version": "2.0.0",
3246
+ "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz",
3247
+ "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==",
3248
+ "dev": true,
3249
+ "requires": {
3250
+ "is-number": "4.0.0"
3251
+ },
3252
+ "dependencies": {
3253
+ "is-number": {
3254
+ "version": "4.0.0",
3255
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
3256
+ "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
3257
+ "dev": true
3258
+ }
3259
+ }
3260
+ },
3261
+ "is-path-cwd": {
3262
+ "version": "1.0.0",
3263
+ "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz",
3264
+ "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=",
3265
+ "dev": true
3266
+ },
3267
+ "is-path-in-cwd": {
3268
+ "version": "1.0.1",
3269
+ "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz",
3270
+ "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==",
3271
+ "dev": true,
3272
+ "requires": {
3273
+ "is-path-inside": "1.0.1"
3274
+ }
3275
+ },
3276
+ "is-path-inside": {
3277
+ "version": "1.0.1",
3278
+ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz",
3279
+ "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=",
3280
+ "dev": true,
3281
+ "requires": {
3282
+ "path-is-inside": "1.0.2"
3283
+ }
3284
+ },
3285
+ "is-plain-object": {
3286
+ "version": "2.0.4",
3287
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
3288
+ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
3289
+ "dev": true,
3290
+ "requires": {
3291
+ "isobject": "3.0.1"
3292
+ }
3293
+ },
3294
+ "is-posix-bracket": {
3295
+ "version": "0.1.1",
3296
+ "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz",
3297
+ "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=",
3298
+ "dev": true
3299
+ },
3300
+ "is-primitive": {
3301
+ "version": "2.0.0",
3302
+ "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz",
3303
+ "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=",
3304
+ "dev": true
3305
+ },
3306
+ "is-property": {
3307
+ "version": "1.0.2",
3308
+ "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
3309
+ "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=",
3310
+ "dev": true
3311
+ },
3312
+ "is-relative": {
3313
+ "version": "1.0.0",
3314
+ "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
3315
+ "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
3316
+ "dev": true,
3317
+ "requires": {
3318
+ "is-unc-path": "1.0.0"
3319
+ }
3320
+ },
3321
+ "is-typedarray": {
3322
+ "version": "1.0.0",
3323
+ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
3324
+ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
3325
+ "dev": true
3326
+ },
3327
+ "is-unc-path": {
3328
+ "version": "1.0.0",
3329
+ "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
3330
+ "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
3331
+ "dev": true,
3332
+ "requires": {
3333
+ "unc-path-regex": "0.1.2"
3334
+ }
3335
+ },
3336
+ "is-utf8": {
3337
+ "version": "0.2.1",
3338
+ "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
3339
+ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
3340
+ "dev": true
3341
+ },
3342
+ "is-valid-glob": {
3343
+ "version": "1.0.0",
3344
+ "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz",
3345
+ "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=",
3346
+ "dev": true
3347
+ },
3348
+ "is-windows": {
3349
+ "version": "1.0.2",
3350
+ "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
3351
+ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
3352
+ "dev": true
3353
+ },
3354
+ "isarray": {
3355
+ "version": "0.0.1",
3356
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
3357
+ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
3358
+ "dev": true
3359
+ },
3360
+ "isexe": {
3361
+ "version": "2.0.0",
3362
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
3363
+ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
3364
+ "dev": true
3365
+ },
3366
+ "isobject": {
3367
+ "version": "3.0.1",
3368
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
3369
+ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
3370
+ "dev": true
3371
+ },
3372
+ "isstream": {
3373
+ "version": "0.1.2",
3374
+ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
3375
+ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
3376
+ "dev": true
3377
+ },
3378
+ "js-base64": {
3379
+ "version": "2.4.5",
3380
+ "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.5.tgz",
3381
+ "integrity": "sha512-aUnNwqMOXw3yvErjMPSQu6qIIzUmT1e5KcU1OZxRDU1g/am6mzBvcrmLAYwzmB59BHPrh5/tKaiF4OPhqRWESQ==",
3382
+ "dev": true
3383
+ },
3384
+ "jsbn": {
3385
+ "version": "0.1.1",
3386
+ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
3387
+ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
3388
+ "dev": true,
3389
+ "optional": true
3390
+ },
3391
+ "jshint": {
3392
+ "version": "2.9.5",
3393
+ "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz",
3394
+ "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=",
3395
+ "dev": true,
3396
+ "requires": {
3397
+ "cli": "1.0.1",
3398
+ "console-browserify": "1.1.0",
3399
+ "exit": "0.1.2",
3400
+ "htmlparser2": "3.8.3",
3401
+ "lodash": "3.7.0",
3402
+ "minimatch": "3.0.4",
3403
+ "shelljs": "0.3.0",
3404
+ "strip-json-comments": "1.0.4"
3405
+ },
3406
+ "dependencies": {
3407
+ "lodash": {
3408
+ "version": "3.7.0",
3409
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.7.0.tgz",
3410
+ "integrity": "sha1-Nni9irmVBXwHreg27S7wh9qBHUU=",
3411
+ "dev": true
3412
+ }
3413
+ }
3414
+ },
3415
+ "json-schema": {
3416
+ "version": "0.2.3",
3417
+ "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
3418
+ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=",
3419
+ "dev": true
3420
+ },
3421
+ "json-stringify-safe": {
3422
+ "version": "5.0.1",
3423
+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
3424
+ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
3425
+ "dev": true
3426
+ },
3427
+ "jsonpointer": {
3428
+ "version": "4.0.1",
3429
+ "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz",
3430
+ "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=",
3431
+ "dev": true
3432
+ },
3433
+ "jsprim": {
3434
+ "version": "1.4.1",
3435
+ "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
3436
+ "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
3437
+ "dev": true,
3438
+ "requires": {
3439
+ "assert-plus": "1.0.0",
3440
+ "extsprintf": "1.3.0",
3441
+ "json-schema": "0.2.3",
3442
+ "verror": "1.10.0"
3443
+ },
3444
+ "dependencies": {
3445
+ "assert-plus": {
3446
+ "version": "1.0.0",
3447
+ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
3448
+ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
3449
+ "dev": true
3450
+ }
3451
+ }
3452
+ },
3453
+ "kind-of": {
3454
+ "version": "6.0.2",
3455
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
3456
+ "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
3457
+ "dev": true
3458
+ },
3459
+ "lcid": {
3460
+ "version": "1.0.0",
3461
+ "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
3462
+ "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
3463
+ "dev": true,
3464
+ "requires": {
3465
+ "invert-kv": "1.0.0"
3466
+ }
3467
+ },
3468
+ "liftoff": {
3469
+ "version": "2.5.0",
3470
+ "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz",
3471
+ "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=",
3472
+ "dev": true,
3473
+ "requires": {
3474
+ "extend": "3.0.1",
3475
+ "findup-sync": "2.0.0",
3476
+ "fined": "1.1.0",
3477
+ "flagged-respawn": "1.0.0",
3478
+ "is-plain-object": "2.0.4",
3479
+ "object.map": "1.0.1",
3480
+ "rechoir": "0.6.2",
3481
+ "resolve": "1.7.1"
3482
+ }
3483
+ },
3484
+ "livereload-js": {
3485
+ "version": "2.3.0",
3486
+ "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-2.3.0.tgz",
3487
+ "integrity": "sha512-j1R0/FeGa64Y+NmqfZhyoVRzcFlOZ8sNlKzHjh4VvLULFACZhn68XrX5DFg2FhMvSMJmROuFxRSa560ECWKBMg==",
3488
+ "dev": true
3489
+ },
3490
+ "load-json-file": {
3491
+ "version": "1.1.0",
3492
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
3493
+ "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
3494
+ "dev": true,
3495
+ "requires": {
3496
+ "graceful-fs": "4.1.11",
3497
+ "parse-json": "2.2.0",
3498
+ "pify": "2.3.0",
3499
+ "pinkie-promise": "2.0.1",
3500
+ "strip-bom": "2.0.0"
3501
+ },
3502
+ "dependencies": {
3503
+ "graceful-fs": {
3504
+ "version": "4.1.11",
3505
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
3506
+ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
3507
+ "dev": true
3508
+ },
3509
+ "pify": {
3510
+ "version": "2.3.0",
3511
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
3512
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
3513
+ "dev": true
3514
+ },
3515
+ "strip-bom": {
3516
+ "version": "2.0.0",
3517
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
3518
+ "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
3519
+ "dev": true,
3520
+ "requires": {
3521
+ "is-utf8": "0.2.1"
3522
+ }
3523
+ }
3524
+ }
3525
+ },
3526
+ "lodash": {
3527
+ "version": "1.0.2",
3528
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz",
3529
+ "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=",
3530
+ "dev": true
3531
+ },
3532
+ "lodash._baseassign": {
3533
+ "version": "3.2.0",
3534
+ "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz",
3535
+ "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=",
3536
+ "dev": true,
3537
+ "requires": {
3538
+ "lodash._basecopy": "3.0.1",
3539
+ "lodash.keys": "3.1.2"
3540
+ }
3541
+ },
3542
+ "lodash._basecopy": {
3543
+ "version": "3.0.1",
3544
+ "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz",
3545
+ "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=",
3546
+ "dev": true
3547
+ },
3548
+ "lodash._basetostring": {
3549
+ "version": "3.0.1",
3550
+ "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz",
3551
+ "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=",
3552
+ "dev": true
3553
+ },
3554
+ "lodash._basevalues": {
3555
+ "version": "3.0.0",
3556
+ "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz",
3557
+ "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=",
3558
+ "dev": true
3559
+ },
3560
+ "lodash._bindcallback": {
3561
+ "version": "3.0.1",
3562
+ "resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz",
3563
+ "integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4=",
3564
+ "dev": true
3565
+ },
3566
+ "lodash._createassigner": {
3567
+ "version": "3.1.1",
3568
+ "resolved": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz",
3569
+ "integrity": "sha1-g4pbri/aymOsIt7o4Z+k5taXCxE=",
3570
+ "dev": true,
3571
+ "requires": {
3572
+ "lodash._bindcallback": "3.0.1",
3573
+ "lodash._isiterateecall": "3.0.9",
3574
+ "lodash.restparam": "3.6.1"
3575
+ }
3576
+ },
3577
+ "lodash._getnative": {
3578
+ "version": "3.9.1",
3579
+ "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz",
3580
+ "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=",
3581
+ "dev": true
3582
+ },
3583
+ "lodash._isiterateecall": {
3584
+ "version": "3.0.9",
3585
+ "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz",
3586
+ "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=",
3587
+ "dev": true
3588
+ },
3589
+ "lodash._reescape": {
3590
+ "version": "3.0.0",
3591
+ "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz",
3592
+ "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=",
3593
+ "dev": true
3594
+ },
3595
+ "lodash._reevaluate": {
3596
+ "version": "3.0.0",
3597
+ "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz",
3598
+ "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=",
3599
+ "dev": true
3600
+ },
3601
+ "lodash._reinterpolate": {
3602
+ "version": "3.0.0",
3603
+ "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz",
3604
+ "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=",
3605
+ "dev": true
3606
+ },
3607
+ "lodash._root": {
3608
+ "version": "3.0.1",
3609
+ "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz",
3610
+ "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=",
3611
+ "dev": true
3612
+ },
3613
+ "lodash.assign": {
3614
+ "version": "4.2.0",
3615
+ "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
3616
+ "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=",
3617
+ "dev": true
3618
+ },
3619
+ "lodash.clonedeep": {
3620
+ "version": "4.5.0",
3621
+ "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
3622
+ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=",
3623
+ "dev": true
3624
+ },
3625
+ "lodash.escape": {
3626
+ "version": "3.2.0",
3627
+ "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz",
3628
+ "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=",
3629
+ "dev": true,
3630
+ "requires": {
3631
+ "lodash._root": "3.0.1"
3632
+ }
3633
+ },
3634
+ "lodash.isarguments": {
3635
+ "version": "3.1.0",
3636
+ "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz",
3637
+ "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=",
3638
+ "dev": true
3639
+ },
3640
+ "lodash.isarray": {
3641
+ "version": "3.0.4",
3642
+ "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz",
3643
+ "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=",
3644
+ "dev": true
3645
+ },
3646
+ "lodash.isobject": {
3647
+ "version": "3.0.2",
3648
+ "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-3.0.2.tgz",
3649
+ "integrity": "sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0=",
3650
+ "dev": true
3651
+ },
3652
+ "lodash.keys": {
3653
+ "version": "3.1.2",
3654
+ "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz",
3655
+ "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=",
3656
+ "dev": true,
3657
+ "requires": {
3658
+ "lodash._getnative": "3.9.1",
3659
+ "lodash.isarguments": "3.1.0",
3660
+ "lodash.isarray": "3.0.4"
3661
+ }
3662
+ },
3663
+ "lodash.merge": {
3664
+ "version": "4.6.1",
3665
+ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz",
3666
+ "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==",
3667
+ "dev": true
3668
+ },
3669
+ "lodash.mergewith": {
3670
+ "version": "4.6.1",
3671
+ "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz",
3672
+ "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==",
3673
+ "dev": true
3674
+ },
3675
+ "lodash.restparam": {
3676
+ "version": "3.6.1",
3677
+ "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz",
3678
+ "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=",
3679
+ "dev": true
3680
+ },
3681
+ "lodash.template": {
3682
+ "version": "3.6.2",
3683
+ "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz",
3684
+ "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=",
3685
+ "dev": true,
3686
+ "requires": {
3687
+ "lodash._basecopy": "3.0.1",
3688
+ "lodash._basetostring": "3.0.1",
3689
+ "lodash._basevalues": "3.0.0",
3690
+ "lodash._isiterateecall": "3.0.9",
3691
+ "lodash._reinterpolate": "3.0.0",
3692
+ "lodash.escape": "3.2.0",
3693
+ "lodash.keys": "3.1.2",
3694
+ "lodash.restparam": "3.6.1",
3695
+ "lodash.templatesettings": "3.1.1"
3696
+ }
3697
+ },
3698
+ "lodash.templatesettings": {
3699
+ "version": "3.1.1",
3700
+ "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz",
3701
+ "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=",
3702
+ "dev": true,
3703
+ "requires": {
3704
+ "lodash._reinterpolate": "3.0.0",
3705
+ "lodash.escape": "3.2.0"
3706
+ }
3707
+ },
3708
+ "loud-rejection": {
3709
+ "version": "1.6.0",
3710
+ "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
3711
+ "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=",
3712
+ "dev": true,
3713
+ "requires": {
3714
+ "currently-unhandled": "0.4.1",
3715
+ "signal-exit": "3.0.2"
3716
+ }
3717
+ },
3718
+ "lru-cache": {
3719
+ "version": "2.7.3",
3720
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
3721
+ "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=",
3722
+ "dev": true
3723
+ },
3724
+ "make-error": {
3725
+ "version": "1.3.4",
3726
+ "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz",
3727
+ "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==",
3728
+ "dev": true
3729
+ },
3730
+ "make-error-cause": {
3731
+ "version": "1.2.2",
3732
+ "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz",
3733
+ "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=",
3734
+ "dev": true,
3735
+ "requires": {
3736
+ "make-error": "1.3.4"
3737
+ }
3738
+ },
3739
+ "make-iterator": {
3740
+ "version": "1.0.1",
3741
+ "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
3742
+ "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
3743
+ "dev": true,
3744
+ "requires": {
3745
+ "kind-of": "6.0.2"
3746
+ }
3747
+ },
3748
+ "map-cache": {
3749
+ "version": "0.2.2",
3750
+ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
3751
+ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=",
3752
+ "dev": true
3753
+ },
3754
+ "map-obj": {
3755
+ "version": "1.0.1",
3756
+ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
3757
+ "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
3758
+ "dev": true
3759
+ },
3760
+ "map-stream": {
3761
+ "version": "0.1.0",
3762
+ "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz",
3763
+ "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=",
3764
+ "dev": true
3765
+ },
3766
+ "map-visit": {
3767
+ "version": "1.0.0",
3768
+ "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
3769
+ "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=",
3770
+ "dev": true,
3771
+ "requires": {
3772
+ "object-visit": "1.0.1"
3773
+ }
3774
+ },
3775
+ "matched": {
3776
+ "version": "2.0.1",
3777
+ "resolved": "https://registry.npmjs.org/matched/-/matched-2.0.1.tgz",
3778
+ "integrity": "sha512-2aidSwg5/8qzUSFx2HuU3tIwY0yyRKA126l67CWIBHhXZlCvA8jjD7C7DqvuTJNzNbbmK/ETRFx3aNEgOFjuzA==",
3779
+ "dev": true,
3780
+ "requires": {
3781
+ "arr-union": "3.1.0",
3782
+ "glob": "7.1.2",
3783
+ "has-glob": "1.0.0",
3784
+ "is-valid-glob": "1.0.0",
3785
+ "resolve-dir": "1.0.1"
3786
+ }
3787
+ },
3788
+ "math-random": {
3789
+ "version": "1.0.1",
3790
+ "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz",
3791
+ "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=",
3792
+ "dev": true
3793
+ },
3794
+ "md5-hex": {
3795
+ "version": "2.0.0",
3796
+ "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz",
3797
+ "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=",
3798
+ "dev": true,
3799
+ "requires": {
3800
+ "md5-o-matic": "0.1.1"
3801
+ }
3802
+ },
3803
+ "md5-o-matic": {
3804
+ "version": "0.1.1",
3805
+ "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz",
3806
+ "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=",
3807
+ "dev": true
3808
+ },
3809
+ "media-typer": {
3810
+ "version": "0.3.0",
3811
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
3812
+ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=",
3813
+ "dev": true
3814
+ },
3815
+ "meow": {
3816
+ "version": "3.7.0",
3817
+ "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
3818
+ "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
3819
+ "dev": true,
3820
+ "requires": {
3821
+ "camelcase-keys": "2.1.0",
3822
+ "decamelize": "1.2.0",
3823
+ "loud-rejection": "1.6.0",
3824
+ "map-obj": "1.0.1",
3825
+ "minimist": "1.2.0",
3826
+ "normalize-package-data": "2.4.0",
3827
+ "object-assign": "4.1.1",
3828
+ "read-pkg-up": "1.0.1",
3829
+ "redent": "1.0.0",
3830
+ "trim-newlines": "1.0.0"
3831
+ }
3832
+ },
3833
+ "micromatch": {
3834
+ "version": "3.1.10",
3835
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
3836
+ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
3837
+ "dev": true,
3838
+ "requires": {
3839
+ "arr-diff": "4.0.0",
3840
+ "array-unique": "0.3.2",
3841
+ "braces": "2.3.2",
3842
+ "define-property": "2.0.2",
3843
+ "extend-shallow": "3.0.2",
3844
+ "extglob": "2.0.4",
3845
+ "fragment-cache": "0.2.1",
3846
+ "kind-of": "6.0.2",
3847
+ "nanomatch": "1.2.9",
3848
+ "object.pick": "1.3.0",
3849
+ "regex-not": "1.0.2",
3850
+ "snapdragon": "0.8.2",
3851
+ "to-regex": "3.0.2"
3852
+ }
3853
+ },
3854
+ "mime-db": {
3855
+ "version": "1.33.0",
3856
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz",
3857
+ "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==",
3858
+ "dev": true
3859
+ },
3860
+ "mime-types": {
3861
+ "version": "2.1.18",
3862
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz",
3863
+ "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
3864
+ "dev": true,
3865
+ "requires": {
3866
+ "mime-db": "1.33.0"
3867
+ }
3868
+ },
3869
+ "mini-lr": {
3870
+ "version": "0.1.9",
3871
+ "resolved": "https://registry.npmjs.org/mini-lr/-/mini-lr-0.1.9.tgz",
3872
+ "integrity": "sha1-AhmdJzR5U9H9HW297UJh8Yey0PY=",
3873
+ "dev": true,
3874
+ "requires": {
3875
+ "body-parser": "1.14.2",
3876
+ "debug": "2.6.9",
3877
+ "faye-websocket": "0.7.3",
3878
+ "livereload-js": "2.3.0",
3879
+ "parseurl": "1.3.2",
3880
+ "qs": "2.2.5"
3881
+ }
3882
+ },
3883
+ "minimatch": {
3884
+ "version": "3.0.4",
3885
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
3886
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
3887
+ "dev": true,
3888
+ "requires": {
3889
+ "brace-expansion": "1.1.11"
3890
+ }
3891
+ },
3892
+ "minimist": {
3893
+ "version": "1.2.0",
3894
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
3895
+ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
3896
+ "dev": true
3897
+ },
3898
+ "mixin-deep": {
3899
+ "version": "1.3.1",
3900
+ "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz",
3901
+ "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==",
3902
+ "dev": true,
3903
+ "requires": {
3904
+ "for-in": "1.0.2",
3905
+ "is-extendable": "1.0.1"
3906
+ },
3907
+ "dependencies": {
3908
+ "is-extendable": {
3909
+ "version": "1.0.1",
3910
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
3911
+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
3912
+ "dev": true,
3913
+ "requires": {
3914
+ "is-plain-object": "2.0.4"
3915
+ }
3916
+ }
3917
+ }
3918
+ },
3919
+ "mkdirp": {
3920
+ "version": "0.5.1",
3921
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
3922
+ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
3923
+ "dev": true,
3924
+ "requires": {
3925
+ "minimist": "0.0.8"
3926
+ },
3927
+ "dependencies": {
3928
+ "minimist": {
3929
+ "version": "0.0.8",
3930
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
3931
+ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
3932
+ "dev": true
3933
+ }
3934
+ }
3935
+ },
3936
+ "ms": {
3937
+ "version": "2.0.0",
3938
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
3939
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
3940
+ "dev": true
3941
+ },
3942
+ "multipipe": {
3943
+ "version": "0.1.2",
3944
+ "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz",
3945
+ "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=",
3946
+ "dev": true,
3947
+ "requires": {
3948
+ "duplexer2": "0.0.2"
3949
+ }
3950
+ },
3951
+ "nan": {
3952
+ "version": "2.10.0",
3953
+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
3954
+ "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
3955
+ "dev": true
3956
+ },
3957
+ "nanomatch": {
3958
+ "version": "1.2.9",
3959
+ "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz",
3960
+ "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==",
3961
+ "dev": true,
3962
+ "requires": {
3963
+ "arr-diff": "4.0.0",
3964
+ "array-unique": "0.3.2",
3965
+ "define-property": "2.0.2",
3966
+ "extend-shallow": "3.0.2",
3967
+ "fragment-cache": "0.2.1",
3968
+ "is-odd": "2.0.0",
3969
+ "is-windows": "1.0.2",
3970
+ "kind-of": "6.0.2",
3971
+ "object.pick": "1.3.0",
3972
+ "regex-not": "1.0.2",
3973
+ "snapdragon": "0.8.2",
3974
+ "to-regex": "3.0.2"
3975
+ }
3976
+ },
3977
+ "natives": {
3978
+ "version": "1.1.3",
3979
+ "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.3.tgz",
3980
+ "integrity": "sha512-BZGSYV4YOLxzoTK73l0/s/0sH9l8SHs2ocReMH1f8JYSh5FUWu4ZrKCpJdRkWXV6HFR/pZDz7bwWOVAY07q77g==",
3981
+ "dev": true
3982
+ },
3983
+ "node-gyp": {
3984
+ "version": "3.6.2",
3985
+ "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.6.2.tgz",
3986
+ "integrity": "sha1-m/vlRWIoYoSDjnUOrAUpWFP6HGA=",
3987
+ "dev": true,
3988
+ "requires": {
3989
+ "fstream": "1.0.11",
3990
+ "glob": "7.1.2",
3991
+ "graceful-fs": "4.1.11",
3992
+ "minimatch": "3.0.4",
3993
+ "mkdirp": "0.5.1",
3994
+ "nopt": "3.0.6",
3995
+ "npmlog": "4.1.2",
3996
+ "osenv": "0.1.5",
3997
+ "request": "2.79.0",
3998
+ "rimraf": "2.6.2",
3999
+ "semver": "5.3.0",
4000
+ "tar": "2.2.1",
4001
+ "which": "1.3.0"
4002
+ },
4003
+ "dependencies": {
4004
+ "graceful-fs": {
4005
+ "version": "4.1.11",
4006
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
4007
+ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
4008
+ "dev": true
4009
+ },
4010
+ "semver": {
4011
+ "version": "5.3.0",
4012
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
4013
+ "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=",
4014
+ "dev": true
4015
+ }
4016
+ }
4017
+ },
4018
+ "node-notifier": {
4019
+ "version": "5.2.1",
4020
+ "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.2.1.tgz",
4021
+ "integrity": "sha512-MIBs+AAd6dJ2SklbbE8RUDRlIVhU8MaNLh1A9SUZDUHPiZkWLFde6UNwG41yQHZEToHgJMXqyVZ9UcS/ReOVTg==",
4022
+ "dev": true,
4023
+ "requires": {
4024
+ "growly": "1.3.0",
4025
+ "semver": "5.5.0",
4026
+ "shellwords": "0.1.1",
4027
+ "which": "1.3.0"
4028
+ },
4029
+ "dependencies": {
4030
+ "semver": {
4031
+ "version": "5.5.0",
4032
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
4033
+ "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
4034
+ "dev": true
4035
+ }
4036
+ }
4037
+ },
4038
+ "node-sass": {
4039
+ "version": "4.9.0",
4040
+ "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.9.0.tgz",
4041
+ "integrity": "sha512-QFHfrZl6lqRU3csypwviz2XLgGNOoWQbo2GOvtsfQqOfL4cy1BtWnhx/XUeAO9LT3ahBzSRXcEO6DdvAH9DzSg==",
4042
+ "dev": true,
4043
+ "requires": {
4044
+ "async-foreach": "0.1.3",
4045
+ "chalk": "1.1.3",
4046
+ "cross-spawn": "3.0.1",
4047
+ "gaze": "1.1.2",
4048
+ "get-stdin": "4.0.1",
4049
+ "glob": "7.1.2",
4050
+ "in-publish": "2.0.0",
4051
+ "lodash.assign": "4.2.0",
4052
+ "lodash.clonedeep": "4.5.0",
4053
+ "lodash.mergewith": "4.6.1",
4054
+ "meow": "3.7.0",
4055
+ "mkdirp": "0.5.1",
4056
+ "nan": "2.10.0",
4057
+ "node-gyp": "3.6.2",
4058
+ "npmlog": "4.1.2",
4059
+ "request": "2.79.0",
4060
+ "sass-graph": "2.2.4",
4061
+ "stdout-stream": "1.4.0",
4062
+ "true-case-path": "1.0.2"
4063
+ },
4064
+ "dependencies": {
4065
+ "cross-spawn": {
4066
+ "version": "3.0.1",
4067
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz",
4068
+ "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=",
4069
+ "dev": true,
4070
+ "requires": {
4071
+ "lru-cache": "4.1.3",
4072
+ "which": "1.3.0"
4073
+ }
4074
+ },
4075
+ "gaze": {
4076
+ "version": "1.1.2",
4077
+ "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.2.tgz",
4078
+ "integrity": "sha1-hHIkZ3rbiHDWeSV+0ziP22HkAQU=",
4079
+ "dev": true,
4080
+ "requires": {
4081
+ "globule": "1.2.0"
4082
+ }
4083
+ },
4084
+ "globule": {
4085
+ "version": "1.2.0",
4086
+ "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz",
4087
+ "integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=",
4088
+ "dev": true,
4089
+ "requires": {
4090
+ "glob": "7.1.2",
4091
+ "lodash": "4.17.10",
4092
+ "minimatch": "3.0.4"
4093
+ }
4094
+ },
4095
+ "lodash": {
4096
+ "version": "4.17.10",
4097
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
4098
+ "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
4099
+ "dev": true
4100
+ },
4101
+ "lru-cache": {
4102
+ "version": "4.1.3",
4103
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz",
4104
+ "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==",
4105
+ "dev": true,
4106
+ "requires": {
4107
+ "pseudomap": "1.0.2",
4108
+ "yallist": "2.1.2"
4109
+ }
4110
+ }
4111
+ }
4112
+ },
4113
+ "node.extend": {
4114
+ "version": "2.0.0",
4115
+ "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-2.0.0.tgz",
4116
+ "integrity": "sha1-dSWih1Z36lNHhKXhCseJVhOWFN8=",
4117
+ "dev": true,
4118
+ "requires": {
4119
+ "is": "3.2.1"
4120
+ }
4121
+ },
4122
+ "nopt": {
4123
+ "version": "3.0.6",
4124
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
4125
+ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=",
4126
+ "dev": true,
4127
+ "requires": {
4128
+ "abbrev": "1.1.1"
4129
+ }
4130
+ },
4131
+ "normalize-package-data": {
4132
+ "version": "2.4.0",
4133
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
4134
+ "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
4135
+ "dev": true,
4136
+ "requires": {
4137
+ "hosted-git-info": "2.6.0",
4138
+ "is-builtin-module": "1.0.0",
4139
+ "semver": "4.3.6",
4140
+ "validate-npm-package-license": "3.0.3"
4141
+ }
4142
+ },
4143
+ "normalize-path": {
4144
+ "version": "2.1.1",
4145
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
4146
+ "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
4147
+ "dev": true,
4148
+ "requires": {
4149
+ "remove-trailing-separator": "1.1.0"
4150
+ }
4151
+ },
4152
+ "normalize-range": {
4153
+ "version": "0.1.2",
4154
+ "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz",
4155
+ "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=",
4156
+ "dev": true
4157
+ },
4158
+ "npmlog": {
4159
+ "version": "4.1.2",
4160
+ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
4161
+ "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
4162
+ "dev": true,
4163
+ "requires": {
4164
+ "are-we-there-yet": "1.1.4",
4165
+ "console-control-strings": "1.1.0",
4166
+ "gauge": "2.7.4",
4167
+ "set-blocking": "2.0.0"
4168
+ }
4169
+ },
4170
+ "num2fraction": {
4171
+ "version": "1.2.2",
4172
+ "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz",
4173
+ "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=",
4174
+ "dev": true
4175
+ },
4176
+ "number-is-nan": {
4177
+ "version": "1.0.1",
4178
+ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
4179
+ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
4180
+ "dev": true
4181
+ },
4182
+ "oauth-sign": {
4183
+ "version": "0.8.2",
4184
+ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
4185
+ "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=",
4186
+ "dev": true
4187
+ },
4188
+ "object-assign": {
4189
+ "version": "4.1.1",
4190
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
4191
+ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
4192
+ "dev": true
4193
+ },
4194
+ "object-copy": {
4195
+ "version": "0.1.0",
4196
+ "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
4197
+ "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=",
4198
+ "dev": true,
4199
+ "requires": {
4200
+ "copy-descriptor": "0.1.1",
4201
+ "define-property": "0.2.5",
4202
+ "kind-of": "3.2.2"
4203
+ },
4204
+ "dependencies": {
4205
+ "define-property": {
4206
+ "version": "0.2.5",
4207
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
4208
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
4209
+ "dev": true,
4210
+ "requires": {
4211
+ "is-descriptor": "0.1.6"
4212
+ }
4213
+ },
4214
+ "kind-of": {
4215
+ "version": "3.2.2",
4216
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
4217
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
4218
+ "dev": true,
4219
+ "requires": {
4220
+ "is-buffer": "1.1.6"
4221
+ }
4222
+ }
4223
+ }
4224
+ },
4225
+ "object-visit": {
4226
+ "version": "1.0.1",
4227
+ "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
4228
+ "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=",
4229
+ "dev": true,
4230
+ "requires": {
4231
+ "isobject": "3.0.1"
4232
+ }
4233
+ },
4234
+ "object.defaults": {
4235
+ "version": "1.1.0",
4236
+ "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz",
4237
+ "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=",
4238
+ "dev": true,
4239
+ "requires": {
4240
+ "array-each": "1.0.1",
4241
+ "array-slice": "1.1.0",
4242
+ "for-own": "1.0.0",
4243
+ "isobject": "3.0.1"
4244
+ }
4245
+ },
4246
+ "object.map": {
4247
+ "version": "1.0.1",
4248
+ "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz",
4249
+ "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=",
4250
+ "dev": true,
4251
+ "requires": {
4252
+ "for-own": "1.0.0",
4253
+ "make-iterator": "1.0.1"
4254
+ }
4255
+ },
4256
+ "object.omit": {
4257
+ "version": "2.0.1",
4258
+ "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz",
4259
+ "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=",
4260
+ "dev": true,
4261
+ "requires": {
4262
+ "for-own": "0.1.5",
4263
+ "is-extendable": "0.1.1"
4264
+ },
4265
+ "dependencies": {
4266
+ "for-own": {
4267
+ "version": "0.1.5",
4268
+ "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz",
4269
+ "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=",
4270
+ "dev": true,
4271
+ "requires": {
4272
+ "for-in": "1.0.2"
4273
+ }
4274
+ }
4275
+ }
4276
+ },
4277
+ "object.pick": {
4278
+ "version": "1.3.0",
4279
+ "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
4280
+ "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=",
4281
+ "dev": true,
4282
+ "requires": {
4283
+ "isobject": "3.0.1"
4284
+ }
4285
+ },
4286
+ "on-finished": {
4287
+ "version": "2.3.0",
4288
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
4289
+ "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
4290
+ "dev": true,
4291
+ "requires": {
4292
+ "ee-first": "1.1.1"
4293
+ }
4294
+ },
4295
+ "once": {
4296
+ "version": "1.4.0",
4297
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
4298
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
4299
+ "dev": true,
4300
+ "requires": {
4301
+ "wrappy": "1.0.2"
4302
+ }
4303
+ },
4304
+ "onetime": {
4305
+ "version": "1.1.0",
4306
+ "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
4307
+ "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=",
4308
+ "dev": true
4309
+ },
4310
+ "orchestrator": {
4311
+ "version": "0.3.8",
4312
+ "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz",
4313
+ "integrity": "sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4=",
4314
+ "dev": true,
4315
+ "requires": {
4316
+ "end-of-stream": "0.1.5",
4317
+ "sequencify": "0.0.7",
4318
+ "stream-consume": "0.1.1"
4319
+ }
4320
+ },
4321
+ "ordered-read-streams": {
4322
+ "version": "0.1.0",
4323
+ "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz",
4324
+ "integrity": "sha1-/VZamvjrRHO6abbtijQ1LLVS8SY=",
4325
+ "dev": true
4326
+ },
4327
+ "os-homedir": {
4328
+ "version": "1.0.2",
4329
+ "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
4330
+ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
4331
+ "dev": true
4332
+ },
4333
+ "os-locale": {
4334
+ "version": "1.4.0",
4335
+ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
4336
+ "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
4337
+ "dev": true,
4338
+ "requires": {
4339
+ "lcid": "1.0.0"
4340
+ }
4341
+ },
4342
+ "os-tmpdir": {
4343
+ "version": "1.0.2",
4344
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
4345
+ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
4346
+ "dev": true
4347
+ },
4348
+ "osenv": {
4349
+ "version": "0.1.5",
4350
+ "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
4351
+ "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
4352
+ "dev": true,
4353
+ "requires": {
4354
+ "os-homedir": "1.0.2",
4355
+ "os-tmpdir": "1.0.2"
4356
+ }
4357
+ },
4358
+ "p-map": {
4359
+ "version": "1.2.0",
4360
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz",
4361
+ "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==",
4362
+ "dev": true
4363
+ },
4364
+ "parse-filepath": {
4365
+ "version": "1.0.2",
4366
+ "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz",
4367
+ "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=",
4368
+ "dev": true,
4369
+ "requires": {
4370
+ "is-absolute": "1.0.0",
4371
+ "map-cache": "0.2.2",
4372
+ "path-root": "0.1.1"
4373
+ }
4374
+ },
4375
+ "parse-glob": {
4376
+ "version": "3.0.4",
4377
+ "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
4378
+ "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=",
4379
+ "dev": true,
4380
+ "requires": {
4381
+ "glob-base": "0.3.0",
4382
+ "is-dotfile": "1.0.3",
4383
+ "is-extglob": "1.0.0",
4384
+ "is-glob": "2.0.1"
4385
+ },
4386
+ "dependencies": {
4387
+ "is-extglob": {
4388
+ "version": "1.0.0",
4389
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
4390
+ "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
4391
+ "dev": true
4392
+ },
4393
+ "is-glob": {
4394
+ "version": "2.0.1",
4395
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
4396
+ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
4397
+ "dev": true,
4398
+ "requires": {
4399
+ "is-extglob": "1.0.0"
4400
+ }
4401
+ }
4402
+ }
4403
+ },
4404
+ "parse-json": {
4405
+ "version": "2.2.0",
4406
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
4407
+ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
4408
+ "dev": true,
4409
+ "requires": {
4410
+ "error-ex": "1.3.1"
4411
+ }
4412
+ },
4413
+ "parse-passwd": {
4414
+ "version": "1.0.0",
4415
+ "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
4416
+ "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=",
4417
+ "dev": true
4418
+ },
4419
+ "parseurl": {
4420
+ "version": "1.3.2",
4421
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
4422
+ "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=",
4423
+ "dev": true
4424
+ },
4425
+ "pascalcase": {
4426
+ "version": "0.1.1",
4427
+ "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
4428
+ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
4429
+ "dev": true
4430
+ },
4431
+ "path-exists": {
4432
+ "version": "3.0.0",
4433
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
4434
+ "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
4435
+ "dev": true
4436
+ },
4437
+ "path-is-absolute": {
4438
+ "version": "1.0.1",
4439
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
4440
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
4441
+ "dev": true
4442
+ },
4443
+ "path-is-inside": {
4444
+ "version": "1.0.2",
4445
+ "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz",
4446
+ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=",
4447
+ "dev": true
4448
+ },
4449
+ "path-parse": {
4450
+ "version": "1.0.5",
4451
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
4452
+ "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
4453
+ "dev": true
4454
+ },
4455
+ "path-root": {
4456
+ "version": "0.1.1",
4457
+ "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz",
4458
+ "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=",
4459
+ "dev": true,
4460
+ "requires": {
4461
+ "path-root-regex": "0.1.2"
4462
+ }
4463
+ },
4464
+ "path-root-regex": {
4465
+ "version": "0.1.2",
4466
+ "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz",
4467
+ "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=",
4468
+ "dev": true
4469
+ },
4470
+ "path-sort": {
4471
+ "version": "0.1.0",
4472
+ "resolved": "https://registry.npmjs.org/path-sort/-/path-sort-0.1.0.tgz",
4473
+ "integrity": "sha1-ywF11Oy/paGP5nTMbXIL/hXguAU=",
4474
+ "dev": true
4475
+ },
4476
+ "path-type": {
4477
+ "version": "1.1.0",
4478
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
4479
+ "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
4480
+ "dev": true,
4481
+ "requires": {
4482
+ "graceful-fs": "4.1.11",
4483
+ "pify": "2.3.0",
4484
+ "pinkie-promise": "2.0.1"
4485
+ },
4486
+ "dependencies": {
4487
+ "graceful-fs": {
4488
+ "version": "4.1.11",
4489
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
4490
+ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
4491
+ "dev": true
4492
+ },
4493
+ "pify": {
4494
+ "version": "2.3.0",
4495
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
4496
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
4497
+ "dev": true
4498
+ }
4499
+ }
4500
+ },
4501
+ "pause-stream": {
4502
+ "version": "0.0.11",
4503
+ "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz",
4504
+ "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=",
4505
+ "dev": true,
4506
+ "requires": {
4507
+ "through": "2.3.8"
4508
+ }
4509
+ },
4510
+ "php-parser": {
4511
+ "version": "3.0.0-alpha2",
4512
+ "resolved": "https://registry.npmjs.org/php-parser/-/php-parser-3.0.0-alpha2.tgz",
4513
+ "integrity": "sha1-bcORysgJ5UFzjxxz9uy52ECjiEA=",
4514
+ "dev": true
4515
+ },
4516
+ "pify": {
4517
+ "version": "3.0.0",
4518
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
4519
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
4520
+ "dev": true
4521
+ },
4522
+ "pinkie": {
4523
+ "version": "2.0.4",
4524
+ "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
4525
+ "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
4526
+ "dev": true
4527
+ },
4528
+ "pinkie-promise": {
4529
+ "version": "2.0.1",
4530
+ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
4531
+ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
4532
+ "dev": true,
4533
+ "requires": {
4534
+ "pinkie": "2.0.4"
4535
+ }
4536
+ },
4537
+ "plugin-error": {
4538
+ "version": "1.0.1",
4539
+ "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz",
4540
+ "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==",
4541
+ "dev": true,
4542
+ "requires": {
4543
+ "ansi-colors": "1.1.0",
4544
+ "arr-diff": "4.0.0",
4545
+ "arr-union": "3.1.0",
4546
+ "extend-shallow": "3.0.2"
4547
+ }
4548
+ },
4549
+ "posix-character-classes": {
4550
+ "version": "0.1.1",
4551
+ "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
4552
+ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
4553
+ "dev": true
4554
+ },
4555
+ "postcss": {
4556
+ "version": "6.0.22",
4557
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz",
4558
+ "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==",
4559
+ "dev": true,
4560
+ "requires": {
4561
+ "chalk": "2.4.1",
4562
+ "source-map": "0.6.1",
4563
+ "supports-color": "5.4.0"
4564
+ },
4565
+ "dependencies": {
4566
+ "ansi-styles": {
4567
+ "version": "3.2.1",
4568
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
4569
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
4570
+ "dev": true,
4571
+ "requires": {
4572
+ "color-convert": "1.9.1"
4573
+ }
4574
+ },
4575
+ "chalk": {
4576
+ "version": "2.4.1",
4577
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
4578
+ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
4579
+ "dev": true,
4580
+ "requires": {
4581
+ "ansi-styles": "3.2.1",
4582
+ "escape-string-regexp": "1.0.5",
4583
+ "supports-color": "5.4.0"
4584
+ }
4585
+ },
4586
+ "source-map": {
4587
+ "version": "0.6.1",
4588
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
4589
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
4590
+ "dev": true
4591
+ },
4592
+ "supports-color": {
4593
+ "version": "5.4.0",
4594
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
4595
+ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
4596
+ "dev": true,
4597
+ "requires": {
4598
+ "has-flag": "3.0.0"
4599
+ }
4600
+ }
4601
+ }
4602
+ },
4603
+ "postcss-value-parser": {
4604
+ "version": "3.3.0",
4605
+ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz",
4606
+ "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=",
4607
+ "dev": true
4608
+ },
4609
+ "preserve": {
4610
+ "version": "0.2.0",
4611
+ "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz",
4612
+ "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=",
4613
+ "dev": true
4614
+ },
4615
+ "pretty-hrtime": {
4616
+ "version": "1.0.3",
4617
+ "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",
4618
+ "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=",
4619
+ "dev": true
4620
+ },
4621
+ "process-nextick-args": {
4622
+ "version": "2.0.0",
4623
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
4624
+ "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
4625
+ "dev": true
4626
+ },
4627
+ "pseudomap": {
4628
+ "version": "1.0.2",
4629
+ "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
4630
+ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
4631
+ "dev": true
4632
+ },
4633
+ "pump": {
4634
+ "version": "3.0.0",
4635
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
4636
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
4637
+ "dev": true,
4638
+ "requires": {
4639
+ "end-of-stream": "1.4.1",
4640
+ "once": "1.4.0"
4641
+ },
4642
+ "dependencies": {
4643
+ "end-of-stream": {
4644
+ "version": "1.4.1",
4645
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
4646
+ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
4647
+ "dev": true,
4648
+ "requires": {
4649
+ "once": "1.4.0"
4650
+ }
4651
+ }
4652
+ }
4653
+ },
4654
+ "punycode": {
4655
+ "version": "1.4.1",
4656
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
4657
+ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
4658
+ "dev": true
4659
+ },
4660
+ "qs": {
4661
+ "version": "2.2.5",
4662
+ "resolved": "https://registry.npmjs.org/qs/-/qs-2.2.5.tgz",
4663
+ "integrity": "sha1-EIirr53MCuWuRbcJ5sa1iIsjkjw=",
4664
+ "dev": true
4665
+ },
4666
+ "randomatic": {
4667
+ "version": "3.0.0",
4668
+ "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz",
4669
+ "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==",
4670
+ "dev": true,
4671
+ "requires": {
4672
+ "is-number": "4.0.0",
4673
+ "kind-of": "6.0.2",
4674
+ "math-random": "1.0.1"
4675
+ },
4676
+ "dependencies": {
4677
+ "is-number": {
4678
+ "version": "4.0.0",
4679
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
4680
+ "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
4681
+ "dev": true
4682
+ }
4683
+ }
4684
+ },
4685
+ "raw-body": {
4686
+ "version": "2.1.7",
4687
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.1.7.tgz",
4688
+ "integrity": "sha1-rf6s4uT7MJgFgBTQjActzFl1h3Q=",
4689
+ "dev": true,
4690
+ "requires": {
4691
+ "bytes": "2.4.0",
4692
+ "iconv-lite": "0.4.13",
4693
+ "unpipe": "1.0.0"
4694
+ },
4695
+ "dependencies": {
4696
+ "bytes": {
4697
+ "version": "2.4.0",
4698
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz",
4699
+ "integrity": "sha1-fZcZb51br39pNeJZhVSe3SpsIzk=",
4700
+ "dev": true
4701
+ }
4702
+ }
4703
+ },
4704
+ "rcfinder": {
4705
+ "version": "0.1.9",
4706
+ "resolved": "https://registry.npmjs.org/rcfinder/-/rcfinder-0.1.9.tgz",
4707
+ "integrity": "sha1-8+gPOH3fmugK4wpBADKWQuroERU=",
4708
+ "dev": true,
4709
+ "requires": {
4710
+ "lodash.clonedeep": "4.5.0"
4711
+ }
4712
+ },
4713
+ "rcloader": {
4714
+ "version": "0.2.2",
4715
+ "resolved": "https://registry.npmjs.org/rcloader/-/rcloader-0.2.2.tgz",
4716
+ "integrity": "sha1-WNIpi0YtC5v9ITPSoex0+9cFxxc=",
4717
+ "dev": true,
4718
+ "requires": {
4719
+ "lodash.assign": "4.2.0",
4720
+ "lodash.isobject": "3.0.2",
4721
+ "lodash.merge": "4.6.1",
4722
+ "rcfinder": "0.1.9"
4723
+ }
4724
+ },
4725
+ "read-pkg": {
4726
+ "version": "1.1.0",
4727
+ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
4728
+ "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
4729
+ "dev": true,
4730
+ "requires": {
4731
+ "load-json-file": "1.1.0",
4732
+ "normalize-package-data": "2.4.0",
4733
+ "path-type": "1.1.0"
4734
+ }
4735
+ },
4736
+ "read-pkg-up": {
4737
+ "version": "1.0.1",
4738
+ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
4739
+ "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
4740
+ "dev": true,
4741
+ "requires": {
4742
+ "find-up": "1.1.2",
4743
+ "read-pkg": "1.1.0"
4744
+ }
4745
+ },
4746
+ "readable-stream": {
4747
+ "version": "1.1.14",
4748
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
4749
+ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
4750
+ "dev": true,
4751
+ "requires": {
4752
+ "core-util-is": "1.0.2",
4753
+ "inherits": "2.0.3",
4754
+ "isarray": "0.0.1",
4755
+ "string_decoder": "0.10.31"
4756
+ }
4757
+ },
4758
+ "rechoir": {
4759
+ "version": "0.6.2",
4760
+ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
4761
+ "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
4762
+ "dev": true,
4763
+ "requires": {
4764
+ "resolve": "1.7.1"
4765
+ }
4766
+ },
4767
+ "redent": {
4768
+ "version": "1.0.0",
4769
+ "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz",
4770
+ "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=",
4771
+ "dev": true,
4772
+ "requires": {
4773
+ "indent-string": "2.1.0",
4774
+ "strip-indent": "1.0.1"
4775
+ }
4776
+ },
4777
+ "regenerator-runtime": {
4778
+ "version": "0.11.1",
4779
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
4780
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
4781
+ "dev": true
4782
+ },
4783
+ "regex-cache": {
4784
+ "version": "0.4.4",
4785
+ "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz",
4786
+ "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==",
4787
+ "dev": true,
4788
+ "requires": {
4789
+ "is-equal-shallow": "0.1.3"
4790
+ }
4791
+ },
4792
+ "regex-not": {
4793
+ "version": "1.0.2",
4794
+ "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
4795
+ "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
4796
+ "dev": true,
4797
+ "requires": {
4798
+ "extend-shallow": "3.0.2",
4799
+ "safe-regex": "1.1.0"
4800
+ }
4801
+ },
4802
+ "remove-trailing-separator": {
4803
+ "version": "1.1.0",
4804
+ "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
4805
+ "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=",
4806
+ "dev": true
4807
+ },
4808
+ "repeat-element": {
4809
+ "version": "1.1.2",
4810
+ "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz",
4811
+ "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=",
4812
+ "dev": true
4813
+ },
4814
+ "repeat-string": {
4815
+ "version": "1.6.1",
4816
+ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
4817
+ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
4818
+ "dev": true
4819
+ },
4820
+ "repeating": {
4821
+ "version": "2.0.1",
4822
+ "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
4823
+ "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
4824
+ "dev": true,
4825
+ "requires": {
4826
+ "is-finite": "1.0.2"
4827
+ }
4828
+ },
4829
+ "replace-ext": {
4830
+ "version": "0.0.1",
4831
+ "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz",
4832
+ "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=",
4833
+ "dev": true
4834
+ },
4835
+ "request": {
4836
+ "version": "2.79.0",
4837
+ "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz",
4838
+ "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=",
4839
+ "dev": true,
4840
+ "requires": {
4841
+ "aws-sign2": "0.6.0",
4842
+ "aws4": "1.7.0",
4843
+ "caseless": "0.11.0",
4844
+ "combined-stream": "1.0.6",
4845
+ "extend": "3.0.1",
4846
+ "forever-agent": "0.6.1",
4847
+ "form-data": "2.1.4",
4848
+ "har-validator": "2.0.6",
4849
+ "hawk": "3.1.3",
4850
+ "http-signature": "1.1.1",
4851
+ "is-typedarray": "1.0.0",
4852
+ "isstream": "0.1.2",
4853
+ "json-stringify-safe": "5.0.1",
4854
+ "mime-types": "2.1.18",
4855
+ "oauth-sign": "0.8.2",
4856
+ "qs": "6.3.2",
4857
+ "stringstream": "0.0.6",
4858
+ "tough-cookie": "2.3.4",
4859
+ "tunnel-agent": "0.4.3",
4860
+ "uuid": "3.2.1"
4861
+ },
4862
+ "dependencies": {
4863
+ "qs": {
4864
+ "version": "6.3.2",
4865
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz",
4866
+ "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=",
4867
+ "dev": true
4868
+ }
4869
+ }
4870
+ },
4871
+ "require-directory": {
4872
+ "version": "2.1.1",
4873
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
4874
+ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
4875
+ "dev": true
4876
+ },
4877
+ "require-main-filename": {
4878
+ "version": "1.0.1",
4879
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
4880
+ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
4881
+ "dev": true
4882
+ },
4883
+ "resolve": {
4884
+ "version": "1.7.1",
4885
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz",
4886
+ "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==",
4887
+ "dev": true,
4888
+ "requires": {
4889
+ "path-parse": "1.0.5"
4890
+ }
4891
+ },
4892
+ "resolve-dir": {
4893
+ "version": "1.0.1",
4894
+ "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz",
4895
+ "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=",
4896
+ "dev": true,
4897
+ "requires": {
4898
+ "expand-tilde": "2.0.2",
4899
+ "global-modules": "1.0.0"
4900
+ }
4901
+ },
4902
+ "resolve-url": {
4903
+ "version": "0.2.1",
4904
+ "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
4905
+ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
4906
+ "dev": true
4907
+ },
4908
+ "ret": {
4909
+ "version": "0.1.15",
4910
+ "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
4911
+ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
4912
+ "dev": true
4913
+ },
4914
+ "rimraf": {
4915
+ "version": "2.6.2",
4916
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
4917
+ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
4918
+ "dev": true,
4919
+ "requires": {
4920
+ "glob": "7.1.2"
4921
+ }
4922
+ },
4923
+ "safe-buffer": {
4924
+ "version": "5.1.2",
4925
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
4926
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
4927
+ "dev": true
4928
+ },
4929
+ "safe-json-parse": {
4930
+ "version": "1.0.1",
4931
+ "resolved": "https://registry.npmjs.org/safe-json-parse/-/safe-json-parse-1.0.1.tgz",
4932
+ "integrity": "sha1-PnZyPjjf3aE8mx0poeB//uSzC1c=",
4933
+ "dev": true
4934
+ },
4935
+ "safe-regex": {
4936
+ "version": "1.1.0",
4937
+ "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
4938
+ "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
4939
+ "dev": true,
4940
+ "requires": {
4941
+ "ret": "0.1.15"
4942
+ }
4943
+ },
4944
+ "sass-graph": {
4945
+ "version": "2.2.4",
4946
+ "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz",
4947
+ "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=",
4948
+ "dev": true,
4949
+ "requires": {
4950
+ "glob": "7.1.2",
4951
+ "lodash": "4.17.10",
4952
+ "scss-tokenizer": "0.2.3",
4953
+ "yargs": "7.1.0"
4954
+ },
4955
+ "dependencies": {
4956
+ "lodash": {
4957
+ "version": "4.17.10",
4958
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
4959
+ "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
4960
+ "dev": true
4961
+ }
4962
+ }
4963
+ },
4964
+ "scss-tokenizer": {
4965
+ "version": "0.2.3",
4966
+ "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz",
4967
+ "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=",
4968
+ "dev": true,
4969
+ "requires": {
4970
+ "js-base64": "2.4.5",
4971
+ "source-map": "0.4.4"
4972
+ },
4973
+ "dependencies": {
4974
+ "source-map": {
4975
+ "version": "0.4.4",
4976
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
4977
+ "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
4978
+ "dev": true,
4979
+ "requires": {
4980
+ "amdefine": "1.0.1"
4981
+ }
4982
+ }
4983
+ }
4984
+ },
4985
+ "semver": {
4986
+ "version": "4.3.6",
4987
+ "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz",
4988
+ "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=",
4989
+ "dev": true
4990
+ },
4991
+ "sequencify": {
4992
+ "version": "0.0.7",
4993
+ "resolved": "https://registry.npmjs.org/sequencify/-/sequencify-0.0.7.tgz",
4994
+ "integrity": "sha1-kM/xnQLgcCf9dn9erT57ldHnOAw=",
4995
+ "dev": true
4996
+ },
4997
+ "set-blocking": {
4998
+ "version": "2.0.0",
4999
+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
5000
+ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
5001
+ "dev": true
5002
+ },
5003
+ "set-immediate-shim": {
5004
+ "version": "1.0.1",
5005
+ "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
5006
+ "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=",
5007
+ "dev": true
5008
+ },
5009
+ "set-value": {
5010
+ "version": "2.0.0",
5011
+ "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz",
5012
+ "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==",
5013
+ "dev": true,
5014
+ "requires": {
5015
+ "extend-shallow": "2.0.1",
5016
+ "is-extendable": "0.1.1",
5017
+ "is-plain-object": "2.0.4",
5018
+ "split-string": "3.1.0"
5019
+ },
5020
+ "dependencies": {
5021
+ "extend-shallow": {
5022
+ "version": "2.0.1",
5023
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
5024
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
5025
+ "dev": true,
5026
+ "requires": {
5027
+ "is-extendable": "0.1.1"
5028
+ }
5029
+ }
5030
+ }
5031
+ },
5032
+ "shebang-command": {
5033
+ "version": "1.2.0",
5034
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
5035
+ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
5036
+ "dev": true,
5037
+ "requires": {
5038
+ "shebang-regex": "1.0.0"
5039
+ }
5040
+ },
5041
+ "shebang-regex": {
5042
+ "version": "1.0.0",
5043
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
5044
+ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
5045
+ "dev": true
5046
+ },
5047
+ "shelljs": {
5048
+ "version": "0.3.0",
5049
+ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz",
5050
+ "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=",
5051
+ "dev": true
5052
+ },
5053
+ "shellwords": {
5054
+ "version": "0.1.1",
5055
+ "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
5056
+ "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==",
5057
+ "dev": true
5058
+ },
5059
+ "sigmund": {
5060
+ "version": "1.0.1",
5061
+ "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz",
5062
+ "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=",
5063
+ "dev": true
5064
+ },
5065
+ "signal-exit": {
5066
+ "version": "3.0.2",
5067
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
5068
+ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
5069
+ "dev": true
5070
+ },
5071
+ "snapdragon": {
5072
+ "version": "0.8.2",
5073
+ "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
5074
+ "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
5075
+ "dev": true,
5076
+ "requires": {
5077
+ "base": "0.11.2",
5078
+ "debug": "2.6.9",
5079
+ "define-property": "0.2.5",
5080
+ "extend-shallow": "2.0.1",
5081
+ "map-cache": "0.2.2",
5082
+ "source-map": "0.5.7",
5083
+ "source-map-resolve": "0.5.2",
5084
+ "use": "3.1.0"
5085
+ },
5086
+ "dependencies": {
5087
+ "define-property": {
5088
+ "version": "0.2.5",
5089
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
5090
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
5091
+ "dev": true,
5092
+ "requires": {
5093
+ "is-descriptor": "0.1.6"
5094
+ }
5095
+ },
5096
+ "extend-shallow": {
5097
+ "version": "2.0.1",
5098
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
5099
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
5100
+ "dev": true,
5101
+ "requires": {
5102
+ "is-extendable": "0.1.1"
5103
+ }
5104
+ }
5105
+ }
5106
+ },
5107
+ "snapdragon-node": {
5108
+ "version": "2.1.1",
5109
+ "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
5110
+ "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
5111
+ "dev": true,
5112
+ "requires": {
5113
+ "define-property": "1.0.0",
5114
+ "isobject": "3.0.1",
5115
+ "snapdragon-util": "3.0.1"
5116
+ },
5117
+ "dependencies": {
5118
+ "define-property": {
5119
+ "version": "1.0.0",
5120
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
5121
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
5122
+ "dev": true,
5123
+ "requires": {
5124
+ "is-descriptor": "1.0.2"
5125
+ }
5126
+ },
5127
+ "is-accessor-descriptor": {
5128
+ "version": "1.0.0",
5129
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
5130
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
5131
+ "dev": true,
5132
+ "requires": {
5133
+ "kind-of": "6.0.2"
5134
+ }
5135
+ },
5136
+ "is-data-descriptor": {
5137
+ "version": "1.0.0",
5138
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
5139
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
5140
+ "dev": true,
5141
+ "requires": {
5142
+ "kind-of": "6.0.2"
5143
+ }
5144
+ },
5145
+ "is-descriptor": {
5146
+ "version": "1.0.2",
5147
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
5148
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
5149
+ "dev": true,
5150
+ "requires": {
5151
+ "is-accessor-descriptor": "1.0.0",
5152
+ "is-data-descriptor": "1.0.0",
5153
+ "kind-of": "6.0.2"
5154
+ }
5155
+ }
5156
+ }
5157
+ },
5158
+ "snapdragon-util": {
5159
+ "version": "3.0.1",
5160
+ "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
5161
+ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
5162
+ "dev": true,
5163
+ "requires": {
5164
+ "kind-of": "3.2.2"
5165
+ },
5166
+ "dependencies": {
5167
+ "kind-of": {
5168
+ "version": "3.2.2",
5169
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
5170
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
5171
+ "dev": true,
5172
+ "requires": {
5173
+ "is-buffer": "1.1.6"
5174
+ }
5175
+ }
5176
+ }
5177
+ },
5178
+ "sntp": {
5179
+ "version": "1.0.9",
5180
+ "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz",
5181
+ "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=",
5182
+ "dev": true,
5183
+ "requires": {
5184
+ "hoek": "2.16.3"
5185
+ }
5186
+ },
5187
+ "source-map": {
5188
+ "version": "0.5.7",
5189
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
5190
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
5191
+ "dev": true
5192
+ },
5193
+ "source-map-resolve": {
5194
+ "version": "0.5.2",
5195
+ "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz",
5196
+ "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==",
5197
+ "dev": true,
5198
+ "requires": {
5199
+ "atob": "2.1.1",
5200
+ "decode-uri-component": "0.2.0",
5201
+ "resolve-url": "0.2.1",
5202
+ "source-map-url": "0.4.0",
5203
+ "urix": "0.1.0"
5204
+ }
5205
+ },
5206
+ "source-map-url": {
5207
+ "version": "0.4.0",
5208
+ "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
5209
+ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=",
5210
+ "dev": true
5211
+ },
5212
+ "sparkles": {
5213
+ "version": "1.0.1",
5214
+ "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz",
5215
+ "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==",
5216
+ "dev": true
5217
+ },
5218
+ "spdx-correct": {
5219
+ "version": "3.0.0",
5220
+ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz",
5221
+ "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==",
5222
+ "dev": true,
5223
+ "requires": {
5224
+ "spdx-expression-parse": "3.0.0",
5225
+ "spdx-license-ids": "3.0.0"
5226
+ }
5227
+ },
5228
+ "spdx-exceptions": {
5229
+ "version": "2.1.0",
5230
+ "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz",
5231
+ "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==",
5232
+ "dev": true
5233
+ },
5234
+ "spdx-expression-parse": {
5235
+ "version": "3.0.0",
5236
+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
5237
+ "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
5238
+ "dev": true,
5239
+ "requires": {
5240
+ "spdx-exceptions": "2.1.0",
5241
+ "spdx-license-ids": "3.0.0"
5242
+ }
5243
+ },
5244
+ "spdx-license-ids": {
5245
+ "version": "3.0.0",
5246
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz",
5247
+ "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==",
5248
+ "dev": true
5249
+ },
5250
+ "split": {
5251
+ "version": "0.3.3",
5252
+ "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz",
5253
+ "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=",
5254
+ "dev": true,
5255
+ "requires": {
5256
+ "through": "2.3.8"
5257
+ }
5258
+ },
5259
+ "split-string": {
5260
+ "version": "3.1.0",
5261
+ "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
5262
+ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
5263
+ "dev": true,
5264
+ "requires": {
5265
+ "extend-shallow": "3.0.2"
5266
+ }
5267
+ },
5268
+ "sshpk": {
5269
+ "version": "1.14.1",
5270
+ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz",
5271
+ "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=",
5272
+ "dev": true,
5273
+ "requires": {
5274
+ "asn1": "0.2.3",
5275
+ "assert-plus": "1.0.0",
5276
+ "bcrypt-pbkdf": "1.0.1",
5277
+ "dashdash": "1.14.1",
5278
+ "ecc-jsbn": "0.1.1",
5279
+ "getpass": "0.1.7",
5280
+ "jsbn": "0.1.1",
5281
+ "tweetnacl": "0.14.5"
5282
+ },
5283
+ "dependencies": {
5284
+ "assert-plus": {
5285
+ "version": "1.0.0",
5286
+ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
5287
+ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
5288
+ "dev": true
5289
+ }
5290
+ }
5291
+ },
5292
+ "static-extend": {
5293
+ "version": "0.1.2",
5294
+ "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
5295
+ "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=",
5296
+ "dev": true,
5297
+ "requires": {
5298
+ "define-property": "0.2.5",
5299
+ "object-copy": "0.1.0"
5300
+ },
5301
+ "dependencies": {
5302
+ "define-property": {
5303
+ "version": "0.2.5",
5304
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
5305
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
5306
+ "dev": true,
5307
+ "requires": {
5308
+ "is-descriptor": "0.1.6"
5309
+ }
5310
+ }
5311
+ }
5312
+ },
5313
+ "statuses": {
5314
+ "version": "1.5.0",
5315
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
5316
+ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
5317
+ "dev": true
5318
+ },
5319
+ "stdout-stream": {
5320
+ "version": "1.4.0",
5321
+ "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.0.tgz",
5322
+ "integrity": "sha1-osfIWH5U2UJ+qe2zrD8s1SLfN4s=",
5323
+ "dev": true,
5324
+ "requires": {
5325
+ "readable-stream": "2.3.6"
5326
+ },
5327
+ "dependencies": {
5328
+ "isarray": {
5329
+ "version": "1.0.0",
5330
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
5331
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
5332
+ "dev": true
5333
+ },
5334
+ "readable-stream": {
5335
+ "version": "2.3.6",
5336
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
5337
+ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
5338
+ "dev": true,
5339
+ "requires": {
5340
+ "core-util-is": "1.0.2",
5341
+ "inherits": "2.0.3",
5342
+ "isarray": "1.0.0",
5343
+ "process-nextick-args": "2.0.0",
5344
+ "safe-buffer": "5.1.2",
5345
+ "string_decoder": "1.1.1",
5346
+ "util-deprecate": "1.0.2"
5347
+ }
5348
+ },
5349
+ "string_decoder": {
5350
+ "version": "1.1.1",
5351
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
5352
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
5353
+ "dev": true,
5354
+ "requires": {
5355
+ "safe-buffer": "5.1.2"
5356
+ }
5357
+ }
5358
+ }
5359
+ },
5360
+ "stream-combiner": {
5361
+ "version": "0.0.4",
5362
+ "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz",
5363
+ "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=",
5364
+ "dev": true,
5365
+ "requires": {
5366
+ "duplexer": "0.1.1"
5367
+ }
5368
+ },
5369
+ "stream-consume": {
5370
+ "version": "0.1.1",
5371
+ "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.1.tgz",
5372
+ "integrity": "sha512-tNa3hzgkjEP7XbCkbRXe1jpg+ievoa0O4SCFlMOYEscGSS4JJsckGL8swUyAa/ApGU3Ae4t6Honor4HhL+tRyg==",
5373
+ "dev": true
5374
+ },
5375
+ "string-template": {
5376
+ "version": "0.2.1",
5377
+ "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz",
5378
+ "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=",
5379
+ "dev": true
5380
+ },
5381
+ "string-width": {
5382
+ "version": "1.0.2",
5383
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
5384
+ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
5385
+ "dev": true,
5386
+ "requires": {
5387
+ "code-point-at": "1.1.0",
5388
+ "is-fullwidth-code-point": "1.0.0",
5389
+ "strip-ansi": "3.0.1"
5390
+ }
5391
+ },
5392
+ "string_decoder": {
5393
+ "version": "0.10.31",
5394
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
5395
+ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
5396
+ "dev": true
5397
+ },
5398
+ "stringstream": {
5399
+ "version": "0.0.6",
5400
+ "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz",
5401
+ "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==",
5402
+ "dev": true
5403
+ },
5404
+ "strip-ansi": {
5405
+ "version": "3.0.1",
5406
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
5407
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
5408
+ "dev": true,
5409
+ "requires": {
5410
+ "ansi-regex": "2.1.1"
5411
+ }
5412
+ },
5413
+ "strip-bom": {
5414
+ "version": "1.0.0",
5415
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz",
5416
+ "integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=",
5417
+ "dev": true,
5418
+ "requires": {
5419
+ "first-chunk-stream": "1.0.0",
5420
+ "is-utf8": "0.2.1"
5421
+ }
5422
+ },
5423
+ "strip-indent": {
5424
+ "version": "1.0.1",
5425
+ "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
5426
+ "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=",
5427
+ "dev": true,
5428
+ "requires": {
5429
+ "get-stdin": "4.0.1"
5430
+ }
5431
+ },
5432
+ "strip-json-comments": {
5433
+ "version": "1.0.4",
5434
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz",
5435
+ "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=",
5436
+ "dev": true
5437
+ },
5438
+ "supports-color": {
5439
+ "version": "2.0.0",
5440
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
5441
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
5442
+ "dev": true
5443
+ },
5444
+ "tar": {
5445
+ "version": "2.2.1",
5446
+ "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz",
5447
+ "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
5448
+ "dev": true,
5449
+ "requires": {
5450
+ "block-stream": "0.0.9",
5451
+ "fstream": "1.0.11",
5452
+ "inherits": "2.0.3"
5453
+ }
5454
+ },
5455
+ "through": {
5456
+ "version": "2.3.8",
5457
+ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
5458
+ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
5459
+ "dev": true
5460
+ },
5461
+ "through2": {
5462
+ "version": "2.0.3",
5463
+ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz",
5464
+ "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=",
5465
+ "dev": true,
5466
+ "requires": {
5467
+ "readable-stream": "2.3.6",
5468
+ "xtend": "4.0.1"
5469
+ },
5470
+ "dependencies": {
5471
+ "isarray": {
5472
+ "version": "1.0.0",
5473
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
5474
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
5475
+ "dev": true
5476
+ },
5477
+ "readable-stream": {
5478
+ "version": "2.3.6",
5479
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
5480
+ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
5481
+ "dev": true,
5482
+ "requires": {
5483
+ "core-util-is": "1.0.2",
5484
+ "inherits": "2.0.3",
5485
+ "isarray": "1.0.0",
5486
+ "process-nextick-args": "2.0.0",
5487
+ "safe-buffer": "5.1.2",
5488
+ "string_decoder": "1.1.1",
5489
+ "util-deprecate": "1.0.2"
5490
+ }
5491
+ },
5492
+ "string_decoder": {
5493
+ "version": "1.1.1",
5494
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
5495
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
5496
+ "dev": true,
5497
+ "requires": {
5498
+ "safe-buffer": "5.1.2"
5499
+ }
5500
+ }
5501
+ }
5502
+ },
5503
+ "tildify": {
5504
+ "version": "1.2.0",
5505
+ "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz",
5506
+ "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=",
5507
+ "dev": true,
5508
+ "requires": {
5509
+ "os-homedir": "1.0.2"
5510
+ }
5511
+ },
5512
+ "time-stamp": {
5513
+ "version": "1.1.0",
5514
+ "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz",
5515
+ "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=",
5516
+ "dev": true
5517
+ },
5518
+ "tiny-lr": {
5519
+ "version": "1.1.1",
5520
+ "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-1.1.1.tgz",
5521
+ "integrity": "sha512-44yhA3tsaRoMOjQQ+5v5mVdqef+kH6Qze9jTpqtVufgYjYt08zyZAwNwwVBj3i1rJMnR52IxOW0LK0vBzgAkuA==",
5522
+ "dev": true,
5523
+ "requires": {
5524
+ "body": "5.1.0",
5525
+ "debug": "3.1.0",
5526
+ "faye-websocket": "0.10.0",
5527
+ "livereload-js": "2.3.0",
5528
+ "object-assign": "4.1.1",
5529
+ "qs": "6.5.2"
5530
+ },
5531
+ "dependencies": {
5532
+ "debug": {
5533
+ "version": "3.1.0",
5534
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
5535
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
5536
+ "dev": true,
5537
+ "requires": {
5538
+ "ms": "2.0.0"
5539
+ }
5540
+ },
5541
+ "faye-websocket": {
5542
+ "version": "0.10.0",
5543
+ "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz",
5544
+ "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=",
5545
+ "dev": true,
5546
+ "requires": {
5547
+ "websocket-driver": "0.7.0"
5548
+ }
5549
+ },
5550
+ "qs": {
5551
+ "version": "6.5.2",
5552
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
5553
+ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
5554
+ "dev": true
5555
+ }
5556
+ }
5557
+ },
5558
+ "to-object-path": {
5559
+ "version": "0.3.0",
5560
+ "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
5561
+ "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=",
5562
+ "dev": true,
5563
+ "requires": {
5564
+ "kind-of": "3.2.2"
5565
+ },
5566
+ "dependencies": {
5567
+ "kind-of": {
5568
+ "version": "3.2.2",
5569
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
5570
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
5571
+ "dev": true,
5572
+ "requires": {
5573
+ "is-buffer": "1.1.6"
5574
+ }
5575
+ }
5576
+ }
5577
+ },
5578
+ "to-regex": {
5579
+ "version": "3.0.2",
5580
+ "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
5581
+ "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
5582
+ "dev": true,
5583
+ "requires": {
5584
+ "define-property": "2.0.2",
5585
+ "extend-shallow": "3.0.2",
5586
+ "regex-not": "1.0.2",
5587
+ "safe-regex": "1.1.0"
5588
+ }
5589
+ },
5590
+ "to-regex-range": {
5591
+ "version": "2.1.1",
5592
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
5593
+ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
5594
+ "dev": true,
5595
+ "requires": {
5596
+ "is-number": "3.0.0",
5597
+ "repeat-string": "1.6.1"
5598
+ }
5599
+ },
5600
+ "tough-cookie": {
5601
+ "version": "2.3.4",
5602
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz",
5603
+ "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==",
5604
+ "dev": true,
5605
+ "requires": {
5606
+ "punycode": "1.4.1"
5607
+ }
5608
+ },
5609
+ "trim-newlines": {
5610
+ "version": "1.0.0",
5611
+ "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
5612
+ "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=",
5613
+ "dev": true
5614
+ },
5615
+ "true-case-path": {
5616
+ "version": "1.0.2",
5617
+ "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.2.tgz",
5618
+ "integrity": "sha1-fskRMJJHZsf1c74wIMNPj9/QDWI=",
5619
+ "dev": true,
5620
+ "requires": {
5621
+ "glob": "6.0.4"
5622
+ },
5623
+ "dependencies": {
5624
+ "glob": {
5625
+ "version": "6.0.4",
5626
+ "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
5627
+ "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=",
5628
+ "dev": true,
5629
+ "requires": {
5630
+ "inflight": "1.0.6",
5631
+ "inherits": "2.0.3",
5632
+ "minimatch": "3.0.4",
5633
+ "once": "1.4.0",
5634
+ "path-is-absolute": "1.0.1"
5635
+ }
5636
+ }
5637
+ }
5638
+ },
5639
+ "tunnel-agent": {
5640
+ "version": "0.4.3",
5641
+ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz",
5642
+ "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=",
5643
+ "dev": true
5644
+ },
5645
+ "tweetnacl": {
5646
+ "version": "0.14.5",
5647
+ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
5648
+ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
5649
+ "dev": true,
5650
+ "optional": true
5651
+ },
5652
+ "type-is": {
5653
+ "version": "1.6.16",
5654
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz",
5655
+ "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
5656
+ "dev": true,
5657
+ "requires": {
5658
+ "media-typer": "0.3.0",
5659
+ "mime-types": "2.1.18"
5660
+ }
5661
+ },
5662
+ "uglify-js": {
5663
+ "version": "3.3.25",
5664
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.25.tgz",
5665
+ "integrity": "sha512-hobogryjDV36VrLK3Y69ou4REyrTApzUblVFmdQOYRe8cYaSmFJXMb4dR9McdvYDSbeNdzUgYr2YVukJaErJcA==",
5666
+ "dev": true,
5667
+ "requires": {
5668
+ "commander": "2.15.1",
5669
+ "source-map": "0.6.1"
5670
+ },
5671
+ "dependencies": {
5672
+ "source-map": {
5673
+ "version": "0.6.1",
5674
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
5675
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
5676
+ "dev": true
5677
+ }
5678
+ }
5679
+ },
5680
+ "unc-path-regex": {
5681
+ "version": "0.1.2",
5682
+ "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
5683
+ "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=",
5684
+ "dev": true
5685
+ },
5686
+ "union-value": {
5687
+ "version": "1.0.0",
5688
+ "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz",
5689
+ "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=",
5690
+ "dev": true,
5691
+ "requires": {
5692
+ "arr-union": "3.1.0",
5693
+ "get-value": "2.0.6",
5694
+ "is-extendable": "0.1.1",
5695
+ "set-value": "0.4.3"
5696
+ },
5697
+ "dependencies": {
5698
+ "extend-shallow": {
5699
+ "version": "2.0.1",
5700
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
5701
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
5702
+ "dev": true,
5703
+ "requires": {
5704
+ "is-extendable": "0.1.1"
5705
+ }
5706
+ },
5707
+ "set-value": {
5708
+ "version": "0.4.3",
5709
+ "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz",
5710
+ "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=",
5711
+ "dev": true,
5712
+ "requires": {
5713
+ "extend-shallow": "2.0.1",
5714
+ "is-extendable": "0.1.1",
5715
+ "is-plain-object": "2.0.4",
5716
+ "to-object-path": "0.3.0"
5717
+ }
5718
+ }
5719
+ }
5720
+ },
5721
+ "unique-stream": {
5722
+ "version": "1.0.0",
5723
+ "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz",
5724
+ "integrity": "sha1-1ZpKdUJ0R9mqbJHnAmP40mpLEEs=",
5725
+ "dev": true
5726
+ },
5727
+ "unpipe": {
5728
+ "version": "1.0.0",
5729
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
5730
+ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=",
5731
+ "dev": true
5732
+ },
5733
+ "unset-value": {
5734
+ "version": "1.0.0",
5735
+ "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
5736
+ "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=",
5737
+ "dev": true,
5738
+ "requires": {
5739
+ "has-value": "0.3.1",
5740
+ "isobject": "3.0.1"
5741
+ },
5742
+ "dependencies": {
5743
+ "has-value": {
5744
+ "version": "0.3.1",
5745
+ "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
5746
+ "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=",
5747
+ "dev": true,
5748
+ "requires": {
5749
+ "get-value": "2.0.6",
5750
+ "has-values": "0.1.4",
5751
+ "isobject": "2.1.0"
5752
+ },
5753
+ "dependencies": {
5754
+ "isobject": {
5755
+ "version": "2.1.0",
5756
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
5757
+ "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
5758
+ "dev": true,
5759
+ "requires": {
5760
+ "isarray": "1.0.0"
5761
+ }
5762
+ }
5763
+ }
5764
+ },
5765
+ "has-values": {
5766
+ "version": "0.1.4",
5767
+ "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
5768
+ "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=",
5769
+ "dev": true
5770
+ },
5771
+ "isarray": {
5772
+ "version": "1.0.0",
5773
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
5774
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
5775
+ "dev": true
5776
+ }
5777
+ }
5778
+ },
5779
+ "urix": {
5780
+ "version": "0.1.0",
5781
+ "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
5782
+ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
5783
+ "dev": true
5784
+ },
5785
+ "use": {
5786
+ "version": "3.1.0",
5787
+ "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz",
5788
+ "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==",
5789
+ "dev": true,
5790
+ "requires": {
5791
+ "kind-of": "6.0.2"
5792
+ }
5793
+ },
5794
+ "user-home": {
5795
+ "version": "1.1.1",
5796
+ "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz",
5797
+ "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=",
5798
+ "dev": true
5799
+ },
5800
+ "util-deprecate": {
5801
+ "version": "1.0.2",
5802
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
5803
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
5804
+ "dev": true
5805
+ },
5806
+ "uuid": {
5807
+ "version": "3.2.1",
5808
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz",
5809
+ "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==",
5810
+ "dev": true
5811
+ },
5812
+ "v8flags": {
5813
+ "version": "2.1.1",
5814
+ "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz",
5815
+ "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=",
5816
+ "dev": true,
5817
+ "requires": {
5818
+ "user-home": "1.1.1"
5819
+ }
5820
+ },
5821
+ "validate-npm-package-license": {
5822
+ "version": "3.0.3",
5823
+ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz",
5824
+ "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==",
5825
+ "dev": true,
5826
+ "requires": {
5827
+ "spdx-correct": "3.0.0",
5828
+ "spdx-expression-parse": "3.0.0"
5829
+ }
5830
+ },
5831
+ "verror": {
5832
+ "version": "1.10.0",
5833
+ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
5834
+ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
5835
+ "dev": true,
5836
+ "requires": {
5837
+ "assert-plus": "1.0.0",
5838
+ "core-util-is": "1.0.2",
5839
+ "extsprintf": "1.3.0"
5840
+ },
5841
+ "dependencies": {
5842
+ "assert-plus": {
5843
+ "version": "1.0.0",
5844
+ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
5845
+ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
5846
+ "dev": true
5847
+ }
5848
+ }
5849
+ },
5850
+ "vinyl": {
5851
+ "version": "0.5.3",
5852
+ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz",
5853
+ "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=",
5854
+ "dev": true,
5855
+ "requires": {
5856
+ "clone": "1.0.4",
5857
+ "clone-stats": "0.0.1",
5858
+ "replace-ext": "0.0.1"
5859
+ }
5860
+ },
5861
+ "vinyl-fs": {
5862
+ "version": "0.3.14",
5863
+ "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz",
5864
+ "integrity": "sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY=",
5865
+ "dev": true,
5866
+ "requires": {
5867
+ "defaults": "1.0.3",
5868
+ "glob-stream": "3.1.18",
5869
+ "glob-watcher": "0.0.6",
5870
+ "graceful-fs": "3.0.11",
5871
+ "mkdirp": "0.5.1",
5872
+ "strip-bom": "1.0.0",
5873
+ "through2": "0.6.5",
5874
+ "vinyl": "0.4.6"
5875
+ },
5876
+ "dependencies": {
5877
+ "clone": {
5878
+ "version": "0.2.0",
5879
+ "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz",
5880
+ "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=",
5881
+ "dev": true
5882
+ },
5883
+ "readable-stream": {
5884
+ "version": "1.0.34",
5885
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
5886
+ "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
5887
+ "dev": true,
5888
+ "requires": {
5889
+ "core-util-is": "1.0.2",
5890
+ "inherits": "2.0.3",
5891
+ "isarray": "0.0.1",
5892
+ "string_decoder": "0.10.31"
5893
+ }
5894
+ },
5895
+ "through2": {
5896
+ "version": "0.6.5",
5897
+ "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz",
5898
+ "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=",
5899
+ "dev": true,
5900
+ "requires": {
5901
+ "readable-stream": "1.0.34",
5902
+ "xtend": "4.0.1"
5903
+ }
5904
+ },
5905
+ "vinyl": {
5906
+ "version": "0.4.6",
5907
+ "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz",
5908
+ "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=",
5909
+ "dev": true,
5910
+ "requires": {
5911
+ "clone": "0.2.0",
5912
+ "clone-stats": "0.0.1"
5913
+ }
5914
+ }
5915
+ }
5916
+ },
5917
+ "vinyl-sourcemaps-apply": {
5918
+ "version": "0.2.1",
5919
+ "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz",
5920
+ "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=",
5921
+ "dev": true,
5922
+ "requires": {
5923
+ "source-map": "0.5.7"
5924
+ }
5925
+ },
5926
+ "websocket-driver": {
5927
+ "version": "0.7.0",
5928
+ "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz",
5929
+ "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=",
5930
+ "dev": true,
5931
+ "requires": {
5932
+ "http-parser-js": "0.4.12",
5933
+ "websocket-extensions": "0.1.3"
5934
+ }
5935
+ },
5936
+ "websocket-extensions": {
5937
+ "version": "0.1.3",
5938
+ "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz",
5939
+ "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==",
5940
+ "dev": true
5941
+ },
5942
+ "which": {
5943
+ "version": "1.3.0",
5944
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz",
5945
+ "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==",
5946
+ "dev": true,
5947
+ "requires": {
5948
+ "isexe": "2.0.0"
5949
+ }
5950
+ },
5951
+ "which-module": {
5952
+ "version": "1.0.0",
5953
+ "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
5954
+ "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=",
5955
+ "dev": true
5956
+ },
5957
+ "wide-align": {
5958
+ "version": "1.1.2",
5959
+ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz",
5960
+ "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==",
5961
+ "dev": true,
5962
+ "requires": {
5963
+ "string-width": "1.0.2"
5964
+ }
5965
+ },
5966
+ "wp-pot": {
5967
+ "version": "1.6.1",
5968
+ "resolved": "https://registry.npmjs.org/wp-pot/-/wp-pot-1.6.1.tgz",
5969
+ "integrity": "sha512-rB57DFGxERyghmCOm1H+cioxq4Cu2HksvtwZJuJOKPB0dYbbfpLerGJ6CPQ1VV7VQp67OcwCzBSuFc7S2rd13A==",
5970
+ "dev": true,
5971
+ "requires": {
5972
+ "matched": "2.0.1",
5973
+ "path-sort": "0.1.0",
5974
+ "php-parser": "3.0.0-alpha2"
5975
+ }
5976
+ },
5977
+ "wrap-ansi": {
5978
+ "version": "2.1.0",
5979
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
5980
+ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
5981
+ "dev": true,
5982
+ "requires": {
5983
+ "string-width": "1.0.2",
5984
+ "strip-ansi": "3.0.1"
5985
+ }
5986
+ },
5987
+ "wrappy": {
5988
+ "version": "1.0.2",
5989
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
5990
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
5991
+ "dev": true
5992
+ },
5993
+ "xtend": {
5994
+ "version": "4.0.1",
5995
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
5996
+ "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=",
5997
+ "dev": true
5998
+ },
5999
+ "y18n": {
6000
+ "version": "3.2.1",
6001
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
6002
+ "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=",
6003
+ "dev": true
6004
+ },
6005
+ "yallist": {
6006
+ "version": "2.1.2",
6007
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
6008
+ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
6009
+ "dev": true
6010
+ },
6011
+ "yargs": {
6012
+ "version": "7.1.0",
6013
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz",
6014
+ "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=",
6015
+ "dev": true,
6016
+ "requires": {
6017
+ "camelcase": "3.0.0",
6018
+ "cliui": "3.2.0",
6019
+ "decamelize": "1.2.0",
6020
+ "get-caller-file": "1.0.2",
6021
+ "os-locale": "1.4.0",
6022
+ "read-pkg-up": "1.0.1",
6023
+ "require-directory": "2.1.1",
6024
+ "require-main-filename": "1.0.1",
6025
+ "set-blocking": "2.0.0",
6026
+ "string-width": "1.0.2",
6027
+ "which-module": "1.0.0",
6028
+ "y18n": "3.2.1",
6029
+ "yargs-parser": "5.0.0"
6030
+ },
6031
+ "dependencies": {
6032
+ "camelcase": {
6033
+ "version": "3.0.0",
6034
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
6035
+ "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=",
6036
+ "dev": true
6037
+ }
6038
+ }
6039
+ },
6040
+ "yargs-parser": {
6041
+ "version": "5.0.0",
6042
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz",
6043
+ "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=",
6044
+ "dev": true,
6045
+ "requires": {
6046
+ "camelcase": "3.0.0"
6047
+ },
6048
+ "dependencies": {
6049
+ "camelcase": {
6050
+ "version": "3.0.0",
6051
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
6052
+ "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=",
6053
+ "dev": true
6054
+ }
6055
+ }
6056
+ }
6057
+ }
6058
+ }
readme.txt CHANGED
@@ -7,7 +7,7 @@ Plugin URI: https://www.wcvendors.com/
7
  Requires at least: 4.4.0
8
  Requires PHP: 5.6
9
  Tested up to: 4.9.5
10
- Stable tag: 2.0.2
11
  License: GPLv2 or later
12
 
13
  The free marketplace plugin for WooCommerce. Now you can allow anyone to open a store on your WooCommerce site!
@@ -19,8 +19,10 @@ WC Vendors was released to the market in October of 2014 having gotten its roots
19
 
20
  == Announcements ==
21
 
 
22
  * WC Vendors 2.0 is a major update, this will affect some stores using other WC Vendors integrations.
23
- * PayPal has depreciated Adaptive Payments as of September 1st 2017. This will soon cease to function. We provide an instant payment solution via our <a href="https://www.wcvendors.com/product/wc-vendors-pro/?utm_source=sport&utm_medium=pluginpage&utm_campaign=description?utm_source=wporg">Stripe Gateway</a> however there are 3rd party extensions from MangoPay and Escrow that also provide vendor commission payouts.
 
24
 
25
  == Features ==
26
 
@@ -56,7 +58,7 @@ The following features are available as a part of the free WC Vendors plugin.
56
 
57
  = WC Vendors Pro =
58
 
59
- The following features are part of <a href="https://www.wcvendors.com/product/wc-vendors-pro/?utm_source=sport&utm_medium=pluginpage&utm_campaign=description?utm_source=wporg">WC Vendors Pro</a> our feature rich addition to your marketplace. Move all your vendors tasks to the frontend. They no longer need or see the WordPress admin.
60
 
61
  * Vendors have a main dashboard showing sales reports and recent orders and products.
62
  * Vendors have complete front end product management
@@ -76,7 +78,7 @@ The following features are part of <a href="https://www.wcvendors.com/product/wc
76
  * Premium ticket based support for all pro users. Annual and lifetime support licenses available.
77
  * There's more features to Pro than listed here!
78
 
79
- See our full comparison of free vs pro here <a href="https://www.wcvendors.com/home/comparison/?utm_source=sport&utm_medium=pluginpage&utm_campaign=description?utm_source=wporg">Compare free and pro</a>
80
 
81
  = Translations =
82
 
@@ -140,6 +142,13 @@ WC Vendors does not work with multisite WordPress. There are no plans to support
140
 
141
  == Changelog ==
142
 
 
 
 
 
 
 
 
143
  = Version 2.0.2 - 17th May 2018 =
144
 
145
  * Fixed: Corrected settings conditional checks across classes
7
  Requires at least: 4.4.0
8
  Requires PHP: 5.6
9
  Tested up to: 4.9.5
10
+ Stable tag: 2.0.3
11
  License: GPLv2 or later
12
 
13
  The free marketplace plugin for WooCommerce. Now you can allow anyone to open a store on your WooCommerce site!
19
 
20
  == Announcements ==
21
 
22
+ * Please read our recent blog post <a href="https://www.wcvendors.com/2018/05/payments-explained/?utm_campaign=announcements?utm_source=wporg">Payments Explained</a> for solutions to your vendor commission payments. Including Stripe, Paypal and others.
23
  * WC Vendors 2.0 is a major update, this will affect some stores using other WC Vendors integrations.
24
+ * PayPal has depreciated Adaptive Payments as of September 1st 2017. This will soon cease to function. We provide an instant payment solution via our <a href="https://www.wcvendors.com/product/wc-vendors-pro/?utm_campaign=annoucements?utm_source=wporg">Stripe Gateway</a> however there are 3rd party extensions from MangoPay and Escrow that also provide vendor commission payouts.
25
+
26
 
27
  == Features ==
28
 
58
 
59
  = WC Vendors Pro =
60
 
61
+ The following features are part of <a href="https://www.wcvendors.com/product/wc-vendors-pro/?utm_campaign=description?utm_source=wporg">WC Vendors Pro</a> our feature rich addition to your marketplace. Move all your vendors tasks to the frontend. They no longer need or see the WordPress admin.
62
 
63
  * Vendors have a main dashboard showing sales reports and recent orders and products.
64
  * Vendors have complete front end product management
78
  * Premium ticket based support for all pro users. Annual and lifetime support licenses available.
79
  * There's more features to Pro than listed here!
80
 
81
+ See our full comparison of free vs pro here <a href="https://www.wcvendors.com/home/comparison/?&utm_campaign=description?utm_source=wporg">Compare free and pro</a>
82
 
83
  = Translations =
84
 
142
 
143
  == Changelog ==
144
 
145
+ = Version 2.0.3 - 18th May 2018 =
146
+
147
+ * Added: Export Commission Sum Totals
148
+ * Added: New setting to rename vendors store wide
149
+ * Fixed: Update Dialog is stuck #409
150
+ * Updated: Langage file
151
+
152
  = Version 2.0.2 - 17th May 2018 =
153
 
154
  * Fixed: Corrected settings conditional checks across classes
templates/emails/vendor-notify-order.php CHANGED
@@ -19,7 +19,7 @@
19
  */
20
  do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
21
 
22
- <p><?php printf( __( 'You have received an order from %s. The order is as follows:', 'woocommerce' ), $order->get_formatted_billing_full_name() ); ?></p>
23
 
24
  <?php
25
 
19
  */
20
  do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
21
 
22
+ <p><?php printf( __( 'You have received an order from %s. The order is as follows:', 'wc-vendors' ), $order->get_formatted_billing_full_name() ); ?></p>
23
 
24
  <?php
25
 
trunk/assets/banner-1544x500.png ADDED
Binary file
trunk/assets/banner-772x250.png ADDED
Binary file
trunk/assets/css/_variables.scss ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WooCommerce CSS Variables
3
+ */
4
+
5
+ $wcvendors: #005580;
6
+ $wcvendors-light: #5897b6;
7
+ $green: #7ad03a;
8
+ $red: #a00;
9
+ $orange: #ffba00;
10
+ $blue: #2ea2cc;
11
+
12
+ $primary: #a46497; // Primary color for buttons (alt)
13
+ $primarytext: desaturate(lighten($primary, 50%), 18%); // Text on primary color bg
14
+
15
+ $secondary: desaturate(lighten($primary, 40%), 21%); // Secondary buttons
16
+ $secondarytext: desaturate(darken($secondary, 60%), 21%); // Text on secondary color bg
17
+
18
+ $highlight: adjust-hue($primary, 150deg); // Prices, In stock labels, sales flash
19
+ $highlightext: desaturate(lighten($highlight, 50%), 18%); // Text on highlight color bg
20
+
21
+ $contentbg: #fff; // Content BG - Tabs (active state)
22
+ $subtext: #777; // small, breadcrumbs etc
23
+ $white: #fff;
trunk/assets/css/admin-orders.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ .wp-list-table .column-order_id { width: 10%; }
2
+ .wp-list-table .column-customer { width: 15%; }
3
+ .wp-list-table .column-product { width: 35%; }
4
+ .wp-list-table .column-total { width: 10%;}
5
+ /*.wp-list-table .column-comments { width: 27.5%;}*/
6
+ .wp-list-table .column-date { width: 15%;}
7
+ .wp-list-table .column-status { width: 15%;}
trunk/assets/css/select2.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
trunk/assets/css/wcv-activation.css ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** activation.scss Styles applied to elements displayed on activation */
2
+ /** Styling begins */
3
+ div.wcvendors-message { overflow: hidden; position: relative; border-left-color: #005580 !important; }
4
+
5
+ div.wcvendors-message p { max-width: 700px; }
6
+
7
+ div.wcvendors-message p:last-child { max-width: inherit; }
8
+
9
+ p.wcvendors-actions .button-primary, .wcvendors-message .button-primary { background: #005580; border-color: #005580; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #a36597; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #a36597; color: #fff; text-shadow: 0 -1px 1px #005580, 1px 0 1px #005580, 0 1px 1px #005580, -1px 0 1px #005580; }
10
+
11
+ p.wcvendors-actions .button-primary:hover, p.wcvendors-actions .button-primary:focus, p.wcvendors-actions .button-primary:active, .wcvendors-message .button-primary:hover, .wcvendors-message .button-primary:focus, .wcvendors-message .button-primary:active { background: #005580; border-color: #005580; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #005580; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #005580; }
12
+
13
+ p.wcvendors-actions a.wcvendors-message-close, .wcvendors-message a.wcvendors-message-close { position: absolute; top: 0; right: 0; padding: 10px 15px 10px 21px; font-size: 13px; line-height: 1.23076923; text-decoration: none; }
14
+
15
+ p.wcvendors-actions a.wcvendors-message-close::before, .wcvendors-message a.wcvendors-message-close::before { position: absolute; top: 8px; left: 0; -webkit-transition: all 0.1s ease-in-out; transition: all 0.1s ease-in-out; }
16
+
17
+ p.wcvendors-actions .button-primary, p.wcvendors-actions .button-secondary, .wcvendors-message .button-primary, .wcvendors-message .button-secondary { text-decoration: none !important; }
18
+
19
+ p.wcvendors-actions .twitter-share-button, .wcvendors-message .twitter-share-button { margin-top: -3px; margin-left: 3px; vertical-align: middle; }
20
+
21
+ p.wcvendors-actions, .wcvendors-about-text { margin-bottom: 1em !important; }
trunk/assets/css/wcv-activation.min.css ADDED
@@ -0,0 +1 @@
 
1
+ div.wcvendors-message{overflow:hidden;position:relative;border-left-color:#005580!important}div.wcvendors-message p{max-width:700px}div.wcvendors-message p:last-child{max-width:inherit}.wcvendors-message .button-primary,p.wcvendors-actions .button-primary{background:#005580;border-color:#005580;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #005580,1px 0 1px #005580,0 1px 1px #005580,-1px 0 1px #005580}.wcvendors-message .button-primary:active,.wcvendors-message .button-primary:focus,.wcvendors-message .button-primary:hover,p.wcvendors-actions .button-primary:active,p.wcvendors-actions .button-primary:focus,p.wcvendors-actions .button-primary:hover{background:#005580;border-color:#005580;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #005580;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #005580}.wcvendors-message a.wcvendors-message-close,p.wcvendors-actions a.wcvendors-message-close{position:absolute;top:0;right:0;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.wcvendors-message a.wcvendors-message-close::before,p.wcvendors-actions a.wcvendors-message-close::before{position:absolute;top:8px;left:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.wcvendors-message .button-primary,.wcvendors-message .button-secondary,p.wcvendors-actions .button-primary,p.wcvendors-actions .button-secondary{text-decoration:none!important}.wcvendors-message .twitter-share-button,p.wcvendors-actions .twitter-share-button{margin-top:-3px;margin-left:3px;vertical-align:middle}.wcvendors-about-text,p.wcvendors-actions{margin-bottom:1em!important}
trunk/assets/css/wcv-activation.scss ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * activation.scss
3
+ * Styles applied to elements displayed on activation
4
+ */
5
+
6
+ /**
7
+ * Styling begins
8
+ */
9
+ div.wcvendors-message {
10
+ overflow: hidden;
11
+ position: relative;
12
+ border-left-color: #005580 !important;
13
+ p {
14
+ max-width: 700px;
15
+ }
16
+ p:last-child {
17
+ max-width: inherit;
18
+ }
19
+ }
20
+
21
+ p.wcvendors-actions,
22
+ .wcvendors-message {
23
+ .button-primary {
24
+ background: #005580;
25
+ border-color: #005580;
26
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #a36597;
27
+ color: #fff;
28
+ text-shadow: 0 -1px 1px #005580, 1px 0 1px #005580, 0 1px 1px #005580, -1px 0 1px #005580;
29
+
30
+ &:hover, &:focus, &:active {
31
+ background: #005580;
32
+ border-color: #005580;
33
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #005580;
34
+ }
35
+ }
36
+
37
+ a.wcvendors-message-close {
38
+ position: absolute;
39
+ top: 0;
40
+ right: 0;
41
+ padding: 10px 15px 10px 21px;
42
+ font-size: 13px;
43
+ line-height: 1.23076923;
44
+ text-decoration: none;
45
+ &::before {
46
+ position: absolute;
47
+ top: 8px;
48
+ left: 0;
49
+ transition: all 0.1s ease-in-out;
50
+ }
51
+ }
52
+
53
+ .button-primary,
54
+ .button-secondary {
55
+ text-decoration: none !important;
56
+ }
57
+
58
+ .twitter-share-button {
59
+ margin-top: -3px;
60
+ margin-left: 3px;
61
+ vertical-align: middle;
62
+ }
63
+ }
64
+
65
+ p.wcvendors-actions,
66
+ .wcvendors-about-text {
67
+ margin-bottom: 1em !important;
68
+ }
trunk/assets/css/wcv-admin.css ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wcv_addons_wrap { max-width: 1200px; }
2
+
3
+ .wcv_addons_wrap h1.search-form-title { clear: left; padding: 0; }
4
+
5
+ .wcv_addons_wrap .update-plugins .update-count { background-color: #d54e21; border-radius: 10px; color: #fff; display: inline-block; font-size: 9px; font-weight: 600; line-height: 17px; margin: 1px 0 0 2px; padding: 0 6px; vertical-align: text-top; }
6
+
7
+ .wcv_addons_wrap .addons-featured { margin: 0; }
8
+
9
+ .wcv_addons_wrap ul.feature-list { list-style: inherit; }
10
+
11
+ .wcv_addons_wrap ul.feature-list li { margin-left: 20px; }
12
+
13
+ .wcv_addons_wrap ul.subsubsub.subsubsub { margin: -2px 0 12px; }
14
+
15
+ .wcv_addons_wrap .subsubsub li::after { content: '|'; }
16
+
17
+ .wcv_addons_wrap .subsubsub li:last-child::after { content: ''; }
18
+
19
+ .wcv_addons_wrap .addons-banner-block-item-icon, .wcv_addons_wrap .addons-column-block-item-icon { -webkit-box-align: center; -ms-flex-align: center; align-items: center; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; }
20
+
21
+ .wcv_addons_wrap .addons-banner-block, .wcv_addons_wrap .addons-wcs-banner-block { background: #ffffff; border: 1px solid #ddd; margin: 0 0 1em 0; padding: 2em 2em 1em; }
22
+
23
+ .wcv_addons_wrap .addons-banner-block img { height: 62px; }
24
+
25
+ .wcv_addons_wrap .addons-banner-block p { margin: 0 0 20px; }
26
+
27
+ .wcv_addons_wrap .addons-banner-block-items { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; -ms-flex-wrap: wrap; flex-wrap: wrap; -ms-flex-pack: distribute; justify-content: space-around; margin: 0 -10px 0 -10px; }
28
+
29
+ .wcv_addons_wrap .addons-banner-block-item { border: 1px solid #e6e6e6; border-radius: 3px; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; margin: 1em; min-width: 200px; width: 30%; }
30
+
31
+ .wcv_addons_wrap .addons-banner-block-item-icon { background: #f7f7f7; height: 143px; }
32
+
33
+ .wcv_addons_wrap .addons-banner-block-item-content { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; height: 184px; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; padding: 24px; }
34
+
35
+ .wcv_addons_wrap .addons-banner-block-item-content h3 { margin-top: 0; }
36
+
37
+ .wcv_addons_wrap .addons-banner-block-item-content p { margin: 0 0 auto; }
38
+
39
+ .wcv_addons_wrap .addons-wcs-banner-block { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; }
40
+
41
+ .wcv_addons_wrap .addons-wcs-banner-block-image { background: #f7f7f7; border: 1px solid #e6e6e6; margin-right: 2em; width: 400px; padding: 1em; text-align: center; }
42
+
43
+ .wcv_addons_wrap .addons-wcs-banner-block-image .addons-img { margin: auto 0; max-height: 350px; max-width: 350px; }
44
+
45
+ .wcv_addons_wrap .addons-shipping-methods .addons-wcs-banner-block { margin-left: 0; margin-right: 0; margin-top: 1em; }
46
+
47
+ .wcv_addons_wrap .addons-wcs-banner-block-content { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -ms-flex-pack: distribute; justify-content: space-around; -ms-flex-item-align: stretch; align-self: stretch; padding: 1em 0; }
48
+
49
+ .wcv_addons_wrap .addons-wcs-banner-block-content h1 { padding-bottom: 0; }
50
+
51
+ .wcv_addons_wrap .addons-wcs-banner-block-content p { margin-bottom: 0; }
52
+
53
+ .wcv_addons_wrap .addons-wcs-banner-block-content .wcs-service-logo { max-width: 40px; }
54
+
55
+ .wcv_addons_wrap .addons-column-section { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; -ms-flex-wrap: wrap; flex-wrap: wrap; -ms-flex-pack: distribute; justify-content: space-around; }
56
+
57
+ .wcv_addons_wrap .addons-column { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; width: 50%; padding: 0 .5em; }
58
+
59
+ .wcv_addons_wrap .addons-column:nth-child(2) { margin-right: 0; }
60
+
61
+ .wcv_addons_wrap .addons-small-light-block, .wcv_addons_wrap .addons-small-dark-block, .wcv_addons_wrap .addons-column-block { -webkit-box-sizing: border-box; box-sizing: border-box; border: 1px solid #ddd; margin: 0 0 1em; padding: 20px; }
62
+
63
+ .wcv_addons_wrap .addons-column-block img { max-height: 50px; max-width: 50px; }
64
+
65
+ .wcv_addons_wrap .addons-small-light-block, .wcv_addons_wrap .addons-column-block { background: #ffffff; }
66
+
67
+ .wcv_addons_wrap .addons-column-block-left { float: left; }
68
+
69
+ .wcv_addons_wrap .addons-column-block-right { float: right; }
70
+
71
+ .wcv_addons_wrap .addons-column-block-item { border-top: 2px solid #f9f9f9; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; -ms-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; margin: 0 -20px; padding: 20px; }
72
+
73
+ .wcv_addons_wrap .addons-column-block-item-icon { background: #f7f7f7; border: 1px solid #e6e6e6; height: 100px; margin: 0 10px 10px 0; width: 100px; }
74
+
75
+ .wcv_addons_wrap .addons-column-block-item-content { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; -ms-flex-wrap: wrap; flex-wrap: wrap; height: 20%; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; min-width: 200px; }
76
+
77
+ .wcv_addons_wrap .addons-column-block-item-content h2 { float: left; margin-top: 8px; }
78
+
79
+ .wcv_addons_wrap .addons-column-block-item-content a { float: right; }
80
+
81
+ .wcv_addons_wrap .addons-column-block-item-content p { float: left; }
82
+
83
+ .wcv_addons_wrap .addons-banner-block-item, .wcv_addons_wrap .addons-column-block-item { display: none; }
84
+
85
+ .wcv_addons_wrap .addons-banner-block-item:nth-child(-n+3) { display: block; }
86
+
87
+ .wcv_addons_wrap .addons-column-block-item:nth-of-type(-n+3) { display: -webkit-box; display: -ms-flexbox; display: flex; }
88
+
89
+ .wcv_addons_wrap .addons-small-dark-block { background-color: #54687d; text-align: center; }
90
+
91
+ .wcv_addons_wrap .addons-small-dark-items { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; -ms-flex-pack: distribute; justify-content: space-around; }
92
+
93
+ .wcv_addons_wrap .addons-small-dark-item { margin: 0 0 20px; }
94
+
95
+ .wcv_addons_wrap .addons-small-dark-block h1 { color: #ffffff; }
96
+
97
+ .wcv_addons_wrap .addons-small-dark-block p { color: #fafafa; }
98
+
99
+ .wcv_addons_wrap .addons-small-dark-item-icon img { height: 30px; }
100
+
101
+ .wcv_addons_wrap .addons-small-dark-item a { margin: 28px auto 0; }
102
+
103
+ .wcv_addons_wrap .addons-small-light-block { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; }
104
+
105
+ .wcv_addons_wrap .addons-small-light-block h1 { margin-top: -12px; }
106
+
107
+ .wcv_addons_wrap .addons-small-light-block p { margin-top: 0; }
108
+
109
+ .wcv_addons_wrap .addons-small-light-block img { height: 225px; margin: 0 0 0 -20px; }
110
+
111
+ .wcv_addons_wrap .addons-small-light-block-content { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-flex: 1; -ms-flex: 1 1 100px; flex: 1 1 100px; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -ms-flex-pack: distribute; justify-content: space-around; }
112
+
113
+ .wcv_addons_wrap .addons-small-light-block-buttons { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }
114
+
115
+ .wcv_addons_wrap .addons-small-light-block-content a { width: 48%; }
116
+
117
+ .wcv_addons_wrap .product-addons-button { cursor: pointer; display: block; height: 37px; line-height: 37px; text-align: center; text-decoration: none; width: 124px; }
118
+
119
+ .wcv_addons_wrap .product-addons-button-solid { background-color: #005580; color: #ffffff; }
120
+
121
+ .wcv_addons_wrap .addons-button { border-radius: 3px; cursor: pointer; display: block; height: 37px; line-height: 37px; text-align: center; text-decoration: none; width: 124px; }
122
+
123
+ .wcv_addons_wrap .addons-button-solid { background-color: #005580; color: #ffffff; }
124
+
125
+ .wcv_addons_wrap .addons-button-solid:hover { color: #ffffff; opacity: 0.8; }
126
+
127
+ .wcv_addons_wrap .addons-button-outline-green { border: 1px solid #73ae39; color: #73ae39; }
128
+
129
+ .wcv_addons_wrap .addons-button-outline-green:hover { color: #73ae39; opacity: 0.8; }
130
+
131
+ .wcv_addons_wrap .addons-button-outline-white { border: 1px solid #ffffff; color: #ffffff; }
132
+
133
+ .wcv_addons_wrap .addons-button-outline-white:hover { color: #ffffff; opacity: 0.8; }
134
+
135
+ .wcv_addons_wrap .addons-button-installed { background: #e6e6e6; color: #3c3c3c; }
136
+
137
+ .wcv_addons_wrap .addons-button-installed:hover { color: #3c3c3c; opacity: 0.8; }
138
+
139
+ @media only screen and (max-width: 400px) { .wcv_addons_wrap .addons-featured { margin: -1% -5%; }
140
+ .wcv_addons_wrap .addons-button { width: 100%; }
141
+ .wcv_addons_wrap .addons-small-dark-item { width: 100%; }
142
+ .wcv_addons_wrap .addons-column-block-item-icon { background: none; border: none; height: 75px; margin: 0 10px 10px 0; width: 75px; } }
143
+
144
+ .wcv_addons_wrap .products { overflow: hidden; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-flow: row; flex-flow: row; -ms-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -.5em; }
145
+
146
+ .wcv_addons_wrap .products li { float: left; border: 1px solid #ddd; margin: 0 .5em 1em !important; padding: 0; vertical-align: top; width: 25%; min-width: 280px; min-height: 220px; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; overflow: hidden; background: #f5f5f5; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.1); }
147
+
148
+ .wcv_addons_wrap .products li a { text-decoration: none; color: inherit; display: block; height: 100%; }
149
+
150
+ .wcv_addons_wrap .products li a .product-img-wrap { background: #fff; display: block; }
151
+
152
+ .wcv_addons_wrap .products li a img { max-width: 258px; max-height: 24px; padding: 17px 20px; display: block; margin: 0; background: #fff; border-right: 260px solid #fff; }
153
+
154
+ .wcv_addons_wrap .products li a img.extension-thumb + h3 { display: none; }
155
+
156
+ .wcv_addons_wrap .products li a .price { display: none; }
157
+
158
+ .wcv_addons_wrap .products li a h2, .wcv_addons_wrap .products li a h3 { margin: 0 !important; padding: 20px !important; background: #fff; }
159
+
160
+ .wcv_addons_wrap .products li a p { padding: 20px !important; margin: 0 !important; border-top: 1px solid #f1f1f1; }
161
+
162
+ .wcv_addons_wrap .products li a:hover, .wcv_addons_wrap .products li a:focus { background-color: #fff; }
trunk/assets/css/wcv-admin.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .wcv_addons_wrap{max-width:1200px}.wcv_addons_wrap h1.search-form-title{clear:left;padding:0}.wcv_addons_wrap .update-plugins .update-count{background-color:#d54e21;border-radius:10px;color:#fff;display:inline-block;font-size:9px;font-weight:600;line-height:17px;margin:1px 0 0 2px;padding:0 6px;vertical-align:text-top}.wcv_addons_wrap .addons-featured{margin:0}.wcv_addons_wrap ul.feature-list{list-style:inherit}.wcv_addons_wrap ul.feature-list li{margin-left:20px}.wcv_addons_wrap ul.subsubsub.subsubsub{margin:-2px 0 12px}.wcv_addons_wrap .subsubsub li::after{content:'|'}.wcv_addons_wrap .subsubsub li:last-child::after{content:''}.wcv_addons_wrap .addons-banner-block-item-icon,.wcv_addons_wrap .addons-column-block-item-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.wcv_addons_wrap .addons-banner-block,.wcv_addons_wrap .addons-wcs-banner-block{background:#fff;border:1px solid #ddd;margin:0 0 1em 0;padding:2em 2em 1em}.wcv_addons_wrap .addons-banner-block img{height:62px}.wcv_addons_wrap .addons-banner-block p{margin:0 0 20px}.wcv_addons_wrap .addons-banner-block-items{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:distribute;justify-content:space-around;margin:0 -10px 0 -10px}.wcv_addons_wrap .addons-banner-block-item{border:1px solid #e6e6e6;border-radius:3px;-webkit-box-flex:1;-ms-flex:1;flex:1;margin:1em;min-width:200px;width:30%}.wcv_addons_wrap .addons-banner-block-item-icon{background:#f7f7f7;height:143px}.wcv_addons_wrap .addons-banner-block-item-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:184px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:24px}.wcv_addons_wrap .addons-banner-block-item-content h3{margin-top:0}.wcv_addons_wrap .addons-banner-block-item-content p{margin:0 0 auto}.wcv_addons_wrap .addons-wcs-banner-block{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.wcv_addons_wrap .addons-wcs-banner-block-image{background:#f7f7f7;border:1px solid #e6e6e6;margin-right:2em;width:400px;padding:1em;text-align:center}.wcv_addons_wrap .addons-wcs-banner-block-image .addons-img{margin:auto 0;max-height:350px;max-width:350px}.wcv_addons_wrap .addons-shipping-methods .addons-wcs-banner-block{margin-left:0;margin-right:0;margin-top:1em}.wcv_addons_wrap .addons-wcs-banner-block-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;-ms-flex-item-align:stretch;align-self:stretch;padding:1em 0}.wcv_addons_wrap .addons-wcs-banner-block-content h1{padding-bottom:0}.wcv_addons_wrap .addons-wcs-banner-block-content p{margin-bottom:0}.wcv_addons_wrap .addons-wcs-banner-block-content .wcs-service-logo{max-width:40px}.wcv_addons_wrap .addons-column-section{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:distribute;justify-content:space-around}.wcv_addons_wrap .addons-column{-webkit-box-flex:1;-ms-flex:1;flex:1;width:50%;padding:0 .5em}.wcv_addons_wrap .addons-column:nth-child(2){margin-right:0}.wcv_addons_wrap .addons-column-block,.wcv_addons_wrap .addons-small-dark-block,.wcv_addons_wrap .addons-small-light-block{-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #ddd;margin:0 0 1em;padding:20px}.wcv_addons_wrap .addons-column-block img{max-height:50px;max-width:50px}.wcv_addons_wrap .addons-column-block,.wcv_addons_wrap .addons-small-light-block{background:#fff}.wcv_addons_wrap .addons-column-block-left{float:left}.wcv_addons_wrap .addons-column-block-right{float:right}.wcv_addons_wrap .addons-column-block-item{border-top:2px solid #f9f9f9;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:0 -20px;padding:20px}.wcv_addons_wrap .addons-column-block-item-icon{background:#f7f7f7;border:1px solid #e6e6e6;height:100px;margin:0 10px 10px 0;width:100px}.wcv_addons_wrap .addons-column-block-item-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-wrap:wrap;flex-wrap:wrap;height:20%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;min-width:200px}.wcv_addons_wrap .addons-column-block-item-content h2{float:left;margin-top:8px}.wcv_addons_wrap .addons-column-block-item-content a{float:right}.wcv_addons_wrap .addons-column-block-item-content p{float:left}.wcv_addons_wrap .addons-banner-block-item,.wcv_addons_wrap .addons-column-block-item{display:none}.wcv_addons_wrap .addons-banner-block-item:nth-child(-n+3){display:block}.wcv_addons_wrap .addons-column-block-item:nth-of-type(-n+3){display:-webkit-box;display:-ms-flexbox;display:flex}.wcv_addons_wrap .addons-small-dark-block{background-color:#54687d;text-align:center}.wcv_addons_wrap .addons-small-dark-items{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:distribute;justify-content:space-around}.wcv_addons_wrap .addons-small-dark-item{margin:0 0 20px}.wcv_addons_wrap .addons-small-dark-block h1{color:#fff}.wcv_addons_wrap .addons-small-dark-block p{color:#fafafa}.wcv_addons_wrap .addons-small-dark-item-icon img{height:30px}.wcv_addons_wrap .addons-small-dark-item a{margin:28px auto 0}.wcv_addons_wrap .addons-small-light-block{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.wcv_addons_wrap .addons-small-light-block h1{margin-top:-12px}.wcv_addons_wrap .addons-small-light-block p{margin-top:0}.wcv_addons_wrap .addons-small-light-block img{height:225px;margin:0 0 0 -20px}.wcv_addons_wrap .addons-small-light-block-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1 1 100px;flex:1 1 100px;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around}.wcv_addons_wrap .addons-small-light-block-buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.wcv_addons_wrap .addons-small-light-block-content a{width:48%}.wcv_addons_wrap .product-addons-button{cursor:pointer;display:block;height:37px;line-height:37px;text-align:center;text-decoration:none;width:124px}.wcv_addons_wrap .product-addons-button-solid{background-color:#005580;color:#fff}.wcv_addons_wrap .addons-button{border-radius:3px;cursor:pointer;display:block;height:37px;line-height:37px;text-align:center;text-decoration:none;width:124px}.wcv_addons_wrap .addons-button-solid{background-color:#005580;color:#fff}.wcv_addons_wrap .addons-button-solid:hover{color:#fff;opacity:.8}.wcv_addons_wrap .addons-button-outline-green{border:1px solid #73ae39;color:#73ae39}.wcv_addons_wrap .addons-button-outline-green:hover{color:#73ae39;opacity:.8}.wcv_addons_wrap .addons-button-outline-white{border:1px solid #fff;color:#fff}.wcv_addons_wrap .addons-button-outline-white:hover{color:#fff;opacity:.8}.wcv_addons_wrap .addons-button-installed{background:#e6e6e6;color:#3c3c3c}.wcv_addons_wrap .addons-button-installed:hover{color:#3c3c3c;opacity:.8}@media only screen and (max-width:400px){.wcv_addons_wrap .addons-featured{margin:-1% -5%}.wcv_addons_wrap .addons-button{width:100%}.wcv_addons_wrap .addons-small-dark-item{width:100%}.wcv_addons_wrap .addons-column-block-item-icon{background:0 0;border:none;height:75px;margin:0 10px 10px 0;width:75px}}.wcv_addons_wrap .products{overflow:hidden;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row;flex-flow:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0 -.5em}.wcv_addons_wrap .products li{float:left;border:1px solid #ddd;margin:0 .5em 1em!important;padding:0;vertical-align:top;width:25%;min-width:280px;min-height:220px;-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;background:#f5f5f5;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1)}.wcv_addons_wrap .products li a{text-decoration:none;color:inherit;display:block;height:100%}.wcv_addons_wrap .products li a .product-img-wrap{background:#fff;display:block}.wcv_addons_wrap .products li a img{max-width:258px;max-height:24px;padding:17px 20px;display:block;margin:0;background:#fff;border-right:260px solid #fff}.wcv_addons_wrap .products li a img.extension-thumb+h3{display:none}.wcv_addons_wrap .products li a .price{display:none}.wcv_addons_wrap .products li a h2,.wcv_addons_wrap .products li a h3{margin:0!important;padding:20px!important;background:#fff}.wcv_addons_wrap .products li a p{padding:20px!important;margin:0!important;border-top:1px solid #f1f1f1}.wcv_addons_wrap .products li a:focus,.wcv_addons_wrap .products li a:hover{background-color:#fff}
trunk/assets/css/wcv-admin.scss ADDED
@@ -0,0 +1,474 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wcv_addons_wrap {
2
+ max-width: 1200px;
3
+
4
+ h1.search-form-title {
5
+ clear: left;
6
+ padding: 0;
7
+ }
8
+
9
+ .update-plugins .update-count {
10
+ background-color: #d54e21;
11
+ border-radius: 10px;
12
+ color: #fff;
13
+ display: inline-block;
14
+ font-size: 9px;
15
+ font-weight: 600;
16
+ line-height: 17px;
17
+ margin: 1px 0 0 2px;
18
+ padding: 0 6px;
19
+ vertical-align: text-top;
20
+ }
21
+
22
+ .addons-featured {
23
+ margin: 0;
24
+ }
25
+
26
+ ul.feature-list {
27
+ list-style: inherit;
28
+
29
+ li {
30
+ margin-left: 20px;
31
+ }
32
+ }
33
+
34
+ ul.subsubsub.subsubsub {
35
+ margin: -2px 0 12px;
36
+ }
37
+
38
+ .subsubsub li::after {
39
+ content: '|';
40
+ }
41
+
42
+ .subsubsub li:last-child::after {
43
+ content: '';
44
+ }
45
+
46
+ .addons-banner-block-item-icon,
47
+ .addons-column-block-item-icon {
48
+ align-items: center;
49
+ display: flex;
50
+ justify-content: center;
51
+ }
52
+
53
+ .addons-banner-block,
54
+ .addons-wcs-banner-block {
55
+ background: #ffffff;
56
+ border: 1px solid #ddd;
57
+ margin: 0 0 1em 0;
58
+ padding: 2em 2em 1em;
59
+ }
60
+
61
+ .addons-banner-block img {
62
+ height: 62px;
63
+ }
64
+
65
+ .addons-banner-block p {
66
+ margin: 0 0 20px;
67
+ }
68
+
69
+ .addons-banner-block-items {
70
+ display: flex;
71
+ flex-direction: row;
72
+ flex-wrap: wrap;
73
+ justify-content: space-around;
74
+ margin: 0 -10px 0 -10px;
75
+ }
76
+
77
+ .addons-banner-block-item {
78
+ border: 1px solid #e6e6e6;
79
+ border-radius: 3px;
80
+ flex: 1;
81
+ margin: 1em;
82
+ min-width: 200px;
83
+ width: 30%;
84
+ }
85
+
86
+ .addons-banner-block-item-icon {
87
+ background: #f7f7f7;
88
+ height: 143px;
89
+ }
90
+
91
+ .addons-banner-block-item-content {
92
+ display: flex;
93
+ flex-direction: column;
94
+ height: 184px;
95
+ justify-content: space-between;
96
+ padding: 24px;
97
+ }
98
+
99
+ .addons-banner-block-item-content h3 {
100
+ margin-top: 0;
101
+ }
102
+
103
+ .addons-banner-block-item-content p {
104
+ margin: 0 0 auto;
105
+ }
106
+
107
+ .addons-wcs-banner-block {
108
+ display: flex;
109
+ align-items: center;
110
+ }
111
+
112
+ .addons-wcs-banner-block-image {
113
+ background: #f7f7f7;
114
+ border: 1px solid #e6e6e6;
115
+ margin-right: 2em;
116
+ width: 400px;
117
+ padding: 1em;
118
+ text-align: center;
119
+
120
+ .addons-img {
121
+ margin: auto 0;
122
+ max-height: 350px;
123
+ max-width: 350px;
124
+ }
125
+ }
126
+
127
+ .addons-shipping-methods .addons-wcs-banner-block {
128
+ margin-left: 0;
129
+ margin-right: 0;
130
+ margin-top: 1em;
131
+ }
132
+
133
+ .addons-wcs-banner-block-content {
134
+ display: flex;
135
+ flex-direction: column;
136
+ justify-content: space-around;
137
+ align-self: stretch;
138
+ padding: 1em 0;
139
+
140
+ h1 {
141
+ padding-bottom: 0;
142
+ }
143
+
144
+ p {
145
+ margin-bottom: 0;
146
+ }
147
+
148
+ .wcs-service-logo {
149
+ max-width: 40px;
150
+ }
151
+ }
152
+
153
+ .addons-column-section {
154
+ display: flex;
155
+ flex-direction: row;
156
+ flex-wrap: wrap;
157
+ justify-content: space-around;
158
+ }
159
+
160
+ .addons-column {
161
+ flex: 1;
162
+ width: 50%;
163
+ padding: 0 .5em;
164
+ }
165
+
166
+ .addons-column:nth-child(2) {
167
+ margin-right: 0;
168
+ }
169
+
170
+ .addons-small-light-block,
171
+ .addons-small-dark-block,
172
+ .addons-column-block {
173
+ box-sizing: border-box;
174
+ border: 1px solid #ddd;
175
+ margin: 0 0 1em;
176
+ padding: 20px;
177
+ }
178
+
179
+ .addons-column-block img {
180
+ max-height: 50px;
181
+ max-width: 50px;
182
+ }
183
+
184
+ .addons-small-light-block,
185
+ .addons-column-block {
186
+ background: #ffffff;
187
+ }
188
+
189
+ .addons-column-block-left {
190
+ float: left;
191
+ }
192
+
193
+ .addons-column-block-right {
194
+ float: right;
195
+ }
196
+
197
+ .addons-column-block-item {
198
+ border-top: 2px solid #f9f9f9;
199
+ flex-direction: row;
200
+ flex-wrap: wrap;
201
+ justify-content: space-between;
202
+ margin: 0 -20px;
203
+ padding: 20px;
204
+ }
205
+
206
+ .addons-column-block-item-icon {
207
+ background: #f7f7f7;
208
+ border: 1px solid #e6e6e6;
209
+ height: 100px;
210
+ margin: 0 10px 10px 0;
211
+ width: 100px;
212
+ }
213
+
214
+ .addons-column-block-item-content {
215
+ display: flex;
216
+ flex: 1;
217
+ flex-wrap: wrap;
218
+ height: 20%;
219
+ justify-content: space-between;
220
+ min-width: 200px;
221
+ }
222
+
223
+ .addons-column-block-item-content h2 {
224
+ float: left;
225
+ margin-top: 8px;
226
+ }
227
+
228
+ .addons-column-block-item-content a {
229
+ float: right;
230
+ }
231
+
232
+ .addons-column-block-item-content p {
233
+ float: left;
234
+ }
235
+
236
+ .addons-banner-block-item,
237
+ .addons-column-block-item {
238
+ display: none;
239
+ }
240
+
241
+ .addons-banner-block-item:nth-child(-n+3) {
242
+ display: block;
243
+ }
244
+ .addons-column-block-item:nth-of-type(-n+3) {
245
+ display: flex;
246
+ }
247
+
248
+ .addons-small-dark-block {
249
+ background-color: #54687d;
250
+ text-align: center;
251
+ }
252
+
253
+ .addons-small-dark-items {
254
+ display: flex;
255
+ flex-wrap: wrap;
256
+ justify-content: space-around;
257
+ }
258
+
259
+ .addons-small-dark-item {
260
+ margin: 0 0 20px;
261
+ }
262
+
263
+ .addons-small-dark-block h1 {
264
+ color: #ffffff;
265
+ }
266
+
267
+ .addons-small-dark-block p {
268
+ color: #fafafa;
269
+ }
270
+
271
+ .addons-small-dark-item-icon img {
272
+ height: 30px;
273
+ }
274
+
275
+ .addons-small-dark-item a {
276
+ margin: 28px auto 0;
277
+ }
278
+
279
+ .addons-small-light-block {
280
+ display: flex;
281
+ flex-wrap: wrap;
282
+ }
283
+
284
+ .addons-small-light-block h1 {
285
+ margin-top: -12px;
286
+ }
287
+
288
+ .addons-small-light-block p {
289
+ margin-top: 0;
290
+ }
291
+
292
+ .addons-small-light-block img {
293
+ height: 225px;
294
+ margin: 0 0 0 -20px;
295
+ }
296
+
297
+ .addons-small-light-block-content {
298
+ display: flex;
299
+ flex: 1 1 100px;
300
+ flex-direction: column;
301
+ justify-content: space-around;
302
+ }
303
+
304
+ .addons-small-light-block-buttons {
305
+ display: flex;
306
+ justify-content: space-between;
307
+ }
308
+
309
+ .addons-small-light-block-content a {
310
+ width: 48%;
311
+ }
312
+
313
+ .product-addons-button {
314
+ // border-radius: 3px;
315
+ cursor: pointer;
316
+ display: block;
317
+ height: 37px;
318
+ line-height: 37px;
319
+ text-align: center;
320
+ text-decoration: none;
321
+ width: 124px;
322
+ }
323
+
324
+ .product-addons-button-solid {
325
+ background-color: #005580;
326
+ color: #ffffff;
327
+ }
328
+
329
+ .addons-button {
330
+ border-radius: 3px;
331
+ cursor: pointer;
332
+ display: block;
333
+ height: 37px;
334
+ line-height: 37px;
335
+ text-align: center;
336
+ text-decoration: none;
337
+ width: 124px;
338
+ }
339
+
340
+ .addons-button-solid {
341
+ background-color: #005580;
342
+ color: #ffffff;
343
+ }
344
+
345
+ .addons-button-solid:hover {
346
+ color: #ffffff;
347
+ opacity: 0.8;
348
+ }
349
+
350
+ .addons-button-outline-green {
351
+ border: 1px solid #73ae39;
352
+ color: #73ae39;
353
+ }
354
+
355
+ .addons-button-outline-green:hover {
356
+ color: #73ae39;
357
+ opacity: 0.8;
358
+ }
359
+
360
+ .addons-button-outline-white {
361
+ border: 1px solid #ffffff;
362
+ color: #ffffff;
363
+ }
364
+
365
+ .addons-button-outline-white:hover {
366
+ color: #ffffff;
367
+ opacity: 0.8;
368
+ }
369
+
370
+ .addons-button-installed {
371
+ background: #e6e6e6;
372
+ color: #3c3c3c;
373
+ }
374
+
375
+ .addons-button-installed:hover {
376
+ color: #3c3c3c;
377
+ opacity: 0.8;
378
+ }
379
+
380
+ @media only screen and (max-width : 400px) {
381
+ .addons-featured {
382
+ margin: -1% -5%;
383
+ }
384
+
385
+ .addons-button {
386
+ width: 100%;
387
+ }
388
+
389
+ .addons-small-dark-item {
390
+ width: 100%;
391
+ }
392
+
393
+ .addons-column-block-item-icon {
394
+ background: none;
395
+ border: none;
396
+ height: 75px;
397
+ margin: 0 10px 10px 0;
398
+ width: 75px;
399
+ }
400
+ }
401
+
402
+ .products {
403
+ overflow: hidden;
404
+ display: flex;
405
+ flex-flow: row;
406
+ flex-wrap: wrap;
407
+ margin: 0 -.5em;
408
+
409
+ li {
410
+ float: left;
411
+ border: 1px solid #ddd;
412
+ margin: 0 .5em 1em !important;
413
+ padding: 0;
414
+ vertical-align: top;
415
+ width: 25%;
416
+ min-width: 280px;
417
+ min-height: 220px;
418
+ flex: 1;
419
+ overflow: hidden;
420
+ background: #f5f5f5;
421
+ box-shadow:
422
+ inset 0 1px 0 rgba(255, 255, 255, 0.2),
423
+ inset 0 -1px 0 rgba(0, 0, 0, 0.1);
424
+
425
+ a {
426
+ text-decoration: none;
427
+ color: inherit;
428
+ display: block;
429
+ height: 100%;
430
+
431
+ .product-img-wrap {
432
+ background: #fff;
433
+ display: block;
434
+ }
435
+
436
+ img {
437
+ max-width: 258px;
438
+ max-height: 24px;
439
+ padding: 17px 20px;
440
+ display: block;
441
+ margin: 0;
442
+ background: #fff;
443
+ border-right: 260px solid #fff;
444
+ }
445
+
446
+ img.extension-thumb + h3 {
447
+ display: none;
448
+ }
449
+
450
+ .price {
451
+ display: none;
452
+ }
453
+
454
+ h2, h3 {
455
+ margin: 0 !important;
456
+ padding: 20px !important;
457
+ background: #fff;
458
+ }
459
+
460
+ p {
461
+ padding: 20px !important;
462
+ margin: 0 !important;
463
+ border-top: 1px solid #f1f1f1;
464
+ }
465
+
466
+ &:hover,
467
+ &:focus {
468
+ background-color: #fff;
469
+ }
470
+ }
471
+ }
472
+ }
473
+
474
+ }
trunk/assets/css/wcv-frontend.css ADDED
@@ -0,0 +1,547 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Bootstrap v2.1.1
3
+ *
4
+ * Copyright 2012 Twitter, Inc
5
+ * Licensed under the Apache License v2.0
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
9
+ */
10
+ clearfix {
11
+ *zoom: 1;
12
+ }
13
+
14
+ .clearfix:before, .clearfix:after {
15
+ display: table;
16
+ content: "";
17
+ line-height: 0;
18
+ }
19
+
20
+ .clearfix:after {
21
+ clear: both;
22
+ }
23
+
24
+ .hide-text {
25
+ font: 0/0 a;
26
+ color: transparent;
27
+ text-shadow: none;
28
+ background-color: transparent;
29
+ border: 0;
30
+ }
31
+
32
+ .input-block-level {
33
+ display: block;
34
+ width: 100%;
35
+ min-height: 30px;
36
+ -webkit-box-sizing: border-box;
37
+ -moz-box-sizing: border-box;
38
+ box-sizing: border-box;
39
+ }
40
+
41
+ .wcv-btn {
42
+ display: inline-block;
43
+ *display: inline;
44
+ *zoom: 1;
45
+ padding: 4px 14px;
46
+ margin-bottom: 0;
47
+ font-size: 14px;
48
+ line-height: 20px;
49
+ *line-height: 20px;
50
+ text-align: center;
51
+ vertical-align: middle;
52
+ cursor: pointer;
53
+ color: #333333;
54
+ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
55
+ background-color: #f5f5f5;
56
+ background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
57
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
58
+ background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
59
+ background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
60
+ background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
61
+ background-repeat: repeat-x;
62
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
63
+ border-color: #e6e6e6 #e6e6e6 #bfbfbf;
64
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
65
+ *background-color: #e6e6e6;
66
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
67
+ border: 1px solid #bbbbbb;
68
+ *border: 0;
69
+ border-bottom-color: #a2a2a2;
70
+ -webkit-border-radius: 4px;
71
+ -moz-border-radius: 4px;
72
+ border-radius: 4px;
73
+ *margin-left: .3em;
74
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
75
+ -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
76
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
77
+ }
78
+
79
+ .wcv-btn:hover, .wcv-btn:active, .wcv-btn.active, .wcv-btn.disabled, .wcv-btn[disabled] {
80
+ color: #333333;
81
+ background-color: #e6e6e6;
82
+ *background-color: #d9d9d9;
83
+ }
84
+
85
+ .wcv-btn:active, .wcv-btn.active {
86
+ background-color: #cccccc \9;
87
+ }
88
+
89
+ .wcv-btn:first-child {
90
+ *margin-left: 0;
91
+ }
92
+
93
+ .wcv-btn:hover {
94
+ color: #333333;
95
+ text-decoration: none;
96
+ background-color: #e6e6e6;
97
+ *background-color: #d9d9d9;
98
+ background-position: 0 -15px;
99
+ -webkit-transition: background-position 0.1s linear;
100
+ -moz-transition: background-position 0.1s linear;
101
+ -o-transition: background-position 0.1s linear;
102
+ transition: background-position 0.1s linear;
103
+ }
104
+
105
+ .wcv-btn:focus {
106
+ outline: thin dotted #333;
107
+ outline: 5px auto -webkit-focus-ring-color;
108
+ outline-offset: -2px;
109
+ }
110
+
111
+ .wcv-btn.active, .wcv-btn:active {
112
+ background-color: #e6e6e6;
113
+ background-color: #d9d9d9 \9;
114
+ background-image: none;
115
+ outline: 0;
116
+ -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
117
+ -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
118
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
119
+ }
120
+
121
+ .wcv-btn.disabled, .wcv-btn[disabled] {
122
+ cursor: default;
123
+ background-color: #e6e6e6;
124
+ background-image: none;
125
+ opacity: 0.65;
126
+ filter: alpha(opacity=65);
127
+ -webkit-box-shadow: none;
128
+ -moz-box-shadow: none;
129
+ box-shadow: none;
130
+ }
131
+
132
+ .wcv-btn-large {
133
+ padding: 9px 14px;
134
+ font-size: 16px;
135
+ line-height: normal;
136
+ -webkit-border-radius: 5px;
137
+ -moz-border-radius: 5px;
138
+ border-radius: 5px;
139
+ }
140
+
141
+ .wcv-btn-large [class^="icon-"] {
142
+ margin-top: 2px;
143
+ }
144
+
145
+ .wcv-btn-small {
146
+ padding: 3px 9px;
147
+ font-size: 12px;
148
+ line-height: 18px;
149
+ }
150
+
151
+ .wcv-btn-small [class^="icon-"] {
152
+ margin-top: 0;
153
+ }
154
+
155
+ .wcv-btn-mini {
156
+ padding: 2px 6px;
157
+ font-size: 11px;
158
+ line-height: 17px;
159
+ }
160
+
161
+ .wcv-btn-block {
162
+ display: block;
163
+ width: 100%;
164
+ padding-left: 0;
165
+ padding-right: 0;
166
+ -webkit-box-sizing: border-box;
167
+ -moz-box-sizing: border-box;
168
+ box-sizing: border-box;
169
+ }
170
+
171
+ .wcv-btn-block + .wcv-btn-block {
172
+ margin-top: 5px;
173
+ }
174
+
175
+ input[type="submit"].wcv-btn-block, input[type="reset"].wcv-btn-block, input[type="button"].wcv-btn-block {
176
+ width: 100%;
177
+ }
178
+
179
+ .wcv-btn-primary.active, .wcv-btn-warning.active, .wcv-btn-danger.active, .wcv-btn-success.active, .wcv-btn-info.active, .wcv-btn-inverse.active {
180
+ color: rgba(255, 255, 255, 0.75);
181
+ }
182
+
183
+ .wcv-btn {
184
+ border-color: #c5c5c5;
185
+ border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
186
+ }
187
+
188
+ .wcv-btn-primary {
189
+ color: #ffffff;
190
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
191
+ background-color: #006dcc;
192
+ background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
193
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
194
+ background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
195
+ background-image: -o-linear-gradient(top, #0088cc, #0044cc);
196
+ background-image: linear-gradient(to bottom, #0088cc, #0044cc);
197
+ background-repeat: repeat-x;
198
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
199
+ border-color: #0044cc #0044cc #002a80;
200
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
201
+ *background-color: #0044cc;
202
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
203
+ }
204
+
205
+ .wcv-btn-primary:hover, .wcv-btn-primary:active, .wcv-btn-primary.active, .wcv-btn-primary.disabled, .wcv-btn-primary[disabled] {
206
+ color: #ffffff;
207
+ background-color: #0044cc;
208
+ *background-color: #003bb3;
209
+ }
210
+
211
+ .wcv-btn-primary:active, .wcv-btn-primary.active {
212
+ background-color: #003399 \9;
213
+ }
214
+
215
+ .wcv-btn-warning {
216
+ color: #ffffff;
217
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
218
+ background-color: #faa732;
219
+ background-image: -moz-linear-gradient(top, #fbb450, #f89406);
220
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
221
+ background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
222
+ background-image: -o-linear-gradient(top, #fbb450, #f89406);
223
+ background-image: linear-gradient(to bottom, #fbb450, #f89406);
224
+ background-repeat: repeat-x;
225
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
226
+ border-color: #f89406 #f89406 #ad6704;
227
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
228
+ *background-color: #f89406;
229
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
230
+ }
231
+
232
+ .wcv-btn-warning:hover, .wcv-btn-warning:active, .wcv-btn-warning.active, .wcv-btn-warning.disabled, .wcv-btn-warning[disabled] {
233
+ color: #ffffff;
234
+ background-color: #f89406;
235
+ *background-color: #df8505;
236
+ }
237
+
238
+ .wcv-btn-warning:active, .wcv-btn-warning.active {
239
+ background-color: #c67605 \9;
240
+ }
241
+
242
+ .wcv-btn-danger {
243
+ color: #ffffff;
244
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
245
+ background-color: #da4f49;
246
+ background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
247
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
248
+ background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
249
+ background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
250
+ background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
251
+ background-repeat: repeat-x;
252
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
253
+ border-color: #bd362f #bd362f #802420;
254
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
255
+ *background-color: #bd362f;
256
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
257
+ }
258
+
259
+ .wcv-btn-danger:hover, .wcv-btn-danger:active, .wcv-btn-danger.active, .wcv-btn-danger.disabled, .wcv-btn-danger[disabled] {
260
+ color: #ffffff;
261
+ background-color: #bd362f;
262
+ *background-color: #a9302a;
263
+ }
264
+
265
+ .wcv-btn-danger:active, .wcv-btn-danger.active {
266
+ background-color: #942a25 \9;
267
+ }
268
+
269
+ .wcv-btn-success {
270
+ color: #ffffff;
271
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
272
+ background-color: #5bb75b;
273
+ background-image: -moz-linear-gradient(top, #62c462, #51a351);
274
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
275
+ background-image: -webkit-linear-gradient(top, #62c462, #51a351);
276
+ background-image: -o-linear-gradient(top, #62c462, #51a351);
277
+ background-image: linear-gradient(to bottom, #62c462, #51a351);
278
+ background-repeat: repeat-x;
279
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
280
+ border-color: #51a351 #51a351 #387038;
281
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
282
+ *background-color: #51a351;
283
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
284
+ }
285
+
286
+ .wcv-btn-success:hover, .wcv-btn-success:active, .wcv-btn-success.active, .wcv-btn-success.disabled, .wcv-btn-success[disabled] {
287
+ color: #ffffff;
288
+ background-color: #51a351;
289
+ *background-color: #499249;
290
+ }
291
+
292
+ .wcv-btn-success:active, .wcv-btn-success.active {
293
+ background-color: #408140 \9;
294
+ }
295
+
296
+ .wcv-btn-info {
297
+ color: #ffffff;
298
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
299
+ background-color: #49afcd;
300
+ background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
301
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
302
+ background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
303
+ background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
304
+ background-image: linear-gradient(to bottom, #5bc0de, #2f96b4);
305
+ background-repeat: repeat-x;
306
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);
307
+ border-color: #2f96b4 #2f96b4 #1f6377;
308
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
309
+ *background-color: #2f96b4;
310
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
311
+ }
312
+
313
+ .wcv-btn-info:hover, .wcv-btn-info:active, .wcv-btn-info.active, .wcv-btn-info.disabled, .wcv-btn-info[disabled] {
314
+ color: #ffffff;
315
+ background-color: #2f96b4;
316
+ *background-color: #2a85a0;
317
+ }
318
+
319
+ .wcv-btn-info:active, .wcv-btn-info.active {
320
+ background-color: #24748c \9;
321
+ }
322
+
323
+ .wcv-btn-inverse {
324
+ color: #ffffff;
325
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
326
+ background-color: #363636;
327
+ background-image: -moz-linear-gradient(top, #444444, #222222);
328
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
329
+ background-image: -webkit-linear-gradient(top, #444444, #222222);
330
+ background-image: -o-linear-gradient(top, #444444, #222222);
331
+ background-image: linear-gradient(to bottom, #444444, #222222);
332
+ background-repeat: repeat-x;
333
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
334
+ border-color: #222222 #222222 #000000;
335
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
336
+ *background-color: #222222;
337
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
338
+ }
339
+
340
+ .wcv-btn-inverse:hover, .wcv-btn-inverse:active, .wcv-btn-inverse.active, .wcv-btn-inverse.disabled, .wcv-btn-inverse[disabled] {
341
+ color: #ffffff;
342
+ background-color: #222222;
343
+ *background-color: #151515;
344
+ }
345
+
346
+ .wcv-btn-inverse:active, .wcv-btn-inverse.active {
347
+ background-color: #080808 \9;
348
+ }
349
+
350
+ button.wcv-btn, input[type="submit"].wcv-btn {
351
+ *padding-top: 3px;
352
+ *padding-bottom: 3px;
353
+ }
354
+
355
+ button.wcv-btn::-moz-focus-inner, input[type="submit"].wcv-btn::-moz-focus-inner {
356
+ padding: 0;
357
+ border: 0;
358
+ }
359
+
360
+ button.wcv-btn.wcv-btn-large, input[type="submit"].wcv-btn.wcv-btn-large {
361
+ *padding-top: 7px;
362
+ *padding-bottom: 7px;
363
+ }
364
+
365
+ button.wcv-btn.wcv-btn-small, input[type="submit"].wcv-btn.wcv-btn-small {
366
+ *padding-top: 3px;
367
+ *padding-bottom: 3px;
368
+ }
369
+
370
+ button.wcv-btn.wcv-btn-mini, input[type="submit"].wcv-btn.wcv-btn-mini {
371
+ *padding-top: 1px;
372
+ *padding-bottom: 1px;
373
+ }
374
+
375
+ .wcv-btn-link, .wcv-btn-link:active, .wcv-btn-link[disabled] {
376
+ background-color: transparent;
377
+ background-image: none;
378
+ -webkit-box-shadow: none;
379
+ -moz-box-shadow: none;
380
+ box-shadow: none;
381
+ }
382
+
383
+ .wcv-btn-link {
384
+ border-color: transparent;
385
+ cursor: pointer;
386
+ color: #0088cc;
387
+ -webkit-border-radius: 0;
388
+ -moz-border-radius: 0;
389
+ border-radius: 0;
390
+ }
391
+
392
+ .wcv-btn-link:hover {
393
+ color: #005580;
394
+ text-decoration: underline;
395
+ background-color: transparent;
396
+ }
397
+
398
+ .wcv-btn-link[disabled]:hover {
399
+ color: #333333;
400
+ text-decoration: none;
401
+ }
402
+
403
+ table {
404
+ max-width: 100%;
405
+ background-color: transparent;
406
+ border-collapse: collapse;
407
+ border-spacing: 0;
408
+ }
409
+
410
+ .table {
411
+ width: 100%;
412
+ margin-bottom: 20px;
413
+ }
414
+
415
+ .table th, .table td {
416
+ padding: 8px;
417
+ line-height: 20px;
418
+ text-align: left;
419
+ vertical-align: top;
420
+ border-top: 1px solid #dddddd;
421
+ }
422
+
423
+ .table th {
424
+ font-weight: bold;
425
+ }
426
+
427
+ .table thead th {
428
+ vertical-align: bottom;
429
+ }
430
+
431
+ .table caption + thead tr:first-child th, .table caption + thead tr:first-child td, .table colgroup + thead tr:first-child th, .table colgroup + thead tr:first-child td, .table thead:first-child tr:first-child th, .table thead:first-child tr:first-child td {
432
+ border-top: 0;
433
+ }
434
+
435
+ .table tbody + tbody {
436
+ border-top: 2px solid #dddddd;
437
+ }
438
+
439
+ .table-condensed th, .table-condensed td {
440
+ padding: 4px 5px;
441
+ }
442
+
443
+ .table-bordered {
444
+ border: 1px solid #dddddd;
445
+ border-collapse: separate;
446
+ *border-collapse: collapse;
447
+ border-left: 0;
448
+ -webkit-border-radius: 4px;
449
+ -moz-border-radius: 4px;
450
+ border-radius: 4px;
451
+ }
452
+
453
+ .table-bordered th, .table-bordered td {
454
+ border-left: 1px solid #dddddd;
455
+ }
456
+
457
+ .table-bordered caption + thead tr:first-child th, .table-bordered caption + tbody tr:first-child th, .table-bordered caption + tbody tr:first-child td, .table-bordered colgroup + thead tr:first-child th, .table-bordered colgroup + tbody tr:first-child th, .table-bordered colgroup + tbody tr:first-child td, .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td {
458
+ border-top: 0;
459
+ }
460
+
461
+ .table-bordered thead:first-child tr:first-child th:first-child, .table-bordered tbody:first-child tr:first-child td:first-child {
462
+ -webkit-border-top-left-radius: 4px;
463
+ border-top-left-radius: 4px;
464
+ -moz-border-radius-topleft: 4px;
465
+ }
466
+
467
+ .table-bordered thead:first-child tr:first-child th:last-child, .table-bordered tbody:first-child tr:first-child td:last-child {
468
+ -webkit-border-top-right-radius: 4px;
469
+ border-top-right-radius: 4px;
470
+ -moz-border-radius-topright: 4px;
471
+ }
472
+
473
+ .table-bordered thead:last-child tr:last-child th:first-child, .table-bordered tbody:last-child tr:last-child td:first-child, .table-bordered tfoot:last-child tr:last-child td:first-child {
474
+ -webkit-border-radius: 0 0 0 4px;
475
+ -moz-border-radius: 0 0 0 4px;
476
+ border-radius: 0 0 0 4px;
477
+ -webkit-border-bottom-left-radius: 4px;
478
+ border-bottom-left-radius: 4px;
479
+ -moz-border-radius-bottomleft: 4px;
480
+ }
481
+
482
+ .table-bordered thead:last-child tr:last-child th:last-child, .table-bordered tbody:last-child tr:last-child td:last-child, .table-bordered tfoot:last-child tr:last-child td:last-child {
483
+ -webkit-border-bottom-right-radius: 4px;
484
+ border-bottom-right-radius: 4px;
485
+ -moz-border-radius-bottomright: 4px;
486
+ }
487
+
488
+ .table-bordered caption + thead tr:first-child th:first-child, .table-bordered caption + tbody tr:first-child td:first-child, .table-bordered colgroup + thead tr:first-child th:first-child, .table-bordered colgroup + tbody tr:first-child td:first-child {
489
+ -webkit-border-top-left-radius: 4px;
490
+ border-top-left-radius: 4px;
491
+ -moz-border-radius-topleft: 4px;
492
+ }
493
+
494
+ .table-bordered caption + thead tr:first-child th:last-child, .table-bordered caption + tbody tr:first-child td:last-child, .table-bordered colgroup + thead tr:first-child th:last-child, .table-bordered colgroup + tbody tr:first-child td:last-child {
495
+ -webkit-border-top-right-radius: 4px;
496
+ border-top-right-radius: 4px;
497
+ -moz-border-radius-topleft: 4px;
498
+ }
499
+
500
+ .table-striped tbody tr:nth-child(odd) td, .table-striped tbody tr:nth-child(odd) th {
501
+ background-color: #f9f9f9;
502
+ }
503
+
504
+ .table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
505
+ background-color: #f5f5f5;
506
+ }
507
+
508
+ table [class*=span], .row-fluid table [class*=span] {
509
+ display: table-cell;
510
+ float: none;
511
+ margin-left: 0;
512
+ }
513
+
514
+ .table tbody tr.success td {
515
+ background-color: #dff0d8;
516
+ }
517
+
518
+ .table tbody tr.error td {
519
+ background-color: #f2dede;
520
+ }
521
+
522
+ .table tbody tr.warning td {
523
+ background-color: #fcf8e3;
524
+ }
525
+
526
+ .table tbody tr.info td {
527
+ background-color: #d9edf7;
528
+ }
529
+
530
+ .table-hover tbody tr.success:hover td {
531
+ background-color: #d0e9c6;
532
+ }
533
+
534
+ .table-hover tbody tr.error:hover td {
535
+ background-color: #ebcccc;
536
+ }
537
+
538
+ .table-hover tbody tr.warning:hover td {
539
+ background-color: #faf2cc;
540
+ }
541
+
542
+ .table-hover tbody tr.info:hover td {
543
+ background-color: #c4e3f3;
544
+ }
545
+ .hidden { display: none; }
546
+
547
+ .vendor_list .button { width: 100%; }
trunk/assets/css/wcv-setup.css ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** WC Vendors setup wizard styles */
2
+ /** WooCommerce CSS Variables */
3
+ body { margin: 65px auto 24px; -webkit-box-shadow: none; box-shadow: none; background: #f1f1f1; padding: 0; }
4
+
5
+ #wcv-logo { border: 0; margin: 0 0 24px; padding: 0; text-align: center; }
6
+
7
+ #wcv-logo img { max-width: 30%; }
8
+
9
+ .wcv-setup-content { -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13); padding: 2em; margin: 0 0 20px; background: #fff; overflow: hidden; zoom: 1; }
10
+
11
+ .wcv-setup-content h1, .wcv-setup-content h2, .wcv-setup-content h3, .wcv-setup-content table { margin: 0 0 20px; border: 0; padding: 0; color: #666; clear: none; font-weight: 500; }
12
+
13
+ .wcv-setup-content p { margin: 20px 0; font-size: 1em; line-height: 1.75em; color: #666; }
14
+
15
+ .wcv-setup-content table { font-size: 1em; line-height: 1.75em; color: #666; }
16
+
17
+ .wcv-setup-content a { color: #005580; }
18
+
19
+ .wcv-setup-content a:hover, .wcv-setup-content a:focus { color: #111; }
20
+
21
+ .wcv-setup-content h4.help-title { text-align: center; }
22
+
23
+ .wcv-setup-content .wcv-setup-input input { padding: 5px 10px; font-size: 1em; }
24
+
25
+ .wcv-setup-content .wcv-setup-next-steps { overflow: hidden; margin: 0 0 24px; padding-bottom: 2px; }
26
+
27
+ .wcv-setup-content .wcv-setup-next-steps h2 { margin-bottom: 12px; }
28
+
29
+ .wcv-setup-content .wcv-setup-next-steps .wcv-setup-next-steps-first { float: left; width: 50%; -webkit-box-sizing: border-box; box-sizing: border-box; }
30
+
31
+ .wcv-setup-content .wcv-setup-next-steps .wcv-setup-next-steps-last { float: right; width: 50%; -webkit-box-sizing: border-box; box-sizing: border-box; }
32
+
33
+ .wcv-setup-content .wcv-setup-next-steps ul { padding: 0 2em 0 0; list-style: none outside; margin: 0; }
34
+
35
+ .wcv-setup-content .wcv-setup-next-steps ul li a { display: block; padding: 0 0 0.75em; }
36
+
37
+ .wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button { background-color: #f7f7f7; border-color: #ccc; color: #23282d; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #ccc; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #ccc; text-shadow: 1px 0 1px #eee, 0 1px 1px #eee; font-size: 1em; height: auto; line-height: 1.75em; margin: 0 0 0.75em; opacity: 1; padding: 1em; text-align: center; }
38
+
39
+ .wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button:hover, .wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button:focus, .wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button:active { background: #5897b6; border-color: #aaa; }
40
+
41
+ .wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button-primary { color: #fff; background-color: #bb77ae; border-color: #5897b6; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #5897b6; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #5897b6; text-shadow: 0 -1px 1px #5897b6, 1px 0 1px #5897b6, 0 1px 1px #5897b6, -1px 0 1px #5897b6; }
42
+
43
+ .wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button-primary:hover, .wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button-primary:focus, .wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button-primary:active { color: #fff; background: #5897b6; border-color: #5897b6; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #5897b6; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #5897b6; }
44
+
45
+ .wcv-setup-content .wcv-setup-next-steps ul li a::before { color: #82878c; font: normal 20px/1 'dashicons'; speak: none; display: inline-block; padding: 0 10px 0 0; top: 1px; position: relative; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-decoration: none !important; vertical-align: top; }
46
+
47
+ .wcv-setup-content .wcv-setup-next-steps ul .learn-more a::before { content: '\f105'; }
48
+
49
+ .wcv-setup-content .wcv-setup-next-steps ul .video-walkthrough a::before { content: '\f126'; }
50
+
51
+ .wcv-setup-content .wcv-setup-next-steps ul .newsletter a::before { content: '\f465'; }
52
+
53
+ .wcv-setup-content .wcvendors-newsletter, .wcv-setup-content .wcvendors-tracker, .wcv-setup-content .updated { padding: 24px 24px 0; margin: 0 0 24px; overflow: hidden; background: #f5f5f5; }
54
+
55
+ .wcv-setup-content .wcvendors-newsletter p, .wcv-setup-content .wcvendors-tracker p, .wcv-setup-content .updated p { padding: 0; margin: 0 0 12px; }
56
+
57
+ .wcv-setup-content .wcvendors-newsletter form, .wcv-setup-content .wcvendors-newsletter p:last-child, .wcv-setup-content .wcvendors-tracker form, .wcv-setup-content .wcvendors-tracker p:last-child, .wcv-setup-content .updated form, .wcv-setup-content .updated p:last-child { margin: 0 0 24px; }
58
+
59
+ .wcv-setup-content .wcvendors-tracker + .wcvendors-newsletter { margin-top: -24px; border-top: 2px dashed #ddd; }
60
+
61
+ .wcv-setup-steps { padding: 0 0 24px; margin: 0; list-style: none outside; overflow: hidden; color: #ccc; width: 100%; display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; }
62
+
63
+ .wcv-setup-steps li { width: 25%; float: left; padding: 0 0 0.8em; margin: 0; text-align: center; position: relative; border-bottom: 4px solid #ccc; line-height: 1.4em; }
64
+
65
+ .wcv-setup-steps li::before { content: ''; border: 4px solid #ccc; border-radius: 100%; width: 4px; height: 4px; position: absolute; bottom: 0; left: 50%; margin-left: -6px; margin-bottom: -8px; background: #fff; }
66
+
67
+ .wcv-setup-steps li.active { border-color: #5897b6; color: #005580; }
68
+
69
+ .wcv-setup-steps li.active::before { border-color: #005580; }
70
+
71
+ .wcv-setup-steps li.done { border-color: #5897b6; color: #005580; }
72
+
73
+ .wcv-setup-steps li.done::before { border-color: #5897b6; background: #5897b6; }
74
+
75
+ .wcv-setup .wcv-setup-actions { overflow: hidden; margin: 20px 0 0; }
76
+
77
+ .wcv-setup .wcv-setup-actions .button { font-size: 1.25em; line-height: 1em; margin-right: 0.5em; margin-bottom: 2px; height: auto; border-radius: 4px; }
78
+
79
+ .wcv-setup .wcv-setup-actions .button-primary { background-color: #005580; border-color: #5897b6; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #5897b6; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #5897b6; text-shadow: 0 -1px 1px #5897b6, 1px 0 1px #5897b6, 0 1px 1px #5897b6, -1px 0 1px #5897b6; margin: 0; opacity: 1; }
80
+
81
+ .wcv-setup .wcv-setup-actions .button-primary:hover, .wcv-setup .wcv-setup-actions .button-primary:focus, .wcv-setup .wcv-setup-actions .button-primary:active { background: #5897b6; border-color: #5897b6; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #5897b6; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #5897b6; }
82
+
83
+ .wcv-setup-content p:last-child { margin-bottom: 0; }
84
+
85
+ .wcv-setup-content p.store-setup { margin-top: 0; }
86
+
87
+ .wcv-return-to-dashboard { font-size: 0.85em; color: #b5b5b5; margin: 1.18em 0; display: block; text-align: center; }
88
+
89
+ .wcv-wizard-storefront .wcv-wizard-storefront-intro { padding: 40px 40px 0; background: #F5F5F5; text-align: center; }
90
+
91
+ .wcv-wizard-storefront .wcv-wizard-storefront-intro img { margin: 40px 0 0 0; width: 100%; display: block; }
92
+
93
+ .wcv-wizard-storefront .wcv-wizard-storefront-features { list-style: none outside; margin: 0 0 20px; padding: 0 0 0 30px; overflow: hidden; }
94
+
95
+ .wcv-wizard-storefront .wcv-wizard-storefront-feature { margin: 0; padding: 20px 30px 20px 2em; width: 50%; -webkit-box-sizing: border-box; box-sizing: border-box; }
96
+
97
+ .wcv-wizard-storefront .wcv-wizard-storefront-feature::before { margin-left: -2em; position: absolute; }
98
+
99
+ .wcv-wizard-storefront .wcv-wizard-storefront-feature.first { clear: both; float: left; }
100
+
101
+ .wcv-wizard-storefront .wcv-wizard-storefront-feature.last { float: right; }
102
+
103
+ .hide { display: none; }
104
+
105
+ .wcv-wizard-features { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; list-style: none; padding: 0; }
106
+
107
+ .wcv-wizard-features .wcv-wizard-feature-item { -ms-flex-preferred-size: calc( 50% - 4em - 3px); flex-basis: calc( 50% - 4em - 3px); border: 1px solid #eee; padding: 2em; }
108
+
109
+ .wcv-wizard-features .wcv-wizard-feature-item:nth-child(1) { border-radius: 4px 0 0 0; }
110
+
111
+ .wcv-wizard-features .wcv-wizard-feature-item:nth-child(2) { border-left: 0; border-radius: 0 4px 0 0; }
112
+
113
+ .wcv-wizard-features .wcv-wizard-feature-item:nth-child(3) { border-top: 0; border-radius: 0 0 0 4px; }
114
+
115
+ .wcv-wizard-features .wcv-wizard-feature-item:nth-child(4) { border-top: 0; border-left: 0; border-radius: 0 0 4px 0; }
116
+
117
+ .wcv-wizard-features p.wcv-wizard-feature-name, .wcv-wizard-features p.wcv-wizard-feature-description { margin: 0; line-height: 1.5em; }
118
+
119
+ .step { text-align: center; }
120
+
121
+ .wcv-setup .wcv-setup-actions .button { font-weight: 300; font-size: 16px; padding: 0.5em 1em; -webkit-box-shadow: none; box-shadow: none; min-width: 12em; min-width: auto; margin-top: 10px; background-color: #005580; color: #fff; }
122
+
123
+ .wcv-setup .wcv-setup-actions .button:focus, .wcv-setup .wcv-setup-actions .button:hover, .wcv-setup .wcv-setup-actions .button:active { -webkit-box-shadow: none; box-shadow: none; background-color: #5897b6; }
124
+
125
+ .location-prompt { color: #666; font-size: 13px; font-weight: 500; margin-bottom: 0.5em; margin-top: 1em; display: inline-block; }
126
+
127
+ .address-step .select2 { min-width: 100%; }
128
+
129
+ .store-address-container { margin-bottom: 24px; }
130
+
131
+ .store-address-container .city-and-postcode { display: -webkit-box; display: -ms-flexbox; display: flex; }
132
+
133
+ .store-address-container .city-and-postcode div { -ms-flex-preferred-size: 50%; flex-basis: 50%; margin-right: 1em; }
134
+
135
+ .store-address-container .city-and-postcode div:last-of-type { margin-right: 0; }
136
+
137
+ .wcv-wizard-service-settings .payment-email-input { border: 1px solid #aaa; border-color: #ddd; border-radius: 4px; height: 30px; padding: 0 8px; font-size: 14px; color: #444; background-color: #fff; display: inline-block; }
138
+
139
+ .newsletter-form-container { display: -webkit-box; display: -ms-flexbox; display: flex; }
140
+
141
+ .newsletter-form-container .newsletter-form-email { border: 1px solid #aaa; border-color: #ddd; border-radius: 4px; height: 42px; padding: 0 8px; font-size: 16px; color: #666; background-color: #fff; display: inline-block; margin-right: 6px; -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; }
142
+
143
+ .newsletter-form-container .newsletter-form-button-container { -webkit-box-flex: 0; -ms-flex-positive: 0; flex-grow: 0; }
144
+
145
+ .wcv-setup .wcv-setup-actions .button.newsletter-form-button { height: 42px; padding: 0 1em; margin: 0; }
146
+
147
+ .wcv-wizard-next-steps { border: 1px solid #eee; border-radius: 4px; list-style: none; padding: 0; }
148
+
149
+ .wcv-wizard-next-steps li { padding: 0; }
150
+
151
+ .wcv-wizard-next-steps .wcv-wizard-next-step-item { display: -webkit-box; display: -ms-flexbox; display: flex; border-top: 1px solid #eee; }
152
+
153
+ .wcv-wizard-next-steps .wcv-wizard-next-step-item:first-child { border-top: 0; }
154
+
155
+ .wcv-wizard-next-steps .wcv-wizard-next-step-description { -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; margin: 1.5em; }
156
+
157
+ .wcv-wizard-next-steps .wcv-wizard-next-step-action { -webkit-box-flex: 0; -ms-flex-positive: 0; flex-grow: 0; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; }
158
+
159
+ .wcv-wizard-next-steps .wcv-wizard-next-step-action .button { margin: 1em; }
160
+
161
+ .wcv-wizard-next-steps p.next-step-heading { margin: 0; font-size: 0.95em; font-weight: 400; font-variant: all-petite-caps; }
162
+
163
+ .wcv-wizard-next-steps p.next-step-extra-info { margin: 0; }
164
+
165
+ .wcv-wizard-next-steps h3.next-step-description { margin: 0; font-size: 16px; font-weight: 600; }
166
+
167
+ p.next-steps-help-text { color: #9f9f9f; padding: 0 2em; text-align: center; font-size: .9em; }
168
+
169
+ .wcv-setup-table { width: 100%; }
170
+
171
+ .wcv-setup-table .table-desc { width: 80%; }
172
+
173
+ .wcv-setup-table .table-check { width: 20%; text-align: right; }
174
+
175
+ .wcv-setup-table .table-check input.option_check { line-height: 4em; }
176
+
177
+ .wcv-setup-table-pages { width: 100%; }
178
+
179
+ .wcv-setup-table-pages .table-desc { width: 60%; }
180
+
181
+ .wcv-setup-table-pages .table-check { width: 40%; }
182
+
183
+ .wcv-setup-table-pages select { width: 100%; }
184
+
185
+ .wcv-setup-table-pages .tool-tip { font-size: 0.75em; }
trunk/assets/css/wcv-setup.min.css ADDED
@@ -0,0 +1 @@
 
1
+ body{margin:65px auto 24px;-webkit-box-shadow:none;box-shadow:none;background:#f1f1f1;padding:0}#wcv-logo{border:0;margin:0 0 24px;padding:0;text-align:center}#wcv-logo img{max-width:30%}.wcv-setup-content{-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13);padding:2em;margin:0 0 20px;background:#fff;overflow:hidden;zoom:1}.wcv-setup-content h1,.wcv-setup-content h2,.wcv-setup-content h3,.wcv-setup-content table{margin:0 0 20px;border:0;padding:0;color:#666;clear:none;font-weight:500}.wcv-setup-content p{margin:20px 0;font-size:1em;line-height:1.75em;color:#666}.wcv-setup-content table{font-size:1em;line-height:1.75em;color:#666}.wcv-setup-content a{color:#005580}.wcv-setup-content a:focus,.wcv-setup-content a:hover{color:#111}.wcv-setup-content h4.help-title{text-align:center}.wcv-setup-content .wcv-setup-input input{padding:5px 10px;font-size:1em}.wcv-setup-content .wcv-setup-next-steps{overflow:hidden;margin:0 0 24px;padding-bottom:2px}.wcv-setup-content .wcv-setup-next-steps h2{margin-bottom:12px}.wcv-setup-content .wcv-setup-next-steps .wcv-setup-next-steps-first{float:left;width:50%;-webkit-box-sizing:border-box;box-sizing:border-box}.wcv-setup-content .wcv-setup-next-steps .wcv-setup-next-steps-last{float:right;width:50%;-webkit-box-sizing:border-box;box-sizing:border-box}.wcv-setup-content .wcv-setup-next-steps ul{padding:0 2em 0 0;list-style:none outside;margin:0}.wcv-setup-content .wcv-setup-next-steps ul li a{display:block;padding:0 0 .75em}.wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button{background-color:#f7f7f7;border-color:#ccc;color:#23282d;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #ccc;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #ccc;text-shadow:1px 0 1px #eee,0 1px 1px #eee;font-size:1em;height:auto;line-height:1.75em;margin:0 0 .75em;opacity:1;padding:1em;text-align:center}.wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button:active,.wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button:focus,.wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button:hover{background:#5897b6;border-color:#aaa}.wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button-primary{color:#fff;background-color:#bb77ae;border-color:#5897b6;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #5897b6;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #5897b6;text-shadow:0 -1px 1px #5897b6,1px 0 1px #5897b6,0 1px 1px #5897b6,-1px 0 1px #5897b6}.wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button-primary:active,.wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button-primary:focus,.wcv-setup-content .wcv-setup-next-steps ul .setup-product a.button-primary:hover{color:#fff;background:#5897b6;border-color:#5897b6;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #5897b6;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #5897b6}.wcv-setup-content .wcv-setup-next-steps ul li a::before{color:#82878c;font:normal 20px/1 dashicons;speak:none;display:inline-block;padding:0 10px 0 0;top:1px;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;vertical-align:top}.wcv-setup-content .wcv-setup-next-steps ul .learn-more a::before{content:'\f105'}.wcv-setup-content .wcv-setup-next-steps ul .video-walkthrough a::before{content:'\f126'}.wcv-setup-content .wcv-setup-next-steps ul .newsletter a::before{content:'\f465'}.wcv-setup-content .updated,.wcv-setup-content .wcvendors-newsletter,.wcv-setup-content .wcvendors-tracker{padding:24px 24px 0;margin:0 0 24px;overflow:hidden;background:#f5f5f5}.wcv-setup-content .updated p,.wcv-setup-content .wcvendors-newsletter p,.wcv-setup-content .wcvendors-tracker p{padding:0;margin:0 0 12px}.wcv-setup-content .updated form,.wcv-setup-content .updated p:last-child,.wcv-setup-content .wcvendors-newsletter form,.wcv-setup-content .wcvendors-newsletter p:last-child,.wcv-setup-content .wcvendors-tracker form,.wcv-setup-content .wcvendors-tracker p:last-child{margin:0 0 24px}.wcv-setup-content .wcvendors-tracker+.wcvendors-newsletter{margin-top:-24px;border-top:2px dashed #ddd}.wcv-setup-steps{padding:0 0 24px;margin:0;list-style:none outside;overflow:hidden;color:#ccc;width:100%;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.wcv-setup-steps li{width:25%;float:left;padding:0 0 .8em;margin:0;text-align:center;position:relative;border-bottom:4px solid #ccc;line-height:1.4em}.wcv-setup-steps li::before{content:'';border:4px solid #ccc;border-radius:100%;width:4px;height:4px;position:absolute;bottom:0;left:50%;margin-left:-6px;margin-bottom:-8px;background:#fff}.wcv-setup-steps li.active{border-color:#5897b6;color:#005580}.wcv-setup-steps li.active::before{border-color:#005580}.wcv-setup-steps li.done{border-color:#5897b6;color:#005580}.wcv-setup-steps li.done::before{border-color:#5897b6;background:#5897b6}.wcv-setup .wcv-setup-actions{overflow:hidden;margin:20px 0 0}.wcv-setup .wcv-setup-actions .button{font-size:1.25em;line-height:1em;margin-right:.5em;margin-bottom:2px;height:auto;border-radius:4px}.wcv-setup .wcv-setup-actions .button-primary{background-color:#005580;border-color:#5897b6;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #5897b6;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #5897b6;text-shadow:0 -1px 1px #5897b6,1px 0 1px #5897b6,0 1px 1px #5897b6,-1px 0 1px #5897b6;margin:0;opacity:1}.wcv-setup .wcv-setup-actions .button-primary:active,.wcv-setup .wcv-setup-actions .button-primary:focus,.wcv-setup .wcv-setup-actions .button-primary:hover{background:#5897b6;border-color:#5897b6;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #5897b6;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #5897b6}.wcv-setup-content p:last-child{margin-bottom:0}.wcv-setup-content p.store-setup{margin-top:0}.wcv-return-to-dashboard{font-size:.85em;color:#b5b5b5;margin:1.18em 0;display:block;text-align:center}.wcv-wizard-storefront .wcv-wizard-storefront-intro{padding:40px 40px 0;background:#f5f5f5;text-align:center}.wcv-wizard-storefront .wcv-wizard-storefront-intro img{margin:40px 0 0 0;width:100%;display:block}.wcv-wizard-storefront .wcv-wizard-storefront-features{list-style:none outside;margin:0 0 20px;padding:0 0 0 30px;overflow:hidden}.wcv-wizard-storefront .wcv-wizard-storefront-feature{margin:0;padding:20px 30px 20px 2em;width:50%;-webkit-box-sizing:border-box;box-sizing:border-box}.wcv-wizard-storefront .wcv-wizard-storefront-feature::before{margin-left:-2em;position:absolute}.wcv-wizard-storefront .wcv-wizard-storefront-feature.first{clear:both;float:left}.wcv-wizard-storefront .wcv-wizard-storefront-feature.last{float:right}.hide{display:none}.wcv-wizard-features{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;list-style:none;padding:0}.wcv-wizard-features .wcv-wizard-feature-item{-ms-flex-preferred-size:calc(50% - 4em - 3px);flex-basis:calc(50% - 4em - 3px);border:1px solid #eee;padding:2em}.wcv-wizard-features .wcv-wizard-feature-item:nth-child(1){border-radius:4px 0 0 0}.wcv-wizard-features .wcv-wizard-feature-item:nth-child(2){border-left:0;border-radius:0 4px 0 0}.wcv-wizard-features .wcv-wizard-feature-item:nth-child(3){border-top:0;border-radius:0 0 0 4px}.wcv-wizard-features .wcv-wizard-feature-item:nth-child(4){border-top:0;border-left:0;border-radius:0 0 4px 0}.wcv-wizard-features p.wcv-wizard-feature-description,.wcv-wizard-features p.wcv-wizard-feature-name{margin:0;line-height:1.5em}.step{text-align:center}.wcv-setup .wcv-setup-actions .button{font-weight:300;font-size:16px;padding:.5em 1em;-webkit-box-shadow:none;box-shadow:none;min-width:12em;min-width:auto;margin-top:10px;background-color:#005580;color:#fff}.wcv-setup .wcv-setup-actions .button:active,.wcv-setup .wcv-setup-actions .button:focus,.wcv-setup .wcv-setup-actions .button:hover{-webkit-box-shadow:none;box-shadow:none;background-color:#5897b6}.location-prompt{color:#666;font-size:13px;font-weight:500;margin-bottom:.5em;margin-top:1em;display:inline-block}.address-step .select2{min-width:100%}.store-address-container{margin-bottom:24px}.store-address-container .city-and-postcode{display:-webkit-box;display:-ms-flexbox;display:flex}.store-address-container .city-and-postcode div{-ms-flex-preferred-size:50%;flex-basis:50%;margin-right:1em}.store-address-container .city-and-postcode div:last-of-type{margin-right:0}.wcv-wizard-service-settings .payment-email-input{border:1px solid #aaa;border-color:#ddd;border-radius:4px;height:30px;padding:0 8px;font-size:14px;color:#444;background-color:#fff;display:inline-block}.newsletter-form-container{display:-webkit-box;display:-ms-flexbox;display:flex}.newsletter-form-container .newsletter-form-email{border:1px solid #aaa;border-color:#ddd;border-radius:4px;height:42px;padding:0 8px;font-size:16px;color:#666;background-color:#fff;display:inline-block;margin-right:6px;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.newsletter-form-container .newsletter-form-button-container{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0}.wcv-setup .wcv-setup-actions .button.newsletter-form-button{height:42px;padding:0 1em;margin:0}.wcv-wizard-next-steps{border:1px solid #eee;border-radius:4px;list-style:none;padding:0}.wcv-wizard-next-steps li{padding:0}.wcv-wizard-next-steps .wcv-wizard-next-step-item{display:-webkit-box;display:-ms-flexbox;display:flex;border-top:1px solid #eee}.wcv-wizard-next-steps .wcv-wizard-next-step-item:first-child{border-top:0}.wcv-wizard-next-steps .wcv-wizard-next-step-description{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;margin:1.5em}.wcv-wizard-next-steps .wcv-wizard-next-step-action{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.wcv-wizard-next-steps .wcv-wizard-next-step-action .button{margin:1em}.wcv-wizard-next-steps p.next-step-heading{margin:0;font-size:.95em;font-weight:400;font-variant:all-petite-caps}.wcv-wizard-next-steps p.next-step-extra-info{margin:0}.wcv-wizard-next-steps h3.next-step-description{margin:0;font-size:16px;font-weight:600}p.next-steps-help-text{color:#9f9f9f;padding:0 2em;text-align:center;font-size:.9em}.wcv-setup-table{width:100%}.wcv-setup-table .table-desc{width:80%}.wcv-setup-table .table-check{width:20%;text-align:right}.wcv-setup-table .table-check input.option_check{line-height:4em}.wcv-setup-table-pages{width:100%}.wcv-setup-table-pages .table-desc{width:60%}.wcv-setup-table-pages .table-check{width:40%}.wcv-setup-table-pages select{width:100%}.wcv-setup-table-pages .tool-tip{font-size:.75em}
trunk/assets/css/wcv-setup.scss ADDED
@@ -0,0 +1,540 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WC Vendors setup wizard styles
3
+ */
4
+
5
+ @import 'variables';
6
+
7
+ body {
8
+ margin: 65px auto 24px;
9
+ box-shadow: none;
10
+ background: #f1f1f1;
11
+ padding: 0;
12
+ }
13
+ #wcv-logo {
14
+ border: 0;
15
+ margin: 0 0 24px;
16
+ padding: 0;
17
+ text-align: center;
18
+ img {
19
+ max-width: 30%;
20
+ }
21
+ }
22
+ .wcv-setup-content {
23
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
24
+ padding: 2em;
25
+ margin: 0 0 20px;
26
+ background: #fff;
27
+ overflow: hidden;
28
+ zoom: 1;
29
+
30
+ h1, h2, h3, table {
31
+ margin: 0 0 20px;
32
+ border: 0;
33
+ padding: 0;
34
+ color: #666;
35
+ clear: none;
36
+ font-weight: 500;
37
+ }
38
+ p {
39
+ margin: 20px 0;
40
+ font-size: 1em;
41
+ line-height: 1.75em;
42
+ color: #666;
43
+ }
44
+ table {
45
+ font-size: 1em;
46
+ line-height: 1.75em;
47
+ color: #666;
48
+ }
49
+ a {
50
+ color: $wcvendors;
51
+ &:hover, &:focus {
52
+ color: #111;
53
+ }
54
+ }
55
+ h4.help-title {
56
+ text-align: center;
57
+ }
58
+ .wcv-setup-input {
59
+
60
+ input {
61
+ padding: 5px 10px;
62
+ font-size: 1em;
63
+ }
64
+
65
+ }
66
+ .wcv-setup-next-steps {
67
+ overflow: hidden;
68
+ margin: 0 0 24px;
69
+ padding-bottom: 2px;
70
+ h2 {
71
+ margin-bottom: 12px;
72
+ }
73
+ .wcv-setup-next-steps-first {
74
+ float: left;
75
+ width: 50%;
76
+ box-sizing: border-box;
77
+ }
78
+ .wcv-setup-next-steps-last {
79
+ float: right;
80
+ width: 50%;
81
+ box-sizing: border-box;
82
+ }
83
+ ul {
84
+ padding: 0 2em 0 0;
85
+ list-style: none outside;
86
+ margin: 0;
87
+ li a {
88
+ display: block;
89
+ padding: 0 0 0.75em;
90
+ }
91
+ .setup-product {
92
+ a.button {
93
+ background-color: #f7f7f7;
94
+ border-color: #ccc;
95
+ color: #23282d;
96
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #ccc;
97
+ text-shadow: 1px 0 1px #eee, 0 1px 1px #eee;
98
+ font-size: 1em;
99
+ height: auto;
100
+ line-height: 1.75em;
101
+ margin: 0 0 0.75em;
102
+ opacity: 1;
103
+ padding: 1em;
104
+ text-align: center;
105
+
106
+ &:hover, &:focus, &:active {
107
+ background: $wcvendors-light;
108
+ border-color: #aaa;
109
+ }
110
+ }
111
+ a.button-primary {
112
+ color: #fff;
113
+ background-color: #bb77ae;
114
+ border-color: $wcvendors-light;
115
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 $wcvendors-light;
116
+ text-shadow: 0 -1px 1px $wcvendors-light, 1px 0 1px $wcvendors-light, 0 1px 1px $wcvendors-light, -1px 0 1px $wcvendors-light;
117
+
118
+ &:hover, &:focus, &:active {
119
+ color: #fff;
120
+ background: $wcvendors-light;
121
+ border-color: $wcvendors-light;
122
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 $wcvendors-light;
123
+ }
124
+ }
125
+ }
126
+ li a::before {
127
+ color: #82878c;
128
+ font: normal 20px/1 'dashicons';
129
+ speak: none;
130
+ display: inline-block;
131
+ padding: 0 10px 0 0;
132
+ top: 1px;
133
+ position: relative;
134
+ -webkit-font-smoothing: antialiased;
135
+ -moz-osx-font-smoothing: grayscale;
136
+ text-decoration: none !important;
137
+ vertical-align: top;
138
+ }
139
+ .learn-more a::before {
140
+ content: '\f105';
141
+ }
142
+ .video-walkthrough a::before {
143
+ content: '\f126';
144
+ }
145
+ .newsletter a::before {
146
+ content: '\f465';
147
+ }
148
+ }
149
+ }
150
+ .wcvendors-newsletter,
151
+ .wcvendors-tracker,
152
+ .updated {
153
+ padding: 24px 24px 0;
154
+ margin: 0 0 24px;
155
+ overflow: hidden;
156
+ background: #f5f5f5;
157
+ p {
158
+ padding: 0;
159
+ margin: 0 0 12px;
160
+ }
161
+ form,
162
+ p:last-child {
163
+ margin: 0 0 24px;
164
+ }
165
+ }
166
+ .wcvendors-tracker + .wcvendors-newsletter {
167
+ margin-top: -24px;
168
+ border-top: 2px dashed #ddd;
169
+ }
170
+ }
171
+ .wcv-setup-steps {
172
+ padding: 0 0 24px;
173
+ margin: 0;
174
+ list-style: none outside;
175
+ overflow: hidden;
176
+ color: #ccc;
177
+ width:100%;
178
+ display: inline-flex;
179
+ li {
180
+ width: 25%;
181
+ float: left;
182
+ padding: 0 0 0.8em;
183
+ margin: 0;
184
+ text-align: center;
185
+ position: relative;
186
+ border-bottom: 4px solid #ccc;
187
+ line-height: 1.4em;
188
+ }
189
+ li::before {
190
+ content: '';
191
+ border: 4px solid #ccc;
192
+ border-radius: 100%;
193
+ width: 4px;
194
+ height: 4px;
195
+ position: absolute;
196
+ bottom: 0;
197
+ left: 50%;
198
+ margin-left: -6px;
199
+ margin-bottom: -8px;
200
+ background: #fff;
201
+ }
202
+ li.active {
203
+ border-color: $wcvendors-light;
204
+ color: $wcvendors;
205
+ &::before {
206
+ border-color: #005580;
207
+ }
208
+ }
209
+ li.done {
210
+ border-color: $wcvendors-light;
211
+ color: $wcvendors;
212
+ &::before {
213
+ border-color: $wcvendors-light;
214
+ background: $wcvendors-light;
215
+ }
216
+ }
217
+ }
218
+ .wcv-setup .wcv-setup-actions {
219
+ overflow: hidden;
220
+ margin: 20px 0 0;
221
+ .button {
222
+ font-size: 1.25em;
223
+ line-height: 1em;
224
+ margin-right: 0.5em;
225
+ margin-bottom: 2px;
226
+ height: auto;
227
+ border-radius: 4px;
228
+ }
229
+ .button-primary {
230
+ background-color: $wcvendors;
231
+ border-color: $wcvendors-light;
232
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 $wcvendors-light;
233
+ text-shadow: 0 -1px 1px $wcvendors-light, 1px 0 1px $wcvendors-light, 0 1px 1px $wcvendors-light, -1px 0 1px $wcvendors-light;
234
+ margin: 0;
235
+ opacity: 1;
236
+
237
+ &:hover, &:focus, &:active {
238
+ background: $wcvendors-light;
239
+ border-color: $wcvendors-light;
240
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 $wcvendors-light;
241
+ }
242
+ }
243
+ }
244
+
245
+ .wcv-setup-content p:last-child {
246
+ margin-bottom: 0;
247
+ }
248
+
249
+ .wcv-setup-content p.store-setup {
250
+ margin-top: 0;
251
+ }
252
+
253
+ .wcv-return-to-dashboard {
254
+ font-size: 0.85em;
255
+ color: #b5b5b5;
256
+ margin: 1.18em 0;
257
+ display: block;
258
+ text-align: center;
259
+ }
260
+
261
+ .wcv-wizard-storefront {
262
+ .wcv-wizard-storefront-intro {
263
+ padding: 40px 40px 0;
264
+ background: #F5F5F5;
265
+ text-align: center;
266
+
267
+ img {
268
+ margin: 40px 0 0 0;
269
+ width: 100%;
270
+ display: block;
271
+ }
272
+ }
273
+ .wcv-wizard-storefront-features {
274
+ list-style: none outside;
275
+ margin: 0 0 20px;
276
+ padding: 0 0 0 30px;
277
+ overflow: hidden;
278
+ }
279
+ .wcv-wizard-storefront-feature {
280
+ margin: 0;
281
+ padding: 20px 30px 20px 2em;
282
+ width: 50%;
283
+ box-sizing: border-box;
284
+
285
+ &::before {
286
+ margin-left: -2em;
287
+ position: absolute;
288
+ }
289
+ &.first {
290
+ clear: both;
291
+ float: left;
292
+ }
293
+ &.last {
294
+ float: right;
295
+ }
296
+ }
297
+ }
298
+
299
+ .hide {
300
+ display: none;
301
+ }
302
+
303
+ .wcv-wizard-features {
304
+ display: flex;
305
+ flex-wrap: wrap;
306
+ list-style: none;
307
+ padding: 0;
308
+
309
+ .wcv-wizard-feature-item {
310
+ flex-basis: calc( 50% - 4em - 3px); // two columns, account for padding and borders
311
+ border: 1px solid #eee;
312
+ padding: 2em;
313
+ }
314
+
315
+ .wcv-wizard-feature-item:nth-child(1) {
316
+ border-radius: 4px 0 0 0;
317
+ }
318
+
319
+ .wcv-wizard-feature-item:nth-child(2) {
320
+ border-left: 0;
321
+ border-radius: 0 4px 0 0;
322
+ }
323
+
324
+ .wcv-wizard-feature-item:nth-child(3) {
325
+ border-top: 0;
326
+ border-radius: 0 0 0 4px;
327
+ }
328
+
329
+ .wcv-wizard-feature-item:nth-child(4) {
330
+ border-top: 0;
331
+ border-left: 0;
332
+ border-radius: 0 0 4px 0;
333
+ }
334
+
335
+ p.wcv-wizard-feature-name,
336
+ p.wcv-wizard-feature-description {
337
+ margin: 0;
338
+ line-height: 1.5em;
339
+ }
340
+ }
341
+
342
+ .step {
343
+ text-align: center;
344
+ }
345
+
346
+ .wcv-setup .wcv-setup-actions .button {
347
+ font-weight: 300;
348
+ font-size: 16px;
349
+ padding: 0.5em 1em;
350
+ box-shadow: none;
351
+ min-width: 12em;
352
+ min-width: auto;
353
+ margin-top:10px;
354
+ background-color: $wcvendors;
355
+ color: $white;
356
+
357
+ &:focus,
358
+ &:hover,
359
+ &:active {
360
+ box-shadow: none;
361
+ background-color: $wcvendors-light;
362
+ }
363
+ }
364
+
365
+ .location-prompt {
366
+ color: #666;
367
+ font-size: 13px;
368
+ font-weight: 500;
369
+ margin-bottom: 0.5em;
370
+ margin-top: 1em;
371
+ display: inline-block;
372
+ }
373
+
374
+ .address-step {
375
+ .select2 {
376
+ min-width: 100%; // widen currency, product type dropdowns
377
+ }
378
+ }
379
+
380
+ .store-address-container {
381
+ margin-bottom: 24px; // match margin-bottom on top paragraph
382
+
383
+ .city-and-postcode {
384
+ display: flex;
385
+
386
+ div {
387
+ flex-basis: 50%;
388
+ margin-right: 1em;
389
+
390
+ &:last-of-type {
391
+ margin-right: 0;
392
+ }
393
+ }
394
+ }
395
+ }
396
+
397
+ .wcv-wizard-service-settings {
398
+ .payment-email-input {
399
+ border: 1px solid #aaa;
400
+ border-color: #ddd;
401
+ border-radius: 4px;
402
+ height: 30px;
403
+ padding: 0 8px;
404
+ font-size: 14px;
405
+ color: #444;
406
+ background-color: #fff;
407
+ display: inline-block;
408
+ }
409
+ }
410
+
411
+ .newsletter-form-container {
412
+ display: flex;
413
+
414
+ .newsletter-form-email {
415
+ border: 1px solid #aaa;
416
+ border-color: #ddd;
417
+ border-radius: 4px;
418
+ height: 42px;
419
+ padding: 0 8px;
420
+ font-size: 16px;
421
+ color: #666;
422
+ background-color: #fff;
423
+ display: inline-block;
424
+ margin-right: 6px;
425
+ flex-grow: 1;
426
+ }
427
+
428
+ .newsletter-form-button-container {
429
+ flex-grow: 0;
430
+ }
431
+ }
432
+
433
+ .wcv-setup .wcv-setup-actions .button.newsletter-form-button {
434
+ height: 42px;
435
+ padding: 0 1em;
436
+ margin: 0;
437
+ }
438
+
439
+ .wcv-wizard-next-steps {
440
+ border: 1px solid #eee;
441
+ border-radius: 4px;
442
+ list-style: none;
443
+ padding: 0;
444
+
445
+ li {
446
+ padding: 0;
447
+ }
448
+
449
+ .wcv-wizard-next-step-item {
450
+ display: flex;
451
+ border-top: 1px solid #eee;
452
+
453
+ &:first-child {
454
+ border-top: 0;
455
+ }
456
+ }
457
+
458
+ .wcv-wizard-next-step-description {
459
+ flex-grow: 1;
460
+ margin: 1.5em;
461
+ }
462
+
463
+ .wcv-wizard-next-step-action {
464
+ flex-grow: 0;
465
+ display: flex;
466
+ align-items: center;
467
+
468
+ .button {
469
+ margin: 1em;
470
+ }
471
+ }
472
+
473
+ p {
474
+ &.next-step-heading {
475
+ margin: 0;
476
+ font-size: 0.95em;
477
+ font-weight: 400;
478
+ font-variant: all-petite-caps;
479
+ }
480
+
481
+ &.next-step-extra-info {
482
+ margin: 0;
483
+ }
484
+ }
485
+
486
+ h3 {
487
+ &.next-step-description {
488
+ margin: 0;
489
+ font-size: 16px;
490
+ font-weight: 600;
491
+ }
492
+ }
493
+ }
494
+
495
+ p.next-steps-help-text {
496
+ color: #9f9f9f;
497
+ padding: 0 2em;
498
+ text-align: center;
499
+ font-size: .9em;
500
+ }
501
+
502
+ .wcv-setup-table {
503
+ width: 100%;
504
+
505
+ .table-desc {
506
+ width: 80%;
507
+ }
508
+
509
+ .table-check {
510
+ width: 20%;
511
+ text-align: right;
512
+
513
+ input.option_check {
514
+ line-height: 4em;
515
+ }
516
+ }
517
+ }
518
+
519
+ .wcv-setup-table-pages {
520
+
521
+ width: 100%;
522
+
523
+ .table-desc {
524
+ width: 60%;
525
+ }
526
+
527
+ .table-check{
528
+ width: 40%;
529
+
530
+ }
531
+
532
+ select {
533
+ width: 100%;
534
+ }
535
+
536
+ .tool-tip {
537
+ font-size: 0.75em;
538
+ }
539
+
540
+ }
trunk/assets/icon-128x128.png ADDED
Binary file
trunk/assets/icon-256x256.png ADDED
Binary file
trunk/assets/icon.svg ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg viewBox="0 0 500 500" xmlns:xlink="http://www.w3.org/1999/xlink" height="500pt" xmlns="http://www.w3.org/2000/svg" width="500pt" version="1.1"><defs>
2
+ <path d="M0.00 0.00 L500.00 0.00 L500.00 500.00 L0.00 500.00 L0.00 0.00" id="p1" />
3
+ <path d="M81.20 65.86 C86.56 60.77 91.79 55.56 97.38 50.72 C107.88 60.16 117.24 70.79 127.00 80.99 C128.97 82.95 130.73 85.43 133.41 86.45 C159.98 91.11 186.86 94.12 213.31 99.49 C210.33 110.00 209.66 121.01 210.56 131.87 C209.92 132.04 208.62 132.39 207.98 132.56 C202.01 127.72 197.14 121.68 191.11 116.90 C189.06 118.91 187.01 120.94 185.01 123.02 C190.35 131.20 200.26 135.94 203.39 145.57 C209.87 163.03 216.76 180.34 223.07 197.87 C224.22 201.13 225.75 204.40 225.73 207.92 C225.48 210.20 224.29 212.23 223.45 214.33 C218.99 214.61 213.97 215.23 210.88 218.83 C206.43 223.50 206.18 231.57 210.72 236.26 C214.45 240.56 221.21 241.88 226.19 239.01 C229.57 237.26 231.39 233.76 233.26 230.63 C245.84 230.66 258.41 230.60 270.99 230.62 C273.85 234.22 277.18 238.38 282.14 238.75 C290.33 239.91 298.02 231.30 296.09 223.30 C295.06 218.43 291.12 213.77 285.94 213.32 C283.08 213.15 279.97 212.97 277.41 214.48 C274.11 216.23 272.37 219.70 270.36 222.67 C257.45 222.43 244.54 222.73 231.63 222.60 C231.23 221.17 230.42 219.79 230.48 218.28 C232.02 214.41 234.51 211.00 236.64 207.44 C258.76 207.23 280.89 207.41 303.02 207.35 C306.26 207.36 309.47 206.89 312.68 206.51 C318.99 188.69 324.59 170.62 330.81 152.76 C335.01 141.26 338.42 129.35 338.50 117.01 C340.36 116.86 342.22 116.70 344.09 116.61 C361.99 119.04 379.93 121.68 397.83 124.32 C402.13 124.81 406.39 125.63 410.62 126.55 C403.27 145.65 395.55 164.62 387.85 183.58 C378.36 207.78 368.47 231.83 358.81 255.96 C358.00 257.55 357.28 260.14 354.98 259.62 C302.96 259.67 250.95 259.66 198.94 259.64 C192.82 268.77 187.99 278.69 182.23 288.04 C183.91 290.90 185.62 293.75 187.31 296.60 C219.72 296.40 252.14 296.83 284.55 296.58 C286.89 292.12 289.20 287.47 293.01 284.04 C299.46 278.23 308.31 274.89 317.02 275.69 C323.90 276.57 330.74 279.33 335.69 284.30 C344.03 292.07 347.71 304.76 344.07 315.67 C340.38 328.98 326.77 338.79 312.95 337.73 C305.62 337.97 298.61 334.62 293.18 329.88 C289.31 326.54 286.92 321.92 284.65 317.42 C252.37 317.52 220.08 317.37 187.79 317.40 C184.23 327.96 175.12 336.50 164.06 338.49 C157.93 338.96 151.44 339.27 145.74 336.56 C136.84 332.90 130.00 324.79 127.80 315.44 C123.88 301.38 131.94 285.22 145.36 279.60 C151.47 276.43 158.54 277.23 165.16 277.52 C168.19 272.67 171.14 267.76 173.92 262.75 C174.75 261.00 175.93 259.01 175.05 257.05 C156.08 206.34 137.13 155.61 118.35 104.82 C116.85 100.91 113.30 98.43 110.51 95.50 C100.78 85.58 90.84 75.87 81.20 65.86" id="p2" />
4
+ <path d="M253.24 60.18 C263.69 56.37 275.17 55.47 286.08 57.67 C306.03 61.43 323.82 75.24 332.41 93.63 C335.86 100.47 337.10 108.10 338.47 115.57 C340.34 115.90 342.21 116.25 344.09 116.61 C342.22 116.70 340.36 116.86 338.50 117.01 C338.42 129.35 335.01 141.26 330.81 152.76 C330.91 152.05 331.11 150.61 331.21 149.90 C327.89 149.46 324.57 149.03 321.26 148.54 C324.36 145.83 326.00 142.01 327.03 138.11 C322.06 139.30 317.29 141.18 312.62 143.23 C312.54 144.58 312.47 145.93 312.39 147.28 C304.65 146.22 296.88 145.38 289.15 144.31 C296.20 144.79 303.34 144.08 309.67 140.72 C309.16 130.99 307.96 121.15 304.13 112.11 C294.74 115.07 285.26 117.86 276.27 121.91 C278.45 129.10 280.84 136.23 283.68 143.20 C281.05 142.76 278.41 142.43 275.79 142.02 C277.11 142.05 278.44 142.07 279.76 142.06 C278.04 135.54 276.02 129.08 273.04 123.01 C263.51 125.91 254.10 129.22 244.90 133.05 C245.84 134.76 246.79 136.47 247.76 138.18 C246.23 137.96 244.70 137.73 243.18 137.48 C242.91 136.63 242.38 134.93 242.11 134.08 C240.17 134.82 238.24 135.58 236.29 136.25 C234.13 135.94 231.97 135.60 229.80 135.37 C233.53 133.99 237.13 132.29 240.76 130.67 C238.29 121.32 236.29 111.85 235.33 102.22 C230.57 103.65 225.55 104.63 221.26 107.25 C219.83 107.98 219.46 109.65 219.15 111.08 C217.74 118.45 218.42 126.01 219.67 133.35 C222.15 133.94 224.63 134.56 227.13 135.09 C220.73 134.36 214.33 133.60 207.98 132.56 C208.62 132.39 209.92 132.04 210.56 131.87 C209.66 121.01 210.33 110.00 213.31 99.49 C214.95 97.03 216.72 94.62 217.77 91.82 C224.02 76.61 237.71 65.12 253.24 60.18" id="p3" />
5
+ <path d="M275.16 65.49 C285.44 65.01 295.90 68.43 304.25 74.39 C299.93 76.02 295.68 78.09 291.08 78.77 C289.26 78.22 288.12 76.47 286.74 75.25 C283.30 71.52 279.12 68.62 275.16 65.49" id="p4" />
6
+ <path d="M257.29 67.74 C260.96 67.01 264.82 64.89 268.55 66.41 C275.87 69.13 281.83 74.53 286.98 80.25 C279.76 83.40 272.26 85.85 264.77 88.30 C261.91 81.58 259.74 74.61 257.29 67.74" id="p5" />
7
+ <path d="M244.73 74.69 C246.69 71.38 250.73 70.47 253.98 68.91 C256.43 75.78 259.22 82.55 261.07 89.62 C253.86 92.39 246.55 94.88 239.17 97.13 C239.01 89.33 240.64 81.39 244.73 74.69" id="p6" />
8
+ <path d="M293.00 81.94 C298.24 80.55 303.16 77.58 308.64 77.32 C316.48 83.22 322.52 91.57 326.03 100.72 C319.66 103.33 313.07 105.32 306.68 107.85 C304.99 104.32 303.45 100.72 301.81 97.17 C299.36 91.82 295.93 87.02 293.00 81.94" id="p7" />
9
+ <path d="M223.06 99.00 C226.54 90.81 231.87 83.26 238.92 77.77 C237.24 84.66 235.54 91.61 235.40 98.75 C231.38 100.03 227.16 99.59 223.06 99.00" id="p8" />
10
+ <path d="M265.96 91.87 C273.55 88.59 281.49 86.23 289.21 83.26 C295.39 91.04 300.24 99.97 303.07 109.51 C301.21 109.62 299.35 109.77 297.49 109.73 C289.68 109.23 282.02 107.44 274.21 106.86 C272.58 106.37 270.71 105.75 269.96 104.07 C268.00 100.24 267.22 95.95 265.96 91.87" id="p9" />
11
+ <path d="M244.65 98.80 C250.62 96.97 256.46 94.72 262.47 93.04 C264.07 97.12 265.59 101.23 266.82 105.43 C266.08 105.31 264.58 105.05 263.84 104.93 C255.85 103.73 247.89 102.15 239.82 101.67 C241.19 100.36 242.79 99.29 244.65 98.80" id="p10" />
12
+ <path d="M221.08 100.93 C223.47 100.26 225.92 99.94 228.40 99.93 C226.49 101.61 224.27 102.88 221.97 103.96 C221.68 102.94 221.38 101.93 221.08 100.93" id="p11" />
13
+ <path d="M221.26 107.25 C225.55 104.63 230.57 103.65 235.33 102.22 C236.29 111.85 238.29 121.32 240.76 130.67 C237.13 132.29 233.53 133.99 229.80 135.37 C229.13 135.30 227.79 135.16 227.13 135.09 C224.63 134.56 222.15 133.94 219.67 133.35 C218.42 126.01 217.74 118.45 219.15 111.08 C219.46 109.65 219.83 107.98 221.26 107.25" id="p12" />
14
+ <path d="M238.32 101.65 C238.69 101.65 239.44 101.67 239.82 101.67 C247.89 102.15 255.85 103.73 263.84 104.93 C269.90 107.04 270.01 114.59 271.94 119.75 C262.84 123.54 253.47 126.65 244.14 129.82 C240.28 120.92 239.46 111.16 238.32 101.65" id="p13" />
15
+ <path d="M309.15 110.27 C315.15 108.26 321.12 106.14 327.11 104.09 C328.26 107.44 328.98 110.92 329.43 114.43 C328.57 114.32 326.85 114.11 325.99 114.00 C320.71 113.11 315.39 112.32 310.02 112.23 C309.80 111.74 309.37 110.76 309.15 110.27" id="p14" />
16
+ <path d="M271.10 106.60 C271.88 106.67 273.43 106.80 274.21 106.86 C282.02 107.44 289.68 109.23 297.49 109.73 C291.10 114.55 282.87 115.54 275.71 118.80 C273.39 115.07 271.97 110.89 271.10 106.60" id="p15" />
17
+ <path d="M276.27 121.91 C285.26 117.86 294.74 115.07 304.13 112.11 C307.96 121.15 309.16 130.99 309.67 140.72 C303.34 144.08 296.20 144.79 289.15 144.31 C287.33 143.93 285.51 143.52 283.68 143.20 C280.84 136.23 278.45 129.10 276.27 121.91" id="p16" />
18
+ <path d="M308.08 112.16 C308.56 112.18 309.54 112.21 310.02 112.23 C315.39 112.32 320.71 113.11 325.99 114.00 C327.22 114.33 328.42 114.74 329.63 115.15 C329.71 120.23 330.06 125.37 329.19 130.41 C328.85 131.79 328.60 133.45 327.26 134.23 C322.80 136.90 317.60 137.90 312.62 139.17 C312.24 130.00 310.00 121.09 308.08 112.16" id="p17" />
19
+ <path d="M185.01 123.02 C187.01 120.94 189.06 118.91 191.11 116.90 C197.14 121.68 202.01 127.72 207.98 132.56 C214.33 133.60 220.73 134.36 227.13 135.09 C227.79 135.16 229.13 135.30 229.80 135.37 C231.97 135.60 234.13 135.94 236.29 136.25 C238.59 136.64 240.87 137.11 243.18 137.48 C244.70 137.73 246.23 137.96 247.76 138.18 C257.11 139.42 266.44 140.80 275.79 142.02 C278.41 142.43 281.05 142.76 283.68 143.20 C285.51 143.52 287.33 143.93 289.15 144.31 C296.88 145.38 304.65 146.22 312.39 147.28 C315.36 147.60 318.31 148.07 321.26 148.54 C324.57 149.03 327.89 149.46 331.21 149.90 C331.11 150.61 330.91 152.05 330.81 152.76 C324.59 170.62 318.99 188.69 312.68 206.51 C309.47 206.89 306.26 207.36 303.02 207.35 C280.89 207.41 258.76 207.23 236.64 207.44 C234.51 211.00 232.02 214.41 230.48 218.28 C230.42 219.79 231.23 221.17 231.63 222.60 C244.54 222.73 257.45 222.43 270.36 222.67 C272.37 219.70 274.11 216.23 277.41 214.48 C279.97 212.97 283.08 213.15 285.94 213.32 C291.12 213.77 295.06 218.43 296.09 223.30 C298.02 231.30 290.33 239.91 282.14 238.75 C277.18 238.38 273.85 234.22 270.99 230.62 C258.41 230.60 245.84 230.66 233.26 230.63 C231.39 233.76 229.57 237.26 226.19 239.01 C221.21 241.88 214.45 240.56 210.72 236.26 C206.18 231.57 206.43 223.50 210.88 218.83 C213.97 215.23 218.99 214.61 223.45 214.33 C224.29 212.23 225.48 210.20 225.73 207.92 C225.75 204.40 224.22 201.13 223.07 197.87 C216.76 180.34 209.87 163.03 203.39 145.57 C200.26 135.94 190.35 131.20 185.01 123.02" id="p18" />
20
+ <path d="M244.90 133.05 C254.10 129.22 263.51 125.91 273.04 123.01 C276.02 129.08 278.04 135.54 279.76 142.06 C278.44 142.07 277.11 142.05 275.79 142.02 C266.44 140.80 257.11 139.42 247.76 138.18 C246.79 136.47 245.84 134.76 244.90 133.05" id="p19" />
21
+ <path d="M236.29 136.25 C238.24 135.58 240.17 134.82 242.11 134.08 C242.38 134.93 242.91 136.63 243.18 137.48 C240.87 137.11 238.59 136.64 236.29 136.25" id="p20" />
22
+ <path d="M312.62 143.23 C317.29 141.18 322.06 139.30 327.03 138.11 C326.00 142.01 324.36 145.83 321.26 148.54 C318.31 148.07 315.36 147.60 312.39 147.28 C312.47 145.93 312.54 144.58 312.62 143.23" id="p21" />
23
+ <path d="M307.28 144.01 C308.89 142.91 310.81 145.58 308.86 146.46 C307.25 147.55 305.34 144.90 307.28 144.01" id="p22" />
24
+ <path d="M334.44 364.50 C337.13 364.56 339.83 364.56 342.52 364.53 C342.61 382.95 342.59 401.36 342.60 419.78 C340.72 419.54 338.71 419.77 336.95 418.99 C335.99 417.77 335.28 416.38 334.50 415.05 C331.13 417.51 327.44 420.24 323.01 419.85 C318.57 420.21 314.00 418.16 311.74 414.26 C308.30 408.88 308.10 402.15 308.80 395.99 C309.63 388.95 314.97 382.17 322.23 381.16 C326.53 380.09 330.61 382.39 334.44 384.02 C334.50 377.51 334.48 371.00 334.44 364.50" id="p23" />
25
+ <path d="M143.41 370.40 C153.35 363.44 167.47 364.52 176.74 372.15 C175.45 374.12 174.16 376.09 172.89 378.07 C168.25 375.68 163.45 372.78 157.99 373.35 C150.51 373.18 143.91 379.07 142.29 386.21 C140.36 394.04 141.45 403.57 147.86 409.11 C152.13 413.05 158.33 413.23 163.78 412.54 C167.33 411.93 170.22 409.61 173.11 407.64 C174.60 409.18 176.12 410.71 177.66 412.22 C171.73 419.80 161.09 421.64 152.09 419.87 C143.82 418.24 136.85 411.76 134.26 403.80 C130.24 392.30 133.04 377.63 143.41 370.40" id="p24" />
26
+ <path d="M178.93 366.41 C181.81 366.43 184.70 366.45 187.58 366.46 C191.15 373.80 193.75 381.54 196.85 389.06 C199.50 395.69 202.23 402.30 204.41 409.10 C207.00 401.05 210.22 393.23 213.47 385.43 C216.14 379.11 217.79 372.37 221.19 366.37 C224.12 366.38 227.06 366.39 229.99 366.39 C222.35 383.96 215.94 402.03 208.42 419.64 C205.73 419.62 203.05 419.62 200.37 419.66 C193.36 401.85 185.80 384.27 178.93 366.41" id="p25" />
27
+ <path d="M53.08 366.56 C54.07 366.56 56.03 366.57 57.02 366.58 C59.99 376.33 63.12 386.04 66.10 395.79 C68.45 403.67 71.43 411.37 73.07 419.45 C71.64 418.81 70.22 418.18 68.81 417.54 C63.90 400.45 58.20 383.59 53.08 366.56" id="p26" />
28
+ <path d="M57.02 366.58 C59.94 366.60 62.94 366.20 65.80 366.93 C67.30 368.09 67.56 370.16 68.20 371.83 C70.70 380.91 73.68 389.86 75.87 399.03 C76.58 398.07 77.29 397.11 78.00 396.17 C77.41 399.59 77.49 403.08 77.87 406.52 C80.78 400.52 82.51 394.06 84.63 387.77 C87.02 380.58 89.38 373.38 91.82 366.21 C93.85 366.39 95.88 366.47 97.89 366.82 C100.03 368.84 100.44 371.96 101.47 374.60 C104.30 382.72 106.30 391.18 110.29 398.85 C110.83 401.34 111.42 403.82 112.07 406.29 C116.25 393.06 119.43 379.54 123.93 366.41 C126.82 366.48 129.71 366.51 132.60 366.59 C127.46 384.35 121.60 401.89 116.44 419.64 C113.67 419.69 110.90 419.73 108.13 419.84 C104.06 406.35 99.53 393.00 95.02 379.66 C94.47 382.07 93.95 384.49 93.38 386.91 C92.32 388.69 91.14 390.43 90.50 392.42 C87.65 401.55 84.83 410.70 81.53 419.67 C77.67 420.08 73.80 420.33 69.92 420.43 C69.55 419.46 69.18 418.50 68.81 417.54 C70.22 418.18 71.64 418.81 73.07 419.45 C71.43 411.37 68.45 403.67 66.10 395.79 C63.12 386.04 59.99 376.33 57.02 366.58" id="p27" />
29
+ <path d="M87.64 367.66 C88.84 366.71 90.38 366.53 91.82 366.21 C89.38 373.38 87.02 380.58 84.63 387.77 C82.51 394.06 80.78 400.52 77.87 406.52 C77.49 403.08 77.41 399.59 78.00 396.17 C80.06 389.57 82.26 383.01 84.45 376.46 C85.45 373.51 86.05 370.38 87.64 367.66" id="p28" />
30
+ <path d="M110.29 398.85 C113.64 388.16 116.22 377.23 119.93 366.65 C121.26 366.56 122.60 366.48 123.93 366.41 C119.43 379.54 116.25 393.06 112.07 406.29 C111.42 403.82 110.83 401.34 110.29 398.85" id="p29" />
31
+ <path d="M93.38 386.91 C93.95 384.49 94.47 382.07 95.02 379.66 C99.53 393.00 104.06 406.35 108.13 419.84 C106.82 419.76 105.51 419.70 104.20 419.64 C100.73 408.69 97.31 397.70 93.38 386.91" id="p30" />
32
+ <path d="M240.45 381.73 C245.53 380.89 251.36 380.95 255.44 384.55 C260.47 388.46 261.75 395.23 261.36 401.26 C252.58 401.58 243.79 401.33 235.01 401.45 C235.52 405.78 236.64 410.89 241.00 412.92 C246.63 415.31 252.58 412.65 257.78 410.41 C258.80 411.69 259.83 412.96 260.85 414.24 C253.37 422.03 238.99 422.70 231.76 414.24 C227.04 408.88 226.65 401.18 227.77 394.46 C229.20 388.37 234.33 383.12 240.45 381.73" id="p31" />
33
+ <path d="M276.09 385.85 C279.07 383.74 282.21 381.30 286.05 381.30 C290.21 380.89 294.83 382.15 297.38 385.66 C300.32 389.80 300.32 395.13 300.31 400.00 C300.18 406.54 300.59 413.09 299.88 419.61 C297.38 419.58 294.88 419.57 292.39 419.59 C292.34 412.04 292.43 404.50 292.37 396.95 C292.22 394.02 292.11 390.37 289.38 388.58 C284.98 386.05 278.71 388.04 276.18 392.26 C275.20 401.33 276.03 410.54 275.84 419.66 C273.33 419.61 270.82 419.59 268.31 419.58 C268.03 411.39 268.50 403.19 267.93 395.01 C267.67 390.53 267.76 386.04 268.07 381.57 C269.65 381.63 271.24 381.63 272.82 381.86 C274.32 382.78 275.06 384.48 276.09 385.85" id="p32" />
34
+ <path d="M362.54 381.76 C368.44 380.79 375.43 380.52 380.15 384.84 C384.95 388.66 386.95 395.04 386.72 401.01 C386.89 407.38 383.97 414.05 378.42 417.45 C374.26 420.20 369.00 419.98 364.24 419.55 C356.95 418.56 351.03 412.20 350.37 404.91 C350.02 400.00 349.71 394.70 352.21 390.25 C354.24 386.12 358.06 382.91 362.54 381.76" id="p33" />
35
+ <path d="M409.50 381.26 C411.81 380.14 414.33 381.12 416.67 381.59 C416.48 383.91 416.32 386.23 416.15 388.55 C412.77 388.73 409.05 388.26 406.05 390.15 C403.52 392.27 402.42 395.71 402.52 398.94 C402.49 405.78 402.68 412.61 402.48 419.44 C399.86 419.42 397.24 419.41 394.63 419.41 C394.67 406.79 394.49 394.17 394.69 381.56 C396.87 381.58 399.04 381.63 401.23 381.69 C401.44 383.79 401.63 385.89 401.81 387.99 C404.06 385.44 406.14 382.42 409.50 381.26" id="p34" />
36
+ <path d="M426.86 382.05 C433.14 379.23 440.14 381.39 445.61 384.95 C444.77 386.46 443.94 387.97 443.10 389.48 C438.67 388.10 433.45 384.99 429.04 388.07 C427.05 389.20 427.51 391.75 427.18 393.66 C432.77 397.46 440.85 397.10 445.01 402.96 C448.54 408.99 444.44 417.02 438.03 418.97 C431.50 420.68 424.21 419.88 418.70 415.77 C419.50 414.12 420.32 412.50 421.17 410.88 C425.94 412.40 431.21 416.20 436.20 413.24 C439.21 411.93 439.70 406.96 436.60 405.45 C431.65 402.58 424.89 402.74 421.17 397.88 C417.30 392.40 420.67 384.08 426.86 382.05" id="p35" />
37
+ <path d="M241.60 387.61 C244.69 386.95 248.48 386.69 250.97 389.01 C253.20 390.77 253.61 393.74 254.33 396.31 C247.93 396.56 241.51 396.60 235.11 396.33 C236.00 392.73 237.71 388.76 241.60 387.61" id="p36" />
38
+ <path d="M323.47 387.57 C327.21 386.79 332.49 387.10 334.27 391.07 C334.79 395.71 334.47 400.40 334.54 405.06 C335.59 412.84 323.62 416.76 319.06 410.94 C316.44 406.87 316.21 401.71 316.83 397.05 C317.45 393.16 319.41 388.80 323.47 387.57" id="p37" />
39
+ <path d="M364.46 387.73 C368.51 386.76 373.52 387.21 376.12 390.88 C378.70 394.66 378.78 399.58 378.39 403.99 C377.91 407.70 376.28 412.02 372.35 413.21 C368.58 414.10 363.76 414.21 361.07 410.93 C357.83 407.06 358.04 401.71 358.41 396.99 C358.73 393.24 360.61 388.95 364.46 387.73" id="p38" /></defs><g stroke-width="10pt">
40
+ <use stroke="#fff" xlink:href="#p1" />
41
+ <use stroke="#005580" xlink:href="#p2" />
42
+ <use stroke="#5e9ab8" xlink:href="#p3" />
43
+ <use stroke="#fff" xlink:href="#p4" />
44
+ <use stroke="#fff" xlink:href="#p5" />
45
+ <use stroke="#fff" xlink:href="#p6" />
46
+ <use stroke="#fff" xlink:href="#p7" />
47
+ <use stroke="#fff" xlink:href="#p8" />
48
+ <use stroke="#fff" xlink:href="#p9" />
49
+ <use stroke="#fff" xlink:href="#p10" />
50
+ <use stroke="#005580" xlink:href="#p11" />
51
+ <use stroke="#005580" xlink:href="#p12" />
52
+ <use stroke="#005580" xlink:href="#p13" />
53
+ <use stroke="#fff" xlink:href="#p14" />
54
+ <use stroke="#005580" xlink:href="#p15" />
55
+ <use stroke="#005580" xlink:href="#p16" />
56
+ <use stroke="#005580" xlink:href="#p17" />
57
+ <use stroke="#fff" xlink:href="#p18" />
58
+ <use stroke="#005580" xlink:href="#p19" />
59
+ <use stroke="#005580" xlink:href="#p20" />
60
+ <use stroke="#005580" xlink:href="#p21" />
61
+ <use stroke="#005580" xlink:href="#p22" />
62
+ <use stroke="#5e9ab8" xlink:href="#p23" />
63
+ <use stroke="#5e9ab8" xlink:href="#p24" />
64
+ <use stroke="#5e9ab8" xlink:href="#p25" />
65
+ <use stroke="#005580" xlink:href="#p26" />
66
+ <use stroke="#5e9ab8" xlink:href="#p27" />
67
+ <use stroke="#005580" xlink:href="#p28" />
68
+ <use stroke="#005580" xlink:href="#p29" />
69
+ <use stroke="#005580" xlink:href="#p30" />
70
+ <use stroke="#5e9ab8" xlink:href="#p31" />
71
+ <use stroke="#5e9ab8" xlink:href="#p32" />
72
+ <use stroke="#5e9ab8" xlink:href="#p33" />
73
+ <use stroke="#5e9ab8" xlink:href="#p34" />
74
+ <use stroke="#5e9ab8" xlink:href="#p35" />
75
+ <use stroke="#fff" xlink:href="#p36" />
76
+ <use stroke="#fff" xlink:href="#p37" />
77
+ <use stroke="#fff" xlink:href="#p38" /></g><g>
78
+ <use xlink:href="#p1" fill="#fff" />
79
+ <use xlink:href="#p2" fill="#005580" />
80
+ <use xlink:href="#p3" fill="#5e9ab8" />
81
+ <use xlink:href="#p4" fill="#fff" />
82
+ <use xlink:href="#p5" fill="#fff" />
83
+ <use xlink:href="#p6" fill="#fff" />
84
+ <use xlink:href="#p7" fill="#fff" />
85
+ <use xlink:href="#p8" fill="#fff" />
86
+ <use xlink:href="#p9" fill="#fff" />
87
+ <use xlink:href="#p10" fill="#fff" />
88
+ <use xlink:href="#p11" fill="#005580" />
89
+ <use xlink:href="#p12" fill="#005580" />
90
+ <use xlink:href="#p13" fill="#005580" />
91
+ <use xlink:href="#p14" fill="#fff" />
92
+ <use xlink:href="#p15" fill="#005580" />
93
+ <use xlink:href="#p16" fill="#005580" />
94
+ <use xlink:href="#p17" fill="#005580" />
95
+ <use xlink:href="#p18" fill="#fff" />
96
+ <use xlink:href="#p19" fill="#005580" />
97
+ <use xlink:href="#p20" fill="#005580" />
98
+ <use xlink:href="#p21" fill="#005580" />
99
+ <use xlink:href="#p22" fill="#005580" />
100
+ <use xlink:href="#p23" fill="#5e9ab8" />
101
+ <use xlink:href="#p24" fill="#5e9ab8" />
102
+ <use xlink:href="#p25" fill="#5e9ab8" />
103
+ <use xlink:href="#p26" fill="#005580" />
104
+ <use xlink:href="#p27" fill="#5e9ab8" />
105
+ <use xlink:href="#p28" fill="#005580" />
106
+ <use xlink:href="#p29" fill="#005580" />
107
+ <use xlink:href="#p30" fill="#005580" />
108
+ <use xlink:href="#p31" fill="#5e9ab8" />
109
+ <use xlink:href="#p32" fill="#5e9ab8" />
110
+ <use xlink:href="#p33" fill="#5e9ab8" />
111
+ <use xlink:href="#p34" fill="#5e9ab8" />
112
+ <use xlink:href="#p35" fill="#5e9ab8" />
113
+ <use xlink:href="#p36" fill="#fff" />
114
+ <use xlink:href="#p37" fill="#fff" />
115
+ <use xlink:href="#p38" fill="#fff" /></g></svg>
trunk/assets/images/extensions/screenshot-1.png ADDED
Binary file
trunk/assets/images/extensions/screenshot-2.png ADDED
Binary file
trunk/assets/images/extensions/screenshot-3.png ADDED
Binary file
trunk/assets/images/icons/truck.png ADDED
Binary file
trunk/assets/images/wcvendors_logo.png ADDED
Binary file
trunk/assets/js/admin/settings.js ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global wcvendors_settings_params */
2
+ ( function( $ ) {
3
+
4
+ // Edit prompt
5
+ $( function() {
6
+ var changed = false;
7
+
8
+ $( 'input, textarea, select, checkbox' ).change( function() {
9
+ changed = true;
10
+ });
11
+
12
+ $( '.wcv-nav-tab-wrapper a' ).click( function() {
13
+ if ( changed ) {
14
+ window.onbeforeunload = function() {
15
+ return wcvendors_settings_params.i18n_nav_warning;
16
+ };
17
+ } else {
18
+ window.onbeforeunload = '';
19
+ }
20
+ });
21
+
22
+ $( '.submit input' ).click( function() {
23
+ window.onbeforeunload = '';
24
+ });
25
+ });
26
+
27
+ // Select all/none
28
+ $( '.wcvendors' ).on( 'click', '.select_all', function() {
29
+ $( this ).closest( 'td' ).find( 'select option' ).attr( 'selected', 'selected' );
30
+ $( this ).closest( 'td' ).find( 'select' ).trigger( 'change' );
31
+ return false;
32
+ });
33
+
34
+ $( '.wcvendors' ).on( 'click', '.select_none', function() {
35
+ $( this ).closest( 'td' ).find( 'select option' ).removeAttr( 'selected' );
36
+ $( this ).closest( 'td' ).find( 'select' ).trigger( 'change' );
37
+ return false;
38
+ });
39
+
40
+ })( jQuery );
trunk/assets/js/admin/wcv-setup.js ADDED
File without changes
trunk/assets/js/front-orders.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ jQuery(function () {
2
+ jQuery('div.order-comments, div.order-tracking').hide();
3
+
4
+ jQuery('a.order-comments-link, a.order-tracking-link').on('click', function (e) {
5
+ e.preventDefault();
6
+ jQuery(this).next('div').slideToggle();
7
+ });
8
+ });
trunk/assets/js/select2.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");
2
+ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b),d=g.$element.find("option").filter(function(){return a(this).val()===c.id});if(!d.length){var e=g.option(c);e.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([e])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null;
3
+ },e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
trunk/assets/js/wcv-admin-login.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ jQuery( function () {
2
+ if (jQuery('#apply_for_vendor').is(':checked')) {
3
+ jQuery('.agree-to-terms-container').show();
4
+ }
5
+
6
+ jQuery('#apply_for_vendor').on('click', function () {
7
+ jQuery('.agree-to-terms-container').slideToggle();
8
+ });
9
+ });
trunk/assets/js/wcv-admin-quick-edit.js ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function(){
2
+ jQuery('#the-list').on('click', '.editinline', function(){
3
+
4
+ if (jQuery('.inline-edit-author').length && jQuery('.inline-edit-author-new').length) {
5
+ jQuery('.inline-edit-author').hide();
6
+ jQuery('.inline-edit-author').attr('class', 'inline-edit-author-old');
7
+ jQuery('select[name=post_author]').attr('name', 'post_author-old');
8
+ jQuery('.inline-edit-author-new').attr('class', 'inline-edit-author');
9
+ jQuery('select[name=post_author-new]').attr('name', 'post_author');
10
+ }
11
+
12
+ inlineEditPost.revert();
13
+
14
+ var post_id = jQuery(this).closest('tr').attr('id');
15
+
16
+ post_id = post_id.replace("post-", "");
17
+
18
+ var wcv_inline_data = jQuery('#vendor_' + post_id),
19
+ wc_inline_data = jQuery('#woocommerce_inline_' + post_id );
20
+
21
+ var vendor = wcv_inline_data.find("#_vendor").text();
22
+
23
+ jQuery('select[name="post_author"] option[value="' + vendor + '"]', '.inline-edit-row').attr('selected', 'selected');
24
+
25
+ var product_type = wc_inline_data.find('.product_type').val();
26
+
27
+ if (product_type=='simple' || product_type=='external') {
28
+ jQuery('.vendor', '.inline-edit-row').show();
29
+ } else {
30
+ jQuery('.vendor', '.inline-edit-row').hide();
31
+ }
32
+
33
+ });
34
+ });
trunk/assets/js/wcv-commissions.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ // global variable
2
+ jQuery(function(){
3
+
4
+ jQuery('.select2').select2(
5
+ {
6
+ placeholder: wcv_commissions_select.placeholder,
7
+ allowClear: wcv_commissions_select.allowclear
8
+ }
9
+ );
10
+
11
+ });
trunk/assets/screenshot-1.png ADDED
Binary file
trunk/assets/screenshot-2.png ADDED
Binary file
trunk/assets/screenshot-3.png ADDED
Binary file
trunk/assets/screenshot-4.png ADDED
Binary file
trunk/assets/screenshot-5.png ADDED
Binary file
trunk/assets/screenshot-6.png ADDED
Binary file
trunk/assets/screenshot-7.png ADDED
Binary file
trunk/changelog.txt ADDED
@@ -0,0 +1,700 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Changelog for WC Vendors
2
+
3
+ Version 2.0.3
4
+
5
+ * Added: Export Commission Sum Totals
6
+ * Added: New setting to rename vendors store wide
7
+ * Fixed: Update Dialog is stuck #409
8
+ * Updated: Langage file
9
+
10
+ Version 2.0.2
11
+
12
+ * Fixed: Corrected settings conditional checks across classes
13
+ * Fixed: Vendor Capabilities
14
+ * Fixed: Reset vendor roles
15
+ * Fixed: Incorrect get_option calls
16
+ * Fixed: Permission check for product submit and order view
17
+ * Updated: Templates to make tracking changes possible
18
+ * Updated: Disable add new product completely if disabled
19
+ * Updated: Make denied product message translateable.
20
+
21
+ Version 2.0.1
22
+
23
+ * Fixed: Update notice won't complete
24
+ * Fixed: Legacy settings options loading
25
+ * Fixed: Errors on activation when unsupported plugin is detected
26
+ * Fixed: Display sold_by option not working
27
+
28
+ Version 2.0.0
29
+
30
+ * Added: New WC Vendors Admin menu
31
+ * Added: Bank details fields for vendors
32
+ * Added: New all new email system and templates
33
+ * Added: New contextual help menus on settings pages
34
+ * Added: New settings system and admin notice system
35
+ * Added: Setup Wizard
36
+ * Added: Support for PHP 7.1+
37
+ * Updated: styles and script build script
38
+ * Updated: language file cleanup
39
+ * Updated: Brazilian Portuguese translation thanks CasperBraske
40
+ * Fixed: Permalinks not flushing on settings save
41
+ * Fixed: Terms & Conditions Checkbox for Vendor Registration does not show #392
42
+ * Fixed: Depreciated calls on orders screen
43
+ * Fixed: Vendor role capabilities updated when new settings updated.
44
+ * Fixed: Vendors can delete media they uploaded
45
+ * Fixed: Added check for woocommerce shipping tax class setting
46
+ * Fixed: Tax classes not being used in shipping tax calculations
47
+ * Fixed: Make compatible with translate.wordpress.org #396
48
+ * Fixed: undefined index notice for reports that have been removed
49
+ * Fixed: Removed focus from select on vendor drop down on product edit screen
50
+
51
+ Templates Added:
52
+ templates/emails/plain/admin-notify-product.php
53
+ templates/emails/plain/admin-notify-shipped.php
54
+ templates/emails/plain/admin-notify-application.php
55
+ templates/emails/plain/customer-notify-shipped.php
56
+ templates/emails/plain/vendor-notify-application.php
57
+ templates/emails/plain/vendor-notify-approved.php
58
+ templates/emails/plain/vendor-notify-denied.php
59
+ templates/emails/plain/vendor-notify-order.php
60
+ templates/emails/plain/vendor-order-details.php
61
+ templates/emails/plain/vendor-order-items.php
62
+ templates/emails/admin-notify-product.php
63
+ templates/emails/admin-notify-shipped.php
64
+ templates/emails/admin-notify-application.php
65
+ templates/emails/customer-notify-shipped.php
66
+ templates/emails/vendor-notify-application.php
67
+ templates/emails/vendor-notify-approved.php
68
+ templates/emails/vendor-notify-denied.php
69
+ templates/emails/vendor-notify-order.php
70
+ templates/emails/vendor-order-details.php
71
+ templates/emails/vendor-order-items.php
72
+
73
+ Templates Updated:
74
+ templates/dashboard/settings/settings.php
75
+ templates/order/table-body.php
76
+
77
+ Version 1.9.14
78
+
79
+ * Added: Export commissions via CSV
80
+ * Added: Commission Table Links #166
81
+ * Added: Apply to become a vendor on wp-login registration page #245
82
+ * Added: Apply filter to get_vendor_dues_from_order()
83
+ * Fixed: wp-admin Commissions Page sorted by status & vendor #374
84
+ * Fixed: Commission filters loading too early so they cannot be applied.
85
+ * Fixed: WooCommerce Reports are showing 2X accurate sales #388
86
+ * Fixed: Shortcodes do not work for products assigned to vendor by admin #385
87
+ * Fixed: Text domain in read me for glotpress translations
88
+ * Fixed: "sold by" is showing in several areas despite deselected admin setting #386
89
+
90
+ Version 1.9.13
91
+
92
+ * Added: Notice for depreciated gateway
93
+ * Added: A filter for role change: Denied Vendor #351
94
+ * Added: WooCommerce tested header for new WooCommerce Status page
95
+ * Added: Filter for vendor signup form so it can be overriden
96
+ * Added: "Approve" Vendor action on Pending Vendors Page #372
97
+ * Updated: Brazillian Port wcvendors-pt_BR.pot
98
+ * Fixed: Moved sprintf must be outside #381 thanks CasperBraske
99
+ * Fixed: Re-Send email options in admin/orders are not available after WooCommerce update #383
100
+ * Fixed: depreciated screen_icon method call
101
+ * Fixed: Use wc_get_order instead of new WC_Order #382
102
+ * Fixed: Post called incorrectly #378
103
+ * Fixed: Get correct product name in commission table if variation deleted
104
+ * Fixed: Commissions reversed when order deleted
105
+ * Fixed: mistake in vendor_shop_query
106
+ * Fixed: Return 404 if vendor doesn't exist
107
+ * Fixed: The shop name background doesn’t scale with shop image #366
108
+ * Fixed: Depreciated functions #368 thanks @stodorovic
109
+ * Fixed: Changed how customer address is displayed based on Woo Options. Thanks @debain
110
+
111
+ Version 1.9.12
112
+
113
+ * Added: For hook for vendor order content
114
+ * Updated: Portuguese translations thanks Elsa
115
+ * Updated: Show SKU in emails as per pre WC3.0 updates
116
+ * Fixed: Static reference calls in commision class
117
+ * Fixed: Shipping tax bug in vendor calculations
118
+ * Fixed: Variations showing $0 price in emails thanks damanmehta
119
+ * Fixed: Prevent PHP notice for getting non-existing vendor name from JeroenSormani/master
120
+
121
+ Version 1.9.11
122
+
123
+ * Fixed: Correct product id being parsed to shipping function
124
+ * Fixed: Payment method notice due to direct access to object property
125
+ * Fixed: Sold by incorrectly showing in cart for variations
126
+
127
+ Version 1.9.10
128
+
129
+ * Fixed: Terms & Conditions Checkbox is not functioning normally #348
130
+ * Fixed: Apply to Become a Vendor Checkbox is Missing with WC 3.0 + WC Vendors 1.9.9 #349
131
+ * Fixed: New product title formatting is showing product #350
132
+ * Fixed: Incorrect use of wpdb->prepare
133
+ * Fixed: Mark shipped filter not providing parameters correctly
134
+ * Fixed: Incorrect reference to billing email in notification email
135
+ * Updated: Removed Sales reports from backend
136
+
137
+ Version 1.9.9
138
+
139
+ * Added: Filters to vendor admin dashboard class for custom columns #339
140
+ * Added: Vendor shop name to the <title> tag on products archive page
141
+ * Updated Woocommerce 2.7 compatibility
142
+ * Updated: i18n text domain loading for proper translations #341
143
+ * Fixed: Class logger when called via includes files
144
+ * Fixed: Bug in how admin notices are displayed when saving shop settings
145
+ * Fixed: 2.7 compatibility bugs
146
+ * Fixed: Commissions Subtotal showing Full Product Price in vendor email #330
147
+ * Fixed: Capabilities Fix for Resetting Roles #329
148
+ * Fixed: HTML title attribute doesn't change for store pages #328
149
+ * Fixed: Login form not displayed if get variable set
150
+ * Fixed: Depreciated action in product edit screen
151
+
152
+ Templates Updated:
153
+ templates/emails/vendor-new-order.php
154
+ templates/emails/notify-vendor-shipped.php
155
+ templates/order/orders.php
156
+
157
+ Version 1.9.8
158
+
159
+ * Fixed: Paypal adaptive payments url changes
160
+ * Added: Store Vendor ID in vendor child order #326
161
+ * Added: 100% Japanese translations thanks to Shohei Tanaka
162
+
163
+ Version 1.9.7
164
+
165
+ * Fixed: Capabilities Fix for Resetting Roles #329
166
+
167
+ Version 1.9.6
168
+
169
+ * Added: Commission Query Functions #321
170
+ * Added: Template for sold by in shop loop #324
171
+ * Merged: Extended commissions management #319 from MounirHamani
172
+ * Updated: Brazilian Portuguese translation
173
+ * Template Added:
174
+ templates/front/vendor-sold-by.php
175
+
176
+ Version 1.9.5
177
+
178
+ * Added: Automated language file builds
179
+ * Added: Vendors can now delete media in the media uploader
180
+ * Updated: Commissions table in backend now shows cost breakdowns
181
+ * Fixed: Removed legacy code for unsupported shipping methods
182
+ * Fixed: Rounding issue with 100% commission and coupons in pro
183
+
184
+ Version 1.9.4
185
+
186
+ * Added: Filter to add delayed payment possibility #309
187
+ * Added: WPML support configuration file
188
+ * Updated: Brazilian translation files thanks Luis!
189
+ * Fixed: Using "date_i18n" instead of just "date" #316 from CasperBraske
190
+ * Fixed: Geczy text domain in the settings file #314
191
+ * Fixed: Commissions lock on one vendor after some actions are made #311
192
+ * Fixed: Vendor dashboard Orders Export link is dead #306
193
+ * Fixed: Vendor sorting in commissions - no option to NOT choose a vendor #305
194
+ * Fixed: vendor order admin product metadata loading #298 from mikko-niemikorpi
195
+ * Fixed: Commission status translatable in reports thanks CasperBraske
196
+ * Fixed: Translatable strings thanks CasperBraske
197
+ * Fixed: Issues with translation strings
198
+ * Fixed: Incorrect variable reference
199
+ * Fixed: bp_setup_current_user was called incorrectly
200
+ * Fixed: Display of variations on main dashboard
201
+ * Fixed: Trying to get property of non-object
202
+ * Fixed: Variation data styles in order display in wp-admin
203
+ * Fixed: Save user meta fields when pending vendor
204
+ * Fixed: Incorrect url string format in french translation
205
+ * Templates Updated:
206
+ templates/dashboard/orders.php
207
+
208
+ Version 1.9.3
209
+
210
+ * Fixed: Only load asset on orders page in admin
211
+ * Fixed: Not showing orders on vendor dashboard for new installations
212
+ * Updated: Persian translations thanks to Alireza
213
+
214
+ Version 1.9.2
215
+
216
+ * Added: Reverse commission when order emptied from trash #277
217
+ * Added: Daily Payout option for PayPal Cron #297
218
+ * Added: Vendor select2 on the commissions page #284
219
+ * Added: Button to reset vendor roles & WC Vendors settings to WooCoomerce system status tools page #230
220
+ * Added: Dutch Translation, thanks @jjclinton
221
+ * Added: Date filter for order queries
222
+ * Added: Turkish translations thanks Hakan
223
+ * Added: $wc_vendors object variable
224
+ * Added: Action to fire after dashboard links (wcvendors_after_links)
225
+ * Added: Body css classes to set pages
226
+ * Updated: Support for woo commerce minimum and readme
227
+ * Fixed: Mark commission reversed bulk action on commissions table
228
+ * Fixed: No longer have to save permalink settings when updating WC Vendors options
229
+ * Fixed: Orders page not set on fresh install
230
+ * Fixed: Property of non object #300
231
+ * Fixed: Translation for Mark Shipped #296
232
+ * Fixed: Too many redirect loops if pages not set #290
233
+ * Fixed: Non-Object Notice in install #289
234
+ * Fixed: Rounding error with 100% commission thanks Brett!
235
+ * Fixed: text domain for email templates
236
+ * Fixed: Don't start session if user isn't logged
237
+ * Fixed: Session error on log out if session doesn't exist
238
+ * Fixed: Settings image selector bug
239
+ * Merged pull request #302 from NicolasBernier - Completed French Translations, Thanks!
240
+ * Merged: pull request #293 from stodorovic/fix_init_sessions
241
+
242
+ Version 1.9.1
243
+
244
+ * Added: GitHub Plugin URI for afragen/github-updater #282 thanks Agoruh
245
+ * Added: Edit and View page settings options
246
+ * Fixed: Missing Argument WCV_Admin_Users::filter_product_types() #288
247
+ * Fixed: Critical: PHP Fatal error: Call to a member function get_children() #287
248
+ * Fixed: Date range session data is not working #285
249
+ * Fixed HTML escaped characters in PaypalAP Cancel and Return URLs: #286 thanks Nicolas
250
+ * Fixed: Post type check to trigger_new_product() function #276
251
+ * Fixed: Updated to notices instead of wordpress errors
252
+ * Fixed: Product attribute fetch and returning HTML #283 thanks Mikko
253
+ * Fixed: Vendor Mark Shipped Security Fix #280 thanks Agoruh
254
+ * Fixed: Missing argument in Vendors Class
255
+ * Fixed: Rounded product commission to avoid error 589023 when submitting to PayPal #275 thanks Nicolas
256
+
257
+ Version 1.9.0
258
+
259
+ * Added: Support for WooCommerce 2.6
260
+ * Added: Vendor roles filter wcvendors_vendor_roles
261
+ * Added: Product and Vendor id's to sold_by filters
262
+ * Added: Vendor Signup Filters #269
263
+ * Added: Notify Vendors Email - Add Product SKU, if set #263
264
+ * Added: New Option: Notify Vendors show Purchase Price or Commissions #253
265
+ * Added: Option to disable sold by #236
266
+ * Added: Initial sub order management code #196 thanks Spreeuw
267
+ * Fixed: Sold by meta removal
268
+ * Fixed: Sequential Orders Support Commissions table #270
269
+ * Fixed: Notify Vendors Email Customizer Not Working #240
270
+ * Fixed: Commissions Total Report a-z sorting #239
271
+ * Fixed: need to agree to terms for this to process correctly
272
+ * Fixed: save pending vendor for login screen
273
+ * Fixed: Notify Vendors Email in WC 2.5+ #265
274
+ * Fixed: Order table layout
275
+ * Fixed: Orders screen for vendors in admin #231
276
+ * Fixed: product management in WC 2.6
277
+ * Fixed: Duplicate application emails firing in free and pro
278
+ * Fixed: Commission display issue in notify vendor email
279
+ * Fixed: New ítem meta compatability with WC 2.5 and above
280
+
281
+ Version 1.8.9
282
+
283
+ * Fixed: Commission Totals Report Inaccurate #267
284
+ * Added: Swedish Translation Thanks Arvid!
285
+
286
+ Version 1.8.8
287
+
288
+ * Fixed: Undefined variable error in commission class
289
+ * Fixed: Pagination bug in wcv_vendorslist shortcode
290
+
291
+ Version 1.8.7
292
+
293
+ * Added: New qty argument to commission calculations
294
+ * Added: Image uploader settings type
295
+ * Added: New commission function for payment gateways
296
+ * Fixed: Prefixed all btn css classes to stop theme collision
297
+ * Fixed: Sold By:Name spaces issue #256
298
+ * Fixed: Show extended fields for vendor and pending vendor roles
299
+ * Fixed: Check if product is taxable
300
+ * Fixed: Depreciated function calls in email templates
301
+ * Fixed: Commission giving tax on none taxable items #251
302
+ * Fixed: Sold by label issues with WC 2.5 #250
303
+
304
+ Version 1.8.6
305
+
306
+ * Fixed: Critical issue with paypal loading classes incorrectly
307
+
308
+ Version 1.8.5
309
+
310
+ * Fixed: Issue with PayPal on some sites - Rolled back issue #247
311
+ * Fixed: Reverted ticket #216 for email conflicts
312
+ * Added: New KnowledgeBase URL
313
+
314
+ Version 1.8.4
315
+
316
+ * Added: Removed fields from users that aren't vendors
317
+ * Added: actions to hook into approve/deny vendor
318
+ * Added: Ability to integrate with any order status for emails #216
319
+ * Added: Terms & Conditions Opens in New Tab #246
320
+ * Updated: Added trigger for on-hold to processing/completed for Notify Vendor Email #238
321
+ * Updated: Settings page helper text and clarifications
322
+ * Fixed: Sold by formatting issue #248
323
+ * Fixed: wp_redirect caches with W3 Total Cache #237
324
+ * Fixed: Bug in single page settings generator
325
+ * Fixed: Category title missing bug #213
326
+ * Fixed: Undefined index for non vendor users
327
+ * Merge: pull request #247 from archonic/hotfix/oauth-class-exists
328
+
329
+
330
+ Version 1.8.3
331
+
332
+ * Fixed: Fatal Error on activation Merge pull request #235 from oleggen/patch-1
333
+ * Added: Seller info label option
334
+
335
+ Version 1.8.2
336
+
337
+ * Added: Sold By label option
338
+ * Added: New Vendor Commission Totals Report #234
339
+ * Fixed: Added 'Shipped' if marked as shipped #233 can be found on WooCommerce > Reports > WC Vendors > Commission Totals
340
+ * Fixed: Renamed internal function to stop theme and plugin clash
341
+
342
+ Version 1.8.1
343
+
344
+ * Added: New options updated action for settings
345
+ * Added: New plugin activation hook for testing woocommerce active
346
+ * Added: vendor id to get shipping due filter
347
+ * Added: Warning on settings page if user registration in WooCommerce is not enabled
348
+ * Added: Russian Translations thanks Natalia
349
+
350
+ Version 1.8.0
351
+
352
+ * Fixed: Mark $0.00 commissions as paid instead of due #205
353
+ * Fixed: Email trigger should be filter not action - Thanks ontiuk #215
354
+ * Updated: Read me with link to Pro and Updated Language List
355
+ * Added: Portuguese Language (Thanks Renato) #212
356
+ * Remove Forced HTTP Protocol on Sent IPN URL #207 from GoTeamScotch
357
+
358
+ Version 1.7.9
359
+
360
+ * Fixed: woocommerce filter and action issues on product edit page
361
+
362
+ Version 1.7.8
363
+
364
+ * Fixed: Vendors can not register #193
365
+ * Fixed: Variation product image upload #194
366
+ * Added: Order actions thanks GoTeamScotch
367
+ * Updated: New item meta in WC 2.4+
368
+ * Updated: WooCommerce Shipment Tracking v1.2.7+
369
+ * Fixed: Paypal Logging thanks to GoTeamScotch
370
+ * Updated: Templates now fully translatable #195
371
+ * Fixed: Translations not loading bug
372
+ * Fixed: vendors not defined error
373
+ * Updated: Base translation files
374
+
375
+ Version 1.7.7
376
+
377
+ * Fixed: Terms and conditions processing #182
378
+ * Added: filter to order note for overrides
379
+ * Added: Order note for marked shipped #187
380
+ * Fixed: order retrieval for wp-admin orders table for vendors
381
+ * Fixed: pagination bug #179
382
+ * Updated: styles for orders table in admin for vendors
383
+ * Fixed: Vendor displaying issue #180
384
+ * Updated: Admin Commission Report Column Names #183
385
+ * Updated: Admin Commissions Page now shows times a product has sold in total #184
386
+
387
+ Version 1.7.6
388
+
389
+ * Added: Stock notifications go to vendors #114
390
+ * Fixed: Instant Pay bug #174
391
+ * Fixed: wcv_vendorslist paging #178
392
+ * Added: Vendor display name now translatable
393
+ * Depreciated: Dashboard vendor reports
394
+ * Added: Chinese Language files thanks to SundayLau
395
+ * Fixed: Added support for WPML #177
396
+ * Update: default pot language file
397
+
398
+ Version 1.7.5
399
+
400
+ * Merged: Check product post type in vendor dashboard thanks simplementNat
401
+ * Updated: Base language file
402
+ * Updated: Compatibility for Shipment Tracking for v1.3.5 #167
403
+ * Fixed: Shipping taxes
404
+ * Fixed: Pending Products for Vendors #168
405
+ * Added: Vendor shipping override #171
406
+ * Added: Give Tax Per Vendor Override #56
407
+ * Added: Hide duplicate product option
408
+ * Fixed: Email firing for pending status only
409
+ * Updated: Unified vendor-main/mini-header variables
410
+ * Fixed: Email template paths to woocommerce paths
411
+ * Merged: Updated Brazilian Portuguese thanks carlosramosweb
412
+ * Added: Seller Info to header #161
413
+ * Updated: Spanish Translations #160
414
+ * Updated: Brazilian Portuguese Language #156
415
+
416
+ Version 1.7.4
417
+
418
+ * Added: Mark shipped filter #157
419
+ * Fixed: Added Tax total to vendor email #146
420
+ * Updated: Location of email templates in theme to wc-vendors/emails
421
+ * Added: User email to Vendor Display Options #158
422
+ * Fixed: Mass Pay Now Bug #159
423
+ * Fixed: Mark as shipped for downloadable product #40
424
+ * Added: Brazilian Portuguese language #156
425
+ * Updated: Default Language file
426
+ * Fixed: Translation issue for query test #155
427
+ * Updated: Template base for emails
428
+ * Fixed: Vendor email and renamed template #135
429
+ * Fixed: Better CSV Output #63
430
+ * Fixed: Made PayPal optional on Vendor Dashboard Shop Settings #144
431
+ * Update: fixed return query var
432
+ * Fixed: Test for product post types #149
433
+ * Fixed: 2.1 Depreciated return call
434
+ * Fixed: PHP Strict static call in commissions class
435
+ * Merged: Is Vendor checks all user roles #147 thanks crabilld
436
+
437
+ Version 1.7.3
438
+
439
+ * Fixed: Paypal AP IPN url issue
440
+
441
+ Version 1.7.2
442
+
443
+ * Added: Filters for seller tab #141
444
+ * Fixed: URI Too Large Error #143
445
+ * Fixed: Give tax to vendors #142
446
+ * Updated: Spanish Translations #140
447
+ * Added: Persian Translation #139
448
+
449
+ Version 1.7.1
450
+
451
+ * Fixed: Invalid argument on new orders dashboard page #138
452
+ * Updated: Base translation file
453
+
454
+ Version 1.7.0
455
+
456
+ * Fixed: add_query_arg/remove_query_arg XSS issue
457
+ * Fixed: Hide Notice not working for admin settings
458
+ * Added: Shop Settings page in WordPress dashboard
459
+ * Added: Orders page in WordPress dashboard
460
+
461
+ Version 1.6.2
462
+
463
+ * Added: Option to change sold by vendor name #106
464
+ * Fixed: Error notice in vendor dashboard #133
465
+ * Fixed: Pagination in commissions admin screen #68
466
+ * Added: Support for WooCommerce Order Status Manager
467
+ * Fixed: Updated media filter method for vendors #132
468
+ * Fixed: Commission not logged for variations #131
469
+
470
+ Version 1.6.1
471
+
472
+ * Fixed: Support for Per Product Shipping 2.2.x #126
473
+ * Added: Filter to change commission label in vendor email #127
474
+
475
+ Version 1.6.0
476
+
477
+ * Added: Admin notices for vendor page slug & permalinks
478
+ * Fixed: Plugin row meta links
479
+ * Added: Upgrade notice
480
+ * Fixed: Rounding issue #120
481
+ * Fixed: Paypal https host check depreciated call
482
+ * Added: show_products attribute #107
483
+ * Updated: Text in denied template to make more sense when registration disabled #123
484
+ * Updated: wcv_vendorslist shortcode now shows 3 column output #123
485
+ * Fixed: Index issue #122
486
+ * Updated: New plugin and template directory structure - IMPORTANT READ KB
487
+
488
+ Version 1.5.0
489
+
490
+ * Added: Spanish translation thanks Mauricio
491
+ * Added: French translation thanks JP
492
+ * Added: CSS class for sold by (classes same as filters in those files)
493
+ * Fixed: Paypal return URL
494
+ * Added: Vendor Dashboard UI Improvements
495
+ * Added: WC Vendors Test Gateway
496
+ * Updated: ToolTips to be more helpful
497
+ * Added: Admin option for not giving shipping cost to vendor
498
+ * Fixed: Disable notify admin
499
+ * Fixed: Mark as shipped/unshipped
500
+ * Fixed: Duplicate column name
501
+
502
+ Version 1.4.5
503
+
504
+ * Updated: select2 3.5.2 for settings api
505
+ * Fixed: Replaced Chosen with Select2 #102
506
+ * Fixed: Table Rate Shipping issue #103
507
+ * Fixed: Featured column issue #100
508
+ * Updated: Filter call for report
509
+ * Fixed: Call to depreciated function #98
510
+
511
+ Version 1.4.4
512
+
513
+ * Fixed: Hardcoded table in wcv_vendorslist shortcode
514
+
515
+ Version 1.4.3
516
+
517
+ * Fixed: Placeholder on Product Reports
518
+
519
+ Version 1.4.2
520
+
521
+ * Added: Commission status sort to commissions page
522
+ * Fixed: Recent Commissions limit of 20 now works on selected date range
523
+ * Fixed: Report By product in WC2.3
524
+ * Fixed: Vendor Report date selector in wp-admin
525
+ * Fixed: Tracking plugin Order Meta
526
+ * Added: New filter wcvendors_dashboard_google_maps_link
527
+ * Fixed: Formatting error for Google maps link
528
+ * Added: New actions in vendor-dashboard wcvendors_vendor_unship, wcvendors_vendor_ship (thanks Nathan H)
529
+
530
+ Version 1.4.1
531
+
532
+ * Fixed: Language file loading issue
533
+ * Fixed: Static function calls in commision class for php 5.6
534
+ * Fixed: Static call in Vendor Cart
535
+ * Added: New language files for de_AT, de_DE (thanks to theHubi), it_IT (thanks to Nicole)
536
+ * Added: New actions for main and mini headers (before and after see KB)
537
+
538
+ Version 1.4.0
539
+
540
+ * Added: product category + vendor shortcode [wcv_product_category category="category" vendor="vendorname"]
541
+ * Added: Tracking number support via WooThemes Shipment Tracking plugin
542
+ * Added: Google Maps for delivery address on front end
543
+ * Fixed: woocommerce_wp_text_input via merged pull request from svenl77
544
+ * Added: Vendor List shortcode [wcv_vendorlist] + template for styling see KB for full details
545
+ * Fixed: Report not showing Commission by Product
546
+ * Fixed: Paths in language files
547
+
548
+ Version 1.3.1
549
+
550
+ * Fixed: Sold by in invoices
551
+
552
+ Version 1.3.0
553
+
554
+ * Added: show vendor on all emails #29
555
+ * Fixed: Critical issue #58
556
+ * Added: Vendor header templates #65
557
+ * Added: Vendor to QuickEdit #12
558
+ * Fixed: Updating notices to use 2.1 Notice API #62
559
+ * Added: wcvendors_registration_checkbox filter to denied.php template view
560
+ * Added: wcvendors_vendor_registration_checkbox filter to filter "Apply to become a vendor?" at registration.
561
+ * Added: wcvendors_vendor_registration_checkbox to filter "Apply to become a vendor?"
562
+
563
+ Version 1.2.0
564
+
565
+ * Added new filters to change sold by text see Knowledge base for details
566
+ * Added sold by to product loop for archive-product.php, see knowledge base on how to disable or change this
567
+ * Added new option to hide "Featured product" from vendors
568
+ * Added Sold By Filter as per #3
569
+ * Removing unused tag filter
570
+ * Updated default.pot
571
+ * Fixing attribute bug #48 - Thanks to gcskye
572
+ * Removing legacy translations
573
+ * Fixed Orders view errors
574
+ * Fixing call to incorrect method #45
575
+
576
+ Version 1.1.5
577
+
578
+ * Fixed orders view to remove incorrect call to woocommerce print messages
579
+
580
+ Version 1.1.4
581
+
582
+ * Fixed called to incorrect notice method
583
+ * Moved methods into parent class See #41
584
+ * PHP Strict updates
585
+ * Deprecated Class due to PHP strict issues
586
+ * fixing static call
587
+ * Tidying up and comments.
588
+ * Renaming class to new standard
589
+ * Removing deprecated wc methods.
590
+ * Fixing incorrect method call
591
+ * Problem with undefined variable.
592
+ * fixing static call issues
593
+ * fixing static call problems
594
+ * Fixing more strict issues
595
+ * fixing encoding issue
596
+ * Fixing tax rounding issue #37
597
+ * Fixing deprecated calls #42
598
+ * Fixing strict standards
599
+ * Fixing constant reference #36
600
+ * Fixed reference to old plugin name
601
+ * Fixing strict errors #27
602
+ * New Default POT translations #26
603
+ * Fixing translation strings #26
604
+ * Updated description
605
+ * Fix link to paypal adaptive payments #25
606
+ * Fixing issue #22
607
+ * Remove support for woo commerce 2.1 and below
608
+ * Class rename
609
+ * Fixed incorrect table name see #35
610
+ * Fixed Class description
611
+ * Added label on vendor email shipping line see #22
612
+ * Fix issue #23 Notify vendor email problem
613
+ * Fixing Issue #28 & removing WC2.0 support
614
+ * Strict Standards in WCV_Vendors #32
615
+ * Fixing Issue #31 PHP Strict Issues
616
+ * Fixing Issue #30 PHP Strict Standards
617
+ * Change Log added for release changes
618
+ * WC Version Requirement changed
619
+ * Updating author to include wc after modifications
620
+ * Rename class
621
+ * Fixing up link to documentation
622
+ * Updated Readme
623
+
624
+ Version 1.1.3
625
+
626
+ * Fixing table names for compatibility
627
+ * Rename class
628
+ * Fixing Fatal error #18
629
+ * Fatal error fixed, version bump
630
+ * Fixing Class call
631
+ * Fixing all references to incorrect class name
632
+ * Commission and report fixes
633
+ * Fixing spelling
634
+ * Update readme.txt
635
+ * Fixing author
636
+ * Version bump
637
+ * Check if shipping is enabled
638
+ * Comment for future reference
639
+
640
+ Version 1.1.1
641
+
642
+ * Start of adding woocomerce short codes enhanced
643
+ * Shortcodes class
644
+ * Removing temp file
645
+ * Adding short code support
646
+ * Version Bump
647
+ * PHP Strict Issue #5
648
+ * Fatal Error: Class 'PV_Commission' #14
649
+ * Fixing references to PV_Vendors
650
+ * Renamed filters and actions
651
+ * Rename Reports Submenu #15
652
+ * "Mark Shipped" Icon #16
653
+ * Version increased after bug fixes
654
+
655
+ Version 1.0.2
656
+
657
+ * Fix up admin settings notices
658
+ * Renamed shortcodes
659
+ * Version bump for short code rename
660
+
661
+
662
+ Version 1.0.1
663
+
664
+ * Initial Commit
665
+ * First commit - no modifications to existing plugin
666
+ * Updating README
667
+ * Update README.md
668
+ * Features added
669
+ * Updated Details of plugin
670
+ * Fixing up formatting
671
+ * More fixes.
672
+ * Updating readme
673
+ * Updating more details
674
+ * Update denied.php
675
+ * Added mac file ignore
676
+ * updated read me
677
+ * Plugin Rename
678
+ * Plugin rename
679
+ * Rename plugin
680
+ * Rename plugin
681
+ * more updates
682
+ * Plugin Updater removed
683
+ * Updating text domain
684
+ * Basic rename complete
685
+ * Replacement includes classes
686
+ * text domain updates
687
+ * text domain updates
688
+ * new change log for new fork
689
+ * Rename main class
690
+ * renaming constants
691
+ * updated constants
692
+ * plugin constant
693
+ * Renaming queries class
694
+ * constants updated
695
+ * rename vendor shop class
696
+ * rename vendor cart class
697
+ * Renaming classes
698
+ * Author updates
699
+ * Class renaming
700
+ * Version bump
trunk/class-wc-vendors.php ADDED
@@ -0,0 +1,425 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: WC Vendors
4
+ * Plugin URI: https://www.wcvendors.com
5
+ * Description: Allow vendors to sell their own products and receive a commission for each sale.
6
+ * Author: WC Vendors
7
+ * Author URI: https://www.wcvendors.com
8
+ * GitHub Plugin URI: https://github.com/wcvendors/wcvendors
9
+ *
10
+ * Version: 2.0.3
11
+ * Requires at least: 4.4.0
12
+ * Tested up to: 4.9.5
13
+ * WC requires at least: 3.0.0
14
+ * WC tested up to: 3.3.5
15
+ *
16
+ * Text Domain: wc-vendors
17
+ * Domain Path: /languages/
18
+ *
19
+ * @category Plugin
20
+ * @copyright Copyright © 2012 Matt Gates
21
+ * @copyright Copyright © 2018 WC Vendors
22
+ * @author Matt Gates, WC Vendors
23
+ * @package WCVendors
24
+ * @license GPL2
25
+
26
+ WC Vendors is free software: you can redistribute it and/or modify
27
+ it under the terms of the GNU General Public License as published by
28
+ the Free Software Foundation, either version 2 of the License, or
29
+ any later version.
30
+
31
+ WC Vendors is distributed in the hope that it will be useful,
32
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
33
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
+ GNU General Public License for more details.
35
+
36
+ You should have received a copy of the GNU General Public License
37
+ along with WC Vendors. If not, see http://www.gnu.org/licenses/gpl-2.0.txt.
38
+
39
+ */
40
+
41
+
42
+ /**
43
+ * Plugin activation hook
44
+ */
45
+ function wcvendors_activate() {
46
+
47
+ /**
48
+ * Requires woocommerce to be installed and active
49
+ */
50
+ if ( !class_exists( 'WooCommerce' ) ) {
51
+ deactivate_plugins( plugin_basename( __FILE__ ) );
52
+ wp_die( __( 'WC Vendors requires WooCommerce to run. Please install WooCommerce and activate before attempting to activate again.', 'wc-vendors' ) );
53
+ }
54
+ } // wcvendors_activate()
55
+
56
+ register_activation_hook( __FILE__, 'wcvendors_activate' );
57
+
58
+
59
+ /**
60
+ * Required functions
61
+ */
62
+ require_once trailingslashit( dirname( __FILE__ ) ) . 'classes/includes/class-functions.php';
63
+
64
+ /**
65
+ * Check if WooCommerce is active
66
+ */
67
+ if ( wcv_is_woocommerce_activated() ) {
68
+
69
+ /* Define an absolute path to our plugin directory. */
70
+ if ( !defined( 'wcv_plugin_dir' ) ) define( 'wcv_plugin_dir', trailingslashit( dirname( __FILE__ ) ) );
71
+ if ( !defined( 'wcv_assets_url' ) ) define( 'wcv_assets_url', trailingslashit( plugins_url( 'assets', __FILE__ ) ) );
72
+ if ( !defined( 'wcv_plugin_base' ) ) define( 'wcv_plugin_base', plugin_basename( __FILE__ ) );
73
+ if ( !defined( 'wcv_plugin_dir_path' ) ) define( 'wcv_plugin_dir_path', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
74
+
75
+ /**
76
+ * Main Product Vendor class
77
+ *
78
+ * @package WCVendors
79
+ */
80
+ class WC_Vendors
81
+ {
82
+
83
+ public $version = '2.0.3';
84
+
85
+ /**
86
+ * @var
87
+ */
88
+ public static $pv_options;
89
+ public static $id = 'wc_prd_vendor';
90
+
91
+ /**
92
+ * Constructor.
93
+ */
94
+ public function __construct()
95
+ {
96
+
97
+ // Load text domain
98
+ add_action( 'plugins_loaded', array( $this, 'load_il8n' ) );
99
+
100
+ $this->title = __( 'WC Vendors', 'wc-vendors' );
101
+
102
+ $this->define_constants();
103
+
104
+ // Install & upgrade
105
+ add_action( 'admin_init', array( $this, 'check_install' ) );
106
+ add_action( 'init', array( $this, 'maybe_flush_permalinks' ), 99 );
107
+ add_action( 'wcvendors_flush_rewrite_rules', array( $this, 'flush_rewrite_rules' ) );
108
+ add_action( 'admin_init', array( $this, 'wcv_required_ignore_notices' ) );
109
+
110
+ add_action( 'plugins_loaded', array( $this, 'include_gateways' ) );
111
+ add_action( 'plugins_loaded', array( $this, 'include_core' ) );
112
+ add_action( 'init', array( $this, 'include_init' ) );
113
+ add_action( 'current_screen', array( $this, 'include_assets' ) );
114
+
115
+ // Start a PHP session, if not yet started then destroy if logged in or out
116
+ add_action( 'init', array( $this, 'init_session'), 1 );
117
+ add_action( 'wp_logout', array( $this, 'destroy_session') );
118
+ add_action( 'wp_login', array( $this, 'destroy_session') );
119
+
120
+ // Legacy settings
121
+ add_action( 'admin_init', array( 'WCVendors_Install', 'check_pro_version' ) );
122
+ add_action( 'plugins_loaded', array( $this, 'load_legacy_settings' ) );
123
+
124
+ // Show update notices
125
+ $file = basename( __FILE__ );
126
+ $folder = basename( dirname( __FILE__ ) );
127
+ $hook = "in_plugin_update_message-{$folder}/{$file}";
128
+ add_action( $hook, array( $this, 'show_upgrade_notification') , 10, 2);
129
+
130
+ }
131
+
132
+
133
+ /**
134
+ *
135
+ */
136
+ public function invalid_wc_version() {
137
+ echo '<div class="error"><p>' . __( '<b>WC Vendors is inactive</b>. WC Vendors requires a minimum of WooCommerce 3.0.0 to operate.', 'wc-vendors' ) . '</p></div>';
138
+ }
139
+
140
+ /**
141
+ * Define WC Constants.
142
+ */
143
+ private function define_constants() {
144
+
145
+ $this->define( 'WCV_VERSION', $this->version );
146
+ $this->define( 'WCV_TEMPLATE_BASE', untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/' );
147
+ $this->define( 'WCV_ABSPATH_ADMIN', dirname( __FILE__ ) . '/classes/admin/');
148
+
149
+ }
150
+
151
+ /**
152
+ * Define constant if not already set.
153
+ *
154
+ * @param string $name Constant name.
155
+ * @param string|bool $value Constant value.
156
+ */
157
+ private function define( $name, $value ) {
158
+ if ( ! defined( $name ) ) {
159
+ define( $name, $value );
160
+ }
161
+ }
162
+
163
+
164
+ /**
165
+ * Start the session
166
+ */
167
+ public function init_session(){
168
+
169
+ if ( !session_id() && is_user_logged_in() ) {
170
+ session_start();
171
+ }
172
+
173
+ } //init_session()
174
+
175
+ public function destroy_session(){
176
+
177
+ if ( session_id() ) {
178
+ session_destroy();
179
+ }
180
+
181
+ } // destroy_session()
182
+
183
+
184
+ /**
185
+ * Check whether install has ran before or not
186
+ *
187
+ * Run install if it hasn't.
188
+ *
189
+ * @return unknown
190
+ */
191
+ public function check_install() {
192
+
193
+ if ( version_compare( WC_VERSION, '3.0.0', '<' ) ) {
194
+ add_action( 'admin_notices', array( $this, 'invalid_wc_version' ) );
195
+ deactivate_plugins( plugin_basename( __FILE__ ) );
196
+ return false;
197
+ }
198
+
199
+ }
200
+
201
+
202
+ /**
203
+ * Set static $pv_options to hold options class
204
+ */
205
+ public function load_legacy_settings() {
206
+ if ( empty( self::$pv_options ) ) {
207
+ include_once( wcv_plugin_dir . 'classes/includes/class-sf-settings.php' );
208
+ self::$pv_options = new SF_Settings_API();
209
+ }
210
+ }
211
+
212
+ public function load_il8n() {
213
+ $locale = apply_filters( 'plugin_locale', get_locale(), 'wc-vendors' );
214
+ load_textdomain( 'wc-vendors', WP_LANG_DIR.'/wc-vendors/wc-vendors-'.$locale.'.mo');
215
+ load_plugin_textdomain( 'wc-vendors', false, plugin_basename( dirname( __FILE__ ) ) . '/languages/' );
216
+
217
+ }
218
+
219
+ /**
220
+ * Include core files
221
+ */
222
+ public function include_core() {
223
+
224
+ include_once( wcv_plugin_dir . 'classes/class-install.php' );
225
+ include_once( wcv_plugin_dir . 'classes/class-queries.php');
226
+ include_once( wcv_plugin_dir . 'classes/class-vendors.php');
227
+ include_once( wcv_plugin_dir . 'classes/class-cron.php');
228
+ include_once( wcv_plugin_dir . 'classes/class-commission.php');
229
+ include_once( wcv_plugin_dir . 'classes/class-shipping.php');
230
+ include_once( wcv_plugin_dir . 'classes/class-vendor-order.php');
231
+ include_once( wcv_plugin_dir . 'classes/class-vendor-post-types.php');
232
+ include_once( wcv_plugin_dir . 'classes/front/class-vendor-cart.php');
233
+ include_once( wcv_plugin_dir . 'classes/front/dashboard/class-vendor-dashboard.php');
234
+ include_once( wcv_plugin_dir . 'classes/front/class-vendor-shop.php');
235
+ include_once( wcv_plugin_dir . 'classes/front/signup/class-vendor-signup.php');
236
+ include_once( wcv_plugin_dir . 'classes/front/orders/class-orders.php');
237
+ include_once( wcv_plugin_dir . 'classes/admin/emails/class-emails.php');
238
+ include_once( wcv_plugin_dir . 'classes/admin/class-vendor-applicants.php');
239
+ include_once( wcv_plugin_dir . 'classes/admin/class-admin-reports.php');
240
+ include_once( wcv_plugin_dir . 'classes/admin/class-wcv-commissions-page.php');
241
+ include_once( wcv_plugin_dir . 'classes/admin/class-wcv-admin-setup.php');
242
+ include_once( wcv_plugin_dir . 'classes/admin/class-wcv-admin-notices.php');
243
+ include_once( wcv_plugin_dir . 'classes/admin/class-wcv-admin-settings.php');
244
+ include_once( wcv_plugin_dir . 'classes/admin/class-admin-menus.php');
245
+ include_once( wcv_plugin_dir . 'classes/admin/class-wcv-admin-extensions.php');
246
+ include_once( wcv_plugin_dir . 'classes/admin/class-wcv-admin-help.php');
247
+ include_once( wcv_plugin_dir . 'classes/admin/class-setup-wizard.php');
248
+ include_once( wcv_plugin_dir . 'classes/admin/class-vendor-admin-dashboard.php');
249
+ include_once( wcv_plugin_dir . 'classes/includes/class-wcv-shortcodes.php');
250
+ include_once( wcv_plugin_dir . 'classes/includes/wcv-update-functions.php');
251
+ include_once( wcv_plugin_dir . 'classes/includes/wcv-template-functions.php');
252
+
253
+ // Include
254
+
255
+
256
+ if ( !function_exists( 'woocommerce_wp_text_input' ) && !is_admin() ) {
257
+ include_once( WC()->plugin_path() . '/includes/admin/wc-meta-box-functions.php' );
258
+ }
259
+
260
+ new WCV_Vendors;
261
+ new WCV_Vendor_Shop;
262
+ new WCV_Vendor_Cart;
263
+ new WCV_Commission;
264
+ new WCV_Shipping;
265
+ new WCV_Cron;
266
+ new WCV_Orders;
267
+ new WCV_Vendor_Dashboard;
268
+ new WCV_Admin_Setup;
269
+ new WCV_Vendor_Admin_Dashboard;
270
+ new WCV_Admin_Reports;
271
+ new WCV_Vendor_Applicants;
272
+ new WCV_Emails;
273
+ new WCV_Vendor_Signup;
274
+ new WCV_Shortcodes;
275
+ }
276
+
277
+
278
+ /**
279
+ * These need to be initlized later in loading to fix interaction with other plugins that call current_user_can at the right time.
280
+ *
281
+ * @since 1.9.4
282
+ * @access public
283
+ */
284
+ public function include_init(){
285
+
286
+ require_once wcv_plugin_dir . 'classes/admin/class-vendor-reports.php';
287
+ require_once wcv_plugin_dir . 'classes/admin/class-product-meta.php';
288
+ require_once wcv_plugin_dir . 'classes/admin/class-admin-users.php';
289
+
290
+
291
+ new WCV_Vendor_Reports;
292
+ new WCV_Product_Meta;
293
+ new WCV_Admin_Users;
294
+
295
+ } // include_init()
296
+
297
+ /**
298
+ * Load plugin assets
299
+ */
300
+ public function include_assets(){
301
+
302
+ $screen = get_current_screen();
303
+
304
+ if ( in_array( $screen->id, array( 'edit-product' ) ) ) {
305
+ wp_enqueue_script( 'wcv_quick-edit', wcv_assets_url. 'js/wcv-admin-quick-edit.js', array('jquery') );
306
+ }
307
+
308
+ }
309
+
310
+
311
+ /**
312
+ * Include payment gateways
313
+ */
314
+ public function include_gateways()
315
+ {
316
+ require_once wcv_plugin_dir . 'classes/gateways/PayPal_AdvPayments/paypal_ap.php';
317
+ require_once wcv_plugin_dir . 'classes/gateways/PayPal_Masspay/class-paypal-masspay.php';
318
+ require_once wcv_plugin_dir . 'classes/gateways/WCV_Gateway_Test/class-wcv-gateway-test.php';
319
+ }
320
+
321
+ /**
322
+ * If the settings are updated and the vendor page link has changed update permalinks
323
+ * @access public
324
+ *
325
+ */
326
+ public function maybe_flush_permalinks() {
327
+ if ( 'yes' === get_option( 'wcvendors_queue_flush_rewrite_rules' ) ) {
328
+ $this->flush_rewrite_rules();
329
+ update_option( 'wcvendors_queue_flush_rewrite_rules', 'no' );
330
+ }
331
+ }
332
+
333
+ public function flush_rewrite_rules(){
334
+ flush_rewrite_rules();
335
+ }
336
+
337
+
338
+ /**
339
+ * Add user meta to remember ignore notices
340
+ * @access public
341
+ *
342
+ */
343
+ public function wcv_required_ignore_notices(){
344
+ global $current_user;
345
+ $current_user_id = $current_user->ID;
346
+
347
+ /* If user clicks to ignore the notice, add that to their user meta */
348
+ if ( isset( $_GET[ 'wcv_shop_ignore_notice' ] ) && '0' == $_GET[ 'wcv_shop_ignore_notice' ] ) {
349
+ add_user_meta( $current_user_id, 'wcv_shop_ignore_notice', 'true', true);
350
+ }
351
+ if ( isset($_GET['wcv_pl_ignore_notice']) && '0' == $_GET['wcv_pl_ignore_notice'] ) {
352
+ add_user_meta( $current_user_id, 'wcv_pl_ignore_notice', 'true' , true);
353
+ }
354
+
355
+ }
356
+
357
+ /**
358
+ * Class logger so that we can keep our debug and logging information cleaner
359
+ *
360
+ * @since 2.0.0
361
+ * @version 2.0.0
362
+ * @access public
363
+ *
364
+ * @param mixed - $data the data to go to the error log could be string, array or object
365
+ */
366
+ public static function log( $data = '', $prefix = '' ){
367
+
368
+ $trace = debug_backtrace( false, 2 );
369
+ $caller = ( isset( $trace[ 1 ]['class'] ) ) ? $trace[ 1 ]['class'] : basename( $trace[ 1 ][ 'file' ] );
370
+
371
+ if ( is_array( $data ) || is_object( $data ) ) {
372
+ if ( $prefix ){
373
+ error_log( '===========================' );
374
+ error_log( $prefix );
375
+ error_log( '===========================' );
376
+ }
377
+ error_log( $caller . ' : ' . print_r( $data, true ) );
378
+ } else {
379
+ if ( $prefix ){
380
+ error_log( '===========================' );
381
+ error_log( $prefix );
382
+ error_log( '===========================' );
383
+ }
384
+ error_log( $caller . ' : ' . $data );
385
+ }
386
+
387
+ } // log()
388
+
389
+
390
+ /*
391
+ * Upgrade notice displayed on the plugin screen
392
+ *
393
+ */
394
+ public function show_upgrade_notification( $args, $response ) {
395
+
396
+ $new_version = $response->new_version;
397
+ $upgrade_notice = sprintf( __( 'WC Vendors 2.0 is a major update. This is not compatible with any of our existing extensions. You should test this update on a staging server before updating. Backup your site and update your theme and extensions, and <a href="%s">review update details here</a> before upgrading.', 'wc-vendors' ), 'https://docs.wcvendors.com/knowledge-base/upgrading-to-wc-vendors-2-0/');
398
+
399
+ if ( version_compare( WCV_VERSION, $new_version, '<' ) && version_compare( $new_version, '2.0.0', '>=') ){
400
+ echo '<h3>Important Upgrade Notice:</h3>';
401
+ echo '<p style="background-color: #d54e21; padding: 10px; color: #f9f9f9; margin-top: 10px">';
402
+ echo $upgrade_notice;
403
+ if ( !class_exists( 'WCVendors_Pro' ) ) echo '</p>';
404
+
405
+ if ( class_exists( 'WCVendors_Pro' ) ){
406
+
407
+ if ( version_compare( WCV_PRO_VERSION, '1.5.0', '<' ) ){
408
+ echo '<h3>WC Vendors Pro Notice</h3>';
409
+ echo '<p style="background-color: #d54e21; padding: 10px; color: #f9f9f9; margin-top: 10px">';
410
+ $pro_upgrade = sprintf( __( 'WC Vendors Pro 1.5.0 is required to run WC Vendors 2.0.0. Your current version %s will be deactivated. Please upgrade to the latest version.', 'wc-vendors' ), WCV_PRO_VERSION );
411
+
412
+ echo $pro_upgrade;
413
+ // echo '</p>';
414
+ }
415
+
416
+ }
417
+
418
+ }
419
+ } // show_upgrade_notification()
420
+
421
+ }
422
+
423
+ $wc_vendors = new WC_Vendors;
424
+
425
+ }
trunk/classes/admin/class-admin-menus.php ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ /**
7
+ * The admin class handles all admin custom page functions for admin view
8
+ *
9
+ * @author Jamie Madden, WC Vendors
10
+ * @category Admin
11
+ * @package WCVendors/Admin
12
+ * @version 2.0.0
13
+ */
14
+ class WCVendors_Admin_Menus {
15
+
16
+ public $commissions_table;
17
+
18
+ /**
19
+ * Constructor
20
+ */
21
+ public function __construct(){
22
+
23
+ // Add menus
24
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
25
+ add_action( 'admin_menu', array( $this, 'commissions_menu' ), 50 );
26
+ add_action( 'admin_menu', array( $this, 'settings_menu' ), 70 );
27
+ add_action( 'admin_menu', array( $this, 'extensions_menu'), 80 );
28
+ add_action( 'admin_head', array( $this, 'commission_table_header_styles' ) );
29
+
30
+ add_filter( 'set-screen-option', array( __CLASS__, 'set_commissions_screen' ), 10, 3 );
31
+
32
+ }
33
+
34
+ /**
35
+ * WC Vendors menu
36
+ */
37
+ public function admin_menu() {
38
+
39
+ global $menu;
40
+
41
+ if ( current_user_can( 'manage_woocommerce' ) ) {
42
+ $menu[] = array( '', 'read', 'separator-woocommerce', '', 'wp-menu-separator wcvendors' );
43
+ }
44
+
45
+ add_menu_page( __( 'WC Vendors', 'wc-vendors' ), __( 'WC Vendors', 'wc-vendors' ), 'manage_woocommerce', 'wc-vendors', array( $this, 'extensions_page' ), 'dashicons-cart', '50' );
46
+ }
47
+
48
+ /**
49
+ * Addons menu item.
50
+ */
51
+ public function extensions_menu() {
52
+ add_submenu_page( 'wc-vendors', __( 'WC Vendors Extensions', 'wc-vendors' ), __( 'Extensions', 'wc-vendors' ), 'manage_woocommerce', 'wcv-extensions', array( $this, 'extensions_page' ) );
53
+ remove_submenu_page( 'wc-vendors', 'wc-vendors' );
54
+ }
55
+
56
+ /**
57
+ * Addons Page
58
+ */
59
+ public function extensions_page(){
60
+ WCVendors_Admin_Extensions::output();
61
+ }
62
+
63
+ /**
64
+ * Add the commissions sub menu
65
+ *
66
+ * @since 1.0.0
67
+ * @access public
68
+ *
69
+ */
70
+ public function commissions_menu() {
71
+
72
+ $commissions_page = add_submenu_page( 'wc-vendors', __( 'Commissions', 'wc-vendors' ), __( 'Commissions', 'wc-vendors' ), 'manage_woocommerce', 'wcv-commissions', array( $this, 'commissions_page' ) );\
73
+ add_action( "load-$commissions_page", array( $this, 'commission_screen_options' ) );
74
+
75
+ } // commissions_menu()
76
+
77
+
78
+ /**
79
+ * Settings menu item
80
+ */
81
+ public function settings_menu(){
82
+ $settings_page = add_submenu_page( 'wc-vendors', __( 'WC Vendors Settings', 'wcvendors' ), __( 'Settings', 'wcvendors' ), 'manage_woocommerce', 'wcv-settings', array( $this, 'settings_page' ) );
83
+ add_action( 'load-' . $settings_page, array( $this, 'settings_page_init') );
84
+ }
85
+
86
+
87
+ /**
88
+ * Loads required objects into memory for use within settings
89
+ */
90
+ public function settings_page_init() {
91
+
92
+ global $current_tab, $current_section;
93
+
94
+ // Include settings pages
95
+ WCVendors_Admin_Settings::get_settings_pages();
96
+
97
+ // Get current tab/section
98
+ $current_tab = empty( $_GET['tab'] ) ? 'general' : sanitize_title( $_GET['tab'] );
99
+ $current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( $_REQUEST['section'] );
100
+
101
+ // Save settings if data has been posted
102
+ if ( ! empty( $_POST ) ) {
103
+ WCVendors_Admin_Settings::save();
104
+ }
105
+
106
+ // Add any posted messages
107
+ if ( ! empty( $_GET['wcv_error'] ) ) {
108
+ WCVendors_Admin_Settings::add_error( stripslashes( $_GET['wcv_error'] ) );
109
+ }
110
+
111
+ if ( ! empty( $_GET['wcv_message'] ) ) {
112
+ WCVendors_Admin_Settings::add_message( stripslashes( $_GET['wcv_message'] ) );
113
+ }
114
+ }
115
+
116
+ /**
117
+ * Settings Page
118
+ */
119
+ public function settings_page(){
120
+ WCVendors_Admin_Settings::output();
121
+ }
122
+
123
+ /**
124
+ * Commission page output
125
+ *
126
+ * @since 2.0.0
127
+ */
128
+ public function commissions_page(){
129
+ include( WCV_ABSPATH_ADMIN . 'views/html-admin-commission-page.php' );
130
+ }
131
+
132
+
133
+ /**
134
+ * Screen options
135
+ */
136
+ public function commission_screen_options() {
137
+
138
+ $option = 'per_page';
139
+ $args = [
140
+ 'label' => 'Commissions',
141
+ 'default' => 10,
142
+ 'option' => 'commissions_per_page'
143
+ ];
144
+
145
+ add_screen_option( $option, $args );
146
+
147
+ $this->commissions_table = new WCVendors_Commissions_Page();
148
+ }
149
+
150
+ public static function set_commissions_screen( $status, $option, $value ) {
151
+ return $value;
152
+ }
153
+
154
+ /**
155
+ * Load styles for the commissions table page
156
+ */
157
+ public function commission_table_header_styles() {
158
+
159
+ $page = ( isset( $_GET[ 'page' ] ) ) ? esc_attr( $_GET[ 'page' ] ) : false;
160
+
161
+
162
+ wp_enqueue_style( 'wcv-admin-styles', wcv_assets_url . 'css/wcv-admin.css', array(), WCV_VERSION );
163
+
164
+ // Only load the styles on the license table page
165
+
166
+ if ( 'wcv_admin_commissions' !== $page ) return;
167
+
168
+ echo '<style type="text/css">';
169
+ echo '.wp-list-table .column-product_id { width: 20%; }';
170
+ echo '.wp-list-table .column-vendor_id { width: 15%; }';
171
+ echo '.wp-list-table .column-order_id { width: 8%; }';
172
+ echo '.wp-list-table .column-total_due { width: 10%;}';
173
+ echo '.wp-list-table .column-total_shipping { width: 10%;}';
174
+ echo '.wp-list-table .column-tax { width: 10%;}';
175
+ echo '.wp-list-table .column-totals { width: 10%;}';
176
+ echo '.wp-list-table .column-status { width: 5%;}';
177
+ echo '.wp-list-table .column-time { width: 10%;}';
178
+ echo '</style>';
179
+
180
+ } //table_header_styles()
181
+
182
+
183
+ }
184
+
185
+ new WCVendors_Admin_Menus();
trunk/classes/admin/class-admin-page.php ADDED
@@ -0,0 +1,882 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WCV_Admin_Setup
4
+ {
5
+ /**
6
+ * WC > Referrals menu
7
+ */
8
+
9
+ public function __construct()
10
+ {
11
+ add_filter( 'set-screen-option', array( 'WCV_Admin_Setup', 'set_table_option' ), 10, 3 );
12
+ add_action( 'admin_menu', array( 'WCV_Admin_Setup', 'menu' ) );
13
+
14
+ add_action( 'woocommerce_admin_order_data_after_shipping_address', array( $this, 'add_vendor_details' ), 10, 2 );
15
+ add_action( 'woocommerce_admin_order_actions_end', array( $this, 'append_actions' ), 10, 1 );
16
+
17
+ add_filter( 'woocommerce_debug_tools', array( $this, 'wcvendors_tools' ) );
18
+
19
+ add_action( 'admin_head', array( $this, 'commission_table_header_styles' ) );
20
+
21
+ add_action( 'admin_init', array( $this, 'export_commissions' ) );
22
+ }
23
+
24
+
25
+ public function add_vendor_details( $order )
26
+ {
27
+ $actions = $this->append_actions( $order, true );
28
+
29
+ if (empty( $actions['wc_pv_shipped']['name'] )) {
30
+ return;
31
+ }
32
+
33
+ echo '<h4>' . __('Vendors shipped', 'wcvendors') . '</h4><br/>';
34
+ echo $actions['wc_pv_shipped']['name'];
35
+ }
36
+
37
+ public function append_actions( $order, $order_page = false )
38
+ {
39
+ global $woocommerce;
40
+
41
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
42
+
43
+ $authors = WCV_Vendors::get_vendors_from_order( $order );
44
+ $authors = $authors ? array_keys( $authors ) : array();
45
+ if ( empty( $authors ) ) return false;
46
+
47
+ $shipped = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
48
+ $string = '</br></br>';
49
+
50
+ foreach ($authors as $author ) {
51
+ $string .= in_array( $author, $shipped ) ? '&#10004; ' : '&#10005; ';
52
+ $string .= WCV_Vendors::get_vendor_shop_name( $author );
53
+ $string .= '</br>';
54
+ }
55
+
56
+ $response = array(
57
+ 'url' => '#',
58
+ 'name' => __('Vendors Shipped', 'wcvendors') . $string,
59
+ 'action' => 'wc_pv_shipped',
60
+ 'image_url' => wcv_assets_url . '/images/icons/truck.png',
61
+ );
62
+
63
+ if ( ! $order_page ) {
64
+ printf( '<a class="button tips %s" href="%s" data-tip="%s"><img style="width:16px;height:16px;" src="%s"></a>', $response['action'], $response['url'], $response['name'], $response['image_url'] );
65
+ } else {
66
+ echo $response['name'];
67
+ }
68
+
69
+ return $response;
70
+ }
71
+
72
+
73
+ /**
74
+ * Add the commissions sub menu
75
+ *
76
+ * @since 1.0.0
77
+ * @access public
78
+ *
79
+ */
80
+ public static function menu()
81
+ {
82
+ $hook = add_submenu_page(
83
+ 'woocommerce',
84
+ __( 'Commission', 'wcvendors' ), __( 'Commission', 'wcvendors' ),
85
+ 'manage_woocommerce',
86
+ 'pv_admin_commissions',
87
+ array( 'WCV_Admin_Setup', 'commissions_page' )
88
+ );
89
+
90
+ add_action( "load-$hook", array( 'WCV_Admin_Setup', 'add_options' ) );
91
+
92
+ add_action( "admin_print_styles-$hook", array( 'WCV_Admin_Setup', 'commission_enqueue_style' ) );
93
+ add_action( "admin_print_scripts-$hook", array( 'WCV_Admin_Setup', 'commission_my_enqueue_script' ) );
94
+
95
+
96
+
97
+ } // menu()
98
+
99
+
100
+ /**
101
+ * Add tools to the woocommerce status tools page
102
+ *
103
+ * @since 1.9.2
104
+ * @access public
105
+ */
106
+ public function wcvendors_tools( $tools ){
107
+
108
+ $tools[ 'reset_wcvendor_roles' ] = array(
109
+ 'name' => __( 'Reset WC Vendors roles ', 'wcvendors' ),
110
+ 'button' => __( 'Reset WC Vendor Roles', 'wcvendors' ),
111
+ 'desc' => __( 'This will reset the wcvendors roles ( vendor & pending_vendor ), back to the default capabilities.', 'wcvendors' ),
112
+ 'callback' => array( 'WCV_Admin_Setup', 'reset_vendor_roles' )
113
+ );
114
+
115
+ $tools[ 'reset_wcvendors' ] = array(
116
+ 'name' => __( 'Reset WC Vendors ', 'wcvendors' ),
117
+ 'button' => __( 'Reset WC Vendors Settings', 'wcvendors' ),
118
+ 'desc' => __( 'This will reset wcvendors back to defaults. This DELETES ALL YOUR Settings.', 'wcvendors' ),
119
+ 'callback' => array( 'WCV_Admin_Setup', 'reset_wcvendors' )
120
+ );
121
+
122
+ return $tools;
123
+
124
+ } // wcvendors_tools()
125
+
126
+ /**
127
+ * Reset the vendor roles
128
+ *
129
+ * @since 1.9.2
130
+ * @access public
131
+ */
132
+ public static function reset_vendor_roles(){
133
+
134
+ $can_add = WC_Vendors::$pv_options->get_option( 'can_submit_products' );
135
+ $can_edit = WC_Vendors::$pv_options->get_option( 'can_edit_published_products' );
136
+ $can_submit_live = WC_Vendors::$pv_options->get_option( 'can_submit_live_products' );
137
+ $can_view_reports = WC_Vendors::$pv_options->get_option( 'can_view_backend_reports' );
138
+
139
+ $args = array(
140
+ 'assign_product_terms' => $can_add,
141
+ 'edit_products' => $can_add || $can_edit,
142
+ 'edit_published_products' => $can_edit,
143
+ 'delete_published_products' => $can_edit,
144
+ 'delete_products' => $can_edit,
145
+ 'manage_product' => $can_add,
146
+ 'publish_products' => $can_submit_live,
147
+ 'read' => true,
148
+ 'read_products' => $can_edit || $can_add,
149
+ 'upload_files' => true,
150
+ 'import' => true,
151
+ 'view_woocommerce_reports' => false,
152
+ );
153
+
154
+ remove_role( 'vendor' );
155
+ add_role( 'vendor', __('Vendor', 'wcvendors'), $args );
156
+
157
+ remove_role( 'pending_vendor');
158
+ add_role( 'pending_vendor', __( 'Pending Vendor', 'wcvendors' ), array(
159
+ 'read' => true,
160
+ 'edit_posts' => false,
161
+ 'delete_posts' => true
162
+ ) );
163
+
164
+ echo '<div class="updated inline"><p>' . __( 'WC Vendor roles successfully reset.', 'wcvendors' ) . '</p></div>';
165
+
166
+ } // reset_vendor_roles()
167
+
168
+
169
+ /**
170
+ * Reset wcvendors
171
+ *
172
+ * @since 1.9.2
173
+ * @access public
174
+ */
175
+ public static function reset_wcvendors(){
176
+
177
+ delete_option( WC_Vendors::$id . '_options' );
178
+ echo '<div class="updated inline"><p>' . __( 'WC Vendors was successfully reset. All settings have been reset.', 'wcvendors' ) . '</p></div>';
179
+
180
+ } // reset_wcvendors()
181
+
182
+
183
+ public static function commission_enqueue_style(){
184
+
185
+ wp_enqueue_style( 'commissions_select2_css', wcv_assets_url . 'css/select2.min.css' );
186
+
187
+ } //commission_enqueue_style()
188
+
189
+ public static function commission_my_enqueue_script(){
190
+
191
+ $select2_args = apply_filters( 'wcvendors_select2_commission_args', array(
192
+ 'placeholder' => __( 'Select a Vendor', 'wcvendors' ),
193
+ 'allowclear' => true,
194
+ ) );
195
+
196
+ wp_enqueue_script( 'commissions_select2_styles_js', wcv_assets_url. 'js/select2.min.js', array('jquery') );
197
+
198
+ wp_register_script( 'commissions_select2_load_js', wcv_assets_url. 'js/wcv-commissions.js', array('jquery') );
199
+ wp_localize_script( 'commissions_select2_load_js', 'wcv_commissions_select', $select2_args );
200
+ wp_enqueue_script( 'commissions_select2_load_js' );
201
+
202
+ }
203
+
204
+ /**
205
+ * Load styles for the commissions table page
206
+ */
207
+ public function commission_table_header_styles() {
208
+
209
+ $page = ( isset( $_GET[ 'page' ] ) ) ? esc_attr( $_GET[ 'page' ] ) : false;
210
+
211
+ // Only load the styles on the license table page
212
+
213
+ if ( 'pv_admin_commissions' !== $page ) return;
214
+
215
+ echo '<style type="text/css">';
216
+ echo '.wp-list-table .column-product_id { width: 20%; }';
217
+ echo '.wp-list-table .column-vendor_id { width: 15%; }';
218
+ echo '.wp-list-table .column-order_id { width: 8%; }';
219
+ echo '.wp-list-table .column-total_due { width: 10%;}';
220
+ echo '.wp-list-table .column-total_shipping { width: 10%;}';
221
+ echo '.wp-list-table .column-tax { width: 10%;}';
222
+ echo '.wp-list-table .column-totals { width: 10%;}';
223
+ echo '.wp-list-table .column-status { width: 5%;}';
224
+ echo '.wp-list-table .column-time { width: 10%;}';
225
+ echo '</style>';
226
+
227
+ } //table_header_styles()
228
+
229
+ /**
230
+ *
231
+ *
232
+ * @param unknown $status
233
+ * @param unknown $option
234
+ * @param unknown $value
235
+ *
236
+ * @return unknown
237
+ */
238
+ public static function set_table_option( $status, $option, $value )
239
+ {
240
+ if ( $option == 'commission_per_page' ) {
241
+ return $value;
242
+ }
243
+ }
244
+
245
+
246
+ /**
247
+ *
248
+ */
249
+ public static function add_options()
250
+ {
251
+ global $PV_Admin_Page;
252
+
253
+ $args = array(
254
+ 'label' => 'Rows',
255
+ 'default' => 10,
256
+ 'option' => 'commission_per_page'
257
+ );
258
+ add_screen_option( 'per_page', $args );
259
+
260
+ $PV_Admin_Page = new WCV_Admin_Page();
261
+
262
+ }
263
+
264
+
265
+ /**
266
+ * HTML setup for the WC > Commission page
267
+ */
268
+ public static function commissions_page()
269
+ {
270
+ global $woocommerce, $PV_Admin_Page;
271
+ ?>
272
+
273
+ <div class="wrap">
274
+
275
+ <div id="icon-woocommerce" class="icon32 icon32-woocommerce-reports"><br/></div>
276
+ <h2><?php _e( 'Commission', 'wcvendors' ); ?></h2>
277
+
278
+ <form id="posts-filter" method="get">
279
+
280
+ <?php
281
+ $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRIPPED );
282
+ $paged = filter_input( INPUT_GET, 'paged', FILTER_SANITIZE_NUMBER_INT );
283
+
284
+ printf( '<input type="hidden" name="page" value="%s" />', $page );
285
+ printf( '<input type="hidden" name="paged" value="%d" />', $paged );
286
+ ?>
287
+
288
+ <input type="hidden" name="page" value="pv_admin_commissions"/>
289
+
290
+ <?php $PV_Admin_Page->prepare_items(); ?>
291
+ <?php $PV_Admin_Page->views() ?>
292
+ <?php $PV_Admin_Page->display() ?>
293
+
294
+ </form>
295
+ <div id="ajax-response"></div>
296
+ <br class="clear"/>
297
+ </div>
298
+ <?php
299
+ }
300
+
301
+ /*
302
+ * Export commissions via csv
303
+ */
304
+ public function export_commissions(){
305
+
306
+ // prepare the items to export
307
+
308
+
309
+ if ( isset( $_GET['action'], $_GET['nonce'] ) && wp_verify_nonce( wp_unslash( $_GET['nonce'] ), 'export_commissions' ) && 'export_commissions' === wp_unslash( $_GET['action'] ) ) {
310
+
311
+ include_once( 'class-wcv-commissions-csv-exporter.php' );
312
+
313
+ $exporter = new WCV_Commissions_CSV_Export();
314
+
315
+ $date = date( 'Y-M-d' );
316
+
317
+ if ( ! empty( $_GET['com_status'] ) ) { // WPCS: input var ok.
318
+ $exporter->set_filename( 'wcv_commissions_'. wp_unslash( $_GET['com_status'] ) . '-' . $date . '.csv' ); // WPCS: input var ok, sanitization ok.
319
+ } else {
320
+ $exporter->set_filename( 'wcv_commissions-' . $date . '.csv' ); // WPCS: input var ok, sanitization ok.
321
+ }
322
+
323
+ $exporter->export();
324
+ }
325
+
326
+ }
327
+
328
+
329
+ }
330
+
331
+
332
+ if ( !class_exists( 'WP_List_Table' ) ) require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
333
+
334
+ /**
335
+ * WC_Simple_Referral_Admin class.
336
+ *
337
+ * @extends WP_List_Table
338
+ */
339
+ class WCV_Admin_Page extends WP_List_Table
340
+ {
341
+
342
+ public $index;
343
+
344
+
345
+ /**
346
+ * __construct function.
347
+ *
348
+ * @access public
349
+ */
350
+ function __construct()
351
+ {
352
+ global $status, $page;
353
+
354
+ $this->index = 0;
355
+
356
+ //Set parent defaults
357
+ parent::__construct( array(
358
+ 'singular' => 'commission',
359
+ 'plural' => 'commissions',
360
+ 'ajax' => false
361
+ ) );
362
+ }
363
+
364
+
365
+ /**
366
+ * column_default function.
367
+ *
368
+ * @access public
369
+ *
370
+ * @param unknown $item
371
+ * @param mixed $column_name
372
+ *
373
+ * @return unknown
374
+ */
375
+ function column_default( $item, $column_name )
376
+ {
377
+ global $wpdb;
378
+
379
+ switch ( $column_name ) {
380
+ case 'id' :
381
+ return $item->id;
382
+ case 'vendor_id' :
383
+ $user = get_userdata( $item->vendor_id );
384
+ return '<a href="' . admin_url( 'user-edit.php?user_id=' . $item->vendor_id ) . '">' . WCV_Vendors::get_vendor_shop_name( $item->vendor_id ) . '</a>';
385
+ case 'total_due' :
386
+ return wc_price( $item->total_due );
387
+ case 'total_shipping':
388
+ return wc_price($item->total_shipping );
389
+ case 'tax':
390
+ return wc_price( $item->tax );
391
+ case 'totals' :
392
+ $totals = ( wc_tax_enabled() ) ? $item->total_due + $item->total_shipping + $item->tax : $item->total_due + $item->total_shipping;
393
+ return wc_price( $totals );
394
+ case 'product_id' :
395
+ $parent = get_post_ancestors( $item->product_id );
396
+ $product_id = $parent ? $parent[ 0 ] : $item->product_id;
397
+ $wcv_total_sales = get_post_meta( $product_id, 'total_sales', true );
398
+ if ( ! get_post_status( $product_id ) ) {
399
+ $product_id = WCV_Vendors::find_parent_id_from_order( $item->order_id, $product_id );
400
+ }
401
+ return '<a href="' . admin_url( 'post.php?post=' . $product_id . '&action=edit' ) . '">' . get_the_title( $product_id ) . '</a> (<span title="' . get_the_title( $product_id ) .' has sold ' . $wcv_total_sales . ' times total.">' . $wcv_total_sales . '</span>)';
402
+ case 'order_id' :
403
+ $order = wc_get_order( $item->order_id );
404
+ if ( $order ) {
405
+ return '<a href="' . admin_url( 'post.php?post=' . $item->order_id . '&action=edit' ) . '">' . $order->get_order_number() . '</a>';
406
+ } else {
407
+ return $item->order_id;
408
+ }
409
+ case 'status' :
410
+ return $item->status;
411
+ case 'time' :
412
+ return date_i18n( get_option( 'date_format' ), strtotime( $item->time ) );
413
+ }
414
+ }
415
+
416
+
417
+ /**
418
+ * column_cb function.
419
+ *
420
+ * @access public
421
+ *
422
+ * @param mixed $item
423
+ *
424
+ * @return unknown
425
+ */
426
+ function column_cb( $item )
427
+ {
428
+ return sprintf(
429
+ '<input type="checkbox" name="%1$s[]" value="%2$s" />',
430
+ /*$1%s*/
431
+ 'id',
432
+ /*$2%s*/
433
+ $item->id
434
+ );
435
+ }
436
+
437
+
438
+ /**
439
+ * get_columns function.
440
+ *
441
+ * @access public
442
+ * @return unknown
443
+ */
444
+ function get_columns()
445
+ {
446
+ $columns = array(
447
+ 'cb' => '<input type="checkbox" />',
448
+ 'product_id' => __( 'Product', 'wcvendors' ),
449
+ 'order_id' => __( 'Order ID', 'wcvendors' ),
450
+ 'vendor_id' => __( 'Vendor', 'wcvendors' ),
451
+ 'total_due' => __( 'Commission', 'wcvendors' ),
452
+ 'total_shipping' => __( 'Shipping', 'wcvendors' ),
453
+ 'tax' => __( 'Tax', 'wcvendors' ),
454
+ 'totals' => __( 'Total', 'wcvendors' ),
455
+ 'status' => __( 'Status', 'wcvendors' ),
456
+ 'time' => __( 'Date', 'wcvendors' ),
457
+ );
458
+
459
+ if ( ! wc_tax_enabled() ) unset( $columns[ 'tax'] );
460
+
461
+ return $columns;
462
+ }
463
+
464
+
465
+ /**
466
+ * get_sortable_columns function.
467
+ *
468
+ * @access public
469
+ * @return unknown
470
+ */
471
+ function get_sortable_columns()
472
+ {
473
+ $sortable_columns = array(
474
+ 'time' => array( 'time', true ),
475
+ 'product_id' => array( 'product_id', false ),
476
+ 'order_id' => array( 'order_id', false ),
477
+ 'total_due' => array( 'total_due', false ),
478
+ 'total_shipping' => array( 'total_shipping', false ),
479
+ 'tax' => array( 'tax', false ),
480
+ 'totals' => array( 'totals', false ),
481
+ 'status' => array( 'status', false ),
482
+ 'vendor_id' => array( 'vendor_id', false ),
483
+ 'status' => array( 'status', false ),
484
+ );
485
+
486
+ if ( ! wc_tax_enabled() ) unset( $sortable_columns[ 'tax'] );
487
+
488
+ return $sortable_columns;
489
+ }
490
+
491
+
492
+ /**
493
+ * Get bulk actions
494
+ *
495
+ * @return unknown
496
+ */
497
+ function get_bulk_actions()
498
+ {
499
+ $actions = array(
500
+ 'mark_paid' => __( 'Mark paid', 'wcvendors' ),
501
+ 'mark_due' => __( 'Mark due', 'wcvendors' ),
502
+ 'mark_reversed' => __( 'Mark reversed', 'wcvendors' ),
503
+ // 'delete' => __('Delete', 'wcvendors'),
504
+ );
505
+
506
+ $actions = apply_filters('wcv_edit_bulk_actions', $actions);
507
+
508
+ return $actions;
509
+ }
510
+
511
+
512
+ /**
513
+ *
514
+ */
515
+ function extra_tablenav( $which )
516
+ {
517
+ $m = isset( $_GET[ 'm' ] ) ? (int) $_GET[ 'm' ] : 0;
518
+ $com_status = isset( $_GET[ 'com_status' ] ) ? $_GET[ 'com_status' ] : '';
519
+ $vendor_id = isset( $_GET[ 'vendor_id' ] ) ? $_GET[ 'vendor_id' ] : '';
520
+ $args_url = '';
521
+
522
+ if ( $m ) $args_url .= '&m='. $m;
523
+ if ( $com_status ) $args_url .= '&com_status='. $com_status;
524
+ if ( $vendor_id ) $args_url .= '&vendor_id='. $vendor_id;
525
+
526
+ if ( $which == 'top' ) {
527
+ echo '<div class="alignleft actions" style="width: 70%;">';
528
+
529
+ // Months drop down
530
+ $this->months_dropdown( 'commission' );
531
+
532
+ // commission status drop down
533
+ $this->status_dropdown( 'commission' );
534
+
535
+ // Vendor drop down
536
+ $this->vendor_dropdown( 'commission' );
537
+
538
+ submit_button( __( 'Filter' ), false, false, false, array( 'id' => "post-query-submit", 'name' => 'do-filter' ) );
539
+
540
+ echo '<a class="button" style="width: 110px; float: left;" href="' . wp_nonce_url( admin_url( 'admin.php?page=pv_admin_commissions&action=export_commissions'. $args_url ), 'export_commissions', 'nonce' ) . '">' . __('Export to CSV') . '</a>';
541
+ echo '</div>';
542
+
543
+ }
544
+ }
545
+
546
+
547
+ /**
548
+ * Display a monthly dropdown for filtering items
549
+ *
550
+ * @since 3.1.0
551
+ * @access protected
552
+ *
553
+ * @param unknown $post_type
554
+ */
555
+ function months_dropdown( $post_type )
556
+ {
557
+ global $wpdb, $wp_locale;
558
+
559
+ $table_name = $wpdb->prefix . "pv_commission";
560
+
561
+ $months = $wpdb->get_results( "
562
+ SELECT DISTINCT YEAR( time ) AS year, MONTH( time ) AS month
563
+ FROM $table_name
564
+ ORDER BY time DESC
565
+ " );
566
+
567
+ $month_count = count( $months );
568
+
569
+ if ( !$month_count || ( 1 == $month_count && 0 == $months[ 0 ]->month ) )
570
+ return;
571
+
572
+ $m = isset( $_GET[ 'm' ] ) ? (int) $_GET[ 'm' ] : 0;
573
+ ?>
574
+ <select name="m" id="filter-by-date">
575
+ <option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates', 'wcvendors' ); ?></option>
576
+ <?php
577
+ foreach ( $months as $arc_row ) {
578
+ if ( 0 == $arc_row->year )
579
+ continue;
580
+
581
+ $month = zeroise( $arc_row->month, 2 );
582
+ $year = $arc_row->year;
583
+
584
+ printf( "<option %s value='%s'>%s</option>\n",
585
+ selected( $m, $year . $month, false ),
586
+ esc_attr( $arc_row->year . $month ),
587
+ /* translators: 1: month name, 2: 4-digit year */
588
+ sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
589
+ );
590
+ }
591
+ ?>
592
+ </select>
593
+
594
+ <?php
595
+ }
596
+
597
+ /**
598
+ * Display a status dropdown for filtering items
599
+ *
600
+ * @since 3.1.0
601
+ * @access protected
602
+ *
603
+ * @param unknown $post_type
604
+ */
605
+ function status_dropdown( $post_type )
606
+ {
607
+ $com_status = isset( $_GET[ 'com_status' ] ) ? $_GET[ 'com_status' ] : '';
608
+ ?>
609
+ <select name="com_status">
610
+ <option<?php selected( $com_status, '' ); ?> value=''><?php _e( 'Show all Statuses', 'wcvendors' ); ?></option>
611
+ <option<?php selected( $com_status, 'due' ); ?> value="due"><?php _e( 'Due', 'wcvendors' ); ?></option>
612
+ <option<?php selected( $com_status, 'paid' ); ?> value="paid"><?php _e( 'Paid', 'wcvendors' ); ?></option>
613
+ <option<?php selected( $com_status, 'reversed' ); ?> value="reversed"><?php _e( 'Reversed', 'wcvendors' ); ?></option>
614
+ </select>
615
+ <?php
616
+ }
617
+
618
+ /**
619
+ * Display a vendor dropdown for filtering commissions
620
+ *
621
+ * @since 1.9.2
622
+ * @access public
623
+ *
624
+ * @param unknown $post_type
625
+ */
626
+ public function vendor_dropdown( $post_type ){
627
+
628
+ $user_args = array( 'fields' => array( 'ID', 'display_name' ) );
629
+ $vendor_id = isset( $_GET[ 'vendor_id' ] ) ? $_GET[ 'vendor_id' ] : '';
630
+ $new_args = $user_args;
631
+ $new_args[ 'role' ] = 'vendor';
632
+ $users = get_users( $new_args );
633
+
634
+ // Generate the drop down
635
+ $output = '<select style="width: 30%;" name="vendor_id" id="vendor_id" class="select2">';
636
+ $output .= "<option></option>";
637
+ foreach ( (array) $users as $user ) {
638
+ $select = selected( $user->ID, $vendor_id, false );
639
+ $output .= "<option value='$user->ID' $select>$user->display_name</option>";
640
+ }
641
+ $output .= '</select>';
642
+
643
+ echo $output;
644
+
645
+ } // vendor_dropdown()
646
+
647
+
648
+
649
+ /**
650
+ * Process bulk actions
651
+ *
652
+ * @return unknown
653
+ */
654
+ function process_bulk_action()
655
+ {
656
+ if ( !isset( $_GET[ 'id' ] ) ) return;
657
+
658
+ $items = array_map( 'intval', $_GET[ 'id' ] );
659
+ $ids = implode( ',', $items );
660
+
661
+ switch ( $this->current_action() ) {
662
+ case 'mark_paid':
663
+ $result = $this->mark_paid( $ids );
664
+
665
+ if ( $result )
666
+ echo '<div class="updated"><p>' . __( 'Commission marked paid.', 'wcvendors' ) . '</p></div>';
667
+ break;
668
+
669
+ case 'mark_due':
670
+ $result = $this->mark_due( $ids );
671
+
672
+ if ( $result )
673
+ echo '<div class="updated"><p>' . __( 'Commission marked due.', 'wcvendors' ) . '</p></div>';
674
+ break;
675
+
676
+ case 'mark_reversed':
677
+ $result = $this->mark_reversed( $ids );
678
+
679
+ if ( $result )
680
+ echo '<div class="updated"><p>' . __( 'Commission marked reversed.', 'wcvendors' ) . '</p></div>';
681
+ break;
682
+
683
+ default:
684
+ // code...
685
+ do_action('wcv_edit_process_bulk_actions', $this->current_action(), $ids);
686
+ break;
687
+ }
688
+
689
+ }
690
+
691
+
692
+ /**
693
+ *
694
+ *
695
+ * @param unknown $ids (optional)
696
+ *
697
+ * @return unknown
698
+ */
699
+ public function mark_paid( $ids = array() )
700
+ {
701
+ global $wpdb;
702
+
703
+ $table_name = $wpdb->prefix . "pv_commission";
704
+
705
+ $query = "UPDATE `{$table_name}` SET `status` = 'paid' WHERE id IN ($ids) AND `status` = 'due'";
706
+ $result = $wpdb->query( $query );
707
+
708
+ return $result;
709
+ }
710
+
711
+
712
+ /**
713
+ *
714
+ *
715
+ * @param unknown $ids (optional)
716
+ *
717
+ * @return unknown
718
+ */
719
+ public function mark_reversed( $ids = array() )
720
+ {
721
+ global $wpdb;
722
+
723
+ $table_name = $wpdb->prefix . "pv_commission";
724
+ $query = "UPDATE `{$table_name}` SET `status` = 'reversed' WHERE id IN ($ids)";
725
+ $result = $wpdb->query( $query );
726
+
727
+ return $result;
728
+
729
+ }
730
+
731
+
732
+ /**
733
+ *
734
+ *
735
+ * @param unknown $ids (optional)
736
+ *
737
+ * @return unknown
738
+ */
739
+ public function mark_due( $ids = array() )
740
+ {
741
+ global $wpdb;
742
+
743
+ $table_name = $wpdb->prefix . "pv_commission";
744
+
745
+ $query = "UPDATE `{$table_name}` SET `status` = 'due' WHERE id IN ($ids)";
746
+ $result = $wpdb->query( $query );
747
+
748
+ return $result;
749
+ }
750
+
751
+
752
+ /**
753
+ * cubrid_prepare(conn_identifier, prepare_stmt)_items function.
754
+ *
755
+ * @access public
756
+ */
757
+ function prepare_items()
758
+ {
759
+ global $wpdb;
760
+
761
+ $_SERVER['REQUEST_URI'] = remove_query_arg( '_wp_http_referer', $_SERVER['REQUEST_URI'] );
762
+
763
+ $per_page = $this->get_items_per_page( 'commission_per_page', 10 );
764
+ $current_page = $this->get_pagenum();
765
+
766
+ $orderby = !empty( $_REQUEST[ 'orderby' ] ) ? esc_attr( $_REQUEST[ 'orderby' ] ) : 'time';
767
+ $order = ( !empty( $_REQUEST[ 'order' ] ) && $_REQUEST[ 'order' ] == 'asc' ) ? 'ASC' : 'DESC';
768
+ $com_status = !empty( $_REQUEST[ 'com_status' ] ) ? esc_attr( $_REQUEST[ 'com_status' ] ) : '';
769
+ $vendor_id = !empty( $_REQUEST[ 'vendor_id' ] ) ? esc_attr( $_REQUEST[ 'vendor_id' ] ) : '';
770
+ $status_sql = '';
771
+ $time_sql = '';
772
+
773
+ /**
774
+ * Init column headers
775
+ */
776
+ $this->_column_headers = $this->get_column_info();
777
+
778
+ /**
779
+ * Process bulk actions
780
+ */
781
+ $this->process_bulk_action();
782
+
783
+ /**
784
+ * Get items
785
+ */
786
+ $sql = "SELECT COUNT(id) FROM {$wpdb->prefix}pv_commission";
787
+
788
+ if ( !empty( $_GET[ 'm' ] ) ) {
789
+
790
+ $year = substr( $_GET[ 'm' ], 0, 4 );
791
+ $month = substr( $_GET[ 'm' ], 4, 2 );
792
+
793
+ $time_sql = "
794
+ WHERE MONTH(`time`) = '$month'
795
+ AND YEAR(`time`) = '$year'
796
+ ";
797
+
798
+ $sql .= $time_sql;
799
+ }
800
+
801
+ if ( !empty( $_GET[ 'com_status' ] ) ) {
802
+
803
+ if ( $time_sql == '' ) {
804
+ $status_sql = "
805
+ WHERE status = '$com_status'
806
+ ";
807
+ } else {
808
+ $status_sql = "
809
+ AND status = '$com_status'
810
+ ";
811
+ }
812
+
813
+ $sql .= $status_sql;
814
+ }
815
+
816
+
817
+ if ( !empty( $_GET[ 'vendor_id' ] ) ) {
818
+
819
+ if ( $time_sql == '' && $status_sql == '' ) {
820
+ $vendor_sql = "
821
+ WHERE vendor_id = '$vendor_id'
822
+ ";
823
+ } else {
824
+ $vendor_sql = "
825
+ AND vendor_id = '$vendor_id'
826
+ ";
827
+ }
828
+
829
+ $sql .= $vendor_sql;
830
+ }
831
+
832
+ $max = $wpdb->get_var( $sql );
833
+
834
+ $sql = "
835
+ SELECT * FROM {$wpdb->prefix}pv_commission
836
+ ";
837
+
838
+ if ( !empty( $_GET[ 'm' ] ) ) {
839
+ $sql .= $time_sql;
840
+ }
841
+
842
+ if ( !empty( $_GET['com_status'] ) ) {
843
+ $sql .= $status_sql;
844
+ }
845
+
846
+ if ( !empty( $_GET['vendor_id'] ) ) {
847
+ $sql .= $vendor_sql;
848
+ }
849
+
850
+ $offset = ( $current_page - 1 ) * $per_page;
851
+
852
+ $sql .= "
853
+ ORDER BY `{$orderby}` {$order}
854
+ LIMIT {$offset}, {$per_page}
855
+ ";
856
+
857
+ // $this->items = $wpdb->get_results( $wpdb->prepare( $sql, ( $current_page - 1 ) * $per_page, $per_page ) );
858
+ $this->items = $wpdb->get_results( $sql );
859
+
860
+ /**
861
+ * Pagination
862
+ */
863
+ $this->set_pagination_args( array(
864
+ 'total_items' => $max,
865
+ 'per_page' => $per_page,
866
+ 'total_pages' => ceil( $max / $per_page )
867
+ ) );
868
+ }
869
+
870
+ public function get_views() {
871
+ $views = array(
872
+ 'all' => '<li class="all"><a href="' . admin_url( 'admin.php?page=pv_admin_commissions' ) . '">' . __( 'All', 'wcvendors' ) . '</a></li>',
873
+ 'due' => '<li class="all"><a href="' . admin_url( 'admin.php?page=pv_admin_commissions&com_status=due' ) . '">' . __( 'Due', 'wcvendors' ) . '</a></li>',
874
+ 'paid' => '<li class="all"><a href="' . admin_url( 'admin.php?page=pv_admin_commissions&com_status=paid' ) . '">' . __( 'Paid', 'wcvendors' ) . '</a></li>',
875
+ 'void' => '<li class="all"><a href="' . admin_url( 'admin.php?page=pv_admin_commissions&com_status=void' ) . '">' . __( 'Void', 'wcvendors' ) . '</a></li>',
876
+ );
877
+
878
+ return $views;
879
+ }
880
+
881
+
882
+ }
trunk/classes/admin/class-admin-reports.php ADDED
@@ -0,0 +1,544 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WCV_Admin_Reports class.
4
+ *
5
+ * Shows reports related to software in the woocommerce backend
6
+ *
7
+ * @author Matt Gates <http://mgates.me>
8
+ * @package
9
+ */
10
+
11
+
12
+ class WCV_Admin_Reports
13
+ {
14
+
15
+
16
+ /**
17
+ * __construct function.
18
+ *
19
+ * @access public
20
+ * @return void
21
+ *
22
+ * @param bool $debug (optional) (default: false)
23
+ */
24
+ function __construct( $debug = false )
25
+ {
26
+ add_filter( 'woocommerce_admin_reports', array( $this, 'reports_tab' ) );
27
+ }
28
+
29
+ /**
30
+ * reports_tab function.
31
+ *
32
+ * @access public
33
+ *
34
+ * @param unknown $reports
35
+ *
36
+ * @return void
37
+ */
38
+ function reports_tab( $reports )
39
+ {
40
+ $reports[ 'vendors' ] = array(
41
+ 'title' => __( 'WC Vendors', 'wc-vendors' ),
42
+ 'charts' => array(
43
+ array(
44
+ 'title' => __( 'Overview', 'wc-vendors' ),
45
+ 'description' => '',
46
+ 'hide_title' => true,
47
+ 'function' => array( $this, 'sales' ),
48
+ ),
49
+ array(
50
+ 'title' => __( 'Commission by vendor', 'wc-vendors' ),
51
+ 'description' => '',
52
+ 'hide_title' => true,
53
+ 'function' => array( $this, 'commission' ),
54
+ ),
55
+ array(
56
+ 'title' => __( 'Commission by product', 'wc-vendors' ),
57
+ 'description' => '',
58
+ 'hide_title' => true,
59
+ 'function' => array( $this, 'commission' ),
60
+ ),
61
+ array(
62
+ 'title' => __( 'Commission Totals', 'wc-vendors' ),
63
+ 'description' => __( 'Commission totals for all vendors includes shipping and taxes. By default no date range is used and all due commissions are returned. Use the date range to filter.', 'wc-vendors' ),
64
+ 'hide_title' => true,
65
+ 'function' => array( $this, 'commission_totals' ),
66
+ ),
67
+ ),
68
+ );
69
+
70
+ return apply_filters( 'wcvendors_admin_reports_tab', $reports );
71
+ }
72
+
73
+
74
+ /**
75
+ *
76
+ */
77
+ function sales()
78
+ {
79
+
80
+ global $start_date, $end_date, $woocommerce, $wpdb;
81
+
82
+ $commission_status_labels = WCV_Commission::commission_status();
83
+
84
+ $start_date = !empty( $_POST[ 'start_date' ] ) ? $_POST[ 'start_date' ] : strtotime( date( 'Ymd', strtotime( date( 'Ym', current_time( 'timestamp' ) ) . '01' ) ) );
85
+ $end_date = !empty( $_POST[ 'end_date' ] ) ? $_POST[ 'end_date' ] : strtotime( date( 'Ymd', current_time( 'timestamp' ) ) );
86
+
87
+ if ( !empty( $_POST[ 'start_date' ] ) ) {
88
+ $start_date = strtotime( $_POST[ 'start_date' ] );
89
+ }
90
+
91
+ if ( !empty( $_POST[ 'end_date' ] ) ) {
92
+ $end_date = strtotime( $_POST[ 'end_date' ] );
93
+ }
94
+
95
+ $after = date( 'Y-m-d', $start_date );
96
+ $before = date( 'Y-m-d', strtotime( '+1 day', $end_date ) );
97
+
98
+ $commission_due = $wpdb->get_var( "
99
+ SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission WHERE status = 'due'
100
+ AND time >= '" . $after . "'
101
+ AND time <= '" . $before . "'
102
+ " );
103
+
104
+ $reversed = $wpdb->get_var( "
105
+ SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission WHERE status = 'reversed'
106
+ AND time >= '" . $after . "'
107
+ AND time <= '" . $before . "'
108
+ " );
109
+
110
+ $paid = $wpdb->get_var( "
111
+ SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission WHERE status = 'paid'
112
+ AND time >= '" . $after . "'
113
+ AND time <= '" . $before . "'
114
+ " );
115
+
116
+ ?>
117
+
118
+ <form method="post" action="">
119
+ <p><label for="from"><?php _e( 'From:', 'wc-vendors' ); ?></label>
120
+ <input type="text" size="9" placeholder="yyyy-mm-dd" value="<?php echo esc_attr( date( 'Y-m-d', $start_date ) ); ?>" name="start_date" class="range_datepicker from" id="from" />
121
+ <label for="to"><?php _e( 'To:', 'wc-vendors' ); ?></label>
122
+ <input type="text" size="9" placeholder="yyyy-mm-dd" value="<?php echo esc_attr( date( 'Y-m-d', $end_date ) ); ?>" name="end_date" class="range_datepicker to" id="to" />
123
+ <input type="submit" class="button" value="<?php _e( 'Show', 'wc-vendors' ); ?>"/></p>
124
+ </form>
125
+
126
+ <div id="poststuff" class="woocommerce-reports-wrap">
127
+ <div class="woocommerce-reports-sidebar">
128
+ <div class="postbox">
129
+ <h3><span><?php _e( 'Total paid in range', 'wc-vendors' ); ?></span></h3>
130
+
131
+ <div class="inside">
132
+ <p class="stat"><?php if ( $paid > 0 ) echo wc_price( $paid ); else _e( 'n/a', 'wc-vendors' ); ?></p>
133
+ </div>
134
+ </div>
135
+ <div class="postbox">
136
+ <h3><span><?php _e( 'Total due in range', 'wc-vendors' ); ?></span></h3>
137
+
138
+ <div class="inside">
139
+ <p class="stat"><?php if ( $commission_due > 0 ) echo wc_price( $commission_due ); else _e( 'n/a', 'wc-vendors' ); ?></p>
140
+ </div>
141
+ </div>
142
+ <div class="postbox">
143
+ <h3><span><?php _e( 'Total reversed in range', 'wc-vendors' ); ?></span></h3>
144
+
145
+ <div class="inside">
146
+ <p class="stat"><?php if ( $reversed > 0 ) echo wc_price( $reversed ); else _e( 'n/a', 'wc-vendors' ); ?></p>
147
+ </div>
148
+ </div>
149
+ </div>
150
+
151
+ <div class="woocommerce-reports-main">
152
+ <div class="postbox">
153
+ <h3><span><?php _e( 'Recent Commission', 'wc-vendors' ); ?></span></h3>
154
+
155
+ <div>
156
+ <?php
157
+ $commission = $wpdb->get_results( "
158
+ SELECT * FROM {$wpdb->prefix}pv_commission
159
+ WHERE time >= '" . $after . "'
160
+ AND time <= '" . $before . "'
161
+ ORDER BY time DESC
162
+ " );
163
+
164
+ if ( sizeof( $commission ) > 0 ) {
165
+
166
+ ?>
167
+ <div class="woocommerce_order_items_wrapper">
168
+ <table id="commission-table" class="woocommerce_order_items" cellspacing="0">
169
+ <thead>
170
+ <tr>
171
+ <th><?php _e( 'Order', 'wc-vendors' ) ?></th>
172
+ <th><?php _e( 'Product', 'wc-vendors' ) ?></th>
173
+ <th><?php _e( 'Vendor', 'wc-vendors' ) ?></th>
174
+ <th><?php _e( 'Total', 'wc-vendors' ) ?></th>
175
+ <th><?php _e( 'Date &amp; Time', 'wc-vendors' ) ?></th>
176
+ <th><?php _e( 'Status', 'wc-vendors' ) ?></th>
177
+ </tr>
178
+ </thead>
179
+ <tbody>
180
+ <?php $i = 1;
181
+ foreach ( $commission as $row ) : $i++ ?>
182
+ <tr<?php if ( $i % 2 == 1 ) echo ' class="alternate"' ?>>
183
+ <td><?php if ( $row->order_id ) : ?><a
184
+ href="<?php echo admin_url( 'post.php?post=' . $row->order_id . '&action=edit' ); ?>"><?php echo $row->order_id; ?></a><?php else : _e( 'N/A', 'wc-vendors' ); endif; ?>
185
+ </td>
186
+ <td><?php echo get_the_title( $row->product_id ); ?></td>
187
+ <td><?php echo WCV_Vendors::get_vendor_shop_name( $row->vendor_id ); ?></td>
188
+ <td><?php echo wc_price( $row->total_due + $row->total_shipping + $row->tax ) ?></td>
189
+ <td><?php echo date_i18n( __( 'D j M Y \a\t h:ia', 'wc-vendors' ), strtotime( $row->time ) ) ?></td>
190
+ <td><?php echo $commission_status_labels[ $row->status ]; ?></td>
191
+ </tr>
192
+ <?php endforeach; ?>
193
+ </tbody>
194
+ </table>
195
+ </div>
196
+ <?php
197
+ } else {
198
+ ?><p><?php _e( 'No commission yet', 'wc-vendors' ) ?></p><?php
199
+ }
200
+ ?>
201
+ </div>
202
+ </div>
203
+ </div>
204
+ </div>
205
+ <?php
206
+
207
+ }
208
+
209
+
210
+ /**
211
+ *
212
+ */
213
+ function commission()
214
+ {
215
+ global $start_date, $end_date, $woocommerce, $wpdb;
216
+
217
+ $latest_woo = version_compare( $woocommerce->version, '2.3', '>' );
218
+
219
+ $first_year = $wpdb->get_var( "SELECT time FROM {$wpdb->prefix}pv_commission ORDER BY time ASC LIMIT 1;" );
220
+ $first_year = $first_year ? date( 'Y', strtotime( $first_year ) ) : date( 'Y' );
221
+ $current_year = isset( $_POST[ 'show_year' ] ) ? $_POST[ 'show_year' ] : date( 'Y', current_time( 'timestamp' ) );
222
+ $start_date = strtotime( $current_year . '0101' );
223
+
224
+ $vendors = get_users( array( 'role' => 'vendor' ) );
225
+ $vendors = apply_filters( 'pv_commission_vendors_list', $vendors );
226
+ $selected_vendor = !empty( $_POST[ 'show_vendor' ] ) ? (int) $_POST[ 'show_vendor' ] : false;
227
+ $products = !empty( $_POST[ 'product_ids' ] ) ? (array) $_POST[ 'product_ids' ] : array();
228
+
229
+ ?>
230
+
231
+ <form method="post" action="" class="report_filters">
232
+ <label for="show_year"><?php _e( 'Show:', 'wc-vendors' ); ?></label>
233
+ <select name="show_year" id="show_year">
234
+ <?php
235
+ for ( $i = $first_year; $i <= date( 'Y' ); $i++ )
236
+ printf( '<option value="%s" %s>%s</option>', $i, selected( $current_year, $i, false ), $i );
237
+ ?>
238
+ </select>
239
+ <?php if ( $_GET[ 'report' ] == 2 ) {
240
+ if ($latest_woo) { ?>
241
+ <input type="hidden" class="wc-product-search" style="width:203px;" name="product_ids[]" data-placeholder="<?php _e( 'Search for a product&hellip;', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" />
242
+ <?php } else { ?>
243
+ <select id="product_ids" name="product_ids[]" class="ajax_chosen_select_products" multiple="multiple"
244
+ data-placeholder="<?php _e( 'Type in a product name to start searching...', 'wc-vendors' ); ?>"
245
+ style="width: 400px;"></select>
246
+ <script type="text/javascript">
247
+ jQuery(function () {
248
+
249
+ // Ajax Chosen Product Selectors
250
+ jQuery("select.ajax_chosen_select_products").ajaxChosen({
251
+ method: 'GET',
252
+ url: '<?php echo admin_url('admin-ajax.php'); ?>',
253
+ dataType: 'json',
254
+ afterTypeDelay: 100,
255
+ data: {
256
+ action: 'woocommerce_json_search_products',
257
+ security: '<?php echo wp_create_nonce("search-products"); ?>'
258
+ }
259
+ }, function (data) {
260
+
261
+ var terms = {};
262
+
263
+ jQuery.each(data, function (i, val) {
264
+ terms[i] = val;
265
+ });
266
+
267
+ return terms;
268
+ });
269
+
270
+ });
271
+ </script>
272
+
273
+ <?php }
274
+ } else { ?>
275
+ <select class="chosen_select" id="show_vendor" name="show_vendor" style="width: 300px;"
276
+ data-placeholder="<?php _e( 'Select a vendor&hellip;', 'wc-vendors' ); ?>">
277
+ <option></option>
278
+ <?php foreach ( $vendors as $key => $vendor ) printf( '<option value="%s" %s>%s</option>', $vendor->ID, selected( $selected_vendor, $vendor->ID, false ), $vendor->display_name ); ?>
279
+ </select>
280
+ <?php } ?>
281
+ <input type="submit" class="button" value="<?php _e( 'Show', 'wc-vendors' ); ?>"/>
282
+ </form>
283
+
284
+ <?php
285
+
286
+ if ( !empty( $selected_vendor ) || !empty( $products ) ) {
287
+
288
+ foreach ($products as $key => $product_id) {
289
+ $_product = wc_get_product($product_id);
290
+ $childs = $_product->get_children();
291
+ $products = array_merge($childs, $products);
292
+ }
293
+
294
+ $commissions = array();
295
+ $filter = !empty( $selected_vendor ) ? (" WHERE vendor_id = " . $selected_vendor) : (" WHERE product_id IN ( " . implode( ', ', $products ) ." )");
296
+
297
+ $sql = "SELECT
298
+ SUM(total_due + total_shipping + tax) as total,
299
+ SUM(total_due) as commission,
300
+ SUM(total_shipping) as shipping,
301
+ SUM(tax) as tax
302
+ FROM {$wpdb->prefix}pv_commission
303
+ ";
304
+
305
+ $paid_sql = "SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission " . $filter . " AND status = 'paid'";
306
+ $reversed_sql = "SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission" . $filter . " AND status = 'reversed'";
307
+ $date_sql = " AND date_format(`time`,'%%Y%%m') = %d";
308
+
309
+ for ( $count = 0; $count < 12; $count++ ) {
310
+ $time = strtotime( date( 'Ym', strtotime( '+ ' . $count . ' MONTH', $start_date ) ) . '01' );
311
+ if ( $time > current_time( 'timestamp' ) ) continue;
312
+
313
+ $month = date( 'Ym', strtotime( date( 'Ym', strtotime( '+ ' . $count . ' MONTH', $start_date ) ) . '01' ) );
314
+
315
+ $fetch_results = $wpdb->prepare( $sql . $filter . $date_sql, $month );
316
+
317
+ $results = $wpdb->get_results( $fetch_results );
318
+ if ( !empty( $results[ 0 ] ) ) {
319
+ extract( get_object_vars( $results[ 0 ] ) );
320
+ }
321
+
322
+ $paid = $wpdb->get_var( $wpdb->prepare( $paid_sql . $date_sql, $month ) );
323
+ $reversed = $wpdb->get_var( $wpdb->prepare( $reversed_sql . $date_sql, $month ) );
324
+
325
+ $commissions[ date( 'M', strtotime( $month . '01' ) ) ] = array(
326
+ 'commission' => $commission,
327
+ 'tax' => $tax,
328
+ 'shipping' => $shipping,
329
+ 'reversed' => $reversed,
330
+ 'paid' => $paid,
331
+ 'total' => $total - $reversed - $paid,
332
+ );
333
+
334
+ }
335
+
336
+ ?>
337
+
338
+ <div class="woocommerce-reports-main">
339
+ <table class="widefat">
340
+ <thead>
341
+ <tr>
342
+ <th><?php _e( 'Month', 'wc-vendors' ); ?></th>
343
+ <th class="total_row"><?php _e( 'Commission Totals', 'wc-vendors' ); ?></th>
344
+ <th class="total_row"><?php _e( 'Tax', 'wc-vendors' ); ?></th>
345
+ <th class="total_row"><?php _e( 'Shipping', 'wc-vendors' ); ?></th>
346
+ <th class="total_row"><?php _e( 'Reversed', 'wc-vendors' ); ?></th>
347
+ <th class="total_row"><?php _e( 'Paid', 'wc-vendors' ); ?></th>
348
+ <th class="total_row"><?php _e( 'Due', 'wc-vendors' ); ?></th>
349
+ </tr>
350
+ </thead>
351
+ <tfoot>
352
+ <tr>
353
+ <?php
354
+ $total = array(
355
+ 'commission' => 0,
356
+ 'tax' => 0,
357
+ 'shipping' => 0,
358
+ 'reversed' => 0,
359
+ 'paid' => 0,
360
+ 'total' => 0,
361
+ );
362
+
363
+ foreach ( $commissions as $month => $commission ) {
364
+ $total[ 'commission' ] += $commission[ 'commission' ];
365
+ $total[ 'tax' ] += $commission[ 'tax' ];
366
+ $total[ 'shipping' ] += $commission[ 'shipping' ];
367
+ $total[ 'reversed' ] += $commission[ 'reversed' ];
368
+ $total[ 'paid' ] += $commission[ 'paid' ];
369
+ $total[ 'total' ] += $commission[ 'total' ];
370
+ }
371
+
372
+ echo '<td>' . __( 'Total', 'wc-vendors' ) . '</td>';
373
+
374
+ foreach ( $total as $value ) {
375
+ echo '<td class="total_row">' . wc_price( $value ) . '</td>';
376
+ }
377
+ ?>
378
+ </tr>
379
+ </tfoot>
380
+ <tbody>
381
+ <?php
382
+ foreach ( $commissions as $month => $commission ) {
383
+ $alt = ( isset( $alt ) && $alt == 'alt' ) ? '' : 'alt';
384
+
385
+ echo '<tr class="' . $alt . '"><td>' . $month . '</td>';
386
+
387
+ foreach ( $commission as $value ) {
388
+ echo '<td class="total_row">' . wc_price( $value ) . '</td>';
389
+ }
390
+
391
+ echo '</tr>';
392
+ }
393
+ ?>
394
+ </tbody>
395
+ </table>
396
+ </div>
397
+
398
+ <?php } ?>
399
+ <?php
400
+
401
+ }
402
+
403
+
404
+ /**
405
+ * Commission Totals for vendors reports
406
+ *
407
+ * @since 1.8.4
408
+ */
409
+ function commission_totals(){
410
+
411
+ global $wpdb;
412
+
413
+ $total_start_date = !empty( $_POST[ 'total_start_date' ] ) ? $_POST[ 'total_start_date' ] : strtotime( date( 'Ymd', strtotime( date( 'Ym', current_time( 'timestamp' ) ) . '01' ) ) );
414
+ $total_end_date = !empty( $_POST[ 'total_end_date' ] ) ? $_POST[ 'total_end_date' ] : strtotime( date( 'Ymd', current_time( 'timestamp' ) ) );
415
+ $commission_status = !empty( $_POST[ 'commission_status' ] ) ? $_POST[ 'commission_status' ] : 'due';
416
+ $date_sql = ( !empty( $_POST[ 'total_start_date' ] ) && !empty( $_POST[ 'total_end_date' ] ) ) ? " time BETWEEN '$total_start_date 00:00:00' AND '$total_end_date 23:59:59' AND" : "";
417
+
418
+ $status_sql = " status='$commission_status'";
419
+
420
+ $sql = "SELECT vendor_id, total_due, total_shipping, tax, status FROM {$wpdb->prefix}pv_commission WHERE";
421
+
422
+ $commissions = $wpdb->get_results( $sql . $date_sql . $status_sql );
423
+
424
+ if ( !empty( $_POST[ 'total_start_date' ] ) ) {
425
+ $total_start_date = strtotime( $_POST[ 'total_start_date' ] );
426
+ }
427
+
428
+ if ( !empty( $_POST[ 'total_end_date' ] ) ) {
429
+ $total_end_date = strtotime( $_POST[ 'total_end_date' ] );
430
+ }
431
+
432
+ $totals = $this->calculate_totals( $commissions );
433
+
434
+ ?><form method="post" action="">
435
+ <p><label for="from"><?php _e( 'From:', 'wc-vendors' ); ?></label>
436
+ <input type="text" size="9" placeholder="yyyy-mm-dd" value="<?php echo esc_attr( date( 'Y-m-d', $total_start_date ) ); ?>" name="total_start_date" class="range_datepicker from" id="from" />
437
+ <label for="to"><?php _e( 'To:', 'wc-vendors' ); ?></label>
438
+ <input type="text" size="9" placeholder="yyyy-mm-dd" value="<?php echo esc_attr( date( 'Y-m-d', $total_end_date ) ); ?>" name="total_end_date" class="range_datepicker to" id="to" />
439
+
440
+ <select name="commission_status">
441
+ <option value="due"><?php _e( 'Due', 'wc-vendors' ); ?></option>
442
+ <option value="paid"><?php _e( 'Paid', 'wc-vendors' ); ?></option>
443
+ <option value="reversed"><?php _e( 'Reversed', 'wc-vendors' ); ?></option>
444
+ </select>
445
+
446
+ <input type="submit" class="button" value="<?php _e( 'Show', 'wc-vendors' ); ?>"/>
447
+
448
+ <?php do_action( 'wcvendors_after_commission_reports', $commissions ); ?>
449
+ </p>
450
+ </form>
451
+
452
+ <div class="woocommerce-reports-main">
453
+ <table class="widefat">
454
+ <thead>
455
+ <tr>
456
+ <th class="total_row"><?php _e( 'Vendor', 'wc-vendors' ); ?></th>
457
+ <th class="total_row"><?php _e( 'Tax Total', 'wc-vendors' ); ?></th>
458
+ <th class="total_row"><?php _e( 'Shipping Total', 'wc-vendors' ); ?></th>
459
+ <th class="total_row"><?php _e( 'Status', 'wc-vendors' ); ?></th>
460
+ <th class="total_row"><?php _e( 'Commission Total', 'wc-vendors' ); ?></th>
461
+ </tr>
462
+ </thead>
463
+ <tbody>
464
+ <?php
465
+
466
+ if ( !empty( $commissions ) ){
467
+
468
+ foreach ( $totals as $totals ) {
469
+
470
+ echo '<tr>';
471
+ echo '<td>' . $totals[ 'user_login' ]. '</td>';
472
+ echo '<td>' . wc_price( $totals[ 'tax' ] ). '</td>';
473
+ echo '<td>' . wc_price( $totals[ 'total_shipping' ] ). '</td>';
474
+ echo '<td>' . $totals[ 'status' ] . '</td>';
475
+ echo '<td>' . wc_price( $totals[ 'total_due' ] ). '</td>';
476
+ echo '</tr>';
477
+
478
+ }
479
+
480
+ } else {
481
+ echo '<tr>';
482
+ echo '<td colspan="5">'. __( 'No commissions found.', 'wc-vendors' ) . '</td>';
483
+ echo '</tr>';
484
+
485
+ }
486
+ ?>
487
+ </tbody>
488
+ </table>
489
+
490
+ <?php
491
+
492
+
493
+ } // commission_totals()
494
+
495
+ /**
496
+ * Calculate the totals of the commissions return an array with vendor id as the key with the totals
497
+ *
498
+ * @param array $commissions total commissions array
499
+ * @return array $totals calculated totals
500
+ */
501
+ function calculate_totals( $commissions ){
502
+
503
+ $totals = array();
504
+
505
+ $vendors = get_users( array( 'role' => 'vendor', 'fields' => array( 'ID', 'user_login' ) ) );
506
+ $vendor_names = wp_list_pluck( $vendors, 'user_login', 'ID' );
507
+
508
+ foreach ($commissions as $commission ) {
509
+
510
+ if ( array_key_exists( $commission->vendor_id, $totals ) ){
511
+
512
+ $totals[ $commission->vendor_id ][ 'total_due' ] += $commission->total_due + $commission->tax + $commission->total_shipping;
513
+ $totals[ $commission->vendor_id ][ 'tax' ] += $commission->tax;
514
+ $totals[ $commission->vendor_id ][ 'total_shipping' ] += $commission->total_shipping;
515
+
516
+ } else {
517
+
518
+ if ( array_key_exists( $commission->vendor_id, $vendor_names) ){
519
+
520
+ $temp_array = array(
521
+ 'user_login' => $vendor_names[ $commission->vendor_id ],
522
+ 'total_due' => $commission->total_due,
523
+ 'tax' => $commission->tax,
524
+ 'total_shipping' => $commission->total_shipping,
525
+ 'status' => $commission->status,
526
+ );
527
+
528
+ $totals[ $commission->vendor_id ] = $temp_array ;
529
+
530
+ }
531
+
532
+ }
533
+
534
+ }
535
+
536
+ usort( $totals, function( $a, $b ) {
537
+ return strcmp( strtolower( $a[ 'user_login' ] ), strtolower( $b[ 'user_login' ] ) );
538
+ });
539
+
540
+ return $totals;
541
+
542
+ } // calculate_totals()
543
+
544
+ }
trunk/classes/admin/class-admin-users.php ADDED
@@ -0,0 +1,425 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP-Admin users page
5
+ *
6
+ * @author Matt Gates <http://mgates.me>
7
+ * @package WC_Vendors
8
+ */
9
+
10
+
11
+ class WCV_Admin_Users
12
+ {
13
+
14
+
15
+ /**
16
+ * Constructor
17
+ */
18
+ function __construct()
19
+ {
20
+ if ( !is_admin() ) return;
21
+
22
+ add_action( 'edit_user_profile', array( $this, 'show_extra_profile_fields' ) );
23
+ add_action( 'edit_user_profile_update', array( $this, 'save_extra_profile_fields' ) );
24
+
25
+ add_filter( 'add_menu_classes', array( $this, 'show_pending_number' ) );
26
+
27
+ // Disabling non-vendor related items on the admin screens
28
+ if ( WCV_Vendors::is_vendor( get_current_user_id() ) ) {
29
+ add_filter( 'woocommerce_csv_product_role', array( $this, 'csv_import_suite_compatibility' ) );
30
+ add_filter( 'woocommerce_csv_product_export_args', array( $this, 'csv_import_suite_compatibility_export' ) );
31
+
32
+ // Admin page lockdown
33
+ remove_action( 'admin_init', 'woocommerce_prevent_admin_access' );
34
+ add_action( 'admin_init', array( $this, 'prevent_admin_access' ) );
35
+
36
+ add_filter( 'woocommerce_prevent_admin_access', array( $this, 'deny_admin_access' ) );
37
+
38
+ // WC > Product page fixes
39
+ add_action( 'load-post-new.php', array( $this, 'confirm_access_to_add' ) );
40
+ add_action( 'load-edit.php', array( $this, 'edit_nonvendors' ) );
41
+ add_filter( 'views_edit-product', array( $this, 'hide_nonvendor_links' ) );
42
+
43
+ // Filter user attachments so they only see their own attachements
44
+ add_action( 'ajax_query_attachments_args', array( $this, 'show_user_attachment_ajax' ) );
45
+ add_filter( 'parse_query', array( $this, 'show_user_attachment_page' ) );
46
+
47
+ add_action( 'admin_menu', array( $this, 'remove_menu_page' ), 99 );
48
+ add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 99 );
49
+ add_filter( 'product_type_selector', array( $this, 'filter_product_types' ), 99 );
50
+ add_filter( 'product_type_options', array( $this, 'filter_product_type_options' ), 99 );
51
+ add_filter( 'woocommerce_product_data_tabs', array( $this, 'filter_product_data_tabs' ), 99, 2 );
52
+
53
+ // Vendor Capabilities
54
+ // Duplicate product
55
+ add_filter( 'woocommerce_duplicate_product_capability', array( $this, 'add_duplicate_capability' ) );
56
+
57
+ // WC > Product featured
58
+ add_filter( 'manage_product_posts_columns', array( $this, 'manage_product_columns'), 99);
59
+
60
+ }
61
+
62
+ }
63
+
64
+ public function confirm_access_to_add()
65
+ {
66
+ if ( empty( $_GET['post_type'] ) || $_GET['post_type'] != 'product' ) {
67
+ return;
68
+ }
69
+
70
+ $can_submit = 'yes' == get_option( 'wcvendors_capability_products_enabled', 'no' ) ? true : false;
71
+
72
+ if ( ! $can_submit ) {
73
+ wp_die( sprintf( __( 'You are not allowed to submit products. <a href="%s">Go Back</a>', 'wc-vendors' ), admin_url( 'edit.php?post_type=product' ) ) );
74
+ }
75
+ }
76
+
77
+ public function csv_import_suite_compatibility( $capability )
78
+ {
79
+ return 'manage_product';
80
+ }
81
+
82
+ public function csv_import_suite_compatibility_export( $args )
83
+ {
84
+ $args[ 'author' ] = get_current_user_id();
85
+
86
+ return $args;
87
+ }
88
+
89
+ /*
90
+ * Enable/disable duplicate product
91
+ */
92
+ public function add_duplicate_capability( $capability ){
93
+ if ( 'yes' === get_option( 'wcvendors_capability_product_duplicate', 'no' ) ) {
94
+ return 'manage_product';
95
+ }
96
+ return $capability;
97
+ }
98
+
99
+
100
+ /**
101
+ *
102
+ *
103
+ * @param unknown $menu
104
+ *
105
+ * @return unknown
106
+ */
107
+ public function show_pending_number( $menu )
108
+ {
109
+
110
+ $args = array(
111
+ 'post_type' => 'product',
112
+ 'author' => get_current_user_id(),
113
+ 'post_status' => 'pending'
114
+ );
115
+
116
+ if (!WCV_Vendors::is_vendor( get_current_user_id() ) ) unset( $args['author'] );
117
+
118
+ $pending_posts = get_posts( $args );
119
+
120
+ $pending_count = is_array( $pending_posts ) ? count( $pending_posts ) : 0;
121
+
122
+ $menu_str = 'edit.php?post_type=product';
123
+
124
+ foreach ( $menu as $menu_key => $menu_data ) {
125
+
126
+ if ( $menu_str != $menu_data[ 2 ] ) continue;
127
+
128
+ if ($pending_count > 0 ) {
129
+ $menu[ $menu_key ][ 0 ] .= " <span class='update-plugins counting-$pending_count'><span class='plugin-count'>" . number_format_i18n( $pending_count ) . '</span></span>';
130
+ }
131
+ }
132
+
133
+ return $menu;
134
+ }
135
+
136
+ /**
137
+ *
138
+ *
139
+ * @param unknown $types
140
+ * @param unknown $product_type
141
+ *
142
+ * @return unknown
143
+ */
144
+ function filter_product_types( $types ) {
145
+
146
+ $product_types = get_option( 'wcvendors_capability_product_types' );
147
+ $product_misc = array(
148
+ 'taxes' => 'yes' === get_option( 'wcvendors_capability_product_taxes', 'no' ) ? true: false,
149
+ 'sku' => 'yes' === get_option( 'wcvendors_capability_product_sku', 'no' ) ? true: false,
150
+ 'duplicate' => 'yes' === get_option( 'wcvendors_capability_product_duplicate', 'no' ) ? true: false,
151
+ 'delete' => 'yes' === get_option( 'wcvendors_capability_product_delete', 'no' ) ? true: false,
152
+ 'featured' => 'yes' === get_option( 'wcvendors_capability_product_featured', 'no' ? true: false)
153
+ );
154
+
155
+ // Add any custom css
156
+ $css = get_option( 'wcvendors_display_advanced_stylesheet' );
157
+ // Filter taxes
158
+ if ( !empty( $product_misc[ 'taxes' ] ) ) {
159
+ $css .= '.form-field._tax_status_field, .form-field._tax_class_field{display:none !important;}';
160
+ }
161
+ unset( $product_misc[ 'taxes' ] );
162
+
163
+ // Filter the rest of the fields
164
+ foreach ( $product_misc as $key => $value ) {
165
+ if ( $value ) $css .= sprintf( '._%s_field{display:none !important;}', $key );
166
+ }
167
+
168
+ echo '<style>';
169
+ echo $css;
170
+ echo '</style>';
171
+
172
+ // Filter product type drop down
173
+ foreach ( $types as $key => $value ) {
174
+ if ( in_array( $key, $product_types ) ){
175
+ unset( $types[ $key ] );
176
+ }
177
+ }
178
+
179
+ return $types;
180
+ }
181
+
182
+ /**
183
+ * Filter the product meta tabs in wp-admin
184
+ * @since 1.9.0
185
+ */
186
+ function filter_product_data_tabs( $tabs ){
187
+
188
+ $product_panel = get_option( 'wcvendors_capability_product_data_tabs' );
189
+
190
+ if ( !$product_panel ) return $tabs;
191
+
192
+ foreach ( $tabs as $key => $value ){
193
+ if ( in_array($key, $product_panel ) ){
194
+ unset( $tabs[ $key ] );
195
+ }
196
+ }
197
+
198
+ return $tabs;
199
+
200
+ } // filter_product_data_tabs()
201
+
202
+
203
+ /**
204
+ *
205
+ *
206
+ * @param unknown $types
207
+ *
208
+ * @return unknown
209
+ */
210
+ function filter_product_type_options( $types )
211
+ {
212
+ $product_options = get_option( 'wcvendors_capability_product_type_options' );
213
+
214
+ if ( !$product_options ) return $types;
215
+
216
+ foreach ( $types as $key => $value ) {
217
+ if ( !empty( $product_options[ $key ] ) ) {
218
+ unset( $types[ $key ] );
219
+ }
220
+ }
221
+
222
+ return $types;
223
+ }
224
+
225
+
226
+ /**
227
+ * Show attachments only belonging to vendor
228
+ *
229
+ * @param object $query
230
+ */
231
+ function show_user_attachment_ajax ( $query ) {
232
+
233
+ $user_id = get_current_user_id();
234
+ if ( $user_id ) {
235
+ $query['author'] = $user_id;
236
+ }
237
+ return $query;
238
+ }
239
+
240
+ /**
241
+ * Show attachments only belonging to vendor
242
+ *
243
+ * @param object $query
244
+ */
245
+ function show_user_attachment_page ( $query ) {
246
+
247
+ global $current_user, $pagenow;
248
+
249
+ if ( !is_a( $current_user, 'WP_User') )
250
+ return;
251
+
252
+ if ( 'upload.php' != $pagenow && 'media-upload.php' != $pagenow)
253
+ return;
254
+
255
+ if ( !current_user_can('delete_pages') )
256
+ $query->set('author', $current_user->ID );
257
+
258
+ return;
259
+ }
260
+
261
+ /**
262
+ * Allow vendors to access admin when disabled
263
+ */
264
+ public function prevent_admin_access()
265
+ {
266
+ $permitted_user = ( current_user_can( 'edit_posts' ) || current_user_can( 'manage_woocommerce' ) || current_user_can( 'vendor' ) );
267
+
268
+ if ( get_option( 'woocommerce_lock_down_admin' ) == 'yes' && !is_ajax() && !$permitted_user ) {
269
+ wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
270
+ exit;
271
+ }
272
+ }
273
+
274
+ public function deny_admin_access()
275
+ {
276
+ return false;
277
+ }
278
+
279
+
280
+ /**
281
+ * Request when load-edit.php
282
+ */
283
+ public function edit_nonvendors()
284
+ {
285
+ add_action( 'request', array( $this, 'hide_nonvendor_products' ) );
286
+ }
287
+
288
+
289
+ /**
290
+ * Hide links that don't matter anymore from vendors
291
+ *
292
+ * @param array $views
293
+ *
294
+ * @return array
295
+ */
296
+ public function hide_nonvendor_links( $views )
297
+ {
298
+ return array();
299
+ }
300
+
301
+
302
+ /**
303
+ * Hide products that don't belong to the vendor
304
+ *
305
+ * @param array $query_vars
306
+ *
307
+ * @return array
308
+ */
309
+ public function hide_nonvendor_products( $query_vars )
310
+ {
311
+ if (array_key_exists('post_type', $query_vars) && ($query_vars['post_type'] == 'product')) {
312
+ $query_vars[ 'author' ] = get_current_user_id();
313
+ }
314
+
315
+ return $query_vars;
316
+ }
317
+
318
+
319
+ /**
320
+ * Remove the media library menu
321
+ */
322
+ public function remove_menu_page(){
323
+ global $pagenow;
324
+
325
+ remove_menu_page( 'index.php' ); /* Hides Dashboard menu */
326
+ remove_menu_page( 'separator1' ); /* Hides separator under Dashboard menu*/
327
+ remove_all_actions( 'admin_notices' );
328
+
329
+ $can_submit = 'yes' == get_option( 'wcvendors_capability_products_enabled' ) ? true : false;
330
+
331
+ if ( ! $can_submit ) {
332
+ global $submenu;
333
+ unset($submenu['edit.php?post_type=product'][10]);
334
+ }
335
+
336
+ if ( $pagenow == 'index.php' ) {
337
+ wp_redirect( admin_url( 'profile.php' ) );
338
+ }
339
+ }
340
+
341
+
342
+ /**
343
+ *
344
+ */
345
+ public function remove_meta_boxes()
346
+ {
347
+ remove_meta_box( 'postcustom', 'product', 'normal' );
348
+ remove_meta_box( 'wpseo_meta', 'product', 'normal' );
349
+ remove_meta_box( 'expirationdatediv', 'product', 'side' );
350
+ }
351
+
352
+
353
+ /**
354
+ * Update the vendor PayPal email
355
+ *
356
+ * @param int $vendor_id
357
+ *
358
+ * @return bool
359
+ */
360
+ public function save_extra_profile_fields( $vendor_id )
361
+ {
362
+ if ( !current_user_can( 'edit_user', $vendor_id ) ) return false;
363
+
364
+ if ( ! WCV_Vendors::is_pending( $vendor_id ) && ! WCV_Vendors::is_vendor( $vendor_id ) ) { return; }
365
+
366
+ $users = get_users( array( 'meta_key' => 'pv_shop_slug', 'meta_value' => sanitize_title( $_POST[ 'pv_shop_name' ] ) ) );
367
+ if ( empty( $users ) || $users[ 0 ]->ID == $vendor_id ) {
368
+ update_user_meta( $vendor_id, 'pv_shop_name', $_POST[ 'pv_shop_name' ] );
369
+ update_user_meta( $vendor_id, 'pv_shop_slug', sanitize_title( $_POST[ 'pv_shop_name' ] ) );
370
+ }
371
+
372
+ update_user_meta( $vendor_id, 'pv_paypal', $_POST[ 'pv_paypal' ] );
373
+ update_user_meta( $vendor_id, 'pv_shop_html_enabled', isset( $_POST[ 'pv_shop_html_enabled' ] ) );
374
+ update_user_meta( $vendor_id, 'pv_custom_commission_rate', $_POST[ 'pv_custom_commission_rate' ] );
375
+ update_user_meta( $vendor_id, 'pv_shop_description', $_POST[ 'pv_shop_description' ] );
376
+ update_user_meta( $vendor_id, 'pv_seller_info', $_POST[ 'pv_seller_info' ] );
377
+ update_user_meta( $vendor_id, 'wcv_give_vendor_tax', isset( $_POST[ 'wcv_give_vendor_tax' ] ) );
378
+ update_user_meta( $vendor_id, 'wcv_give_vendor_shipping', isset( $_POST[ 'wcv_give_vendor_shipping' ] ) );
379
+
380
+ // Bank details
381
+ update_user_meta( $vendor_id, 'wcv_bank_account_name', $_POST['wcv_bank_account_name'] );
382
+ update_user_meta( $vendor_id, 'wcv_bank_account_number', $_POST['wcv_bank_account_number'] );
383
+ update_user_meta( $vendor_id, 'wcv_bank_name', $_POST['wcv_bank_name'] );
384
+ update_user_meta( $vendor_id, 'wcv_bank_routing_number', $_POST['wcv_bank_routing_number'] );
385
+ update_user_meta( $vendor_id, 'wcv_bank_iban', $_POST['wcv_bank_iban'] );
386
+ update_user_meta( $vendor_id, 'wcv_bank_bic_swift', $_POST['wcv_bank_bic_swift'] );
387
+
388
+ do_action( 'wcvendors_update_admin_user', $vendor_id );
389
+ }
390
+
391
+
392
+ /**
393
+ * Show the PayPal field and commision due table
394
+ *
395
+ * @param unknown $user
396
+ */
397
+ public function show_extra_profile_fields( $user ) {
398
+
399
+ if ( ! WCV_Vendors::is_vendor( $user->ID ) && ! WCV_Vendors::is_pending( $user->ID ) ) {
400
+ return;
401
+ }
402
+
403
+ include( apply_filters( 'wcvendors_vendor_meta_partial', WCV_ABSPATH_ADMIN . 'views/html-vendor-meta.php' ) );
404
+ }
405
+
406
+ /*
407
+ Manage product columns on product page
408
+ */
409
+ public function manage_product_columns( $columns ){
410
+
411
+ // Featured Product
412
+ if ( 'yes' !== get_option( 'wcvendors_capability_product_featured', 'no' ) ) {
413
+ unset($columns['featured']);
414
+ }
415
+
416
+ // SKU
417
+ if ( 'yes' === get_option( 'wcvendors_capability_product_sku', 'no' ) ) {
418
+ unset($columns['sku']);
419
+ }
420
+
421
+
422
+ return $columns;
423
+ }
424
+
425
+ }
trunk/classes/admin/class-product-meta.php ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Product meta configurations
5
+ *
6
+ * @package ProductVendor
7
+ */
8
+
9
+
10
+ class WCV_Product_Meta
11
+ {
12
+
13
+
14
+ /**
15
+ * Constructor
16
+ */
17
+ function __construct()
18
+ {
19
+ if ( !current_user_can( 'manage_woocommerce' ) ) return;
20
+
21
+ // Allow products to have authors
22
+ add_post_type_support( 'product', 'author' );
23
+
24
+ add_action( 'add_meta_boxes', array( $this, 'change_author_meta_box_title' ) );
25
+ add_action( 'wp_dropdown_users', array( $this, 'author_vendor_roles' ), 0, 1 );
26
+ if ( apply_filters( 'wcv_product_commission_tab', true ) ) {
27
+ add_action( 'woocommerce_product_write_panel_tabs', array( $this, 'add_tab' ) );
28
+ add_action( 'woocommerce_product_data_panels', array( $this, 'add_panel' ) );
29
+ add_action( 'woocommerce_process_product_meta', array( $this, 'save_panel' ) );
30
+ }
31
+
32
+ add_action( 'woocommerce_product_quick_edit_end', array($this, 'display_vendor_dd_quick_edit') );
33
+ add_action( 'woocommerce_product_quick_edit_save', array($this, 'save_vendor_quick_edit'), 2, 99 );
34
+ add_action( 'manage_product_posts_custom_column', array($this, 'display_vendor_column'), 2, 99 );
35
+ add_filter( 'manage_product_posts_columns', array($this, 'vendor_column_quickedit') );
36
+
37
+ }
38
+
39
+
40
+ /**
41
+ * Change the "Author" metabox to "Vendor"
42
+ */
43
+ public function change_author_meta_box_title()
44
+ {
45
+ global $wp_meta_boxes;
46
+ $wp_meta_boxes[ 'product' ][ 'normal' ][ 'core' ][ 'authordiv' ][ 'title' ] = wcv_get_vendor_name();
47
+ }
48
+
49
+
50
+ /**
51
+ * Override the authors selectbox with +vendor roles
52
+ *
53
+ * @param html $output
54
+ *
55
+ * @return html
56
+ */
57
+ public function author_vendor_roles( $output )
58
+ {
59
+ global $post;
60
+
61
+ if ( empty( $post ) ) return $output;
62
+
63
+ // Return if this isn't a WooCommerce product post type
64
+ if ( $post->post_type != 'product' ) return $output;
65
+
66
+ // Return if this isn't the vendor author override dropdown
67
+ if ( !strpos( $output, 'post_author_override' ) ) return $output;
68
+
69
+ $args = array(
70
+ 'selected' => $post->post_author,
71
+ 'id' => 'post_author_override',
72
+ );
73
+
74
+ $output = $this->vendor_selectbox( $args );
75
+
76
+ return $output;
77
+ }
78
+
79
+
80
+ /**
81
+ * Create a selectbox to display vendor & administrator roles
82
+ *
83
+ * @param array $args
84
+ *
85
+ * @return html
86
+ */
87
+ public function vendor_selectbox( $args )
88
+ {
89
+ $default_args = array(
90
+ 'placeholder',
91
+ 'id',
92
+ 'class',
93
+ );
94
+
95
+ foreach ( $default_args as $key ) {
96
+ if ( !is_array( $key ) && empty( $args[ $key ] ) ) $args[ $key ] = '';
97
+ else if ( is_array( $key ) ) foreach ( $key as $val ) $args[ $key ][ $val ] = esc_attr( $args[ $key ][ $val ] );
98
+ }
99
+ extract( $args );
100
+
101
+ $roles = array( 'vendor', 'administrator' );
102
+ $user_args = array( 'fields' => array( 'ID', 'user_login' ) );
103
+
104
+ $output = "<select style='width:200px;' name='$id' id='$id' class='$class' data-placeholder='$placeholder'>\n";
105
+ $output .= "\t<option value=''></option>\n";
106
+
107
+ foreach ( $roles as $role ) {
108
+
109
+ $new_args = $user_args;
110
+ $new_args[ 'role' ] = $role;
111
+ $users = get_users( $new_args );
112
+
113
+ if ( empty( $users ) ) continue;
114
+ foreach ( (array) $users as $user ) {
115
+ $select = selected( $user->ID, $selected, false );
116
+ $output .= "\t<option value='$user->ID' $select>$user->user_login</option>\n";
117
+ }
118
+
119
+ }
120
+ $output .= "</select>";
121
+
122
+ // Convert this selectbox with select2
123
+ $output .= '
124
+ <script type="text/javascript">jQuery(function() { jQuery("#' . $id . '").select2(); } );</script>';
125
+
126
+ return $output;
127
+ }
128
+
129
+
130
+ /**
131
+ * Save commission rate of a product
132
+ *
133
+ * @param int $post_id
134
+ */
135
+ public function save_panel( $post_id )
136
+ {
137
+ if ( isset( $_POST[ 'pv_commission_rate' ] ) ) {
138
+ update_post_meta( $post_id, 'pv_commission_rate', is_numeric( $_POST[ 'pv_commission_rate' ] ) ? (float) $_POST[ 'pv_commission_rate' ] : false );
139
+ }
140
+
141
+ }
142
+
143
+
144
+ /**
145
+ * Add the Commission tab to a product
146
+ */
147
+ public function add_tab()
148
+ {
149
+ ?>
150
+ <li class="commission_tab">
151
+ <a href="#commission"><?php _e( 'Commission', 'wc-vendors' ) ?></a>
152
+ </li> <?php
153
+ }
154
+
155
+
156
+ /**
157
+ * Add the Commission panel to a product
158
+ */
159
+ public function add_panel()
160
+ {
161
+ global $post; ?>
162
+
163
+ <div id="commission" class="panel woocommerce_options_panel">
164
+ <fieldset>
165
+
166
+ <p class='form-field commission_rate_field'>
167
+ <label for='pv_commission_rate'><?php _e( 'Commission', 'wc-vendors' ); ?> (%)</label>
168
+ <input type='number' id='pv_commission_rate'
169
+ name='pv_commission_rate'
170
+ class='short'
171
+ max="100"
172
+ min="0"
173
+ step='any'
174
+ placeholder='<?php _e( 'Leave blank for default', 'wc-vendors' ); ?>'
175
+ value="<?php echo get_post_meta( $post->ID, 'pv_commission_rate', true ); ?>"/>
176
+ </p>
177
+
178
+ </fieldset>
179
+ </div> <?php
180
+
181
+ }
182
+
183
+ /*
184
+ * Rename the Authors column to Vendor on products page
185
+ */
186
+ public function vendor_column_quickedit($posts_columns) {
187
+ $posts_columns['author'] = wcv_get_vendor_name();
188
+
189
+ return $posts_columns;
190
+ }
191
+
192
+ /*
193
+ * Display the vendor drop down on the quick edit screen
194
+ */
195
+ public function display_vendor_dd_quick_edit() {
196
+
197
+ global $post;
198
+ $selected = $post->post_author;
199
+
200
+ $roles = array( 'vendor', 'administrator' );
201
+ $user_args = array( 'fields' => array( 'ID', 'display_name' ) );
202
+
203
+ $output = "<select style='width:200px;' name='post_author-new' class='select'>\n";
204
+
205
+ foreach ( $roles as $role ) {
206
+
207
+ $new_args = $user_args;
208
+ $new_args[ 'role' ] = $role;
209
+ $users = get_users( $new_args );
210
+
211
+ if ( empty( $users ) ) continue;
212
+ foreach ( (array) $users as $user ) {
213
+ $select = selected( $user->ID, $selected, false );
214
+ $output .= "\t<option value='$user->ID' $select>$user->display_name</option>\n";
215
+ }
216
+
217
+ }
218
+ $output .= "</select>";
219
+
220
+ ?>
221
+ <br class="clear" />
222
+ <label class="inline-edit-author-new">
223
+ <span class="title"><?php _e('Vendor', 'wc-vendors' ); ?></span>
224
+ <?php echo $output; ?>
225
+ </label>
226
+ <?php
227
+ }
228
+
229
+
230
+ /*
231
+ * Save the vendor on the quick edit screen
232
+ */
233
+ public function save_vendor_quick_edit( $product ) {
234
+
235
+ if ( $product->is_type('simple') || $product->is_type('external') ) {
236
+ if ( isset( $_REQUEST['_vendor'] ) ) {
237
+ $vendor = wc_clean($_REQUEST['_vendor']);
238
+ $post = get_post( $product->get_id() );
239
+ $post->post_author = $vendor;
240
+ }
241
+ }
242
+ return $product;
243
+ }
244
+
245
+ /*
246
+ * Display hidden column data for js
247
+ */
248
+ public function display_vendor_column( $column, $post_id ){
249
+
250
+ $vendor = get_post_field( 'post_author', $post_id );
251
+
252
+ switch ( $column ) {
253
+ case 'name' :
254
+
255
+ ?>
256
+ <div class="hidden vendor" id="vendor_<?php echo $post_id; ?>">
257
+ <div id="post_author"><?php echo $vendor; ?></div>
258
+ </div>
259
+ <?php
260
+
261
+ break;
262
+
263
+ default :
264
+ break;
265
+ }
266
+
267
+ }
268
+ }
trunk/classes/admin/class-setup-wizard.php ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Admin setup wziard
4
+ *
5
+ * @author WooCommerce, Jamie Madden, WC Vendors
6
+ * @category Admin
7
+ * @package WCVendors/Admin
8
+ * @version 2.0.0
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ /**
16
+ * WCVendors_Admin_Setup_Wizard class.
17
+ */
18
+ class WCVendors_Admin_Setup_Wizard {
19
+
20
+ /**
21
+ * Current step
22
+ *
23
+ * @var string
24
+ */
25
+ private $step = '';
26
+
27
+ /**
28
+ * Steps for the setup wizard
29
+ *
30
+ * @var array
31
+ */
32
+ private $steps = array();
33
+
34
+ /**
35
+ * Actions to be executed after the HTTP response has completed
36
+ *
37
+ * @var array
38
+ */
39
+ private $deferred_actions = array();
40
+
41
+ /**
42
+ * Hook in tabs.
43
+ */
44
+ public function __construct() {
45
+
46
+ if ( apply_filters( 'wcv_enable_setup_wizard', true ) && current_user_can( 'manage_woocommerce' ) ) {
47
+ add_action( 'admin_menu', array( $this, 'admin_menus' ) );
48
+ add_action( 'admin_init', array( $this, 'setup_wizard' ) );
49
+ }
50
+ }
51
+
52
+ /**
53
+ * Add admin menus/screens.
54
+ */
55
+ public function admin_menus() {
56
+ add_dashboard_page( '', '', 'manage_options', 'wcv-setup', '' );
57
+ }
58
+
59
+ /**
60
+ * Show the setup wizard.
61
+ */
62
+ public function setup_wizard() {
63
+
64
+ if ( empty( $_GET['page'] ) || 'wcv-setup' !== $_GET['page'] ) {
65
+ return;
66
+ }
67
+ $default_steps = array(
68
+ 'store_setup' => array(
69
+ 'name' => __( 'Start', 'wc-vendors' ),
70
+ 'view' => array( $this, 'wcv_setup_general' ),
71
+ 'handler' => array( $this, 'wcv_setup_general_save' ),
72
+ ),
73
+ 'capabilities' => array(
74
+ 'name' => __( 'Capabilities', 'wc-vendors' ),
75
+ 'view' => array( $this, 'wcv_setup_capabilities' ),
76
+ 'handler' => array( $this, 'wcv_setup_capabilities_save' ),
77
+ ),
78
+ 'shipping' => array(
79
+ 'name' => __( 'Pages', 'wc-vendors' ),
80
+ 'view' => array( $this, 'wcv_setup_pages' ),
81
+ 'handler' => array( $this, 'wcv_setup_pages_save' ),
82
+ ),
83
+ 'ready' => array(
84
+ 'name' => __( 'Ready!', 'wc-vendors' ),
85
+ 'view' => array( $this, 'wcv_setup_ready' ),
86
+ 'handler' => '',
87
+ ),
88
+ );
89
+
90
+ $this->steps = apply_filters( 'wcv_setup_wizard_steps', $default_steps );
91
+ $this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) );
92
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
93
+
94
+ wp_register_script( 'jquery-blockui', WC()->plugin_url() . '/assets/js/jquery-blockui/jquery.blockUI' . $suffix . '.js', array( 'jquery' ), '2.70', true );
95
+ wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.0' );
96
+ wp_register_script( 'wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array( 'jquery', 'selectWoo' ), WC_VERSION );
97
+ wp_localize_script( 'wc-enhanced-select', 'wc_enhanced_select_params', array(
98
+ 'i18n_no_matches' => _x( 'No matches found', 'enhanced select', 'wcvendors' ),
99
+ 'i18n_ajax_error' => _x( 'Loading failed', 'enhanced select', 'wcvendors' ),
100
+ 'i18n_input_too_short_1' => _x( 'Please enter 1 or more characters', 'enhanced select', 'wcvendors' ),
101
+ 'i18n_input_too_short_n' => _x( 'Please enter %qty% or more characters', 'enhanced select', 'wcvendors' ),
102
+ 'i18n_input_too_long_1' => _x( 'Please delete 1 character', 'enhanced select', 'wcvendors' ),
103
+ 'i18n_input_too_long_n' => _x( 'Please delete %qty% characters', 'enhanced select', 'wcvendors' ),
104
+ 'i18n_selection_too_long_1' => _x( 'You can only select 1 item', 'enhanced select', 'wcvendors' ),
105
+ 'i18n_selection_too_long_n' => _x( 'You can only select %qty% items', 'enhanced select', 'wcvendors' ),
106
+ 'i18n_load_more' => _x( 'Loading more results&hellip;', 'enhanced select', 'wcvendors' ),
107
+ 'i18n_searching' => _x( 'Searching&hellip;', 'enhanced select', 'wcvendors' ),
108
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
109
+ 'search_products_nonce' => wp_create_nonce( 'search-products' ),
110
+ 'search_customers_nonce' => wp_create_nonce( 'search-customers' ),
111
+ ) );
112
+ // @todo fix the select2 styles in our admin.css
113
+ wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION );
114
+
115
+ wp_enqueue_style( 'wcv-setup', wcv_assets_url . 'css/wcv-setup.css', array( 'dashicons', 'install' ), WCV_VERSION );
116
+ wp_register_script( 'wcv-setup', wcv_assets_url . 'js/admin/wcv-setup.js', array( 'jquery', 'wc-enhanced-select', 'jquery-blockui', 'wp-util' ), WCV_VERSION );
117
+
118
+ if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) {
119
+ call_user_func( $this->steps[ $this->step ]['handler'], $this );
120
+ }
121
+
122
+ ob_start();
123
+ $this->setup_wizard_header();
124
+ $this->setup_wizard_steps();
125
+ $this->setup_wizard_content();
126
+ $this->setup_wizard_footer();
127
+ exit;
128
+ }
129
+
130
+ /**
131
+ * Get the URL for the next step's screen.
132
+ *
133
+ * @param string $step slug (default: current step).
134
+ * @return string URL for next step if a next step exists.
135
+ * Admin URL if it's the last step.
136
+ * Empty string on failure.
137
+ * @since 2.0.0
138
+ */
139
+ public function get_next_step_link( $step = '' ) {
140
+ if ( ! $step ) {
141
+ $step = $this->step;
142
+ }
143
+
144
+ $keys = array_keys( $this->steps );
145
+ if ( end( $keys ) === $step ) {
146
+ return admin_url();
147
+ }
148
+
149
+ $step_index = array_search( $step, $keys );
150
+ if ( false === $step_index ) {
151
+ return '';
152
+ }
153
+
154
+ return add_query_arg( 'step', $keys[ $step_index + 1 ], remove_query_arg( 'activate_error' ) );
155
+ }
156
+
157
+ /**
158
+ * Setup Wizard Header.
159
+ */
160
+ public function setup_wizard_header() {
161
+
162
+ include( WCV_ABSPATH_ADMIN . 'views/setup/header.php' );
163
+ }
164
+
165
+ /**
166
+ * Setup Wizard Footer.
167
+ */
168
+ public function setup_wizard_footer() {
169
+ include( WCV_ABSPATH_ADMIN . 'views/setup/footer.php' );
170
+ }
171
+
172
+ /**
173
+ * Output the steps.
174
+ */
175
+ public function setup_wizard_steps() {
176
+ $output_steps = $this->steps;
177
+ include( WCV_ABSPATH_ADMIN . 'views/setup/steps.php' );
178
+ }
179
+
180
+ /**
181
+ * Output the content for the current step.
182
+ */
183
+ public function setup_wizard_content() {
184
+ echo '<div class="wcv-setup-content">';
185
+ if ( ! empty( $this->steps[ $this->step ]['view'] ) ) {
186
+ call_user_func( $this->steps[ $this->step ]['view'], $this );
187
+ }
188
+ echo '</div>';
189
+ }
190
+
191
+ /**
192
+ * Helper method to retrieve the current user's email address.
193
+ *
194
+ * @return string Email address
195
+ */
196
+ protected function get_current_user_email() {
197
+ $current_user = wp_get_current_user();
198
+ $user_email = $current_user->user_email;
199
+
200
+ return $user_email;
201
+ }
202
+
203
+ /**
204
+ * Initial "marketplace setup" step.
205
+ * Vendor registration, taxes and shipping
206
+ */
207
+ public function wcv_setup_general() {
208
+
209
+ $allow_registration = get_option( 'wcvendors_vendor_allow_registration', 'yes' );
210
+ $manual_approval = get_option( 'wcvendors_vendor_approve_registration', 'yes' );
211
+ $vendor_taxes = get_option( 'wcvendors_vendor_give_taxes', 'yes' );
212
+ $vendor_shipping = get_option( 'wcvendors_vendor_give_shipping', 'yes' );
213
+ $commission_rate = get_option( 'wcvendors_vendor_commission_rate' );
214
+
215
+ include( WCV_ABSPATH_ADMIN . 'views/setup/general.php' );
216
+ }
217
+
218
+ /**
219
+ * Save initial marketplace settings.
220
+ */
221
+ public function wcv_setup_general_save() {
222
+
223
+ check_admin_referer( 'wcv-setup' );
224
+
225
+ $allow_registration = isset( $_POST[ 'wcv_vendor_allow_registration' ] ) ? sanitize_text_field( $_POST[ 'wcv_vendor_allow_registration' ] ) : '';
226
+ $manual_approval = isset( $_POST[ 'wcv_vendor_approve_registration'] ) ? sanitize_text_field( $_POST[ 'wcv_vendor_approve_registration' ] ) : '';
227
+ $vendor_taxes = isset( $_POST[ 'wcv_vendor_give_taxes' ] ) ? sanitize_text_field( $_POST[ 'wcv_vendor_give_taxes' ] ) : '';
228
+ $vendor_shipping = isset( $_POST[ 'wcv_vendor_give_shipping' ] ) ? sanitize_text_field( $_POST[ 'wcv_vendor_give_shipping' ] ) : '';
229
+ $commission_rate = sanitize_text_field( $_POST[ 'wcv_vendor_commission_rate' ] );
230
+
231
+ update_option( 'wcvendors_vendor_allow_registration', $allow_registration );
232
+ update_option( 'wcvendors_vendor_approve_registration', $manual_approval );
233
+ update_option( 'wcvendors_vendor_give_taxes', $vendor_taxes );
234
+ update_option( 'wcvendors_vendor_give_shipping', $vendor_shipping );
235
+ update_option( 'wcvendors_vendor_commission_rate', $commission_rate );
236
+
237
+ WCVendors_Install::create_pages();
238
+ wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
239
+ exit;
240
+ }
241
+
242
+ /**
243
+ * General setup
244
+ * Vendor registration, taxes and shipping
245
+ */
246
+ public function wcv_setup_capabilities() {
247
+
248
+ $products_enabled = get_option( 'wcvendors_capability_products_enabled', 'yes' );
249
+ $live_products = get_option( 'wcvendors_capability_products_edit', 'yes' );
250
+ $products_approval = get_option( 'wcvendors_capability_products_live', 'yes' );
251
+ $orders_enabled = get_option( 'wcvendors_capability_orders_enabled', 'yes' );
252
+ $export_orders = get_option( 'wcvendors_capability_orders_export', 'yes' );
253
+ $view_order_notes = get_option( 'wcvendors_capability_order_read_notes', 'yes' );
254
+ $add_order_notes = get_option( 'wcvendors_capability_order_update_notes', 'yes' );
255
+
256
+ include( WCV_ABSPATH_ADMIN . 'views/setup/capabilities.php' );
257
+ }
258
+
259
+ /**
260
+ * Save capabilities settings.
261
+ */
262
+ public function wcv_setup_capabilities_save() {
263
+
264
+ check_admin_referer( 'wcv-setup' );
265
+
266
+ $products_enabled = isset( $_POST[ 'wcv_capability_products_enabled' ] ) ? sanitize_text_field( $_POST[ 'wcv_capability_products_enabled' ] ) : '';
267
+ $live_products = isset( $_POST[ 'wcv_capability_products_edit' ] ) ? sanitize_text_field( $_POST[ 'wcv_capability_products_edit' ] ) : '';
268
+ $products_approval = isset( $_POST[ 'wcv_capability_products_live' ] ) ? sanitize_text_field( $_POST[ 'wcv_capability_products_live' ] ) : '';
269
+ $orders_enabled = isset( $_POST[ 'wcv_capability_orders_enabled' ] ) ? sanitize_text_field( $_POST[ 'wcv_capability_orders_enabled' ] ) : '';
270
+ $export_orders = isset( $_POST[ 'wcv_capability_orders_export' ] ) ? sanitize_text_field( $_POST[ 'wcv_capability_orders_export' ] ) : '';
271
+ $view_order_notes = isset( $_POST[ 'wcv_capability_order_read_notes' ] ) ? sanitize_text_field( $_POST[ 'wcv_capability_order_read_notes' ] ) : '';
272
+ $add_order_notes = isset( $_POST[ 'wcv_capability_order_update_notes' ] ) ? sanitize_text_field( $_POST[ 'wcv_capability_order_update_notes' ] ) : '';
273
+
274
+ update_option( 'wcvendors_capability_products_enabled', $products_enabled );
275
+ update_option( 'wcvendors_capability_products_edit', $live_products );
276
+ update_option( 'wcvendors_capability_products_live', $products_approval );
277
+ update_option( 'wcvendors_capability_orders_enabled', $orders_enabled );
278
+ update_option( 'wcvendors_capability_orders_export', $export_orders );
279
+ update_option( 'wcvendors_capability_order_read_notes', $view_order_notes );
280
+ update_option( 'wcvendors_capability_order_update_notes', $add_order_notes );
281
+
282
+ wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
283
+ exit;
284
+ }
285
+
286
+ /**
287
+ * Initial "marketplace setup" step.
288
+ * Vendor registration, taxes and shipping
289
+ */
290
+ public function wcv_setup_pages() {
291
+
292
+ $vendor_dashboard_page_id = get_option( 'wcvendors_vendor_dashboard_page_id' );
293
+ $shop_settings_page_id = get_option( 'wcvendors_shop_settings_page_id' );
294
+ $product_orders_page_id = get_option( 'wcvendors_product_orders_page_id' );
295
+ $vendors_page_id = get_option( 'wcvendors_vendors_page_id' );
296
+ $terms_page_id = get_option( 'wcvendors_vendor_terms_page_id' );
297
+
298
+ include( WCV_ABSPATH_ADMIN . 'views/setup/pages.php' );
299
+ }
300
+
301
+ /**
302
+ * Initial "marketplace setup" step.
303
+ * Vendor registration, taxes and shipping
304
+ */
305
+ public function wcv_setup_pages_save() {
306
+
307
+
308
+ $vendor_dashboard_page_id = sanitize_text_field( $_POST[ 'wcvendors_vendor_dashboard_page_id' ] );
309
+ $shop_settings_page_id = sanitize_text_field( $_POST[ 'wcvendors_shop_settings_page_id' ] );
310
+ $product_orders_page_id = sanitize_text_field( $_POST[ 'wcvendors_product_orders_page_id' ] );
311
+ $vendors_page_id = sanitize_text_field( $_POST[ 'wcvendors_vendors_page_id' ] );
312
+ $terms_page_id = sanitize_text_field( $_POST[ 'wcvendors_vendor_terms_page_id' ] );
313
+
314
+ update_option( 'wcvendors_vendor_dashboard_page_id', $vendor_dashboard_page_id );
315
+ update_option( 'wcvendors_shop_settings_page_id', $shop_settings_page_id );
316
+ update_option( 'wcvendors_product_orders_page_id', $product_orders_page_id );
317
+ update_option( 'wcvendors_vendors_page_id', $vendors_page_id );
318
+ update_option( 'wcvendors_vendor_terms_page_id', $terms_page_id );
319
+
320
+ wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
321
+ exit;
322
+
323
+ }
324
+
325
+ /**
326
+ * Final step.
327
+ */
328
+ public function wcv_setup_ready() {
329
+
330
+ WCVendors_Admin_Notices::remove_notice( 'install' );
331
+ WCVendors_Install::update_db_version();
332
+ flush_rewrite_rules();
333
+
334
+ $user_email = $this->get_current_user_email();
335
+ $forums = 'https://wordpress.org/support/plugin/wc-vendors';
336
+ $docs_url = 'https://docs.wcvendors.com/?utm_source=setup_wizard&utm_medium=plugin&utm_campaign=setup_complete';
337
+ $help_text = sprintf(
338
+ /* translators: %1$s: link to videos, %2$s: link to docs */
339
+ __( 'Don\'t forget to check our <a href="%1$s" target="_blank">documentation</a> to learn more about setting up WC Vendors and if you need help, be sure to visit our <a href="%2$s" target="_blank">free support forums</a>.', 'wc-vendors' ),
340
+ $docs_url,
341
+ $forums
342
+ );
343
+
344
+ include( WCV_ABSPATH_ADMIN . 'views/setup/ready.php' );
345
+ }
346
+ }
347
+
348
+ new WCVendors_Admin_Setup_Wizard();
trunk/classes/admin/class-vendor-admin-dashboard.php ADDED
@@ -0,0 +1,724 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WC Vendor Admin Dashboard - Vendor WP-Admin Dashboard Pages
4
+ *
5
+ * @author Jamie Madden <http://wcvendors.com / https://github.com/digitalchild>
6
+ * @package WCVendors
7
+ */
8
+
9
+ Class WCV_Vendor_Admin_Dashboard {
10
+
11
+ public $dashboard_error_msg;
12
+
13
+ function __construct(){
14
+ // Add Shop Settings page
15
+ add_action( 'admin_menu', array( $this, 'vendor_dashboard_pages') );
16
+ // Hook into init for form processing
17
+ add_action( 'admin_init', array( $this, 'save_shop_settings' ) );
18
+ add_action( 'admin_head', array( $this, 'admin_enqueue_order_style') );
19
+ }
20
+
21
+ function vendor_dashboard_pages(){
22
+ add_menu_page( __('Shop Settings', 'wc-vendors'), __('Shop Settings', 'wc-vendors'), 'manage_product', 'wcv-vendor-shopsettings', array( $this, 'settings_page' ) );
23
+ $hook = add_menu_page( __( 'Orders', 'wc-vendors' ), __( 'Orders', 'wc-vendors' ), 'manage_product', 'wcv-vendor-orders', array( 'WCV_Vendor_Admin_Dashboard', 'orders_page' ) );
24
+ add_action( "load-$hook", array( 'WCV_Vendor_Admin_Dashboard', 'add_options' ) );
25
+ }
26
+
27
+ function settings_page() {
28
+ $user_id = get_current_user_id();
29
+ $paypal_address = true;
30
+ $shop_description = true;
31
+ $description = get_user_meta( $user_id, 'pv_shop_description', true );
32
+ $seller_info = get_user_meta( $user_id, 'pv_seller_info', true );
33
+ $has_html = get_user_meta( $user_id, 'pv_shop_html_enabled', true );
34
+ $shop_page = WCV_Vendors::get_vendor_shop_page( wp_get_current_user()->user_login );
35
+ $global_html = 'yes' === get_option( 'wcvendors_display_shop_description_html', 'no' ) ? true : false;
36
+ include('views/html-vendor-settings-page.php');
37
+ }
38
+
39
+ function admin_enqueue_order_style() {
40
+
41
+ $screen = get_current_screen();
42
+
43
+ if ( ! $screen ) return;
44
+
45
+ $screen_id = $screen->id;
46
+
47
+ if ( 'wcv-vendor-orders' === $screen_id ){
48
+
49
+ add_thickbox();
50
+ wp_enqueue_style( 'admin_order_styles', wcv_assets_url . 'css/admin-orders.css' );
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Save shop settings
56
+ */
57
+ public function save_shop_settings()
58
+ {
59
+ $user_id = get_current_user_id();
60
+ $error = false;
61
+ $error_msg = '';
62
+
63
+ if (isset ( $_POST[ 'wc-vendors-nonce' ] ) ) {
64
+
65
+ if ( !wp_verify_nonce( $_POST[ 'wc-vendors-nonce' ], 'save-shop-settings-admin' ) ) {
66
+ return false;
67
+ }
68
+
69
+ if ( isset( $_POST[ 'pv_paypal' ] ) && '' !== $_POST[ 'pv_paypal' ] ) {
70
+ if ( !is_email( $_POST[ 'pv_paypal' ] ) ) {
71
+ $error_msg .= __( 'Your PayPal address is not a valid email address.', 'wc-vendors' );
72
+ $error = true;
73
+ } else {
74
+ update_user_meta( $user_id, 'pv_paypal', $_POST[ 'pv_paypal' ] );
75
+ }
76
+ } else {
77
+ update_user_meta( $user_id, 'pv_paypal', $_POST[ 'pv_paypal' ] );
78
+ }
79
+
80
+ if ( !empty( $_POST[ 'pv_shop_name' ] ) ) {
81
+ $users = get_users( array( 'meta_key' => 'pv_shop_slug', 'meta_value' => sanitize_title( $_POST[ 'pv_shop_name' ] ) ) );
82
+ if ( !empty( $users ) && $users[ 0 ]->ID != $user_id ) {
83
+ $error_msg .= __( 'That shop name is already taken. Your shop name must be unique.', 'wc-vendors' );
84
+ $error = true;
85
+ } else {
86
+ update_user_meta( $user_id, 'pv_shop_name', $_POST[ 'pv_shop_name' ] );
87
+ update_user_meta( $user_id, 'pv_shop_slug', sanitize_title( $_POST[ 'pv_shop_name' ] ) );
88
+ }
89
+ }
90
+
91
+ if ( isset( $_POST[ 'pv_shop_description' ] ) ) {
92
+ update_user_meta( $user_id, 'pv_shop_description', $_POST[ 'pv_shop_description' ] );
93
+ }
94
+
95
+ if ( isset( $_POST[ 'pv_seller_info' ] ) ) {
96
+ update_user_meta( $user_id, 'pv_seller_info', $_POST[ 'pv_seller_info' ] );
97
+ }
98
+
99
+ // Bank details
100
+ if ( isset( $_POST[ 'wcv_bank_account_name' ] ) ){
101
+ update_user_meta( $user_id, 'wcv_bank_account_name', $_POST['wcv_bank_account_name'] );
102
+ }
103
+ if ( isset( $_POST[ 'wcv_bank_account_number' ] ) ){
104
+ update_user_meta( $user_id, 'wcv_bank_account_name', $_POST['wcv_bank_account_name'] );
105
+ }
106
+ if ( isset( $_POST[ 'wcv_bank_name' ] ) ){
107
+ update_user_meta( $user_id, 'wcv_bank_name', $_POST['wcv_bank_name'] );
108
+ }
109
+ if ( isset( $_POST[ 'wcv_bank_routing_number' ] ) ){
110
+ update_user_meta( $user_id, 'wcv_bank_routing_number', $_POST['wcv_bank_routing_number'] );
111
+ }
112
+ if ( isset( $_POST[ 'wcv_bank_iban' ] ) ){
113
+ update_user_meta( $user_id, 'wcv_bank_iban', $_POST['wcv_bank_iban'] );
114
+ }
115
+ if ( isset( $_POST[ 'wcv_bank_bic_swift' ] ) ){
116
+ update_user_meta( $user_id, 'wcv_bank_bic_swift', $_POST['wcv_bank_bic_swift'] );
117
+ }
118
+
119
+
120
+
121
+ do_action( 'wcvendors_shop_settings_admin_saved', $user_id );
122
+
123
+ if ( ! $error ) {
124
+ add_action( 'admin_notices', array( $this, 'add_admin_notice_success' ) );
125
+ } else {
126
+ $this->dashboard_error_msg = $error_msg;
127
+ add_action( 'admin_notices', array( $this, 'add_admin_notice_error' ) );
128
+ }
129
+ }
130
+ }
131
+
132
+ /**
133
+ * Output a sucessful message after saving the shop settings
134
+ *
135
+ * @since 1.9.9
136
+ * @access public
137
+ */
138
+ public function add_admin_notice_success( ){
139
+
140
+ echo '<div class="updated"><p>';
141
+ echo __( 'Settings saved.', 'wc-vendors' );
142
+ echo '</p></div>';
143
+
144
+ } // add_admin_notice_success()
145
+
146
+ /**
147
+ * Output an error message
148
+ *
149
+ * @since 1.9.9
150
+ * @access public
151
+ */
152
+ public function add_admin_notice_error( ){
153
+
154
+ echo '<div class="error"><p>';
155
+ echo $this->dashboard_error_msg;
156
+ echo '</p></div>';
157
+
158
+ } // add_admin_notice_error()
159
+
160
+ /**
161
+ *
162
+ *
163
+ * @param unknown $status
164
+ * @param unknown $option
165
+ * @param unknown $value
166
+ *
167
+ * @return unknown
168
+ */
169
+ public static function set_table_option( $status, $option, $value )
170
+ {
171
+ if ( $option == 'orders_per_page' ) {
172
+ return $value;
173
+ }
174
+ }
175
+
176
+
177
+ /**
178
+ *
179
+ */
180
+ public static function add_options()
181
+ {
182
+ global $WCV_Vendor_Order_Page;
183
+
184
+ $args = array(
185
+ 'label' => 'Rows',
186
+ 'default' => 10,
187
+ 'option' => 'orders_per_page'
188
+ );
189
+ add_screen_option( 'per_page', $args );
190
+
191
+ $WCV_Vendor_Order_Page = new WCV_Vendor_Order_Page();
192
+
193
+ }
194
+
195
+
196
+ /**
197
+ * HTML setup for the Orders Page
198
+ */
199
+ public static function orders_page()
200
+ {
201
+ global $woocommerce, $WCV_Vendor_Order_Page;
202
+
203
+ $WCV_Vendor_Order_Page->prepare_items();
204
+
205
+ ?>
206
+ <div class="wrap">
207
+
208
+ <div id="icon-woocommerce" class="icon32 icon32-woocommerce-reports"><br/></div>
209
+ <h2><?php _e( 'Orders', 'wc-vendors' ); ?></h2>
210
+
211
+ <form id="posts-filter" method="get">
212
+
213
+ <input type="hidden" name="page" value="wcv-vendor-orders"/>
214
+ <?php $WCV_Vendor_Order_Page->display() ?>
215
+
216
+ </form>
217
+ <div id="ajax-response"></div>
218
+ <br class="clear"/>
219
+ </div>
220
+
221
+ <?php }
222
+
223
+ } // End WCV_Vendor_Admin_Dashboard
224
+
225
+ if ( !class_exists( 'WP_List_Table' ) ) require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
226
+
227
+ /**
228
+ * WCV Vendor Order Page
229
+ *
230
+ * @author Jamie Madden <http://wcvendors.com / https://github.com/digitalchild>
231
+ * @package WCVendors
232
+ * @extends WP_List_Table
233
+ */
234
+ class WCV_Vendor_Order_Page extends WP_List_Table
235
+ {
236
+
237
+ public $index;
238
+
239
+ /**
240
+ * can_view_comments
241
+ *
242
+ * @since 1.0.0
243
+ * @access public
244
+ * @var string $can_view_comments permission check for view comments
245
+ */
246
+ public $can_view_comments;
247
+
248
+
249
+ /**
250
+ * can_add_comments
251
+ *
252
+ * @since 1.0.0
253
+ * @access public
254
+ * @var string $can_add_comments permission check for add comments
255
+ */
256
+ public $can_add_comments;
257
+
258
+
259
+ /**
260
+ * __construct function.
261
+ *
262
+ * @access public
263
+ */
264
+ function __construct()
265
+ {
266
+ global $status, $page;
267
+
268
+ $this->index = 0;
269
+
270
+ //Set parent defaults
271
+ parent::__construct( array(
272
+ 'singular' => __( 'order', 'wc-vendors' ),
273
+ 'plural' => __( 'orders', 'wc-vendors' ),
274
+ 'ajax' => false
275
+ ) );
276
+
277
+ $this->can_view_comments = 'yes' === get_option( 'wcvendors_capability_order_read_notes', 'no' ) ? true : false;
278
+ $this->can_add_comments = 'yes' === get_option( 'wcvendors_capability_order_update_notes', 'no' ) ? true : false;
279
+ }
280
+
281
+
282
+ /**
283
+ * column_default function.
284
+ *
285
+ * @access public
286
+ *
287
+ * @param unknown $item
288
+ * @param mixed $column_name
289
+ *
290
+ * @return unknown
291
+ */
292
+ function column_default( $item, $column_name )
293
+ {
294
+ global $wpdb;
295
+
296
+ switch ( $column_name ) {
297
+ case 'order_id' :
298
+ return $item->order_id;
299
+ case 'customer' :
300
+ return $item->customer;
301
+ case 'products' :
302
+ return $item->products;
303
+ case 'total' :
304
+ return $item->total;
305
+ // case 'comments' :
306
+ // return $item->comments;
307
+ case 'date' :
308
+ return $item->date;
309
+ case 'status' :
310
+ return $item->status;
311
+ default:
312
+ return apply_filters( 'wcvendors_vendor_order_page_column_default', '', $item, $column_name );
313
+ }
314
+ }
315
+
316
+
317
+ /**
318
+ * column_cb function.
319
+ *
320
+ * @access public
321
+ *
322
+ * @param mixed $item
323
+ *
324
+ * @return unknown
325
+ */
326
+ function column_cb( $item )
327
+ {
328
+ return sprintf(
329
+ '<input type="checkbox" name="%1$s[]" value="%2$s" />',
330
+ /*$1%s*/
331
+ 'order_id',
332
+ /*$2%s*/
333
+ $item->order_id
334
+ );
335
+ }
336
+
337
+
338
+ /**
339
+ * get_columns function.
340
+ *
341
+ * @access public
342
+ * @return unknown
343
+ */
344
+ function get_columns()
345
+ {
346
+ $columns = array(
347
+ 'cb' => '<input type="checkbox" />',
348
+ 'order_id' => __( 'Order ID', 'wc-vendors' ),
349
+ 'customer' => __( 'Customer', 'wc-vendors' ),
350
+ 'products' => __( 'Products', 'wc-vendors' ),
351
+ 'total' => __( 'Total', 'wc-vendors' ),
352
+ // 'comments' => __( 'Comments to Customer', 'wc-vendors' ),
353
+ 'date' => __( 'Date', 'wc-vendors' ),
354
+ 'status' => __( 'Shipped', 'wc-vendors' ),
355
+ );
356
+
357
+ if ( !$this->can_view_comments ) unset( $columns['comments'] );
358
+
359
+ return apply_filters( 'wcvendors_vendor_order_page_get_columns', $columns );
360
+
361
+ }
362
+
363
+
364
+ /**
365
+ * get_sortable_columns function.
366
+ *
367
+ * @access public
368
+ * @return unknown
369
+ */
370
+ function get_sortable_columns()
371
+ {
372
+ $sortable_columns = array(
373
+ 'order_id' => array( 'order_id', false ),
374
+ 'total' => array( 'total', false ),
375
+ 'status' => array( 'status', false ),
376
+ );
377
+
378
+ return $sortable_columns;
379
+ }
380
+
381
+
382
+ /**
383
+ * Get bulk actions
384
+ *
385
+ * @return unknown
386
+ */
387
+ function get_bulk_actions()
388
+ {
389
+ $actions = array(
390
+ 'mark_shipped' => apply_filters( 'wcvendors_mark_shipped_label', __( 'Mark shipped', 'wc-vendors' ) ),
391
+ );
392
+
393
+ return $actions;
394
+ }
395
+
396
+
397
+ /**
398
+ * Process bulk actions
399
+ *
400
+ * @return unknown
401
+ */
402
+ function process_bulk_action()
403
+ {
404
+ if ( !isset( $_GET[ 'order_id' ] ) ) return;
405
+
406
+ if (is_array( $_GET[ 'order_id' ] ) ) {
407
+
408
+ $items = array_map( 'intval', $_GET[ 'order_id' ] );
409
+
410
+ switch ( $this->current_action() ) {
411
+ case 'mark_shipped':
412
+
413
+ $result = $this->mark_shipped( $items );
414
+
415
+ if ( $result )
416
+ echo '<div class="updated"><p>' . __( 'Orders marked shipped.', 'wc-vendors' ) . '</p></div>';
417
+ break;
418
+
419
+ default:
420
+ // code...
421
+ break;
422
+ }
423
+
424
+ } else {
425
+
426
+ if ( !isset( $_GET[ 'action' ] ) ) return;
427
+ }
428
+
429
+
430
+ }
431
+
432
+
433
+ /**
434
+ * Mark orders as shipped
435
+ *
436
+ * @param unknown $ids (optional)
437
+ *
438
+ * @version 2.0.0
439
+ * @return unknown
440
+ */
441
+ public function mark_shipped( $ids = array() ){
442
+
443
+ $user_id = get_current_user_id();
444
+
445
+ if ( !empty( $ids ) ) {
446
+
447
+ foreach ($ids as $order_id ) {
448
+ $order = wc_get_order( $order_id );
449
+ $vendors = WCV_Vendors::get_vendors_from_order( $order );
450
+ $vendor_ids = array_keys( $vendors );
451
+
452
+ if ( !in_array( $user_id, $vendor_ids ) ) {
453
+ return;
454
+ }
455
+
456
+ $shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
457
+
458
+ if( !in_array($user_id, $shippers ) ) {
459
+
460
+ $shippers[] = $user_id;
461
+
462
+ if ( !empty( $mails ) ) {
463
+ WC()->mailer()->emails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );
464
+ }
465
+ do_action( 'wcvendors_vendor_ship', $order_id, $user_id, $order );
466
+ }
467
+
468
+ update_post_meta( $order_id, 'wc_pv_shipped', $shippers );
469
+ }
470
+ return true;
471
+ }
472
+ return false;
473
+ }
474
+
475
+
476
+
477
+ /**
478
+ * Get Orders to display in admin
479
+ *
480
+ * @return $orders
481
+ */
482
+ function get_orders() {
483
+
484
+ $user_id = get_current_user_id();
485
+
486
+ $orders = array();
487
+
488
+ $vendor_products = $this->get_vendor_products( $user_id );
489
+
490
+ $products = array();
491
+
492
+ foreach ( $vendor_products as $_product ) {
493
+
494
+ $products[] = $_product->ID;
495
+ }
496
+
497
+ $_orders = $this->get_orders_for_vendor_products( $products );
498
+
499
+ $model_id = 0;
500
+
501
+ if ( !empty( $_orders ) ) {
502
+
503
+ foreach ( $_orders as $order ) {
504
+
505
+ $order = wc_get_order( $order->order_id );
506
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
507
+ $valid_items = WCV_Queries::get_products_for_order( $order_id );
508
+ $valid = array();
509
+
510
+ $items = $order->get_items();
511
+
512
+ foreach ( $items as $order_item_id => $item) {
513
+ if ( in_array( $item[ 'variation_id' ], $valid_items) || in_array( $item[ 'product_id' ], $valid_items ) ) {
514
+ $valid[ $order_item_id ] = $item;
515
+ }
516
+ }
517
+
518
+ $products = '';
519
+
520
+ foreach ( $valid as $order_item_id => $item ) {
521
+
522
+ $wc_product = new WC_Product( $item['product_id'] );
523
+ $products .= '<strong>'. $item['qty'] . ' x ' . $item['name'] . '</strong><br />';
524
+ $_item = $order->get_item( $order_item_id );
525
+ $meta_data = $_item->get_meta_data();
526
+
527
+ if ( !empty( $metadata ) ) {
528
+
529
+ $products .= '<table cellspacing="0" class="wcv_display_meta">';
530
+
531
+ foreach ( $metadata as $meta ) {
532
+
533
+ // Skip hidden core fields
534
+ if ( in_array( $meta['meta_key'], apply_filters( 'woocommerce_hidden_order_itemmeta', array(
535
+ '_qty',
536
+ '_tax_class',
537
+ '_product_id',
538
+ '_variation_id',
539
+ '_line_subtotal',
540
+ '_line_subtotal_tax',
541
+ '_line_total',
542
+ '_line_tax',
543
+ '_vendor_order_item_id',
544
+ '_vendor_commission',
545
+ get_option( 'wcvendors_label_sold_by' ),
546
+ ) ) ) ) {
547
+ continue;
548
+ }
549
+
550
+ // Skip serialised meta
551
+ if ( is_serialized( $meta['meta_value'] ) ) {
552
+ continue;
553
+ }
554
+
555
+ // Get attribute data
556
+ if ( taxonomy_exists( wc_sanitize_taxonomy_name( $meta['meta_key'] ) ) ) {
557
+ $term = get_term_by( 'slug', $meta['meta_value'], wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
558
+ $meta['meta_key'] = wc_attribute_label( wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
559
+ $meta['meta_value'] = isset( $term->name ) ? $term->name : $meta['meta_value'];
560
+ } else {
561
+ $meta['meta_key'] = apply_filters( 'woocommerce_attribute_label', wc_attribute_label( $meta['meta_key'], $wc_product ), $meta['meta_key'] );
562
+ }
563
+
564
+ $products .= '<tr><th>' . wp_kses_post( rawurldecode( $meta['meta_key'] ) ) . ':</th><td>' . rawurldecode( $meta['meta_value'] ) . '</td></tr>';
565
+ }
566
+ $products .= '</table>';
567
+ }
568
+
569
+ }
570
+
571
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
572
+ $shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
573
+ $shipped = in_array($user_id, $shippers) ? __( 'Yes', 'wc-vendors' ) : __( 'No', 'wc-vendors' ) ;
574
+
575
+ $sum = WCV_Queries::sum_for_orders( array( $order_id ), array('vendor_id' =>get_current_user_id() ), false );
576
+ $sum = reset( $sum );
577
+
578
+ $total = $sum->line_total;
579
+
580
+ $comment_output = '';
581
+
582
+ $order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->order_date : $order->get_date_created();
583
+
584
+ // Make sure the correct address is shown based on the WooCommerce options
585
+ $customer = $order->get_formatted_billing_address();
586
+ if ( ( get_option( 'woocommerce_ship_to_billing_address_only' ) === 'no' ) && ( $order->get_formatted_shipping_address() ) ) {
587
+ $customer = $order->get_formatted_shipping_address();
588
+ }
589
+
590
+ $order_items = array();
591
+ $order_items[ 'order_id' ] = $order_id;
592
+ $order_items[ 'customer' ] = $customer;
593
+ $order_items[ 'products' ] = $products;
594
+ $order_items[ 'total' ] = wc_price( $total );
595
+ $order_items[ 'date' ] = date_i18n( wc_date_format(), strtotime( $order_date ) );
596
+ $order_items[ 'status' ] = $shipped;
597
+
598
+ $orders[] = (object) $order_items;
599
+
600
+ $model_id++;
601
+ }
602
+ }
603
+ return $orders;
604
+
605
+ }
606
+
607
+
608
+ /**
609
+ * Get the vendor products sold
610
+ *
611
+ * @param $user_id - the user_id to get the products of
612
+ *
613
+ * @return unknown
614
+ */
615
+ public function get_vendor_products( $user_id )
616
+ {
617
+ global $wpdb;
618
+
619
+ $vendor_products = array();
620
+ $sql = '';
621
+
622
+ $sql .= "SELECT product_id FROM {$wpdb->prefix}pv_commission WHERE vendor_id = {$user_id} AND status != 'reversed' GROUP BY product_id";
623
+
624
+ $results = $wpdb->get_results( $sql );
625
+
626
+ foreach ( $results as $value ) {
627
+ $ids[ ] = $value->product_id;
628
+ }
629
+
630
+ if ( !empty( $ids ) ) {
631
+ $vendor_products = get_posts(
632
+ array(
633
+ 'numberposts' => -1,
634
+ 'orderby' => 'post_date',
635
+ 'post_type' => array( 'product', 'product_variation' ),
636
+ 'order' => 'DESC',
637
+ 'include' => $ids
638
+ )
639
+ );
640
+ }
641
+
642
+ return $vendor_products;
643
+ }
644
+
645
+
646
+ /**
647
+ * All orders for a specific product
648
+ *
649
+ * @param array $product_ids
650
+ * @param array $args (optional)
651
+ *
652
+ * @return object
653
+ */
654
+ public function get_orders_for_vendor_products( array $product_ids, array $args = array() )
655
+ {
656
+ global $wpdb;
657
+
658
+ if ( empty( $product_ids ) ) return false;
659
+
660
+ $defaults = array(
661
+ 'status' => apply_filters( 'wcvendors_completed_statuses', array( 'completed', 'processing' ) ),
662
+ );
663
+
664
+ $args = wp_parse_args( $args, $defaults );
665
+
666
+
667
+ $sql = "
668
+ SELECT order_id
669
+ FROM {$wpdb->prefix}pv_commission as order_items
670
+ WHERE product_id IN ('" . implode( "','", $product_ids ) . "')
671
+ AND status != 'reversed'
672
+ ";
673
+
674
+ if ( !empty( $args[ 'vendor_id' ] ) ) {
675
+ $sql .= "
676
+ AND vendor_id = {$args['vendor_id']}
677
+ ";
678
+ }
679
+
680
+ $sql .= "
681
+ GROUP BY order_id
682
+ ORDER BY time DESC
683
+ ";
684
+
685
+ $orders = $wpdb->get_results( $sql );
686
+
687
+ return $orders;
688
+ }
689
+
690
+
691
+
692
+ /**
693
+ * prepare_items function.
694
+ *
695
+ * @access public
696
+ */
697
+ function prepare_items()
698
+ {
699
+
700
+
701
+ /**
702
+ * Init column headers
703
+ */
704
+ $this->_column_headers = $this->get_column_info();
705
+
706
+
707
+ /**
708
+ * Process bulk actions
709
+ */
710
+ $this->process_bulk_action();
711
+
712
+ /**
713
+ * Get items
714
+ */
715
+
716
+ $this->items = $this->get_orders();
717
+
718
+ /**
719
+ * Pagination
720
+ */
721
+ }
722
+
723
+
724
+ }
trunk/classes/admin/class-vendor-applicants.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class WCV_Vendor_Applicants
7
+ {
8
+
9
+ function __construct()
10
+ {
11
+ add_filter( 'user_row_actions', array( $this, 'user_row_actions' ), 10, 2 );
12
+ add_filter( 'load-users.php', array( $this, 'user_row_actions_commit' ) );
13
+ }
14
+
15
+ /**
16
+ *
17
+ *
18
+ * @param unknown $actions
19
+ * @param unknown $user_object
20
+ *
21
+ * @return unknown
22
+ */
23
+ function user_row_actions( $actions, $user_object )
24
+ {
25
+
26
+ if ( in_array( 'pending_vendor', $user_object->roles ) ){
27
+ $actions[ 'approve_vendor' ] = "<a href='?role=pending_vendor&action=approve_vendor&user_id=" . $user_object->ID . "'>" . __( 'Approve', 'cgc_ub' ) . "</a>";
28
+ $actions[ 'deny_vendor' ] = "<a href='?role=pending_vendor&action=deny_vendor&user_id=" . $user_object->ID . "'>" . __( 'Deny', 'cgc_ub' ) . "</a>";
29
+ }
30
+
31
+ return $actions;
32
+ }
33
+
34
+
35
+ /**
36
+ *
37
+ */
38
+ public function user_row_actions_commit()
39
+ {
40
+ if ( !empty( $_GET[ 'action' ] ) && !empty( $_GET[ 'user_id' ] ) ) {
41
+
42
+ $wp_user_object = new WP_User( (int) $_GET[ 'user_id' ] );
43
+
44
+ switch ( $_GET[ 'action' ] ) {
45
+ case 'approve_vendor':
46
+ $role = 'vendor';
47
+ add_action( 'admin_notices', array( $this, 'approved' ) );
48
+ do_action( 'wcvendors_approve_vendor', $wp_user_object );
49
+ break;
50
+
51
+ case 'deny_vendor':
52
+ $role = apply_filters( 'wcvendors_denied_vendor_role', 'subscriber' );
53
+ add_action( 'admin_notices', array( $this, 'denied' ) );
54
+ do_action( 'wcvendors_deny_vendor', $wp_user_object );
55
+ break;
56
+
57
+ default:
58
+ // code...
59
+ break;
60
+ }
61
+
62
+ $wp_user_object->set_role( $role );
63
+
64
+ }
65
+ }
66
+
67
+
68
+ /**
69
+ *
70
+ */
71
+ public function denied()
72
+ {
73
+ echo '<div class="updated">';
74
+ echo '<p>' . sprintf( __( '%s has been <b>denied</b>.', 'wc-vendors' ), wcv_get_vendor_name( ) ) . '</p>';
75
+ echo '</div>';
76
+ }
77
+
78
+
79
+ /**
80
+ *
81
+ */
82
+ public function approved()
83
+ {
84
+ echo '<div class="updated">';
85
+ echo '<p>' . __( 'Vendor has been <b>approved</b>.', 'wc-vendors' ) . '</p>';
86
+ echo '</div>';
87
+ }
88
+
89
+
90
+ /**
91
+ *
92
+ *
93
+ * @param unknown $values
94
+ *
95
+ * @return unknown
96
+ */
97
+ public function show_pending_vendors_link( $values )
98
+ {
99
+ $values[ 'pending_vendors' ] = '<a href="?role=asd">' . __( 'Pending Vendors', 'wc-vendors' ) . ' <span class="count">(3)</span></a>';
100
+
101
+ return $values;
102
+ }
103
+
104
+ }
trunk/classes/admin/class-vendor-reports.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Report views
5
+ *
6
+ * @author Matt Gates <http://mgates.me>
7
+ * @package ProductVendor
8
+ */
9
+
10
+
11
+ class WCV_Vendor_Reports
12
+ {
13
+
14
+
15
+ /**
16
+ * Constructor
17
+ */
18
+ function __construct()
19
+ {
20
+ $this->vendor_id = !current_user_can( 'manage_woocommerce' ) ? wp_get_current_user()->ID : '';
21
+ if ( !empty ( $this->vendor_id ) ) {
22
+ add_filter( 'woocommerce_reports_charts', array( $this, 'filter_tabs' ), 99 );
23
+ add_filter( 'woocommerce_json_search_found_products', array( $this, 'filter_products_json' ) );
24
+ add_filter( 'woocommerce_reports_product_sales_order_items', array( $this, 'filter_products' ) );
25
+ add_filter( 'woocommerce_reports_top_sellers_order_items', array( $this, 'filter_products' ) );
26
+ add_filter( 'woocommerce_reports_top_earners_order_items', array( $this, 'filter_products' ) );
27
+ }
28
+
29
+ }
30
+
31
+ /**
32
+ * Show only reports that are useful to a vendor
33
+ *
34
+ * @param array $tabs
35
+ *
36
+ * @return array
37
+ */
38
+ public function filter_tabs( $tabs )
39
+ {
40
+ global $woocommerce;
41
+
42
+ $remove = array(
43
+ 'woocommerce_sales_overview',
44
+ 'woocommerce_daily_sales',
45
+ 'woocommerce_monthly_sales',
46
+ 'woocommerce_monthly_taxes',
47
+ 'woocommerce_category_sales',
48
+ 'woocommerce_coupon_sales',
49
+ );
50
+
51
+ $reports = $tabs[ 'orders' ][ 'reports' ];
52
+
53
+ foreach ( $reports as $key => $chart ) {
54
+ if ( $key == 'coupon_usage' ) {
55
+ unset( $tabs[ 'orders' ][ 'reports' ][ $key ] );
56
+ }
57
+ }
58
+
59
+ // These are admin tabs
60
+ $return = array(
61
+ 'orders' => $tabs[ 'orders' ]
62
+ );
63
+
64
+ return $return;
65
+ }
66
+
67
+
68
+ /**
69
+ * Filter products based on current vendor
70
+ *
71
+ * @param unknown $orders
72
+ *
73
+ * @return unknown
74
+ */
75
+ public function filter_products( $orders )
76
+ {
77
+ $products = WCV_Vendors::get_vendor_products( $this->vendor_id );
78
+
79
+ $ids = array();
80
+ foreach ( $products as $product ) {
81
+ $ids[ ] = ( $product->ID );
82
+ }
83
+
84
+ foreach ( $orders as $key => $order ) {
85
+
86
+ if ( !in_array( $order->product_id, $ids ) ) {
87
+ unset( $orders[ $key ] );
88
+ continue;
89
+ } else {
90
+ if ( !empty( $order->line_total ) ) {
91
+ $orders[ $key ]->line_total = WCV_Commission::calculate_commission( $order->line_total, $order->product_id, $order, $order->qty );
92
+ }
93
+ }
94
+
95
+ }
96
+
97
+ return $orders;
98
+ }
99
+
100
+
101
+ /**
102
+ *
103
+ *
104
+ * @param unknown $products
105
+ *
106
+ * @return unknown
107
+ */
108
+ public function filter_products_json( $products )
109
+ {
110
+ $vendor_products = WCV_Vendors::get_vendor_products( $this->vendor_id );
111
+
112
+ $ids = array();
113
+ foreach ( $vendor_products as $vendor_product ) {
114
+ $ids[ $vendor_product->ID ] = $vendor_product->post_title;
115
+ }
116
+
117
+ return array_intersect_key( $products, $ids );
118
+ }
119
+
120
+
121
+ }
trunk/classes/admin/class-wcv-admin-extensions.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WC Vendors Extensions Page
4
+ *
5
+ * @author WooThemes
6
+ * @category Admin
7
+ * @package WooCommerce/Admin
8
+ * @version 2.5.0
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ /**
16
+ * WC_Admin_Addons Class.
17
+ */
18
+ class WCVendors_Admin_Extensions {
19
+
20
+ public static function output(){
21
+
22
+ include_once dirname( __FILE__ ) . '/views/html-admin-page-extensions.php';
23
+ }
24
+
25
+ }
trunk/classes/admin/class-wcv-admin-help.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Add some content to the help tab
4
+ *
5
+ * @package WC Vendors/Admin
6
+ * @version 2.0.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ if ( class_exists( 'WCVendors_Admin_Help', false ) ) {
14
+ return new WCVendors_Admin_Help();
15
+ }
16
+
17
+ /**
18
+ * WCVendors_Admin_Help Class.
19
+ */
20
+ class WCVendors_Admin_Help {
21
+
22
+ /**
23
+ * Hook in tabs.
24
+ */
25
+ public function __construct() {
26
+ add_action( 'current_screen', array( $this, 'add_tabs' ), 60 );
27
+ }
28
+
29
+ /**
30
+ * Add help tabs.
31
+ */
32
+ public function add_tabs() {
33
+
34
+ $screen = get_current_screen();
35
+
36
+ if ( ! $screen || ! in_array( $screen->id, wcv_get_screen_ids() ) ) {
37
+ return;
38
+ }
39
+
40
+ // Rquired to unhook woocommerce tabs on these pages due to adding wc vendors pages into the wc_get_screen_ids to load woocommerce assets
41
+ $screen->remove_help_tab( 'woocommerce_support_tab' );
42
+ $screen->remove_help_tab( 'woocommerce_bugs_tab' );
43
+ $screen->remove_help_tab( 'woocommerce_education_tab' );
44
+ $screen->remove_help_tab( 'woocommerce_onboard_tab' );
45
+
46
+ $screen->add_help_tab( array(
47
+ 'id' => 'wcv_support_tab',
48
+ 'title' => __( 'Help &amp; Support', 'wc-vendors' ),
49
+ 'content' =>
50
+ '<h2>' . __( 'Welcome to WC Vendors Help &amp; Support', 'wc-vendors' ) . '</h2>' .
51
+ '<p>' . sprintf(
52
+ /* translators: %s: Documentation URL */
53
+ __( 'Should you need any help with using or extending WC Vendors, <a href="%s">please read our documentation</a>. You will find all kinds of resources including code snippets, guides and much more.', 'wc-vendors' ),
54
+ 'https://docs.wcvendors.com/?utm_source=plugin&utm_medium=help&utm_campaign=settings'
55
+ ) . '</p>' .
56
+ '<p>' . sprintf(
57
+ /* translators: %s: Forum URL */
58
+ __( 'Do you have a question about WC Vendors? For assistance please see our <a href="%1$s">community forum</a>. If you need help with premium extensions sold by WC Vendors, please <a href="%2$s">submit a ticket</a>.', 'wc-vendors' ),
59
+ 'https://wordpress.org/support/plugin/wc-vendors',
60
+ 'https://www.wcvendors.com/submit-ticket/?utm_source=plugin&utm_medium=help&utm_campaign=pluginsettings'
61
+ ) . '</p>' .
62
+ '<p>' . __( 'Before asking for help we recommend checking the system status page to identify any problems with your configuration. <strong>Anything showing red should be fixed before contacting us.</strong>', 'wc-vendors' ) . '</p>' .
63
+ '<p>' . sprintf( __( 'Please follow our <a href="%s">debuggin guide</a> to ensure that you have narrowed down the issue. ', 'wc-vendors' ), 'https://docs.wcvendors.com/knowledge-base/the-debugging-guide/?utm_source=plugin&utm_medium=help&utm_campaign=settings' ) .
64
+ '<p><a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button button-primary">' . __( 'System status', 'wc-vendors' ) . '</a> <a href="https://wordpress.org/support/plugin/wc-vendors" class="button">' . __( 'Community forum', 'wc-vendors' ) . '</a> <a href="https://www.wcvendors.com/submit-ticket/?utm_source=plugin&utm_medium=help&utm_campaign=pluginsettings" class="button">' . __( 'WC Vendors Premium Support', 'wc-vendors' ) . '</a></p>',
65
+ ) );
66
+
67
+ $screen->add_help_tab( array(
68
+ 'id' => 'wcvendors_getting_started_tab',
69
+ 'title' => __( 'Getting Started', 'wc-vendors' ),
70
+ 'content' =>
71
+ '<h2>' . __( 'Getting Started', 'wc-vendors' ) . '</h2>' .
72
+ '<p>' . sprintf( __( 'If you are new to WC Vendors then we highly recommend that you go through our <a href="%s">getting started guides</a>.', 'wc-vendors' ), 'https://docs.wcvendors.com/article-categories/getting-started/' ). '</p>'
73
+ ) );
74
+
75
+ $screen->add_help_tab( array(
76
+ 'id' => 'wcvendors_bugs_tab',
77
+ 'title' => __( 'Found a bug?', 'wc-vendors' ),
78
+ 'content' =>
79
+ '<h2>' . __( 'Found a bug?', 'wc-vendors' ) . '</h2>' .
80
+ /* translators: 1: GitHub issues URL 2: System status report URL */
81
+ '<p>' . sprintf( __( 'If you think you have found a bug in WC Vendors you can create a ticket via <a href="%1$s">Github issues</a>. To help us solve your issue, please be as descriptive as possible and include your <a href="%2$s">system status report</a>.', 'wc-vendors' ), 'https://github.com/wcvendors/wcvendors/issues?state=open', admin_url( 'admin.php?page=wc-status' ) ) . '</p>' .
82
+ '<p><a href="https://github.com/wcvendors/wcvendors/issues?state=open" class="button button-primary">' . __( 'Report a bug', 'wc-vendors' ) . '</a> <a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button">' . __( 'System status', 'wc-vendors' ) . '</a></p>',
83
+
84
+ ) );
85
+
86
+
87
+
88
+ $screen->add_help_tab( array(
89
+ 'id' => 'wcvendors_onboard_tab',
90
+ 'title' => __( 'Setup wizard', 'wc-vendors' ),
91
+ 'content' =>
92
+ '<h2>' . __( 'Setup wizard', 'wc-vendors' ) . '</h2>' .
93
+ '<p>' . __( 'If you need to access the setup wizard again, please click on the button below.', 'wc-vendors' ) . '</p>' .
94
+ '<p><a href="' . admin_url( 'index.php?page=wcv-setup' ) . '" class="button button-primary">' . __( 'Setup wizard', 'wc-vendors' ) . '</a></p>',
95
+
96
+ ) );
97
+
98
+ $screen->add_help_tab( array(
99
+ 'id' => 'wcvendors_upgrade_tab',
100
+ 'title' => __( 'Update', 'wc-vendors' ),
101
+ 'content' =>
102
+ '<h2>' . __( 'Upgrade', 'wc-vendors' ) . '</h2>' .
103
+ '<p>' . __( 'If you need to manually run the updates, please click on the button below.', 'wc-vendors' ) . '</p>' .
104
+ '<p><a href="' . esc_url( add_query_arg( 'do_update_wcvendors', 'true', admin_url( 'admin.php?page=wcv-settings' ) ) ). '" class="button button-primary">' . __( 'Run the updater', 'wc-vendors' ) . '</a></p>',
105
+
106
+ ) );
107
+
108
+ $screen->set_help_sidebar(
109
+ '<p><strong>' . __( 'For more information:', 'wc-vendors' ) . '</strong></p>' .
110
+ '<p><a href="https://www.wcvendors.com/product/wc-vendors-pro/?utm_source=plugin&utm_medium=help&utm_campaign=settings" target="_blank">' . __( 'Upgrade to Pro', 'wc-vendors' ) . '</a></p>' .
111
+ '<p><a href="https://www.wcvendors.com/extensions/?utm_source=plugin&utm_medium=help&utm_campaign=settings" target="_blank">' . __( 'Buy extensions', 'wc-vendors' ) . '</a></p>' .
112
+ '<p><a href="https://woocommerce.com/?utm_source=helptab&utm_medium=product&utm_content=about&utm_campaign=woocommerceplugin" target="_blank">' . __( 'About WC Vendors', 'wc-vendors' ) . '</a></p>' .
113
+ '<p><a href="https://wordpress.org/plugins/wc-vendors/" target="_blank">' . __( 'WC Vendors on WordPress.org', 'wc-vendors' ) . '</a></p>' .
114
+ '<p><a href="https://github.com/wcvendors/wcvendors" target="_blank">' . __( 'WC Vendors Github', 'wc-vendors' ) . '</a></p>'
115
+
116
+ );
117
+ }
118
+ }
119
+
120
+ return new WCVendors_Admin_Help();
trunk/classes/admin/class-wcv-admin-notices.php ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Display notices in admin
4
+ *
5
+ * @author Jamie Madden, WC Vendors
6
+ * @category Admin
7
+ * @package WCVendors/Admin
8
+ * @version 2.0.0
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ /**
16
+ * WC_Admin_Notices Class.
17
+ */
18
+ class WCVendors_Admin_Notices {
19
+
20
+ /**
21
+ * Stores notices.
22
+ * @var array
23
+ */
24
+ private static $notices = array();
25
+
26
+ /**
27
+ * Array of notices - name => callback.
28
+ * @var array
29
+ */
30
+ private static $core_notices = array(
31
+ 'install' => 'install_notice',
32
+ 'update' => 'update_notice',
33
+ 'template_files' => 'template_file_check_notice',
34
+ 'theme_support' => 'theme_check_notice',
35
+ );
36
+
37
+ /**
38
+ * Constructor.
39
+ */
40
+ public static function init() {
41
+ self::$notices = get_option( 'wcvendors_admin_notices', array() );
42
+
43
+ add_action( 'switch_theme', array( __CLASS__, 'reset_admin_notices' ) );
44
+ add_action( 'wcvendors_installed', array( __CLASS__, 'reset_admin_notices' ) );
45
+ add_action( 'wp_loaded', array( __CLASS__, 'hide_notices' ) );
46
+ add_action( 'shutdown', array( __CLASS__, 'store_notices' ) );
47
+
48
+ if ( current_user_can( 'manage_woocommerce' ) ) {
49
+ add_action( 'admin_print_styles', array( __CLASS__, 'add_notices' ) );
50
+ }
51
+ }
52
+
53
+ /**
54
+ * Store notices to DB
55
+ */
56
+ public static function store_notices() {
57
+ update_option( 'wcvendors_admin_notices', self::get_notices() );
58
+ }
59
+
60
+ /**
61
+ * Get notices
62
+ * @return array
63
+ */
64
+ public static function get_notices() {
65
+ return self::$notices;
66
+ }
67
+
68
+ /**
69
+ * Remove all notices.
70
+ */
71
+ public static function remove_all_notices() {
72
+ self::$notices = array();
73
+ }
74
+
75
+ /**
76
+ * Reset notices for themes when switched or a new version of WC is installed.
77
+ */
78
+ public static function reset_admin_notices() {
79
+ self::add_notice( 'template_files' );
80
+ }
81
+
82
+ /**
83
+ * Show a notice.
84
+ * @param string $name
85
+ */
86
+ public static function add_notice( $name ) {
87
+ self::$notices = array_unique( array_merge( self::get_notices(), array( $name ) ) );
88
+ }
89
+
90
+ /**
91
+ * Remove a notice from being displayed.
92
+ * @param string $name
93
+ */
94
+ public static function remove_notice( $name ) {
95
+ self::$notices = array_diff( self::get_notices(), array( $name ) );
96
+ delete_option( 'wcvendors_admin_notice_' . $name );
97
+ }
98
+
99
+ /**
100
+ * See if a notice is being shown.
101
+ * @param string $name
102
+ * @return boolean
103
+ */
104
+ public static function has_notice( $name ) {
105
+ return in_array( $name, self::get_notices() );
106
+ }
107
+
108
+ /**
109
+ * Hide a notice if the GET variable is set.
110
+ */
111
+ public static function hide_notices() {
112
+ if ( isset( $_GET['wcv-hide-notice'] ) && isset( $_GET['_wcv_notice_nonce'] ) ) {
113
+ if ( ! wp_verify_nonce( $_GET['_wcv_notice_nonce'], 'wcvendors_hide_notices_nonce' ) ) {
114
+ wp_die( __( 'Action failed. Please refresh the page and retry.', 'wcvendors' ) );
115
+ }
116
+
117
+ if ( ! current_user_can( 'manage_woocommerce' ) ) {
118
+ wp_die( __( 'Cheatin&#8217; huh?', 'wcvendors' ) );
119
+ }
120
+
121
+ $hide_notice = sanitize_text_field( $_GET['wcv-hide-notice'] );
122
+ self::remove_notice( $hide_notice );
123
+ do_action( 'wcvendors_hide_' . $hide_notice . '_notice' );
124
+ }
125
+ }
126
+
127
+ /**
128
+ * Add notices + styles if needed.
129
+ */
130
+ public static function add_notices() {
131
+ $notices = self::get_notices();
132
+
133
+ if ( ! empty( $notices ) ) {
134
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
135
+ wp_enqueue_style( 'wcv-setup', wcv_assets_url . 'css/wcv-activation' . $suffix .'.css', WCV_VERSION );
136
+ foreach ( $notices as $notice ) {
137
+ if ( ! empty( self::$core_notices[ $notice ] ) && apply_filters( 'wcvendors_show_admin_notice', true, $notice ) ) {
138
+ add_action( 'admin_notices', array( __CLASS__, self::$core_notices[ $notice ] ) );
139
+ } else {
140
+ add_action( 'admin_notices', array( __CLASS__, 'output_custom_notices' ) );
141
+ }
142
+ }
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Add a custom notice.
148
+ * @param string $name
149
+ * @param string $notice_html
150
+ */
151
+ public static function add_custom_notice( $name, $notice_html ) {
152
+ self::add_notice( $name );
153
+ update_option( 'wcvendors_admin_notice_' . $name, wp_kses_post( $notice_html ) );
154
+ }
155
+
156
+ /**
157
+ * Output any stored custom notices.
158
+ */
159
+ public static function output_custom_notices() {
160
+ $notices = self::get_notices();
161
+
162
+ if ( ! empty( $notices ) ) {
163
+ foreach ( $notices as $notice ) {
164
+ if ( empty( self::$core_notices[ $notice ] ) ) {
165
+ $notice_html = get_option( 'wcvendors_admin_notice_' . $notice );
166
+
167
+ if ( $notice_html ) {
168
+ include( 'views/notices/html-notice-custom.php' );
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }
174
+
175
+ /**
176
+ * If we need to update, include a message with the update button.
177
+ */
178
+ public static function update_notice() {
179
+ if ( version_compare( get_option( 'wcvendors_db_version' ), WCV_VERSION, '<' ) ) {
180
+ $updater = new WC_Background_Updater();
181
+ if ( $updater->is_updating() || ! empty( $_GET['do_update_wcvendors'] ) ) {
182
+ include( 'views/notices/html-notice-updating.php' );
183
+ } else {
184
+ include( 'views/notices/html-notice-update.php' );
185
+ }
186
+ } else {
187
+ include( 'views/notices/html-notice-updated.php' );
188
+ }
189
+ }
190
+
191
+ /**
192
+ * If we have just installed, show a message with the install pages button.
193
+ */
194
+ public static function install_notice() {
195
+ include( 'views/notices/html-notice-install.php' );
196
+ }
197
+
198
+ /**
199
+ * Show the Theme Check notice.
200
+ */
201
+ public static function theme_check_notice() {
202
+ if ( ! current_theme_supports( 'wcvendors' ) && ! in_array( get_option( 'template' ), wc_get_core_supported_themes() ) ) {
203
+ include( 'views/notices/html-notice-theme-support.php' );
204
+ } else {
205
+ self::remove_notice( 'theme_support' );
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Show a notice highlighting bad template files.
211
+ */
212
+ public static function template_file_check_notice() {
213
+
214
+ $core_templates = WC_Admin_Status::scan_template_files( wcv_plugin_dir_path . '/templates' );
215
+ $outdated = false;
216
+
217
+ foreach ( $core_templates as $file ) {
218
+
219
+ $theme_file = false;
220
+ if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
221
+ $theme_file = get_stylesheet_directory() . '/' . $file;
222
+ } elseif ( file_exists( get_stylesheet_directory() . '/wc-vendors/' . $file ) ) {
223
+ $theme_file = get_stylesheet_directory() . '/wc-vendors/' . $file;
224
+ } elseif ( file_exists( get_template_directory() . '/' . $file ) ) {
225
+ $theme_file = get_template_directory() . '/' . $file;
226
+ } elseif ( file_exists( get_template_directory() . '/wc-vendors/' . $file ) ) {
227
+ $theme_file = get_template_directory() . '/wc-vendors/' . $file;
228
+ }
229
+
230
+ if ( false !== $theme_file ) {
231
+ $core_version = WC_Admin_Status::get_file_version( wcv_plugin_dir_path . '/templates/' . $file );
232
+ $theme_version = WC_Admin_Status::get_file_version( $theme_file );
233
+
234
+ if ( $core_version && $theme_version && version_compare( $theme_version, $core_version, '<' ) ) {
235
+ $outdated = true;
236
+ break;
237
+ }
238
+ }
239
+ }
240
+
241
+ if ( $outdated ) {
242
+ include( 'views/notices/html-notice-template-check.php' );
243
+ } else {
244
+ self::remove_notice( 'template_files' );
245
+ }
246
+ }
247
+ }
248
+
249
+ WCVendors_Admin_Notices::init();
trunk/classes/admin/class-wcv-admin-settings.php ADDED
@@ -0,0 +1,668 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ /**
7
+ * The admin settings class handles all settings in the admin area. This is a modified version of the WooCommerce Admin Settings class
8
+ *
9
+ * @author WooCommerce, Jamie Madden, WC Vendors
10
+ * @category Admin
11
+ * @package WCVendors/Admin
12
+ * @version 2.0.0
13
+ */
14
+
15
+ class WCVendors_Admin_Settings extends WC_Admin_Settings {
16
+
17
+ /**
18
+ * Setting pages.
19
+ *
20
+ * @var array
21
+ */
22
+ private static $settings = array();
23
+
24
+ /**
25
+ * Error messages.
26
+ *
27
+ * @var array
28
+ */
29
+ private static $errors = array();
30
+
31
+ /**
32
+ * Update messages.
33
+ *
34
+ * @var array
35
+ */
36
+ private static $messages = array();
37
+
38
+ /**
39
+ * Include the settings page classes.
40
+ */
41
+ public static function get_settings_pages() {
42
+
43
+ if ( empty( self::$settings ) ) {
44
+ $settings = array();
45
+
46
+ // Include the setings page.
47
+ include_once( WCV_ABSPATH_ADMIN . 'settings/class-wcv-settings-page.php' );
48
+
49
+ $settings[] = include( WCV_ABSPATH_ADMIN . 'settings/class-wcv-settings-general.php' );
50
+ $settings[] = include( WCV_ABSPATH_ADMIN . 'settings/class-wcv-settings-commission.php' );
51
+ $settings[] = include( WCV_ABSPATH_ADMIN . 'settings/class-wcv-settings-capabilities.php' );
52
+ $settings[] = include( WCV_ABSPATH_ADMIN . 'settings/class-wcv-settings-display.php' );
53
+ $settings[] = include( WCV_ABSPATH_ADMIN . 'settings/class-wcv-settings-payments.php' );
54
+
55
+ self::$settings = apply_filters( 'wcvendors_get_settings_pages', $settings );
56
+ }
57
+
58
+ return self::$settings;
59
+ }
60
+
61
+ /**
62
+ * Save the settings.
63
+ */
64
+ public static function save() {
65
+ global $current_tab;
66
+
67
+ if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'wcvendors-settings' ) ) {
68
+ die( __( 'Action failed. Please refresh the page and retry.', 'wc-vendors' ) );
69
+ }
70
+
71
+ // Trigger actions
72
+ do_action( 'wcvendors_settings_save_' . $current_tab );
73
+ do_action( 'wcvendors_update_options_' . $current_tab );
74
+ do_action( 'wcvendors_update_options' );
75
+
76
+ self::add_message( __( 'Your settings have been saved.', 'wc-vendors' ) );
77
+
78
+ update_option( 'wcvendors_queue_flush_rewrite_rules', 'yes' );
79
+ do_action( 'wcvendors_settings_saved' );
80
+ }
81
+
82
+ /**
83
+ * Settings page.
84
+ *
85
+ * Handles the display of the main woocommerce settings page in admin.
86
+ */
87
+ public static function output() {
88
+ global $current_section, $current_tab;
89
+
90
+ // $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
91
+ $suffix = '';
92
+
93
+ do_action( 'wcvendors_settings_start' );
94
+ wp_enqueue_script( 'wcvendors_settings', wcv_assets_url . '/js/admin/settings' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris', 'selectWoo' ), WCV_VERSION, true );
95
+ wp_localize_script( 'wcvendors_settings', 'wcvendors_settings_params', array(
96
+ 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'wc-vendors' ),
97
+ ) );
98
+
99
+ // Get tabs for the settings page
100
+ $tabs = apply_filters( 'wcvendors_settings_tabs_array', array() );
101
+
102
+ include( WCV_ABSPATH_ADMIN . 'views/html-admin-settings.php' );
103
+ }
104
+
105
+ /**
106
+ * Output admin fields.
107
+ *
108
+ * Loops though the wcvendors options array and outputs each field.
109
+ *
110
+ * @param array[] $options Opens array to output
111
+ */
112
+ public static function output_fields( $options ) {
113
+
114
+ foreach ( $options as $value ) {
115
+ if ( ! isset( $value['type'] ) ) {
116
+ continue;
117
+ }
118
+ if ( ! isset( $value['id'] ) ) {
119
+ $value['id'] = '';
120
+ }
121
+ if ( ! isset( $value['title'] ) ) {
122
+ $value['title'] = isset( $value['name'] ) ? $value['name'] : '';
123
+ }
124
+ if ( ! isset( $value['class'] ) ) {
125
+ $value['class'] = '';
126
+ }
127
+ if ( ! isset( $value['css'] ) ) {
128
+ $value['css'] = '';
129
+ }
130
+ if ( ! isset( $value['default'] ) ) {
131
+ $value['default'] = '';
132
+ }
133
+ if ( ! isset( $value['desc'] ) ) {
134
+ $value['desc'] = '';
135
+ }
136
+ if ( ! isset( $value['desc_tip'] ) ) {
137
+ $value['desc_tip'] = false;
138
+ }
139
+ if ( ! isset( $value['placeholder'] ) ) {
140
+ $value['placeholder'] = '';
141
+ }
142
+ if ( ! isset( $value['suffix'] ) ) {
143
+ $value['suffix'] = '';
144
+ }
145
+
146
+ // Custom attribute handling
147
+ $custom_attributes = array();
148
+
149
+ if ( ! empty( $value['custom_attributes'] ) && is_array( $value['custom_attributes'] ) ) {
150
+ foreach ( $value['custom_attributes'] as $attribute => $attribute_value ) {
151
+ $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
152
+ }
153
+ }
154
+
155
+ // Description handling
156
+ $field_description = self::get_field_description( $value );
157
+ extract( $field_description );
158
+
159
+ // Switch based on type
160
+ switch ( $value['type'] ) {
161
+
162
+ // Section Titles
163
+ case 'title':
164
+ if ( ! empty( $value['title'] ) ) {
165
+ echo '<h2>' . esc_html( $value['title'] ) . '</h2>';
166
+ }
167
+ if ( ! empty( $value['desc'] ) ) {
168
+ echo wpautop( wptexturize( wp_kses_post( $value['desc'] ) ) );
169
+ }
170
+ echo '<table class="form-table">' . "\n\n";
171
+ if ( ! empty( $value['id'] ) ) {
172
+ do_action( 'wcvendors_settings_' . sanitize_title( $value['id'] ) );
173
+ }
174
+ break;
175
+
176
+ // Section Ends
177
+ case 'sectionend':
178
+ if ( ! empty( $value['id'] ) ) {
179
+ do_action( 'wcvendors_settings_' . sanitize_title( $value['id'] ) . '_end' );
180
+ }
181
+ echo '</table>';
182
+ if ( ! empty( $value['id'] ) ) {
183
+ do_action( 'wcvendors_settings_' . sanitize_title( $value['id'] ) . '_after' );
184
+ }
185
+ break;
186
+
187
+ // Standard text inputs and subtypes like 'number'
188
+ case 'text':
189
+ case 'email':
190
+ case 'number':
191
+ case 'password' :
192
+ $option_value = self::get_option( $value['id'], $value['default'] );
193
+
194
+ ?><tr valign="top">
195
+ <th scope="row" class="titledesc">
196
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
197
+ <?php echo $tooltip_html; ?>
198
+ </th>
199
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
200
+ <input
201
+ name="<?php echo esc_attr( $value['id'] ); ?>"
202
+ id="<?php echo esc_attr( $value['id'] ); ?>"
203
+ type="<?php echo esc_attr( $value['type'] ); ?>"
204
+ style="<?php echo esc_attr( $value['css'] ); ?>"
205
+ value="<?php echo esc_attr( $option_value ); ?>"
206
+ class="<?php echo esc_attr( $value['class'] ); ?>"
207
+ placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
208
+ <?php echo implode( ' ', $custom_attributes ); ?>
209
+ /><?php echo esc_html( $value['suffix'] ); ?> <?php echo $description; ?>
210
+ </td>
211
+ </tr><?php
212
+ break;
213
+
214
+ // Color picker.
215
+ case 'color' :
216
+ $option_value = self::get_option( $value['id'], $value['default'] );
217
+
218
+ ?><tr valign="top">
219
+ <th scope="row" class="titledesc">
220
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
221
+ <?php echo $tooltip_html; ?>
222
+ </th>
223
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">&lrm;
224
+ <span class="colorpickpreview" style="background: <?php echo esc_attr( $option_value ); ?>"></span>
225
+ <input
226
+ name="<?php echo esc_attr( $value['id'] ); ?>"
227
+ id="<?php echo esc_attr( $value['id'] ); ?>"
228
+ type="text"
229
+ dir="ltr"
230
+ style="<?php echo esc_attr( $value['css'] ); ?>"
231
+ value="<?php echo esc_attr( $option_value ); ?>"
232
+ class="<?php echo esc_attr( $value['class'] ); ?>colorpick"
233
+ placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
234
+ <?php echo implode( ' ', $custom_attributes ); ?>
235
+ />&lrm; <?php echo $description; ?>
236
+ <div id="colorPickerDiv_<?php echo esc_attr( $value['id'] ); ?>" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div>
237
+ </td>
238
+ </tr><?php
239
+ break;
240
+
241
+ // Textarea
242
+ case 'textarea':
243
+
244
+ $option_value = self::get_option( $value['id'], $value['default'] );
245
+
246
+ ?><tr valign="top">
247
+ <th scope="row" class="titledesc">
248
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
249
+ <?php echo $tooltip_html; ?>
250
+ </th>
251
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
252
+ <?php echo $description; ?>
253
+
254
+ <textarea
255
+ name="<?php echo esc_attr( $value['id'] ); ?>"
256
+ id="<?php echo esc_attr( $value['id'] ); ?>"
257
+ style="<?php echo esc_attr( $value['css'] ); ?>"
258
+ class="<?php echo esc_attr( $value['class'] ); ?>"
259
+ placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
260
+ <?php echo implode( ' ', $custom_attributes ); ?>
261
+ ><?php echo esc_textarea( $option_value ); ?></textarea>
262
+ </td>
263
+ </tr><?php
264
+ break;
265
+
266
+ // Select boxes
267
+ case 'select' :
268
+ case 'multiselect' :
269
+
270
+ $option_value = self::get_option( $value['id'], $value['default'] );
271
+
272
+ ?><tr valign="top">
273
+ <th scope="row" class="titledesc">
274
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
275
+ <?php echo $tooltip_html; ?>
276
+ </th>
277
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
278
+ <select
279
+ name="<?php echo esc_attr( $value['id'] ); ?><?php echo ( 'multiselect' === $value['type'] ) ? '[]' : ''; ?>"
280
+ id="<?php echo esc_attr( $value['id'] ); ?>"
281
+ style="<?php echo esc_attr( $value['css'] ); ?>"
282
+ class="<?php echo esc_attr( $value['class'] ); ?>"
283
+ <?php echo implode( ' ', $custom_attributes ); ?>
284
+ <?php echo ( 'multiselect' == $value['type'] ) ? 'multiple="multiple"' : ''; ?>
285
+ >
286
+ <?php
287
+ foreach ( $value['options'] as $key => $val ) {
288
+ ?>
289
+ <option value="<?php echo esc_attr( $key ); ?>" <?php
290
+
291
+ if ( is_array( $option_value ) ) {
292
+ selected( in_array( $key, $option_value ), true );
293
+ } else {
294
+ selected( $option_value, $key );
295
+ }
296
+
297
+ ?>><?php echo $val ?></option>
298
+ <?php
299
+ }
300
+ ?>
301
+ </select> <?php echo $description; ?>
302
+ </td>
303
+ </tr><?php
304
+ break;
305
+
306
+ // Radio inputs
307
+ case 'radio' :
308
+
309
+ $option_value = self::get_option( $value['id'], $value['default'] );
310
+
311
+ ?><tr valign="top">
312
+ <th scope="row" class="titledesc">
313
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
314
+ <?php echo $tooltip_html; ?>
315
+ </th>
316
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
317
+ <fieldset>
318
+ <?php echo $description; ?>
319
+ <ul>
320
+ <?php
321
+ foreach ( $value['options'] as $key => $val ) {
322
+ ?>
323
+ <li>
324
+ <label><input
325
+ name="<?php echo esc_attr( $value['id'] ); ?>"
326
+ value="<?php echo $key; ?>"
327
+ type="radio"
328
+ style="<?php echo esc_attr( $value['css'] ); ?>"
329
+ class="<?php echo esc_attr( $value['class'] ); ?>"
330
+ <?php echo implode( ' ', $custom_attributes ); ?>
331
+ <?php checked( $key, $option_value ); ?>
332
+ /> <?php echo $val ?></label>
333
+ </li>
334
+ <?php
335
+ }
336
+ ?>
337
+ </ul>
338
+ </fieldset>
339
+ </td>
340
+ </tr><?php
341
+ break;
342
+
343
+ // Checkbox input
344
+ case 'checkbox' :
345
+
346
+ $option_value = self::get_option( $value['id'], $value['default'] );
347
+ $visibility_class = array();
348
+
349
+ if ( ! isset( $value['hide_if_checked'] ) ) {
350
+ $value['hide_if_checked'] = false;
351
+ }
352
+ if ( ! isset( $value['show_if_checked'] ) ) {
353
+ $value['show_if_checked'] = false;
354
+ }
355
+ if ( 'yes' == $value['hide_if_checked'] || 'yes' == $value['show_if_checked'] ) {
356
+ $visibility_class[] = 'hidden_option';
357
+ }
358
+ if ( 'option' == $value['hide_if_checked'] ) {
359
+ $visibility_class[] = 'hide_options_if_checked';
360
+ }
361
+ if ( 'option' == $value['show_if_checked'] ) {
362
+ $visibility_class[] = 'show_options_if_checked';
363
+ }
364
+
365
+ if ( ! isset( $value['checkboxgroup'] ) || 'start' == $value['checkboxgroup'] ) {
366
+ ?>
367
+ <tr valign="top" class="<?php echo esc_attr( implode( ' ', $visibility_class ) ); ?>">
368
+ <th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ) ?></th>
369
+ <td class="forminp forminp-checkbox">
370
+ <fieldset>
371
+ <?php
372
+ } else {
373
+ ?>
374
+ <fieldset class="<?php echo esc_attr( implode( ' ', $visibility_class ) ); ?>">
375
+ <?php
376
+ }
377
+
378
+ if ( ! empty( $value['title'] ) ) {
379
+ ?>
380
+ <legend class="screen-reader-text"><span><?php echo esc_html( $value['title'] ) ?></span></legend>
381
+ <?php
382
+ }
383
+
384
+ ?>
385
+ <label for="<?php echo $value['id'] ?>">
386
+ <input
387
+ name="<?php echo esc_attr( $value['id'] ); ?>"
388
+ id="<?php echo esc_attr( $value['id'] ); ?>"
389
+ type="checkbox"
390
+ class="<?php echo esc_attr( isset( $value['class'] ) ? $value['class'] : '' ); ?>"
391
+ value="1"
392
+ <?php checked( $option_value, 'yes' ); ?>
393
+ <?php echo implode( ' ', $custom_attributes ); ?>
394
+ /> <?php echo $description ?>
395
+ </label> <?php echo $tooltip_html; ?>
396
+ <?php
397
+
398
+ if ( ! isset( $value['checkboxgroup'] ) || 'end' == $value['checkboxgroup'] ) {
399
+ ?>
400
+ </fieldset>
401
+ </td>
402
+ </tr>
403
+ <?php
404
+ } else {
405
+ ?>
406
+ </fieldset>
407
+ <?php
408
+ }
409
+ break;
410
+
411
+ // Single page selects
412
+ case 'single_select_page' :
413
+
414
+ $args = array(
415
+ 'name' => $value['id'],
416
+ 'id' => $value['id'],
417
+ 'sort_column' => 'menu_order',
418
+ 'sort_order' => 'ASC',
419
+ 'show_option_none' => ' ',
420
+ 'class' => $value['class'],
421
+ 'echo' => false,
422
+ 'selected' => absint( self::get_option( $value['id'] ) ),
423
+ );
424
+
425
+ if ( isset( $value['args'] ) ) {
426
+ $args = wp_parse_args( $value['args'], $args );
427
+ }
428
+
429
+ ?><tr valign="top" class="single_select_page">
430
+ <th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ) ?> <?php echo $tooltip_html; ?></th>
431
+ <td class="forminp">
432
+ <?php echo str_replace( ' id=', " data-placeholder='" . esc_attr__( 'Select a page&hellip;', 'wc-vendors' ) . "' style='" . $value['css'] . "' class='" . $value['class'] . "' id=", wp_dropdown_pages( $args ) ); ?> <?php echo $description; ?>
433
+ </td>
434
+ </tr><?php
435
+ break;
436
+
437
+ // Single country selects
438
+ case 'single_select_country' :
439
+ $country_setting = (string) self::get_option( $value['id'] );
440
+
441
+ if ( strstr( $country_setting, ':' ) ) {
442
+ $country_setting = explode( ':', $country_setting );
443
+ $country = current( $country_setting );
444
+ $state = end( $country_setting );
445
+ } else {
446
+ $country = $country_setting;
447
+ $state = '*';
448
+ }
449
+ ?><tr valign="top">
450
+ <th scope="row" class="titledesc">
451
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
452
+ <?php echo $tooltip_html; ?>
453
+ </th>
454
+ <td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" data-placeholder="<?php esc_attr_e( 'Choose a country&hellip;', 'wc-vendors' ); ?>" aria-label="<?php esc_attr_e( 'Country', 'wc-vendors' ) ?>" class="wc-enhanced-select">
455
+ <?php WC()->countries->country_dropdown_options( $country, $state ); ?>
456
+ </select> <?php echo $description; ?>
457
+ </td>
458
+ </tr><?php
459
+ break;
460
+
461
+ // Country multiselects
462
+ case 'multi_select_countries' :
463
+
464
+ $selections = (array) self::get_option( $value['id'] );
465
+
466
+ if ( ! empty( $value['options'] ) ) {
467
+ $countries = $value['options'];
468
+ } else {
469
+ $countries = WC()->countries->countries;
470
+ }
471
+
472
+ asort( $countries );
473
+ ?><tr valign="top">
474
+ <th scope="row" class="titledesc">
475
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
476
+ <?php echo $tooltip_html; ?>
477
+ </th>
478
+ <td class="forminp">
479
+ <select multiple="multiple" name="<?php echo esc_attr( $value['id'] ); ?>[]" style="width:350px" data-placeholder="<?php esc_attr_e( 'Choose countries&hellip;', 'wc-vendors' ); ?>" aria-label="<?php esc_attr_e( 'Country', 'wc-vendors' ) ?>" class="wc-enhanced-select">
480
+ <?php
481
+ if ( ! empty( $countries ) ) {
482
+ foreach ( $countries as $key => $val ) {
483
+ echo '<option value="' . esc_attr( $key ) . '" ' . selected( in_array( $key, $selections ), true, false ) . '>' . $val . '</option>';
484
+ }
485
+ }
486
+ ?>
487
+ </select> <?php echo ( $description ) ? $description : ''; ?> <br /><a class="select_all button" href="#"><?php _e( 'Select all', 'wc-vendors' ); ?></a> <a class="select_none button" href="#"><?php _e( 'Select none', 'wc-vendors' ); ?></a>
488
+ </td>
489
+ </tr><?php
490
+ break;
491
+
492
+ case 'image':
493
+
494
+ $option_value = self::get_option( $value['id'], $value['default'] );
495
+
496
+ ?><tr valign="top">
497
+ <th scope="row" class="titledesc">
498
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
499
+ <?php echo $tooltip_html; ?>
500
+ </th>
501
+ <td class="forminp">
502
+ <img class="wcv-image-container-<?php echo $value['id']; ?>" src="<?php echo $option_value; ?>" alt="" style="max-width:100%;" />
503
+ <br />
504
+ <input id="wcv-add-<?php echo $value['id']; ?>" type="button" class="<?php echo $value['css']; ?>" value="<?php echo sprintf( __( 'Update %s', 'wc-vendors' ), strtolower( $value['title'] ) ); ?>" data-id="<?php echo $value['id']; ?>" data-save_button="<?php echo sprintf( __( 'Add %s', 'wc-vendors' ), $value['title'] ); ?>" data-window_title="<?php echo sprintf( __( 'Add %s', 'wc-vendors' ), strtolower( $value['title'] ) ); ?>" data-upload_notice="<?php echo sprintf( __( 'Upload an image for the %s', 'wc-vendors' ), strtolower( $value['title'] ) ); ?>" />
505
+ <input type="hidden" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="<?php echo $option_value; ?>">
506
+ </td>
507
+ </tr><?php
508
+
509
+ break;
510
+
511
+ case 'wysiwyg':
512
+
513
+ $option_value = self::get_option( $value['id'], $value['default'] );
514
+
515
+ ?>
516
+ <tr valign="top">
517
+ <th scope="row" class="titledesc">
518
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
519
+ <?php echo $tooltip_html; ?>
520
+ </th>
521
+ <td class="forminp">
522
+ <?php wp_editor( $option_value, $value[ 'id' ], array( 'textarea_name' => $value['id'] ) ); ?>
523
+ <?php echo $description;?>
524
+ </td>
525
+ </tr>
526
+ <?php
527
+
528
+
529
+ break;
530
+
531
+ // Default: run an action
532
+ default:
533
+ do_action( 'wcvendors_admin_field_' . $value['type'], $value );
534
+ break;
535
+ }
536
+ }
537
+ }
538
+
539
+ /**
540
+ * Save admin fields.
541
+ *
542
+ * Loops though the options array and saves each field.
543
+ *
544
+ * @param array $options Options array to output
545
+ * @param array $data Optional. Data to use for saving. Defaults to $_POST.
546
+ * @return bool
547
+ */
548
+ public static function save_fields( $options, $data = null ) {
549
+ if ( is_null( $data ) ) {
550
+ $data = $_POST;
551
+ }
552
+ if ( empty( $data ) ) {
553
+ return false;
554
+ }
555
+
556
+ // Options to update will be stored here and saved later.
557
+ $update_options = array();
558
+
559
+ // Loop options and get values to save.
560
+ foreach ( $options as $option ) {
561
+ if ( ! isset( $option['id'] ) || ! isset( $option['type'] ) ) {
562
+ continue;
563
+ }
564
+
565
+ // Get posted value.
566
+ if ( strstr( $option['id'], '[' ) ) {
567
+ parse_str( $option['id'], $option_name_array );
568
+ $option_name = current( array_keys( $option_name_array ) );
569
+ $setting_name = key( $option_name_array[ $option_name ] );
570
+ $raw_value = isset( $data[ $option_name ][ $setting_name ] ) ? wp_unslash( $data[ $option_name ][ $setting_name ] ) : null;
571
+ } else {
572
+ $option_name = $option['id'];
573
+ $setting_name = '';
574
+ $raw_value = isset( $data[ $option['id'] ] ) ? wp_unslash( $data[ $option['id'] ] ) : null;
575
+ }
576
+
577
+ // Format the value based on option type.
578
+ switch ( $option['type'] ) {
579
+ case 'checkbox' :
580
+ $value = '1' === $raw_value || 'yes' === $raw_value ? 'yes' : 'no';
581
+ break;
582
+ case 'textarea' :
583
+ $value = wp_kses_post( trim( $raw_value ) );
584
+ break;
585
+ case 'multiselect' :
586
+ case 'multi_select_countries' :
587
+ $value = array_filter( array_map( 'wc_clean', (array) $raw_value ) );
588
+ break;
589
+ case 'image_width' :
590
+ $value = array();
591
+ if ( isset( $raw_value['width'] ) ) {
592
+ $value['width'] = wc_clean( $raw_value['width'] );
593
+ $value['height'] = wc_clean( $raw_value['height'] );
594
+ $value['crop'] = isset( $raw_value['crop'] ) ? 1 : 0;
595
+ } else {
596
+ $value['width'] = $option['default']['width'];
597
+ $value['height'] = $option['default']['height'];
598
+ $value['crop'] = $option['default']['crop'];
599
+ }
600
+ break;
601
+ case 'thumbnail_cropping' :
602
+ $value = wc_clean( $raw_value );
603
+
604
+ if ( 'custom' === $value ) {
605
+ $width_ratio = wc_clean( wp_unslash( $_POST['thumbnail_cropping_aspect_ratio_width'] ) );
606
+ $height_ratio = wc_clean( wp_unslash( $_POST['thumbnail_cropping_aspect_ratio_height'] ) );
607
+ $value = $width_ratio . ':' . $height_ratio;
608
+ }
609
+ break;
610
+ case 'select':
611
+ $allowed_values = empty( $option['options'] ) ? array() : array_keys( $option['options'] );
612
+ if ( empty( $option['default'] ) && empty( $allowed_values ) ) {
613
+ $value = null;
614
+ break;
615
+ }
616
+ $default = ( empty( $option['default'] ) ? $allowed_values[0] : $option['default'] );
617
+ $value = in_array( $raw_value, $allowed_values ) ? $raw_value : $default;
618
+ break;
619
+ default :
620
+ $value = wc_clean( $raw_value );
621
+ break;
622
+ }
623
+
624
+ /**
625
+ * Sanitize the value of an option.
626
+ * @since 2.4.0
627
+ */
628
+ $value = apply_filters( 'wcvendors_admin_settings_sanitize_option', $value, $option, $raw_value );
629
+
630
+ /**
631
+ * Sanitize the value of an option by option name.
632
+ * @since 2.4.0
633
+ */
634
+ $value = apply_filters( "wcvendors_admin_settings_sanitize_option_$option_name", $value, $option, $raw_value );
635
+
636
+ if ( is_null( $value ) ) {
637
+ continue;
638
+ }
639
+
640
+ // Check if option is an array and handle that differently to single values.
641
+ if ( $option_name && $setting_name ) {
642
+ if ( ! isset( $update_options[ $option_name ] ) ) {
643
+ $update_options[ $option_name ] = get_option( $option_name, array() );
644
+ }
645
+ if ( ! is_array( $update_options[ $option_name ] ) ) {
646
+ $update_options[ $option_name ] = array();
647
+ }
648
+ $update_options[ $option_name ][ $setting_name ] = $value;
649
+ } else {
650
+ $update_options[ $option_name ] = $value;
651
+ }
652
+
653
+ /**
654
+ * Fire an action before saved.
655
+ * @deprecated 2.4.0 - doesn't allow manipulation of values!
656
+ */
657
+ do_action( 'wcvendors_update_option', $option );
658
+ }
659
+
660
+ // Save all options in our array.
661
+ foreach ( $update_options as $name => $value ) {
662
+ update_option( $name, $value );
663
+ }
664
+
665
+ return true;
666
+ }
667
+
668
+ }
trunk/classes/admin/class-wcv-admin-setup.php ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Admin setup
5
+ *
6
+ * @author Jamie Madden, WC Vendors
7
+ * @category Admin
8
+ * @package WCVendors/Admin
9
+ * @version 2.0.0
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+
16
+
17
+ class WCV_Admin_Setup {
18
+
19
+ public function __construct() {
20
+
21
+
22
+ // add_action( 'admin_menu', array( 'WCV_Admin_Setup', 'menu' ), 10 );
23
+ add_action( 'woocommerce_admin_order_data_after_shipping_address', array( $this, 'add_vendor_details' ), 10, 2 );
24
+ add_action( 'woocommerce_admin_order_actions_end', array( $this, 'append_actions' ), 10, 1 );
25
+ add_filter( 'woocommerce_debug_tools', array( $this, 'wcvendors_tools' ) );
26
+
27
+ add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
28
+ add_action( 'admin_init', array( $this, 'export_commissions' ) );
29
+ add_action( 'admin_init', array( $this, 'export_sum_commissions' ) );
30
+ add_filter( 'woocommerce_screen_ids', array( $this, 'wcv_screen_ids' ) );
31
+ add_action( 'wcvendors_update_options_capabilities', array( $this, 'update_vendor_role' ) );
32
+
33
+ }
34
+
35
+ public function add_vendor_details( $order )
36
+ {
37
+ $actions = $this->append_actions( $order, true );
38
+
39
+ if (empty( $actions['wc_pv_shipped']['name'] )) {
40
+ return;
41
+ }
42
+
43
+ echo '<h4>' . __('Vendors shipped', 'wc-vendors') . '</h4><br/>';
44
+ echo $actions['wc_pv_shipped']['name'];
45
+ }
46
+
47
+ public function append_actions( $order, $order_page = false )
48
+ {
49
+ global $woocommerce;
50
+
51
+ $order_id = $order->get_id();
52
+
53
+ $authors = WCV_Vendors::get_vendors_from_order( $order );
54
+ $authors = $authors ? array_keys( $authors ) : array();
55
+ if ( empty( $authors ) ) return false;
56
+
57
+ $shipped = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
58
+ $string = '</br></br>';
59
+
60
+ foreach ($authors as $author ) {
61
+ $string .= in_array( $author, $shipped ) ? '&#10004; ' : '&#10005; ';
62
+ $string .= WCV_Vendors::get_vendor_shop_name( $author );
63
+ $string .= '</br>';
64
+ }
65
+
66
+ $response = array(
67
+ 'url' => '#',
68
+ 'name' => __('Vendors Shipped', 'wc-vendors') . $string,
69
+ 'action' => 'wc_pv_shipped',
70
+ 'image_url' => wcv_assets_url . '/images/icons/truck.png',
71
+ );
72
+
73
+ if ( ! $order_page ) {
74
+ printf( '<a class="button tips %s" href="%s" data-tip="%s"><img style="width:16px;height:16px;" src="%s"></a>', $response['action'], $response['url'], $response['name'], $response['image_url'] );
75
+ } else {
76
+ echo $response['name'];
77
+ }
78
+
79
+ return $response;
80
+ }
81
+
82
+
83
+
84
+
85
+ /**
86
+ * Add tools to the woocommerce status tools page
87
+ *
88
+ * @since 1.9.2
89
+ * @access public
90
+ */
91
+ public function wcvendors_tools( $tools ){
92
+
93
+ $tools[ 'reset_wcvendor_roles' ] = array(
94
+ 'name' => __( 'Reset WC Vendors roles ', 'wc-vendors' ),
95
+ 'button' => __( 'Reset WC Vendor Roles', 'wc-vendors' ),
96
+ 'desc' => __( 'This will reset the wcvendors roles ( vendor & pending_vendor ), back to the default capabilities.', 'wc-vendors' ),
97
+ 'callback' => array( 'WCV_Admin_Setup', 'reset_vendor_roles' )
98
+ );
99
+
100
+ $tools[ 'reset_wcvendors' ] = array(
101
+ 'name' => __( 'Reset WC Vendors ', 'wc-vendors' ),
102
+ 'button' => __( 'Reset WC Vendors Settings', 'wc-vendors' ),
103
+ 'desc' => __( 'This will reset wcvendors back to defaults. This DELETES ALL YOUR Settings.', 'wc-vendors' ),
104
+ 'callback' => array( 'WCV_Admin_Setup', 'reset_wcvendors' )
105
+ );
106
+
107
+ return $tools;
108
+
109
+ } // wcvendors_tools()
110
+
111
+ /**
112
+ * Reset the vendor roles
113
+ *
114
+ * @since 1.9.2
115
+ * @access public
116
+ */
117
+ public static function reset_vendor_roles(){
118
+
119
+ $can_add = 'yes' === get_option( 'wcvendors_capability_products_enabled', 'no' ) ? true : false;
120
+ $can_edit = 'yes' === get_option( 'wcvendors_capability_products_edit', 'no' ) ? true : false;
121
+ $can_submit_live = 'yes' === get_option( 'wcvendors_capability_products_live', 'no' ) ? true : false;
122
+
123
+ $args = array(
124
+ 'assign_product_terms' => $can_add,
125
+ 'edit_products' => $can_add || $can_edit,
126
+ 'edit_published_products' => $can_edit,
127
+ 'delete_published_products' => $can_edit,
128
+ 'delete_products' => $can_edit,
129
+ 'manage_product' => $can_add,
130
+ 'publish_products' => $can_submit_live,
131
+ 'delete_posts' => true,
132
+ 'read' => true,
133
+ 'read_products' => $can_edit || $can_add,
134
+ 'upload_files' => true,
135
+ 'import' => true,
136
+ 'view_woocommerce_reports' => false,
137
+ );
138
+
139
+ remove_role( 'vendor' );
140
+ add_role( 'vendor', __('Vendor', 'wc-vendors'), $args );
141
+
142
+ remove_role( 'pending_vendor');
143
+ add_role( 'pending_vendor', __( 'Pending Vendor', 'wc-vendors' ), array(
144
+ 'read' => true,
145
+ 'edit_posts' => false,
146
+ 'delete_posts' => false
147
+ ) );
148
+
149
+ echo '<div class="updated inline"><p>' . __( 'WC Vendor roles successfully reset.', 'wc-vendors' ) . '</p></div>';
150
+
151
+ } // reset_vendor_roles()
152
+
153
+
154
+ /**
155
+ * Reset wcvendors
156
+ *
157
+ * @since 1.9.2
158
+ * @access public
159
+ */
160
+ public static function reset_wcvendors(){
161
+
162
+ delete_option( WC_Vendors::$id . '_options' );
163
+ echo '<div class="updated inline"><p>' . __( 'WC Vendors was successfully reset. All settings have been reset.', 'wc-vendors' ) . '</p></div>';
164
+
165
+ } // reset_wcvendors()
166
+
167
+
168
+
169
+ /*
170
+ * Export commissions via csv
171
+ */
172
+ public function export_commissions(){
173
+
174
+ // prepare the items to export
175
+
176
+
177
+ if ( isset( $_GET['action'], $_GET['nonce'] ) && wp_verify_nonce( wp_unslash( $_GET['nonce'] ), 'export_commissions' ) && 'export_commissions' === wp_unslash( $_GET['action'] ) ) {
178
+
179
+ include_once( 'class-wcv-commissions-csv-exporter.php' );
180
+
181
+ $exporter = new WCV_Commissions_CSV_Export();
182
+
183
+ $date = date( 'Y-M-d' );
184
+
185
+ if ( ! empty( $_GET['com_status'] ) ) { // WPCS: input var ok.
186
+ $exporter->set_filename( 'wcv_commissions_'. wp_unslash( $_GET['com_status'] ) . '-' . $date . '.csv' ); // WPCS: input var ok, sanitization ok.
187
+ } else {
188
+ $exporter->set_filename( 'wcv_commissions-' . $date . '.csv' ); // WPCS: input var ok, sanitization ok.
189
+ }
190
+
191
+ $exporter->export();
192
+ }
193
+
194
+ }
195
+
196
+ /*
197
+ * Export sum commissions via csv
198
+ */
199
+ public function export_sum_commissions(){
200
+
201
+ // prepare the items to export
202
+
203
+
204
+ if ( isset( $_GET['action'], $_GET['nonce'] ) && wp_verify_nonce( wp_unslash( $_GET['nonce'] ), 'export_commission_totals' ) && 'export_commission_totals' === wp_unslash( $_GET['action'] ) ) {
205
+
206
+ include_once( 'class-wcv-commissions-sum-csv-exporter.php' );
207
+
208
+ $exporter = new WCV_Commissions_Sum_CSV_Export();
209
+
210
+ $date = date( 'Y-M-d' );
211
+
212
+ if ( ! empty( $_GET['com_status'] ) ) { // WPCS: input var ok.
213
+ $exporter->set_filename( 'wcv_commissions_sum_'. wp_unslash( $_GET['com_status'] ) . '-' . $date . '.csv' ); // WPCS: input var ok, sanitization ok.
214
+ } else {
215
+ $exporter->set_filename( 'wcv_commissions_sum-' . $date . '.csv' ); // WPCS: input var ok, sanitization ok.
216
+ }
217
+
218
+ $exporter->export();
219
+ }
220
+
221
+ }
222
+
223
+
224
+ /**
225
+ * Add wc vendors screens to woocommerce screen ids to utilise js and css assets from woocommerce.
226
+ *
227
+ * @since 2.0.0
228
+ */
229
+ public function wcv_screen_ids( $screen_ids ) {
230
+
231
+ $screen = get_current_screen();
232
+
233
+ $wcv_screen_ids = wcv_get_screen_ids();
234
+ $screen_ids = array_merge( $wcv_screen_ids, $screen_ids );
235
+
236
+ return $screen_ids;
237
+ }
238
+
239
+
240
+ /**
241
+ * Change the admin footer text on WooCommerce admin pages.
242
+ *
243
+ * @since 2.0.0
244
+ * @param string $footer_text
245
+ * @return string
246
+ */
247
+ public function admin_footer_text( $footer_text ) {
248
+
249
+ if ( ! current_user_can( 'manage_woocommerce' ) || ! function_exists( 'wcv_get_screen_ids' ) ) {
250
+ return $footer_text;
251
+ }
252
+ $current_screen = get_current_screen();
253
+ $wcv_pages = wcv_get_screen_ids();
254
+
255
+ // Set only WC pages.
256
+ // $wcv_pages = array_diff( $wcv_pages, array( 'profile', 'user-edit' ) );
257
+
258
+ // Check to make sure we're on a WooCommerce admin page.
259
+ if ( isset( $current_screen->id ) && apply_filters( 'wcvendors_display_admin_footer_text', in_array( $current_screen->id, $wcv_pages ) ) ) {
260
+ // Change the footer text
261
+ $footer_text = sprintf(
262
+ /* translators: 1: WooCommerce 2:: five stars */
263
+ __( 'If you like %1$s please leave us a %2$s rating. A huge thanks in advance!', 'wc-vendors' ),
264
+ sprintf( '<strong>%s</strong>', esc_html__( 'WC Vendors', 'wc-vendors' ) ),
265
+ '<a href="https://wordpress.org/support/plugin/wc-vendors/reviews?rate=5#new-post" target="_blank" class="wcv-rating-link" data-rated="' . esc_attr__( 'Thanks :)', 'wc-vendors' ) . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
266
+ );
267
+ }
268
+
269
+ return $footer_text;
270
+ }
271
+
272
+ /**
273
+ * Update the vendor role based on the capabilities saved.
274
+ *
275
+ */
276
+ public function update_vendor_role( ){
277
+
278
+ $can_add = 'yes' === get_option( 'wcvendors_capability_products_enabled', 'no' ) ? true : false;
279
+ $can_edit = 'yes' === get_option( 'wcvendors_capability_products_edit', 'no' ) ? true : false;
280
+ $can_submit_live = 'yes' === get_option( 'wcvendors_capability_products_live', 'no' ) ? true : false;
281
+
282
+ $args = array(
283
+ 'assign_product_terms' => $can_add,
284
+ 'edit_products' => $can_add || $can_edit,
285
+ 'edit_published_products' => $can_edit,
286
+ 'delete_published_products' => $can_edit,
287
+ 'delete_products' => $can_edit,
288
+ 'delete_posts' => true,
289
+ 'manage_product' => $can_add,
290
+ 'publish_products' => $can_submit_live,
291
+ 'read' => true,
292
+ 'read_products' => $can_edit || $can_add,
293
+ 'upload_files' => true,
294
+ 'import' => true,
295
+ 'view_woocommerce_reports' => false,
296
+ );
297
+
298
+ remove_role( 'vendor' );
299
+ add_role( 'vendor', __('Vendor', 'wc-vendors'), $args );
300
+
301
+ }
302
+
303
+
304
+ }
trunk/classes/admin/class-wcv-commissions-csv-exporter.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Handles commission CSV export.
4
+ *
5
+ * @version 1.9.14
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ /**
13
+ * Include dependencies.
14
+ */
15
+ if ( ! class_exists( 'WC_CSV_Exporter', false ) ) {
16
+ include_once WC_ABSPATH . 'includes/export/abstract-wc-csv-exporter.php';
17
+ }
18
+
19
+ /**
20
+ * WCV_Commissions_CSV_Export Class.
21
+ */
22
+ class WCV_Commissions_CSV_Export extends WC_CSV_Exporter {
23
+
24
+ /**
25
+ * Constructor.
26
+ */
27
+ public function __construct() {
28
+ $this->column_names = $this->get_default_column_names();
29
+ }
30
+
31
+
32
+ /**
33
+ * Return an array of columns to export.
34
+ *
35
+ * @since 1.9.14
36
+ * @return array
37
+ */
38
+ public function get_default_column_names() {
39
+
40
+ return apply_filters( 'wcv_commissions_export_columns', array(
41
+ 'product_id' => __( 'Product', 'wc-vendors' ),
42
+ 'order_id' => __( 'Order ID', 'wc-vendors' ),
43
+ 'vendor_id' => __( 'Vendor', 'wc-vendors' ),
44
+ 'total_due' => __( 'Commission', 'wc-vendors' ),
45
+ 'total_shipping' => __( 'Shipping', 'wc-vendors' ),
46
+ 'tax' => __( 'Tax', 'wc-vendors' ),
47
+ 'totals' => __( 'Total', 'wc-vendors' ),
48
+ 'status' => __( 'Status', 'wc-vendors' ),
49
+ 'time' => __( 'Date', 'wc-vendors' ),
50
+ ) );
51
+ }
52
+
53
+ /**
54
+ * Prepare data for export.
55
+ *
56
+ * @since 1.9.14
57
+ */
58
+ public function prepare_data_to_export() {
59
+
60
+ global $wpdb;
61
+
62
+ $columns = $this->get_column_names();
63
+
64
+ if ( ! current_user_can( 'manage_options' ) ) return;
65
+
66
+ $orderby = !empty( $_REQUEST[ 'orderby' ] ) ? esc_attr( $_REQUEST[ 'orderby' ] ) : 'time';
67
+ $order = ( !empty( $_REQUEST[ 'order' ] ) && $_REQUEST[ 'order' ] == 'asc' ) ? 'ASC' : 'DESC';
68
+ $com_status = !empty( $_REQUEST[ 'com_status' ] ) ? esc_attr( $_REQUEST[ 'com_status' ] ) : '';
69
+ $vendor_id = !empty( $_REQUEST[ 'vendor_id' ] ) ? esc_attr( $_REQUEST[ 'vendor_id' ] ) : '';
70
+ $status_sql = '';
71
+ $time_sql = '';
72
+
73
+ /**
74
+ * Get items
75
+ */
76
+ $sql = "SELECT COUNT(id) FROM {$wpdb->prefix}pv_commission";
77
+
78
+ if ( !empty( $_GET[ 'm' ] ) ) {
79
+
80
+ $year = substr( $_GET[ 'm' ], 0, 4 );
81
+ $month = substr( $_GET[ 'm' ], 4, 2 );
82
+
83
+ $time_sql = "
84
+ WHERE MONTH(`time`) = '$month'
85
+ AND YEAR(`time`) = '$year'
86
+ ";
87
+
88
+ $sql .= $time_sql;
89
+ }
90
+
91
+ if ( !empty( $_GET[ 'com_status' ] ) ) {
92
+
93
+ if ( $time_sql == '' ) {
94
+ $status_sql = "
95
+ WHERE status = '$com_status'
96
+ ";
97
+ } else {
98
+ $status_sql = "
99
+ AND status = '$com_status'
100
+ ";
101
+ }
102
+
103
+ $sql .= $status_sql;
104
+ }
105
+
106
+
107
+ if ( !empty( $_GET[ 'vendor_id' ] ) ) {
108
+
109
+ if ( $time_sql == '' && $status_sql == '' ) {
110
+ $vendor_sql = "
111
+ WHERE vendor_id = '$vendor_id'
112
+ ";
113
+ } else {
114
+ $vendor_sql = "
115
+ AND vendor_id = '$vendor_id'
116
+ ";
117
+ }
118
+
119
+ $sql .= $vendor_sql;
120
+ }
121
+
122
+ $max = $wpdb->get_var( $sql );
123
+
124
+ $sql = "
125
+ SELECT * FROM {$wpdb->prefix}pv_commission
126
+ ";
127
+
128
+ if ( !empty( $_GET[ 'm' ] ) ) {
129
+ $sql .= $time_sql;
130
+ }
131
+
132
+ if ( !empty( $_GET['com_status'] ) ) {
133
+ $sql .= $status_sql;
134
+ }
135
+
136
+ if ( !empty( $_GET['vendor_id'] ) ) {
137
+ $sql .= $vendor_sql;
138
+ }
139
+
140
+ // $offset = ( $current_page - 1 ) * $per_page;
141
+
142
+ $sql .= "
143
+ ORDER BY `{$orderby}` {$order}
144
+ ";
145
+
146
+ $commissions = $wpdb->get_results( $sql );
147
+
148
+ $this->total_rows = count( $commissions );
149
+ $this->row_data = array();
150
+
151
+ foreach ( $commissions as $commission ) {
152
+
153
+ $row = array();
154
+
155
+ foreach ( $columns as $column_id => $column_name ) {
156
+
157
+ if ( $column_id == 'vendor_id' ) {
158
+ $value = WCV_Vendors::get_vendor_shop_name( $commission->vendor_id );
159
+ } elseif ( $column_id == 'totals' ){
160
+ $totals = ( wc_tax_enabled() ) ? $commission->total_due + $commission->total_shipping + $commission->tax : $commission->total_due + $commission->total_shipping;
161
+ $value = wc_format_localized_price( $totals );
162
+ } else {
163
+ $value = $commission->$column_id;
164
+ }
165
+
166
+
167
+
168
+ $row[ $column_id ] = $value;
169
+ }
170
+
171
+ $this->row_data[] = apply_filters( 'wcv_commissions_export_row_data', $row, $commission );
172
+ }
173
+
174
+ }
175
+ }
trunk/classes/admin/class-wcv-commissions-page.php ADDED
@@ -0,0 +1,554 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !class_exists( 'WP_List_Table' ) ) require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
4
+
5
+ /**
6
+ * WCVendors_Commissions_Page class.
7
+ *
8
+ * @category Admin
9
+ * @package WCVendors/Admin
10
+ * @version 2.0.0
11
+ * @extends WP_List_Table
12
+ */
13
+ class WCVendors_Commissions_Page extends WP_List_Table {
14
+
15
+ public $index;
16
+
17
+ /**
18
+ * __construct function.
19
+ *
20
+ * @access public
21
+ */
22
+ public function __construct() {
23
+ global $status, $page;
24
+
25
+ $this->index = 0;
26
+
27
+ //Set parent defaults
28
+ parent::__construct( array(
29
+ 'singular' => 'commission',
30
+ 'plural' => 'commissions',
31
+ 'ajax' => false
32
+ ) );
33
+ }
34
+
35
+
36
+ /**
37
+ * column_default function.
38
+ *
39
+ * @access public
40
+ *
41
+ * @param unknown $item
42
+ * @param mixed $column_name
43
+ *
44
+ * @return unknown
45
+ */
46
+ public function column_default( $item, $column_name ) {
47
+ global $wpdb;
48
+
49
+ switch ( $column_name ) {
50
+ case 'id' :
51
+ return $item->id;
52
+ case 'vendor_id' :
53
+ $user = get_userdata( $item->vendor_id );
54
+ return '<a href="' . admin_url( 'user-edit.php?user_id=' . $item->vendor_id ) . '">' . WCV_Vendors::get_vendor_shop_name( $item->vendor_id ) . '</a>';
55
+ case 'total_due' :
56
+ return wc_price( $item->total_due );
57
+ case 'total_shipping':
58
+ return wc_price($item->total_shipping );
59
+ case 'tax':
60
+ return wc_price( $item->tax );
61
+ case 'totals' :
62
+ $totals = ( wc_tax_enabled() ) ? $item->total_due + $item->total_shipping + $item->tax : $item->total_due + $item->total_shipping;
63
+ return wc_price( $totals );
64
+ case 'product_id' :
65
+ $parent = get_post_ancestors( $item->product_id );
66
+ $product_id = $parent ? $parent[ 0 ] : $item->product_id;
67
+ $wcv_total_sales = get_post_meta( $product_id, 'total_sales', true );
68
+ if ( ! get_post_status( $product_id ) ) {
69
+ $product_id = WCV_Vendors::find_parent_id_from_order( $item->order_id, $product_id );
70
+ }
71
+ return '<a href="' . admin_url( 'post.php?post=' . $product_id . '&action=edit' ) . '">' . get_the_title( $product_id ) . '</a> (<span title="' . get_the_title( $product_id ) .' has sold ' . $wcv_total_sales . ' times total.">' . $wcv_total_sales . '</span>)';
72
+ case 'order_id' :
73
+ $order = wc_get_order( $item->order_id );
74
+ if ( $order ) {
75
+ return '<a href="' . admin_url( 'post.php?post=' . $item->order_id . '&action=edit' ) . '">' . $order->get_order_number() . '</a>';
76
+ } else {
77
+ return $item->order_id;
78
+ }
79
+ case 'status' :
80
+ return $item->status;
81
+ case 'time' :
82
+ return date_i18n( get_option( 'date_format' ), strtotime( $item->time ) );
83
+ }
84
+ }
85
+
86
+
87
+ /**
88
+ * column_cb function.
89
+ *
90
+ * @access public
91
+ *
92
+ * @param mixed $item
93
+ *
94
+ * @return unknown
95
+ */
96
+ public function column_cb( $item ) {
97
+ return sprintf(
98
+ '<input type="checkbox" name="%1$s[]" value="%2$s" />',
99
+ /*$1%s*/
100
+ 'id',
101
+ /*$2%s*/
102
+ $item->id
103
+ );
104
+ }
105
+
106
+
107
+ /**
108
+ * get_columns function.
109
+ *
110
+ * @access public
111
+ * @return unknown
112
+ */
113
+ public function get_columns() {
114
+ $columns = array(
115
+ 'cb' => '<input type="checkbox" />',
116
+ 'product_id' => __( 'Product', 'wc-vendors' ),
117
+ 'order_id' => __( 'Order ID', 'wc-vendors' ),
118
+ 'vendor_id' => __( 'Vendor', 'wc-vendors' ),
119
+ 'total_due' => __( 'Commission', 'wc-vendors' ),
120
+ 'total_shipping' => __( 'Shipping', 'wc-vendors' ),
121
+ 'tax' => __( 'Tax', 'wc-vendors' ),
122
+ 'totals' => __( 'Total', 'wc-vendors' ),
123
+ 'status' => __( 'Status', 'wc-vendors' ),
124
+ 'time' => __( 'Date', 'wc-vendors' ),
125
+ );
126
+
127
+ if ( ! wc_tax_enabled() ) unset( $columns[ 'tax'] );
128
+
129
+ return $columns;
130
+ }
131
+
132
+
133
+ /**
134
+ * get_sortable_columns function.
135
+ *
136
+ * @access public
137
+ * @return unknown
138
+ */
139
+ public function get_sortable_columns() {
140
+ $sortable_columns = array(
141
+ 'time' => array( 'time', true ),
142
+ 'product_id' => array( 'product_id', false ),
143
+ 'order_id' => array( 'order_id', false ),
144
+ 'total_due' => array( 'total_due', false ),
145
+ 'total_shipping' => array( 'total_shipping', false ),
146
+ 'tax' => array( 'tax', false ),
147
+ 'totals' => array( 'totals', false ),
148
+ 'status' => array( 'status', false ),
149
+ 'vendor_id' => array( 'vendor_id', false ),
150
+ 'status' => array( 'status', false ),
151
+ );
152
+
153
+ if ( ! wc_tax_enabled() ) unset( $sortable_columns[ 'tax'] );
154
+
155
+ return $sortable_columns;
156
+ }
157
+
158
+
159
+ /**
160
+ * Get bulk actions
161
+ *
162
+ * @return unknown
163
+ */
164
+ public function get_bulk_actions() {
165
+ $actions = array(
166
+ 'mark_paid' => __( 'Mark paid', 'wc-vendors' ),
167
+ 'mark_due' => __( 'Mark due', 'wc-vendors' ),
168
+ 'mark_reversed' => __( 'Mark reversed', 'wc-vendors' ),
169
+ // 'delete' => __('Delete', 'wc-vendors'),
170
+ );
171
+
172
+ $actions = apply_filters('wcv_edit_bulk_actions', $actions);
173
+
174
+ return $actions;
175
+ }
176
+
177
+
178
+ /**
179
+ *
180
+ */
181
+ public function extra_tablenav( $which ) {
182
+ $m = isset( $_GET[ 'm' ] ) ? (int) $_GET[ 'm' ] : 0;
183
+ $com_status = isset( $_GET[ 'com_status' ] ) ? $_GET[ 'com_status' ] : '';
184
+ $vendor_id = isset( $_GET[ 'vendor_id' ] ) ? $_GET[ 'vendor_id' ] : '';
185
+ $args_url = '';
186
+
187
+ if ( $m ) $args_url .= '&m='. $m;
188
+ if ( $com_status ) $args_url .= '&com_status='. $com_status;
189
+ if ( $vendor_id ) $args_url .= '&vendor_id='. $vendor_id;
190
+
191
+ if ( $which == 'top' ) {
192
+ echo '<div class="alignleft actions" style="width: 70%;">';
193
+
194
+ // Months drop down
195
+ $this->months_dropdown( 'commission' );
196
+
197
+ // commission status drop down
198
+ $this->status_dropdown( 'commission' );
199
+
200
+ // Vendor drop down
201
+ $this->vendor_dropdown( 'commission' );
202
+
203
+ submit_button( __( 'Filter', 'wc-vendors' ), false, false, false, array( 'id' => "post-query-submit", 'name' => 'do-filter' ) );
204
+ submit_button( __( 'Clear', 'wc-vendors' ), 'secondary', 'reset', false, array( 'type' => 'reset' ) );
205
+
206
+ echo '<a class="button" style="width: 110px; float: left;" href="' . wp_nonce_url( admin_url( 'admin.php?page=wcv-commissions&action=export_commissions'. $args_url ), 'export_commissions', 'nonce' ) . '">' . __('Export to CSV', 'wc-vendors' ) . '</a>';
207
+ echo '<a class="button" style="width: 150px; float: left;" href="' . wp_nonce_url( admin_url( 'admin.php?page=wcv-commissions&action=export_commission_totals'. $args_url ), 'export_commission_totals', 'nonce' ) . '">' . __('Export Totals to CSV', 'wc-vendors' ) . '</a>';
208
+ echo '</div>';
209
+
210
+ }
211
+ }
212
+
213
+
214
+ /**
215
+ * Display a monthly dropdown for filtering items
216
+ *
217
+ * @since 3.1.0
218
+ * @access protected
219
+ *
220
+ * @param unknown $post_type
221
+ */
222
+ public function months_dropdown( $post_type )
223
+ {
224
+ global $wpdb, $wp_locale;
225
+
226
+ $table_name = $wpdb->prefix . "pv_commission";
227
+
228
+ $months = $wpdb->get_results( "
229
+ SELECT DISTINCT YEAR( time ) AS year, MONTH( time ) AS month
230
+ FROM $table_name
231
+ ORDER BY time DESC
232
+ " );
233
+
234
+ $month_count = count( $months );
235
+
236
+ if ( !$month_count || ( 1 == $month_count && 0 == $months[ 0 ]->month ) )
237
+ return;
238
+
239
+ $m = isset( $_GET[ 'm' ] ) ? (int) $_GET[ 'm' ] : 0;
240
+ ?>
241
+ <select name="m" id="filter-by-date" class="wc-enhanced-select-nostd" style="min-width:150px;">
242
+ <option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates', 'wc-vendors' ); ?></option>
243
+ <?php
244
+ foreach ( $months as $arc_row ) {
245
+ if ( 0 == $arc_row->year )
246
+ continue;
247
+
248
+ $month = zeroise( $arc_row->month, 2 );
249
+ $year = $arc_row->year;
250
+
251
+ printf( "<option %s value='%s'>%s</option>\n",
252
+ selected( $m, $year . $month, false ),
253
+ esc_attr( $arc_row->year . $month ),
254
+ /* translators: 1: month name, 2: 4-digit year */
255
+ sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
256
+ );
257
+ }
258
+ ?>
259
+ </select>
260
+
261
+ <?php
262
+ }
263
+
264
+ /**
265
+ * Display a status dropdown for filtering items
266
+ *
267
+ * @since 3.1.0
268
+ * @access protected
269
+ *
270
+ * @param unknown $post_type
271
+ */
272
+ public function status_dropdown( $post_type )
273
+ {
274
+ $com_status = isset( $_GET[ 'com_status' ] ) ? $_GET[ 'com_status' ] : '';
275
+ ?>
276
+ <select name="com_status" class="wc-enhanced-select">
277
+ <option<?php selected( $com_status, '' ); ?> value=''><?php _e( 'Show all Statuses', 'wc-vendors' ); ?></option>
278
+ <option<?php selected( $com_status, 'due' ); ?> value="due"><?php _e( 'Due', 'wc-vendors' ); ?></option>
279
+ <option<?php selected( $com_status, 'paid' ); ?> value="paid"><?php _e( 'Paid', 'wc-vendors' ); ?></option>
280
+ <option<?php selected( $com_status, 'reversed' ); ?> value="reversed"><?php _e( 'Reversed', 'wc-vendors' ); ?></option>
281
+ </select>
282
+ <?php
283
+ }
284
+
285
+ /**
286
+ * Display a vendor dropdown for filtering commissions
287
+ *
288
+ * @since 1.9.2
289
+ * @access public
290
+ *
291
+ * @param unknown $post_type
292
+ */
293
+ public function vendor_dropdown( $post_type ){
294
+
295
+ $user_args = array( 'fields' => array( 'ID', 'display_name' ) );
296
+ $vendor_id = isset( $_GET[ 'vendor_id' ] ) ? $_GET[ 'vendor_id' ] : '';
297
+ $new_args = $user_args;
298
+ $new_args[ 'role' ] = 'vendor';
299
+ $users = get_users( $new_args );
300
+
301
+ // Generate the drop down
302
+ $output = '<select style="width:250px;" name="vendor_id" id="vendor_id" class="wc-enhanced-select">';
303
+ $output .= "<option></option>";
304
+ foreach ( (array) $users as $user ) {
305
+ $select = selected( $user->ID, $vendor_id, false );
306
+ $output .= "<option value='$user->ID' $select>$user->display_name</option>";
307
+ }
308
+ $output .= '</select>';
309
+
310
+ echo $output;
311
+
312
+ } // vendor_dropdown()
313
+
314
+
315
+
316
+ /**
317
+ * Process bulk actions
318
+ *
319
+ * @return unknown
320
+ */
321
+ public function process_bulk_action()
322
+ {
323
+ if ( !isset( $_GET[ 'id' ] ) ) return;
324
+
325
+ $items = array_map( 'intval', $_GET[ 'id' ] );
326
+ $ids = implode( ',', $items );
327
+
328
+ switch ( $this->current_action() ) {
329
+ case 'mark_paid':
330
+ $result = $this->mark_paid( $ids );
331
+
332
+ if ( $result )
333
+ echo '<div class="updated"><p>' . __( 'Commission marked paid.', 'wc-vendors' ) . '</p></div>';
334
+ break;
335
+
336
+ case 'mark_due':
337
+ $result = $this->mark_due( $ids );
338
+
339
+ if ( $result )
340
+ echo '<div class="updated"><p>' . __( 'Commission marked due.', 'wc-vendors' ) . '</p></div>';
341
+ break;
342
+
343
+ case 'mark_reversed':
344
+ $result = $this->mark_reversed( $ids );
345
+
346
+ if ( $result )
347
+ echo '<div class="updated"><p>' . __( 'Commission marked reversed.', 'wc-vendors' ) . '</p></div>';
348
+ break;
349
+
350
+ default:
351
+ // code...
352
+ do_action('wcv_edit_process_bulk_actions', $this->current_action(), $ids);
353
+ break;
354
+ }
355
+
356
+ }
357
+
358
+
359
+ /**
360
+ *
361
+ *
362
+ * @param unknown $ids (optional)
363
+ *
364
+ * @return unknown
365
+ */
366
+ public function mark_paid( $ids = array() )
367
+ {
368
+ global $wpdb;
369
+
370
+ $table_name = $wpdb->prefix . "pv_commission";
371
+
372
+ $query = "UPDATE `{$table_name}` SET `status` = 'paid' WHERE id IN ($ids) AND `status` = 'due'";
373
+ $result = $wpdb->query( $query );
374
+
375
+ return $result;
376
+ }
377
+
378
+
379
+ /**
380
+ *
381
+ *
382
+ * @param unknown $ids (optional)
383
+ *
384
+ * @return unknown
385
+ */
386
+ public function mark_reversed( $ids = array() )
387
+ {
388
+ global $wpdb;
389
+
390
+ $table_name = $wpdb->prefix . "pv_commission";
391
+ $query = "UPDATE `{$table_name}` SET `status` = 'reversed' WHERE id IN ($ids)";
392
+ $result = $wpdb->query( $query );
393
+
394
+ return $result;
395
+
396
+ }
397
+
398
+
399
+ /**
400
+ *
401
+ *
402
+ * @param unknown $ids (optional)
403
+ *
404
+ * @return unknown
405
+ */
406
+ public function mark_due( $ids = array() )
407
+ {
408
+ global $wpdb;
409
+
410
+ $table_name = $wpdb->prefix . "pv_commission";
411
+
412
+ $query = "UPDATE `{$table_name}` SET `status` = 'due' WHERE id IN ($ids)";
413
+ $result = $wpdb->query( $query );
414
+
415
+ return $result;
416
+ }
417
+
418
+
419
+ /**
420
+ * cubrid_prepare(conn_identifier, prepare_stmt)_items function.
421
+ *
422
+ * @access public
423
+ */
424
+ public function prepare_items() {
425
+ global $wpdb;
426
+
427
+
428
+ $_SERVER['REQUEST_URI'] = remove_query_arg( '_wp_http_referer', $_SERVER['REQUEST_URI'] );
429
+
430
+ $per_page = $this->get_items_per_page( 'commissions_per_page', 10 );
431
+ $current_page = $this->get_pagenum();
432
+
433
+ $orderby = !empty( $_REQUEST[ 'orderby' ] ) ? esc_attr( $_REQUEST[ 'orderby' ] ) : 'time';
434
+ $order = ( !empty( $_REQUEST[ 'order' ] ) && $_REQUEST[ 'order' ] == 'asc' ) ? 'ASC' : 'DESC';
435
+ $com_status = !empty( $_REQUEST[ 'com_status' ] ) ? esc_attr( $_REQUEST[ 'com_status' ] ) : '';
436
+ $vendor_id = !empty( $_REQUEST[ 'vendor_id' ] ) ? esc_attr( $_REQUEST[ 'vendor_id' ] ) : '';
437
+ $status_sql = '';
438
+ $time_sql = '';
439
+
440
+ /**
441
+ * Init column headers
442
+ */
443
+ $this->_column_headers = $this->get_column_info();
444
+
445
+ /**
446
+ * Process bulk actions
447
+ */
448
+ $this->process_bulk_action();
449
+
450
+ /**
451
+ * Get items
452
+ */
453
+ $sql = "SELECT COUNT(id) FROM {$wpdb->prefix}pv_commission";
454
+
455
+ if ( !empty( $_GET[ 'm' ] ) ) {
456
+
457
+ $year = substr( $_GET[ 'm' ], 0, 4 );
458
+ $month = substr( $_GET[ 'm' ], 4, 2 );
459
+
460
+ $time_sql = "
461
+ WHERE MONTH(`time`) = '$month'
462
+ AND YEAR(`time`) = '$year'
463
+ ";
464
+
465
+ $sql .= $time_sql;
466
+ }
467
+
468
+ if ( !empty( $_GET[ 'com_status' ] ) ) {
469
+
470
+ if ( $time_sql == '' ) {
471
+ $status_sql = "
472
+ WHERE status = '$com_status'
473
+ ";
474
+ } else {
475
+ $status_sql = "
476
+ AND status = '$com_status'
477
+ ";
478
+ }
479
+
480
+ $sql .= $status_sql;
481
+ }
482
+
483
+
484
+ if ( !empty( $_GET[ 'vendor_id' ] ) ) {
485
+
486
+ if ( $time_sql == '' && $status_sql == '' ) {
487
+ $vendor_sql = "
488
+ WHERE vendor_id = '$vendor_id'
489
+ ";
490
+ } else {
491
+ $vendor_sql = "
492
+ AND vendor_id = '$vendor_id'
493
+ ";
494
+ }
495
+
496
+ $sql .= $vendor_sql;
497
+ }
498
+
499
+ $max = $wpdb->get_var( $sql );
500
+
501
+ $sql = "
502
+ SELECT * FROM {$wpdb->prefix}pv_commission
503
+ ";
504
+
505
+ if ( !empty( $_GET[ 'm' ] ) ) {
506
+ $sql .= $time_sql;
507
+ }
508
+
509
+ if ( !empty( $_GET['com_status'] ) ) {
510
+ $sql .= $status_sql;
511
+ }
512
+
513
+ if ( !empty( $_GET['vendor_id'] ) ) {
514
+ $sql .= $vendor_sql;
515
+ }
516
+
517
+ $offset = ( $current_page - 1 ) * $per_page;
518
+
519
+ $sql .= "
520
+ ORDER BY `{$orderby}` {$order}
521
+ LIMIT {$offset}, {$per_page}
522
+ ";
523
+
524
+ // $this->items = $wpdb->get_results( $wpdb->prepare( $sql, ( $current_page - 1 ) * $per_page, $per_page ) );
525
+ $this->items = $wpdb->get_results( $sql );
526
+
527
+ /**
528
+ * Pagination
529
+ */
530
+ $this->set_pagination_args( array(
531
+ 'total_items' => $max,
532
+ 'per_page' => $per_page,
533
+ 'total_pages' => ceil( $max / $per_page )
534
+ ) );
535
+ }
536
+
537
+ /**
538
+ * Get Views for commissions page
539
+ *
540
+ */
541
+ public function get_views() {
542
+ $views = array(
543
+ 'all' => '<li class="all"><a href="' . admin_url( 'admin.php?page=wcv-commissions' ) . '">' . __( 'All', 'wc-vendors' ) . '</a></li>',
544
+ 'due' => '<li class="all"><a href="' . admin_url( 'admin.php?page=wcv-commissions&com_status=due' ) . '">' . __( 'Due', 'wc-vendors' ) . '</a></li>',
545
+ 'paid' => '<li class="all"><a href="' . admin_url( 'admin.php?page=wcv-commissions&com_status=paid' ) . '">' . __( 'Paid', 'wc-vendors' ) . '</a></li>',
546
+ 'void' => '<li class="all"><a href="' . admin_url( 'admin.php?page=wcv-commissions&com_status=reversed' ) . '">' . __( 'Reversed', 'wc-vendors' ) . '</a></li>',
547
+ );
548
+
549
+ return $views;
550
+ }
551
+
552
+
553
+
554
+ }
trunk/classes/admin/class-wcv-commissions-sum-csv-exporter.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Handles commission CSV export.
4
+ *
5
+ * @version 1.9.14
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ /**
13
+ * Include dependencies.
14
+ */
15
+ if ( ! class_exists( 'WC_CSV_Exporter', false ) ) {
16
+ include_once WC_ABSPATH . 'includes/export/abstract-wc-csv-exporter.php';
17
+ }
18
+
19
+ /**
20
+ * WCV_Commissions_CSV_Export Class.
21
+ */
22
+ class WCV_Commissions_Sum_CSV_Export extends WC_CSV_Exporter {
23
+
24
+ /**
25
+ * Constructor.
26
+ */
27
+ public function __construct() {
28
+ $this->column_names = $this->get_default_column_names();
29
+ }
30
+
31
+
32
+ /**
33
+ * Return an array of columns to export.
34
+ *
35
+ * @since 1.9.14
36
+ * @return array
37
+ */
38
+ public function get_default_column_names() {
39
+
40
+ return apply_filters( 'wcv_commissions_sum_export_columns', array(
41
+ 'vendor_id' => __( 'Vendor', 'wc-vendors' ),
42
+ 'total_due' => __( 'Total', 'wc-vendors' ),
43
+ 'status' => __( 'Commission Status', 'wc-vendors' ),
44
+ ) );
45
+ }
46
+
47
+ /**
48
+ * Prepare data for export.
49
+ *
50
+ * @since 1.9.14
51
+ */
52
+ public function prepare_data_to_export() {
53
+
54
+ global $wpdb;
55
+
56
+ $columns = $this->get_column_names();
57
+
58
+ if ( ! current_user_can( 'manage_options' ) ) return;
59
+
60
+ $sum_totals = WCV_Commission::get_sum_vendor_totals();
61
+ $this->total_rows = count( $sum_totals );
62
+ $this->row_data = array();
63
+
64
+ foreach ( $sum_totals as $status => $totals ) {
65
+ $row = array();
66
+ foreach ( $totals as $vendor_id => $total ) {
67
+
68
+ foreach ( $columns as $column_id => $column_name ) {
69
+ if ( $column_id == 'vendor_id' ) {
70
+ $value = WCV_Vendors::get_vendor_shop_name( $vendor_id );
71
+ } elseif ( $column_id == 'total_due' ){
72
+ $value = wc_format_localized_price( $total );
73
+ } else {
74
+ $value = $status;
75
+ }
76
+
77
+ $row[ $column_id ] = $value;
78
+ }
79
+
80
+ $this->row_data[] = apply_filters( 'wcv_sum_commissions_export_row_data', $row, $vendor_id, $total, $status );
81
+ }
82
+ }
83
+
84
+ }
85
+ }
trunk/classes/admin/emails/class-emails.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ /**
6
+ *
7
+ *
8
+ * @author Matt Gates <http://mgates.me>
9
+ * @package
10
+ */
11
+
12
+
13
+ class WCV_Emails
14
+ {
15
+
16
+
17
+ /**
18
+ *
19
+ */
20
+ public function __construct() {
21
+
22
+ add_filter( 'woocommerce_email_classes', array( $this, 'email_classes' ) );
23
+ add_filter( 'woocommerce_order_actions', array( $this, 'order_actions' ) );
24
+ add_action( 'woocommerce_order_action_send_vvendor_new_order', array( $this, 'order_actions_save') );
25
+ // Deprecaited
26
+
27
+ add_action( 'set_user_role', array( $this, 'application_status_email' ), 10, 2 );
28
+ add_action( 'transition_post_status', array( $this, 'trigger_new_product' ), 10, 3 );
29
+
30
+ // Low stock
31
+ // These fatal error in WC3.3.3 @todo fix !
32
+ add_filter( 'woocommerce_email_recipient_low_stock', array( $this, 'vendor_stock_email'), 10, 2 );
33
+ add_filter( 'woocommerce_email_recipient_no_stock', array( $this, 'vendor_stock_email'), 10, 2 );
34
+ add_filter( 'woocommerce_email_recipient_backorder', array( $this, 'vendor_stock_email'), 10, 2 );
35
+
36
+ // New emails
37
+ // Triggers
38
+ add_action( 'wcvendors_vendor_ship', array( $this, 'vendor_shipped' ), 10, 3 );
39
+ add_action( 'wcvendors_email_order_details',array( $this, 'vendor_order_details'), 10, 8 );
40
+ add_action( 'transition_post_status', array( $this, 'new_vendor_product' ), 10, 3 );
41
+ add_action( 'set_user_role', array( $this, 'vendor_application' ), 10, 2 );
42
+
43
+ }
44
+
45
+
46
+ // Depreciated
47
+ public function trigger_new_product( $from, $to, $post )
48
+ {
49
+ global $woocommerce;
50
+
51
+ if ( $from != $to && $post->post_status == 'pending' && WCV_Vendors::is_vendor( $post->post_author ) && $post->post_type == 'product' ) {
52
+ $mails = $woocommerce->mailer()->get_emails();
53
+ if ( !empty( $mails ) ) {
54
+ $mails[ 'WC_Email_Notify_Admin' ]->trigger( $post->post_id, $post );
55
+ }
56
+ }
57
+ }
58
+
59
+
60
+ /**
61
+ * @depreciated
62
+ *
63
+ * @param unknown $user_id
64
+ * @param unknown $role
65
+ */
66
+ public function application_status_email( $user_id, $role ) {
67
+
68
+ global $woocommerce;
69
+
70
+ if ( !empty( $_POST[ 'apply_for_vendor' ] ) || ( !empty( $_GET[ 'action' ] ) && ( $_GET[ 'action' ] == 'approve_vendor' || $_GET[ 'action' ] == 'deny_vendor' ) ) ) {
71
+
72
+ if ( $role == 'pending_vendor' ) {
73
+ $status = __( 'pending', 'wc-vendors' );
74
+ } else if ( $role == 'vendor' ) {
75
+ $status = __( 'approved', 'wc-vendors' );
76
+ } else if ( !empty( $_GET[ 'action' ] ) && $_GET[ 'action' ] == 'deny_vendor' ) {
77
+ $status = __( 'denied', 'wc-vendors' );
78
+ }
79
+
80
+ $mails = $woocommerce->mailer()->get_emails();
81
+
82
+ if ( isset( $status ) && !empty( $mails ) ) {
83
+ $mails[ 'WC_Email_Approve_Vendor' ]->trigger( $user_id, $status );
84
+ }
85
+ }
86
+ }
87
+
88
+ /**
89
+ *
90
+ *
91
+ * @param unknown $emails
92
+ *
93
+ * @return unknown
94
+ */
95
+ public function email_classes( $emails ){
96
+
97
+ require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-notify-admin.php';
98
+ require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-notify-vendor.php';
99
+ require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-approve-vendor.php';
100
+ require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-notify-shipped.php';
101
+
102
+ // Emails to depreciate
103
+ $emails[ 'WC_Email_Notify_Vendor' ] = new WC_Email_Notify_Vendor();
104
+ $emails[ 'WC_Email_Approve_Vendor' ] = new WC_Email_Approve_Vendor();
105
+ $emails[ 'WC_Email_Notify_Admin' ] = new WC_Email_Notify_Admin();
106
+ $emails[ 'WC_Email_Notify_Shipped' ] = new WC_Email_Notify_Shipped();
107
+
108
+ // New emails introduced in @since 2.0.0
109
+ $emails[ 'WCVendors_Customer_Notify_Shipped'] = include( wcv_plugin_dir . 'classes/admin/emails/class-wcv-customer-notify-shipped.php' );
110
+ $emails[ 'WCVendors_Admin_Notify_Shipped'] = include( wcv_plugin_dir . 'classes/admin/emails/class-wcv-admin-notify-shipped.php' );
111
+ $emails[ 'WCVendors_Admin_Notify_Product'] = include( wcv_plugin_dir . 'classes/admin/emails/class-wcv-admin-notify-product.php' );
112
+ $emails[ 'WCVendors_Admin_Notify_Application'] = include( wcv_plugin_dir . 'classes/admin/emails/class-wcv-admin-notify-application.php' );
113
+ $emails[ 'WCVendors_Vendor_Notify_Application'] = include( wcv_plugin_dir . 'classes/admin/emails/class-wcv-vendor-notify-application.php' );
114
+ $emails[ 'WCVendors_Vendor_Notify_Approved'] = include( wcv_plugin_dir . 'classes/admin/emails/class-wcv-vendor-notify-approved.php' );
115
+ $emails[ 'WCVendors_Vendor_Notify_Denied'] = include( wcv_plugin_dir . 'classes/admin/emails/class-wcv-vendor-notify-denied.php' );
116
+ $emails[ 'WCVendors_Vendor_Notify_Order'] = include( wcv_plugin_dir . 'classes/admin/emails/class-wcv-vendor-notify-order.php' );
117
+
118
+ return $emails;
119
+
120
+ } // email_classes()
121
+
122
+ /**
123
+ * Add the vendor email to the low stock emails.
124
+ *
125
+ */
126
+ public function vendor_stock_email( $emails, $product ) {
127
+
128
+ if ( ! is_a( $product, 'WC_Product' ) ) return;
129
+
130
+ $post = get_post( $product->get_id() );
131
+
132
+ if ( WCV_Vendors::is_vendor( $post->post_author ) ) {
133
+ $vendor_data = get_userdata( $post->post_author );
134
+ $vendor_email = $vendor_data->user_email;
135
+ $emails .= ','.$vendor_email;
136
+ }
137
+
138
+ return $emails;
139
+
140
+ }
141
+
142
+ /**
143
+ * Filter hook for order actions meta box
144
+ *
145
+ */
146
+ public function order_actions( $order_actions ){
147
+ $order_actions[ 'send_vvendor_new_order' ] = sprintf( __( 'Resend %s new order notification', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
148
+ return $order_actions;
149
+ }
150
+
151
+ /**
152
+ * Action hook : trigger the notify vendor email
153
+ *
154
+ */
155
+ public function order_actions_save( $order ){
156
+
157
+ WC()->mailer()->emails[ 'WC_Email_Notify_Vendor' ]->trigger( $order->get_id(), $order );
158
+ WC()->mailer()->emails[ 'WCVendors_Vendor_Notify_Order' ]->trigger( $order->get_id(), $order );
159
+ }
160
+
161
+ /**
162
+ * Trigger the notify vendor shipped emails
163
+ *
164
+ * @since 2.0.0
165
+ */
166
+ public function vendor_shipped( $order_id, $user_id, $order ){
167
+ // Notify the admin
168
+ WC()->mailer()->emails[ 'WCVendors_Admin_Notify_Shipped' ]->trigger( $order->get_id(), $user_id, $order );
169
+ // Notify the customer
170
+ WC()->mailer()->emails[ 'WCVendors_Customer_Notify_Shipped' ]->trigger( $order->get_id(), $user_id, $order );
171
+ }
172
+
173
+
174
+ /**
175
+ * Trigger the notify admin new vendor product
176
+ *
177
+ * @since 2.0.0
178
+ */
179
+ public function new_vendor_product( $from, $to, $post ){
180
+
181
+ if ( $from != $to && $post->post_status == 'pending' && WCV_Vendors::is_vendor( $post->post_author ) && $post->post_type == 'product' ) {
182
+
183
+ WC()->mailer()->emails[ 'WCVendors_Admin_Notify_Product' ]->trigger( $post->post_id, $post );
184
+ }
185
+ }
186
+
187
+ /**
188
+ * Trigger the vendor application emails
189
+ *
190
+ * @since 2.0.0
191
+ */
192
+ public function vendor_application( $user_id, $role ){
193
+
194
+ if ( !empty( $_POST[ 'apply_for_vendor' ] ) || ( !empty( $_GET[ 'action' ] ) && ( $_GET[ 'action' ] == 'approve_vendor' || $_GET[ 'action' ] == 'deny_vendor' ) ) ) {
195
+
196
+ if ( $role == 'pending_vendor' ) {
197
+ WC()->mailer()->emails[ 'WCVendors_Vendor_Notify_Application' ]->trigger( $user_id, __( 'pending', 'wc-vendors' ) );
198
+ } else if ( $role == 'vendor' ) {
199
+ WC()->mailer()->emails[ 'WCVendors_Vendor_Notify_Approved' ]->trigger( $user_id );
200
+ } else if ( !empty( $_GET[ 'action' ] ) && $_GET[ 'action' ] == 'deny_vendor' ) {
201
+ $reason = isset( $_GET[ 'reason' ] ) ? $_GET[ 'reason' ] : '';
202
+ WC()->mailer()->emails[ 'WCVendors_Vendor_Notify_Denied' ]->trigger( $user_id, $reason );
203
+ }
204
+
205
+ WC()->mailer()->emails[ 'WCVendors_Admin_Notify_Application' ]->trigger( $user_id, $role );
206
+
207
+ }
208
+ }
209
+
210
+
211
+ /*
212
+ * Show the order details table filtered for each vendor
213
+ */
214
+ public function vendor_order_details( $order, $vendor_items, $totals_display, $vendor_id, $sent_to_vendor = false, $sent_to_admin = false, $plain_text = false, $email = '' ) {
215
+
216
+
217
+ if ( $plain_text ) {
218
+
219
+ wc_get_template( 'emails/plain/vendor-order-details.php', array(
220
+ 'order' => $order,
221
+ 'vendor_id' => $vendor_id,
222
+ 'vendor_items' => $vendor_items,
223
+ 'sent_to_admin' => $sent_to_admin,
224
+ 'sent_to_vendor' => $sent_to_vendor,
225
+ 'totals_display' => $totals_display,
226
+ 'plain_text' => $plain_text,
227
+ 'email' => $email ),
228
+ 'woocommerce', WCV_TEMPLATE_BASE );
229
+
230
+ } else {
231
+
232
+ wc_get_template( 'emails/vendor-order-details.php', array(
233
+ 'order' => $order,
234
+ 'vendor_id' => $vendor_id,
235
+ 'vendor_items' => $vendor_items,
236
+ 'sent_to_admin' => $sent_to_admin,
237
+ 'sent_to_vendor' => $sent_to_vendor,
238
+ 'totals_display' => $totals_display,
239
+ 'plain_text' => $plain_text,
240
+ 'email' => $email ),
241
+ 'woocommerce', WCV_TEMPLATE_BASE );
242
+ }
243
+ }
244
+ }
trunk/classes/admin/emails/class-wc-approve-vendor.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ /**
6
+ * New Order Email
7
+ *
8
+ * An email sent to the admin when a new order is received/paid for.
9
+ *
10
+ * @class WC_Email_Approve_Vendor
11
+ * @version 2.0.0
12
+ * @extends WC_Email
13
+ * @author WooThemes
14
+ * @package WooCommerce/Classes/Emails
15
+ */
16
+
17
+
18
+ class WC_Email_Approve_Vendor extends WC_Email
19
+ {
20
+
21
+
22
+ /**
23
+ * Constructor
24
+ */
25
+ function __construct()
26
+ {
27
+ $this->id = 'vendor_application';
28
+ $this->title = __( 'Vendor Application', 'wc-vendors' );
29
+ $this->description = __( 'Vendor application will either be approved, denied, or pending. <strong>This email has been depreciated.</strong>', 'wc-vendors' );
30
+
31
+ $this->heading = __( 'Application {status}', 'wc-vendors' );
32
+ $this->subject = __( '[{blogname}] Your vendor application has been {status}', 'wc-vendors' );
33
+
34
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/emails/';
35
+ $this->template_html = 'application-status.php';
36
+ $this->template_plain = 'application-status.php';
37
+
38
+ // Call parent constuctor
39
+ parent::__construct();
40
+
41
+ // Other settings
42
+ $this->recipient = $this->get_option( 'recipient' );
43
+
44
+ if ( !$this->recipient )
45
+ $this->recipient = get_option( 'admin_email' );
46
+ }
47
+
48
+ /**
49
+ * trigger function.
50
+ *
51
+ * @access public
52
+ * @return void
53
+ *
54
+ * @param unknown $order_id
55
+ */
56
+ function trigger( $user_id, $status )
57
+ {
58
+ if ( !$this->is_enabled() ) return;
59
+
60
+ $this->find[ ] = '{status}';
61
+ $this->replace[ ] = $status;
62
+
63
+ $this->status = $status;
64
+
65
+ $this->user = get_userdata( $user_id );
66
+ $user_email = $this->user->user_email;
67
+
68
+ $this->send( $user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
69
+
70
+ if ( $status == __( 'pending', 'wc-vendors' ) ) {
71
+ $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
72
+ }
73
+ }
74
+
75
+ /**
76
+ * get_content_html function.
77
+ *
78
+ * @access public
79
+ * @return string
80
+ */
81
+ function get_content_html()
82
+ {
83
+ ob_start();
84
+ wc_get_template( $this->template_html, array(
85
+ 'status' => $this->status,
86
+ 'user' => $this->user,
87
+ 'email_heading' => $this->get_heading()
88
+ ), 'woocommerce', $this->template_base );
89
+
90
+ return ob_get_clean();
91
+ }
92
+
93
+
94
+ /**
95
+ * get_content_plain function.
96
+ *
97
+ * @access public
98
+ * @return string
99
+ */
100
+ function get_content_plain()
101
+ {
102
+ ob_start();
103
+ wc_get_template( $this->template_plain, array(
104
+ 'status' => $this->status,
105
+ 'user' => $this->user,
106
+ 'email_heading' => $this->get_heading()
107
+ ), 'woocommerce', $this->template_base );
108
+
109
+ return ob_get_clean();
110
+ }
111
+
112
+
113
+ /**
114
+ * Initialise Settings Form Fields
115
+ *
116
+ * @access public
117
+ * @return void
118
+ */
119
+ function init_form_fields()
120
+ {
121
+ $this->form_fields = array(
122
+ 'enabled' => array(
123
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
124
+ 'type' => 'checkbox',
125
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
126
+ 'default' => 'no'
127
+ ),
128
+ 'recipient' => array(
129
+ 'title' => __( 'Recipient(s)', 'woocommerce' ),
130
+ 'type' => 'text',
131
+ 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', 'wc-vendors' ), esc_attr( get_option( 'admin_email' ) ) ),
132
+ 'placeholder' => '',
133
+ 'default' => ''
134
+ ),
135
+ 'subject' => array(
136
+ 'title' => __( 'Subject', 'wc-vendors' ),
137
+ 'type' => 'text',
138
+ 'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wc-vendors' ), $this->subject ),
139
+ 'placeholder' => '',
140
+ 'default' => ''
141
+ ),
142
+ 'heading' => array(
143
+ 'title' => __( 'Email Heading', 'wc-vendors' ),
144
+ 'type' => 'text',
145
+ 'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wc-vendors' ), $this->heading ),
146
+ 'placeholder' => '',
147
+ 'default' => ''
148
+ ),
149
+ 'email_type' => array(
150
+ 'title' => __( 'Email type', 'wc-vendors' ),
151
+ 'type' => 'select',
152
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
153
+ 'default' => 'html',
154
+ 'class' => 'email_type',
155
+ 'options' => array(
156
+ 'plain' => __( 'Plain text', 'wc-vendors' ),
157
+ 'html' => __( 'HTML', 'wc-vendors' ),
158
+ 'multipart' => __( 'Multipart', 'wc-vendors' ),
159
+ )
160
+ )
161
+ );
162
+ }
163
+
164
+
165
+ }
trunk/classes/admin/emails/class-wc-notify-admin.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ /**
6
+ * New Order Email
7
+ *
8
+ * An email sent to the admin when a new product is created.
9
+ *
10
+ * @class WC_Email_Notify_Admin
11
+ * @version 2.0.0
12
+ * @extends WC_Email
13
+ * @author WooThemes
14
+ * @package WooCommerce/Classes/Emails
15
+ */
16
+
17
+
18
+ class WC_Email_Notify_Admin extends WC_Email
19
+ {
20
+
21
+
22
+ /**
23
+ * Constructor
24
+ */
25
+ function __construct()
26
+ {
27
+ $this->id = 'admin_new_vendor_product';
28
+ $this->title = __( 'New Vendor Product', 'wc-vendors' );
29
+ $this->description = __( 'New order emails are sent when a new product is submitted by a vendor. <strong>This email has been depreciated.</strong>', 'wc-vendors' );
30
+
31
+ $this->heading = __( 'New product submitted: {product_name}', 'wc-vendors' );
32
+ $this->subject = __( '[{blogname}] New product submitted by {vendor_name} - {product_name}', 'wc-vendors' );
33
+
34
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/emails/';
35
+ $this->template_html = 'new-product.php';
36
+ $this->template_plain = 'new-product.php';
37
+
38
+ // Triggers for this email
39
+ add_action( 'pending_product', array( $this, 'trigger' ), 10, 2 );
40
+ add_action( 'pending_product_variation', array( $this, 'trigger' ), 10, 2 );
41
+
42
+ // Call parent constuctor
43
+ parent::__construct();
44
+
45
+ // Other settings
46
+ $this->recipient = $this->get_option( 'recipient' );
47
+
48
+ if ( !$this->recipient )
49
+ $this->recipient = get_option( 'admin_email' );
50
+ }
51
+
52
+
53
+ /**
54
+ * trigger function.
55
+ *
56
+ * @access public
57
+ * @return void
58
+ *
59
+ * @param unknown $order_id
60
+ */
61
+ function trigger( $id, $post )
62
+ {
63
+
64
+ // Ensure that the post author is a vendor
65
+ if ( !WCV_Vendors::is_vendor( $post->post_author ) ) {
66
+ return;
67
+ }
68
+
69
+ if ( !$this->is_enabled() ) return;
70
+
71
+ $this->find[ ] = '{product_name}';
72
+ $this->product_name = $post->post_title;
73
+ $this->replace[ ] = $this->product_name;
74
+
75
+ $this->find[ ] = '{vendor_name}';
76
+ $this->vendor_name = WCV_Vendors::get_vendor_shop_name( $post->post_author );
77
+ $this->replace[ ] = $this->vendor_name;
78
+
79
+ $this->post_id = $post->ID;
80
+
81
+ $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
82
+ }
83
+
84
+ /**
85
+ * get_content_html function.
86
+ *
87
+ * @access public
88
+ * @return string
89
+ */
90
+ function get_content_html()
91
+ {
92
+ ob_start();
93
+ wc_get_template( $this->template_html, array(
94
+ 'product_name' => $this->product_name,
95
+ 'vendor_name' => $this->vendor_name,
96
+ 'post_id' => $this->post_id,
97
+ 'email_heading' => $this->get_heading()
98
+ ), 'woocommerce', $this->template_base );
99
+
100
+ return ob_get_clean();
101
+ }
102
+
103
+
104
+ /**
105
+ * get_content_plain function.
106
+ *
107
+ * @access public
108
+ * @return string
109
+ */
110
+ function get_content_plain()
111
+ {
112
+ ob_start();
113
+ wc_get_template( $this->template_plain, array(
114
+ 'product_name' => $this->product_name,
115
+ 'vendor_name' => $this->vendor_name,
116
+ 'post_id' => $this->post_id,
117
+ 'email_heading' => $this->get_heading()
118
+ ), 'woocommerce', $this->template_base );
119
+
120
+ return ob_get_clean();
121
+ }
122
+
123
+
124
+ /**
125
+ * Initialise Settings Form Fields
126
+ *
127
+ * @access public
128
+ * @return void
129
+ */
130
+ function init_form_fields()
131
+ {
132
+ $this->form_fields = array(
133
+ 'enabled' => array(
134
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
135
+ 'type' => 'checkbox',
136
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
137
+ 'default' => 'no'
138
+ ),
139
+ 'recipient' => array(
140
+ 'title' => __( 'Recipient(s)', 'woocommerce' ),
141
+ 'type' => 'text',
142
+ 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', 'wc-vendors' ), esc_attr( get_option( 'admin_email' ) ) ),
143
+ 'placeholder' => '',
144
+ 'default' => ''
145
+ ),
146
+ 'subject' => array(
147
+ 'title' => __( 'Subject', 'wc-vendors' ),
148
+ 'type' => 'text',
149
+ 'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wc-vendors' ), $this->subject ),
150
+ 'placeholder' => '',
151
+ 'default' => ''
152
+ ),
153
+ 'heading' => array(
154
+ 'title' => __( 'Email Heading', 'wc-vendors' ),
155
+ 'type' => 'text',
156
+ 'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wc-vendors' ), $this->heading ),
157
+ 'placeholder' => '',
158
+ 'default' => ''
159
+ ),
160
+ 'email_type' => array(
161
+ 'title' => __( 'Email type', 'wc-vendors' ),
162
+ 'type' => 'select',
163
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
164
+ 'default' => 'html',
165
+ 'class' => 'email_type',
166
+ 'options' => array(
167
+ 'plain' => __( 'Plain text', 'wc-vendors' ),
168
+ 'html' => __( 'HTML', 'wc-vendors' ),
169
+ 'multipart' => __( 'Multipart', 'wc-vendors' ),
170
+ )
171
+ )
172
+ );
173
+ }
174
+
175
+
176
+ }
trunk/classes/admin/emails/class-wc-notify-shipped.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ /**
6
+ * New Order Email
7
+ *
8
+ * An email sent to the admin when a new product is created.
9
+ *
10
+ * @class WC_Email_Notify_Shipped
11
+ * @version 2.0.0
12
+ * @extends WC_Email
13
+ * @author WooThemes
14
+ * @package WooCommerce/Classes/Emails
15
+ */
16
+
17
+
18
+ class WC_Email_Notify_Shipped extends WC_Email
19
+ {
20
+
21
+
22
+ /**
23
+ * Constructor
24
+ */
25
+ function __construct()
26
+ {
27
+ $this->id = 'vendor_notify_shipped';
28
+ $this->title = __( 'Vendor has shipped', 'wc-vendors' );
29
+ $this->description = __( 'An email is sent when a vendor has marked one of their orders as shipped. <strong>This email has been depreciated.</strong>', 'wc-vendors' );
30
+
31
+ $this->heading = __( 'Your order has been shipped', 'wc-vendors' );
32
+ $this->subject = __( '[{blogname}] Your order has been shipped ({order_number}) - {order_date}', 'wc-vendors' );
33
+
34
+ $this->template_html = 'notify-vendor-shipped.php';
35
+ $this->template_plain = 'notify-vendor-shipped.php';
36
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/emails/';
37
+
38
+ // Call parent constuctor
39
+ parent::__construct();
40
+ }
41
+
42
+
43
+ /**
44
+ * trigger function.
45
+ *
46
+ * @access public
47
+ * @return void
48
+ *
49
+ * @param unknown $order_id
50
+ */
51
+ function trigger( $order_id, $vendor_id )
52
+ {
53
+ $this->object = wc_get_order( $order_id );
54
+ $this->current_vendor = $vendor_id;
55
+ $order_date = $this->object->get_date_created();
56
+
57
+ $this->find[ ] = '{order_date}';
58
+ $this->replace[ ] = date_i18n( wc_date_format(), strtotime( $order_date ) );
59
+
60
+ $this->find[ ] = '{order_number}';
61
+ $this->replace[ ] = $this->object->get_order_number();
62
+
63
+ $billing_email = $this->object->get_billing_email();
64
+
65
+ if ( !$this->is_enabled() ) return;
66
+
67
+ add_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
68
+ add_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
69
+ $this->send( $billing_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
70
+ remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
71
+ remove_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
72
+ }
73
+
74
+
75
+ /**
76
+ *
77
+ *
78
+ * @param unknown $items
79
+ * @param unknown $order
80
+ *
81
+ * @return unknown
82
+ */
83
+ public function check_items( $items, $order )
84
+ {
85
+ foreach ( $items as $key => $product ) {
86
+
87
+ if ( empty( $product[ 'product_id' ] ) ) {
88
+ unset( $items[ $key ] );
89
+ continue;
90
+ }
91
+
92
+ $author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
93
+
94
+ if ( $this->current_vendor != $author ) {
95
+ unset( $items[ $key ] );
96
+ continue;
97
+ }
98
+
99
+ }
100
+
101
+ return $items;
102
+ }
103
+
104
+ /**
105
+ *
106
+ *
107
+ * @param unknown $total_rows
108
+ * @param unknown $order
109
+ *
110
+ * @return unknown
111
+ */
112
+ public function check_order_totals( $total_rows, $order )
113
+ {
114
+ $return[ 'cart_subtotal' ] = $total_rows[ 'cart_subtotal' ];
115
+ $return[ 'cart_subtotal' ][ 'label' ] = __( 'Subtotal:', 'wc-vendors' );
116
+
117
+ return $return;
118
+ }
119
+
120
+ /**
121
+ * get_content_html function.
122
+ *
123
+ * @access public
124
+ * @return string
125
+ */
126
+ function get_content_html()
127
+ {
128
+ ob_start();
129
+ wc_get_template( $this->template_html, array(
130
+ 'order' => $this->object,
131
+ 'email_heading' => $this->get_heading()
132
+ ), 'woocommerce/emails', $this->template_base );
133
+
134
+ return ob_get_clean();
135
+ }
136
+
137
+
138
+ /**
139
+ * get_content_plain function.
140
+ *
141
+ * @access public
142
+ * @return string
143
+ */
144
+ function get_content_plain()
145
+ {
146
+ ob_start();
147
+ wc_get_template( $this->template_plain, array(
148
+ 'order' => $this->object,
149
+ 'email_heading' => $this->get_heading()
150
+ ), 'woocommerce/emails', $this->template_base );
151
+
152
+ return ob_get_clean();
153
+ }
154
+
155
+
156
+ /**
157
+ * Initialise Settings Form Fields
158
+ *
159
+ * @access public
160
+ * @return void
161
+ */
162
+ function init_form_fields()
163
+ {
164
+ $this->form_fields = array(
165
+ 'enabled' => array(
166
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
167
+ 'type' => 'checkbox',
168
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
169
+ 'default' => 'no'
170
+ ),
171
+ 'subject' => array(
172
+ 'title' => __( 'Subject', 'wc-vendors' ),
173
+ 'type' => 'text',
174
+ 'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wc-vendors' ), $this->subject ),
175
+ 'placeholder' => '',
176
+ 'default' => ''
177
+ ),
178
+ 'heading' => array(
179
+ 'title' => __( 'Email Heading', 'wc-vendors' ),
180
+ 'type' => 'text',
181
+ 'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wc-vendors' ), $this->heading ),
182
+ 'placeholder' => '',
183
+ 'default' => ''
184
+ ),
185
+ 'email_type' => array(
186
+ 'title' => __( 'Email type', 'wc-vendors' ),
187
+ 'type' => 'select',
188
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
189
+ 'default' => 'html',
190
+ 'class' => 'email_type',
191
+ 'options' => array(
192
+ 'plain' => __( 'Plain text', 'wc-vendors' ),
193
+ 'html' => __( 'HTML', 'wc-vendors' ),
194
+ 'multipart' => __( 'Multipart', 'wc-vendors' ),
195
+ )
196
+ )
197
+ );
198
+ }
199
+
200
+
201
+ }
trunk/classes/admin/emails/class-wc-notify-vendor.php ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ /**
6
+ * New Order Email
7
+ *
8
+ * An email sent to the vendor when a new order is received/paid for.
9
+ *
10
+ * @class WC_Email_Notify_Vendor
11
+ * @version 2.0.0
12
+ * @extends WC_Email
13
+ * @author WooThemes
14
+ * @package WooCommerce/Classes/Emails
15
+ */
16
+
17
+
18
+ class WC_Email_Notify_Vendor extends WC_Email
19
+ {
20
+
21
+ /**
22
+ * Constructor
23
+ */
24
+ function __construct()
25
+ {
26
+ $this->id = 'vendor_new_order';
27
+ $this->title = __( 'Notify vendors', 'wc-vendors' );
28
+ $this->description = __( 'New order emails are sent when an order is received/paid by a customer. <strong>This email has been depreciated.</strong>', 'wc-vendors' );
29
+
30
+ $this->heading = __( 'New customer order', 'wc-vendors' );
31
+ $this->subject = __( '[{blogname}] New customer order ({order_number}) - {order_date}', 'wc-vendors' );
32
+
33
+ $this->template_html = 'vendor-new-order.php';
34
+ $this->template_plain = 'vendor-new-order.php';
35
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/emails/';
36
+
37
+ // Triggers for this email
38
+ add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ) );
39
+ add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, 'trigger' ) );
40
+ add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, 'trigger' ) );
41
+ add_action( 'woocommerce_order_status_failed_to_completed_notification', array( $this, 'trigger' ) );
42
+ add_action( 'woocommerce_order_status_on-hold_to_processing_notification', array( $this, 'trigger' ) ); // Added in 1.8.4
43
+ add_action( 'woocommerce_order_status_on-hold_to_completed_notification', array( $this, 'trigger' ) ); // Added in 1.8.4
44
+
45
+ // Call parent constuctor
46
+ parent::__construct();
47
+ }
48
+
49
+
50
+ /**
51
+ * trigger function.
52
+ *
53
+ * @access public
54
+ * @return void
55
+ *
56
+ * @param unknown $order_id
57
+ */
58
+ function trigger( $order_id )
59
+ {
60
+ global $woocommerce;
61
+
62
+ if ( $order_id ) {
63
+ $this->object = wc_get_order( $order_id );
64
+
65
+ $order_date = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $this->object->order_date : $this->object->get_date_created();
66
+
67
+ $this->find[ ] = '{order_date}';
68
+ $this->replace[ ] = date_i18n( wc_date_format(), strtotime( $order_date ) );
69
+
70
+ $this->find[ ] = '{order_number}';
71
+ $this->replace[ ] = $this->object->get_order_number();
72
+
73
+ }
74
+
75
+ if ( !$this->is_enabled() ) return;
76
+
77
+ $vendors = $this->get_vendors( $this->object );
78
+
79
+ if ( empty( $vendors ) ) return;
80
+
81
+ add_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
82
+ add_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
83
+ add_filter( 'woocommerce_order_formatted_line_subtotal', array( $this, 'check_order_formatted_line_subtotal' ), 10, 3 );
84
+ add_filter( 'woocommerce_order_subtotal_to_display', array( $this, 'check_order_subtotal_to_display'), 10, 3 );
85
+ foreach ( $vendors as $user_id => $user_email ) {
86
+ $this->current_vendor = $user_id;
87
+ $this->send( $user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
88
+ }
89
+ remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
90
+ remove_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
91
+ remove_filter( 'woocommerce_order_formatted_line_subtotal', array( $this, 'check_order_formatted_line_subtotal' ), 10, 3 );
92
+ remove_filter( 'woocommerce_order_subtotal_to_display', array( $this, 'check_order_subtotal_to_display'), 10, 3 );
93
+ }
94
+
95
+
96
+ /**
97
+ *
98
+ *
99
+ * @param unknown $total_rows
100
+ * @param unknown $order
101
+ *
102
+ * @return unknown
103
+ */
104
+ function check_order_totals( $total_rows, $order )
105
+ {
106
+
107
+ $commission_label = apply_filters('wcv_notify_vendor_commission_label', __( 'Commission Subtotal:', 'wc-vendors' ) ) ;
108
+ $return[ 'cart_subtotal' ] = $total_rows[ 'cart_subtotal' ];
109
+ $return[ 'cart_subtotal' ][ 'label' ] = $commission_label;
110
+
111
+ if ( 'yes' === get_option( 'wcvendors_vendor_give_taxes', 'no' ) ) {
112
+ $return[ 'tax_subtotal'] = array( 'label' => '', 'value' => '');
113
+ $return[ 'tax_subtotal']['label'] = apply_filters('wcv_notify_vendor_tax_label', __( 'Tax Subtotal:', 'wc-vendors' ) ) ;
114
+ }
115
+
116
+ $dues = WCV_Vendors::get_vendor_dues_from_order( $order );
117
+
118
+ foreach ( $dues as $due ) {
119
+ if ( $this->current_vendor == $due['vendor_id'] ) {
120
+ if (!empty($return[ 'shipping' ])) $return[ 'shipping' ] = $total_rows[ 'shipping' ];
121
+ $return[ 'shipping' ]['label'] = __( 'Shipping Subtotal:', 'wc-vendors' );
122
+ $return[ 'shipping' ][ 'value' ] = wc_price( $due['shipping'] );
123
+ if ( get_option( 'wcvendors_vendor_give_taxes' ) ) {
124
+ $return[ 'tax_subtotal']['value'] += (float) $due['tax'];
125
+ }
126
+ break;
127
+ }
128
+ }
129
+ // Format tax price
130
+ if ( 'yes' === get_option( 'wcvendors_vendor_give_taxes', 'no' ) ) {
131
+ $return[ 'tax_subtotal']['value'] = wc_price( $return[ 'tax_subtotal'] ['value'] );
132
+ }
133
+
134
+ return $return;
135
+ }
136
+
137
+
138
+ /**
139
+ *
140
+ *
141
+ * @param unknown $order
142
+ *
143
+ * @return unknown
144
+ */
145
+ public function get_vendors( $order )
146
+ {
147
+ $items = $order->get_items();
148
+ $vendors = array();
149
+
150
+ foreach ( $items as $key => $product ) {
151
+
152
+ if ( empty( $product[ 'product_id' ] ) ) continue;
153
+ $author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
154
+
155
+ // Only store the vendor authors
156
+ if ( !WCV_Vendors::is_vendor( $author ) ) {
157
+ unset( $items[ $key ] );
158
+ continue;
159
+ }
160
+
161
+ $vendors[ $author ] = get_userdata( $author )->user_email;
162
+ }
163
+
164
+ return $vendors;
165
+ }
166
+
167
+ /**
168
+ *
169
+ *
170
+ * @param unknown $items
171
+ * @param unknown $order
172
+ *
173
+ * @return unknown
174
+ */
175
+ function check_items( $items, $order )
176
+ {
177
+
178
+ $settings = get_option( 'woocommerce_vendor_new_order_settings' );
179
+
180
+ if ( empty( $settings ) ) $settings = $this->get_default_settings();
181
+
182
+ foreach ( $items as $key => $product ) {
183
+
184
+ // If this is a line item
185
+ if ( $product['type'] == 'line_item' ) {
186
+
187
+ $author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
188
+
189
+ if ( $this->current_vendor != $author) {
190
+ unset( $items[ $key ] );
191
+ continue;
192
+ } else {
193
+
194
+ // If display commission is ticked show this otherwise show the full price.
195
+ if ( 'yes' == $settings[ 'commission_display' ] ){
196
+
197
+ $order_id = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->id : $order->get_id();
198
+
199
+ // Get correct product_id depending on which product type
200
+ $product_id = !empty( $product['variation_id'] ) ? $product['variation_id'] : $product['product_id'];
201
+
202
+ $commission_due = WCV_Commission::get_commission_due( $order_id, $product_id, $author );
203
+
204
+ $items[ $key ][ 'line_subtotal' ] = $commission_due;
205
+ $items[ $key ][ 'line_total' ] = $commission_due;
206
+
207
+ // Don't display tax if give tax is not enabled.
208
+ if ( !get_option( 'wcvendors_vendor_give_taxes' ) ) {
209
+ unset($items[ $key ][ 'line_tax' ]) ;
210
+ }
211
+ }
212
+ }
213
+ }
214
+
215
+ }
216
+
217
+ return $items;
218
+
219
+ } // check_items()
220
+
221
+
222
+ /**
223
+ * get_content_html function.
224
+ *
225
+ * @access public
226
+ * @return string
227
+ */
228
+ function get_content_html()
229
+ {
230
+ ob_start();
231
+ wc_get_template( $this->template_html, array(
232
+ 'order' => $this->object,
233
+ 'email_heading' => $this->get_heading()
234
+ ), 'woocommerce', $this->template_base );
235
+
236
+ return ob_get_clean();
237
+ }
238
+
239
+
240
+ /**
241
+ * get_content_plain function.
242
+ *
243
+ * @access public
244
+ * @return string
245
+ */
246
+ function get_content_plain()
247
+ {
248
+ ob_start();
249
+ wc_get_template( $this->template_plain, array(
250
+ 'order' => $this->object,
251
+ 'email_heading' => $this->get_heading()
252
+ ), 'woocommerce', $this->template_base );
253
+
254
+ return ob_get_clean();
255
+ }
256
+
257
+
258
+ /**
259
+ * Initialise Settings Form Fields
260
+ *
261
+ * @access public
262
+ * @return void
263
+ */
264
+ function init_form_fields()
265
+ {
266
+ $this->form_fields = array(
267
+ 'enabled' => array(
268
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
269
+ 'type' => 'checkbox',
270
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
271
+ 'default' => 'no'
272
+ ),
273
+ 'subject' => array(
274
+ 'title' => __( 'Subject', 'wc-vendors' ),
275
+ 'type' => 'text',
276
+ 'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wc-vendors' ), $this->subject ),
277
+ 'placeholder' => '',
278
+ 'default' => ''
279
+ ),
280
+ 'heading' => array(
281
+ 'title' => __( 'Email Heading', 'wc-vendors' ),
282
+ 'type' => 'text',
283
+ 'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wc-vendors' ), $this->heading ),
284
+ 'placeholder' => '',
285
+ 'default' => ''
286
+ ),
287
+ 'commission_display' => array(
288
+ 'title' => __( 'Product Totals', 'wc-vendors' ),
289
+ 'type' => 'checkbox',
290
+ 'label' => __( 'Show the commission due/paid as the product totals instead of the product prices.', 'wc-vendors' ),
291
+ 'default' => 'yes'
292
+ ),
293
+ 'email_type' => array(
294
+ 'title' => __( 'Email type', 'wc-vendors' ),
295
+ 'type' => 'select',
296
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
297
+ 'default' => 'html',
298
+ 'class' => 'email_type',
299
+ 'options' => array(
300
+ 'plain' => __( 'Plain text', 'wc-vendors' ),
301
+ 'html' => __( 'HTML', 'wc-vendors' ),
302
+ 'multipart' => __( 'Multipart', 'wc-vendors' ),
303
+ )
304
+ )
305
+ );
306
+ }
307
+
308
+
309
+ /**
310
+ * check the order line item sub total to ensure that the tax is shown correctly on the vendor emails
311
+ */
312
+ function check_order_formatted_line_subtotal( $subtotal, $item, $order ){
313
+
314
+ $order_currency = ( version_compare( WC_VERSION, '2.7', '<' ) ) ? $order->get_order_currency() : $order->get_currency();
315
+
316
+ $subtotal = wc_price( $order->get_line_subtotal( $item ), array( 'currency' => $order_currency ) );
317
+
318
+ return $subtotal;
319
+
320
+ } // check_order_formatted_line_subtotal()
321
+
322
+
323
+ function check_order_subtotal_to_display( $subtotal, $compound, $order ){
324
+
325
+ $new_subtotal = 0;
326
+
327
+ foreach ( $order->get_items() as $key => $product ) {
328
+ $new_subtotal += $product[ 'line_subtotal' ];
329
+ }
330
+
331
+ return wc_price( $new_subtotal );
332
+
333
+
334
+ } // check_order_subtotal_to_display()
335
+
336
+ /**
337
+ * Get the default settings for this email if not already set.
338
+ *
339
+ * @since 1.9.9
340
+ *
341
+ */
342
+ public function get_default_settings(){
343
+
344
+ $settings = array();
345
+
346
+ foreach ( $this->form_fields as $key => $field ) {
347
+ $settings[ $key ] = $field[ 'default' ];
348
+ }
349
+
350
+ return $settings;
351
+
352
+ } // get_default_settings()
353
+
354
+
355
+ }
trunk/classes/admin/emails/class-wcv-admin-notify-application.php ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! class_exists( 'WCVendors_Admin_Notify_Application' ) ) :
8
+
9
+ /**
10
+ * Notify Admin Shipped
11
+ *
12
+ * An email sent to the admin when the vendor marks the order shipped.
13
+ *
14
+ * @class WCVendors_Admin_Notify_Shipped
15
+ * @version 2.0.0
16
+ * @package Classes/Admin/Emails
17
+ * @author WC Vendors
18
+ * @extends WC_Email
19
+ */
20
+ class WCVendors_Admin_Notify_Application extends WC_Email {
21
+
22
+ /**
23
+ * Constructor.
24
+ */
25
+ public function __construct() {
26
+ $this->id = 'admin_notify_application';
27
+ $this->title = sprintf( __( 'Admin notify %s application', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
28
+ $this->description = sprintf( __( 'Notification is sent to chosen recipient(s) when a user applies to be a %s', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
+ $this->template_html = 'emails/admin-notify-application.php';
30
+ $this->template_plain = 'emails/plain/admin-notify-application.php';
31
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
32
+ $this->placeholders = array(
33
+ '{site_title}' => $this->get_blogname(),
34
+ '{user_name}' => '',
35
+ );
36
+
37
+ // Call parent constructor
38
+ parent::__construct();
39
+
40
+ // Other settings
41
+ $this->recipient = $this->get_option( 'recipient', get_option( 'admin_email' ) );
42
+ }
43
+
44
+ /**
45
+ * Get email subject.
46
+ *
47
+ * @since 2.0.0
48
+ * @return string
49
+ */
50
+ public function get_default_subject() {
51
+ return sprintf( __( '[{site_title}] {user_name} has applied to be a %s', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
52
+ }
53
+
54
+ /**
55
+ * Get email heading.
56
+ *
57
+ * @since 2.0.0
58
+ * @return string
59
+ */
60
+ public function get_default_heading() {
61
+ return sprintf( __( '%s application received', 'wc-vendors' ), wcv_get_vendor_name( ) );
62
+ }
63
+
64
+ /**
65
+ * Trigger the sending of this email.
66
+ *
67
+ * @param int $order_id The order ID.
68
+ * @param WC_Order $order Order object.
69
+ */
70
+ public function trigger( $vendor_id, $status ) {
71
+
72
+ $this->setup_locale();
73
+
74
+ $this->user = get_userdata( $vendor_id );
75
+ $this->status = $status;
76
+
77
+ if ( $this->is_enabled() && $this->get_recipient() && $status === $this->get_option( 'notification' ) ) {
78
+ $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
79
+ }
80
+
81
+ $this->restore_locale();
82
+ }
83
+
84
+ /**
85
+ * Get content html.
86
+ *
87
+ * @access public
88
+ * @return string
89
+ */
90
+ public function get_content_html() {
91
+
92
+ return wc_get_template_html( $this->template_html, array(
93
+ 'order' => $this->object,
94
+ 'email_heading' => $this->get_heading(),
95
+ 'sent_to_admin' => true,
96
+ 'plain_text' => false,
97
+ 'email' => $this,
98
+ 'user' => $this->user,
99
+ 'status' => $this->status,
100
+ ), 'woocommerce', $this->template_base );
101
+ }
102
+
103
+ /**
104
+ * Get content plain.
105
+ *
106
+ * @access public
107
+ * @return string
108
+ */
109
+ public function get_content_plain() {
110
+ return wc_get_template_html( $this->template_plain, array(
111
+ 'order' => $this->object,
112
+ 'email_heading' => $this->get_heading(),
113
+ 'sent_to_admin' => true,
114
+ 'plain_text' => true,
115
+ 'email' => $this,
116
+ 'user' => $this->user,
117
+ 'status' => $this->status,
118
+ ), 'woocommerce', $this->template_base );
119
+ }
120
+
121
+ /**
122
+ * Initialise settings form fields.
123
+ */
124
+ public function init_form_fields() {
125
+ $this->form_fields = array(
126
+ 'enabled' => array(
127
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
128
+ 'type' => 'checkbox',
129
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
130
+ 'default' => 'no',
131
+ ),
132
+ 'recipient' => array(
133
+ 'title' => __( 'Recipient(s)', 'wc-vendors' ),
134
+ 'type' => 'text',
135
+ 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to %s.', 'wc-vendors' ), '<code>' . esc_attr( get_option( 'admin_email' ) ) . '</code>' ),
136
+ 'placeholder' => '',
137
+ 'default' => '',
138
+ 'desc_tip' => true,
139
+ ),
140
+ 'subject' => array(
141
+ 'title' => __( 'Subject', 'wc-vendors' ),
142
+ 'type' => 'text',
143
+ 'desc_tip' => true,
144
+ /* translators: %s: list of placeholders */
145
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{user_name}</code>' ),
146
+ 'placeholder' => $this->get_default_subject(),
147
+ 'default' => '',
148
+ ),
149
+ 'heading' => array(
150
+ 'title' => __( 'Email heading', 'wc-vendors' ),
151
+ 'type' => 'text',
152
+ 'desc_tip' => true,
153
+ /* translators: %s: list of placeholders */
154
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{user_name}</code>' ),
155
+ 'placeholder' => $this->get_default_heading(),
156
+ 'default' => '',
157
+ ),
158
+ 'notification' => array(
159
+ 'title' => __( 'Notification', 'wc-vendors' ),
160
+ 'type' => 'select',
161
+ 'description' => __( 'Choose when to be notified of an application.', 'wc-vendors' ),
162
+ 'default' => 'pending',
163
+ 'class' => 'wc-enhanced-select',
164
+ 'options' => array(
165
+ 'vendor' => __( 'All Applications', 'wc-vendors'),
166
+ 'pending_vendor' => __( 'Pending Applications', 'wc-vendors' ),
167
+ ),
168
+ 'desc_tip' => true,
169
+ ),
170
+ 'email_type' => array(
171
+ 'title' => __( 'Email type', 'wc-vendors' ),
172
+ 'type' => 'select',
173
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
174
+ 'default' => 'html',
175
+ 'class' => 'email_type wc-enhanced-select',
176
+ 'options' => $this->get_email_type_options(),
177
+ 'desc_tip' => true,
178
+ ),
179
+ );
180
+ }
181
+ }
182
+
183
+ endif;
184
+
185
+ return new WCVendors_Admin_Notify_Application();
trunk/classes/admin/emails/class-wcv-admin-notify-product.php ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! class_exists( 'WCVendors_Admin_Notify_Product' ) ) :
8
+
9
+ /**
10
+ * Notify Admin of new vendor product
11
+ *
12
+ * An email sent to the admin when a vendor adds a new product for approval
13
+ *
14
+ * @class WCVendors_Admin_Notify_Product
15
+ * @version 2.0.0
16
+ * @package Classes/Admin/Emails
17
+ * @author WC Vendors
18
+ * @extends WC_Email
19
+ */
20
+ class WCVendors_Admin_Notify_Product extends WC_Email {
21
+
22
+ /**
23
+ * Constructor.
24
+ */
25
+ public function __construct() {
26
+ $this->id = 'admin_notify_product';
27
+ $this->title = sprintf( __( 'Admin new %s product', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
28
+ $this->description = sprintf( __( 'Notification is sent to chosen recipient(s) when a %s submits a product for approval.', 'wc-vendors' ), wcv_get_vendor_name() );
29
+ $this->template_html = 'emails/admin-notify-product.php';
30
+ $this->template_plain = 'emails/plain/admin-notify-product.php';
31
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
32
+ $this->placeholders = array(
33
+ '{site_title}' => $this->get_blogname(),
34
+ '{product_name}' => '',
35
+ '{vendor_name}' => '',
36
+ );
37
+
38
+
39
+ // Triggers for this email
40
+ add_action( 'pending_product', array( $this, 'trigger' ), 10, 2 );
41
+ add_action( 'pending_product_variation', array( $this, 'trigger' ), 10, 2 );
42
+
43
+ // Call parent constructor
44
+ parent::__construct();
45
+
46
+ // Other settings
47
+ $this->recipient = $this->get_option( 'recipient', get_option( 'admin_email' ) );
48
+ }
49
+
50
+ /**
51
+ * Get email subject.
52
+ *
53
+ * @since 2.0.0
54
+ * @return string
55
+ */
56
+ public function get_default_subject() {
57
+ return sprintf( __( '[{site_title}] New %s product submitted by {vendor_name} - {product_name}', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
58
+ }
59
+
60
+ /**
61
+ * Get email heading.
62
+ *
63
+ * @since 2.0.0
64
+ * @return string
65
+ */
66
+ public function get_default_heading() {
67
+ return sprintf( __( 'New %s product submitted: {product_name}', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
68
+ }
69
+
70
+ /**
71
+ * Trigger the sending of this email.
72
+ *
73
+ * @param int $order_id The order ID.
74
+ * @param WC_Order $order Order object.
75
+ */
76
+ public function trigger( $post_id, $post ) {
77
+
78
+ $this->setup_locale();
79
+
80
+ if ( ! WCV_Vendors::is_vendor( $post->post_author ) ) return;
81
+
82
+ $this->post_id = $post_id;
83
+ $this->vendor_id = $post->post_author;
84
+ $this->product = wc_get_product( $post_id );
85
+ $this->vendor_name = WCV_Vendors::get_vendor_shop_name( $post->post_author );
86
+
87
+ if ( is_a( 'WC_Product', $this->product ) ){
88
+ $this->placeholders['{product_name}'] = $this->product->get_title();
89
+ $this->placeholders['{vendor_name}'] = $this->vendor_name;
90
+
91
+ if ( $this->is_enabled() && $this->get_recipient() ) {
92
+ $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
93
+ }
94
+
95
+ $this->restore_locale();
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Get content html.
101
+ *
102
+ * @access public
103
+ * @return string
104
+ */
105
+ public function get_content_html() {
106
+
107
+ return wc_get_template_html( $this->template_html, array(
108
+ 'order' => $this->object,
109
+ 'email_heading' => $this->get_heading(),
110
+ 'sent_to_admin' => true,
111
+ 'plain_text' => false,
112
+ 'email' => $this,
113
+ 'post_id' => $this->post_id,
114
+ 'vendor_id' => $this->vendor_id,
115
+ 'vendor_name' => $this->vendor_name,
116
+ 'product' => $this->product,
117
+ ), 'woocommerce', $this->template_base );
118
+ }
119
+
120
+ /**
121
+ * Get content plain.
122
+ *
123
+ * @access public
124
+ * @return string
125
+ */
126
+ public function get_content_plain() {
127
+ return wc_get_template_html( $this->template_plain, array(
128
+ 'order' => $this->object,
129
+ 'email_heading' => $this->get_heading(),
130
+ 'sent_to_admin' => true,
131
+ 'plain_text' => true,
132
+ 'email' => $this,
133
+ 'post_id' => $this->post_id,
134
+ 'vendor_id' => $this->vendor_id,
135
+ 'vendor_name' => $this->vendor_name,
136
+ 'product' => $this->product,
137
+ ), 'woocommerce', $this->template_base );
138
+ }
139
+
140
+ /**
141
+ * Initialise settings form fields.
142
+ */
143
+ public function init_form_fields() {
144
+ $this->form_fields = array(
145
+ 'enabled' => array(
146
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
147
+ 'type' => 'checkbox',
148
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
149
+ 'default' => 'yes',
150
+ ),
151
+ 'recipient' => array(
152
+ 'title' => __( 'Recipient(s)', 'wc-vendors' ),
153
+ 'type' => 'text',
154
+ 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to %s.', 'wc-vendors' ), '<code>' . esc_attr( get_option( 'admin_email' ) ) . '</code>' ),
155
+ 'placeholder' => '',
156
+ 'default' => '',
157
+ 'desc_tip' => true,
158
+ ),
159
+ 'subject' => array(
160
+ 'title' => __( 'Subject', 'wc-vendors' ),
161
+ 'type' => 'text',
162
+ 'desc_tip' => true,
163
+ /* translators: %s: list of placeholders */
164
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}, {order_date}, {order_number}</code>' ),
165
+ 'placeholder' => $this->get_default_subject(),
166
+ 'default' => '',
167
+ ),
168
+ 'heading' => array(
169
+ 'title' => __( 'Email heading', 'wc-vendors' ),
170
+ 'type' => 'text',
171
+ 'desc_tip' => true,
172
+ /* translators: %s: list of placeholders */
173
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}, {order_date}, {order_number}</code>' ),
174
+ 'placeholder' => $this->get_default_heading(),
175
+ 'default' => '',
176
+ ),
177
+ 'email_type' => array(
178
+ 'title' => __( 'Email type', 'wc-vendors' ),
179
+ 'type' => 'select',
180
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
181
+ 'default' => 'html',
182
+ 'class' => 'email_type wc-enhanced-select',
183
+ 'options' => $this->get_email_type_options(),
184
+ 'desc_tip' => true,
185
+ ),
186
+ );
187
+ }
188
+ }
189
+
190
+ endif;
191
+
192
+ return new WCVendors_Admin_Notify_Product();
trunk/classes/admin/emails/class-wcv-admin-notify-shipped.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! class_exists( 'WCVendors_Admin_Notify_Shipped' ) ) :
8
+
9
+ /**
10
+ * Notify Admin Shipped
11
+ *
12
+ * An email sent to the admin when the vendor marks the order shipped.
13
+ *
14
+ * @class WCVendors_Admin_Notify_Shipped
15
+ * @version 2.0.0
16
+ * @package Classes/Admin/Emails
17
+ * @author WC Vendors
18
+ * @extends WC_Email
19
+ */
20
+ class WCVendors_Admin_Notify_Shipped extends WC_Email {
21
+
22
+ /**
23
+ * Constructor.
24
+ */
25
+ public function __construct() {
26
+ $this->id = 'admin_notify_shipped';
27
+ $this->title = sprintf( __( 'Admin notify %s shipped', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
28
+ $this->description = sprintf( __( 'Notification is sent to chosen recipient(s) when a %s marks an order shipped.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
+ $this->template_html = 'emails/admin-notify-shipped.php';
30
+ $this->template_plain = 'emails/plain/admin-notify-shipped.php';
31
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
32
+ $this->placeholders = array(
33
+ '{site_title}' => $this->get_blogname(),
34
+ '{order_date}' => '',
35
+ '{order_number}' => '',
36
+ );
37
+
38
+ // Call parent constructor
39
+ parent::__construct();
40
+
41
+ // Other settings
42
+ $this->recipient = $this->get_option( 'recipient', get_option( 'admin_email' ) );
43
+ }
44
+
45
+ /**
46
+ * Get email subject.
47
+ *
48
+ * @since 2.0.0
49
+ * @return string
50
+ */
51
+ public function get_default_subject() {
52
+ return sprintf( __( '[{site_title}] %s has marked shipped ({order_number}) - {order_date}', 'wc-vendors' ), wcv_get_vendor_name( ) );
53
+ }
54
+
55
+ /**
56
+ * Get email heading.
57
+ *
58
+ * @since 2.0.0
59
+ * @return string
60
+ */
61
+ public function get_default_heading() {
62
+ return sprintf( __( '%s has shipped', 'wc-vendors' ), wcv_get_vendor_name( ) );
63
+ }
64
+
65
+ /**
66
+ * Trigger the sending of this email.
67
+ *
68
+ * @param int $order_id The order ID.
69
+ * @param WC_Order $order Order object.
70
+ */
71
+ public function trigger( $order_id, $user_id, $order = false ) {
72
+
73
+ $this->setup_locale();
74
+
75
+ $this->vendor_id = $user_id;
76
+
77
+ if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
78
+ $order = wc_get_order( $order_id );
79
+ }
80
+
81
+ if ( is_a( $order, 'WC_Order' ) ) {
82
+ $this->object = $order;
83
+ $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() );
84
+ $this->placeholders['{order_number}'] = $this->object->get_order_number();
85
+ }
86
+
87
+ if ( $this->is_enabled() && $this->get_recipient() ) {
88
+ $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
89
+ }
90
+
91
+ $this->restore_locale();
92
+ }
93
+
94
+ /**
95
+ * Get content html.
96
+ *
97
+ * @access public
98
+ * @return string
99
+ */
100
+ public function get_content_html() {
101
+
102
+ return wc_get_template_html( $this->template_html, array(
103
+ 'order' => $this->object,
104
+ 'email_heading' => $this->get_heading(),
105
+ 'sent_to_admin' => true,
106
+ 'plain_text' => false,
107
+ 'email' => $this,
108
+ 'vendor_id' => $this->vendor_id,
109
+ ), 'woocommerce', $this->template_base );
110
+ }
111
+
112
+ /**
113
+ * Get content plain.
114
+ *
115
+ * @access public
116
+ * @return string
117
+ */
118
+ public function get_content_plain() {
119
+ return wc_get_template_html( $this->template_plain, array(
120
+ 'order' => $this->object,
121
+ 'email_heading' => $this->get_heading(),
122
+ 'sent_to_admin' => true,
123
+ 'plain_text' => true,
124
+ 'email' => $this,
125
+ 'vendor_id' => $this->vendor_id,
126
+ ), 'woocommerce', $this->template_base );
127
+ }
128
+
129
+ /**
130
+ * Initialise settings form fields.
131
+ */
132
+ public function init_form_fields() {
133
+ $this->form_fields = array(
134
+ 'enabled' => array(
135
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
136
+ 'type' => 'checkbox',
137
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
138
+ 'default' => 'yes',
139
+ ),
140
+ 'recipient' => array(
141
+ 'title' => __( 'Recipient(s)', 'wc-vendors' ),
142
+ 'type' => 'text',
143
+ 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to %s.', 'wc-vendors' ), '<code>' . esc_attr( get_option( 'admin_email' ) ) . '</code>' ),
144
+ 'placeholder' => '',
145
+ 'default' => '',
146
+ 'desc_tip' => true,
147
+ ),
148
+ 'subject' => array(
149
+ 'title' => __( 'Subject', 'wc-vendors' ),
150
+ 'type' => 'text',
151
+ 'desc_tip' => true,
152
+ /* translators: %s: list of placeholders */
153
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}, {order_date}, {order_number}</code>' ),
154
+ 'placeholder' => $this->get_default_subject(),
155
+ 'default' => '',
156
+ ),
157
+ 'heading' => array(
158
+ 'title' => __( 'Email heading', 'wc-vendors' ),
159
+ 'type' => 'text',
160
+ 'desc_tip' => true,
161
+ /* translators: %s: list of placeholders */
162
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}, {order_date}, {order_number}</code>' ),
163
+ 'placeholder' => $this->get_default_heading(),
164
+ 'default' => '',
165
+ ),
166
+ 'email_type' => array(
167
+ 'title' => __( 'Email type', 'wc-vendors' ),
168
+ 'type' => 'select',
169
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
170
+ 'default' => 'html',
171
+ 'class' => 'email_type wc-enhanced-select',
172
+ 'options' => $this->get_email_type_options(),
173
+ 'desc_tip' => true,
174
+ ),
175
+ );
176
+ }
177
+ }
178
+
179
+ endif;
180
+
181
+ return new WCVendors_Admin_Notify_Shipped();
trunk/classes/admin/emails/class-wcv-customer-notify-shipped.php ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! class_exists( 'WCVendors_Customer_Notify_Shipped' ) ) :
8
+
9
+ /**
10
+ * Notify Admin Shipped
11
+ *
12
+ * An email sent to the admin when the vendor marks the order shipped.
13
+ *
14
+ * @class WCVendors_Customer_Notify_Shipped
15
+ * @version 2.0.0
16
+ * @package Classes/Admin/Emails
17
+ * @author WC Vendors
18
+ * @extends WC_Email
19
+ */
20
+ class WCVendors_Customer_Notify_Shipped extends WC_Email {
21
+
22
+ /**
23
+ * Constructor.
24
+ */
25
+ public function __construct() {
26
+ $this->id = 'customer_notify_shipped';
27
+ $this->customer_email = true;
28
+ $this->title = sprintf( __( 'Customer %s shipped', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
+ $this->description = sprintf( __( 'Email is sent to the customer when a %s marks an order received/paid by a customer.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
30
+ $this->template_html = 'emails/customer-notify-shipped.php';
31
+ $this->template_plain = 'emails/plain/customer-notify-shipped.php';
32
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
33
+ $this->placeholders = array(
34
+ '{site_title}' => $this->get_blogname(),
35
+ '{order_date}' => '',
36
+ '{order_number}' => '',
37
+ );
38
+
39
+ // Call parent constructor
40
+ parent::__construct();
41
+
42
+ }
43
+
44
+ /**
45
+ * Get email subject.
46
+ *
47
+ * @since 2.0.0
48
+ * @return string
49
+ */
50
+ public function get_default_subject() {
51
+ return sprintf( __( '[{site_title}] %s has marked shipped ({order_number}) - {order_date}', 'wc-vendors' ), wcv_get_vendor_name( ) );
52
+ }
53
+
54
+ /**
55
+ * Get email heading.
56
+ *
57
+ * @since 2.0.0
58
+ * @return string
59
+ */
60
+ public function get_default_heading() {
61
+ return sprintf( __( '%s has shipped', 'wc-vendors' ), wcv_get_vendor_name( ) );
62
+ }
63
+
64
+ /**
65
+ * Trigger the sending of this email.
66
+ *
67
+ * @param int $order_id The order ID.
68
+ * @param WC_Order $order Order object.
69
+ */
70
+ public function trigger( $order_id, $user_id, $order = false ) {
71
+
72
+ $this->setup_locale();
73
+ $this->vendor_id = $user_id;
74
+
75
+ if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
76
+ $order = wc_get_order( $order_id );
77
+ }
78
+
79
+ if ( is_a( $order, 'WC_Order' ) ) {
80
+ $this->object = $order;
81
+ $this->recipient = $this->object->get_billing_email();
82
+ $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() );
83
+ $this->placeholders['{order_number}'] = $this->object->get_order_number();
84
+ }
85
+
86
+ if ( $this->is_enabled() && $this->get_recipient() ) {
87
+ // Filter the order items to only show the products owned by the vendor that marked shipped.
88
+ add_filter( 'woocommerce_order_get_items', array( $this, 'filter_vendor_items' ), 10, 3 );
89
+ add_filter( 'woocommerce_get_order_item_totals', array( $this, 'udpate_order_totals' ), 10, 3 );
90
+
91
+ $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
92
+
93
+ // Remove filters
94
+ remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'udpate_order_totals' ), 10, 3 );
95
+ remove_filter( 'woocommerce_order_get_items', array( $this, 'filter_vendor_items' ), 10, 3 );
96
+ }
97
+
98
+ $this->restore_locale();
99
+ }
100
+
101
+ /**
102
+ * Get content html.
103
+ *
104
+ * @access public
105
+ * @return string
106
+ */
107
+ public function get_content_html() {
108
+
109
+ return wc_get_template_html( $this->template_html, array(
110
+ 'order' => $this->object,
111
+ 'email_heading' => $this->get_heading(),
112
+ 'sent_to_admin' => true,
113
+ 'plain_text' => false,
114
+ 'email' => $this,
115
+ 'vendor_id' => $this->vendor_id,
116
+ ), 'woocommerce', $this->template_base );
117
+ }
118
+
119
+ /**
120
+ * Get content plain.
121
+ *
122
+ * @access public
123
+ * @return string
124
+ */
125
+ public function get_content_plain() {
126
+ return wc_get_template_html( $this->template_plain, array(
127
+ 'order' => $this->object,
128
+ 'email_heading' => $this->get_heading(),
129
+ 'sent_to_admin' => true,
130
+ 'plain_text' => true,
131
+ 'email' => $this,
132
+ 'vendor_id' => $this->vendor_id,
133
+ ), 'woocommerce', $this->template_base );
134
+ }
135
+
136
+ /**
137
+ * Initialise settings form fields.
138
+ */
139
+ public function init_form_fields() {
140
+ $this->form_fields = array(
141
+ 'enabled' => array(
142
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
143
+ 'type' => 'checkbox',
144
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
145
+ 'default' => 'yes',
146
+ ),
147
+ 'subject' => array(
148
+ 'title' => __( 'Subject', 'wc-vendors' ),
149
+ 'type' => 'text',
150
+ 'desc_tip' => true,
151
+ /* translators: %s: list of placeholders */
152
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}, {order_date}, {order_number}</code>' ),
153
+ 'placeholder' => $this->get_default_subject(),
154
+ 'default' => '',
155
+ ),
156
+ 'heading' => array(
157
+ 'title' => __( 'Email heading', 'wc-vendors' ),
158
+ 'type' => 'text',
159
+ 'desc_tip' => true,
160
+ /* translators: %s: list of placeholders */
161
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}, {order_date}, {order_number}</code>' ),
162
+ 'placeholder' => $this->get_default_heading(),
163
+ 'default' => '',
164
+ ),
165
+ 'email_type' => array(
166
+ 'title' => __( 'Email type', 'wc-vendors' ),
167
+ 'type' => 'select',
168
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
169
+ 'default' => 'html',
170
+ 'class' => 'email_type wc-enhanced-select',
171
+ 'options' => $this->get_email_type_options(),
172
+ 'desc_tip' => true,
173
+ ),
174
+ );
175
+ }
176
+
177
+
178
+ /**
179
+ * Filter the order to only show vendor products
180
+ *
181
+ * @param array $items
182
+ * @param WC_Order $order
183
+ * @param array $types
184
+ *
185
+ * @return array
186
+ */
187
+ public function filter_vendor_items( $items, $order, $types ) {
188
+
189
+ foreach ( $items as $item_id => $order_item ) {
190
+
191
+ if ( 'line_item' === $order_item->get_type() ){
192
+
193
+ $product_id = ( $order_item->get_variation_id() ) ? $order_item->get_variation_id() : $order_item->get_product_id();
194
+
195
+ if ( empty( $product_id ) ) {
196
+ unset( $items[ $item_id ] );
197
+ continue;
198
+ }
199
+
200
+ $product_vendor = WCV_Vendors::get_vendor_from_product( $product_id );
201
+
202
+ if ( $this->vendor_id != $product_vendor ) {
203
+ unset( $items[ $item_id ] );
204
+ continue;
205
+ }
206
+
207
+ }
208
+
209
+ }
210
+
211
+ return $items;
212
+
213
+ } // filter_vendor_items
214
+
215
+ /**
216
+ * Update the order totals to only show the items for the product(s)
217
+ *
218
+ * @param array $total_rows
219
+ * @param WC_Order $order
220
+ * @param string $tax_display
221
+ *
222
+ * @return array
223
+ */
224
+ public function udpate_order_totals( $total_rows, $order, $tax_display ) {
225
+
226
+ $new_total_rows = array();
227
+ $new_total_rows[ 'cart_subtotal' ] = $total_rows[ 'cart_subtotal' ];
228
+
229
+ return $new_total_rows;
230
+ }
231
+ }
232
+
233
+ endif;
234
+
235
+ return new WCVendors_Customer_Notify_Shipped();
trunk/classes/admin/emails/class-wcv-vendor-notify-application.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! class_exists( 'WCVendors_Vendor_Notify_Application' ) ) :
8
+
9
+ /**
10
+ * Notify vendor application has started
11
+ *
12
+ * An email sent to the admin when the vendor marks the order shipped.
13
+ *
14
+ * @class WCVendors_Vendor_Notify_Application
15
+ * @version 2.0.0
16
+ * @package Classes/Admin/Emails
17
+ * @author WC Vendors
18
+ * @extends WC_Email
19
+ */
20
+ class WCVendors_Vendor_Notify_Application extends WC_Email {
21
+
22
+ /**
23
+ * Constructor.
24
+ */
25
+ public function __construct() {
26
+ $this->id = 'vendor_notify_application';
27
+ $this->title = sprintf( __( '%s notify application', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
+ $this->description = sprintf( __( 'Notification is sent to the %s that their application has been received', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
+ $this->template_html = 'emails/vendor-notify-application.php';
30
+ $this->template_plain = 'emails/plain/vendor-notify-application.php';
31
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
32
+ $this->placeholders = array(
33
+ '{site_title}' => $this->get_blogname()
34
+ );
35
+
36
+ // Call parent constructor
37
+ parent::__construct();
38
+
39
+ }
40
+
41
+ /**
42
+ * Get email subject.
43
+ *
44
+ * @since 2.0.0
45
+ * @return string
46
+ */
47
+ public function get_default_subject() {
48
+ return sprintf( __( '[{site_title}] Your %s application has been received', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
49
+ }
50
+
51
+ /**
52
+ * Get email heading.
53
+ *
54
+ * @since 2.0.0
55
+ * @return string
56
+ */
57
+ public function get_default_heading() {
58
+ return sprintf( __( '%s application received', 'wc-vendors' ), wcv_get_vendor_name( ) );
59
+ }
60
+
61
+ public function get_default_content() {
62
+ return sprintf( __( 'Hi there. This is a notification about a %s application on %s.', 'wc-vendors' ), wcv_get_vendor_name( true, false ), get_option( 'blogname' ) );
63
+ }
64
+
65
+ /**
66
+ * Trigger the sending of this email.
67
+ *
68
+ * @param int $order_id The order ID.
69
+ * @param WC_Order $order Order object.
70
+ */
71
+ public function trigger( $vendor_id, $status = '' ) {
72
+
73
+ $this->setup_locale();
74
+
75
+ $this->user = get_userdata( $vendor_id );
76
+ $this->user_email = $this->user->user_email;
77
+ $this->status = $status;
78
+
79
+ if ( $this->is_enabled() ) {
80
+ $this->send( $this->user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
81
+ }
82
+
83
+ $this->restore_locale();
84
+ }
85
+
86
+ /**
87
+ * Get content html.
88
+ *
89
+ * @access public
90
+ * @return string
91
+ */
92
+ public function get_content_html() {
93
+
94
+ return wc_get_template_html( $this->template_html, array(
95
+ 'order' => $this->object,
96
+ 'email_heading' => $this->get_heading(),
97
+ 'sent_to_admin' => true,
98
+ 'plain_text' => false,
99
+ 'email' => $this,
100
+ 'user' => $this->user,
101
+ 'status' => $this->status,
102
+ ), 'woocommerce', $this->template_base );
103
+ }
104
+
105
+ /**
106
+ * Get content plain.
107
+ *
108
+ * @access public
109
+ * @return string
110
+ */
111
+ public function get_content_plain() {
112
+ return wc_get_template_html( $this->template_plain, array(
113
+ 'order' => $this->object,
114
+ 'email_heading' => $this->get_heading(),
115
+ 'sent_to_admin' => true,
116
+ 'plain_text' => true,
117
+ 'email' => $this,
118
+ 'user' => $this->user,
119
+ 'status' => $this->status,
120
+ ), 'woocommerce', $this->template_base );
121
+ }
122
+
123
+ /**
124
+ * Initialise settings form fields.
125
+ */
126
+ public function init_form_fields() {
127
+ $this->form_fields = array(
128
+ 'enabled' => array(
129
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
130
+ 'type' => 'checkbox',
131
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
132
+ 'default' => 'yes',
133
+ ),
134
+ 'subject' => array(
135
+ 'title' => __( 'Subject', 'wc-vendors' ),
136
+ 'type' => 'text',
137
+ 'desc_tip' => true,
138
+ /* translators: %s: list of placeholders */
139
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}</code>' ),
140
+ 'placeholder' => $this->get_default_subject(),
141
+ 'default' => '',
142
+ ),
143
+ 'heading' => array(
144
+ 'title' => __( 'Email heading', 'wc-vendors' ),
145
+ 'type' => 'text',
146
+ 'desc_tip' => true,
147
+ /* translators: %s: list of placeholders */
148
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}</code>' ),
149
+ 'placeholder' => $this->get_default_heading(),
150
+ 'default' => '',
151
+ ),
152
+ 'email_type' => array(
153
+ 'title' => __( 'Email type', 'wc-vendors' ),
154
+ 'type' => 'select',
155
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
156
+ 'default' => 'html',
157
+ 'class' => 'email_type wc-enhanced-select',
158
+ 'options' => $this->get_email_type_options(),
159
+ 'desc_tip' => true,
160
+ ),
161
+ );
162
+ }
163
+ }
164
+
165
+ endif;
166
+
167
+ return new WCVendors_Vendor_Notify_Application();
trunk/classes/admin/emails/class-wcv-vendor-notify-approved.php ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! class_exists( 'WCVendors_Notify_Vendor_Approved' ) ) :
8
+
9
+ /**
10
+ * Notify vendor application has started
11
+ *
12
+ * An email sent to the admin when the vendor marks the order shipped.
13
+ *
14
+ * @class WCV_Notify_Vendor_Application
15
+ * @version 2.0.0
16
+ * @package Classes/Admin/Emails
17
+ * @author WC Vendors
18
+ * @extends WC_Email
19
+ */
20
+ class WCVendors_Notify_Vendor_Approved extends WC_Email {
21
+
22
+ /**
23
+ * Constructor.
24
+ */
25
+ public function __construct() {
26
+ $this->id = 'vendor_notify_approved';
27
+ $this->title = sprintf( __( '%s notify approved', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
+ $this->description = sprintf( __( 'Notification is sent to the %s that their application has been approved', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
+ $this->template_html = 'emails/vendor-notify-approved.php';
30
+ $this->template_plain = 'emails/plain/vendor-notify-approved.php';
31
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
32
+ $this->placeholders = array(
33
+ '{site_title}' => $this->get_blogname(),
34
+ );
35
+
36
+ // Call parent constructor
37
+ parent::__construct();
38
+
39
+ }
40
+
41
+ /**
42
+ * Get email subject.
43
+ *
44
+ * @since 2.0.0
45
+ * @return string
46
+ */
47
+ public function get_default_subject() {
48
+ return __( '[{site_title}] Your vendor application has been approved', 'wc-vendors' );
49
+ }
50
+
51
+ /**
52
+ * Get email heading.
53
+ *
54
+ * @since 2.0.0
55
+ * @return string
56
+ */
57
+ public function get_default_heading() {
58
+ return sprintf( __( '%s Application Approved', 'wc-vendors' ), wcv_get_vendor_name( ) );
59
+ }
60
+
61
+ /**
62
+ * Get email content
63
+ *
64
+ * @since 2.0.0
65
+ * @return string
66
+ */
67
+ public function get_default_content(){
68
+ return sprintf( __( 'Your application to become a %s has been approved.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
69
+ }
70
+
71
+ /**
72
+ * Trigger the sending of this email.
73
+ *
74
+ * @param int $order_id The order ID.
75
+ * @param WC_Order $order Order object.
76
+ */
77
+ public function trigger( $vendor_id, $status = '' ) {
78
+
79
+ $this->setup_locale();
80
+
81
+ $this->user = get_userdata( $vendor_id );
82
+ $this->user_email = $this->user->user_email;
83
+ $this->content = $this->get_option( 'content', $this->get_default_content() );
84
+ $this->status = $status;
85
+
86
+ if ( $this->is_enabled() ) {
87
+ $this->send( $this->user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
88
+ }
89
+
90
+ $this->restore_locale();
91
+ }
92
+
93
+ /**
94
+ * Get content html.
95
+ *
96
+ * @access public
97
+ * @return string
98
+ */
99
+ public function get_content_html() {
100
+
101
+ return wc_get_template_html( $this->template_html, array(
102
+ 'order' => $this->object,
103
+ 'email_heading' => $this->get_heading(),
104
+ 'sent_to_admin' => true,
105
+ 'plain_text' => false,
106
+ 'email' => $this,
107
+ 'user' => $this->user,
108
+ 'content' => $this->content,
109
+ 'status' => $this->status,
110
+ ), 'woocommerce', $this->template_base );
111
+ }
112
+
113
+ /**
114
+ * Get content plain.
115
+ *
116
+ * @access public
117
+ * @return string
118
+ */
119
+ public function get_content_plain() {
120
+ return wc_get_template_html( $this->template_plain, array(
121
+ 'order' => $this->object,
122
+ 'email_heading' => $this->get_heading(),
123
+ 'sent_to_admin' => true,
124
+ 'plain_text' => true,
125
+ 'email' => $this,
126
+ 'user' => $this->user,
127
+ 'content' => $this->content,
128
+ 'status' => $this->status,
129
+ ) );
130
+ }
131
+
132
+ /**
133
+ * Initialise settings form fields.
134
+ */
135
+ public function init_form_fields() {
136
+ $this->form_fields = array(
137
+ 'enabled' => array(
138
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
139
+ 'type' => 'checkbox',
140
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
141
+ 'default' => 'yes',
142
+ ),
143
+ 'subject' => array(
144
+ 'title' => __( 'Subject', 'wc-vendors' ),
145
+ 'type' => 'text',
146
+ 'desc_tip' => true,
147
+ /* translators: %s: list of placeholders */
148
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}</code>' ),
149
+ 'placeholder' => $this->get_default_subject(),
150
+ 'default' => '',
151
+ ),
152
+ 'content' => array(
153
+ 'title' => __( 'Content', 'wc-vendors' ),
154
+ 'type' => 'textarea',
155
+ 'desc_tip' => true,
156
+ /* translators: %s: list of placeholders */
157
+ 'description' => sprintf( __( 'Email body to be included when sent to the %s.', '' ), wcv_get_vendor_name( true, false ) ),
158
+ 'placeholder' => $this->get_default_content(),
159
+ 'default' => '',
160
+ ),
161
+ 'heading' => array(
162
+ 'title' => __( 'Email heading', 'wc-vendors' ),
163
+ 'type' => 'text',
164
+ 'desc_tip' => true,
165
+ /* translators: %s: list of placeholders */
166
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}</code>' ),
167
+ 'placeholder' => $this->get_default_heading(),
168
+ 'default' => '',
169
+ ),
170
+ 'email_type' => array(
171
+ 'title' => __( 'Email type', 'wc-vendors' ),
172
+ 'type' => 'select',
173
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
174
+ 'default' => 'html',
175
+ 'class' => 'email_type wc-enhanced-select',
176
+ 'options' => $this->get_email_type_options(),
177
+ 'desc_tip' => true,
178
+ ),
179
+ );
180
+ }
181
+ }
182
+
183
+ endif;
184
+
185
+ return new WCVendors_Notify_Vendor_Approved();
trunk/classes/admin/emails/class-wcv-vendor-notify-denied.php ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! class_exists( 'WCVendors_Vendor_Notify_Denied' ) ) :
8
+
9
+ /**
10
+ * Notify vendor application has been denied
11
+ *
12
+ * An email sent to the vendor when the admin denies their application
13
+ *
14
+ * @class WCVendors_Vendor_Notify_Denied
15
+ * @version 2.0.0
16
+ * @package Classes/Admin/Emails
17
+ * @author WC Vendors
18
+ * @extends WC_Email
19
+ */
20
+ class WCVendors_Vendor_Notify_Denied extends WC_Email {
21
+
22
+ /**
23
+ * Constructor.
24
+ */
25
+ public function __construct() {
26
+ $this->id = 'vendor_notify_denied';
27
+ $this->title = sprintf( __( '%s notify denied', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
+ $this->description = sprintf( __( 'Notification is sent to the %s that their application has been denied', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
+ $this->template_html = 'emails/vendor-notify-denied.php';
30
+ $this->template_plain = 'emails/plain/vendor-notify-denied.php';
31
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
32
+ $this->placeholders = array(
33
+ '{site_title}' => $this->get_blogname(),
34
+ );
35
+
36
+ // Call parent constructor
37
+ parent::__construct();
38
+
39
+ }
40
+
41
+ /**
42
+ * Get email subject.
43
+ *
44
+ * @since 2.0.0
45
+ * @return string
46
+ */
47
+ public function get_default_subject() {
48
+ return sprintf( __( '[{site_title}] Your %s application has been denied', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
49
+ }
50
+
51
+ /**
52
+ * Get email heading.
53
+ *
54
+ * @since 2.0.0
55
+ * @return string
56
+ */
57
+ public function get_default_heading() {
58
+ return sprintf( __( '%s Application Denied', 'wc-vendors' ), wcv_get_vendor_name( ) );
59
+ }
60
+
61
+ /**
62
+ * Get email content
63
+ *
64
+ * @since 2.0.0
65
+ * @return string
66
+ */
67
+ public function get_default_content(){
68
+ return sprintf( __( 'Your application to become a %s has been denied.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
69
+ }
70
+
71
+ /**
72
+ * Get email reason
73
+ *
74
+ * @since 2.0.0
75
+ * @return string
76
+ */
77
+ public function get_default_reason(){
78
+ return __( 'We are not taking any new applications at this time.', 'wc-vendors' );
79
+ }
80
+
81
+ /**
82
+ * Trigger the sending of this email.
83
+ *
84
+ * @param int $order_id The order ID.
85
+ * @param WC_Order $order Order object.
86
+ */
87
+ public function trigger( $vendor_id, $reason = '' ) {
88
+
89
+ $this->setup_locale();
90
+
91
+ $this->user = get_userdata( $vendor_id );
92
+ $this->user_email = $this->user->user_email;
93
+ $this->content = $this->get_option( 'content', $this->get_default_content() );
94
+ $this->reason = ( $reason ) ? $reason : $this->get_option( 'reason', $this->get_default_reason() );
95
+
96
+ if ( $this->is_enabled() ) {
97
+ $this->send( $this->user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
98
+ }
99
+
100
+ $this->restore_locale();
101
+ }
102
+
103
+ /**
104
+ * Get content html.
105
+ *
106
+ * @access public
107
+ * @return string
108
+ */
109
+ public function get_content_html() {
110
+
111
+ return wc_get_template_html( $this->template_html, array(
112
+ 'order' => $this->object,
113
+ 'email_heading' => $this->get_heading(),
114
+ 'sent_to_admin' => true,
115
+ 'plain_text' => false,
116
+ 'email' => $this,
117
+ 'user' => $this->user,
118
+ 'reason' => $this->reason,
119
+ 'content' => $this->content,
120
+ ), 'woocommerce', $this->template_base );
121
+ }
122
+
123
+ /**
124
+ * Get content plain.
125
+ *
126
+ * @access public
127
+ * @return string
128
+ */
129
+ public function get_content_plain() {
130
+ return wc_get_template_html( $this->template_plain, array(
131
+ 'order' => $this->object,
132
+ 'email_heading' => $this->get_heading(),
133
+ 'sent_to_admin' => true,
134
+ 'plain_text' => true,
135
+ 'email' => $this,
136
+ 'reason' => $this->reason,
137
+ 'content' => $this->content,
138
+ 'user' => $this->user,
139
+ ) );
140
+ }
141
+
142
+ /**
143
+ * Initialise settings form fields.
144
+ */
145
+ public function init_form_fields() {
146
+ $this->form_fields = array(
147
+ 'enabled' => array(
148
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
149
+ 'type' => 'checkbox',
150
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
151
+ 'default' => 'yes',
152
+ ),
153
+ 'subject' => array(
154
+ 'title' => __( 'Subject', 'wc-vendors' ),
155
+ 'type' => 'text',
156
+ 'desc_tip' => true,
157
+ /* translators: %s: list of placeholders */
158
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}</code>' ),
159
+ 'placeholder' => $this->get_default_subject(),
160
+ 'default' => '',
161
+ ),
162
+ 'content' => array(
163
+ 'title' => __( 'Content', 'wc-vendors' ),
164
+ 'type' => 'textarea',
165
+ 'desc_tip' => true,
166
+ /* translators: %s: list of placeholders */
167
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}</code>' ),
168
+ 'placeholder' => $this->get_default_content(),
169
+ 'default' => $this->get_default_content(),
170
+ ),
171
+ 'reason' => array(
172
+ 'title' => __( 'Reason', 'wc-vendors' ),
173
+ 'type' => 'textarea',
174
+ 'desc_tip' => true,
175
+ 'description' => sprintf( __( 'Provide a reason for denying the %s application', 'wc-vendors'), wcv_get_vendor_name( true, false ) ),
176
+ 'placeholder' => $this->get_default_reason(),
177
+ 'default' => $this->get_default_reason(),
178
+ ),
179
+ 'heading' => array(
180
+ 'title' => __( 'Email heading', 'wc-vendors' ),
181
+ 'type' => 'text',
182
+ 'desc_tip' => true,
183
+ /* translators: %s: list of placeholders */
184
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}</code>' ),
185
+ 'placeholder' => $this->get_default_heading(),
186
+ 'default' => '',
187
+ ),
188
+ 'email_type' => array(
189
+ 'title' => __( 'Email type', 'wc-vendors' ),
190
+ 'type' => 'select',
191
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
192
+ 'default' => 'html',
193
+ 'class' => 'email_type wc-enhanced-select',
194
+ 'options' => $this->get_email_type_options(),
195
+ 'desc_tip' => true,
196
+ ),
197
+ );
198
+ }
199
+ }
200
+
201
+ endif;
202
+
203
+ return new WCVendors_Vendor_Notify_Denied();
trunk/classes/admin/emails/class-wcv-vendor-notify-order.php ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! class_exists( 'WCVendors_Vendor_Notify_Order' ) ) :
8
+
9
+ /**
10
+ * Notify Admin Shipped
11
+ *
12
+ * An email sent to the admin when the vendor marks the order shipped.
13
+ *
14
+ * @class WCVendors_Vendor_Notify_Order
15
+ * @version 2.0.0
16
+ * @package Classes/Admin/Emails
17
+ * @author WC Vendors
18
+ * @extends WC_Email
19
+ */
20
+ class WCVendors_Vendor_Notify_Order extends WC_Email {
21
+
22
+ /**
23
+ * Constructor.
24
+ */
25
+ public function __construct() {
26
+ $this->id = 'vendor_notify_order';
27
+ $this->title = sprintf( __( '%s notify order', 'wc-vendors' ), wcv_get_vendor_name( ) );
28
+ $this->description = sprintf( __( 'Notification is sent to %s when an order is paid.', 'wc-vendors' ), wcv_get_vendor_name( true, false ) );
29
+ $this->template_html = 'emails/vendor-notify-order.php';
30
+ $this->template_plain = 'emails/plain/vendor-notify-order.php';
31
+ $this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/';
32
+ $this->placeholders = array(
33
+ '{site_title}' => $this->get_blogname(),
34
+ '{order_date}' => '',
35
+ '{order_number}' => '',
36
+ );
37
+
38
+ // Other settings
39
+ add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
40
+ add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, 'trigger' ), 10, 2 );
41
+ add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
42
+ add_action( 'woocommerce_order_status_failed_to_completed_notification', array( $this, 'trigger' ), 10, 2 );
43
+ add_action( 'woocommerce_order_status_on-hold_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
44
+ add_action( 'woocommerce_order_status_on-hold_to_completed_notification', array( $this, 'trigger' ), 10, 2 );
45
+
46
+ // Call parent constructor
47
+ parent::__construct();
48
+ }
49
+
50
+ /**
51
+ * Get email subject.
52
+ *
53
+ * @since 2.0.0
54
+ * @return string
55
+ */
56
+ public function get_default_subject() {
57
+ return __( '[{site_title}] New Customer Order ({order_number}) - {order_date}', 'wc-vendors' );
58
+ }
59
+
60
+ /**
61
+ * Get email heading.
62
+ *
63
+ * @since 2.0.0
64
+ * @return string
65
+ */
66
+ public function get_default_heading() {
67
+ return __( 'New Customer Order', 'wc-vendors' );
68
+ }
69
+
70
+ /**
71
+ * Trigger the sending of this email.
72
+ *
73
+ * @param int $order_id The order ID.
74
+ * @param WC_Order $order Order object.
75
+ */
76
+ public function trigger( $order_id, $order = false ) {
77
+
78
+ $this->setup_locale();
79
+
80
+ if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
81
+ $order = wc_get_order( $order_id );
82
+ }
83
+
84
+ $this->vendors = WCV_Vendors::get_vendors_from_order( $order );
85
+
86
+ if ( is_a( $order, 'WC_Order' ) ) {
87
+ $this->object = $order;
88
+ $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() );
89
+ $this->placeholders['{order_number}'] = $this->object->get_order_number();
90
+ }
91
+
92
+ if ( $this->is_enabled() && !empty( $this->vendors )) {
93
+
94
+ foreach ( $this->vendors as $vendor_id => $vendor_details ) {
95
+
96
+ $this->recipient = $vendor_details[ 'vendor' ]->user_email;
97
+ $this->order_items = $vendor_details[ 'line_items' ];
98
+ $this->vendor_id = $vendor_id;
99
+ $this->totals_display = $this->get_option( 'totals_display' );
100
+ $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
101
+
102
+ }
103
+ }
104
+
105
+ $this->restore_locale();
106
+ }
107
+
108
+ /**
109
+ * Get content html.
110
+ *
111
+ * @access public
112
+ * @return string
113
+ */
114
+ public function get_content_html() {
115
+
116
+ return wc_get_template_html( $this->template_html, array(
117
+ 'order' => $this->object,
118
+ 'vendor_id' => $this->vendor_id,
119
+ 'vendor_items' => $this->order_items,
120
+ 'email_heading' => $this->get_heading(),
121
+ 'totals_display' => $this->totals_display,
122
+ 'sent_to_admin' => false,
123
+ 'sent_to_vendor' => true,
124
+ 'plain_text' => false,
125
+ 'email' => $this,
126
+ ), 'woocommerce', $this->template_base );
127
+ }
128
+
129
+ /**
130
+ * Get content plain.
131
+ *
132
+ * @access public
133
+ * @return string
134
+ */
135
+ public function get_content_plain() {
136
+ return wc_get_template_html( $this->template_plain, array(
137
+ 'order' => $this->object,
138
+ 'vendor_id' => $this->vendor_id,
139
+ 'vendor_items' => $this->order_items,
140
+ 'email_heading' => $this->get_heading(),
141
+ 'sent_to_admin' => false,
142
+ 'sent_to_vendor' => true,
143
+ 'totals_display' => $this->totals_display,
144
+ 'plain_text' => true,
145
+ 'email' => $this,
146
+ ), 'woocommerce', $this->template_base );
147
+ }
148
+
149
+ /**
150
+ * Initialise settings form fields.
151
+ */
152
+ public function init_form_fields() {
153
+ $this->form_fields = array(
154
+ 'enabled' => array(
155
+ 'title' => __( 'Enable/Disable', 'wc-vendors' ),
156
+ 'type' => 'checkbox',
157
+ 'label' => __( 'Enable this email notification', 'wc-vendors' ),
158
+ 'default' => 'yes',
159
+ ),
160
+ 'subject' => array(
161
+ 'title' => __( 'Subject', 'wc-vendors' ),
162
+ 'type' => 'text',
163
+ 'desc_tip' => true,
164
+ /* translators: %s: list of placeholders */
165
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}, {order_date}, {order_number}</code>' ),
166
+ 'placeholder' => $this->get_default_subject(),
167
+ 'default' => '',
168
+ ),
169
+ 'heading' => array(
170
+ 'title' => __( 'Email heading', 'wc-vendors' ),
171
+ 'type' => 'text',
172
+ 'desc_tip' => true,
173
+ /* translators: %s: list of placeholders */
174
+ 'description' => sprintf( __( 'Available placeholders: %s', 'wc-vendors' ), '<code>{site_title}, {order_date}, {order_number}</code>' ),
175
+ 'placeholder' => $this->get_default_heading(),
176
+ 'default' => '',
177
+ ),
178
+ 'totals_display' => array(
179
+ 'title' => __( 'Totals Display', 'wc-vendors' ),
180
+ 'type' => 'select',
181
+ 'description' => __( 'Choose how to display the product totals. Including commission or without or no totals at all.', 'wc-vendors' ),
182
+ 'default' => 'both',
183
+ 'class' => 'wc-enhanced-select',
184
+ 'options' => array(
185
+ 'both' => __( 'Both', 'wc-vendors'),
186
+ 'comission' => __( 'Commission', 'wc-vendors' ),
187
+ 'product' => __( 'Product', 'wc-vendors' ),
188
+ 'none' => __( 'None', 'wc-vendors' ),
189
+ ),
190
+ 'desc_tip' => true,
191
+ ),
192
+ 'payment_method' => array(
193
+ 'title' => __( 'Payment method', 'wc-vendors' ),
194
+ 'type' => 'checkbox',
195
+ 'label' => __( 'Include the payment method in the email', 'wc-vendors' ),
196
+ 'default' => 'no',
197
+ ),
198
+ 'email_type' => array(
199
+ 'title' => __( 'Email type', 'wc-vendors' ),
200
+ 'type' => 'select',
201
+ 'description' => __( 'Choose which format of email to send.', 'wc-vendors' ),
202
+ 'default' => 'html',
203
+ 'class' => 'email_type wc-enhanced-select',
204
+ 'options' => $this->get_email_type_options(),
205
+ 'desc_tip' => true,
206
+ ),
207
+ );
208
+ }
209
+ }
210
+
211
+ endif;
212
+
213
+ return new WCVendors_Vendor_Notify_Order();
trunk/classes/admin/settings/README.md ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ WP Simple Settings Framework
2
+ ================================
3
+
4
+ A minimalistic framework for Wordpress Settings API.
5
+
6
+ Quick start
7
+ ------------
8
+
9
+ * [Download the latest release](https://github.com/Geczy/WP-Simple-Settings-Framework/zipball/master) (zip)
10
+
11
+ * Or, clone the repo, `git clone git://github.com/Geczy/WP-Simple-Settings-Framework.git`
12
+
13
+ Installation
14
+ ------------
15
+ 1. Include the framework in your Wordpress plugin by using:
16
+
17
+ ```php
18
+ <?php
19
+ add_action( 'init', 'sf_load_settings' );
20
+ function sf_load_settings() {
21
+ require 'classes/sf-class-settings.php';
22
+ $settings_framework = new SF_Settings_API($id = 'my_plugin_name', $title = 'My Plugin Title', $menu = 'plugins.php', __FILE__);
23
+ }
24
+ ```
25
+
26
+ Optionally, you might want to make `$settings_framework` a global variable so that you can use the [helper functions](#helpers).
27
+
28
+ 2. Open `sf-options.php` to begin configuring your options.
29
+
30
+ Features
31
+ ------------
32
+
33
+ ### Automatic settings page
34
+ Don't want it under the Plugins tab like in the screenshot? No problem, you can choose where you want it!
35
+
36
+ You can also change "Simple Settings" submenu to be anything you'd like.
37
+
38
+ ![settings page example](http://i.imgur.com/aEGUD.png)
39
+
40
+ ---
41
+
42
+ ### Tooltips
43
+ ![tooltips example](http://i.imgur.com/Z3Pnk.png)
44
+
45
+ Optional tooltips using [Twitter Bootstrap](http://twitter.github.com/bootstrap/javascript.html#tooltips)!
46
+
47
+ ---
48
+
49
+ ### Select box replacement
50
+ ![select box replacement](http://i.imgur.com/ikOXH.png)
51
+
52
+ Utilizing [Select2](http://ivaynberg.github.com/select2/) to display select boxes. It's pretty cool!
53
+
54
+ ---
55
+
56
+ ### Multiple tabs
57
+ ![multiple tabs example](http://i.imgur.com/OUM4i.png)
58
+
59
+ Create multiple tabs for your options.
60
+
61
+ ---
62
+
63
+ ### Input types
64
+
65
+ * Text
66
+ * Number
67
+ * Textarea
68
+ * Checkbox
69
+ * Radio
70
+ * Select
71
+ * WP Pages
72
+
73
+ Helpers
74
+ ------------
75
+
76
+ Update or add a new option
77
+
78
+ ```php
79
+ <?php
80
+ $settings_framework->update_option('your_option', 'new_value');
81
+ ```
82
+
83
+ Get an existing option's value
84
+
85
+ ```php
86
+ <?php
87
+ $settings_framework->get_option('your_option');
88
+ ```
89
+
90
+ Example configuration
91
+ ------------
92
+
93
+ Check out the [example config](https://github.com/Geczy/WP-Simple-Settings-Framework/blob/master/sf-options.php) for an idea of how to use every input type.
94
+
95
+ Here's an example of one type, though:
96
+
97
+ ```php
98
+ <?php
99
+ $options[] = array(
100
+ 'name' => __( 'Name', 'geczy' ),
101
+ 'desc' => __( 'Please tell me who you are.', 'geczy' ),
102
+ 'id' => 'text_sample',
103
+ 'type' => 'text',
104
+ );
105
+ ```
106
+
107
+
108
+ Bug tracker
109
+ -----------
110
+
111
+ Have a bug? Please create an issue here on GitHub!
112
+
113
+ https://github.com/Geczy/WP-Simple-Settings-Framework/issues/
114
+
115
+ Copyright and License
116
+ ---------------------
117
+
118
+ Copyright 2012 Matthew Gates
119
+
120
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
121
+
122
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
123
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
124
+ * Neither the names of the copyright holders nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission.
125
+
126
+ http://www.opensource.org/licenses/bsd-license.php
trunk/classes/admin/settings/assets/css/sf-styles.css ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ a.sf-tips {
2
+ height: 16px;
3
+ width: 16px;
4
+ margin-top: 0.2em;
5
+ float: right;
6
+ background: url(../img/tip.png) no-repeat top left;
7
+ }
8
+
9
+ /*!
10
+ * Bootstrap v2.3.1 [Styles for Tooltips]
11
+ *
12
+ * Copyright 2012 Twitter, Inc
13
+ * Licensed under the Apache License v2.0
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
17
+ */
18
+ .clearfix {
19
+ *zoom: 1;
20
+ }
21
+
22
+ .clearfix:before, .clearfix:after {
23
+ display: table;
24
+ content: "";
25
+ line-height: 0;
26
+ }
27
+
28
+ .clearfix:after {
29
+ clear: both;
30
+ }
31
+
32
+ .hide-text {
33
+ font: 0/0 a;
34
+ color: transparent;
35
+ text-shadow: none;
36
+ background-color: transparent;
37
+ border: 0;
38
+ }
39
+
40
+ .input-block-level {
41
+ display: block;
42
+ width: 100%;
43
+ min-height: 30px;
44
+ -webkit-box-sizing: border-box;
45
+ -moz-box-sizing: border-box;
46
+ box-sizing: border-box;
47
+ }
48
+
49
+ /* Tooltips */
50
+ .tooltip {
51
+ text-shadow: none;
52
+ }
53
+
54
+ .tooltip {
55
+ position: absolute;
56
+ z-index: 1030;
57
+ display: block;
58
+ visibility: visible;
59
+ font-size: 11px;
60
+ line-height: 1.4;
61
+ opacity: 0;
62
+ filter: alpha(opacity=0);
63
+ }
64
+
65
+ .tooltip.in {
66
+ opacity: 0.8;
67
+ filter: alpha(opacity=80);
68
+ }
69
+
70
+ .tooltip.top {
71
+ margin-top: -3px;
72
+ padding: 5px 0;
73
+ }
74
+
75
+ .tooltip.right {
76
+ margin-left: 3px;
77
+ padding: 0 5px;
78
+ }
79
+
80
+ .tooltip.bottom {
81
+ margin-top: 3px;
82
+ padding: 5px 0;
83
+ }
84
+
85
+ .tooltip.left {
86
+ margin-left: -3px;
87
+ padding: 0 5px;
88
+ }
89
+
90
+ .tooltip-inner {
91
+ max-width: 200px;
92
+ padding: 8px;
93
+ color: #ffffff;
94
+ text-align: center;
95
+ text-decoration: none;
96
+ background-color: #000000;
97
+ -webkit-border-radius: 4px;
98
+ -moz-border-radius: 4px;
99
+ border-radius: 4px;
100
+ }
101
+
102
+ .tooltip-arrow {
103
+ position: absolute;
104
+ width: 0;
105
+ height: 0;
106
+ border-color: transparent;
107
+ border-style: solid;
108
+ }
109
+
110
+ .tooltip.top .tooltip-arrow {
111
+ bottom: 0;
112
+ left: 50%;
113
+ margin-left: -5px;
114
+ border-width: 5px 5px 0;
115
+ border-top-color: #000000;
116
+ }
117
+
118
+ .tooltip.right .tooltip-arrow {
119
+ top: 50%;
120
+ left: 0;
121
+ margin-top: -5px;
122
+ border-width: 5px 5px 5px 0;
123
+ border-right-color: #000000;
124
+ }
125
+
126
+ .tooltip.left .tooltip-arrow {
127
+ top: 50%;
128
+ right: 0;
129
+ margin-top: -5px;
130
+ border-width: 5px 0 5px 5px;
131
+ border-left-color: #000000;
132
+ }
133
+
134
+ .tooltip.bottom .tooltip-arrow {
135
+ top: 0;
136
+ left: 50%;
137
+ margin-left: -5px;
138
+ border-width: 0 5px 5px;
139
+ border-bottom-color: #000000;
140
+ }
141
+
142
+ /* Animation */
143
+ .fade {
144
+ opacity: 0;
145
+ -webkit-transition: opacity 0.15s linear;
146
+ -moz-transition: opacity 0.15s linear;
147
+ -o-transition: opacity 0.15s linear;
148
+ transition: opacity 0.15s linear;
149
+ }
150
+
151
+ .fade.in {
152
+ opacity: 1;
153
+ }
154
+
155
+ .collapse {
156
+ position: relative;
157
+ height: 0;
158
+ overflow: hidden;
159
+ -webkit-transition: height 0.35s ease;
160
+ -moz-transition: height 0.35s ease;
161
+ -o-transition: height 0.35s ease;
162
+ transition: height 0.35s ease;
163
+ }
164
+
165
+ .collapse.in {
166
+ height: auto;
167
+ }
trunk/classes/admin/settings/assets/img/tip.png ADDED
Binary file
trunk/classes/admin/settings/assets/js/bootstrap-tooltip.js ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Bootstrap.js by @fat & @mdo
3
+ * plugins: bootstrap-transition.js, bootstrap-tooltip.js
4
+ * 2.3.1
5
+ * Copyright 2012 Twitter, Inc.
6
+ * http://www.apache.org/licenses/LICENSE-2.0.txt
7
+ */
8
+ !function (a) {
9
+ a(function () {
10
+ a.support.transition = function () {
11
+ var a = function () {
12
+ var a = document.createElement("bootstrap"), b = {WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend", transition: "transitionend"}, c;
13
+ for (c in b)if (a.style[c] !== undefined)return b[c]
14
+ }();
15
+ return a && {end: a}
16
+ }()
17
+ })
18
+ }(window.jQuery), !function (a) {
19
+ var b = function (a, b) {
20
+ this.init("tooltip", a, b)
21
+ };
22
+ b.prototype = {constructor: b, init: function (b, c, d) {
23
+ var e, f, g, h, i;
24
+ this.type = b, this.$element = a(c), this.options = this.getOptions(d), this.enabled = !0, g = this.options.trigger.split(" ");
25
+ for (i = g.length; i--;)h = g[i], h == "click" ? this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this)) : h != "manual" && (e = h == "hover" ? "mouseenter" : "focus", f = h == "hover" ? "mouseleave" : "blur", this.$element.on(e + "." + this.type, this.options.selector, a.proxy(this.enter, this)), this.$element.on(f + "." + this.type, this.options.selector, a.proxy(this.leave, this)));
26
+ this.options.selector ? this._options = a.extend({}, this.options, {trigger: "manual", selector: ""}) : this.fixTitle()
27
+ }, getOptions: function (b) {
28
+ return b = a.extend({}, a.fn[this.type].defaults, this.$element.data(), b), b.delay && typeof b.delay == "number" && (b.delay = {show: b.delay, hide: b.delay}), b
29
+ }, enter: function (b) {
30
+ var c = a.fn[this.type].defaults, d = {}, e;
31
+ this._options && a.each(this._options, function (a, b) {
32
+ c[a] != b && (d[a] = b)
33
+ }, this), e = a(b.currentTarget)[this.type](d).data(this.type);
34
+ if (!e.options.delay || !e.options.delay.show)return e.show();
35
+ clearTimeout(this.timeout), e.hoverState = "in", this.timeout = setTimeout(function () {
36
+ e.hoverState == "in" && e.show()
37
+ }, e.options.delay.show)
38
+ }, leave: function (b) {
39
+ var c = a(b.currentTarget)[this.type](this._options).data(this.type);
40
+ this.timeout && clearTimeout(this.timeout);
41
+ if (!c.options.delay || !c.options.delay.hide)return c.hide();
42
+ c.hoverState = "out", this.timeout = setTimeout(function () {
43
+ c.hoverState == "out" && c.hide()
44
+ }, c.options.delay.hide)
45
+ }, show: function () {
46
+ var b, c, d, e, f, g, h = a.Event("show");
47
+ if (this.hasContent() && this.enabled) {
48
+ this.$element.trigger(h);
49
+ if (h.isDefaultPrevented())return;
50
+ b = this.tip(), this.setContent(), this.options.animation && b.addClass("fade"), f = typeof this.options.placement == "function" ? this.options.placement.call(this, b[0], this.$element[0]) : this.options.placement, b.detach().css({top: 0, left: 0, display: "block"}), this.options.container ? b.appendTo(this.options.container) : b.insertAfter(this.$element), c = this.getPosition(), d = b[0].offsetWidth, e = b[0].offsetHeight;
51
+ switch (f) {
52
+ case"bottom":
53
+ g = {top: c.top + c.height, left: c.left + c.width / 2 - d / 2};
54
+ break;
55
+ case"top":
56
+ g = {top: c.top - e, left: c.left + c.width / 2 - d / 2};
57
+ break;
58
+ case"left":
59
+ g = {top: c.top + c.height / 2 - e / 2, left: c.left - d};
60
+ break;
61
+ case"right":
62
+ g = {top: c.top + c.height / 2 - e / 2, left: c.left + c.width}
63
+ }
64
+ this.applyPlacement(g, f), this.$element.trigger("shown")
65
+ }
66
+ }, applyPlacement: function (a, b) {
67
+ var c = this.tip(), d = c[0].offsetWidth, e = c[0].offsetHeight, f, g, h, i;
68
+ c.offset(a).addClass(b).addClass("in"), f = c[0].offsetWidth, g = c[0].offsetHeight, b == "top" && g != e && (a.top = a.top + e - g, i = !0), b == "bottom" || b == "top" ? (h = 0, a.left < 0 && (h = a.left * -2, a.left = 0, c.offset(a), f = c[0].offsetWidth, g = c[0].offsetHeight), this.replaceArrow(h - d + f, f, "left")) : this.replaceArrow(g - e, g, "top"), i && c.offset(a)
69
+ }, replaceArrow: function (a, b, c) {
70
+ this.arrow().css(c, a ? 50 * (1 - a / b) + "%" : "")
71
+ }, setContent: function () {
72
+ var a = this.tip(), b = this.getTitle();
73
+ a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b), a.removeClass("fade in top bottom left right")
74
+ }, hide: function () {
75
+ function e() {
76
+ var b = setTimeout(function () {
77
+ c.off(a.support.transition.end).detach()
78
+ }, 500);
79
+ c.one(a.support.transition.end, function () {
80
+ clearTimeout(b), c.detach()
81
+ })
82
+ }
83
+
84
+ var b = this, c = this.tip(), d = a.Event("hide");
85
+ this.$element.trigger(d);
86
+ if (d.isDefaultPrevented())return;
87
+ return c.removeClass("in"), a.support.transition && this.$tip.hasClass("fade") ? e() : c.detach(), this.$element.trigger("hidden"), this
88
+ }, fixTitle: function () {
89
+ var a = this.$element;
90
+ (a.attr("title") || typeof a.attr("data-original-title") != "string") && a.attr("data-original-title", a.attr("title") || "").attr("title", "")
91
+ }, hasContent: function () {
92
+ return this.getTitle()
93
+ }, getPosition: function () {
94
+ var b = this.$element[0];
95
+ return a.extend({}, typeof b.getBoundingClientRect == "function" ? b.getBoundingClientRect() : {width: b.offsetWidth, height: b.offsetHeight}, this.$element.offset())
96
+ }, getTitle: function () {
97
+ var a, b = this.$element, c = this.options;
98
+ return a = b.attr("data-original-title") || (typeof c.title == "function" ? c.title.call(b[0]) : c.title), a
99
+ }, tip: function () {
100
+ return this.$tip = this.$tip || a(this.options.template)
101
+ }, arrow: function () {
102
+ return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
103
+ }, validate: function () {
104
+ this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
105
+ }, enable: function () {
106
+ this.enabled = !0
107
+ }, disable: function () {
108
+ this.enabled = !1
109
+ }, toggleEnabled: function () {
110
+ this.enabled = !this.enabled
111
+ }, toggle: function (b) {
112
+ var c = b ? a(b.currentTarget)[this.type](this._options).data(this.type) : this;
113
+ c.tip().hasClass("in") ? c.hide() : c.show()
114
+ }, destroy: function () {
115
+ this.hide().$element.off("." + this.type).removeData(this.type)
116
+ }};
117
+ var c = a.fn.tooltip;
118
+ a.fn.tooltip = function (c) {
119
+ return this.each(function () {
120
+ var d = a(this), e = d.data("tooltip"), f = typeof c == "object" && c;
121
+ e || d.data("tooltip", e = new b(this, f)), typeof c == "string" && e[c]()
122
+ })
123
+ }, a.fn.tooltip.Constructor = b, a.fn.tooltip.defaults = {animation: !0, placement: "top", selector: !1, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger: "hover focus", title: "", delay: 0, html: !1, container: !1}, a.fn.tooltip.noConflict = function () {
124
+ return a.fn.tooltip = c, this
125
+ }
126
+ }(window.jQuery)
trunk/classes/admin/settings/assets/js/js.iml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ </component>
9
+ </module>
10
+
trunk/classes/admin/settings/assets/js/select2/select2-bootstrap.css ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .form-control .select2-choice {
2
+ border: 0;
3
+ border-radius: 2px;
4
+ }
5
+
6
+ .form-control .select2-choice .select2-arrow {
7
+ border-radius: 0 2px 2px 0;
8
+ }
9
+
10
+ .form-control.select2-container {
11
+ height: auto !important;
12
+ padding: 0;
13
+ }
14
+
15
+ .form-control.select2-container.select2-dropdown-open {
16
+ border-color: #5897FB;
17
+ border-radius: 3px 3px 0 0;
18
+ }
19
+
20
+ .form-control .select2-container.select2-dropdown-open .select2-choices {
21
+ border-radius: 3px 3px 0 0;
22
+ }
23
+
24
+ .form-control.select2-container .select2-choices {
25
+ border: 0 !important;
26
+ border-radius: 3px;
27
+ }
28
+
29
+ .control-group.warning .select2-container .select2-choice,
30
+ .control-group.warning .select2-container .select2-choices,
31
+ .control-group.warning .select2-container-active .select2-choice,
32
+ .control-group.warning .select2-container-active .select2-choices,
33
+ .control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice,
34
+ .control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices,
35
+ .control-group.warning .select2-container-multi.select2-container-active .select2-choices {
36
+ border: 1px solid #C09853 !important;
37
+ }
38
+
39
+ .control-group.warning .select2-container .select2-choice div {
40
+ border-left: 1px solid #C09853 !important;
41
+ background: #FCF8E3 !important;
42
+ }
43
+
44
+ .control-group.error .select2-container .select2-choice,
45
+ .control-group.error .select2-container .select2-choices,
46
+ .control-group.error .select2-container-active .select2-choice,
47
+ .control-group.error .select2-container-active .select2-choices,
48
+ .control-group.error .select2-dropdown-open.select2-drop-above .select2-choice,
49
+ .control-group.error .select2-dropdown-open.select2-drop-above .select2-choices,
50
+ .control-group.error .select2-container-multi.select2-container-active .select2-choices {
51
+ border: 1px solid #B94A48 !important;
52
+ }
53
+
54
+ .control-group.error .select2-container .select2-choice div {
55
+ border-left: 1px solid #B94A48 !important;
56
+ background: #F2DEDE !important;
57
+ }
58
+
59
+ .control-group.info .select2-container .select2-choice,
60
+ .control-group.info .select2-container .select2-choices,
61
+ .control-group.info .select2-container-active .select2-choice,
62
+ .control-group.info .select2-container-active .select2-choices,
63
+ .control-group.info .select2-dropdown-open.select2-drop-above .select2-choice,
64
+ .control-group.info .select2-dropdown-open.select2-drop-above .select2-choices,
65
+ .control-group.info .select2-container-multi.select2-container-active .select2-choices {
66
+ border: 1px solid #3A87AD !important;
67
+ }
68
+
69
+ .control-group.info .select2-container .select2-choice div {
70
+ border-left: 1px solid #3A87AD !important;
71
+ background: #D9EDF7 !important;
72
+ }
73
+
74
+ .control-group.success .select2-container .select2-choice,
75
+ .control-group.success .select2-container .select2-choices,
76
+ .control-group.success .select2-container-active .select2-choice,
77
+ .control-group.success .select2-container-active .select2-choices,
78
+ .control-group.success .select2-dropdown-open.select2-drop-above .select2-choice,
79
+ .control-group.success .select2-dropdown-open.select2-drop-above .select2-choices,
80
+ .control-group.success .select2-container-multi.select2-container-active .select2-choices {
81
+ border: 1px solid #468847 !important;
82
+ }
83
+
84
+ .control-group.success .select2-container .select2-choice div {
85
+ border-left: 1px solid #468847 !important;
86
+ background: #DFF0D8 !important;
87
+ }
trunk/classes/admin/settings/assets/js/select2/select2-spinner.gif ADDED
Binary file
trunk/classes/admin/settings/assets/js/select2/select2.css ADDED
@@ -0,0 +1,704 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
3
+ */
4
+ .select2-container {
5
+ margin: 0;
6
+ position: relative;
7
+ display: inline-block;
8
+ /* inline-block for ie7 */
9
+ zoom: 1;
10
+ *display: inline;
11
+ vertical-align: middle;
12
+ }
13
+
14
+ .select2-container,
15
+ .select2-drop,
16
+ .select2-search,
17
+ .select2-search input {
18
+ /*
19
+ Force border-box so that % widths fit the parent
20
+ container without overlap because of margin/padding.
21
+ More Info : http://www.quirksmode.org/css/box.html
22
+ */
23
+ -webkit-box-sizing: border-box; /* webkit */
24
+ -moz-box-sizing: border-box; /* firefox */
25
+ box-sizing: border-box; /* css3 */
26
+ }
27
+
28
+ .select2-container .select2-choice {
29
+ display: block;
30
+ height: 26px;
31
+ padding: 0 0 0 8px;
32
+ overflow: hidden;
33
+ position: relative;
34
+
35
+ border: 1px solid #aaa;
36
+ white-space: nowrap;
37
+ line-height: 26px;
38
+ color: #444;
39
+ text-decoration: none;
40
+
41
+ border-radius: 4px;
42
+
43
+ background-clip: padding-box;
44
+
45
+ -webkit-touch-callout: none;
46
+ -webkit-user-select: none;
47
+ -moz-user-select: none;
48
+ -ms-user-select: none;
49
+ user-select: none;
50
+
51
+ background-color: #fff;
52
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff));
53
+ background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%);
54
+ background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%);
55
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
56
+ background-image: linear-gradient(to top, #eee 0%, #fff 50%);
57
+ }
58
+
59
+ html[dir="rtl"] .select2-container .select2-choice {
60
+ padding: 0 8px 0 0;
61
+ }
62
+
63
+ .select2-container.select2-drop-above .select2-choice {
64
+ border-bottom-color: #aaa;
65
+
66
+ border-radius: 0 0 4px 4px;
67
+
68
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff));
69
+ background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%);
70
+ background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%);
71
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);
72
+ background-image: linear-gradient(to bottom, #eee 0%, #fff 90%);
73
+ }
74
+
75
+ .select2-container.select2-allowclear .select2-choice .select2-chosen {
76
+ margin-right: 42px;
77
+ }
78
+
79
+ .select2-container .select2-choice > .select2-chosen {
80
+ margin-right: 26px;
81
+ display: block;
82
+ overflow: hidden;
83
+
84
+ white-space: nowrap;
85
+
86
+ text-overflow: ellipsis;
87
+ float: none;
88
+ width: auto;
89
+ }
90
+
91
+ html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
92
+ margin-left: 26px;
93
+ margin-right: 0;
94
+ }
95
+
96
+ .select2-container .select2-choice abbr {
97
+ display: none;
98
+ width: 12px;
99
+ height: 12px;
100
+ position: absolute;
101
+ right: 24px;
102
+ top: 8px;
103
+
104
+ font-size: 1px;
105
+ text-decoration: none;
106
+
107
+ border: 0;
108
+ background: url('select2.png') right top no-repeat;
109
+ cursor: pointer;
110
+ outline: 0;
111
+ }
112
+
113
+ .select2-container.select2-allowclear .select2-choice abbr {
114
+ display: inline-block;
115
+ }
116
+
117
+ .select2-container .select2-choice abbr:hover {
118
+ background-position: right -11px;
119
+ cursor: pointer;
120
+ }
121
+
122
+ .select2-drop-mask {
123
+ border: 0;
124
+ margin: 0;
125
+ padding: 0;
126
+ position: fixed;
127
+ left: 0;
128
+ top: 0;
129
+ min-height: 100%;
130
+ min-width: 100%;
131
+ height: auto;
132
+ width: auto;
133
+ opacity: 0;
134
+ z-index: 9998;
135
+ /* styles required for IE to work */
136
+ background-color: #fff;
137
+ filter: alpha(opacity=0);
138
+ }
139
+
140
+ .select2-drop {
141
+ width: 100%;
142
+ margin-top: -1px;
143
+ position: absolute;
144
+ z-index: 9999;
145
+ top: 100%;
146
+
147
+ background: #fff;
148
+ color: #000;
149
+ border: 1px solid #aaa;
150
+ border-top: 0;
151
+
152
+ border-radius: 0 0 4px 4px;
153
+
154
+ -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
155
+ box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
156
+ }
157
+
158
+ .select2-drop.select2-drop-above {
159
+ margin-top: 1px;
160
+ border-top: 1px solid #aaa;
161
+ border-bottom: 0;
162
+
163
+ border-radius: 4px 4px 0 0;
164
+
165
+ -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
166
+ box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
167
+ }
168
+
169
+ .select2-drop-active {
170
+ border: 1px solid #5897fb;
171
+ border-top: none;
172
+ }
173
+
174
+ .select2-drop.select2-drop-above.select2-drop-active {
175
+ border-top: 1px solid #5897fb;
176
+ }
177
+
178
+ .select2-drop-auto-width {
179
+ border-top: 1px solid #aaa;
180
+ width: auto;
181
+ }
182
+
183
+ .select2-drop-auto-width .select2-search {
184
+ padding-top: 4px;
185
+ }
186
+
187
+ .select2-container .select2-choice .select2-arrow {
188
+ display: inline-block;
189
+ width: 18px;
190
+ height: 100%;
191
+ position: absolute;
192
+ right: 0;
193
+ top: 0;
194
+
195
+ border-left: 1px solid #aaa;
196
+ border-radius: 0 4px 4px 0;
197
+
198
+ background-clip: padding-box;
199
+
200
+ background: #ccc;
201
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
202
+ background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
203
+ background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
204
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
205
+ background-image: linear-gradient(to top, #ccc 0%, #eee 60%);
206
+ }
207
+
208
+ html[dir="rtl"] .select2-container .select2-choice .select2-arrow {
209
+ left: 0;
210
+ right: auto;
211
+
212
+ border-left: none;
213
+ border-right: 1px solid #aaa;
214
+ border-radius: 4px 0 0 4px;
215
+ }
216
+
217
+ .select2-container .select2-choice .select2-arrow b {
218
+ display: block;
219
+ width: 100%;
220
+ height: 100%;
221
+ background: url('select2.png') no-repeat 0 1px;
222
+ }
223
+
224
+ html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
225
+ background-position: 2px 1px;
226
+ }
227
+
228
+ .select2-search {
229
+ display: inline-block;
230
+ width: 100%;
231
+ min-height: 26px;
232
+ margin: 0;
233
+ padding-left: 4px;
234
+ padding-right: 4px;
235
+
236
+ position: relative;
237
+ z-index: 10000;
238
+
239
+ white-space: nowrap;
240
+ }
241
+
242
+ .select2-search input {
243
+ width: 100%;
244
+ height: auto !important;
245
+ min-height: 26px;
246
+ padding: 4px 20px 4px 5px;
247
+ margin: 0;
248
+
249
+ outline: 0;
250
+ font-family: sans-serif;
251
+ font-size: 1em;
252
+
253
+ border: 1px solid #aaa;
254
+ border-radius: 0;
255
+
256
+ -webkit-box-shadow: none;
257
+ box-shadow: none;
258
+
259
+ background: #fff url('select2.png') no-repeat 100% -22px;
260
+ background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
261
+ background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
262
+ background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
263
+ background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
264
+ }
265
+
266
+ html[dir="rtl"] .select2-search input {
267
+ padding: 4px 5px 4px 20px;
268
+
269
+ background: #fff url('select2.png') no-repeat -37px -22px;
270
+ background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
271
+ background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
272
+ background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
273
+ background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
274
+ }
275
+
276
+ .select2-drop.select2-drop-above .select2-search input {
277
+ margin-top: 4px;
278
+ }
279
+
280
+ .select2-search input.select2-active {
281
+ background: #fff url('select2-spinner.gif') no-repeat 100%;
282
+ background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
283
+ background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
284
+ background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
285
+ background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
286
+ }
287
+
288
+ .select2-container-active .select2-choice,
289
+ .select2-container-active .select2-choices {
290
+ border: 1px solid #5897fb;
291
+ outline: none;
292
+
293
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
294
+ box-shadow: 0 0 5px rgba(0, 0, 0, .3);
295
+ }
296
+
297
+ .select2-dropdown-open .select2-choice {
298
+ border-bottom-color: transparent;
299
+ -webkit-box-shadow: 0 1px 0 #fff inset;
300
+ box-shadow: 0 1px 0 #fff inset;
301
+
302
+ border-bottom-left-radius: 0;
303
+ border-bottom-right-radius: 0;
304
+
305
+ background-color: #eee;
306
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee));
307
+ background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%);
308
+ background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%);
309
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
310
+ background-image: linear-gradient(to top, #fff 0%, #eee 50%);
311
+ }
312
+
313
+ .select2-dropdown-open.select2-drop-above .select2-choice,
314
+ .select2-dropdown-open.select2-drop-above .select2-choices {
315
+ border: 1px solid #5897fb;
316
+ border-top-color: transparent;
317
+
318
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee));
319
+ background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%);
320
+ background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%);
321
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
322
+ background-image: linear-gradient(to bottom, #fff 0%, #eee 50%);
323
+ }
324
+
325
+ .select2-dropdown-open .select2-choice .select2-arrow {
326
+ background: transparent;
327
+ border-left: none;
328
+ filter: none;
329
+ }
330
+ html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow {
331
+ border-right: none;
332
+ }
333
+
334
+ .select2-dropdown-open .select2-choice .select2-arrow b {
335
+ background-position: -18px 1px;
336
+ }
337
+
338
+ html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b {
339
+ background-position: -16px 1px;
340
+ }
341
+
342
+ .select2-hidden-accessible {
343
+ border: 0;
344
+ clip: rect(0 0 0 0);
345
+ height: 1px;
346
+ margin: -1px;
347
+ overflow: hidden;
348
+ padding: 0;
349
+ position: absolute;
350
+ width: 1px;
351
+ }
352
+
353
+ /* results */
354
+ .select2-results {
355
+ max-height: 200px;
356
+ padding: 0 0 0 4px;
357
+ margin: 4px 4px 4px 0;
358
+ position: relative;
359
+ overflow-x: hidden;
360
+ overflow-y: auto;
361
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
362
+ }
363
+
364
+ html[dir="rtl"] .select2-results {
365
+ padding: 0 4px 0 0;
366
+ margin: 4px 0 4px 4px;
367
+ }
368
+
369
+ .select2-results ul.select2-result-sub {
370
+ margin: 0;
371
+ padding-left: 0;
372
+ }
373
+
374
+ .select2-results li {
375
+ list-style: none;
376
+ display: list-item;
377
+ background-image: none;
378
+ }
379
+
380
+ .select2-results li.select2-result-with-children > .select2-result-label {
381
+ font-weight: bold;
382
+ }
383
+
384
+ .select2-results .select2-result-label {
385
+ padding: 3px 7px 4px;
386
+ margin: 0;
387
+ cursor: pointer;
388
+
389
+ min-height: 1em;
390
+
391
+ -webkit-touch-callout: none;
392
+ -webkit-user-select: none;
393
+ -moz-user-select: none;
394
+ -ms-user-select: none;
395
+ user-select: none;
396
+ }
397
+
398
+ .select2-results-dept-1 .select2-result-label { padding-left: 20px }
399
+ .select2-results-dept-2 .select2-result-label { padding-left: 40px }
400
+ .select2-results-dept-3 .select2-result-label { padding-left: 60px }
401
+ .select2-results-dept-4 .select2-result-label { padding-left: 80px }
402
+ .select2-results-dept-5 .select2-result-label { padding-left: 100px }
403
+ .select2-results-dept-6 .select2-result-label { padding-left: 110px }
404
+ .select2-results-dept-7 .select2-result-label { padding-left: 120px }
405
+
406
+ .select2-results .select2-highlighted {
407
+ background: #3875d7;
408
+ color: #fff;
409
+ }
410
+
411
+ .select2-results li em {
412
+ background: #feffde;
413
+ font-style: normal;
414
+ }
415
+
416
+ .select2-results .select2-highlighted em {
417
+ background: transparent;
418
+ }
419
+
420
+ .select2-results .select2-highlighted ul {
421
+ background: #fff;
422
+ color: #000;
423
+ }
424
+
425
+ .select2-results .select2-no-results,
426
+ .select2-results .select2-searching,
427
+ .select2-results .select2-ajax-error,
428
+ .select2-results .select2-selection-limit {
429
+ background: #f4f4f4;
430
+ display: list-item;
431
+ padding-left: 5px;
432
+ }
433
+
434
+ /*
435
+ disabled look for disabled choices in the results dropdown
436
+ */
437
+ .select2-results .select2-disabled.select2-highlighted {
438
+ color: #666;
439
+ background: #f4f4f4;
440
+ display: list-item;
441
+ cursor: default;
442
+ }
443
+ .select2-results .select2-disabled {
444
+ background: #f4f4f4;
445
+ display: list-item;
446
+ cursor: default;
447
+ }
448
+
449
+ .select2-results .select2-selected {
450
+ display: none;
451
+ }
452
+
453
+ .select2-more-results.select2-active {
454
+ background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
455
+ }
456
+
457
+ .select2-results .select2-ajax-error {
458
+ background: rgba(255, 50, 50, .2);
459
+ }
460
+
461
+ .select2-more-results {
462
+ background: #f4f4f4;
463
+ display: list-item;
464
+ }
465
+
466
+ /* disabled styles */
467
+
468
+ .select2-container.select2-container-disabled .select2-choice {
469
+ background-color: #f4f4f4;
470
+ background-image: none;
471
+ border: 1px solid #ddd;
472
+ cursor: default;
473
+ }
474
+
475
+ .select2-container.select2-container-disabled .select2-choice .select2-arrow {
476
+ background-color: #f4f4f4;
477
+ background-image: none;
478
+ border-left: 0;
479
+ }
480
+
481
+ .select2-container.select2-container-disabled .select2-choice abbr {
482
+ display: none;
483
+ }
484
+
485
+
486
+ /* multiselect */
487
+
488
+ .select2-container-multi .select2-choices {
489
+ height: auto !important;
490
+ height: 1%;
491
+ margin: 0;
492
+ padding: 0 5px 0 0;
493
+ position: relative;
494
+
495
+ border: 1px solid #aaa;
496
+ cursor: text;
497
+ overflow: hidden;
498
+
499
+ background-color: #fff;
500
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff));
501
+ background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%);
502
+ background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%);
503
+ background-image: linear-gradient(to bottom, #eee 1%, #fff 15%);
504
+ }
505
+
506
+ html[dir="rtl"] .select2-container-multi .select2-choices {
507
+ padding: 0 0 0 5px;
508
+ }
509
+
510
+ .select2-locked {
511
+ padding: 3px 5px 3px 5px !important;
512
+ }
513
+
514
+ .select2-container-multi .select2-choices {
515
+ min-height: 26px;
516
+ }
517
+
518
+ .select2-container-multi.select2-container-active .select2-choices {
519
+ border: 1px solid #5897fb;
520
+ outline: none;
521
+
522
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
523
+ box-shadow: 0 0 5px rgba(0, 0, 0, .3);
524
+ }
525
+ .select2-container-multi .select2-choices li {
526
+ float: left;
527
+ list-style: none;
528
+ }
529
+ html[dir="rtl"] .select2-container-multi .select2-choices li
530
+ {
531
+ float: right;
532
+ }
533
+ .select2-container-multi .select2-choices .select2-search-field {
534
+ margin: 0;
535
+ padding: 0;
536
+ white-space: nowrap;
537
+ }
538
+
539
+ .select2-container-multi .select2-choices .select2-search-field input {
540
+ padding: 5px;
541
+ margin: 1px 0;
542
+
543
+ font-family: sans-serif;
544
+ font-size: 100%;
545
+ color: #666;
546
+ outline: 0;
547
+ border: 0;
548
+ -webkit-box-shadow: none;
549
+ box-shadow: none;
550
+ background: transparent !important;
551
+ }
552
+
553
+ .select2-container-multi .select2-choices .select2-search-field input.select2-active {
554
+ background: #fff url('select2-spinner.gif') no-repeat 100% !important;
555
+ }
556
+
557
+ .select2-default {
558
+ color: #999 !important;
559
+ }
560
+
561
+ .select2-container-multi .select2-choices .select2-search-choice {
562
+ padding: 3px 5px 3px 18px;
563
+ margin: 3px 0 3px 5px;
564
+ position: relative;
565
+
566
+ line-height: 13px;
567
+ color: #333;
568
+ cursor: default;
569
+ border: 1px solid #aaaaaa;
570
+
571
+ border-radius: 3px;
572
+
573
+ -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
574
+ box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
575
+
576
+ background-clip: padding-box;
577
+
578
+ -webkit-touch-callout: none;
579
+ -webkit-user-select: none;
580
+ -moz-user-select: none;
581
+ -ms-user-select: none;
582
+ user-select: none;
583
+
584
+ background-color: #e4e4e4;
585
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
586
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
587
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
588
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
589
+ background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
590
+ }
591
+ html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
592
+ {
593
+ margin: 3px 5px 3px 0;
594
+ padding: 3px 18px 3px 5px;
595
+ }
596
+ .select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
597
+ cursor: default;
598
+ }
599
+ .select2-container-multi .select2-choices .select2-search-choice-focus {
600
+ background: #d4d4d4;
601
+ }
602
+
603
+ .select2-search-choice-close {
604
+ display: block;
605
+ width: 12px;
606
+ height: 13px;
607
+ position: absolute;
608
+ right: 3px;
609
+ top: 4px;
610
+
611
+ font-size: 1px;
612
+ outline: none;
613
+ background: url('select2.png') right top no-repeat;
614
+ }
615
+ html[dir="rtl"] .select2-search-choice-close {
616
+ right: auto;
617
+ left: 3px;
618
+ }
619
+
620
+ .select2-container-multi .select2-search-choice-close {
621
+ left: 3px;
622
+ }
623
+
624
+ html[dir="rtl"] .select2-container-multi .select2-search-choice-close {
625
+ left: auto;
626
+ right: 2px;
627
+ }
628
+
629
+ .select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
630
+ background-position: right -11px;
631
+ }
632
+ .select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
633
+ background-position: right -11px;
634
+ }
635
+
636
+ /* disabled styles */
637
+ .select2-container-multi.select2-container-disabled .select2-choices {
638
+ background-color: #f4f4f4;
639
+ background-image: none;
640
+ border: 1px solid #ddd;
641
+ cursor: default;
642
+ }
643
+
644
+ .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
645
+ padding: 3px 5px 3px 5px;
646
+ border: 1px solid #ddd;
647
+ background-image: none;
648
+ background-color: #f4f4f4;
649
+ }
650
+
651
+ .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
652
+ background: none;
653
+ }
654
+ /* end multiselect */
655
+
656
+
657
+ .select2-result-selectable .select2-match,
658
+ .select2-result-unselectable .select2-match {
659
+ text-decoration: underline;
660
+ }
661
+
662
+ .select2-offscreen, .select2-offscreen:focus {
663
+ clip: rect(0 0 0 0) !important;
664
+ width: 1px !important;
665
+ height: 1px !important;
666
+ border: 0 !important;
667
+ margin: 0 !important;
668
+ padding: 0 !important;
669
+ overflow: hidden !important;
670
+ position: absolute !important;
671
+ outline: 0 !important;
672
+ left: 0px !important;
673
+ top: 0px !important;
674
+ }
675
+
676
+ .select2-display-none {
677
+ display: none;
678
+ }
679
+
680
+ .select2-measure-scrollbar {
681
+ position: absolute;
682
+ top: -10000px;
683
+ left: -10000px;
684
+ width: 100px;
685
+ height: 100px;
686
+ overflow: scroll;
687
+ }
688
+
689
+ /* Retina-ize icons */
690
+
691
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) {
692
+ .select2-search input,
693
+ .select2-search-choice-close,
694
+ .select2-container .select2-choice abbr,
695
+ .select2-container .select2-choice .select2-arrow b {
696
+ background-image: url('select2x2.png') !important;
697
+ background-repeat: no-repeat !important;
698
+ background-size: 60px 40px !important;
699
+ }
700
+
701
+ .select2-search input {
702
+ background-position: 100% -21px !important;
703
+ }
704
+ }
trunk/classes/admin/settings/assets/js/select2/select2.js ADDED
@@ -0,0 +1,3541 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Copyright 2012 Igor Vaynberg
3
+
4
+ Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
5
+
6
+ This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
7
+ General Public License version 2 (the "GPL License"). You may choose either license to govern your
8
+ use of this software only upon the condition that you accept all of the terms of either the Apache
9
+ License or the GPL License.
10
+
11
+ You may obtain a copy of the Apache License and the GPL License at:
12
+
13
+ http://www.apache.org/licenses/LICENSE-2.0
14
+ http://www.gnu.org/licenses/gpl-2.0.html
15
+
16
+ Unless required by applicable law or agreed to in writing, software distributed under the
17
+ Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
18
+ CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
19
+ the specific language governing permissions and limitations under the Apache License and the GPL License.
20
+ */
21
+ (function ($) {
22
+ if(typeof $.fn.each2 == "undefined") {
23
+ $.extend($.fn, {
24
+ /*
25
+ * 4-10 times faster .each replacement
26
+ * use it carefully, as it overrides jQuery context of element on each iteration
27
+ */
28
+ each2 : function (c) {
29
+ var j = $([0]), i = -1, l = this.length;
30
+ while (
31
+ ++i < l
32
+ && (j.context = j[0] = this[i])
33
+ && c.call(j[0], i, j) !== false //"this"=DOM, i=index, j=jQuery object
34
+ );
35
+ return this;
36
+ }
37
+ });
38
+ }
39
+ })(jQuery);
40
+
41
+ (function ($, undefined) {
42
+ "use strict";
43
+ /*global document, window, jQuery, console */
44
+
45
+ if (window.Select2 !== undefined) {
46
+ return;
47
+ }
48
+
49
+ var AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer,
50
+ lastMousePosition={x:0,y:0}, $document, scrollBarDimensions,
51
+
52
+ KEY = {
53
+ TAB: 9,
54
+ ENTER: 13,
55
+ ESC: 27,
56
+ SPACE: 32,
57
+ LEFT: 37,
58
+ UP: 38,
59
+ RIGHT: 39,
60
+ DOWN: 40,
61
+ SHIFT: 16,
62
+ CTRL: 17,
63
+ ALT: 18,
64
+ PAGE_UP: 33,
65
+ PAGE_DOWN: 34,
66
+ HOME: 36,
67
+ END: 35,
68
+ BACKSPACE: 8,
69
+ DELETE: 46,
70
+ isArrow: function (k) {
71
+ k = k.which ? k.which : k;
72
+ switch (k) {
73
+ case KEY.LEFT:
74
+ case KEY.RIGHT:
75
+ case KEY.UP:
76
+ case KEY.DOWN:
77
+ return true;
78
+ }
79
+ return false;
80
+ },
81
+ isControl: function (e) {
82
+ var k = e.which;
83
+ switch (k) {
84
+ case KEY.SHIFT:
85
+ case KEY.CTRL:
86
+ case KEY.ALT:
87
+ return true;
88
+ }
89
+
90
+ if (e.metaKey) return true;
91
+
92
+ return false;
93
+ },
94
+ isFunctionKey: function (k) {
95
+ k = k.which ? k.which : k;
96
+ return k >= 112 && k <= 123;
97
+ }
98
+ },
99
+ MEASURE_SCROLLBAR_TEMPLATE = "<div class='select2-measure-scrollbar'></div>",
100
+
101
+ DIACRITICS = {"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18":"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u1E9E":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC5":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u017F":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u00DF":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u1E9B":"s","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038A":"\u0399","\u03AA":"\u0399","\u038C":"\u039F","\u038E":"\u03A5","\u03AB":"\u03A5","\u038F":"\u03A9","\u03AC":"\u03B1","\u03AD":"\u03B5","\u03AE":"\u03B7","\u03AF":"\u03B9","\u03CA":"\u03B9","\u0390":"\u03B9","\u03CC":"\u03BF","\u03CD":"\u03C5","\u03CB":"\u03C5","\u03B0":"\u03C5","\u03C9":"\u03C9","\u03C2":"\u03C3"};
102
+
103
+ $document = $(document);
104
+
105
+ nextUid=(function() { var counter=1; return function() { return counter++; }; }());
106
+
107
+
108
+ function reinsertElement(element) {
109
+ var placeholder = $(document.createTextNode(''));
110
+
111
+ element.before(placeholder);
112
+ placeholder.before(element);
113
+ placeholder.remove();
114
+ }
115
+
116
+ function stripDiacritics(str) {
117
+ // Used 'uni range + named function' from http://jsperf.com/diacritics/18
118
+ function match(a) {
119
+ return DIACRITICS[a] || a;
120
+ }
121
+
122
+ return str.replace(/[^\u0000-\u007E]/g, match);
123
+ }
124
+
125
+ function indexOf(value, array) {
126
+ var i = 0, l = array.length;
127
+ for (; i < l; i = i + 1) {
128
+ if (equal(value, array[i])) return i;
129
+ }
130
+ return -1;
131
+ }
132
+
133
+ function measureScrollbar () {
134
+ var $template = $( MEASURE_SCROLLBAR_TEMPLATE );
135
+ $template.appendTo(document.body);
136
+
137
+ var dim = {
138
+ width: $template.width() - $template[0].clientWidth,
139
+ height: $template.height() - $template[0].clientHeight
140
+ };
141
+ $template.remove();
142
+
143
+ return dim;
144
+ }
145
+
146
+ /**
147
+ * Compares equality of a and b
148
+ * @param a
149
+ * @param b
150
+ */
151
+ function equal(a, b) {
152
+ if (a === b) return true;
153
+ if (a === undefined || b === undefined) return false;
154
+ if (a === null || b === null) return false;
155
+ // Check whether 'a' or 'b' is a string (primitive or object).
156
+ // The concatenation of an empty string (+'') converts its argument to a string's primitive.
157
+ if (a.constructor === String) return a+'' === b+''; // a+'' - in case 'a' is a String object
158
+ if (b.constructor === String) return b+'' === a+''; // b+'' - in case 'b' is a String object
159
+ return false;
160
+ }
161
+
162
+ /**
163
+ * Splits the string into an array of values, transforming each value. An empty array is returned for nulls or empty
164
+ * strings
165
+ * @param string
166
+ * @param separator
167
+ */
168
+ function splitVal(string, separator, transform) {
169
+ var val, i, l;
170
+ if (string === null || string.length < 1) return [];
171
+ val = string.split(separator);
172
+ for (i = 0, l = val.length; i < l; i = i + 1) val[i] = transform(val[i]);
173
+ return val;
174
+ }
175
+
176
+ function getSideBorderPadding(element) {
177
+ return element.outerWidth(false) - element.width();
178
+ }
179
+
180
+ function installKeyUpChangeEvent(element) {
181
+ var key="keyup-change-value";
182
+ element.on("keydown", function () {
183
+ if ($.data(element, key) === undefined) {
184
+ $.data(element, key, element.val());
185
+ }
186
+ });
187
+ element.on("keyup", function () {
188
+ var val= $.data(element, key);
189
+ if (val !== undefined && element.val() !== val) {
190
+ $.removeData(element, key);
191
+ element.trigger("keyup-change");
192
+ }
193
+ });
194
+ }
195
+
196
+
197
+ /**
198
+ * filters mouse events so an event is fired only if the mouse moved.
199
+ *
200
+ * filters out mouse events that occur when mouse is stationary but
201
+ * the elements under the pointer are scrolled.
202
+ */
203
+ function installFilteredMouseMove(element) {
204
+ element.on("mousemove", function (e) {
205
+ var lastpos = lastMousePosition;
206
+ if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) {
207
+ $(e.target).trigger("mousemove-filtered", e);
208
+ }
209
+ });
210
+ }
211
+
212
+ /**
213
+ * Debounces a function. Returns a function that calls the original fn function only if no invocations have been made
214
+ * within the last quietMillis milliseconds.
215
+ *
216
+ * @param quietMillis number of milliseconds to wait before invoking fn
217
+ * @param fn function to be debounced
218
+ * @param ctx object to be used as this reference within fn
219
+ * @return debounced version of fn
220
+ */
221
+ function debounce(quietMillis, fn, ctx) {
222
+ ctx = ctx || undefined;
223
+ var timeout;
224
+ return function () {
225
+ var args = arguments;
226
+ window.clearTimeout(timeout);
227
+ timeout = window.setTimeout(function() {
228
+ fn.apply(ctx, args);
229
+ }, quietMillis);
230
+ };
231
+ }
232
+
233
+ function installDebouncedScroll(threshold, element) {
234
+ var notify = debounce(threshold, function (e) { element.trigger("scroll-debounced", e);});
235
+ element.on("scroll", function (e) {
236
+ if (indexOf(e.target, element.get()) >= 0) notify(e);
237
+ });
238
+ }
239
+
240
+ function focus($el) {
241
+ if ($el[0] === document.activeElement) return;
242
+
243
+ /* set the focus in a 0 timeout - that way the focus is set after the processing
244
+ of the current event has finished - which seems like the only reliable way
245
+ to set focus */
246
+ window.setTimeout(function() {
247
+ var el=$el[0], pos=$el.val().length, range;
248
+
249
+ $el.focus();
250
+
251
+ /* make sure el received focus so we do not error out when trying to manipulate the caret.
252
+ sometimes modals or others listeners may steal it after its set */
253
+ var isVisible = (el.offsetWidth > 0 || el.offsetHeight > 0);
254
+ if (isVisible && el === document.activeElement) {
255
+
256
+ /* after the focus is set move the caret to the end, necessary when we val()
257
+ just before setting focus */
258
+ if(el.setSelectionRange)
259
+ {
260
+ el.setSelectionRange(pos, pos);
261
+ }
262
+ else if (el.createTextRange) {
263
+ range = el.createTextRange();
264
+ range.collapse(false);
265
+ range.select();
266
+ }
267
+ }
268
+ }, 0);
269
+ }
270
+
271
+ function getCursorInfo(el) {
272
+ el = $(el)[0];
273
+ var offset = 0;
274
+ var length = 0;
275
+ if ('selectionStart' in el) {
276
+ offset = el.selectionStart;
277
+ length = el.selectionEnd - offset;
278
+ } else if ('selection' in document) {
279
+ el.focus();
280
+ var sel = document.selection.createRange();
281
+ length = document.selection.createRange().text.length;
282
+ sel.moveStart('character', -el.value.length);
283
+ offset = sel.text.length - length;
284
+ }
285
+ return { offset: offset, length: length };
286
+ }
287
+
288
+ function killEvent(event) {
289
+ event.preventDefault();
290
+ event.stopPropagation();
291
+ }
292
+ function killEventImmediately(event) {
293
+ event.preventDefault();
294
+ event.stopImmediatePropagation();
295
+ }
296
+
297
+ function measureTextWidth(e) {
298
+ if (!sizer){
299
+ var style = e[0].currentStyle || window.getComputedStyle(e[0], null);
300
+ sizer = $(document.createElement("div")).css({
301
+ position: "absolute",
302
+ left: "-10000px",
303
+ top: "-10000px",
304
+ display: "none",
305
+ fontSize: style.fontSize,
306
+ fontFamily: style.fontFamily,
307
+ fontStyle: style.fontStyle,
308
+ fontWeight: style.fontWeight,
309
+ letterSpacing: style.letterSpacing,
310
+ textTransform: style.textTransform,
311
+ whiteSpace: "nowrap"
312
+ });
313
+ sizer.attr("class","select2-sizer");
314
+ $(document.body).append(sizer);
315
+ }
316
+ sizer.text(e.val());
317
+ return sizer.width();
318
+ }
319
+
320
+ function syncCssClasses(dest, src, adapter) {
321
+ var classes, replacements = [], adapted;
322
+
323
+ classes = $.trim(dest.attr("class"));
324
+
325
+ if (classes) {
326
+ classes = '' + classes; // for IE which returns object
327
+
328
+ $(classes.split(/\s+/)).each2(function() {
329
+ if (this.indexOf("select2-") === 0) {
330
+ replacements.push(this);
331
+ }
332
+ });
333
+ }
334
+
335
+ classes = $.trim(src.attr("class"));
336
+
337
+ if (classes) {
338
+ classes = '' + classes; // for IE which returns object
339
+
340
+ $(classes.split(/\s+/)).each2(function() {
341
+ if (this.indexOf("select2-") !== 0) {
342
+ adapted = adapter(this);
343
+
344
+ if (adapted) {
345
+ replacements.push(adapted);
346
+ }
347
+ }
348
+ });
349
+ }
350
+
351
+ dest.attr("class", replacements.join(" "));
352
+ }
353
+
354
+
355
+ function markMatch(text, term, markup, escapeMarkup) {
356
+ var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())),
357
+ tl=term.length;
358
+
359
+ if (match<0) {
360
+ markup.push(escapeMarkup(text));
361
+ return;
362
+ }
363
+
364
+ markup.push(escapeMarkup(text.substring(0, match)));
365
+ markup.push("<span class='select2-match'>");
366
+ markup.push(escapeMarkup(text.substring(match, match + tl)));
367
+ markup.push("</span>");
368
+ markup.push(escapeMarkup(text.substring(match + tl, text.length)));
369
+ }
370
+
371
+ function defaultEscapeMarkup(markup) {
372
+ var replace_map = {
373
+ '\\': '&#92;',
374
+ '&': '&amp;',
375
+ '<': '&lt;',
376
+ '>': '&gt;',
377
+ '"': '&quot;',
378
+ "'": '&#39;',
379
+ "/": '&#47;'
380
+ };
381
+
382
+ return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
383
+ return replace_map[match];
384
+ });
385
+ }
386
+
387
+ /**
388
+ * Produces an ajax-based query function
389
+ *
390
+ * @param options object containing configuration parameters
391
+ * @param options.params parameter map for the transport ajax call, can contain such options as cache, jsonpCallback, etc. see $.ajax
392
+ * @param options.transport function that will be used to execute the ajax request. must be compatible with parameters supported by $.ajax
393
+ * @param options.url url for the data
394
+ * @param options.data a function(searchTerm, pageNumber, context) that should return an object containing query string parameters for the above url.
395
+ * @param options.dataType request data type: ajax, jsonp, other datatypes supported by jQuery's $.ajax function or the transport function if specified
396
+ * @param options.quietMillis (optional) milliseconds to wait before making the ajaxRequest, helps debounce the ajax function if invoked too often
397
+ * @param options.results a function(remoteData, pageNumber, query) that converts data returned form the remote request to the format expected by Select2.
398
+ * The expected format is an object containing the following keys:
399
+ * results array of objects that will be used as choices
400
+ * more (optional) boolean indicating whether there are more results available
401
+ * Example: {results:[{id:1, text:'Red'},{id:2, text:'Blue'}], more:true}
402
+ */
403
+ function ajax(options) {
404
+ var timeout, // current scheduled but not yet executed request
405
+ handler = null,
406
+ quietMillis = options.quietMillis || 100,
407
+ ajaxUrl = options.url,
408
+ self = this;
409
+
410
+ return function (query) {
411
+ window.clearTimeout(timeout);
412
+ timeout = window.setTimeout(function () {
413
+ var data = options.data, // ajax data function
414
+ url = ajaxUrl, // ajax url string or function
415
+ transport = options.transport || $.fn.select2.ajaxDefaults.transport,
416
+ // deprecated - to be removed in 4.0 - use params instead
417
+ deprecated = {
418
+ type: options.type || 'GET', // set type of request (GET or POST)
419
+ cache: options.cache || false,
420
+ jsonpCallback: options.jsonpCallback||undefined,
421
+ dataType: options.dataType||"json"
422
+ },
423
+ params = $.extend({}, $.fn.select2.ajaxDefaults.params, deprecated);
424
+
425
+ data = data ? data.call(self, query.term, query.page, query.context) : null;
426
+ url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url;
427
+
428
+ if (handler && typeof handler.abort === "function") { handler.abort(); }
429
+
430
+ if (options.params) {
431
+ if ($.isFunction(options.params)) {
432
+ $.extend(params, options.params.call(self));
433
+ } else {
434
+ $.extend(params, options.params);
435
+ }
436
+ }
437
+
438
+ $.extend(params, {
439
+ url: url,
440
+ dataType: options.dataType,
441
+ data: data,
442
+ success: function (data) {
443
+ // TODO - replace query.page with query so users have access to term, page, etc.
444
+ // added query as third paramter to keep backwards compatibility
445
+ var results = options.results(data, query.page, query);
446
+ query.callback(results);
447
+ },
448
+ error: function(jqXHR, textStatus, errorThrown){
449
+ var results = {
450
+ hasError: true,
451
+ jqXHR: jqXHR,
452
+ textStatus: textStatus,
453
+ errorThrown: errorThrown
454
+ };
455
+
456
+ query.callback(results);
457
+ }
458
+ });
459
+ handler = transport.call(self, params);
460
+ }, quietMillis);
461
+ };
462
+ }
463
+
464
+ /**
465
+ * Produces a query function that works with a local array
466
+ *
467
+ * @param options object containing configuration parameters. The options parameter can either be an array or an
468
+ * object.
469
+ *
470
+ * If the array form is used it is assumed that it contains objects with 'id' and 'text' keys.
471
+ *
472
+ * If the object form is used it is assumed that it contains 'data' and 'text' keys. The 'data' key should contain
473
+ * an array of objects that will be used as choices. These objects must contain at least an 'id' key. The 'text'
474
+ * key can either be a String in which case it is expected that each element in the 'data' array has a key with the
475
+ * value of 'text' which will be used to match choices. Alternatively, text can be a function(item) that can extract
476
+ * the text.
477
+ */
478
+ function local(options) {
479
+ var data = options, // data elements
480
+ dataText,
481
+ tmp,
482
+ text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search
483
+
484
+ if ($.isArray(data)) {
485
+ tmp = data;
486
+ data = { results: tmp };
487
+ }
488
+
489
+ if ($.isFunction(data) === false) {
490
+ tmp = data;
491
+ data = function() { return tmp; };
492
+ }
493
+
494
+ var dataItem = data();
495
+ if (dataItem.text) {
496
+ text = dataItem.text;
497
+ // if text is not a function we assume it to be a key name
498
+ if (!$.isFunction(text)) {
499
+ dataText = dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available
500
+ text = function (item) { return item[dataText]; };
501
+ }
502
+ }
503
+
504
+ return function (query) {
505
+ var t = query.term, filtered = { results: [] }, process;
506
+ if (t === "") {
507
+ query.callback(data());
508
+ return;
509
+ }
510
+
511
+ process = function(datum, collection) {
512
+ var group, attr;
513
+ datum = datum[0];
514
+ if (datum.children) {
515
+ group = {};
516
+ for (attr in datum) {
517
+ if (datum.hasOwnProperty(attr)) group[attr]=datum[attr];
518
+ }
519
+ group.children=[];
520
+ $(datum.children).each2(function(i, childDatum) { process(childDatum, group.children); });
521
+ if (group.children.length || query.matcher(t, text(group), datum)) {
522
+ collection.push(group);
523
+ }
524
+ } else {
525
+ if (query.matcher(t, text(datum), datum)) {
526
+ collection.push(datum);
527
+ }
528
+ }
529
+ };
530
+
531
+ $(data().results).each2(function(i, datum) { process(datum, filtered.results); });
532
+ query.callback(filtered);
533
+ };
534
+ }
535
+
536
+ // TODO javadoc
537
+ function tags(data) {
538
+ var isFunc = $.isFunction(data);
539
+ return function (query) {
540
+ var t = query.term, filtered = {results: []};
541
+ var result = isFunc ? data(query) : data;
542
+ if ($.isArray(result)) {
543
+ $(result).each(function () {
544
+ var isObject = this.text !== undefined,
545
+ text = isObject ? this.text : this;
546
+ if (t === "" || query.matcher(t, text)) {
547
+ filtered.results.push(isObject ? this : {id: this, text: this});
548
+ }
549
+ });
550
+ query.callback(filtered);
551
+ }
552
+ };
553
+ }
554
+
555
+ /**
556
+ * Checks if the formatter function should be used.
557
+ *
558
+ * Throws an error if it is not a function. Returns true if it should be used,
559
+ * false if no formatting should be performed.
560
+ *
561
+ * @param formatter
562
+ */
563
+ function checkFormatter(formatter, formatterName) {
564
+ if ($.isFunction(formatter)) return true;
565
+ if (!formatter) return false;
566
+ if (typeof(formatter) === 'string') return true;
567
+ throw new Error(formatterName +" must be a string, function, or falsy value");
568
+ }
569
+
570
+ /**
571
+ * Returns a given value
572
+ * If given a function, returns its output
573
+ *
574
+ * @param val string|function
575
+ * @param context value of "this" to be passed to function
576
+ * @returns {*}
577
+ */
578
+ function evaluate(val, context) {
579
+ if ($.isFunction(val)) {
580
+ var args = Array.prototype.slice.call(arguments, 2);
581
+ return val.apply(context, args);
582
+ }
583
+ return val;
584
+ }
585
+
586
+ function countResults(results) {
587
+ var count = 0;
588
+ $.each(results, function(i, item) {
589
+ if (item.children) {
590
+ count += countResults(item.children);
591
+ } else {
592
+ count++;
593
+ }
594
+ });
595
+ return count;
596
+ }
597
+
598
+ /**
599
+ * Default tokenizer. This function uses breaks the input on substring match of any string from the
600
+ * opts.tokenSeparators array and uses opts.createSearchChoice to create the choice object. Both of those
601
+ * two options have to be defined in order for the tokenizer to work.
602
+ *
603
+ * @param input text user has typed so far or pasted into the search field
604
+ * @param selection currently selected choices
605
+ * @param selectCallback function(choice) callback tho add the choice to selection
606
+ * @param opts select2's opts
607
+ * @return undefined/null to leave the current input unchanged, or a string to change the input to the returned value
608
+ */
609
+ function defaultTokenizer(input, selection, selectCallback, opts) {
610
+ var original = input, // store the original so we can compare and know if we need to tell the search to update its text
611
+ dupe = false, // check for whether a token we extracted represents a duplicate selected choice
612
+ token, // token
613
+ index, // position at which the separator was found
614
+ i, l, // looping variables
615
+ separator; // the matched separator
616
+
617
+ if (!opts.createSearchChoice || !opts.tokenSeparators || opts.tokenSeparators.length < 1) return undefined;
618
+
619
+ while (true) {
620
+ index = -1;
621
+
622
+ for (i = 0, l = opts.tokenSeparators.length; i < l; i++) {
623
+ separator = opts.tokenSeparators[i];
624
+ index = input.indexOf(separator);
625
+ if (index >= 0) break;
626
+ }
627
+
628
+ if (index < 0) break; // did not find any token separator in the input string, bail
629
+
630
+ token = input.substring(0, index);
631
+ input = input.substring(index + separator.length);
632
+
633
+ if (token.length > 0) {
634
+ token = opts.createSearchChoice.call(this, token, selection);
635
+ if (token !== undefined && token !== null && opts.id(token) !== undefined && opts.id(token) !== null) {
636
+ dupe = false;
637
+ for (i = 0, l = selection.length; i < l; i++) {
638
+ if (equal(opts.id(token), opts.id(selection[i]))) {
639
+ dupe = true; break;
640
+ }
641
+ }
642
+
643
+ if (!dupe) selectCallback(token);
644
+ }
645
+ }
646
+ }
647
+
648
+ if (original!==input) return input;
649
+ }
650
+
651
+ function cleanupJQueryElements() {
652
+ var self = this;
653
+
654
+ $.each(arguments, function (i, element) {
655
+ self[element].remove();
656
+ self[element] = null;
657
+ });
658
+ }
659
+
660
+ /**
661
+ * Creates a new class
662
+ *
663
+ * @param superClass
664
+ * @param methods
665
+ */
666
+ function clazz(SuperClass, methods) {
667
+ var constructor = function () {};
668
+ constructor.prototype = new SuperClass;
669
+ constructor.prototype.constructor = constructor;
670
+ constructor.prototype.parent = SuperClass.prototype;
671
+ constructor.prototype = $.extend(constructor.prototype, methods);
672
+ return constructor;
673
+ }
674
+
675
+ AbstractSelect2 = clazz(Object, {
676
+
677
+ // abstract
678
+ bind: function (func) {
679
+ var self = this;
680
+ return function () {
681
+ func.apply(self, arguments);
682
+ };
683
+ },
684
+
685
+ // abstract
686
+ init: function (opts) {
687
+ var results, search, resultsSelector = ".select2-results";
688
+
689
+ // prepare options
690
+ this.opts = opts = this.prepareOpts(opts);
691
+
692
+ this.id=opts.id;
693
+
694
+ // destroy if called on an existing component
695
+ if (opts.element.data("select2") !== undefined &&
696
+ opts.element.data("select2") !== null) {
697
+ opts.element.data("select2").destroy();
698
+ }
699
+
700
+ this.container = this.createContainer();
701
+
702
+ this.liveRegion = $('.select2-hidden-accessible');
703
+ if (this.liveRegion.length == 0) {
704
+ this.liveRegion = $("<span>", {
705
+ role: "status",
706
+ "aria-live": "polite"
707
+ })
708
+ .addClass("select2-hidden-accessible")
709
+ .appendTo(document.body);
710
+ }
711
+
712
+ this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
713
+ this.containerEventName= this.containerId
714
+ .replace(/([.])/g, '_')
715
+ .replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
716
+ this.container.attr("id", this.containerId);
717
+
718
+ this.container.attr("title", opts.element.attr("title"));
719
+
720
+ this.body = $(document.body);
721
+
722
+ syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
723
+
724
+ this.container.attr("style", opts.element.attr("style"));
725
+ this.container.css(evaluate(opts.containerCss, this.opts.element));
726
+ this.container.addClass(evaluate(opts.containerCssClass, this.opts.element));
727
+
728
+ this.elementTabIndex = this.opts.element.attr("tabindex");
729
+
730
+ // swap container for the element
731
+ this.opts.element
732
+ .data("select2", this)
733
+ .attr("tabindex", "-1")
734
+ .before(this.container)
735
+ .on("click.select2", killEvent); // do not leak click events
736
+
737
+ this.container.data("select2", this);
738
+
739
+ this.dropdown = this.container.find(".select2-drop");
740
+
741
+ syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
742
+
743
+ this.dropdown.addClass(evaluate(opts.dropdownCssClass, this.opts.element));
744
+ this.dropdown.data("select2", this);
745
+ this.dropdown.on("click", killEvent);
746
+
747
+ this.results = results = this.container.find(resultsSelector);
748
+ this.search = search = this.container.find("input.select2-input");
749
+
750
+ this.queryCount = 0;
751
+ this.resultsPage = 0;
752
+ this.context = null;
753
+
754
+ // initialize the container
755
+ this.initContainer();
756
+
757
+ this.container.on("click", killEvent);
758
+
759
+ installFilteredMouseMove(this.results);
760
+
761
+ this.dropdown.on("mousemove-filtered", resultsSelector, this.bind(this.highlightUnderEvent));
762
+ this.dropdown.on("touchstart touchmove touchend", resultsSelector, this.bind(function (event) {
763
+ this._touchEvent = true;
764
+ this.highlightUnderEvent(event);
765
+ }));
766
+ this.dropdown.on("touchmove", resultsSelector, this.bind(this.touchMoved));
767
+ this.dropdown.on("touchstart touchend", resultsSelector, this.bind(this.clearTouchMoved));
768
+
769
+ // Waiting for a click event on touch devices to select option and hide dropdown
770
+ // otherwise click will be triggered on an underlying element
771
+ this.dropdown.on('click', this.bind(function (event) {
772
+ if (this._touchEvent) {
773
+ this._touchEvent = false;
774
+ this.selectHighlighted();
775
+ }
776
+ }));
777
+
778
+ installDebouncedScroll(80, this.results);
779
+ this.dropdown.on("scroll-debounced", resultsSelector, this.bind(this.loadMoreIfNeeded));
780
+
781
+ // do not propagate change event from the search field out of the component
782
+ $(this.container).on("change", ".select2-input", function(e) {e.stopPropagation();});
783
+ $(this.dropdown).on("change", ".select2-input", function(e) {e.stopPropagation();});
784
+
785
+ // if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel
786
+ if ($.fn.mousewheel) {
787
+ results.mousewheel(function (e, delta, deltaX, deltaY) {
788
+ var top = results.scrollTop();
789
+ if (deltaY > 0 && top - deltaY <= 0) {
790
+ results.scrollTop(0);
791
+ killEvent(e);
792
+ } else if (deltaY < 0 && results.get(0).scrollHeight - results.scrollTop() + deltaY <= results.height()) {
793
+ results.scrollTop(results.get(0).scrollHeight - results.height());
794
+ killEvent(e);
795
+ }
796
+ });
797
+ }
798
+
799
+ installKeyUpChangeEvent(search);
800
+ search.on("keyup-change input paste", this.bind(this.updateResults));
801
+ search.on("focus", function () { search.addClass("select2-focused"); });
802
+ search.on("blur", function () { search.removeClass("select2-focused");});
803
+
804
+ this.dropdown.on("mouseup", resultsSelector, this.bind(function (e) {
805
+ if ($(e.target).closest(".select2-result-selectable").length > 0) {
806
+ this.highlightUnderEvent(e);
807
+ this.selectHighlighted(e);
808
+ }
809
+ }));
810
+
811
+ // trap all mouse events from leaving the dropdown. sometimes there may be a modal that is listening
812
+ // for mouse events outside of itself so it can close itself. since the dropdown is now outside the select2's
813
+ // dom it will trigger the popup close, which is not what we want
814
+ // focusin can cause focus wars between modals and select2 since the dropdown is outside the modal.
815
+ this.dropdown.on("click mouseup mousedown touchstart touchend focusin", function (e) { e.stopPropagation(); });
816
+
817
+ this.nextSearchTerm = undefined;
818
+
819
+ if ($.isFunction(this.opts.initSelection)) {
820
+ // initialize selection based on the current value of the source element
821
+ this.initSelection();
822
+
823
+ // if the user has provided a function that can set selection based on the value of the source element
824
+ // we monitor the change event on the element and trigger it, allowing for two way synchronization
825
+ this.monitorSource();
826
+ }
827
+
828
+ if (opts.maximumInputLength !== null) {
829
+ this.search.attr("maxlength", opts.maximumInputLength);
830
+ }
831
+
832
+ var disabled = opts.element.prop("disabled");
833
+ if (disabled === undefined) disabled = false;
834
+ this.enable(!disabled);
835
+
836
+ var readonly = opts.element.prop("readonly");
837
+ if (readonly === undefined) readonly = false;
838
+ this.readonly(readonly);
839
+
840
+ // Calculate size of scrollbar
841
+ scrollBarDimensions = scrollBarDimensions || measureScrollbar();
842
+
843
+ this.autofocus = opts.element.prop("autofocus");
844
+ opts.element.prop("autofocus", false);
845
+ if (this.autofocus) this.focus();
846
+
847
+ this.search.attr("placeholder", opts.searchInputPlaceholder);
848
+ },
849
+
850
+ // abstract
851
+ destroy: function () {
852
+ var element=this.opts.element, select2 = element.data("select2"), self = this;
853
+
854
+ this.close();
855
+
856
+ if (element.length && element[0].detachEvent && self._sync) {
857
+ element.each(function () {
858
+ if (self._sync) {
859
+ this.detachEvent("onpropertychange", self._sync);
860
+ }
861
+ });
862
+ }
863
+ if (this.propertyObserver) {
864
+ this.propertyObserver.disconnect();
865
+ this.propertyObserver = null;
866
+ }
867
+ this._sync = null;
868
+
869
+ if (select2 !== undefined) {
870
+ select2.container.remove();
871
+ select2.liveRegion.remove();
872
+ select2.dropdown.remove();
873
+ element
874
+ .show()
875
+ .removeData("select2")
876
+ .off(".select2")
877
+ .prop("autofocus", this.autofocus || false);
878
+ if (this.elementTabIndex) {
879
+ element.attr({tabindex: this.elementTabIndex});
880
+ } else {
881
+ element.removeAttr("tabindex");
882
+ }
883
+ element.show();
884
+ }
885
+
886
+ cleanupJQueryElements.call(this,
887
+ "container",
888
+ "liveRegion",
889
+ "dropdown",
890
+ "results",
891
+ "search"
892
+ );
893
+ },
894
+
895
+ // abstract
896
+ optionToData: function(element) {
897
+ if (element.is("option")) {
898
+ return {
899
+ id:element.prop("value"),
900
+ text:element.text(),
901
+ element: element.get(),
902
+ css: element.attr("class"),
903
+ disabled: element.prop("disabled"),
904
+ locked: equal(element.attr("locked"), "locked") || equal(element.data("locked"), true)
905
+ };
906
+ } else if (element.is("optgroup")) {
907
+ return {
908
+ text:element.attr("label"),
909
+ children:[],
910
+ element: element.get(),
911
+ css: element.attr("class")
912
+ };
913
+ }
914
+ },
915
+
916
+ // abstract
917
+ prepareOpts: function (opts) {
918
+ var element, select, idKey, ajaxUrl, self = this;
919
+
920
+ element = opts.element;
921
+
922
+ if (element.get(0).tagName.toLowerCase() === "select") {
923
+ this.select = select = opts.element;
924
+ }
925
+
926
+ if (select) {
927
+ // these options are not allowed when attached to a select because they are picked up off the element itself
928
+ $.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function () {
929
+ if (this in opts) {
930
+ throw new Error("Option '" + this + "' is not allowed for Select2 when attached to a <select> element.");
931
+ }
932
+ });
933
+ }
934
+
935
+ opts = $.extend({}, {
936
+ populateResults: function(container, results, query) {
937
+ var populate, id=this.opts.id, liveRegion=this.liveRegion;
938
+
939
+ populate=function(results, container, depth) {
940
+
941
+ var i, l, result, selectable, disabled, compound, node, label, innerContainer, formatted;
942
+
943
+ results = opts.sortResults(results, container, query);
944
+
945
+ // collect the created nodes for bulk append
946
+ var nodes = [];
947
+ for (i = 0, l = results.length; i < l; i = i + 1) {
948
+
949
+ result=results[i];
950
+
951
+ disabled = (result.disabled === true);
952
+ selectable = (!disabled) && (id(result) !== undefined);
953
+
954
+ compound=result.children && result.children.length > 0;
955
+
956
+ node=$("<li></li>");
957
+ node.addClass("select2-results-dept-"+depth);
958
+ node.addClass("select2-result");
959
+ node.addClass(selectable ? "select2-result-selectable" : "select2-result-unselectable");
960
+ if (disabled) { node.addClass("select2-disabled"); }
961
+ if (compound) { node.addClass("select2-result-with-children"); }
962
+ node.addClass(self.opts.formatResultCssClass(result));
963
+ node.attr("role", "presentation");
964
+
965
+ label=$(document.createElement("div"));
966
+ label.addClass("select2-result-label");
967
+ label.attr("id", "select2-result-label-" + nextUid());
968
+ label.attr("role", "option");
969
+
970
+ formatted=opts.formatResult(result, label, query, self.opts.escapeMarkup);
971
+ if (formatted!==undefined) {
972
+ label.html(formatted);
973
+ node.append(label);
974
+ }
975
+
976
+
977
+ if (compound) {
978
+
979
+ innerContainer=$("<ul></ul>");
980
+ innerContainer.addClass("select2-result-sub");
981
+ populate(result.children, innerContainer, depth+1);
982
+ node.append(innerContainer);
983
+ }
984
+
985
+ node.data("select2-data", result);
986
+ nodes.push(node[0]);
987
+ }
988
+
989
+ // bulk append the created nodes
990
+ container.append(nodes);
991
+ liveRegion.text(opts.formatMatches(results.length));
992
+ };
993
+
994
+ populate(results, container, 0);
995
+ }
996
+ }, $.fn.select2.defaults, opts);
997
+
998
+ if (typeof(opts.id) !== "function") {
999
+ idKey = opts.id;
1000
+ opts.id = function (e) { return e[idKey]; };
1001
+ }
1002
+
1003
+ if ($.isArray(opts.element.data("select2Tags"))) {
1004
+ if ("tags" in opts) {
1005
+ throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + opts.element.attr("id");
1006
+ }
1007
+ opts.tags=opts.element.data("select2Tags");
1008
+ }
1009
+
1010
+ if (select) {
1011
+ opts.query = this.bind(function (query) {
1012
+ var data = { results: [], more: false },
1013
+ term = query.term,
1014
+ children, placeholderOption, process;
1015
+
1016
+ process=function(element, collection) {
1017
+ var group;
1018
+ if (element.is("option")) {
1019
+ if (query.matcher(term, element.text(), element)) {
1020
+ collection.push(self.optionToData(element));
1021
+ }
1022
+ } else if (element.is("optgroup")) {
1023
+ group=self.optionToData(element);
1024
+ element.children().each2(function(i, elm) { process(elm, group.children); });
1025
+ if (group.children.length>0) {
1026
+ collection.push(group);
1027
+ }
1028
+ }
1029
+ };
1030
+
1031
+ children=element.children();
1032
+
1033
+ // ignore the placeholder option if there is one
1034
+ if (this.getPlaceholder() !== undefined && children.length > 0) {
1035
+ placeholderOption = this.getPlaceholderOption();
1036
+ if (placeholderOption) {
1037
+ children=children.not(placeholderOption);
1038
+ }
1039
+ }
1040
+
1041
+ children.each2(function(i, elm) { process(elm, data.results); });
1042
+
1043
+ query.callback(data);
1044
+ });
1045
+ // this is needed because inside val() we construct choices from options and their id is hardcoded
1046
+ opts.id=function(e) { return e.id; };
1047
+ } else {
1048
+ if (!("query" in opts)) {
1049
+
1050
+ if ("ajax" in opts) {
1051
+ ajaxUrl = opts.element.data("ajax-url");
1052
+ if (ajaxUrl && ajaxUrl.length > 0) {
1053
+ opts.ajax.url = ajaxUrl;
1054
+ }
1055
+ opts.query = ajax.call(opts.element, opts.ajax);
1056
+ } else if ("data" in opts) {
1057
+ opts.query = local(opts.data);
1058
+ } else if ("tags" in opts) {
1059
+ opts.query = tags(opts.tags);
1060
+ if (opts.createSearchChoice === undefined) {
1061
+ opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; };
1062
+ }
1063
+ if (opts.initSelection === undefined) {
1064
+ opts.initSelection = function (element, callback) {
1065
+ var data = [];
1066
+ $(splitVal(element.val(), opts.separator, opts.transformVal)).each(function () {
1067
+ var obj = { id: this, text: this },
1068
+ tags = opts.tags;
1069
+ if ($.isFunction(tags)) tags=tags();
1070
+ $(tags).each(function() { if (equal(this.id, obj.id)) { obj = this; return false; } });
1071
+ data.push(obj);
1072
+ });
1073
+
1074
+ callback(data);
1075
+ };
1076
+ }
1077
+ }
1078
+ }
1079
+ }
1080
+ if (typeof(opts.query) !== "function") {
1081
+ throw "query function not defined for Select2 " + opts.element.attr("id");
1082
+ }
1083
+
1084
+ if (opts.createSearchChoicePosition === 'top') {
1085
+ opts.createSearchChoicePosition = function(list, item) { list.unshift(item); };
1086
+ }
1087
+ else if (opts.createSearchChoicePosition === 'bottom') {
1088
+ opts.createSearchChoicePosition = function(list, item) { list.push(item); };
1089
+ }
1090
+ else if (typeof(opts.createSearchChoicePosition) !== "function") {
1091
+ throw "invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";
1092
+ }
1093
+
1094
+ return opts;
1095
+ },
1096
+
1097
+ /**
1098
+ * Monitor the original element for changes and update select2 accordingly
1099
+ */
1100
+ // abstract
1101
+ monitorSource: function () {
1102
+ var el = this.opts.element, observer, self = this;
1103
+
1104
+ el.on("change.select2", this.bind(function (e) {
1105
+ if (this.opts.element.data("select2-change-triggered") !== true) {
1106
+ this.initSelection();
1107
+ }
1108
+ }));
1109
+
1110
+ this._sync = this.bind(function () {
1111
+
1112
+ // sync enabled state
1113
+ var disabled = el.prop("disabled");
1114
+ if (disabled === undefined) disabled = false;
1115
+ this.enable(!disabled);
1116
+
1117
+ var readonly = el.prop("readonly");
1118
+ if (readonly === undefined) readonly = false;
1119
+ this.readonly(readonly);
1120
+
1121
+ if (this.container) {
1122
+ syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
1123
+ this.container.addClass(evaluate(this.opts.containerCssClass, this.opts.element));
1124
+ }
1125
+
1126
+ if (this.dropdown) {
1127
+ syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
1128
+ this.dropdown.addClass(evaluate(this.opts.dropdownCssClass, this.opts.element));
1129
+ }
1130
+
1131
+ });
1132
+
1133
+ // IE8-10 (IE9/10 won't fire propertyChange via attachEventListener)
1134
+ if (el.length && el[0].attachEvent) {
1135
+ el.each(function() {
1136
+ this.attachEvent("onpropertychange", self._sync);
1137
+ });
1138
+ }
1139
+
1140
+ // safari, chrome, firefox, IE11
1141
+ observer = window.MutationObserver || window.WebKitMutationObserver|| window.MozMutationObserver;
1142
+ if (observer !== undefined) {
1143
+ if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; }
1144
+ this.propertyObserver = new observer(function (mutations) {
1145
+ $.each(mutations, self._sync);
1146
+ });
1147
+ this.propertyObserver.observe(el.get(0), { attributes:true, subtree:false });
1148
+ }
1149
+ },
1150
+
1151
+ // abstract
1152
+ triggerSelect: function(data) {
1153
+ var evt = $.Event("select2-selecting", { val: this.id(data), object: data, choice: data });
1154
+ this.opts.element.trigger(evt);
1155
+ return !evt.isDefaultPrevented();
1156
+ },
1157
+
1158
+ /**
1159
+ * Triggers the change event on the source element
1160
+ */
1161
+ // abstract
1162
+ triggerChange: function (details) {
1163
+
1164
+ details = details || {};
1165
+ details= $.extend({}, details, { type: "change", val: this.val() });
1166
+ // prevents recursive triggering
1167
+ this.opts.element.data("select2-change-triggered", true);
1168
+ this.opts.element.trigger(details);
1169
+ this.opts.element.data("select2-change-triggered", false);
1170
+
1171
+ // some validation frameworks ignore the change event and listen instead to keyup, click for selects
1172
+ // so here we trigger the click event manually
1173
+ this.opts.element.click();
1174
+
1175
+ // ValidationEngine ignores the change event and listens instead to blur
1176
+ // so here we trigger the blur event manually if so desired
1177
+ if (this.opts.blurOnChange)
1178
+ this.opts.element.blur();
1179
+ },
1180
+
1181
+ //abstract
1182
+ isInterfaceEnabled: function()
1183
+ {
1184
+ return this.enabledInterface === true;
1185
+ },
1186
+
1187
+ // abstract
1188
+ enableInterface: function() {
1189
+ var enabled = this._enabled && !this._readonly,
1190
+ disabled = !enabled;
1191
+
1192
+ if (enabled === this.enabledInterface) return false;
1193
+
1194
+ this.container.toggleClass("select2-container-disabled", disabled);
1195
+ this.close();
1196
+ this.enabledInterface = enabled;
1197
+
1198
+ return true;
1199
+ },
1200
+
1201
+ // abstract
1202
+ enable: function(enabled) {
1203
+ if (enabled === undefined) enabled = true;
1204
+ if (this._enabled === enabled) return;
1205
+ this._enabled = enabled;
1206
+
1207
+ this.opts.element.prop("disabled", !enabled);
1208
+ this.enableInterface();
1209
+ },
1210
+
1211
+ // abstract
1212
+ disable: function() {
1213
+ this.enable(false);
1214
+ },
1215
+
1216
+ // abstract
1217
+ readonly: function(enabled) {
1218
+ if (enabled === undefined) enabled = false;
1219
+ if (this._readonly === enabled) return;
1220
+ this._readonly = enabled;
1221
+
1222
+ this.opts.element.prop("readonly", enabled);
1223
+ this.enableInterface();
1224
+ },
1225
+
1226
+ // abstract
1227
+ opened: function () {
1228
+ return (this.container) ? this.container.hasClass("select2-dropdown-open") : false;
1229
+ },
1230
+
1231
+ // abstract
1232
+ positionDropdown: function() {
1233
+ var $dropdown = this.dropdown,
1234
+ container = this.container,
1235
+ offset = container.offset(),
1236
+ height = container.outerHeight(false),
1237
+ width = container.outerWidth(false),
1238
+ dropHeight = $dropdown.outerHeight(false),
1239
+ $window = $(window),
1240
+ windowWidth = $window.width(),
1241
+ windowHeight = $window.height(),
1242
+ viewPortRight = $window.scrollLeft() + windowWidth,
1243
+ viewportBottom = $window.scrollTop() + windowHeight,
1244
+ dropTop = offset.top + height,
1245
+ dropLeft = offset.left,
1246
+ enoughRoomBelow = dropTop + dropHeight <= viewportBottom,
1247
+ enoughRoomAbove = (offset.top - dropHeight) >= $window.scrollTop(),
1248
+ dropWidth = $dropdown.outerWidth(false),
1249
+ enoughRoomOnRight = function() {
1250
+ return dropLeft + dropWidth <= viewPortRight;
1251
+ },
1252
+ enoughRoomOnLeft = function() {
1253
+ return offset.left + viewPortRight + container.outerWidth(false) > dropWidth;
1254
+ },
1255
+ aboveNow = $dropdown.hasClass("select2-drop-above"),
1256
+ bodyOffset,
1257
+ above,
1258
+ changeDirection,
1259
+ css,
1260
+ resultsListNode;
1261
+
1262
+ // always prefer the current above/below alignment, unless there is not enough room
1263
+ if (aboveNow) {
1264
+ above = true;
1265
+ if (!enoughRoomAbove && enoughRoomBelow) {
1266
+ changeDirection = true;
1267
+ above = false;
1268
+ }
1269
+ } else {
1270
+ above = false;
1271
+ if (!enoughRoomBelow && enoughRoomAbove) {
1272
+ changeDirection = true;
1273
+ above = true;
1274
+ }
1275
+ }
1276
+
1277
+ //if we are changing direction we need to get positions when dropdown is hidden;
1278
+ if (changeDirection) {
1279
+ $dropdown.hide();
1280
+ offset = this.container.offset();
1281
+ height = this.container.outerHeight(false);
1282
+ width = this.container.outerWidth(false);
1283
+ dropHeight = $dropdown.outerHeight(false);
1284
+ viewPortRight = $window.scrollLeft() + windowWidth;
1285
+ viewportBottom = $window.scrollTop() + windowHeight;
1286
+ dropTop = offset.top + height;
1287
+ dropLeft = offset.left;
1288
+ dropWidth = $dropdown.outerWidth(false);
1289
+ $dropdown.show();
1290
+
1291
+ // fix so the cursor does not move to the left within the search-textbox in IE
1292
+ this.focusSearch();
1293
+ }
1294
+
1295
+ if (this.opts.dropdownAutoWidth) {
1296
+ resultsListNode = $('.select2-results', $dropdown)[0];
1297
+ $dropdown.addClass('select2-drop-auto-width');
1298
+ $dropdown.css('width', '');
1299
+ // Add scrollbar width to dropdown if vertical scrollbar is present
1300
+ dropWidth = $dropdown.outerWidth(false) + (resultsListNode.scrollHeight === resultsListNode.clientHeight ? 0 : scrollBarDimensions.width);
1301
+ dropWidth > width ? width = dropWidth : dropWidth = width;
1302
+ dropHeight = $dropdown.outerHeight(false);
1303
+ }
1304
+ else {
1305
+ this.container.removeClass('select2-drop-auto-width');
1306
+ }
1307
+
1308
+ //console.log("below/ droptop:", dropTop, "dropHeight", dropHeight, "sum", (dropTop+dropHeight)+" viewport bottom", viewportBottom, "enough?", enoughRoomBelow);
1309
+ //console.log("above/ offset.top", offset.top, "dropHeight", dropHeight, "top", (offset.top-dropHeight), "scrollTop", this.body.scrollTop(), "enough?", enoughRoomAbove);
1310
+
1311
+ // fix positioning when body has an offset and is not position: static
1312
+ if (this.body.css('position') !== 'static') {
1313
+ bodyOffset = this.body.offset();
1314
+ dropTop -= bodyOffset.top;
1315
+ dropLeft -= bodyOffset.left;
1316
+ }
1317
+
1318
+ if (!enoughRoomOnRight() && enoughRoomOnLeft()) {
1319
+ dropLeft = offset.left + this.container.outerWidth(false) - dropWidth;
1320
+ }
1321
+
1322
+ css = {
1323
+ left: dropLeft,
1324
+ width: width
1325
+ };
1326
+
1327
+ if (above) {
1328
+ css.top = offset.top - dropHeight;
1329
+ css.bottom = 'auto';
1330
+ this.container.addClass("select2-drop-above");
1331
+ $dropdown.addClass("select2-drop-above");
1332
+ }
1333
+ else {
1334
+ css.top = dropTop;
1335
+ css.bottom = 'auto';
1336
+ this.container.removeClass("select2-drop-above");
1337
+ $dropdown.removeClass("select2-drop-above");
1338
+ }
1339
+ css = $.extend(css, evaluate(this.opts.dropdownCss, this.opts.element));
1340
+
1341
+ $dropdown.css(css);
1342
+ },
1343
+
1344
+ // abstract
1345
+ shouldOpen: function() {
1346
+ var event;
1347
+
1348
+ if (this.opened()) return false;
1349
+
1350
+ if (this._enabled === false || this._readonly === true) return false;
1351
+
1352
+ event = $.Event("select2-opening");
1353
+ this.opts.element.trigger(event);
1354
+ return !event.isDefaultPrevented();
1355
+ },
1356
+
1357
+ // abstract
1358
+ clearDropdownAlignmentPreference: function() {
1359
+ // clear the classes used to figure out the preference of where the dropdown should be opened
1360
+ this.container.removeClass("select2-drop-above");
1361
+ this.dropdown.removeClass("select2-drop-above");
1362
+ },
1363
+
1364
+ /**
1365
+ * Opens the dropdown
1366
+ *
1367
+ * @return {Boolean} whether or not dropdown was opened. This method will return false if, for example,
1368
+ * the dropdown is already open, or if the 'open' event listener on the element called preventDefault().
1369
+ */
1370
+ // abstract
1371
+ open: function () {
1372
+
1373
+ if (!this.shouldOpen()) return false;
1374
+
1375
+ this.opening();
1376
+
1377
+ // Only bind the document mousemove when the dropdown is visible
1378
+ $document.on("mousemove.select2Event", function (e) {
1379
+ lastMousePosition.x = e.pageX;
1380
+ lastMousePosition.y = e.pageY;
1381
+ });
1382
+
1383
+ return true;
1384
+ },
1385
+
1386
+ /**
1387
+ * Performs the opening of the dropdown
1388
+ */
1389
+ // abstract
1390
+ opening: function() {
1391
+ var cid = this.containerEventName,
1392
+ scroll = "scroll." + cid,
1393
+ resize = "resize."+cid,
1394
+ orient = "orientationchange."+cid,
1395
+ mask;
1396
+
1397
+ this.container.addClass("select2-dropdown-open").addClass("select2-container-active");
1398
+
1399
+ this.clearDropdownAlignmentPreference();
1400
+
1401
+ if(this.dropdown[0] !== this.body.children().last()[0]) {
1402
+ this.dropdown.detach().appendTo(this.body);
1403
+ }
1404
+
1405
+ // create the dropdown mask if doesn't already exist
1406
+ mask = $("#select2-drop-mask");
1407
+ if (mask.length === 0) {
1408
+ mask = $(document.createElement("div"));
1409
+ mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask");
1410
+ mask.hide();
1411
+ mask.appendTo(this.body);
1412
+ mask.on("mousedown touchstart click", function (e) {
1413
+ // Prevent IE from generating a click event on the body
1414
+ reinsertElement(mask);
1415
+
1416
+ var dropdown = $("#select2-drop"), self;
1417
+ if (dropdown.length > 0) {
1418
+ self=dropdown.data("select2");
1419
+ if (self.opts.selectOnBlur) {
1420
+ self.selectHighlighted({noFocus: true});
1421
+ }
1422
+ self.close();
1423
+ e.preventDefault();
1424
+ e.stopPropagation();
1425
+ }
1426
+ });
1427
+ }
1428
+
1429
+ // ensure the mask is always right before the dropdown
1430
+ if (this.dropdown.prev()[0] !== mask[0]) {
1431
+ this.dropdown.before(mask);
1432
+ }
1433
+
1434
+ // move the global id to the correct dropdown
1435
+ $("#select2-drop").removeAttr("id");
1436
+ this.dropdown.attr("id", "select2-drop");
1437
+
1438
+ // show the elements
1439
+ mask.show();
1440
+
1441
+ this.positionDropdown();
1442
+ this.dropdown.show();
1443
+ this.positionDropdown();
1444
+
1445
+ this.dropdown.addClass("select2-drop-active");
1446
+
1447
+ // attach listeners to events that can change the position of the container and thus require
1448
+ // the position of the dropdown to be updated as well so it does not come unglued from the container
1449
+ var that = this;
1450
+ this.container.parents().add(window).each(function () {
1451
+ $(this).on(resize+" "+scroll+" "+orient, function (e) {
1452
+ if (that.opened()) that.positionDropdown();
1453
+ });
1454
+ });
1455
+
1456
+
1457
+ },
1458
+
1459
+ // abstract
1460
+ close: function () {
1461
+ if (!this.opened()) return;
1462
+
1463
+ var cid = this.containerEventName,
1464
+ scroll = "scroll." + cid,
1465
+ resize = "resize."+cid,
1466
+ orient = "orientationchange."+cid;
1467
+
1468
+ // unbind event listeners
1469
+ this.container.parents().add(window).each(function () { $(this).off(scroll).off(resize).off(orient); });
1470
+
1471
+ this.clearDropdownAlignmentPreference();
1472
+
1473
+ $("#select2-drop-mask").hide();
1474
+ this.dropdown.removeAttr("id"); // only the active dropdown has the select2-drop id
1475
+ this.dropdown.hide();
1476
+ this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");
1477
+ this.results.empty();
1478
+
1479
+ // Now that the dropdown is closed, unbind the global document mousemove event
1480
+ $document.off("mousemove.select2Event");
1481
+
1482
+ this.clearSearch();
1483
+ this.search.removeClass("select2-active");
1484
+ this.opts.element.trigger($.Event("select2-close"));
1485
+ },
1486
+
1487
+ /**
1488
+ * Opens control, sets input value, and updates results.
1489
+ */
1490
+ // abstract
1491
+ externalSearch: function (term) {
1492
+ this.open();
1493
+ this.search.val(term);
1494
+ this.updateResults(false);
1495
+ },
1496
+
1497
+ // abstract
1498
+ clearSearch: function () {
1499
+
1500
+ },
1501
+
1502
+ //abstract
1503
+ getMaximumSelectionSize: function() {
1504
+ return evaluate(this.opts.maximumSelectionSize, this.opts.element);
1505
+ },
1506
+
1507
+ // abstract
1508
+ ensureHighlightVisible: function () {
1509
+ var results = this.results, children, index, child, hb, rb, y, more, topOffset;
1510
+
1511
+ index = this.highlight();
1512
+
1513
+ if (index < 0) return;
1514
+
1515
+ if (index == 0) {
1516
+
1517
+ // if the first element is highlighted scroll all the way to the top,
1518
+ // that way any unselectable headers above it will also be scrolled
1519
+ // into view
1520
+
1521
+ results.scrollTop(0);
1522
+ return;
1523
+ }
1524
+
1525
+ children = this.findHighlightableChoices().find('.select2-result-label');
1526
+
1527
+ child = $(children[index]);
1528
+
1529
+ topOffset = (child.offset() || {}).top || 0;
1530
+
1531
+ hb = topOffset + child.outerHeight(true);
1532
+
1533
+ // if this is the last child lets also make sure select2-more-results is visible
1534
+ if (index === children.length - 1) {
1535
+ more = results.find("li.select2-more-results");
1536
+ if (more.length > 0) {
1537
+ hb = more.offset().top + more.outerHeight(true);
1538
+ }
1539
+ }
1540
+
1541
+ rb = results.offset().top + results.outerHeight(false);
1542
+ if (hb > rb) {
1543
+ results.scrollTop(results.scrollTop() + (hb - rb));
1544
+ }
1545
+ y = topOffset - results.offset().top;
1546
+
1547
+ // make sure the top of the element is visible
1548
+ if (y < 0 && child.css('display') != 'none' ) {
1549
+ results.scrollTop(results.scrollTop() + y); // y is negative
1550
+ }
1551
+ },
1552
+
1553
+ // abstract
1554
+ findHighlightableChoices: function() {
1555
+ return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)");
1556
+ },
1557
+
1558
+ // abstract
1559
+ moveHighlight: function (delta) {
1560
+ var choices = this.findHighlightableChoices(),
1561
+ index = this.highlight();
1562
+
1563
+ while (index > -1 && index < choices.length) {
1564
+ index += delta;
1565
+ var choice = $(choices[index]);
1566
+ if (choice.hasClass("select2-result-selectable") && !choice.hasClass("select2-disabled") && !choice.hasClass("select2-selected")) {
1567
+ this.highlight(index);
1568
+ break;
1569
+ }
1570
+ }
1571
+ },
1572
+
1573
+ // abstract
1574
+ highlight: function (index) {
1575
+ var choices = this.findHighlightableChoices(),
1576
+ choice,
1577
+ data;
1578
+
1579
+ if (arguments.length === 0) {
1580
+ return indexOf(choices.filter(".select2-highlighted")[0], choices.get());
1581
+ }
1582
+
1583
+ if (index >= choices.length) index = choices.length - 1;
1584
+ if (index < 0) index = 0;
1585
+
1586
+ this.removeHighlight();
1587
+
1588
+ choice = $(choices[index]);
1589
+ choice.addClass("select2-highlighted");
1590
+
1591
+ // ensure assistive technology can determine the active choice
1592
+ this.search.attr("aria-activedescendant", choice.find(".select2-result-label").attr("id"));
1593
+
1594
+ this.ensureHighlightVisible();
1595
+
1596
+ this.liveRegion.text(choice.text());
1597
+
1598
+ data = choice.data("select2-data");
1599
+ if (data) {
1600
+ this.opts.element.trigger({ type: "select2-highlight", val: this.id(data), choice: data });
1601
+ }
1602
+ },
1603
+
1604
+ removeHighlight: function() {
1605
+ this.results.find(".select2-highlighted").removeClass("select2-highlighted");
1606
+ },
1607
+
1608
+ touchMoved: function() {
1609
+ this._touchMoved = true;
1610
+ },
1611
+
1612
+ clearTouchMoved: function() {
1613
+ this._touchMoved = false;
1614
+ },
1615
+
1616
+ // abstract
1617
+ countSelectableResults: function() {
1618
+ return this.findHighlightableChoices().length;
1619
+ },
1620
+
1621
+ // abstract
1622
+ highlightUnderEvent: function (event) {
1623
+ var el = $(event.target).closest(".select2-result-selectable");
1624
+ if (el.length > 0 && !el.is(".select2-highlighted")) {
1625
+ var choices = this.findHighlightableChoices();
1626
+ this.highlight(choices.index(el));
1627
+ } else if (el.length == 0) {
1628
+ // if we are over an unselectable item remove all highlights
1629
+ this.removeHighlight();
1630
+ }
1631
+ },
1632
+
1633
+ // abstract
1634
+ loadMoreIfNeeded: function () {
1635
+ var results = this.results,
1636
+ more = results.find("li.select2-more-results"),
1637
+ below, // pixels the element is below the scroll fold, below==0 is when the element is starting to be visible
1638
+ page = this.resultsPage + 1,
1639
+ self=this,
1640
+ term=this.search.val(),
1641
+ context=this.context;
1642
+
1643
+ if (more.length === 0) return;
1644
+ below = more.offset().top - results.offset().top - results.height();
1645
+
1646
+ if (below <= this.opts.loadMorePadding) {
1647
+ more.addClass("select2-active");
1648
+ this.opts.query({
1649
+ element: this.opts.element,
1650
+ term: term,
1651
+ page: page,
1652
+ context: context,
1653
+ matcher: this.opts.matcher,
1654
+ callback: this.bind(function (data) {
1655
+
1656
+ // ignore a response if the select2 has been closed before it was received
1657
+ if (!self.opened()) return;
1658
+
1659
+
1660
+ self.opts.populateResults.call(this, results, data.results, {term: term, page: page, context:context});
1661
+ self.postprocessResults(data, false, false);
1662
+
1663
+ if (data.more===true) {
1664
+ more.detach().appendTo(results).html(self.opts.escapeMarkup(evaluate(self.opts.formatLoadMore, self.opts.element, page+1)));
1665
+ window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
1666
+ } else {
1667
+ more.remove();
1668
+ }
1669
+ self.positionDropdown();
1670
+ self.resultsPage = page;
1671
+ self.context = data.context;
1672
+ this.opts.element.trigger({ type: "select2-loaded", items: data });
1673
+ })});
1674
+ }
1675
+ },
1676
+
1677
+ /**
1678
+ * Default tokenizer function which does nothing
1679
+ */
1680
+ tokenize: function() {
1681
+
1682
+ },
1683
+
1684
+ /**
1685
+ * @param initial whether or not this is the call to this method right after the dropdown has been opened
1686
+ */
1687
+ // abstract
1688
+ updateResults: function (initial) {
1689
+ var search = this.search,
1690
+ results = this.results,
1691
+ opts = this.opts,
1692
+ data,
1693
+ self = this,
1694
+ input,
1695
+ term = search.val(),
1696
+ lastTerm = $.data(this.container, "select2-last-term"),
1697
+ // sequence number used to drop out-of-order responses
1698
+ queryNumber;
1699
+
1700
+ // prevent duplicate queries against the same term
1701
+ if (initial !== true && lastTerm && equal(term, lastTerm)) return;
1702
+
1703
+ $.data(this.container, "select2-last-term", term);
1704
+
1705
+ // if the search is currently hidden we do not alter the results
1706
+ if (initial !== true && (this.showSearchInput === false || !this.opened())) {
1707
+ return;
1708
+ }
1709
+
1710
+ function postRender() {
1711
+ search.removeClass("select2-active");
1712
+ self.positionDropdown();
1713
+ if (results.find('.select2-no-results,.select2-selection-limit,.select2-searching').length) {
1714
+ self.liveRegion.text(results.text());
1715
+ }
1716
+ else {
1717
+ self.liveRegion.text(self.opts.formatMatches(results.find('.select2-result-selectable:not(".select2-selected")').length));
1718
+ }
1719
+ }
1720
+
1721
+ function render(html) {
1722
+ results.html(html);
1723
+ postRender();
1724
+ }
1725
+
1726
+ queryNumber = ++this.queryCount;
1727
+
1728
+ var maxSelSize = this.getMaximumSelectionSize();
1729
+ if (maxSelSize >=1) {
1730
+ data = this.data();
1731
+ if ($.isArray(data) && data.length >= maxSelSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) {
1732
+ render("<li class='select2-selection-limit'>" + evaluate(opts.formatSelectionTooBig, opts.element, maxSelSize) + "</li>");
1733
+ return;
1734
+ }
1735
+ }
1736
+
1737
+ if (search.val().length < opts.minimumInputLength) {
1738
+ if (checkFormatter(opts.formatInputTooShort, "formatInputTooShort")) {
1739
+ render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooShort, opts.element, search.val(), opts.minimumInputLength) + "</li>");
1740
+ } else {
1741
+ render("");
1742
+ }
1743
+ if (initial && this.showSearch) this.showSearch(true);
1744
+ return;
1745
+ }
1746
+
1747
+ if (opts.maximumInputLength && search.val().length > opts.maximumInputLength) {
1748
+ if (checkFormatter(opts.formatInputTooLong, "formatInputTooLong")) {
1749
+ render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooLong, opts.element, search.val(), opts.maximumInputLength) + "</li>");
1750
+ } else {
1751
+ render("");
1752
+ }
1753
+ return;
1754
+ }
1755
+
1756
+ if (opts.formatSearching && this.findHighlightableChoices().length === 0) {
1757
+ render("<li class='select2-searching'>" + evaluate(opts.formatSearching, opts.element) + "</li>");
1758
+ }
1759
+
1760
+ search.addClass("select2-active");
1761
+
1762
+ this.removeHighlight();
1763
+
1764
+ // give the tokenizer a chance to pre-process the input
1765
+ input = this.tokenize();
1766
+ if (input != undefined && input != null) {
1767
+ search.val(input);
1768
+ }
1769
+
1770
+ this.resultsPage = 1;
1771
+
1772
+ opts.query({
1773
+ element: opts.element,
1774
+ term: search.val(),
1775
+ page: this.resultsPage,
1776
+ context: null,
1777
+ matcher: opts.matcher,
1778
+ callback: this.bind(function (data) {
1779
+ var def; // default choice
1780
+
1781
+ // ignore old responses
1782
+ if (queryNumber != this.queryCount) {
1783
+ return;
1784
+ }
1785
+
1786
+ // ignore a response if the select2 has been closed before it was received
1787
+ if (!this.opened()) {
1788
+ this.search.removeClass("select2-active");
1789
+ return;
1790
+ }
1791
+
1792
+ // handle ajax error
1793
+ if(data.hasError !== undefined && checkFormatter(opts.formatAjaxError, "formatAjaxError")) {
1794
+ render("<li class='select2-ajax-error'>" + evaluate(opts.formatAjaxError, opts.element, data.jqXHR, data.textStatus, data.errorThrown) + "</li>");
1795
+ return;
1796
+ }
1797
+
1798
+ // save context, if any
1799
+ this.context = (data.context===undefined) ? null : data.context;
1800
+ // create a default choice and prepend it to the list
1801
+ if (this.opts.createSearchChoice && search.val() !== "") {
1802
+ def = this.opts.createSearchChoice.call(self, search.val(), data.results);
1803
+ if (def !== undefined && def !== null && self.id(def) !== undefined && self.id(def) !== null) {
1804
+ if ($(data.results).filter(
1805
+ function () {
1806
+ return equal(self.id(this), self.id(def));
1807
+ }).length === 0) {
1808
+ this.opts.createSearchChoicePosition(data.results, def);
1809
+ }
1810
+ }
1811
+ }
1812
+
1813
+ if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) {
1814
+ render("<li class='select2-no-results'>" + evaluate(opts.formatNoMatches, opts.element, search.val()) + "</li>");
1815
+ return;
1816
+ }
1817
+
1818
+ results.empty();
1819
+ self.opts.populateResults.call(this, results, data.results, {term: search.val(), page: this.resultsPage, context:null});
1820
+
1821
+ if (data.more === true && checkFormatter(opts.formatLoadMore, "formatLoadMore")) {
1822
+ results.append("<li class='select2-more-results'>" + opts.escapeMarkup(evaluate(opts.formatLoadMore, opts.element, this.resultsPage)) + "</li>");
1823
+ window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
1824
+ }
1825
+
1826
+ this.postprocessResults(data, initial);
1827
+
1828
+ postRender();
1829
+
1830
+ this.opts.element.trigger({ type: "select2-loaded", items: data });
1831
+ })});
1832
+ },
1833
+
1834
+ // abstract
1835
+ cancel: function () {
1836
+ this.close();
1837
+ },
1838
+
1839
+ // abstract
1840
+ blur: function () {
1841
+ // if selectOnBlur == true, select the currently highlighted option
1842
+ if (this.opts.selectOnBlur)
1843
+ this.selectHighlighted({noFocus: true});
1844
+
1845
+ this.close();
1846
+ this.container.removeClass("select2-container-active");
1847
+ // synonymous to .is(':focus'), which is available in jquery >= 1.6
1848
+ if (this.search[0] === document.activeElement) { this.search.blur(); }
1849
+ this.clearSearch();
1850
+ this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
1851
+ },
1852
+
1853
+ // abstract
1854
+ focusSearch: function () {
1855
+ focus(this.search);
1856
+ },
1857
+
1858
+ // abstract
1859
+ selectHighlighted: function (options) {
1860
+ if (this._touchMoved) {
1861
+ this.clearTouchMoved();
1862
+ return;
1863
+ }
1864
+ var index=this.highlight(),
1865
+ highlighted=this.results.find(".select2-highlighted"),
1866
+ data = highlighted.closest('.select2-result').data("select2-data");
1867
+
1868
+ if (data) {
1869
+ this.highlight(index);
1870
+ this.onSelect(data, options);
1871
+ } else if (options && options.noFocus) {
1872
+ this.close();
1873
+ }
1874
+ },
1875
+
1876
+ // abstract
1877
+ getPlaceholder: function () {
1878
+ var placeholderOption;
1879
+ return this.opts.element.attr("placeholder") ||
1880
+ this.opts.element.attr("data-placeholder") || // jquery 1.4 compat
1881
+ this.opts.element.data("placeholder") ||
1882
+ this.opts.placeholder ||
1883
+ ((placeholderOption = this.getPlaceholderOption()) !== undefined ? placeholderOption.text() : undefined);
1884
+ },
1885
+
1886
+ // abstract
1887
+ getPlaceholderOption: function() {
1888
+ if (this.select) {
1889
+ var firstOption = this.select.children('option').first();
1890
+ if (this.opts.placeholderOption !== undefined ) {
1891
+ //Determine the placeholder option based on the specified placeholderOption setting
1892
+ return (this.opts.placeholderOption === "first" && firstOption) ||
1893
+ (typeof this.opts.placeholderOption === "function" && this.opts.placeholderOption(this.select));
1894
+ } else if ($.trim(firstOption.text()) === "" && firstOption.val() === "") {
1895
+ //No explicit placeholder option specified, use the first if it's blank
1896
+ return firstOption;
1897
+ }
1898
+ }
1899
+ },
1900
+
1901
+ /**
1902
+ * Get the desired width for the container element. This is
1903
+ * derived first from option `width` passed to select2, then
1904
+ * the inline 'style' on the original element, and finally
1905
+ * falls back to the jQuery calculated element width.
1906
+ */
1907
+ // abstract
1908
+ initContainerWidth: function () {
1909
+ function resolveContainerWidth() {
1910
+ var style, attrs, matches, i, l, attr;
1911
+
1912
+ if (this.opts.width === "off") {
1913
+ return null;
1914
+ } else if (this.opts.width === "element"){
1915
+ return this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px';
1916
+ } else if (this.opts.width === "copy" || this.opts.width === "resolve") {
1917
+ // check if there is inline style on the element that contains width
1918
+ style = this.opts.element.attr('style');
1919
+ if (style !== undefined) {
1920
+ attrs = style.split(';');
1921
+ for (i = 0, l = attrs.length; i < l; i = i + 1) {
1922
+ attr = attrs[i].replace(/\s/g, '');
1923
+ matches = attr.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);
1924
+ if (matches !== null && matches.length >= 1)
1925
+ return matches[1];
1926
+ }
1927
+ }
1928
+
1929
+ if (this.opts.width === "resolve") {
1930
+ // next check if css('width') can resolve a width that is percent based, this is sometimes possible
1931
+ // when attached to input type=hidden or elements hidden via css
1932
+ style = this.opts.element.css('width');
1933
+ if (style.indexOf("%") > 0) return style;
1934
+
1935
+ // finally, fallback on the calculated width of the element
1936
+ return (this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px');
1937
+ }
1938
+
1939
+ return null;
1940
+ } else if ($.isFunction(this.opts.width)) {
1941
+ return this.opts.width();
1942
+ } else {
1943
+ return this.opts.width;
1944
+ }
1945
+ };
1946
+
1947
+ var width = resolveContainerWidth.call(this);
1948
+ if (width !== null) {
1949
+ this.container.css("width", width);
1950
+ }
1951
+ }
1952
+ });
1953
+
1954
+ SingleSelect2 = clazz(AbstractSelect2, {
1955
+
1956
+ // single
1957
+
1958
+ createContainer: function () {
1959
+ var container = $(document.createElement("div")).attr({
1960
+ "class": "select2-container"
1961
+ }).html([
1962
+ "<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>",
1963
+ " <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>",
1964
+ " <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>",
1965
+ "</a>",
1966
+ "<label for='' class='select2-offscreen'></label>",
1967
+ "<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />",
1968
+ "<div class='select2-drop select2-display-none'>",
1969
+ " <div class='select2-search'>",
1970
+ " <label for='' class='select2-offscreen'></label>",
1971
+ " <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'",
1972
+ " aria-autocomplete='list' />",
1973
+ " </div>",
1974
+ " <ul class='select2-results' role='listbox'>",
1975
+ " </ul>",
1976
+ "</div>"].join(""));
1977
+ return container;
1978
+ },
1979
+
1980
+ // single
1981
+ enableInterface: function() {
1982
+ if (this.parent.enableInterface.apply(this, arguments)) {
1983
+ this.focusser.prop("disabled", !this.isInterfaceEnabled());
1984
+ }
1985
+ },
1986
+
1987
+ // single
1988
+ opening: function () {
1989
+ var el, range, len;
1990
+
1991
+ if (this.opts.minimumResultsForSearch >= 0) {
1992
+ this.showSearch(true);
1993
+ }
1994
+
1995
+ this.parent.opening.apply(this, arguments);
1996
+
1997
+ if (this.showSearchInput !== false) {
1998
+ // IE appends focusser.val() at the end of field :/ so we manually insert it at the beginning using a range
1999
+ // all other browsers handle this just fine
2000
+
2001
+ this.search.val(this.focusser.val());
2002
+ }
2003
+ if (this.opts.shouldFocusInput(this)) {
2004
+ this.search.focus();
2005
+ // move the cursor to the end after focussing, otherwise it will be at the beginning and
2006
+ // new text will appear *before* focusser.val()
2007
+ el = this.search.get(0);
2008
+ if (el.createTextRange) {
2009
+ range = el.createTextRange();
2010
+ range.collapse(false);
2011
+ range.select();
2012
+ } else if (el.setSelectionRange) {
2013
+ len = this.search.val().length;
2014
+ el.setSelectionRange(len, len);
2015
+ }
2016
+ }
2017
+
2018
+ // initializes search's value with nextSearchTerm (if defined by user)
2019
+ // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
2020
+ if(this.search.val() === "") {
2021
+ if(this.nextSearchTerm != undefined){
2022
+ this.search.val(this.nextSearchTerm);
2023
+ this.search.select();
2024
+ }
2025
+ }
2026
+
2027
+ this.focusser.prop("disabled", true).val("");
2028
+ this.updateResults(true);
2029
+ this.opts.element.trigger($.Event("select2-open"));
2030
+ },
2031
+
2032
+ // single
2033
+ close: function () {
2034
+ if (!this.opened()) return;
2035
+ this.parent.close.apply(this, arguments);
2036
+
2037
+ this.focusser.prop("disabled", false);
2038
+
2039
+ if (this.opts.shouldFocusInput(this)) {
2040
+ this.focusser.focus();
2041
+ }
2042
+ },
2043
+
2044
+ // single
2045
+ focus: function () {
2046
+ if (this.opened()) {
2047
+ this.close();
2048
+ } else {
2049
+ this.focusser.prop("disabled", false);
2050
+ if (this.opts.shouldFocusInput(this)) {
2051
+ this.focusser.focus();
2052
+ }
2053
+ }
2054
+ },
2055
+
2056
+ // single
2057
+ isFocused: function () {
2058
+ return this.container.hasClass("select2-container-active");
2059
+ },
2060
+
2061
+ // single
2062
+ cancel: function () {
2063
+ this.parent.cancel.apply(this, arguments);
2064
+ this.focusser.prop("disabled", false);
2065
+
2066
+ if (this.opts.shouldFocusInput(this)) {
2067
+ this.focusser.focus();
2068
+ }
2069
+ },
2070
+
2071
+ // single
2072
+ destroy: function() {
2073
+ $("label[for='" + this.focusser.attr('id') + "']")
2074
+ .attr('for', this.opts.element.attr("id"));
2075
+ this.parent.destroy.apply(this, arguments);
2076
+
2077
+ cleanupJQueryElements.call(this,
2078
+ "selection",
2079
+ "focusser"
2080
+ );
2081
+ },
2082
+
2083
+ // single
2084
+ initContainer: function () {
2085
+
2086
+ var selection,
2087
+ container = this.container,
2088
+ dropdown = this.dropdown,
2089
+ idSuffix = nextUid(),
2090
+ elementLabel;
2091
+
2092
+ if (this.opts.minimumResultsForSearch < 0) {
2093
+ this.showSearch(false);
2094
+ } else {
2095
+ this.showSearch(true);
2096
+ }
2097
+
2098
+ this.selection = selection = container.find(".select2-choice");
2099
+
2100
+ this.focusser = container.find(".select2-focusser");
2101
+
2102
+ // add aria associations
2103
+ selection.find(".select2-chosen").attr("id", "select2-chosen-"+idSuffix);
2104
+ this.focusser.attr("aria-labelledby", "select2-chosen-"+idSuffix);
2105
+ this.results.attr("id", "select2-results-"+idSuffix);
2106
+ this.search.attr("aria-owns", "select2-results-"+idSuffix);
2107
+
2108
+ // rewrite labels from original element to focusser
2109
+ this.focusser.attr("id", "s2id_autogen"+idSuffix);
2110
+
2111
+ elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
2112
+ this.opts.element.focus(this.bind(function () { this.focus(); }));
2113
+
2114
+ this.focusser.prev()
2115
+ .text(elementLabel.text())
2116
+ .attr('for', this.focusser.attr('id'));
2117
+
2118
+ // Ensure the original element retains an accessible name
2119
+ var originalTitle = this.opts.element.attr("title");
2120
+ this.opts.element.attr("title", (originalTitle || elementLabel.text()));
2121
+
2122
+ this.focusser.attr("tabindex", this.elementTabIndex);
2123
+
2124
+ // write label for search field using the label from the focusser element
2125
+ this.search.attr("id", this.focusser.attr('id') + '_search');
2126
+
2127
+ this.search.prev()
2128
+ .text($("label[for='" + this.focusser.attr('id') + "']").text())
2129
+ .attr('for', this.search.attr('id'));
2130
+
2131
+ this.search.on("keydown", this.bind(function (e) {
2132
+ if (!this.isInterfaceEnabled()) return;
2133
+
2134
+ // filter 229 keyCodes (input method editor is processing key input)
2135
+ if (229 == e.keyCode) return;
2136
+
2137
+ if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
2138
+ // prevent the page from scrolling
2139
+ killEvent(e);
2140
+ return;
2141
+ }
2142
+
2143
+ switch (e.which) {
2144
+ case KEY.UP:
2145
+ case KEY.DOWN:
2146
+ this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
2147
+ killEvent(e);
2148
+ return;
2149
+ case KEY.ENTER:
2150
+ this.selectHighlighted();
2151
+ killEvent(e);
2152
+ return;
2153
+ case KEY.TAB:
2154
+ this.selectHighlighted({noFocus: true});
2155
+ return;
2156
+ case KEY.ESC:
2157
+ this.cancel(e);
2158
+ killEvent(e);
2159
+ return;
2160
+ }
2161
+ }));
2162
+
2163
+ this.search.on("blur", this.bind(function(e) {
2164
+ // a workaround for chrome to keep the search field focussed when the scroll bar is used to scroll the dropdown.
2165
+ // without this the search field loses focus which is annoying
2166
+ if (document.activeElement === this.body.get(0)) {
2167
+ window.setTimeout(this.bind(function() {
2168
+ if (this.opened()) {
2169
+ this.search.focus();
2170
+ }
2171
+ }), 0);
2172
+ }
2173
+ }));
2174
+
2175
+ this.focusser.on("keydown", this.bind(function (e) {
2176
+ if (!this.isInterfaceEnabled()) return;
2177
+
2178
+ if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) {
2179
+ return;
2180
+ }
2181
+
2182
+ if (this.opts.openOnEnter === false && e.which === KEY.ENTER) {
2183
+ killEvent(e);
2184
+ return;
2185
+ }
2186
+
2187
+ if (e.which == KEY.DOWN || e.which == KEY.UP
2188
+ || (e.which == KEY.ENTER && this.opts.openOnEnter)) {
2189
+
2190
+ if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) return;
2191
+
2192
+ this.open();
2193
+ killEvent(e);
2194
+ return;
2195
+ }
2196
+
2197
+ if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE) {
2198
+ if (this.opts.allowClear) {
2199
+ this.clear();
2200
+ }
2201
+ killEvent(e);
2202
+ return;
2203
+ }
2204
+ }));
2205
+
2206
+
2207
+ installKeyUpChangeEvent(this.focusser);
2208
+ this.focusser.on("keyup-change input", this.bind(function(e) {
2209
+ if (this.opts.minimumResultsForSearch >= 0) {
2210
+ e.stopPropagation();
2211
+ if (this.opened()) return;
2212
+ this.open();
2213
+ }
2214
+ }));
2215
+
2216
+ selection.on("mousedown touchstart", "abbr", this.bind(function (e) {
2217
+ if (!this.isInterfaceEnabled()) {
2218
+ return;
2219
+ }
2220
+
2221
+ this.clear();
2222
+ killEventImmediately(e);
2223
+ this.close();
2224
+
2225
+ if (this.selection) {
2226
+ this.selection.focus();
2227
+ }
2228
+ }));
2229
+
2230
+ selection.on("mousedown touchstart", this.bind(function (e) {
2231
+ // Prevent IE from generating a click event on the body
2232
+ reinsertElement(selection);
2233
+
2234
+ if (!this.container.hasClass("select2-container-active")) {
2235
+ this.opts.element.trigger($.Event("select2-focus"));
2236
+ }
2237
+
2238
+ if (this.opened()) {
2239
+ this.close();
2240
+ } else if (this.isInterfaceEnabled()) {
2241
+ this.open();
2242
+ }
2243
+
2244
+ killEvent(e);
2245
+ }));
2246
+
2247
+ dropdown.on("mousedown touchstart", this.bind(function() {
2248
+ if (this.opts.shouldFocusInput(this)) {
2249
+ this.search.focus();
2250
+ }
2251
+ }));
2252
+
2253
+ selection.on("focus", this.bind(function(e) {
2254
+ killEvent(e);
2255
+ }));
2256
+
2257
+ this.focusser.on("focus", this.bind(function(){
2258
+ if (!this.container.hasClass("select2-container-active")) {
2259
+ this.opts.element.trigger($.Event("select2-focus"));
2260
+ }
2261
+ this.container.addClass("select2-container-active");
2262
+ })).on("blur", this.bind(function() {
2263
+ if (!this.opened()) {
2264
+ this.container.removeClass("select2-container-active");
2265
+ this.opts.element.trigger($.Event("select2-blur"));
2266
+ }
2267
+ }));
2268
+ this.search.on("focus", this.bind(function(){
2269
+ if (!this.container.hasClass("select2-container-active")) {
2270
+ this.opts.element.trigger($.Event("select2-focus"));
2271
+ }
2272
+ this.container.addClass("select2-container-active");
2273
+ }));
2274
+
2275
+ this.initContainerWidth();
2276
+ this.opts.element.hide();
2277
+ this.setPlaceholder();
2278
+
2279
+ },
2280
+
2281
+ // single
2282
+ clear: function(triggerChange) {
2283
+ var data=this.selection.data("select2-data");
2284
+ if (data) { // guard against queued quick consecutive clicks
2285
+ var evt = $.Event("select2-clearing");
2286
+ this.opts.element.trigger(evt);
2287
+ if (evt.isDefaultPrevented()) {
2288
+ return;
2289
+ }
2290
+ var placeholderOption = this.getPlaceholderOption();
2291
+ this.opts.element.val(placeholderOption ? placeholderOption.val() : "");
2292
+ this.selection.find(".select2-chosen").empty();
2293
+ this.selection.removeData("select2-data");
2294
+ this.setPlaceholder();
2295
+
2296
+ if (triggerChange !== false){
2297
+ this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
2298
+ this.triggerChange({removed:data});
2299
+ }
2300
+ }
2301
+ },
2302
+
2303
+ /**
2304
+ * Sets selection based on source element's value
2305
+ */
2306
+ // single
2307
+ initSelection: function () {
2308
+ var selected;
2309
+ if (this.isPlaceholderOptionSelected()) {
2310
+ this.updateSelection(null);
2311
+ this.close();
2312
+ this.setPlaceholder();
2313
+ } else {
2314
+ var self = this;
2315
+ this.opts.initSelection.call(null, this.opts.element, function(selected){
2316
+ if (selected !== undefined && selected !== null) {
2317
+ self.updateSelection(selected);
2318
+ self.close();
2319
+ self.setPlaceholder();
2320
+ self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
2321
+ }
2322
+ });
2323
+ }
2324
+ },
2325
+
2326
+ isPlaceholderOptionSelected: function() {
2327
+ var placeholderOption;
2328
+ if (this.getPlaceholder() === undefined) return false; // no placeholder specified so no option should be considered
2329
+ return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.prop("selected"))
2330
+ || (this.opts.element.val() === "")
2331
+ || (this.opts.element.val() === undefined)
2332
+ || (this.opts.element.val() === null);
2333
+ },
2334
+
2335
+ // single
2336
+ prepareOpts: function () {
2337
+ var opts = this.parent.prepareOpts.apply(this, arguments),
2338
+ self=this;
2339
+
2340
+ if (opts.element.get(0).tagName.toLowerCase() === "select") {
2341
+ // install the selection initializer
2342
+ opts.initSelection = function (element, callback) {
2343
+ var selected = element.find("option").filter(function() { return this.selected && !this.disabled });
2344
+ // a single select box always has a value, no need to null check 'selected'
2345
+ callback(self.optionToData(selected));
2346
+ };
2347
+ } else if ("data" in opts) {
2348
+ // install default initSelection when applied to hidden input and data is local
2349
+ opts.initSelection = opts.initSelection || function (element, callback) {
2350
+ var id = element.val();
2351
+ //search in data by id, storing the actual matching item
2352
+ var match = null;
2353
+ opts.query({
2354
+ matcher: function(term, text, el){
2355
+ var is_match = equal(id, opts.id(el));
2356
+ if (is_match) {
2357
+ match = el;
2358
+ }
2359
+ return is_match;
2360
+ },
2361
+ callback: !$.isFunction(callback) ? $.noop : function() {
2362
+ callback(match);
2363
+ }
2364
+ });
2365
+ };
2366
+ }
2367
+
2368
+ return opts;
2369
+ },
2370
+
2371
+ // single
2372
+ getPlaceholder: function() {
2373
+ // if a placeholder is specified on a single select without a valid placeholder option ignore it
2374
+ if (this.select) {
2375
+ if (this.getPlaceholderOption() === undefined) {
2376
+ return undefined;
2377
+ }
2378
+ }
2379
+
2380
+ return this.parent.getPlaceholder.apply(this, arguments);
2381
+ },
2382
+
2383
+ // single
2384
+ setPlaceholder: function () {
2385
+ var placeholder = this.getPlaceholder();
2386
+
2387
+ if (this.isPlaceholderOptionSelected() && placeholder !== undefined) {
2388
+
2389
+ // check for a placeholder option if attached to a select
2390
+ if (this.select && this.getPlaceholderOption() === undefined) return;
2391
+
2392
+ this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder));
2393
+
2394
+ this.selection.addClass("select2-default");
2395
+
2396
+ this.container.removeClass("select2-allowclear");
2397
+ }
2398
+ },
2399
+
2400
+ // single
2401
+ postprocessResults: function (data, initial, noHighlightUpdate) {
2402
+ var selected = 0, self = this, showSearchInput = true;
2403
+
2404
+ // find the selected element in the result list
2405
+
2406
+ this.findHighlightableChoices().each2(function (i, elm) {
2407
+ if (equal(self.id(elm.data("select2-data")), self.opts.element.val())) {
2408
+ selected = i;
2409
+ return false;
2410
+ }
2411
+ });
2412
+
2413
+ // and highlight it
2414
+ if (noHighlightUpdate !== false) {
2415
+ if (initial === true && selected >= 0) {
2416
+ this.highlight(selected);
2417
+ } else {
2418
+ this.highlight(0);
2419
+ }
2420
+ }
2421
+
2422
+ // hide the search box if this is the first we got the results and there are enough of them for search
2423
+
2424
+ if (initial === true) {
2425
+ var min = this.opts.minimumResultsForSearch;
2426
+ if (min >= 0) {
2427
+ this.showSearch(countResults(data.results) >= min);
2428
+ }
2429
+ }
2430
+ },
2431
+
2432
+ // single
2433
+ showSearch: function(showSearchInput) {
2434
+ if (this.showSearchInput === showSearchInput) return;
2435
+
2436
+ this.showSearchInput = showSearchInput;
2437
+
2438
+ this.dropdown.find(".select2-search").toggleClass("select2-search-hidden", !showSearchInput);
2439
+ this.dropdown.find(".select2-search").toggleClass("select2-offscreen", !showSearchInput);
2440
+ //add "select2-with-searchbox" to the container if search box is shown
2441
+ $(this.dropdown, this.container).toggleClass("select2-with-searchbox", showSearchInput);
2442
+ },
2443
+
2444
+ // single
2445
+ onSelect: function (data, options) {
2446
+
2447
+ if (!this.triggerSelect(data)) { return; }
2448
+
2449
+ var old = this.opts.element.val(),
2450
+ oldData = this.data();
2451
+
2452
+ this.opts.element.val(this.id(data));
2453
+ this.updateSelection(data);
2454
+
2455
+ this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data });
2456
+
2457
+ this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
2458
+ this.close();
2459
+
2460
+ if ((!options || !options.noFocus) && this.opts.shouldFocusInput(this)) {
2461
+ this.focusser.focus();
2462
+ }
2463
+
2464
+ if (!equal(old, this.id(data))) {
2465
+ this.triggerChange({ added: data, removed: oldData });
2466
+ }
2467
+ },
2468
+
2469
+ // single
2470
+ updateSelection: function (data) {
2471
+
2472
+ var container=this.selection.find(".select2-chosen"), formatted, cssClass;
2473
+
2474
+ this.selection.data("select2-data", data);
2475
+
2476
+ container.empty();
2477
+ if (data !== null) {
2478
+ formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup);
2479
+ }
2480
+ if (formatted !== undefined) {
2481
+ container.append(formatted);
2482
+ }
2483
+ cssClass=this.opts.formatSelectionCssClass(data, container);
2484
+ if (cssClass !== undefined) {
2485
+ container.addClass(cssClass);
2486
+ }
2487
+
2488
+ this.selection.removeClass("select2-default");
2489
+
2490
+ if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
2491
+ this.container.addClass("select2-allowclear");
2492
+ }
2493
+ },
2494
+
2495
+ // single
2496
+ val: function () {
2497
+ var val,
2498
+ triggerChange = false,
2499
+ data = null,
2500
+ self = this,
2501
+ oldData = this.data();
2502
+
2503
+ if (arguments.length === 0) {
2504
+ return this.opts.element.val();
2505
+ }
2506
+
2507
+ val = arguments[0];
2508
+
2509
+ if (arguments.length > 1) {
2510
+ triggerChange = arguments[1];
2511
+ }
2512
+
2513
+ if (this.select) {
2514
+ this.select
2515
+ .val(val)
2516
+ .find("option").filter(function() { return this.selected }).each2(function (i, elm) {
2517
+ data = self.optionToData(elm);
2518
+ return false;
2519
+ });
2520
+ this.updateSelection(data);
2521
+ this.setPlaceholder();
2522
+ if (triggerChange) {
2523
+ this.triggerChange({added: data, removed:oldData});
2524
+ }
2525
+ } else {
2526
+ // val is an id. !val is true for [undefined,null,'',0] - 0 is legal
2527
+ if (!val && val !== 0) {
2528
+ this.clear(triggerChange);
2529
+ return;
2530
+ }
2531
+ if (this.opts.initSelection === undefined) {
2532
+ throw new Error("cannot call val() if initSelection() is not defined");
2533
+ }
2534
+ this.opts.element.val(val);
2535
+ this.opts.initSelection(this.opts.element, function(data){
2536
+ self.opts.element.val(!data ? "" : self.id(data));
2537
+ self.updateSelection(data);
2538
+ self.setPlaceholder();
2539
+ if (triggerChange) {
2540
+ self.triggerChange({added: data, removed:oldData});
2541
+ }
2542
+ });
2543
+ }
2544
+ },
2545
+
2546
+ // single
2547
+ clearSearch: function () {
2548
+ this.search.val("");
2549
+ this.focusser.val("");
2550
+ },
2551
+
2552
+ // single
2553
+ data: function(value) {
2554
+ var data,
2555
+ triggerChange = false;
2556
+
2557
+ if (arguments.length === 0) {
2558
+ data = this.selection.data("select2-data");
2559
+ if (data == undefined) data = null;
2560
+ return data;
2561
+ } else {
2562
+ if (arguments.length > 1) {
2563
+ triggerChange = arguments[1];
2564
+ }
2565
+ if (!value) {
2566
+ this.clear(triggerChange);
2567
+ } else {
2568
+ data = this.data();
2569
+ this.opts.element.val(!value ? "" : this.id(value));
2570
+ this.updateSelection(value);
2571
+ if (triggerChange) {
2572
+ this.triggerChange({added: value, removed:data});
2573
+ }
2574
+ }
2575
+ }
2576
+ }
2577
+ });
2578
+
2579
+ MultiSelect2 = clazz(AbstractSelect2, {
2580
+
2581
+ // multi
2582
+ createContainer: function () {
2583
+ var container = $(document.createElement("div")).attr({
2584
+ "class": "select2-container select2-container-multi"
2585
+ }).html([
2586
+ "<ul class='select2-choices'>",
2587
+ " <li class='select2-search-field'>",
2588
+ " <label for='' class='select2-offscreen'></label>",
2589
+ " <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>",
2590
+ " </li>",
2591
+ "</ul>",
2592
+ "<div class='select2-drop select2-drop-multi select2-display-none'>",
2593
+ " <ul class='select2-results'>",
2594
+ " </ul>",
2595
+ "</div>"].join(""));
2596
+ return container;
2597
+ },
2598
+
2599
+ // multi
2600
+ prepareOpts: function () {
2601
+ var opts = this.parent.prepareOpts.apply(this, arguments),
2602
+ self=this;
2603
+
2604
+ // TODO validate placeholder is a string if specified
2605
+ if (opts.element.get(0).tagName.toLowerCase() === "select") {
2606
+ // install the selection initializer
2607
+ opts.initSelection = function (element, callback) {
2608
+
2609
+ var data = [];
2610
+
2611
+ element.find("option").filter(function() { return this.selected && !this.disabled }).each2(function (i, elm) {
2612
+ data.push(self.optionToData(elm));
2613
+ });
2614
+ callback(data);
2615
+ };
2616
+ } else if ("data" in opts) {
2617
+ // install default initSelection when applied to hidden input and data is local
2618
+ opts.initSelection = opts.initSelection || function (element, callback) {
2619
+ var ids = splitVal(element.val(), opts.separator, opts.transformVal);
2620
+ //search in data by array of ids, storing matching items in a list
2621
+ var matches = [];
2622
+ opts.query({
2623
+ matcher: function(term, text, el){
2624
+ var is_match = $.grep(ids, function(id) {
2625
+ return equal(id, opts.id(el));
2626
+ }).length;
2627
+ if (is_match) {
2628
+ matches.push(el);
2629
+ }
2630
+ return is_match;
2631
+ },
2632
+ callback: !$.isFunction(callback) ? $.noop : function() {
2633
+ // reorder matches based on the order they appear in the ids array because right now
2634
+ // they are in the order in which they appear in data array
2635
+ var ordered = [];
2636
+ for (var i = 0; i < ids.length; i++) {
2637
+ var id = ids[i];
2638
+ for (var j = 0; j < matches.length; j++) {
2639
+ var match = matches[j];
2640
+ if (equal(id, opts.id(match))) {
2641
+ ordered.push(match);
2642
+ matches.splice(j, 1);
2643
+ break;
2644
+ }
2645
+ }
2646
+ }
2647
+ callback(ordered);
2648
+ }
2649
+ });
2650
+ };
2651
+ }
2652
+
2653
+ return opts;
2654
+ },
2655
+
2656
+ // multi
2657
+ selectChoice: function (choice) {
2658
+
2659
+ var selected = this.container.find(".select2-search-choice-focus");
2660
+ if (selected.length && choice && choice[0] == selected[0]) {
2661
+
2662
+ } else {
2663
+ if (selected.length) {
2664
+ this.opts.element.trigger("choice-deselected", selected);
2665
+ }
2666
+ selected.removeClass("select2-search-choice-focus");
2667
+ if (choice && choice.length) {
2668
+ this.close();
2669
+ choice.addClass("select2-search-choice-focus");
2670
+ this.opts.element.trigger("choice-selected", choice);
2671
+ }
2672
+ }
2673
+ },
2674
+
2675
+ // multi
2676
+ destroy: function() {
2677
+ $("label[for='" + this.search.attr('id') + "']")
2678
+ .attr('for', this.opts.element.attr("id"));
2679
+ this.parent.destroy.apply(this, arguments);
2680
+
2681
+ cleanupJQueryElements.call(this,
2682
+ "searchContainer",
2683
+ "selection"
2684
+ );
2685
+ },
2686
+
2687
+ // multi
2688
+ initContainer: function () {
2689
+
2690
+ var selector = ".select2-choices", selection;
2691
+
2692
+ this.searchContainer = this.container.find(".select2-search-field");
2693
+ this.selection = selection = this.container.find(selector);
2694
+
2695
+ var _this = this;
2696
+ this.selection.on("click", ".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)", function (e) {
2697
+ _this.search[0].focus();
2698
+ _this.selectChoice($(this));
2699
+ });
2700
+
2701
+ // rewrite labels from original element to focusser
2702
+ this.search.attr("id", "s2id_autogen"+nextUid());
2703
+
2704
+ this.search.prev()
2705
+ .text($("label[for='" + this.opts.element.attr("id") + "']").text())
2706
+ .attr('for', this.search.attr('id'));
2707
+ this.opts.element.focus(this.bind(function () { this.focus(); }));
2708
+
2709
+ this.search.on("input paste", this.bind(function() {
2710
+ if (this.search.attr('placeholder') && this.search.val().length == 0) return;
2711
+ if (!this.isInterfaceEnabled()) return;
2712
+ if (!this.opened()) {
2713
+ this.open();
2714
+ }
2715
+ }));
2716
+
2717
+ this.search.attr("tabindex", this.elementTabIndex);
2718
+
2719
+ this.keydowns = 0;
2720
+ this.search.on("keydown", this.bind(function (e) {
2721
+ if (!this.isInterfaceEnabled()) return;
2722
+
2723
+ ++this.keydowns;
2724
+ var selected = selection.find(".select2-search-choice-focus");
2725
+ var prev = selected.prev(".select2-search-choice:not(.select2-locked)");
2726
+ var next = selected.next(".select2-search-choice:not(.select2-locked)");
2727
+ var pos = getCursorInfo(this.search);
2728
+
2729
+ if (selected.length &&
2730
+ (e.which == KEY.LEFT || e.which == KEY.RIGHT || e.which == KEY.BACKSPACE || e.which == KEY.DELETE || e.which == KEY.ENTER)) {
2731
+ var selectedChoice = selected;
2732
+ if (e.which == KEY.LEFT && prev.length) {
2733
+ selectedChoice = prev;
2734
+ }
2735
+ else if (e.which == KEY.RIGHT) {
2736
+ selectedChoice = next.length ? next : null;
2737
+ }
2738
+ else if (e.which === KEY.BACKSPACE) {
2739
+ if (this.unselect(selected.first())) {
2740
+ this.search.width(10);
2741
+ selectedChoice = prev.length ? prev : next;
2742
+ }
2743
+ } else if (e.which == KEY.DELETE) {
2744
+ if (this.unselect(selected.first())) {
2745
+ this.search.width(10);
2746
+ selectedChoice = next.length ? next : null;
2747
+ }
2748
+ } else if (e.which == KEY.ENTER) {
2749
+ selectedChoice = null;
2750
+ }
2751
+
2752
+ this.selectChoice(selectedChoice);
2753
+ killEvent(e);
2754
+ if (!selectedChoice || !selectedChoice.length) {
2755
+ this.open();
2756
+ }
2757
+ return;
2758
+ } else if (((e.which === KEY.BACKSPACE && this.keydowns == 1)
2759
+ || e.which == KEY.LEFT) && (pos.offset == 0 && !pos.length)) {
2760
+
2761
+ this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last());
2762
+ killEvent(e);
2763
+ return;
2764
+ } else {
2765
+ this.selectChoice(null);
2766
+ }
2767
+
2768
+ if (this.opened()) {
2769
+ switch (e.which) {
2770
+ case KEY.UP:
2771
+ case KEY.DOWN:
2772
+ this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
2773
+ killEvent(e);
2774
+ return;
2775
+ case KEY.ENTER:
2776
+ this.selectHighlighted();
2777
+ killEvent(e);
2778
+ return;
2779
+ case KEY.TAB:
2780
+ this.selectHighlighted({noFocus:true});
2781
+ this.close();
2782
+ return;
2783
+ case KEY.ESC:
2784
+ this.cancel(e);
2785
+ killEvent(e);
2786
+ return;
2787
+ }
2788
+ }
2789
+
2790
+ if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e)
2791
+ || e.which === KEY.BACKSPACE || e.which === KEY.ESC) {
2792
+ return;
2793
+ }
2794
+
2795
+ if (e.which === KEY.ENTER) {
2796
+ if (this.opts.openOnEnter === false) {
2797
+ return;
2798
+ } else if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
2799
+ return;
2800
+ }
2801
+ }
2802
+
2803
+ this.open();
2804
+
2805
+ if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
2806
+ // prevent the page from scrolling
2807
+ killEvent(e);
2808
+ }
2809
+
2810
+ if (e.which === KEY.ENTER) {
2811
+ // prevent form from being submitted
2812
+ killEvent(e);
2813
+ }
2814
+
2815
+ }));
2816
+
2817
+ this.search.on("keyup", this.bind(function (e) {
2818
+ this.keydowns = 0;
2819
+ this.resizeSearch();
2820
+ })
2821
+ );
2822
+
2823
+ this.search.on("blur", this.bind(function(e) {
2824
+ this.container.removeClass("select2-container-active");
2825
+ this.search.removeClass("select2-focused");
2826
+ this.selectChoice(null);
2827
+ if (!this.opened()) this.clearSearch();
2828
+ e.stopImmediatePropagation();
2829
+ this.opts.element.trigger($.Event("select2-blur"));
2830
+ }));
2831
+
2832
+ this.container.on("click", selector, this.bind(function (e) {
2833
+ if (!this.isInterfaceEnabled()) return;
2834
+ if ($(e.target).closest(".select2-search-choice").length > 0) {
2835
+ // clicked inside a select2 search choice, do not open
2836
+ return;
2837
+ }
2838
+ this.selectChoice(null);
2839
+ this.clearPlaceholder();
2840
+ if (!this.container.hasClass("select2-container-active")) {
2841
+ this.opts.element.trigger($.Event("select2-focus"));
2842
+ }
2843
+ this.open();
2844
+ this.focusSearch();
2845
+ e.preventDefault();
2846
+ }));
2847
+
2848
+ this.container.on("focus", selector, this.bind(function () {
2849
+ if (!this.isInterfaceEnabled()) return;
2850
+ if (!this.container.hasClass("select2-container-active")) {
2851
+ this.opts.element.trigger($.Event("select2-focus"));
2852
+ }
2853
+ this.container.addClass("select2-container-active");
2854
+ this.dropdown.addClass("select2-drop-active");
2855
+ this.clearPlaceholder();
2856
+ }));
2857
+
2858
+ this.initContainerWidth();
2859
+ this.opts.element.hide();
2860
+
2861
+ // set the placeholder if necessary
2862
+ this.clearSearch();
2863
+ },
2864
+
2865
+ // multi
2866
+ enableInterface: function() {
2867
+ if (this.parent.enableInterface.apply(this, arguments)) {
2868
+ this.search.prop("disabled", !this.isInterfaceEnabled());
2869
+ }
2870
+ },
2871
+
2872
+ // multi
2873
+ initSelection: function () {
2874
+ var data;
2875
+ if (this.opts.element.val() === "" && this.opts.element.text() === "") {
2876
+ this.updateSelection([]);
2877
+ this.close();
2878
+ // set the placeholder if necessary
2879
+ this.clearSearch();
2880
+ }
2881
+ if (this.select || this.opts.element.val() !== "") {
2882
+ var self = this;
2883
+ this.opts.initSelection.call(null, this.opts.element, function(data){
2884
+ if (data !== undefined && data !== null) {
2885
+ self.updateSelection(data);
2886
+ self.close();
2887
+ // set the placeholder if necessary
2888
+ self.clearSearch();
2889
+ }
2890
+ });
2891
+ }
2892
+ },
2893
+
2894
+ // multi
2895
+ clearSearch: function () {
2896
+ var placeholder = this.getPlaceholder(),
2897
+ maxWidth = this.getMaxSearchWidth();
2898
+
2899
+ if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) {
2900
+ this.search.val(placeholder).addClass("select2-default");
2901
+ // stretch the search box to full width of the container so as much of the placeholder is visible as possible
2902
+ // we could call this.resizeSearch(), but we do not because that requires a sizer and we do not want to create one so early because of a firefox bug, see #944
2903
+ this.search.width(maxWidth > 0 ? maxWidth : this.container.css("width"));
2904
+ } else {
2905
+ this.search.val("").width(10);
2906
+ }
2907
+ },
2908
+
2909
+ // multi
2910
+ clearPlaceholder: function () {
2911
+ if (this.search.hasClass("select2-default")) {
2912
+ this.search.val("").removeClass("select2-default");
2913
+ }
2914
+ },
2915
+
2916
+ // multi
2917
+ opening: function () {
2918
+ this.clearPlaceholder(); // should be done before super so placeholder is not used to search
2919
+ this.resizeSearch();
2920
+
2921
+ this.parent.opening.apply(this, arguments);
2922
+
2923
+ this.focusSearch();
2924
+
2925
+ // initializes search's value with nextSearchTerm (if defined by user)
2926
+ // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
2927
+ if(this.search.val() === "") {
2928
+ if(this.nextSearchTerm != undefined){
2929
+ this.search.val(this.nextSearchTerm);
2930
+ this.search.select();
2931
+ }
2932
+ }
2933
+
2934
+ this.updateResults(true);
2935
+ if (this.opts.shouldFocusInput(this)) {
2936
+ this.search.focus();
2937
+ }
2938
+ this.opts.element.trigger($.Event("select2-open"));
2939
+ },
2940
+
2941
+ // multi
2942
+ close: function () {
2943
+ if (!this.opened()) return;
2944
+ this.parent.close.apply(this, arguments);
2945
+ },
2946
+
2947
+ // multi
2948
+ focus: function () {
2949
+ this.close();
2950
+ this.search.focus();
2951
+ },
2952
+
2953
+ // multi
2954
+ isFocused: function () {
2955
+ return this.search.hasClass("select2-focused");
2956
+ },
2957
+
2958
+ // multi
2959
+ updateSelection: function (data) {
2960
+ var ids = [], filtered = [], self = this;
2961
+
2962
+ // filter out duplicates
2963
+ $(data).each(function () {
2964
+ if (indexOf(self.id(this), ids) < 0) {
2965
+ ids.push(self.id(this));
2966
+ filtered.push(this);
2967
+ }
2968
+ });
2969
+ data = filtered;
2970
+
2971
+ this.selection.find(".select2-search-choice").remove();
2972
+ $(data).each(function () {
2973
+ self.addSelectedChoice(this);
2974
+ });
2975
+ self.postprocessResults();
2976
+ },
2977
+
2978
+ // multi
2979
+ tokenize: function() {
2980
+ var input = this.search.val();
2981
+ input = this.opts.tokenizer.call(this, input, this.data(), this.bind(this.onSelect), this.opts);
2982
+ if (input != null && input != undefined) {
2983
+ this.search.val(input);
2984
+ if (input.length > 0) {
2985
+ this.open();
2986
+ }
2987
+ }
2988
+
2989
+ },
2990
+
2991
+ // multi
2992
+ onSelect: function (data, options) {
2993
+
2994
+ if (!this.triggerSelect(data) || data.text === "") { return; }
2995
+
2996
+ this.addSelectedChoice(data);
2997
+
2998
+ this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data });
2999
+
3000
+ // keep track of the search's value before it gets cleared
3001
+ this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
3002
+
3003
+ this.clearSearch();
3004
+ this.updateResults();
3005
+
3006
+ if (this.select || !this.opts.closeOnSelect) this.postprocessResults(data, false, this.opts.closeOnSelect===true);
3007
+
3008
+ if (this.opts.closeOnSelect) {
3009
+ this.close();
3010
+ this.search.width(10);
3011
+ } else {
3012
+ if (this.countSelectableResults()>0) {
3013
+ this.search.width(10);
3014
+ this.resizeSearch();
3015
+ if (this.getMaximumSelectionSize() > 0 && this.val().length >= this.getMaximumSelectionSize()) {
3016
+ // if we reached max selection size repaint the results so choices
3017
+ // are replaced with the max selection reached message
3018
+ this.updateResults(true);
3019
+ } else {
3020
+ // initializes search's value with nextSearchTerm and update search result
3021
+ if(this.nextSearchTerm != undefined){
3022
+ this.search.val(this.nextSearchTerm);
3023
+ this.updateResults();
3024
+ this.search.select();
3025
+ }
3026
+ }
3027
+ this.positionDropdown();
3028
+ } else {
3029
+ // if nothing left to select close
3030
+ this.close();
3031
+ this.search.width(10);
3032
+ }
3033
+ }
3034
+
3035
+ // since its not possible to select an element that has already been
3036
+ // added we do not need to check if this is a new element before firing change
3037
+ this.triggerChange({ added: data });
3038
+
3039
+ if (!options || !options.noFocus)
3040
+ this.focusSearch();
3041
+ },
3042
+
3043
+ // multi
3044
+ cancel: function () {
3045
+ this.close();
3046
+ this.focusSearch();
3047
+ },
3048
+
3049
+ addSelectedChoice: function (data) {
3050
+ var enableChoice = !data.locked,
3051
+ enabledItem = $(
3052
+ "<li class='select2-search-choice'>" +
3053
+ " <div></div>" +
3054
+ " <a href='#' class='select2-search-choice-close' tabindex='-1'></a>" +
3055
+ "</li>"),
3056
+ disabledItem = $(
3057
+ "<li class='select2-search-choice select2-locked'>" +
3058
+ "<div></div>" +
3059
+ "</li>");
3060
+ var choice = enableChoice ? enabledItem : disabledItem,
3061
+ id = this.id(data),
3062
+ val = this.getVal(),
3063
+ formatted,
3064
+ cssClass;
3065
+
3066
+ formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup);
3067
+ if (formatted != undefined) {
3068
+ choice.find("div").replaceWith($("<div></div>").html(formatted));
3069
+ }
3070
+ cssClass=this.opts.formatSelectionCssClass(data, choice.find("div"));
3071
+ if (cssClass != undefined) {
3072
+ choice.addClass(cssClass);
3073
+ }
3074
+
3075
+ if(enableChoice){
3076
+ choice.find(".select2-search-choice-close")
3077
+ .on("mousedown", killEvent)
3078
+ .on("click dblclick", this.bind(function (e) {
3079
+ if (!this.isInterfaceEnabled()) return;
3080
+
3081
+ this.unselect($(e.target));
3082
+ this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
3083
+ killEvent(e);
3084
+ this.close();
3085
+ this.focusSearch();
3086
+ })).on("focus", this.bind(function () {
3087
+ if (!this.isInterfaceEnabled()) return;
3088
+ this.container.addClass("select2-container-active");
3089
+ this.dropdown.addClass("select2-drop-active");
3090
+ }));
3091
+ }
3092
+
3093
+ choice.data("select2-data", data);
3094
+ choice.insertBefore(this.searchContainer);
3095
+
3096
+ val.push(id);
3097
+ this.setVal(val);
3098
+ },
3099
+
3100
+ // multi
3101
+ unselect: function (selected) {
3102
+ var val = this.getVal(),
3103
+ data,
3104
+ index;
3105
+ selected = selected.closest(".select2-search-choice");
3106
+
3107
+ if (selected.length === 0) {
3108
+ throw "Invalid argument: " + selected + ". Must be .select2-search-choice";
3109
+ }
3110
+
3111
+ data = selected.data("select2-data");
3112
+
3113
+ if (!data) {
3114
+ // prevent a race condition when the 'x' is clicked really fast repeatedly the event can be queued
3115
+ // and invoked on an element already removed
3116
+ return;
3117
+ }
3118
+
3119
+ var evt = $.Event("select2-removing");
3120
+ evt.val = this.id(data);
3121
+ evt.choice = data;
3122
+ this.opts.element.trigger(evt);
3123
+
3124
+ if (evt.isDefaultPrevented()) {
3125
+ return false;
3126
+ }
3127
+
3128
+ while((index = indexOf(this.id(data), val)) >= 0) {
3129
+ val.splice(index, 1);
3130
+ this.setVal(val);
3131
+ if (this.select) this.postprocessResults();
3132
+ }
3133
+
3134
+ selected.remove();
3135
+
3136
+ this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
3137
+ this.triggerChange({ removed: data });
3138
+
3139
+ return true;
3140
+ },
3141
+
3142
+ // multi
3143
+ postprocessResults: function (data, initial, noHighlightUpdate) {
3144
+ var val = this.getVal(),
3145
+ choices = this.results.find(".select2-result"),
3146
+ compound = this.results.find(".select2-result-with-children"),
3147
+ self = this;
3148
+
3149
+ choices.each2(function (i, choice) {
3150
+ var id = self.id(choice.data("select2-data"));
3151
+ if (indexOf(id, val) >= 0) {
3152
+ choice.addClass("select2-selected");
3153
+ // mark all children of the selected parent as selected
3154
+ choice.find(".select2-result-selectable").addClass("select2-selected");
3155
+ }
3156
+ });
3157
+
3158
+ compound.each2(function(i, choice) {
3159
+ // hide an optgroup if it doesn't have any selectable children
3160
+ if (!choice.is('.select2-result-selectable')
3161
+ && choice.find(".select2-result-selectable:not(.select2-selected)").length === 0) {
3162
+ choice.addClass("select2-selected");
3163
+ }
3164
+ });
3165
+
3166
+ if (this.highlight() == -1 && noHighlightUpdate !== false && this.opts.closeOnSelect === true){
3167
+ self.highlight(0);
3168
+ }
3169
+
3170
+ //If all results are chosen render formatNoMatches
3171
+ if(!this.opts.createSearchChoice && !choices.filter('.select2-result:not(.select2-selected)').length > 0){
3172
+ if(!data || data && !data.more && this.results.find(".select2-no-results").length === 0) {
3173
+ if (checkFormatter(self.opts.formatNoMatches, "formatNoMatches")) {
3174
+ this.results.append("<li class='select2-no-results'>" + evaluate(self.opts.formatNoMatches, self.opts.element, self.search.val()) + "</li>");
3175
+ }
3176
+ }
3177
+ }
3178
+
3179
+ },
3180
+
3181
+ // multi
3182
+ getMaxSearchWidth: function() {
3183
+ return this.selection.width() - getSideBorderPadding(this.search);
3184
+ },
3185
+
3186
+ // multi
3187
+ resizeSearch: function () {
3188
+ var minimumWidth, left, maxWidth, containerLeft, searchWidth,
3189
+ sideBorderPadding = getSideBorderPadding(this.search);
3190
+
3191
+ minimumWidth = measureTextWidth(this.search) + 10;
3192
+
3193
+ left = this.search.offset().left;
3194
+
3195
+ maxWidth = this.selection.width();
3196
+ containerLeft = this.selection.offset().left;
3197
+
3198
+ searchWidth = maxWidth - (left - containerLeft) - sideBorderPadding;
3199
+
3200
+ if (searchWidth < minimumWidth) {
3201
+ searchWidth = maxWidth - sideBorderPadding;
3202
+ }
3203
+
3204
+ if (searchWidth < 40) {
3205
+ searchWidth = maxWidth - sideBorderPadding;
3206
+ }
3207
+
3208
+ if (searchWidth <= 0) {
3209
+ searchWidth = minimumWidth;
3210
+ }
3211
+
3212
+ this.search.width(Math.floor(searchWidth));
3213
+ },
3214
+
3215
+ // multi
3216
+ getVal: function () {
3217
+ var val;
3218
+ if (this.select) {
3219
+ val = this.select.val();
3220
+ return val === null ? [] : val;
3221
+ } else {
3222
+ val = this.opts.element.val();
3223
+ return splitVal(val, this.opts.separator, this.opts.transformVal);
3224
+ }
3225
+ },
3226
+
3227
+ // multi
3228
+ setVal: function (val) {
3229
+ var unique;
3230
+ if (this.select) {
3231
+ this.select.val(val);
3232
+ } else {
3233
+ unique = [];
3234
+ // filter out duplicates
3235
+ $(val).each(function () {
3236
+ if (indexOf(this, unique) < 0) unique.push(this);
3237
+ });
3238
+ this.opts.element.val(unique.length === 0 ? "" : unique.join(this.opts.separator));
3239
+ }
3240
+ },
3241
+
3242
+ // multi
3243
+ buildChangeDetails: function (old, current) {
3244
+ var current = current.slice(0),
3245
+ old = old.slice(0);
3246
+
3247
+ // remove intersection from each array
3248
+ for (var i = 0; i < current.length; i++) {
3249
+ for (var j = 0; j < old.length; j++) {
3250
+ if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
3251
+ current.splice(i, 1);
3252
+ if(i>0){
3253
+ i--;
3254
+ }
3255
+ old.splice(j, 1);
3256
+ j--;
3257
+ }
3258
+ }
3259
+ }
3260
+
3261
+ return {added: current, removed: old};
3262
+ },
3263
+
3264
+
3265
+ // multi
3266
+ val: function (val, triggerChange) {
3267
+ var oldData, self=this;
3268
+
3269
+ if (arguments.length === 0) {
3270
+ return this.getVal();
3271
+ }
3272
+
3273
+ oldData=this.data();
3274
+ if (!oldData.length) oldData=[];
3275
+
3276
+ // val is an id. !val is true for [undefined,null,'',0] - 0 is legal
3277
+ if (!val && val !== 0) {
3278
+ this.opts.element.val("");
3279
+ this.updateSelection([]);
3280
+ this.clearSearch();
3281
+ if (triggerChange) {
3282
+ this.triggerChange({added: this.data(), removed: oldData});
3283
+ }
3284
+ return;
3285
+ }
3286
+
3287
+ // val is a list of ids
3288
+ this.setVal(val);
3289
+
3290
+ if (this.select) {
3291
+ this.opts.initSelection(this.select, this.bind(this.updateSelection));
3292
+ if (triggerChange) {
3293
+ this.triggerChange(this.buildChangeDetails(oldData, this.data()));
3294
+ }
3295
+ } else {
3296
+ if (this.opts.initSelection === undefined) {
3297
+ throw new Error("val() cannot be called if initSelection() is not defined");
3298
+ }
3299
+
3300
+ this.opts.initSelection(this.opts.element, function(data){
3301
+ var ids=$.map(data, self.id);
3302
+ self.setVal(ids);
3303
+ self.updateSelection(data);
3304
+ self.clearSearch();
3305
+ if (triggerChange) {
3306
+ self.triggerChange(self.buildChangeDetails(oldData, self.data()));
3307
+ }
3308
+ });
3309
+ }
3310
+ this.clearSearch();
3311
+ },
3312
+
3313
+ // multi
3314
+ onSortStart: function() {
3315
+ if (this.select) {
3316
+ throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");
3317
+ }
3318
+
3319
+ // collapse search field into 0 width so its container can be collapsed as well
3320
+ this.search.width(0);
3321
+ // hide the container
3322
+ this.searchContainer.hide();
3323
+ },
3324
+
3325
+ // multi
3326
+ onSortEnd:function() {
3327
+
3328
+ var val=[], self=this;
3329
+
3330
+ // show search and move it to the end of the list
3331
+ this.searchContainer.show();
3332
+ // make sure the search container is the last item in the list
3333
+ this.searchContainer.appendTo(this.searchContainer.parent());
3334
+ // since we collapsed the width in dragStarted, we resize it here
3335
+ this.resizeSearch();
3336
+
3337
+ // update selection
3338
+ this.selection.find(".select2-search-choice").each(function() {
3339
+ val.push(self.opts.id($(this).data("select2-data")));
3340
+ });
3341
+ this.setVal(val);
3342
+ this.triggerChange();
3343
+ },
3344
+
3345
+ // multi
3346
+ data: function(values, triggerChange) {
3347
+ var self=this, ids, old;
3348
+ if (arguments.length === 0) {
3349
+ return this.selection
3350
+ .children(".select2-search-choice")
3351
+ .map(function() { return $(this).data("select2-data"); })
3352
+ .get();
3353
+ } else {
3354
+ old = this.data();
3355
+ if (!values) { values = []; }
3356
+ ids = $.map(values, function(e) { return self.opts.id(e); });
3357
+ this.setVal(ids);
3358
+ this.updateSelection(values);
3359
+ this.clearSearch();
3360
+ if (triggerChange) {
3361
+ this.triggerChange(this.buildChangeDetails(old, this.data()));
3362
+ }
3363
+ }
3364
+ }
3365
+ });
3366
+
3367
+ $.fn.select2 = function () {
3368
+
3369
+ var args = Array.prototype.slice.call(arguments, 0),
3370
+ opts,
3371
+ select2,
3372
+ method, value, multiple,
3373
+ allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "disable", "readonly", "positionDropdown", "data", "search"],
3374
+ valueMethods = ["opened", "isFocused", "container", "dropdown"],
3375
+ propertyMethods = ["val", "data"],
3376
+ methodsMap = { search: "externalSearch" };
3377
+
3378
+ this.each(function () {
3379
+ if (args.length === 0 || typeof(args[0]) === "object") {
3380
+ opts = args.length === 0 ? {} : $.extend({}, args[0]);
3381
+ opts.element = $(this);
3382
+
3383
+ if (opts.element.get(0).tagName.toLowerCase() === "select") {
3384
+ multiple = opts.element.prop("multiple");
3385
+ } else {
3386
+ multiple = opts.multiple || false;
3387
+ if ("tags" in opts) {opts.multiple = multiple = true;}
3388
+ }
3389
+
3390
+ select2 = multiple ? new window.Select2["class"].multi() : new window.Select2["class"].single();
3391
+ select2.init(opts);
3392
+ } else if (typeof(args[0]) === "string") {
3393
+
3394
+ if (indexOf(args[0], allowedMethods) < 0) {
3395
+ throw "Unknown method: " + args[0];
3396
+ }
3397
+
3398
+ value = undefined;
3399
+ select2 = $(this).data("select2");
3400
+ if (select2 === undefined) return;
3401
+
3402
+ method=args[0];
3403
+
3404
+ if (method === "container") {
3405
+ value = select2.container;
3406
+ } else if (method === "dropdown") {
3407
+ value = select2.dropdown;
3408
+ } else {
3409
+ if (methodsMap[method]) method = methodsMap[method];
3410
+
3411
+ value = select2[method].apply(select2, args.slice(1));
3412
+ }
3413
+ if (indexOf(args[0], valueMethods) >= 0
3414
+ || (indexOf(args[0], propertyMethods) >= 0 && args.length == 1)) {
3415
+ return false; // abort the iteration, ready to return first matched value
3416
+ }
3417
+ } else {
3418
+ throw "Invalid arguments to select2 plugin: " + args;
3419
+ }
3420
+ });
3421
+ return (value === undefined) ? this : value;
3422
+ };
3423
+
3424
+ // plugin defaults, accessible to users
3425
+ $.fn.select2.defaults = {
3426
+ width: "copy",
3427
+ loadMorePadding: 0,
3428
+ closeOnSelect: true,
3429
+ openOnEnter: true,
3430
+ containerCss: {},
3431
+ dropdownCss: {},
3432
+ containerCssClass: "",
3433
+ dropdownCssClass: "",
3434
+ formatResult: function(result, container, query, escapeMarkup) {
3435
+ var markup=[];
3436
+ markMatch(this.text(result), query.term, markup, escapeMarkup);
3437
+ return markup.join("");
3438
+ },
3439
+ transformVal: function(val) {
3440
+ return $.trim(val);
3441
+ },
3442
+ formatSelection: function (data, container, escapeMarkup) {
3443
+ return data ? escapeMarkup(this.text(data)) : undefined;
3444
+ },
3445
+ sortResults: function (results, container, query) {
3446
+ return results;
3447
+ },
3448
+ formatResultCssClass: function(data) {return data.css;},
3449
+ formatSelectionCssClass: function(data, container) {return undefined;},
3450
+ minimumResultsForSearch: 0,
3451
+ minimumInputLength: 0,
3452
+ maximumInputLength: null,
3453
+ maximumSelectionSize: 0,
3454
+ id: function (e) { return e == undefined ? null : e.id; },
3455
+ text: function (e) {
3456
+ if (e && this.data && this.data.text) {
3457
+ if ($.isFunction(this.data.text)) {
3458
+ return this.data.text(e);
3459
+ } else {
3460
+ return e[this.data.text];
3461
+ }
3462
+ } else {
3463
+ return e.text;
3464
+ }
3465
+ },
3466
+ matcher: function(term, text) {
3467
+ return stripDiacritics(''+text).toUpperCase().indexOf(stripDiacritics(''+term).toUpperCase()) >= 0;
3468
+ },
3469
+ separator: ",",
3470
+ tokenSeparators: [],
3471
+ tokenizer: defaultTokenizer,
3472
+ escapeMarkup: defaultEscapeMarkup,
3473
+ blurOnChange: false,
3474
+ selectOnBlur: false,
3475
+ adaptContainerCssClass: function(c) { return c; },
3476
+ adaptDropdownCssClass: function(c) { return null; },
3477
+ nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; },
3478
+ searchInputPlaceholder: '',
3479
+ createSearchChoicePosition: 'top',
3480
+ shouldFocusInput: function (instance) {
3481
+ // Attempt to detect touch devices
3482
+ var supportsTouchEvents = (('ontouchstart' in window) ||
3483
+ (navigator.msMaxTouchPoints > 0));
3484
+
3485
+ // Only devices which support touch events should be special cased
3486
+ if (!supportsTouchEvents) {
3487
+ return true;
3488
+ }
3489
+
3490
+ // Never focus the input if search is disabled
3491
+ if (instance.opts.minimumResultsForSearch < 0) {
3492
+ return false;
3493
+ }
3494
+
3495
+ return true;
3496
+ }
3497
+ };
3498
+
3499
+ $.fn.select2.locales = [];
3500
+
3501
+ $.fn.select2.locales['en'] = {
3502
+ formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; },
3503
+ formatNoMatches: function () { return "No matches found"; },
3504
+ formatAjaxError: function (jqXHR, textStatus, errorThrown) { return "Loading failed"; },
3505
+ formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); },
3506
+ formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); },
3507
+ formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
3508
+ formatLoadMore: function (pageNumber) { return "Loading more results…"; },
3509
+ formatSearching: function () { return "Searching…"; }
3510
+ };
3511
+
3512
+ $.extend($.fn.select2.defaults, $.fn.select2.locales['en']);
3513
+
3514
+ $.fn.select2.ajaxDefaults = {
3515
+ transport: $.ajax,
3516
+ params: {
3517
+ type: "GET",
3518
+ cache: false,
3519
+ dataType: "json"
3520
+ }
3521
+ };
3522
+
3523
+ // exports
3524
+ window.Select2 = {
3525
+ query: {
3526
+ ajax: ajax,
3527
+ local: local,
3528
+ tags: tags
3529
+ }, util: {
3530
+ debounce: debounce,
3531
+ markMatch: markMatch,
3532
+ escapeMarkup: defaultEscapeMarkup,
3533
+ stripDiacritics: stripDiacritics
3534
+ }, "class": {
3535
+ "abstract": AbstractSelect2,
3536
+ "single": SingleSelect2,
3537
+ "multi": MultiSelect2
3538
+ }
3539
+ };
3540
+
3541
+ }(jQuery));
trunk/classes/admin/settings/assets/js/select2/select2.min.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Copyright 2014 Igor Vaynberg
3
+
4
+ Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
5
+
6
+ This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
7
+ General Public License version 2 (the "GPL License"). You may choose either license to govern your
8
+ use of this software only upon the condition that you accept all of the terms of either the Apache
9
+ License or the GPL License.
10
+
11
+ You may obtain a copy of the Apache License and the GPL License at:
12
+
13
+ http://www.apache.org/licenses/LICENSE-2.0
14
+ http://www.gnu.org/licenses/gpl-2.0.html
15
+
16
+ Unless required by applicable law or agreed to in writing, software distributed under the Apache License
17
+ or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
18
+ either express or implied. See the Apache License and the GPL License for the specific language governing
19
+ permissions and limitations under the Apache License and the GPL License.
20
+ */
21
+ !function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(b){for(var c=a([0]),d=-1,e=this.length;++d<e&&(c.context=c[0]=this[d])&&b.call(c[0],d,c)!==!1;);return this}})}(jQuery),function(a,b){"use strict";function n(b){var c=a(document.createTextNode(""));b.before(c),c.before(b),c.remove()}function o(a){function b(a){return m[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function p(a,b){for(var c=0,d=b.length;d>c;c+=1)if(r(a,b[c]))return c;return-1}function q(){var b=a(l);b.appendTo(document.body);var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function r(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function s(a,b,c){var d,e,f;if(null===a||a.length<1)return[];for(d=a.split(b),e=0,f=d.length;f>e;e+=1)d[e]=c(d[e]);return d}function t(a){return a.outerWidth(!1)-a.width()}function u(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function v(c){c.on("mousemove",function(c){var d=h;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function w(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function x(a,b){var c=w(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){p(a.target,b.get())>=0&&c(a)})}function y(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus();var e=b.offsetWidth>0||b.offsetHeight>0;e&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function z(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function A(a){a.preventDefault(),a.stopPropagation()}function B(a){a.preventDefault(),a.stopImmediatePropagation()}function C(b){if(!g){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);g=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),g.attr("class","select2-sizer"),a(document.body).append(g)}return g.text(b.val()),g.width()}function D(b,c,d){var e,g,f=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(g))})),b.attr("class",f.join(" "))}function E(a,b,c,d){var e=o(a.toUpperCase()).indexOf(o(b.toUpperCase())),f=b.length;return 0>e?(c.push(d(a)),void 0):(c.push(d(a.substring(0,e))),c.push("<span class='select2-match'>"),c.push(d(a.substring(e,e+f))),c.push("</span>"),c.push(d(a.substring(e+f,a.length))),void 0)}function F(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function G(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&"function"==typeof e.abort&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{url:f,dataType:c.dataType,data:d,success:function(a){var b=c.results(a,i.page,i);i.callback(b)},error:function(a,b,c){var d={hasError:!0,jqXHR:a,textStatus:b,errorThrown:c};i.callback(d)}}),e=j.call(h,l)},f)}}function H(b){var d,e,c=b,f=function(a){return""+a.text};a.isArray(c)&&(e=c,c={results:e}),a.isFunction(c)===!1&&(e=c,c=function(){return e});var g=c();return g.text&&(f=g.text,a.isFunction(f)||(d=g.text,f=function(a){return a[d]})),function(b){var g,d=b.term,e={results:[]};return""===d?(b.callback(c()),void 0):(g=function(c,e){var h,i;if(c=c[0],c.children){h={};for(i in c)c.hasOwnProperty(i)&&(h[i]=c[i]);h.children=[],a(c.children).each2(function(a,b){g(b,h.children)}),(h.children.length||b.matcher(d,f(h),c))&&e.push(h)}else b.matcher(d,f(c),c)&&e.push(c)},a(c().results).each2(function(a,b){g(b,e.results)}),b.callback(e),void 0)}}function I(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]},h=d?c(e):c;a.isArray(h)&&(a(h).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g))}}function J(b,c){if(a.isFunction(b))return!0;if(!b)return!1;if("string"==typeof b)return!0;throw new Error(c+" must be a string, function, or falsy value")}function K(b,c){if(a.isFunction(b)){var d=Array.prototype.slice.call(arguments,2);return b.apply(c,d)}return b}function L(b){var c=0;return a.each(b,function(a,b){b.children?c+=L(b.children):c++}),c}function M(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(r(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:void 0}function N(){var b=this;a.each(arguments,function(a,c){b[c].remove(),b[c]=null})}function O(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,i,j,h={x:0,y:0},k={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case k.LEFT:case k.RIGHT:case k.UP:case k.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case k.SHIFT:case k.CTRL:case k.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="<div class='select2-measure-scrollbar'></div>",m={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};i=a(document),f=function(){var a=1;return function(){return a++}}(),c=O(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,g=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=a(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=a("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+f()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",c.element.attr("title")),this.body=a(document.body),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(K(c.containerCss,this.opts.element)),this.container.addClass(K(c.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",A),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(c.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",A),this.results=d=this.container.find(g),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",A),v(this.results),this.dropdown.on("mousemove-filtered",g,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",g,this.bind(function(a){this._touchEvent=!0,this.highlightUnderEvent(a)})),this.dropdown.on("touchmove",g,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",g,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),x(80,this.results),this.dropdown.on("scroll-debounced",g,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),A(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),A(a))}),u(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",g,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(a){a.stopPropagation()}),this.nextSearchTerm=b,a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),j=j||q(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",c.searchInputPlaceholder)},destroy:function(){var a=this.opts.element,c=a.data("select2"),d=this;this.close(),a.length&&a[0].detachEvent&&d._sync&&a.each(function(){d._sync&&this.detachEvent("onpropertychange",d._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,c!==b&&(c.container.remove(),c.liveRegion.remove(),c.dropdown.remove(),a.show().removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show()),N.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:r(a.attr("locked"),"locked")||r(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:void 0},prepareOpts:function(c){var d,e,g,h,i=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),c=a.extend({},{populateResults:function(d,e,g){var h,j=this.opts.id,k=this.liveRegion;h=function(d,e,l){var m,n,o,p,q,r,s,t,u,v;d=c.sortResults(d,e,g);var w=[];for(m=0,n=d.length;n>m;m+=1)o=d[m],q=o.disabled===!0,p=!q&&j(o)!==b,r=o.children&&o.children.length>0,s=a("<li></li>"),s.addClass("select2-results-dept-"+l),s.addClass("select2-result"),s.addClass(p?"select2-result-selectable":"select2-result-unselectable"),q&&s.addClass("select2-disabled"),r&&s.addClass("select2-result-with-children"),s.addClass(i.opts.formatResultCssClass(o)),s.attr("role","presentation"),t=a(document.createElement("div")),t.addClass("select2-result-label"),t.attr("id","select2-result-label-"+f()),t.attr("role","option"),v=c.formatResult(o,t,g,i.opts.escapeMarkup),v!==b&&(t.html(v),s.append(t)),r&&(u=a("<ul></ul>"),u.addClass("select2-result-sub"),h(o.children,u,l+1),s.append(u)),s.data("select2-data",o),w.push(s[0]);e.append(w),k.text(c.formatMatches(d.length))},h(e,d,0)}},a.fn.select2.defaults,c),"function"!=typeof c.id&&(g=c.id,c.id=function(a){return a[g]}),a.isArray(c.element.data("select2Tags"))){if("tags"in c)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+c.element.attr("id");c.tags=c.element.data("select2Tags")}if(e?(c.query=this.bind(function(a){var f,g,h,c={results:[],more:!1},e=a.term;h=function(b,c){var d;b.is("option")?a.matcher(e,b.text(),b)&&c.push(i.optionToData(b)):b.is("optgroup")&&(d=i.optionToData(b),b.children().each2(function(a,b){h(b,d.children)}),d.children.length>0&&c.push(d))},f=d.children(),this.getPlaceholder()!==b&&f.length>0&&(g=this.getPlaceholderOption(),g&&(f=f.not(g))),f.each2(function(a,b){h(b,c.results)}),a.callback(c)}),c.id=function(a){return a.id}):"query"in c||("ajax"in c?(h=c.element.data("ajax-url"),h&&h.length>0&&(c.ajax.url=h),c.query=G.call(c.element,c.ajax)):"data"in c?c.query=H(c.data):"tags"in c&&(c.query=I(c.tags),c.createSearchChoice===b&&(c.createSearchChoice=function(b){return{id:a.trim(b),text:a.trim(b)}}),c.initSelection===b&&(c.initSelection=function(b,d){var e=[];a(s(b.val(),c.separator,c.transformVal)).each(function(){var b={id:this,text:this},d=c.tags;a.isFunction(d)&&(d=d()),a(d).each(function(){return r(this.id,b.id)?(b=this,!1):void 0}),e.push(b)}),d(e)}))),"function"!=typeof c.query)throw"query function not defined for Select2 "+c.element.attr("id");if("top"===c.createSearchChoicePosition)c.createSearchChoicePosition=function(a,b){a.unshift(b)};else if("bottom"===c.createSearchChoicePosition)c.createSearchChoicePosition=function(a,b){a.push(b)};else if("function"!=typeof c.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return c},monitorSource:function(){var d,c=this.opts.element,e=this;c.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),this._sync=this.bind(function(){var a=c.prop("disabled");a===b&&(a=!1),this.enable(!a);var d=c.prop("readonly");d===b&&(d=!1),this.readonly(d),this.container&&(D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(K(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(this.opts.dropdownCssClass,this.opts.element)))}),c.length&&c[0].attachEvent&&c.each(function(){this.attachEvent("onpropertychange",e._sync)}),d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,d!==b&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new d(function(b){a.each(b,e._sync)}),this.propertyObserver.observe(c.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(b){var c=a.Event("select2-selecting",{val:this.id(b),object:b,choice:b});return this.opts.element.trigger(c),!c.isDefaultPrevented()},triggerChange:function(b){b=b||{},b=a.extend({},b,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(b),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var a=this._enabled&&!this._readonly,b=!a;return a===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",b),this.close(),this.enabledInterface=a,!0)},enable:function(a){a===b&&(a=!0),this._enabled!==a&&(this._enabled=a,this.opts.element.prop("disabled",!a),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(a){a===b&&(a=!1),this._readonly!==a&&(this._readonly=a,this.opts.element.prop("readonly",a),this.enableInterface())},opened:function(){return this.container?this.container.hasClass("select2-dropdown-open"):!1},positionDropdown:function(){var v,w,x,y,z,b=this.dropdown,c=this.container,d=c.offset(),e=c.outerHeight(!1),f=c.outerWidth(!1),g=b.outerHeight(!1),h=a(window),i=h.width(),k=h.height(),l=h.scrollLeft()+i,m=h.scrollTop()+k,n=d.top+e,o=d.left,p=m>=n+g,q=d.top-g>=h.scrollTop(),r=b.outerWidth(!1),s=function(){return l>=o+r},t=function(){return d.left+l+c.outerWidth(!1)>r},u=b.hasClass("select2-drop-above");u?(w=!0,!q&&p&&(x=!0,w=!1)):(w=!1,!p&&q&&(x=!0,w=!0)),x&&(b.hide(),d=this.container.offset(),e=this.container.outerHeight(!1),f=this.container.outerWidth(!1),g=b.outerHeight(!1),l=h.scrollLeft()+i,m=h.scrollTop()+k,n=d.top+e,o=d.left,r=b.outerWidth(!1),b.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(z=a(".select2-results",b)[0],b.addClass("select2-drop-auto-width"),b.css("width",""),r=b.outerWidth(!1)+(z.scrollHeight===z.clientHeight?0:j.width),r>f?f=r:r=f,g=b.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(v=this.body.offset(),n-=v.top,o-=v.left),!s()&&t()&&(o=d.left+this.container.outerWidth(!1)-r),y={left:o,width:f},w?(y.top=d.top-g,y.bottom="auto",this.container.addClass("select2-drop-above"),b.addClass("select2-drop-above")):(y.top=n,y.bottom="auto",this.container.removeClass("select2-drop-above"),b.removeClass("select2-drop-above")),y=a.extend(y,K(this.opts.dropdownCss,this.opts.element)),b.css(y)},shouldOpen:function(){var b;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(b=a.Event("select2-opening"),this.opts.element.trigger(b),!b.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),i.on("mousemove.select2Event",function(a){h.x=a.pageX,h.y=a.pageY}),!0):!1},opening:function(){var f,b=this.containerEventName,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),f=a("#select2-drop-mask"),0===f.length&&(f=a(document.createElement("div")),f.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),f.hide(),f.appendTo(this.body),f.on("mousedown touchstart click",function(b){n(f);var d,c=a("#select2-drop");c.length>0&&(d=c.data("select2"),d.opts.selectOnBlur&&d.selectHighlighted({noFocus:!0}),d.close(),b.preventDefault(),b.stopPropagation())})),this.dropdown.prev()[0]!==f[0]&&this.dropdown.before(f),a("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),f.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var g=this;this.container.parents().add(window).each(function(){a(this).on(d+" "+c+" "+e,function(){g.opened()&&g.positionDropdown()})})},close:function(){if(this.opened()){var b=this.containerEventName,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.parents().add(window).each(function(){a(this).off(c).off(d).off(e)}),this.clearDropdownAlignmentPreference(),a("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),i.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(a.Event("select2-close"))}},externalSearch:function(a){this.open(),this.search.val(a),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return K(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var c,d,e,f,g,h,i,j,b=this.results;if(d=this.highlight(),!(0>d)){if(0==d)return b.scrollTop(0),void 0;c=this.findHighlightableChoices().find(".select2-result-label"),e=a(c[d]),j=(e.offset()||{}).top||0,f=j+e.outerHeight(!0),d===c.length-1&&(i=b.find("li.select2-more-results"),i.length>0&&(f=i.offset().top+i.outerHeight(!0))),g=b.offset().top+b.outerHeight(!1),f>g&&b.scrollTop(b.scrollTop()+(f-g)),h=j-b.offset().top,0>h&&"none"!=e.css("display")&&b.scrollTop(b.scrollTop()+h)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(b){for(var c=this.findHighlightableChoices(),d=this.highlight();d>-1&&d<c.length;){d+=b;
22
+ var e=a(c[d]);if(e.hasClass("select2-result-selectable")&&!e.hasClass("select2-disabled")&&!e.hasClass("select2-selected")){this.highlight(d);break}}},highlight:function(b){var d,e,c=this.findHighlightableChoices();return 0===arguments.length?p(c.filter(".select2-highlighted")[0],c.get()):(b>=c.length&&(b=c.length-1),0>b&&(b=0),this.removeHighlight(),d=a(c[b]),d.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",d.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(d.text()),e=d.data("select2-data"),e&&this.opts.element.trigger({type:"select2-highlight",val:this.id(e),choice:e}),void 0)},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(b){var c=a(b.target).closest(".select2-result-selectable");if(c.length>0&&!c.is(".select2-highlighted")){var d=this.findHighlightableChoices();this.highlight(d.index(c))}else 0==c.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var c,a=this.results,b=a.find("li.select2-more-results"),d=this.resultsPage+1,e=this,f=this.search.val(),g=this.context;0!==b.length&&(c=b.offset().top-a.offset().top-a.height(),c<=this.opts.loadMorePadding&&(b.addClass("select2-active"),this.opts.query({element:this.opts.element,term:f,page:d,context:g,matcher:this.opts.matcher,callback:this.bind(function(c){e.opened()&&(e.opts.populateResults.call(this,a,c.results,{term:f,page:d,context:g}),e.postprocessResults(c,!1,!1),c.more===!0?(b.detach().appendTo(a).html(e.opts.escapeMarkup(K(e.opts.formatLoadMore,e.opts.element,d+1))),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):b.remove(),e.positionDropdown(),e.resultsPage=d,e.context=c.context,this.opts.element.trigger({type:"select2-loaded",items:c}))})})))},tokenize:function(){},updateResults:function(c){function m(){d.removeClass("select2-active"),h.positionDropdown(),e.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?h.liveRegion.text(e.text()):h.liveRegion.text(h.opts.formatMatches(e.find('.select2-result-selectable:not(".select2-selected")').length))}function n(a){e.html(a),m()}var g,i,l,d=this.search,e=this.results,f=this.opts,h=this,j=d.val(),k=a.data(this.container,"select2-last-term");if((c===!0||!k||!r(j,k))&&(a.data(this.container,"select2-last-term",j),c===!0||this.showSearchInput!==!1&&this.opened())){l=++this.queryCount;var o=this.getMaximumSelectionSize();if(o>=1&&(g=this.data(),a.isArray(g)&&g.length>=o&&J(f.formatSelectionTooBig,"formatSelectionTooBig")))return n("<li class='select2-selection-limit'>"+K(f.formatSelectionTooBig,f.element,o)+"</li>"),void 0;if(d.val().length<f.minimumInputLength)return J(f.formatInputTooShort,"formatInputTooShort")?n("<li class='select2-no-results'>"+K(f.formatInputTooShort,f.element,d.val(),f.minimumInputLength)+"</li>"):n(""),c&&this.showSearch&&this.showSearch(!0),void 0;if(f.maximumInputLength&&d.val().length>f.maximumInputLength)return J(f.formatInputTooLong,"formatInputTooLong")?n("<li class='select2-no-results'>"+K(f.formatInputTooLong,f.element,d.val(),f.maximumInputLength)+"</li>"):n(""),void 0;f.formatSearching&&0===this.findHighlightableChoices().length&&n("<li class='select2-searching'>"+K(f.formatSearching,f.element)+"</li>"),d.addClass("select2-active"),this.removeHighlight(),i=this.tokenize(),i!=b&&null!=i&&d.val(i),this.resultsPage=1,f.query({element:f.element,term:d.val(),page:this.resultsPage,context:null,matcher:f.matcher,callback:this.bind(function(g){var i;if(l==this.queryCount){if(!this.opened())return this.search.removeClass("select2-active"),void 0;if(g.hasError!==b&&J(f.formatAjaxError,"formatAjaxError"))return n("<li class='select2-ajax-error'>"+K(f.formatAjaxError,f.element,g.jqXHR,g.textStatus,g.errorThrown)+"</li>"),void 0;if(this.context=g.context===b?null:g.context,this.opts.createSearchChoice&&""!==d.val()&&(i=this.opts.createSearchChoice.call(h,d.val(),g.results),i!==b&&null!==i&&h.id(i)!==b&&null!==h.id(i)&&0===a(g.results).filter(function(){return r(h.id(this),h.id(i))}).length&&this.opts.createSearchChoicePosition(g.results,i)),0===g.results.length&&J(f.formatNoMatches,"formatNoMatches"))return n("<li class='select2-no-results'>"+K(f.formatNoMatches,f.element,d.val())+"</li>"),void 0;e.empty(),h.opts.populateResults.call(this,e,g.results,{term:d.val(),page:this.resultsPage,context:null}),g.more===!0&&J(f.formatLoadMore,"formatLoadMore")&&(e.append("<li class='select2-more-results'>"+f.escapeMarkup(K(f.formatLoadMore,f.element,this.resultsPage))+"</li>"),window.setTimeout(function(){h.loadMoreIfNeeded()},10)),this.postprocessResults(g,c),m(),this.opts.element.trigger({type:"select2-loaded",items:g})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){y(this.search)},selectHighlighted:function(a){if(this._touchMoved)return this.clearTouchMoved(),void 0;var b=this.highlight(),c=this.results.find(".select2-highlighted"),d=c.closest(".select2-result").data("select2-data");d?(this.highlight(b),this.onSelect(d,a)):a&&a.noFocus&&this.close()},getPlaceholder:function(){var a;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((a=this.getPlaceholderOption())!==b?a.text():b)},getPlaceholderOption:function(){if(this.select){var c=this.select.children("option").first();if(this.opts.placeholderOption!==b)return"first"===this.opts.placeholderOption&&c||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===a.trim(c.text())&&""===c.val())return c}},initContainerWidth:function(){function c(){var c,d,e,f,g,h;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(c=this.opts.element.attr("style"),c!==b)for(d=c.split(";"),f=0,g=d.length;g>f;f+=1)if(h=d[f].replace(/\s/g,""),e=h.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==e&&e.length>=1)return e[1];return"resolve"===this.opts.width?(c=this.opts.element.css("width"),c.indexOf("%")>0?c:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return a.isFunction(this.opts.width)?this.opts.width():this.opts.width}var d=c.call(this);null!==d&&this.container.css("width",d)}}),d=O(c,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var c,d,e;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),c=this.search.get(0),c.createTextRange?(d=c.createTextRange(),d.collapse(!1),d.select()):c.setSelectionRange&&(e=this.search.val().length,c.setSelectionRange(e,e))),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"selection","focusser")},initContainer:function(){var b,g,c=this.container,d=this.dropdown,e=f();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=b=c.find(".select2-choice"),this.focusser=c.find(".select2-focusser"),b.find(".select2-chosen").attr("id","select2-chosen-"+e),this.focusser.attr("aria-labelledby","select2-chosen-"+e),this.results.attr("id","select2-results-"+e),this.search.attr("aria-owns","select2-results-"+e),this.focusser.attr("id","s2id_autogen"+e),g=a("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.focus(this.bind(function(){this.focus()})),this.focusser.prev().text(g.text()).attr("for",this.focusser.attr("id"));var h=this.opts.element.attr("title");this.opts.element.attr("title",h||g.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(a("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&229!=a.keyCode){if(a.which===k.PAGE_UP||a.which===k.PAGE_DOWN)return A(a),void 0;switch(a.which){case k.UP:case k.DOWN:return this.moveHighlight(a.which===k.UP?-1:1),A(a),void 0;case k.ENTER:return this.selectHighlighted(),A(a),void 0;case k.TAB:return this.selectHighlighted({noFocus:!0}),void 0;case k.ESC:return this.cancel(a),A(a),void 0}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==k.TAB&&!k.isControl(a)&&!k.isFunctionKey(a)&&a.which!==k.ESC){if(this.opts.openOnEnter===!1&&a.which===k.ENTER)return A(a),void 0;if(a.which==k.DOWN||a.which==k.UP||a.which==k.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),A(a),void 0}return a.which==k.DELETE||a.which==k.BACKSPACE?(this.opts.allowClear&&this.clear(),A(a),void 0):void 0}})),u(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown touchstart","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),B(a),this.close(),this.selection&&this.selection.focus())})),b.on("mousedown touchstart",this.bind(function(c){n(b),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),A(c)})),d.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),b.on("focus",this.bind(function(a){A(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.setPlaceholder(),c.nextSearchTerm=c.opts.nextSearchTerm(a,c.search.val()))})}},isPlaceholderOptionSelected:function(){var a;return this.getPlaceholder()===b?!1:(a=this.getPlaceholderOption())!==b&&a.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val()},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find("option").filter(function(){return this.selected&&!this.disabled});b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var g=r(e,b.id(d));return g&&(f=d),g},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return r(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&(b===!0&&d>=0?this.highlight(d):this.highlight(0)),b===!0){var g=this.opts.minimumResultsForSearch;g>=0&&this.showSearch(L(a.results)>=g)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.close(),b&&b.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),r(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var d,e,c=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),c.empty(),null!==a&&(d=this.opts.formatSelection(a,c,this.opts.escapeMarkup)),d!==b&&c.append(d),e=this.opts.formatSelectionCssClass(a,c),e!==b&&c.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find("option").filter(function(){return this.selected}).each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({added:d,removed:f});else{if(!a&&0!==a)return this.clear(c),void 0;if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({added:a,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(a){var c,d=!1;return 0===arguments.length?(c=this.selection.data("select2-data"),c==b&&(c=null),c):(arguments.length>1&&(d=arguments[1]),a?(c=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),d&&this.triggerChange({added:a,removed:c})):this.clear(d),void 0)}}),e=O(c,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=s(c.val(),b.separator,b.transformVal),f=[];b.query({matcher:function(c,d,g){var h=a.grep(e,function(a){return r(a,b.id(g))}).length;return h&&f.push(g),h},callback:a.isFunction(d)?function(){for(var a=[],c=0;c<e.length;c++)for(var g=e[c],h=0;h<f.length;h++){var i=f[h];if(r(g,b.id(i))){a.push(i),f.splice(h,1);break}}d(a)}:a.noop})}),b},selectChoice:function(a){var b=this.container.find(".select2-search-choice-focus");b.length&&a&&a[0]==b[0]||(b.length&&this.opts.element.trigger("choice-deselected",b),b.removeClass("select2-search-choice-focus"),a&&a.length&&(this.close(),a.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",a)))},destroy:function(){a("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"searchContainer","selection")},initContainer:function(){var c,b=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=c=this.container.find(b);var d=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(){d.search[0].focus(),d.selectChoice(a(this))}),this.search.attr("id","s2id_autogen"+f()),this.search.prev().text(a("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.opts.element.focus(this.bind(function(){this.focus()})),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){++this.keydowns;var b=c.find(".select2-search-choice-focus"),d=b.prev(".select2-search-choice:not(.select2-locked)"),e=b.next(".select2-search-choice:not(.select2-locked)"),f=z(this.search);if(b.length&&(a.which==k.LEFT||a.which==k.RIGHT||a.which==k.BACKSPACE||a.which==k.DELETE||a.which==k.ENTER)){var g=b;return a.which==k.LEFT&&d.length?g=d:a.which==k.RIGHT?g=e.length?e:null:a.which===k.BACKSPACE?this.unselect(b.first())&&(this.search.width(10),g=d.length?d:e):a.which==k.DELETE?this.unselect(b.first())&&(this.search.width(10),g=e.length?e:null):a.which==k.ENTER&&(g=null),this.selectChoice(g),A(a),g&&g.length||this.open(),void 0}if((a.which===k.BACKSPACE&&1==this.keydowns||a.which==k.LEFT)&&0==f.offset&&!f.length)return this.selectChoice(c.find(".select2-search-choice:not(.select2-locked)").last()),A(a),void 0;if(this.selectChoice(null),this.opened())switch(a.which){case k.UP:case k.DOWN:return this.moveHighlight(a.which===k.UP?-1:1),A(a),void 0;case k.ENTER:return this.selectHighlighted(),A(a),void 0;case k.TAB:return this.selectHighlighted({noFocus:!0}),this.close(),void 0;case k.ESC:return this.cancel(a),A(a),void 0}if(a.which!==k.TAB&&!k.isControl(a)&&!k.isFunctionKey(a)&&a.which!==k.BACKSPACE&&a.which!==k.ESC){if(a.which===k.ENTER){if(this.opts.openOnEnter===!1)return;if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return}this.open(),(a.which===k.PAGE_UP||a.which===k.PAGE_DOWN)&&A(a),a.which===k.ENTER&&A(a)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(b){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),b.stopImmediatePropagation(),this.opts.element.trigger(a.Event("select2-blur"))})),this.container.on("click",b,this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",b,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c=[],d=[],e=this;a(b).each(function(){p(e.id(this),c)<0&&(c.push(e.id(this)),d.push(this))}),b=d,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){e.addSelectedChoice(this)}),e.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,c){this.triggerSelect(a)&&""!==a.text&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),c&&c.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(c){var j,k,d=!c.locked,e=a("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),f=a("<li class='select2-search-choice select2-locked'><div></div></li>"),g=d?e:f,h=this.id(c),i=this.getVal();j=this.opts.formatSelection(c,g.find("div"),this.opts.escapeMarkup),j!=b&&g.find("div").replaceWith(a("<div></div>").html(j)),k=this.opts.formatSelectionCssClass(c,g.find("div")),k!=b&&g.addClass(k),d&&g.find(".select2-search-choice-close").on("mousedown",A).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),A(b),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),g.data("select2-data",c),g.insertBefore(this.searchContainer),i.push(h),this.setVal(i)},unselect:function(b){var d,e,c=this.getVal();if(b=b.closest(".select2-search-choice"),0===b.length)throw"Invalid argument: "+b+". Must be .select2-search-choice";if(d=b.data("select2-data")){var f=a.Event("select2-removing");if(f.val=this.id(d),f.choice=d,this.opts.element.trigger(f),f.isDefaultPrevented())return!1;for(;(e=p(this.id(d),c))>=0;)c.splice(e,1),this.setVal(c),this.select&&this.postprocessResults();return b.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(d),choice:d}),this.triggerChange({removed:d}),!0}},postprocessResults:function(a,b,c){var d=this.getVal(),e=this.results.find(".select2-result"),f=this.results.find(".select2-result-with-children"),g=this;e.each2(function(a,b){var c=g.id(b.data("select2-data"));p(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),f.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&this.opts.closeOnSelect===!0&&g.highlight(0),!this.opts.createSearchChoice&&!e.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&J(g.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+K(g.opts.formatNoMatches,g.opts.element,g.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-t(this.search)},resizeSearch:function(){var a,b,c,d,e,f=t(this.search);a=C(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),s(a,this.opts.separator,this.opts.transformVal))},setVal:function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){p(this,c)<0&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c<b.length;c++)for(var d=0;d<a.length;d++)r(this.opts.id(b[c]),this.opts.id(a[d]))&&(b.splice(c,1),c>0&&c--,a.splice(d,1),d--);return{added:b,removed:a}},val:function(c,d){var e,f=this;if(0===arguments.length)return this.getVal();if(e=this.data(),e.length||(e=[]),!c&&0!==c)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),d&&this.triggerChange({added:this.data(),removed:e}),void 0;if(this.setVal(c),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),d&&this.triggerChange(this.buildChangeDetails(e,this.data()));else{if(this.opts.initSelection===b)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(b){var c=a.map(b,f.id);f.setVal(c),f.updateSelection(b),f.clearSearch(),d&&f.triggerChange(f.buildChangeDetails(e,f.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(b,c){var e,f,d=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(f=this.data(),b||(b=[]),e=a.map(b,function(a){return d.opts.id(a)}),this.setVal(e),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(f,this.data())),void 0)}}),a.fn.select2=function(){var d,e,f,g,h,c=Array.prototype.slice.call(arguments,0),i=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],j=["opened","isFocused","container","dropdown"],k=["val","data"],l={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])d=0===c.length?{}:a.extend({},c[0]),d.element=a(this),"select"===d.element.get(0).tagName.toLowerCase()?h=d.element.prop("multiple"):(h=d.multiple||!1,"tags"in d&&(d.multiple=h=!0)),e=h?new window.Select2["class"].multi:new window.Select2["class"].single,e.init(d);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(p(c[0],i)<0)throw"Unknown method: "+c[0];if(g=b,e=a(this).data("select2"),e===b)return;if(f=c[0],"container"===f?g=e.container:"dropdown"===f?g=e.dropdown:(l[f]&&(f=l[f]),g=e[f].apply(e,c.slice(1))),p(c[0],j)>=0||p(c[0],k)>=0&&1==c.length)return!1}}),g===b?this:g},a.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return E(this.text(a),c.term,e,d),e.join("")},transformVal:function(b){return a.trim(b)},formatSelection:function(a,c,d){return a?d(this.text(a)):b},sortResults:function(a){return a},formatResultCssClass:function(a){return a.css},formatSelectionCssClass:function(){return b},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a==b?null:a.id},text:function(b){return b&&this.data&&this.data.text?a.isFunction(this.data.text)?this.data.text(b):b[this.data.text]:b.text
23
+ },matcher:function(a,b){return o(""+b).toUpperCase().indexOf(o(""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:F,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return b},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(a){var b="ontouchstart"in window||navigator.msMaxTouchPoints>0;return b?a.opts.minimumResultsForSearch<0?!1:!0:!0}},a.fn.select2.locales=[],a.fn.select2.locales.en={formatMatches:function(a){return 1===a?"One result is available, press enter to select it.":a+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(){return"Loading failed"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" or more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results\u2026"},formatSearching:function(){return"Searching\u2026"}},a.extend(a.fn.select2.defaults,a.fn.select2.locales.en),a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window