diff --git a/packages/Webkul/CartRule/src/Database/Migrations/2020_02_26_163908_change_column_type_in_cart_rules_table.php b/packages/Webkul/CartRule/src/Database/Migrations/2020_02_26_163908_change_column_type_in_cart_rules_table.php
new file mode 100644
index 000000000..11b4f62b0
--- /dev/null
+++ b/packages/Webkul/CartRule/src/Database/Migrations/2020_02_26_163908_change_column_type_in_cart_rules_table.php
@@ -0,0 +1,34 @@
+dateTime('starts_from')->change();
+ $table->dateTime('ends_till')->change();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('cart_rules', function (Blueprint $table) {
+ $table->dateTime('starts_from')->change();
+ $table->dateTime('ends_till')->change();
+ });
+ }
+}
diff --git a/packages/Webkul/CartRule/src/Helpers/CartRule.php b/packages/Webkul/CartRule/src/Helpers/CartRule.php
index 020233ec4..4db3cfb0e 100644
--- a/packages/Webkul/CartRule/src/Helpers/CartRule.php
+++ b/packages/Webkul/CartRule/src/Helpers/CartRule.php
@@ -8,6 +8,7 @@ use Webkul\CartRule\Repositories\CartRuleCouponRepository;
use Webkul\CartRule\Repositories\CartRuleCouponUsageRepository;
use Webkul\CartRule\Repositories\CartRuleCustomerRepository;
use Webkul\Customer\Repositories\CustomerGroupRepository;
+use Webkul\Checkout\Models\CartItem;
use Webkul\Rule\Helpers\Validator;
use Webkul\Checkout\Facades\Cart;
@@ -63,12 +64,13 @@ class CartRule
/**
* Create a new helper instance.
*
- * @param Webkul\CartRule\Repositories\CartRuleRepository $cartRuleRepository
- * @param Webkul\CartRule\Repositories\CartRuleCouponRepository $cartRuleCouponRepository
- * @param Webkul\CartRule\Repositories\CartRuleCouponUsageRepository $cartRuleCouponUsageRepository
- * @param Webkul\CartRule\Repositories\CartRuleCustomerRepository $cartRuleCustomerRepository
- * @param Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository
- * @param Webkul\Rule\Helpers\Validator $validator
+ * @param Webkul\CartRule\Repositories\CartRuleRepository $cartRuleRepository
+ * @param Webkul\CartRule\Repositories\CartRuleCouponRepository $cartRuleCouponRepository
+ * @param Webkul\CartRule\Repositories\CartRuleCouponUsageRepository $cartRuleCouponUsageRepository
+ * @param Webkul\CartRule\Repositories\CartRuleCustomerRepository $cartRuleCustomerRepository
+ * @param Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository
+ * @param Webkul\Rule\Helpers\Validator $validator
+ *
* @return void
*/
public function __construct(
@@ -101,17 +103,23 @@ class CartRule
public function collect()
{
$cart = Cart::getCart();
+ $appliedCartRuleIds = [];
$this->calculateCartItemTotals($cart->items()->get());
foreach ($cart->items()->get() as $item) {
- $this->process($item);
+ $itemCartRuleIds = $this->process($item);
+ $appliedCartRuleIds = array_merge($appliedCartRuleIds, $itemCartRuleIds);
if ($item->children()->count() && $item->product->getTypeInstance()->isChildrenCalculated()) {
- $this->devideDiscount($item);
+ $this->divideDiscount($item);
}
}
+ $cart->applied_cart_rule_ids = implode(',', array_unique($appliedCartRuleIds, SORT_REGULAR));
+ $cart->save();
+ $cart->refresh();
+
$this->processShippingDiscount($cart);
$this->processFreeShippingDiscount($cart);
@@ -142,18 +150,20 @@ class CartRule
}
}
- $cartRules = $this->cartRuleRepository->scopeQuery(function($query) use ($customerGroupId) {
+ $cartRules = $this->cartRuleRepository->scopeQuery(function ($query) use ($customerGroupId) {
return $query->leftJoin('cart_rule_customer_groups', 'cart_rules.id', '=', 'cart_rule_customer_groups.cart_rule_id')
- ->leftJoin('cart_rule_channels', 'cart_rules.id', '=', 'cart_rule_channels.cart_rule_id')
- ->where('cart_rule_customer_groups.customer_group_id', $customerGroupId)
- ->where('cart_rule_channels.channel_id', core()->getCurrentChannel()->id)
- ->where(function ($query1) {
- $query1->where('cart_rules.starts_from', '<=', Carbon::now()->format('Y-m-d'))->orWhereNull('cart_rules.starts_from');
- })
- ->where(function ($query2) {
- $query2->where('cart_rules.ends_till', '>=', Carbon::now()->format('Y-m-d'))->orWhereNull('cart_rules.ends_till');
- })
- ->orderBy('sort_order', 'asc');
+ ->leftJoin('cart_rule_channels', 'cart_rules.id', '=', 'cart_rule_channels.cart_rule_id')
+ ->where('cart_rule_customer_groups.customer_group_id', $customerGroupId)
+ ->where('cart_rule_channels.channel_id', core()->getCurrentChannel()->id)
+ ->where(function ($query1) {
+ $query1->where('cart_rules.starts_from', '<=', Carbon::now()->format('Y-m-d'))
+ ->orWhereNull('cart_rules.starts_from');
+ })
+ ->where(function ($query2) {
+ $query2->where('cart_rules.ends_till', '>=', Carbon::now()->format('Y-m-d'))
+ ->orWhereNull('cart_rules.ends_till');
+ })
+ ->orderBy('sort_order', 'asc');
})->findWhere(['status' => 1]);
return $cartRules;
@@ -163,29 +173,30 @@ class CartRule
* Check if cart rule can be applied
*
* @param CartRule $rule
+ *
* @return boolean
*/
- public function canProcessRule($rule)
+ public function canProcessRule($rule): bool
{
$cart = Cart::getCart();
if ($rule->coupon_type) {
if (strlen($cart->coupon_code)) {
$coupon = $this->cartRuleCouponRepository->findOneWhere([
- 'cart_rule_id' => $rule->id,
- 'code' => $cart->coupon_code,
- ]);
+ 'cart_rule_id' => $rule->id,
+ 'code' => $cart->coupon_code,
+ ]);
if ($coupon) {
if ($coupon->usage_limit && $coupon->times_used >= $coupon->usage_limit) {
return false;
}
-
+
if ($cart->customer_id && $coupon->usage_per_customer) {
$couponUsage = $this->cartRuleCouponUsageRepository->findOneWhere([
- 'cart_rule_coupon_id' => $coupon->id,
- 'customer_id' => $cart->customer_id
- ]);
+ 'cart_rule_coupon_id' => $coupon->id,
+ 'customer_id' => $cart->customer_id,
+ ]);
if ($couponUsage && $couponUsage->times_used >= $coupon->usage_per_customer) {
return false;
@@ -201,9 +212,9 @@ class CartRule
if ($rule->usage_per_customer) {
$ruleCustomer = $this->cartRuleCustomerRepository->findOneWhere([
- 'cart_rule_id' => $rule->id,
- 'customer_id' => $cart->customer_id,
- ]);
+ 'cart_rule_id' => $rule->id,
+ 'customer_id' => $cart->customer_id,
+ ]);
if ($ruleCustomer && $ruleCustomer->times_used >= $rule->usage_per_customer) {
return false;
@@ -216,19 +227,16 @@ class CartRule
/**
* Cart item discount calculation process
*
- * @param CartItem $item
- * @return void
+ * @param \Webkul\Checkout\Models\CartItem $item
+ *
+ * @return array
*/
- public function process($item)
+ public function process(CartItem $item): array
{
$item->discount_percent = 0;
$item->discount_amount = 0;
$item->base_discount_amount = 0;
- $cart = $item->cart;
-
- $cart->applied_cart_rule_ids = null;
-
$appliedRuleIds = [];
foreach ($this->getCartRules() as $rule) {
@@ -310,8 +318,8 @@ class CartRule
break;
}
- $item->discount_amount = min($item->discount_amount + $discountAmount, $item->price * $quantity);
- $item->base_discount_amount = min($item->base_discount_amount + $baseDiscountAmount, $item->base_price * $quantity);
+ $item->discount_amount = min($item->discount_amount + $discountAmount, $item->price * $quantity + $item->tax_amount);
+ $item->base_discount_amount = min($item->base_discount_amount + $baseDiscountAmount, $item->base_price * $quantity + $item->base_tax_amount);
$appliedRuleIds[$rule->id] = $rule->id;
@@ -320,25 +328,18 @@ class CartRule
}
}
- $item->applied_cart_rule_ids = join(',', $appliedRuleIds);
+ $item->applied_cart_rule_ids = implode(',', $appliedRuleIds);
$item->save();
- $cartAppliedCartRuleIds = array_merge(explode(',', $cart->applied_cart_rule_ids), $appliedRuleIds);
-
- $cartAppliedCartRuleIds = array_filter($cartAppliedCartRuleIds);
-
- $cartAppliedCartRuleIds = array_unique($cartAppliedCartRuleIds);
-
- $cart->applied_cart_rule_ids = join(',', $cartAppliedCartRuleIds);
-
- $cart->save();
+ return $appliedRuleIds;
}
/**
* Cart shipping discount calculation process
*
* @param Cart $cart
+ *
* @return void
*/
public function processShippingDiscount($cart)
@@ -388,9 +389,9 @@ class CartRule
$selectedShipping->discount_amount = min($selectedShipping->discount_amount + $discountAmount, $selectedShipping->price);
$selectedShipping->base_discount_amount = min(
- $selectedShipping->base_discount_amount + $baseDiscountAmount,
- $selectedShipping->base_price
- );
+ $selectedShipping->base_discount_amount + $baseDiscountAmount,
+ $selectedShipping->base_price
+ );
$selectedShipping->save();
@@ -409,7 +410,7 @@ class CartRule
$cartAppliedCartRuleIds = array_unique($cartAppliedCartRuleIds);
- $cart->applied_cart_rule_ids = join(',', $cartAppliedCartRuleIds);
+ $cart->applied_cart_rule_ids = implode(',', $cartAppliedCartRuleIds);
$cart->save();
@@ -420,6 +421,7 @@ class CartRule
* Cart free shipping discount calculation process
*
* @param Cart $cart
+ *
* @return void
*/
public function processFreeShippingDiscount($cart)
@@ -475,6 +477,7 @@ class CartRule
* Calculate cart item totals for each rule
*
* @param mixed $items
+ *
* @return Validator
*/
public function calculateCartItemTotals($items)
@@ -524,12 +527,13 @@ class CartRule
}
/**
- * Devide discount amount to children
+ * Divide discount amount to children
*
* @param CartItem $item
+ *
* @return void
*/
- protected function devideDiscount($item)
+ protected function divideDiscount($item)
{
foreach ($item->children as $child) {
$ratio = $item->base_total != 0 ? $child->base_total / $item->base_total : 0;
@@ -545,4 +549,4 @@ class CartRule
}
}
}
-}
\ No newline at end of file
+}
diff --git a/packages/Webkul/CartRule/src/Models/CartRule.php b/packages/Webkul/CartRule/src/Models/CartRule.php
index 33d925b1b..76776ec2d 100644
--- a/packages/Webkul/CartRule/src/Models/CartRule.php
+++ b/packages/Webkul/CartRule/src/Models/CartRule.php
@@ -11,7 +11,30 @@ use Webkul\Customer\Models\CustomerGroupProxy;
// class CartRule extends TranslatableModel implements CartRuleContract
class CartRule extends Model implements CartRuleContract
{
- protected $fillable = ['name', 'description', 'starts_from', 'ends_till', 'status', 'coupon_type', 'use_auto_generation', 'usage_per_customer', 'uses_per_coupon', 'times_used', 'condition_type', 'conditions', 'actions', 'end_other_rules', 'uses_attribute_conditions', 'action_type', 'discount_amount', 'discount_quantity', 'discount_step', 'apply_to_shipping', 'free_shipping', 'sort_order'];
+ protected $fillable = [
+ 'name',
+ 'description',
+ 'starts_from',
+ 'ends_till',
+ 'status',
+ 'coupon_type',
+ 'use_auto_generation',
+ 'usage_per_customer',
+ 'uses_per_coupon',
+ 'times_used',
+ 'condition_type',
+ 'conditions',
+ 'actions',
+ 'end_other_rules',
+ 'uses_attribute_conditions',
+ 'action_type',
+ 'discount_amount',
+ 'discount_quantity',
+ 'discount_step',
+ 'apply_to_shipping',
+ 'free_shipping',
+ 'sort_order',
+ ];
protected $casts = [
'conditions' => 'array',
diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php
index d80cc5777..ac76ab0a7 100755
--- a/packages/Webkul/Checkout/src/Cart.php
+++ b/packages/Webkul/Checkout/src/Cart.php
@@ -213,7 +213,7 @@ class Cart
'items_count' => 1,
];
- //Authentication details
+ // Fill in the customer data, as far as possible:
if ($this->getCurrentCustomer()->check()) {
$cartData['customer_id'] = $this->getCurrentCustomer()->user()->id;
$cartData['is_guest'] = 0;
@@ -675,7 +675,7 @@ class Cart
$cart->tax_total = Tax::getTaxTotal($cart, false);
$cart->base_tax_total = Tax::getTaxTotal($cart, true);
- $cart->grand_total = $cart->sub_total + $cart->tax_total + $cart->discount_amount;
+ $cart->grand_total = $cart->sub_total + $cart->tax_total - $cart->discount_amount;
$cart->base_grand_total = $cart->base_sub_total + $cart->base_tax_total - $cart->base_discount_amount;
if ($shipping = $cart->selected_shipping_rate) {
diff --git a/packages/Webkul/Checkout/src/Models/CartAddress.php b/packages/Webkul/Checkout/src/Models/CartAddress.php
index 1434b838c..737632589 100755
--- a/packages/Webkul/Checkout/src/Models/CartAddress.php
+++ b/packages/Webkul/Checkout/src/Models/CartAddress.php
@@ -9,7 +9,21 @@ class CartAddress extends Model implements CartAddressContract
{
protected $table = 'cart_address';
- protected $fillable = ['first_name', 'last_name', 'email', 'address1', 'city', 'state', 'postcode', 'country', 'phone', 'address_type', 'cart_id'];
+ protected $fillable = [
+ 'first_name',
+ 'last_name',
+ 'email',
+ 'company_name',
+ 'vat_id',
+ 'address1',
+ 'city',
+ 'state',
+ 'postcode',
+ 'country',
+ 'phone',
+ 'address_type',
+ 'cart_id',
+ ];
/**
* Get the shipping rates for the cart address.
diff --git a/packages/Webkul/Customer/src/Database/Migrations/2020_02_25_181902_propagate_company_name.php b/packages/Webkul/Customer/src/Database/Migrations/2020_02_25_181902_propagate_company_name.php
new file mode 100644
index 000000000..a7064a0d3
--- /dev/null
+++ b/packages/Webkul/Customer/src/Database/Migrations/2020_02_25_181902_propagate_company_name.php
@@ -0,0 +1,45 @@
+string('company_name')->nullable()->after('email');
+ $table->string('vat_id')->nullable()->after('company_name');
+
+ });
+
+ Schema::table('order_address', function (Blueprint $table) {
+ $table->string('company_name')->nullable()->after('email');
+ $table->string('vat_id')->nullable()->after('company_name');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('cart_address', function (Blueprint $table) {
+ $table->dropColumn('company_name');
+ $table->dropColumn('vat_id');
+ });
+
+ Schema::table('order_address', function (Blueprint $table) {
+ $table->dropColumn('company_name');
+ $table->dropColumn('vat_id');
+ });
+ }
+}
diff --git a/packages/Webkul/Product/src/Helpers/GenerateProduct.php b/packages/Webkul/Product/src/Helpers/GenerateProduct.php
index 4e20618dc..a5aaa13af 100644
--- a/packages/Webkul/Product/src/Helpers/GenerateProduct.php
+++ b/packages/Webkul/Product/src/Helpers/GenerateProduct.php
@@ -2,10 +2,17 @@
namespace Webkul\Product\Helpers;
+use Webkul\Attribute\Models\Attribute;
+use Webkul\Attribute\Models\AttributeOption;
use Webkul\Product\Repositories\ProductRepository as Product;
use Webkul\Attribute\Repositories\AttributeFamilyRepository as AttributeFamily;
use Illuminate\Support\Str;
+/**
+ * Class GenerateProduct
+ *
+ * @package Webkul\Product\Helpers
+ */
class GenerateProduct
{
/**
@@ -28,18 +35,50 @@ class GenerateProduct
$this->product = $product;
$this->types = [
- 'text', 'textarea', 'boolean', 'select', 'multiselect', 'datetime', 'date', 'price', 'image', 'file', 'checkbox'
+ 'text',
+ 'textarea',
+ 'boolean',
+ 'select',
+ 'multiselect',
+ 'datetime',
+ 'date',
+ 'price',
+ 'image',
+ 'file',
+ 'checkbox',
];
$this->attributeFamily = $attributeFamily;
}
+ /**
+ * This brand option needs to be available so that the generated product
+ * can be linked to the order_brands table after checkout.
+ */
+ public function generateDemoBrand()
+ {
+ $brand = Attribute::where(['code' => 'brand'])->first();
+
+ if (! AttributeOption::where(['attribute_id' => $brand->id])->exists()) {
+
+ AttributeOption::create([
+ 'admin_name' => 'Webkul Demo Brand (c) 2020',
+ 'attribute_id' => $brand->id,
+ ]);
+ }
+
+
+ }
+
+ /**
+ * @return mixed
+ */
public function create()
{
$attributes = $this->getDefaultFamilyAttributes();
$attributeFamily = $this->attributeFamily->findWhere([
- 'code' => 'default'
+ 'code' => 'default',
]);
$sku = Str::random(10);
@@ -59,7 +98,11 @@ class GenerateProduct
foreach ($attributes as $attribute) {
if ($attribute->type == 'text') {
- if ($attribute->code == 'width' || $attribute->code == 'height' || $attribute->code == 'depth' || $attribute->code == 'weight') {
+ if ($attribute->code == 'width'
+ || $attribute->code == 'height'
+ || $attribute->code == 'depth'
+ || $attribute->code == 'weight'
+ ) {
$data[$attribute->code] = $faker->randomNumber(3);
} elseif ($attribute->code == 'url_key') {
$data[$attribute->code] = strtolower($sku);
@@ -72,7 +115,7 @@ class GenerateProduct
$data[$attribute->code] = $faker->text;
if ($attribute->code == 'description' || $attribute->code == 'short_description') {
- $data[$attribute->code] = '
'. $data[$attribute->code] . '
';
+ $data[$attribute->code] = '
' . $data[$attribute->code] . '
';
}
} elseif ($attribute->type == 'boolean') {
$data[$attribute->code] = $faker->boolean;
@@ -117,7 +160,7 @@ class GenerateProduct
} elseif ($attribute->code == 'checkbox') {
$options = $attribute->options;
- if ($options->count()) {
+ if ($options->count()) {
$option = $options->first()->id;
$optionArray = [];
@@ -135,20 +178,23 @@ class GenerateProduct
$data['locale'] = core()->getCurrentLocale()->code;
+ $brand = Attribute::where(['code' => 'brand'])->first();
+ $data['brand'] = AttributeOption::where(['attribute_id' => $brand->id])->first()->id ?? '';
+
$data['channel'] = $channel->code;
$data['channels'] = [
- 0 => $channel->id
+ 0 => $channel->id,
];
$inventorySource = $channel->inventory_sources[0];
$data['inventories'] = [
- $inventorySource->id => 10
+ $inventorySource->id => 10,
];
$data['categories'] = [
- 0 => $channel->root_category->id
+ 0 => $channel->root_category->id,
];
$updated = $this->product->update($data, $product->id);
@@ -159,7 +205,7 @@ class GenerateProduct
public function getDefaultFamilyAttributes()
{
$attributeFamily = $this->attributeFamily->findWhere([
- 'code' => 'default'
+ 'code' => 'default',
]);
$attributes = collect();
diff --git a/packages/Webkul/Sales/src/Models/OrderAddress.php b/packages/Webkul/Sales/src/Models/OrderAddress.php
index 827e499a9..0b5f5b89c 100755
--- a/packages/Webkul/Sales/src/Models/OrderAddress.php
+++ b/packages/Webkul/Sales/src/Models/OrderAddress.php
@@ -11,6 +11,24 @@ class OrderAddress extends Model implements OrderAddressContract
protected $guarded = ['id', 'created_at', 'updated_at'];
+ protected $fillable = [
+ 'first_name',
+ 'last_name',
+ 'email',
+ 'company_name',
+ 'vat_id',
+ 'address1',
+ 'address2',
+ 'city',
+ 'state',
+ 'postcode',
+ 'country',
+ 'phone',
+ 'address_type',
+ 'cart_id',
+ 'customer_id',
+ ];
+
/**
* Get of the customer fullname.
*/
diff --git a/packages/Webkul/Shop/package.json b/packages/Webkul/Shop/package.json
index 4c880e614..9cf8a14fa 100755
--- a/packages/Webkul/Shop/package.json
+++ b/packages/Webkul/Shop/package.json
@@ -17,7 +17,7 @@
"laravel-mix-merge-manifest": "^0.1.2",
"sass": "^1.24.4",
"sass-loader": "^8.0.0",
- "vue": "^2.6.10",
+ "vue": "^2.6.11",
"vue-template-compiler": "^2.6.11"
},
"dependencies": {
diff --git a/packages/Webkul/Shop/publishable/assets/js/shop.js b/packages/Webkul/Shop/publishable/assets/js/shop.js
index 91e115c7e..fc21234f5 100755
--- a/packages/Webkul/Shop/publishable/assets/js/shop.js
+++ b/packages/Webkul/Shop/publishable/assets/js/shop.js
@@ -1,2 +1,2 @@
/*! For license information please see shop.js.LICENSE.txt */
-!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}({0:function(e,t,n){n("uPOf"),e.exports=n("w/dW")},"2SVd":function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},"5oMp":function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},"8oxB":function(e,t){var n,i,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var u,l=[],c=!1,d=-1;function f(){c&&u&&(c=!1,u.length?l=u.concat(l):d=-1,l.length&&h())}function h(){if(!c){var e=a(f);c=!0;for(var t=l.length;t;){for(u=l,l=[];++d
1)for(var n=1;n3?u.length%3:0;return a+(p?u.substr(0,p)+o.thousand:"")+u.substr(p).replace(/(\d{3})(?=\d)/g,"$1"+o.thousand)+(s?o.decimal+m(Math.abs(e),s).split(".")[1]:"")},y=r.formatMoney=function(e,t,n,i,o,s){if(l(e))return f(e,(function(e){return y(e,t,n,i,o,s)}));e=v(e);var a=d(c(t)?t:{symbol:t,precision:n,thousand:i,decimal:o,format:s},r.settings.currency),u=p(a.format);return(e>0?u.pos:e<0?u.neg:u.zero).replace("%s",a.symbol).replace("%v",g(Math.abs(e),h(a.precision),a.thousand,a.decimal))};r.formatColumn=function(e,t,n,i,o,s){if(!e)return[];var a=d(c(t)?t:{symbol:t,precision:n,thousand:i,decimal:o,format:s},r.settings.currency),m=p(a.format),y=m.pos.indexOf("%s")0?m.pos:e<0?m.neg:m.zero).replace("%s",a.symbol).replace("%v",g(Math.abs(e),h(a.precision),a.thousand,a.decimal));return n.length>w&&(w=n.length),n}));return f(b,(function(e,t){return u(e)&&e.length0&&t-1 in e)}_.fn=_.prototype={jquery:"3.4.1",constructor:_,length:0,toArray:function(){return u.call(this)},get:function(e){return null==e?u.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=_.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return _.each(this,e)},map:function(e){return this.pushStack(_.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+W+")"+W+"*"),V=new RegExp(W+"|>"),U=new RegExp(F),Z=new RegExp("^"+M+"$"),Y={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+W+"*(even|odd|(([+-]|)(\\d*)n|)"+W+"*(?:([+-]|)"+W+"*(\\d+)|))"+W+"*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^"+W+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+W+"*((?:-\\d)?\\d*)"+W+"*\\)|)(?=[^-]|$)","i")},X=/HTML$/i,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+W+"?|("+W+")|.)","ig"),ne=function(e,t,n){var i="0x"+t-65536;return i!=i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},ie=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){f()},se=be((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{L.apply(O=N.call(x.childNodes),x.childNodes),O[x.childNodes.length].nodeType}catch(e){L={apply:O.length?function(e,t){D.apply(e,N.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function ae(e,t,i,r){var o,a,l,c,d,p,g,y=t&&t.ownerDocument,T=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return i;if(!r&&((t?t.ownerDocument||t:x)!==h&&f(t),t=t||h,v)){if(11!==T&&(d=J.exec(e)))if(o=d[1]){if(9===T){if(!(l=t.getElementById(o)))return i;if(l.id===o)return i.push(l),i}else if(y&&(l=y.getElementById(o))&&w(t,l)&&l.id===o)return i.push(l),i}else{if(d[2])return L.apply(i,t.getElementsByTagName(e)),i;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(i,t.getElementsByClassName(o)),i}if(n.qsa&&!z[e+" "]&&(!m||!m.test(e))&&(1!==T||"object"!==t.nodeName.toLowerCase())){if(g=e,y=t,1===T&&V.test(e)){for((c=t.getAttribute("id"))?c=c.replace(ie,re):t.setAttribute("id",c=b),a=(p=s(e)).length;a--;)p[a]="#"+c+" "+we(p[a]);g=p.join(","),y=ee.test(e)&&ge(t.parentNode)||t}try{return L.apply(i,y.querySelectorAll(g)),i}catch(t){z(e,!0)}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(H,"$1"),t,i,r)}function ue(){var e=[];return function t(n,r){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function le(e){return e[b]=!0,e}function ce(e){var t=h.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=t}function fe(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function he(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ve(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&se(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function me(e){return le((function(t){return t=+t,le((function(n,i){for(var r,o=e([],n.length,t),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))}))}))}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ae.support={},o=ae.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!X.test(t||n&&n.nodeName||"HTML")},f=ae.setDocument=function(e){var t,r,s=e?e.ownerDocument||e:x;return s!==h&&9===s.nodeType&&s.documentElement?(p=(h=s).documentElement,v=!o(h),x!==h&&(r=h.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",oe,!1):r.attachEvent&&r.attachEvent("onunload",oe)),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(h.getElementsByClassName),n.getById=ce((function(e){return p.appendChild(e).id=b,!h.getElementsByName||!h.getElementsByName(b).length})),n.getById?(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n=t.getElementById(e);return n?[n]:[]}}):(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n,i,r,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(r=t.getElementsByName(e),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&v)return t.getElementsByClassName(e)},g=[],m=[],(n.qsa=K.test(h.querySelectorAll))&&(ce((function(e){p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+W+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+W+"*(?:value|"+j+")"),e.querySelectorAll("[id~="+b+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||m.push(".#.+[+~]")})),ce((function(e){e.innerHTML="";var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+W+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=K.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",F)})),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),t=K.test(p.compareDocumentPosition),w=t||K.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return d=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e===h||e.ownerDocument===x&&w(x,e)?-1:t===h||t.ownerDocument===x&&w(x,t)?1:c?I(c,e)-I(c,t):0:4&i?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,i=0,r=e.parentNode,o=t.parentNode,s=[e],a=[t];if(!r||!o)return e===h?-1:t===h?1:r?-1:o?1:c?I(c,e)-I(c,t):0;if(r===o)return fe(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?fe(s[i],a[i]):s[i]===x?-1:a[i]===x?1:0},h):h},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if((e.ownerDocument||e)!==h&&f(e),n.matchesSelector&&v&&!z[t+" "]&&(!g||!g.test(t))&&(!m||!m.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){z(t,!0)}return ae(t,h,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!==h&&f(e),w(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!==h&&f(e);var r=i.attrHandle[t.toLowerCase()],o=r&&k.call(i.attrHandle,t.toLowerCase())?r(e,t,!v):void 0;return void 0!==o?o:n.attributes||!v?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},ae.escape=function(e){return(e+"").replace(ie,re)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,i=[],r=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(A),d){for(;t=e[o++];)t===e[o]&&(r=i.push(o));for(;r--;)e.splice(i[r],1)}return c=null,e},r=ae.getText=function(e){var t,n="",i=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=r(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[i++];)n+=r(t);return n},(i=ae.selectors={cacheLength:50,createPseudo:le,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&U.test(n)&&(t=s(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=new RegExp("(^|"+W+")"+e+"("+W+"|$)"))&&C(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var r=ae.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(R," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,u){var l,c,d,f,h,p,v=o!==s?"nextSibling":"previousSibling",m=t.parentNode,g=a&&t.nodeName.toLowerCase(),y=!u&&!a,w=!1;if(m){if(o){for(;v;){for(f=t;f=f[v];)if(a?f.nodeName.toLowerCase()===g:1===f.nodeType)return!1;p=v="only"===e&&!p&&"nextSibling"}return!0}if(p=[s?m.firstChild:m.lastChild],s&&y){for(w=(h=(l=(c=(d=(f=m)[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],f=h&&m.childNodes[h];f=++h&&f&&f[v]||(w=h=0)||p.pop();)if(1===f.nodeType&&++w&&f===t){c[e]=[T,h,w];break}}else if(y&&(w=h=(l=(c=(d=(f=t)[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===w)for(;(f=++h&&f&&f[v]||(w=h=0)||p.pop())&&((a?f.nodeName.toLowerCase()!==g:1!==f.nodeType)||!++w||(y&&((c=(d=f[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]=[T,w]),f!==t)););return(w-=r)===i||w%i==0&&w/i>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?le((function(e,n){for(var i,o=r(e,t),s=o.length;s--;)e[i=I(e,o[s])]=!(n[i]=o[s])})):function(e){return r(e,0,n)}):r}},pseudos:{not:le((function(e){var t=[],n=[],i=a(e.replace(H,"$1"));return i[b]?le((function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))})):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}})),has:le((function(e){return function(t){return ae(e,t).length>0}})),contains:le((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||r(t)).indexOf(e)>-1}})),lang:le((function(e){return Z.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ve(!1),disabled:ve(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:me((function(){return[0]})),last:me((function(e,t){return[t-1]})),eq:me((function(e,t,n){return[n<0?n+t:n]})),even:me((function(e,t){for(var n=0;nt?t:n;--i>=0;)e.push(i);return e})),gt:me((function(e,t,n){for(var i=n<0?n+t:n;++i1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function Te(e,t,n,i,r){for(var o,s=[],a=0,u=e.length,l=null!=t;a-1&&(o[l]=!(s[l]=d))}}else g=Te(g===s?g.splice(p,g.length):g),r?r(null,s,g,u):L.apply(s,g)}))}function Ce(e){for(var t,n,r,o=e.length,s=i.relative[e[0].type],a=s||i.relative[" "],u=s?1:0,c=be((function(e){return e===t}),a,!0),d=be((function(e){return I(t,e)>-1}),a,!0),f=[function(e,n,i){var r=!s&&(i||n!==l)||((t=n).nodeType?c(e,n,i):d(e,n,i));return t=null,r}];u1&&xe(f),u>1&&we(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(H,"$1"),n,u0,r=e.length>0,o=function(o,s,a,u,c){var d,p,m,g=0,y="0",w=o&&[],b=[],x=l,_=o||r&&i.find.TAG("*",c),C=T+=null==x?1:Math.random()||.1,S=_.length;for(c&&(l=s===h||s||c);y!==S&&null!=(d=_[y]);y++){if(r&&d){for(p=0,s||d.ownerDocument===h||(f(d),a=!v);m=e[p++];)if(m(d,s||h,a)){u.push(d);break}c&&(T=C)}n&&((d=!m&&d)&&g--,o&&w.push(d))}if(g+=y,n&&y!==g){for(p=0;m=t[p++];)m(w,b,s,a);if(o){if(g>0)for(;y--;)w[y]||b[y]||(b[y]=E.call(u));b=Te(b)}L.apply(u,b),c&&!o&&b.length>0&&g+t.length>1&&ae.uniqueSort(u)}return c&&(T=C,l=x),w};return n?le(o):o}(o,r))).selector=e}return a},u=ae.select=function(e,t,n,r){var o,u,l,c,d,f="function"==typeof e&&e,h=!r&&s(e=f.selector||e);if(n=n||[],1===h.length){if((u=h[0]=h[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&v&&i.relative[u[1].type]){if(!(t=(i.find.ID(l.matches[0].replace(te,ne),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=Y.needsContext.test(e)?0:u.length;o--&&(l=u[o],!i.relative[c=l.type]);)if((d=i.find[c])&&(r=d(l.matches[0].replace(te,ne),ee.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=r.length&&we(u)))return L.apply(n,r),n;break}}return(f||a(e,h))(r,t,!v,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(A).join("")===b,n.detectDuplicates=!!d,f(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(h.createElement("fieldset"))})),ce((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||de("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||de("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||de(j,(function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),ae}(n);_.find=$,_.expr=$.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=$.uniqueSort,_.text=$.getText,_.isXMLDoc=$.isXML,_.contains=$.contains,_.escapeSelector=$.escape;var z=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&_(e).is(n))break;i.push(e)}return i},A=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=_.expr.match.needsContext;function O(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var E=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,t,n){return y(t)?_.grep(e,(function(e,i){return!!t.call(e,i,e)!==n})):t.nodeType?_.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?_.grep(e,(function(e){return d.call(t,e)>-1!==n})):_.filter(t,e,n)}_.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?_.find.matchesSelector(i,e)?[i]:[]:_.find.matches(e,_.grep(t,(function(e){return 1===e.nodeType})))},_.fn.extend({find:function(e){var t,n,i=this.length,r=this;if("string"!=typeof e)return this.pushStack(_(e).filter((function(){for(t=0;t1?_.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?_(e):e||[],!1).length}});var L,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||L,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:N.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof _?t[0]:t,_.merge(this,_.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:s,!0)),E.test(i[1])&&_.isPlainObject(t))for(i in t)y(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=s.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):y(e)?void 0!==n.ready?n.ready(e):e(_):_.makeArray(e,this)}).prototype=_.fn,L=_(s);var I=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function W(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}_.fn.extend({has:function(e){var t=_(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&_.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?_.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?d.call(_(e),this[0]):d.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),_.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return z(e,"parentNode")},parentsUntil:function(e,t,n){return z(e,"parentNode",n)},next:function(e){return W(e,"nextSibling")},prev:function(e){return W(e,"previousSibling")},nextAll:function(e){return z(e,"nextSibling")},prevAll:function(e){return z(e,"previousSibling")},nextUntil:function(e,t,n){return z(e,"nextSibling",n)},prevUntil:function(e,t,n){return z(e,"previousSibling",n)},siblings:function(e){return A((e.parentNode||{}).firstChild,e)},children:function(e){return A(e.firstChild)},contents:function(e){return void 0!==e.contentDocument?e.contentDocument:(O(e,"template")&&(e=e.content||e),_.merge([],e.childNodes))}},(function(e,t){_.fn[e]=function(n,i){var r=_.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=_.filter(i,r)),this.length>1&&(j[e]||_.uniqueSort(r),I.test(e)&&r.reverse()),this.pushStack(r)}}));var M=/[^\x20\t\r\n\f]+/g;function P(e){return e}function F(e){throw e}function R(e,t,n,i){var r;try{e&&y(r=e.promise)?r.call(e).done(t).fail(n):e&&y(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(i))}catch(e){n.apply(void 0,[e])}}_.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return _.each(e.match(M)||[],(function(e,n){t[n]=!0})),t}(e):_.extend({},e);var t,n,i,r,o=[],s=[],a=-1,u=function(){for(r=r||e.once,i=t=!0;s.length;a=-1)for(n=s.shift();++a-1;)o.splice(n,1),n<=a&&a--})),this},has:function(e){return e?_.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||t||(o=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!i}};return l},_.extend({Deferred:function(e){var t=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return _.Deferred((function(n){_.each(t,(function(t,i){var r=y(e[i[4]])&&e[i[4]];o[i[1]]((function(){var e=r&&r.apply(this,arguments);e&&y(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[e]:arguments)}))})),e=null})).promise()},then:function(e,i,r){var o=0;function s(e,t,i,r){return function(){var a=this,u=arguments,l=function(){var n,l;if(!(e=o&&(i!==F&&(a=void 0,u=[n]),t.rejectWith(a,u))}};e?c():(_.Deferred.getStackHook&&(c.stackTrace=_.Deferred.getStackHook()),n.setTimeout(c))}}return _.Deferred((function(n){t[0][3].add(s(0,n,y(r)?r:P,n.notifyWith)),t[1][3].add(s(0,n,y(e)?e:P)),t[2][3].add(s(0,n,y(i)?i:F))})).promise()},promise:function(e){return null!=e?_.extend(e,r):r}},o={};return _.each(t,(function(e,n){var s=n[2],a=n[5];r[n[1]]=s.add,a&&s.add((function(){i=a}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),s.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=s.fireWith})),r.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,i=Array(n),r=u.call(arguments),o=_.Deferred(),s=function(e){return function(n){i[e]=this,r[e]=arguments.length>1?u.call(arguments):n,--t||o.resolveWith(i,r)}};if(t<=1&&(R(e,o.done(s(n)).resolve,o.reject,!t),"pending"===o.state()||y(r[n]&&r[n].then)))return o.then();for(;n--;)R(r[n],s(n),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&H.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},_.readyException=function(e){n.setTimeout((function(){throw e}))};var q=_.Deferred();function B(){s.removeEventListener("DOMContentLoaded",B),n.removeEventListener("load",B),_.ready()}_.fn.ready=function(e){return q.then(e).catch((function(e){_.readyException(e)})),this},_.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==e&&--_.readyWait>0||q.resolveWith(s,[_]))}}),_.ready.then=q.then,"complete"===s.readyState||"loading"!==s.readyState&&!s.documentElement.doScroll?n.setTimeout(_.ready):(s.addEventListener("DOMContentLoaded",B),n.addEventListener("load",B));var V=function(e,t,n,i,r,o,s){var a=0,u=e.length,l=null==n;if("object"===T(n))for(a in r=!0,n)V(e,t,a,n[a],!0,o,s);else if(void 0!==i&&(r=!0,y(i)||(s=!0),l&&(s?(t.call(e,i),t=null):(l=t,t=function(e,t,n){return l.call(_(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each((function(){J.remove(this,e)}))}}),_.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=K.get(e,t),n&&(!i||Array.isArray(n)?i=K.access(e,t,_.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=_.queue(e,t),i=n.length,r=n.shift(),o=_._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,(function(){_.dequeue(e,t)}),o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return K.get(e,n)||K.access(e,n,{empty:_.Callbacks("once memory").add((function(){K.remove(e,[t+"queue",n])}))})}}),_.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ge=/^$|^module$|\/(?:java|ecma)script/i,ye={option:[1,""],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function we(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&O(e,t)?_.merge([e],n):n}function be(e,t){for(var n=0,i=e.length;n-1)r&&r.push(o);else if(l=ae(o),s=we(d.appendChild(o),"script"),l&&be(s),n)for(c=0;o=s[c++];)ge.test(o.type||"")&&n.push(o);return d}xe=s.createDocumentFragment().appendChild(s.createElement("div")),(Te=s.createElement("input")).setAttribute("type","radio"),Te.setAttribute("checked","checked"),Te.setAttribute("name","t"),xe.appendChild(Te),g.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",g.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue;var Se=/^key/,$e=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ze=/^([^.]*)(?:\.(.+)|)/;function Ae(){return!0}function ke(){return!1}function Oe(e,t){return e===function(){try{return s.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,i,r,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)Ee(e,a,n,i,t[a],o);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=ke;else if(!r)return e;return 1===o&&(s=r,(r=function(e){return _().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=_.guid++)),e.each((function(){_.event.add(this,t,r,i,n)}))}function De(e,t,n){n?(K.set(e,t,!1),_.event.add(e,t,{namespace:!1,handler:function(e){var i,r,o=K.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(_.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=u.call(arguments),K.set(this,t,o),i=n(this,t),this[t](),o!==(r=K.get(this,t))||i?K.set(this,t,!1):r={},o!==r)return e.stopImmediatePropagation(),e.preventDefault(),r.value}else o.length&&(K.set(this,t,{value:_.event.trigger(_.extend(o[0],_.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===K.get(e,t)&&_.event.add(e,t,Ae)}_.event={global:{},add:function(e,t,n,i,r){var o,s,a,u,l,c,d,f,h,p,v,m=K.get(e);if(m)for(n.handler&&(n=(o=n).handler,r=o.selector),r&&_.find.matchesSelector(se,r),n.guid||(n.guid=_.guid++),(u=m.events)||(u=m.events={}),(s=m.handle)||(s=m.handle=function(t){return void 0!==_&&_.event.triggered!==t.type?_.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;l--;)h=v=(a=ze.exec(t[l])||[])[1],p=(a[2]||"").split(".").sort(),h&&(d=_.event.special[h]||{},h=(r?d.delegateType:d.bindType)||h,d=_.event.special[h]||{},c=_.extend({type:h,origType:v,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&_.expr.match.needsContext.test(r),namespace:p.join(".")},o),(f=u[h])||((f=u[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,i,p,s)||e.addEventListener&&e.addEventListener(h,s)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,c):f.push(c),_.event.global[h]=!0)},remove:function(e,t,n,i,r){var o,s,a,u,l,c,d,f,h,p,v,m=K.hasData(e)&&K.get(e);if(m&&(u=m.events)){for(l=(t=(t||"").match(M)||[""]).length;l--;)if(h=v=(a=ze.exec(t[l])||[])[1],p=(a[2]||"").split(".").sort(),h){for(d=_.event.special[h]||{},f=u[h=(i?d.delegateType:d.bindType)||h]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;o--;)c=f[o],!r&&v!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,d.remove&&d.remove.call(e,c));s&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,p,m.handle)||_.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)_.event.remove(e,h+t[l],n,i,!0);_.isEmptyObject(u)&&K.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,s,a=_.event.fix(e),u=new Array(arguments.length),l=(K.get(this,"events")||{})[a.type]||[],c=_.event.special[a.type]||{};for(u[0]=a,t=1;t=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],s={},n=0;n-1:_.find(r,this,null,[l]).length),s[r]&&o.push(i);o.length&&a.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ne=/