Webinterpret_Connector - Version 1.2.7.7

Version Notes

- Redirector optimization
- Simplified installation process

Download this release

Release Info

Developer Webinterpret
Extension Webinterpret_Connector
Version 1.2.7.7
Comparing to
See all releases


Code changes from version 1.2.7.6 to 1.2.7.7

Files changed (39) hide show
  1. app/code/community/Webinterpret/Connector/Block/Analytics.php +0 -28
  2. app/code/community/Webinterpret/Connector/Block/Footer.php +5 -0
  3. app/code/community/Webinterpret/Connector/Block/Product/Redirect.php +0 -94
  4. app/code/community/Webinterpret/Connector/Block/Product/View.php +39 -0
  5. app/code/community/Webinterpret/Connector/Helper/Data.php +5 -180
  6. app/code/community/Webinterpret/Connector/Model/Observer.php +3 -10
  7. app/code/community/Webinterpret/Connector/bridge2cart/bridge.php +3854 -1
  8. app/code/community/Webinterpret/Connector/bridge2cart/config.php +20 -1
  9. app/code/community/Webinterpret/Connector/bridge2cart/helper.php +24 -3
  10. app/code/community/Webinterpret/Connector/controllers/ApiController.php +0 -24
  11. app/code/community/Webinterpret/Connector/controllers/HelperController.php +11 -7
  12. app/code/community/Webinterpret/Connector/controllers/IndexController.php +10 -6
  13. app/code/community/Webinterpret/Connector/etc/config.xml +1 -3
  14. app/code/community/Webinterpret/Connector/etc/system.xml +0 -22
  15. app/design/adminhtml/default/default/template/webinterpret/system/config/fieldset/status.phtml +0 -48
  16. app/design/frontend/base/default/layout/webinterpret/connector.xml +8 -18
  17. app/design/frontend/base/default/template/webinterpret/connector/analytics.phtml +0 -18
  18. app/design/frontend/base/default/template/webinterpret/connector/footer.phtml +6 -1
  19. app/design/frontend/base/default/template/webinterpret/connector/head.phtml +0 -1
  20. app/design/frontend/base/default/template/webinterpret/connector/product_footer.phtml +0 -13
  21. app/design/frontend/base/default/template/webinterpret/connector/product_redirect.phtml +0 -43
  22. app/design/frontend/base/default/template/webinterpret/connector/product_view.phtml +24 -0
  23. app/locale/de_DE/Webinterpret_Connector.csv +46 -48
  24. app/locale/en_US/Webinterpret_Connector.csv +1 -1
  25. js/webinterpret/flags/flag-at.png +0 -0
  26. js/webinterpret/flags/flag-au.png +0 -0
  27. js/webinterpret/flags/flag-be.png +0 -0
  28. js/webinterpret/flags/flag-de.png +0 -0
  29. js/webinterpret/flags/flag-es.png +0 -0
  30. js/webinterpret/flags/flag-fr.png +0 -0
  31. js/webinterpret/flags/flag-ie.png +0 -0
  32. js/webinterpret/flags/flag-it.png +0 -0
  33. js/webinterpret/flags/flag-uk.png +0 -0
  34. js/webinterpret/flags/flag-us.png +0 -0
  35. js/webinterpret/webinterpret-1.2.7.6.css +0 -312
  36. js/webinterpret/webinterpret-1.2.7.6.js +0 -348
  37. js/webinterpret/webinterpret.css +0 -312
  38. js/webinterpret/webinterpret.js +0 -348
  39. package.xml +7 -6
app/code/community/Webinterpret/Connector/Block/Analytics.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- /**
3
- * Analytics block
4
- *
5
- * @category Webinterpret
6
- * @package Webinterpret_Connector
7
- * @author Webinterpret Team <info@webinterpret.com>
8
- * @license http://opensource.org/licenses/osl-3.0.php
9
- */
10
- class Webinterpret_Connector_Block_Analytics extends Mage_Core_Block_Template
11
- {
12
- public function getTrackingCode()
13
- {
14
- return Mage::getStoreConfig('webinterpret_connector/tracking_code');
15
- }
16
-
17
- public function getPluginInfoCode()
18
- {
19
- $pid = Mage::getStoreConfig('webinterpret_connector/plugin_id');
20
- $html = '';
21
- $html .= '<script id="__webinterpret">' . PHP_EOL;
22
- $html .= '//<![CDATA[' . PHP_EOL;
23
- $html .= 'var __webinterpret={"pid":"' . $pid . '"};' . PHP_EOL;
24
- $html .= '//]]>' . PHP_EOL;
25
- $html .= '</script>' . PHP_EOL;
26
- return $html;
27
- }
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Webinterpret/Connector/Block/Footer.php CHANGED
@@ -13,4 +13,9 @@ class Webinterpret_Connector_Block_Footer extends Mage_Core_Block_Template
13
  {
14
  return Mage::getStoreConfig('webinterpret_connector/footer') . PHP_EOL;
15
  }
 
 
 
 
 
16
  }
13
  {
14
  return Mage::getStoreConfig('webinterpret_connector/footer') . PHP_EOL;
15
  }
16
+
17
+ public function getPluginId()
18
+ {
19
+ return Mage::getStoreConfig('webinterpret_connector/plugin_id');
20
+ }
21
  }
app/code/community/Webinterpret/Connector/Block/Product/Redirect.php DELETED
@@ -1,94 +0,0 @@
1
- <?php
2
- /**
3
- * Redirect block
4
- *
5
- * @category Webinterpret
6
- * @package Webinterpret_Connector
7
- * @author Webinterpret Team <info@webinterpret.com>
8
- * @license http://opensource.org/licenses/osl-3.0.php
9
- */
10
- class Webinterpret_Connector_Block_Product_Redirect extends Mage_Core_Block_Template
11
- {
12
- public function getProductId()
13
- {
14
- $id = Mage::registry('current_product')->getId();
15
- if (isset($_GET['wi_product_id'])) {
16
- $id = $_GET['wi_product_id'];
17
- }
18
- return $id;
19
- }
20
-
21
- public function getStoreUrl()
22
- {
23
- $url = Mage::helper('webinterpret_connector')->getStoreBaseUrl();
24
- if (isset($_GET['wi_store_url'])) {
25
- $url = $_GET['wi_store_url'];
26
- }
27
- return $url;
28
- }
29
-
30
- public function getUtmUrlQuery($source = null, $medium = null, $campaign = null)
31
- {
32
- $storeUrl = $this->getStoreUrl();
33
- $source = is_null($source) ? parse_url($storeUrl, PHP_URL_HOST) : $source;
34
- $medium = is_null($medium) ? 'na' : $medium;
35
- if (isset($_GET['wi'])) {
36
- $medium .= '_pw';
37
- } else {
38
- if (isset($_GET['gclid'])) {
39
- $medium .= '_pg';
40
- }
41
- }
42
- $campaign = is_null($campaign) ? $this->getLocaleCode() : $campaign;
43
-
44
- $params = array(
45
- 'utm_source' => $source,
46
- 'utm_medium' => $medium,
47
- 'utm_campaign' => $campaign,
48
- );
49
- return http_build_query($params);
50
- }
51
-
52
- public function getLocaleCode()
53
- {
54
- return Mage::getStoreConfig('general/locale/code');
55
- }
56
-
57
- public function getPluginVersion()
58
- {
59
- return Mage::helper('webinterpret_connector')->getExtensionVersion();
60
- }
61
-
62
- public function getRedirectUrl($iframe = false)
63
- {
64
- $productId = $this->getProductId();
65
- $redirectUrl = 'https://inventory.glopal.com/v1/open/redirect/product/' . $productId;
66
- $params = array(
67
- 'store_url' => $this->getStoreUrl(),
68
- );
69
- if ($iframe) {
70
- $params['iframe'] = 1;
71
- }
72
- return $redirectUrl . '?' . http_build_query($params);
73
- }
74
-
75
- public function getOverlayUrl()
76
- {
77
- return $this->getRedirectUrl(true);
78
- }
79
-
80
- public function buildTrackEventData($category = null, $action = null, $name = null, $value = null)
81
- {
82
- $data = array(
83
- 'category' => $category,
84
- 'action' => $action,
85
- 'name' => $name,
86
- 'value' => $value,
87
- 'store_locale' => $this->getLocaleCode(),
88
- 'plugin_version' => $this->getPluginVersion(),
89
- 'store_url' => $this->getStoreUrl(),
90
- 'product_id' => $this->getProductId(),
91
- );
92
- return http_build_query($data);
93
- }
94
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Webinterpret/Connector/Block/Product/View.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Redirect block
4
+ *
5
+ * @category Webinterpret
6
+ * @package Webinterpret_Connector
7
+ * @author Webinterpret Team <info@webinterpret.com>
8
+ * @license http://opensource.org/licenses/osl-3.0.php
9
+ */
10
+ class Webinterpret_Connector_Block_Product_View extends Mage_Core_Block_Template
11
+ {
12
+ public function getProductId()
13
+ {
14
+ $id = Mage::registry('current_product')->getId();
15
+ if (isset($_GET['wi_product_id'])) {
16
+ $id = $_GET['wi_product_id'];
17
+ }
18
+ return $id;
19
+ }
20
+
21
+ public function getStoreUrl()
22
+ {
23
+ $url = Mage::helper('webinterpret_connector')->getStoreBaseUrl();
24
+ if (isset($_GET['wi_store_url'])) {
25
+ $url = $_GET['wi_store_url'];
26
+ }
27
+ return $url;
28
+ }
29
+
30
+ public function getLocaleCode()
31
+ {
32
+ return Mage::getStoreConfig('general/locale/code');
33
+ }
34
+
35
+ public function getPluginVersion()
36
+ {
37
+ return 'magento-' . Mage::helper('webinterpret_connector')->getExtensionVersion();
38
+ }
39
+ }
app/code/community/Webinterpret/Connector/Helper/Data.php CHANGED
@@ -13,12 +13,6 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
13
  {
14
  Mage::getSingleton('adminhtml/session')->getMessages(true);
15
 
16
- // Uninstall bridge
17
- if (!$this->isEnabled()) {
18
- $this->uninstallBridge();
19
- return;
20
- }
21
-
22
  // Validate key
23
  $key = $this->getWebinterpretKey();
24
  if (!$this->validateWebinterpretKey($key)) {
@@ -26,53 +20,7 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
26
  return;
27
  }
28
 
29
- // Install bridge
30
- if (!$this->isBridgeInstalled()) {
31
- if (!$this->installBridge()) {
32
- return;
33
- }
34
- }
35
-
36
- // Update config
37
- $this->updateBridgeConfig($key);
38
- }
39
-
40
- public function installBridge()
41
- {
42
- $repo = Mage::getStoreConfig('webinterpret_connector/file_repository');
43
- $dir = $this->getModuleBridgeDir();
44
-
45
- // Install bridge.php
46
- $remoteFile = $repo . DS . 'bridge2cart' . DS . $this->getExtensionVersion() . DS . 'bridge.php';
47
- $contents = $this->downloadFile($remoteFile);
48
- if ($contents === false) {
49
- Mage::getSingleton('adminhtml/session')->addError($this->__("Failed to download file: %s<br>Please contact Webinterpret support.", $remoteFile));
50
- return false;
51
- }
52
- $localFile = $dir . DS . 'bridge.php';
53
- $contents = str_replace('exit();', '', $contents);
54
- if (@file_put_contents($localFile, $contents) === false) {
55
- Mage::getSingleton('adminhtml/session')->addError($this->__("Failed to write file: %s<br>Please update the file permissions and try again.", $localFile));
56
- return false;
57
- }
58
-
59
- // Install config.php
60
- $remoteFile = $repo . DS . 'bridge2cart' . DS . $this->getExtensionVersion() . DS . 'config.php';
61
- $contents = $this->downloadFile($remoteFile);
62
- if ($contents === false) {
63
- Mage::getSingleton('adminhtml/session')->addError($this->__("Failed to download file: %s<br>Please contact Webinterpret support.", $remoteFile));
64
- return false;
65
- }
66
- $localFile = $dir . DS . 'config.php';
67
- $contents = str_replace('exit();', '', $contents);
68
- if (@file_put_contents($localFile, $contents) === false) {
69
- Mage::getSingleton('adminhtml/session')->addError($this->__("Failed to write file: %s<br>Please update the file permissions and try again.", $localFile));
70
- return false;
71
- }
72
-
73
  Mage::getConfig()->saveConfig('webinterpret_connector/installation_mode', 0);
74
-
75
- return true;
76
  }
77
 
78
  public function installBridgeHelper()
@@ -95,51 +43,6 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
95
  return true;
96
  }
97
 
98
- public function updateBridgeConfig($key)
99
- {
100
- $dir = $this->getModuleBridgeDir();
101
-
102
- // Update config.php
103
- $localFile = $dir . DS . 'config.php';
104
- $contents = @file_get_contents($localFile);
105
- if ($contents === false) {
106
- Mage::getSingleton('adminhtml/session')->addError($this->__("Failed to read file: %s<br>Please update the file permissions and try again.", $localFile));
107
- return false;
108
- }
109
-
110
- $contents = str_replace('%m1_token%', $key, $contents);
111
- // $contents = str_replace('%m1_store_base_dir%', Mage::getBaseDir() . DS, $contents);
112
- if (@file_put_contents($localFile, $contents) === false) {
113
- Mage::getSingleton('adminhtml/session')->addError($this->__("Failed to write file: %s<br>Please update the file permissions and try again.", $localFile));
114
- return false;
115
- }
116
-
117
- return true;
118
- }
119
-
120
- public function uninstallBridge()
121
- {
122
- $dir = $this->getModuleBridgeDir();
123
-
124
- // Truncate bridge.php
125
- $localFile = $dir . DS . 'bridge.php';
126
- $contents = "<?php // Uninstalled" . PHP_EOL;
127
- if (@file_put_contents($localFile, $contents) === false) {
128
- Mage::getSingleton('adminhtml/session')->addError($this->__("Failed to write file: %s<br>Please update the file permissions and try again.", $localFile));
129
- return false;
130
- }
131
-
132
- // Truncate config.php
133
- $localFile = $dir . DS . 'config.php';
134
- $contents = "<?php // Uninstalled" . PHP_EOL;
135
- if (@file_put_contents($localFile, $contents) === false) {
136
- Mage::getSingleton('adminhtml/session')->addError($this->__("Failed to write file: %s<br>Please update the file permissions and try again.", $localFile));
137
- return false;
138
- }
139
-
140
- return true;
141
- }
142
-
143
  public function downloadFile($url, $timeout = 10)
144
  {
145
  try {
@@ -205,33 +108,6 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
205
  return (bool)Mage::getStoreConfig('webinterpret_connector/enabled');
206
  }
207
 
208
- public function isBridgeInstalled()
209
- {
210
- $dir = $this->getModuleBridgeDir();
211
-
212
- // Check if bridge.php exists
213
- $path = $dir . DS . 'bridge.php';
214
- $contents = @file_get_contents($path);
215
- if ($contents === false) {
216
- return false;
217
- }
218
- if (strpos($contents, 'MagneticOne') === false) {
219
- return false;
220
- }
221
-
222
- // Check if config.php exists
223
- $path = $dir . DS . 'config.php';
224
- $contents = @file_get_contents($path);
225
- if ($contents === false) {
226
- return false;
227
- }
228
- if (strpos($contents, 'MagneticOne') === false) {
229
- return false;
230
- }
231
-
232
- return true;
233
- }
234
-
235
  public function getWebinterpretKey()
236
  {
237
  $key = Mage::getStoreConfig('webinterpret_connector/key');
@@ -264,24 +140,6 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
264
  return $module && $feature;
265
  }
266
 
267
- public function isProductRedirectEnabled()
268
- {
269
- // Overlay overrides the redirector
270
- if ($this->isProductOverlayEnabled()) {
271
- return false;
272
- }
273
- $module = $this->isEnabled();
274
- $feature = (bool)Mage::getStoreConfig('webinterpret_connector/product_redirect_enabled');
275
- return $module && $feature;
276
- }
277
-
278
- public function isProductOverlayEnabled()
279
- {
280
- $module = $this->isEnabled();
281
- $feature = (bool)Mage::getStoreConfig('webinterpret_connector/product_overlay_enabled');
282
- return $module && $feature;
283
- }
284
-
285
  public function getModuleBridgeDir()
286
  {
287
  $dir = Mage::getModuleDir('controllers', 'Webinterpret_Connector');
@@ -387,18 +245,9 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
387
  $report['integration']['errors'][] = $this->__('Integration is turned OFF. Please set "Enabled" field to "Yes" and click the "Save Config" button.');
388
  }
389
 
390
- // Bridge
391
- $report['bridge']['label'] = $this->__('Bridge Files');
392
- if ($this->isBridgeInstalled()) {
393
- $report['bridge']['info'] = $this->__('Bridge is installed');
394
- } else {
395
- $report['bridge']['errors'] = array();
396
- if ($this->isEnabled()) {
397
- $report['bridge']['errors'][] = $this->__('Bridge is not installed. Please click "Save Config" button to install it.');
398
- } else {
399
- $report['bridge']['errors'][] = $this->__('Bridge is not installed. Please set "Enabled" field to "Yes" and click the "Save Config" button.');
400
- }
401
- }
402
 
403
  // PHP Version
404
  $report['php_version']['label'] = $this->__('PHP');
@@ -472,15 +321,7 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
472
  ),
473
  array(
474
  'type' => 'file',
475
- 'path' => 'app/design/frontend/base/default/template/webinterpret/connector/product_footer.phtml',
476
- ),
477
- array(
478
- 'type' => 'file',
479
- 'path' => 'app/design/frontend/base/default/template/webinterpret/connector/product_redirect.phtml',
480
- ),
481
- array(
482
- 'type' => 'file',
483
- 'path' => 'app/design/frontend/base/default/template/webinterpret/connector/analytics.phtml',
484
  ),
485
  array(
486
  'type' => 'file',
@@ -518,10 +359,6 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
518
  'type' => 'file',
519
  'path' => 'app/code/community/Webinterpret/Connector/etc/config.xml',
520
  ),
521
- array(
522
- 'type' => 'file',
523
- 'path' => 'app/code/community/Webinterpret/Connector/controllers/ApiController.php',
524
- ),
525
  array(
526
  'type' => 'file',
527
  'path' => 'app/code/community/Webinterpret/Connector/controllers/IndexController.php',
@@ -530,10 +367,6 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
530
  'type' => 'file',
531
  'path' => 'app/code/community/Webinterpret/Connector/controllers/HelperController.php',
532
  ),
533
- array(
534
- 'type' => 'file',
535
- 'path' => 'app/code/community/Webinterpret/Connector/Block/Analytics.php',
536
- ),
537
  array(
538
  'type' => 'file',
539
  'path' => 'app/code/community/Webinterpret/Connector/Block/Adminhtml/Notifications.php',
@@ -544,7 +377,7 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
544
  ),
545
  array(
546
  'type' => 'file',
547
- 'path' => 'app/code/community/Webinterpret/Connector/Block/Product/Redirect.php',
548
  ),
549
  array(
550
  'type' => 'file',
@@ -574,14 +407,6 @@ class Webinterpret_Connector_Helper_Data extends Mage_Core_Helper_Abstract
574
  'type' => 'file',
575
  'path' => 'app/code/community/Webinterpret/Connector/bridge2cart/preloader.php',
576
  ),
577
- array(
578
- 'type' => 'file',
579
- 'path' => 'js/webinterpret/webinterpret.css',
580
- ),
581
- array(
582
- 'type' => 'file',
583
- 'path' => 'js/webinterpret/webinterpret.js',
584
- ),
585
  );
586
 
587
  // Check file permissions
13
  {
14
  Mage::getSingleton('adminhtml/session')->getMessages(true);
15
 
 
 
 
 
 
 
16
  // Validate key
17
  $key = $this->getWebinterpretKey();
18
  if (!$this->validateWebinterpretKey($key)) {
20
  return;
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  Mage::getConfig()->saveConfig('webinterpret_connector/installation_mode', 0);
 
 
24
  }
25
 
26
  public function installBridgeHelper()
43
  return true;
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  public function downloadFile($url, $timeout = 10)
47
  {
48
  try {
108
  return (bool)Mage::getStoreConfig('webinterpret_connector/enabled');
109
  }
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  public function getWebinterpretKey()
112
  {
113
  $key = Mage::getStoreConfig('webinterpret_connector/key');
140
  return $module && $feature;
141
  }
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  public function getModuleBridgeDir()
144
  {
145
  $dir = Mage::getModuleDir('controllers', 'Webinterpret_Connector');
245
  $report['integration']['errors'][] = $this->__('Integration is turned OFF. Please set "Enabled" field to "Yes" and click the "Save Config" button.');
246
  }
247
 
248
+ // Plugin version
249
+ $report['plugin_version']['label'] = $this->__('Plugin');
250
+ $report['plugin_version']['info'] = $this->getExtensionVersion();
 
 
 
 
 
 
 
 
 
251
 
252
  // PHP Version
253
  $report['php_version']['label'] = $this->__('PHP');
321
  ),
322
  array(
323
  'type' => 'file',
324
+ 'path' => 'app/design/frontend/base/default/template/webinterpret/connector/product_view.phtml',
 
 
 
 
 
 
 
 
325
  ),
326
  array(
327
  'type' => 'file',
359
  'type' => 'file',
360
  'path' => 'app/code/community/Webinterpret/Connector/etc/config.xml',
361
  ),
 
 
 
 
362
  array(
363
  'type' => 'file',
364
  'path' => 'app/code/community/Webinterpret/Connector/controllers/IndexController.php',
367
  'type' => 'file',
368
  'path' => 'app/code/community/Webinterpret/Connector/controllers/HelperController.php',
369
  ),
 
 
 
 
370
  array(
371
  'type' => 'file',
372
  'path' => 'app/code/community/Webinterpret/Connector/Block/Adminhtml/Notifications.php',
377
  ),
378
  array(
379
  'type' => 'file',
380
+ 'path' => 'app/code/community/Webinterpret/Connector/Block/Product/View.php',
381
  ),
382
  array(
383
  'type' => 'file',
407
  'type' => 'file',
408
  'path' => 'app/code/community/Webinterpret/Connector/bridge2cart/preloader.php',
409
  ),
 
 
 
 
 
 
 
 
410
  );
411
 
412
  // Check file permissions
app/code/community/Webinterpret/Connector/Model/Observer.php CHANGED
@@ -47,19 +47,12 @@ class Webinterpret_Connector_Model_Observer
47
 
48
  $notifications = Mage::getSingleton('webinterpret_connector/notification');
49
 
50
- if (!Mage::helper('webinterpret_connector')->isBridgeInstalled()) {
51
- if (Mage::helper('webinterpret_connector')->isInstallationMode()) {
52
- if (Mage::getSingleton('admin/session')->isAllowed('system/config')) {
53
  $url = Mage::getModel('adminhtml/url')->getUrl('/system_config/edit/section/webinterpret_connector');
54
  $notifications->addMessage(Mage::helper('webinterpret_connector')->__("To continue installing Webinterpret, <a href=\"%s\">click here</a>", $url));
55
  }
56
- } else {
57
- if (Mage::helper('webinterpret_connector')->isEnabled()) {
58
- if (Mage::getSingleton('admin/session')->isAllowed('system/config')) {
59
- $url = Mage::getModel('adminhtml/url')->getUrl('/system_config/edit/section/webinterpret_connector');
60
- $notifications->addMessage(Mage::helper('webinterpret_connector')->__("Webinterpret extension has stopped working. For more details, <a href=\"%s\">click here</a>", $url));
61
- }
62
- }
63
  }
64
  }
65
 
47
 
48
  $notifications = Mage::getSingleton('webinterpret_connector/notification');
49
 
50
+ if (Mage::helper('webinterpret_connector')->isEnabled()) {
51
+ if (Mage::getSingleton('admin/session')->isAllowed('system/config')) {
52
+ if (Mage::helper('webinterpret_connector')->isInstallationMode()) {
53
  $url = Mage::getModel('adminhtml/url')->getUrl('/system_config/edit/section/webinterpret_connector');
54
  $notifications->addMessage(Mage::helper('webinterpret_connector')->__("To continue installing Webinterpret, <a href=\"%s\">click here</a>", $url));
55
  }
 
 
 
 
 
 
 
56
  }
57
  }
58
 
app/code/community/Webinterpret/Connector/bridge2cart/bridge.php CHANGED
@@ -1 +1,3854 @@
1
- <?php // THIS FILE SHOULD BE WRITEABLE BY THE WEB SERVER
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Bridge
4
+ *
5
+ * @category Webinterpret
6
+ * @package Webinterpret_Connector
7
+ * @author Webinterpret Team <info@webinterpret.com>
8
+ * @license http://opensource.org/licenses/osl-3.0.php
9
+ */
10
+
11
+ require_once 'preloader.php';
12
+
13
+ class M1_Bridge_Action_Update
14
+ {
15
+ var $uri = "BRIDGE_DOWNLOAD_LINK";
16
+
17
+ var $pathToTmpDir;
18
+
19
+ var $pathToFile = __FILE__;
20
+
21
+ function M1_Bridge_Action_Update()
22
+ {
23
+ $this->pathToTmpDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "temp_c2c";
24
+ }
25
+
26
+ function perform($bridge)
27
+ {
28
+ $response = new stdClass();
29
+ if ( !($this->_checkBridgeDirPermission() && $this->_checkBridgeFilePermission()) ) {
30
+ $response->is_error = true;
31
+ $response->message = "Bridge Update couldn't be performed. Please change permission for bridge folder to 777 and bridge.php file inside it to 666";
32
+ echo serialize($response);die;
33
+ }
34
+
35
+
36
+ if ( ($data = $this->_downloadFile()) === false ) {
37
+ $response->is_error = true;
38
+ $response->message = "Bridge Version is outdated. Files couldn't be updated automatically. Please set write permission or re-upload files manually.";
39
+ echo serialize($response);die;
40
+ }
41
+
42
+ if ( !$this->_writeToFile($data, $this->pathToFile) ) {
43
+ $response->is_error = true;
44
+ $response->message = "Couln't create file in temporary folder or file is write protected.";
45
+ echo serialize($response);die;
46
+ }
47
+
48
+ $response->is_error = false;
49
+ $response->message = "Bridge successfully updated to latest version";
50
+ echo serialize($response);
51
+ die;
52
+ }
53
+
54
+ function _fetch( $uri )
55
+ {
56
+ $ch = curl_init();
57
+
58
+ curl_setopt($ch, CURLOPT_URL, $uri);
59
+ curl_setopt($ch, CURLOPT_HEADER, 0);
60
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
61
+
62
+ $response = new stdClass();
63
+
64
+ $response->body = curl_exec($ch);
65
+ $response->http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
66
+ $response->content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
67
+ $response->content_length = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
68
+
69
+ curl_close($ch);
70
+
71
+ return $response;
72
+ }
73
+
74
+ function _checkBridgeDirPermission()
75
+ {
76
+ if (!is_writeable(dirname(__FILE__))) {
77
+ @chmod(dirname(__FILE__), 0777);
78
+ }
79
+ return is_writeable(dirname(__FILE__));
80
+ }
81
+
82
+ function _checkBridgeFilePermission()
83
+ {
84
+ $pathToFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bridge.php";
85
+ if (!is_writeable($pathToFile)) {
86
+ @chmod($pathToFile, 0666);
87
+ }
88
+ return is_writeable($pathToFile);
89
+ }
90
+
91
+ function _createTempDir()
92
+ {
93
+ @mkdir($this->pathToTmpDir, 0777);
94
+ return file_exists($this->pathToTmpDir);
95
+ }
96
+
97
+ function _removeTempDir()
98
+ {
99
+ @unlink($this->pathToTmpDir . DIRECTORY_SEPARATOR . "bridge.php_c2c");
100
+ @rmdir($this->pathToTmpDir);
101
+ return !file_exists($this->pathToTmpDir);
102
+ }
103
+
104
+ function _downloadFile()
105
+ {
106
+ $file = $this->_fetch($this->uri);
107
+ if ( $file->http_code == 200 ) {
108
+ return $file;
109
+ }
110
+ return false;
111
+ }
112
+
113
+ function _writeToFile($data, $file)
114
+ {
115
+ if (function_exists("file_put_contents")) {
116
+ $bytes = file_put_contents($file, $data->body);
117
+ return $bytes == $data->content_length;
118
+ }
119
+
120
+ $handle = @fopen($file, 'w+');
121
+ $bytes = fwrite($handle, $data->body);
122
+ @fclose($handle);
123
+
124
+ return $bytes == $data->content_length;
125
+
126
+ }
127
+
128
+ }
129
+
130
+ class M1_Bridge_Action_Query
131
+ {
132
+ function perform($bridge)
133
+ {
134
+ if (isset($_POST['query']) && isset($_POST['fetchMode'])) {
135
+ $query = base64_decode($_POST['query']);
136
+
137
+ $res = $bridge->query($query, (int)$_POST['fetchMode']);
138
+
139
+ if (is_array($res['result']) || is_bool($res['result'])) {
140
+ $result = serialize(array(
141
+ 'res' => $res['result'],
142
+ 'fetchedFields' => @$res['fetchedFields'],
143
+ 'insertId' => $bridge->getLink()->getLastInsertId(),
144
+ 'affectedRows' => $bridge->getLink()->getAffectedRows(),
145
+ ));
146
+
147
+ echo base64_encode($result);
148
+ } else {
149
+ echo base64_encode($res['message']);
150
+ }
151
+ } else {
152
+ return false;
153
+ }
154
+ }
155
+ }
156
+
157
+ class M1_Bridge_Action_Getconfig
158
+ {
159
+
160
+ function parseMemoryLimit($val)
161
+ {
162
+ $last = strtolower($val[strlen($val)-1]);
163
+ switch($last) {
164
+ case 'g':
165
+ $val *= 1024;
166
+ case 'm':
167
+ $val *= 1024;
168
+ case 'k':
169
+ $val *= 1024;
170
+ }
171
+
172
+ return $val;
173
+ }
174
+
175
+ function getMemoryLimit()
176
+ {
177
+ $memoryLimit = trim(@ini_get('memory_limit'));
178
+ if (strlen($memoryLimit) === 0) {
179
+ $memoryLimit = "0";
180
+ }
181
+ $memoryLimit = $this->parseMemoryLimit($memoryLimit);
182
+
183
+ $maxPostSize = trim(@ini_get('post_max_size'));
184
+ if (strlen($maxPostSize) === 0) {
185
+ $maxPostSize = "0";
186
+ }
187
+ $maxPostSize = $this->parseMemoryLimit($maxPostSize);
188
+
189
+ $suhosinMaxPostSize = trim(@ini_get('suhosin.post.max_value_length'));
190
+ if (strlen($suhosinMaxPostSize) === 0) {
191
+ $suhosinMaxPostSize = "0";
192
+ }
193
+ $suhosinMaxPostSize = $this->parseMemoryLimit($suhosinMaxPostSize);
194
+
195
+ if ($suhosinMaxPostSize == 0) {
196
+ $suhosinMaxPostSize = $maxPostSize;
197
+ }
198
+
199
+ if ($maxPostSize == 0) {
200
+ $suhosinMaxPostSize = $maxPostSize = $memoryLimit;
201
+ }
202
+
203
+ return min($suhosinMaxPostSize, $maxPostSize, $memoryLimit);
204
+ }
205
+
206
+ function isZlibSupported()
207
+ {
208
+ return function_exists('gzdecode');
209
+ }
210
+
211
+ function perform($bridge)
212
+ {
213
+ if (!defined("DEFAULT_LANGUAGE_ISO2")) {
214
+ define("DEFAULT_LANGUAGE_ISO2", ""); //variable for Interspire cart
215
+ }
216
+
217
+ $result = array(
218
+ "images" => array(
219
+ "imagesPath" => $bridge->config->imagesDir, // path to images folder - relative to store root
220
+ "categoriesImagesPath" => $bridge->config->categoriesImagesDir,
221
+ "categoriesImagesPaths" => $bridge->config->categoriesImagesDirs,
222
+ "productsImagesPath" => $bridge->config->productsImagesDir,
223
+ "productsImagesPaths" => $bridge->config->productsImagesDirs,
224
+ "manufacturersImagesPath" => $bridge->config->manufacturersImagesDir,
225
+ "manufacturersImagesPaths" => $bridge->config->manufacturersImagesDirs,
226
+ ),
227
+ "languages" => $bridge->config->languages,
228
+ "baseDirFs" => M1_STORE_BASE_DIR, // filesystem path to store root
229
+ "defaultLanguageIso2" => DEFAULT_LANGUAGE_ISO2,
230
+ "databaseName" => $bridge->config->Dbname,
231
+ "memoryLimit" => $this->getMemoryLimit(),
232
+ "zlibSupported" => $this->isZlibSupported(),
233
+ //"orderStatus" => $bridge->config->orderStatus,
234
+ "cartVars" => $bridge->config->cartVars,
235
+ );
236
+
237
+ echo serialize($result);
238
+ }
239
+
240
+ }
241
+
242
+
243
+ class M1_Bridge_Action_Batchsavefile extends M1_Bridge_Action_Savefile
244
+ {
245
+ function perform($bridge) {
246
+ $result = array();
247
+
248
+ foreach ($_POST['files'] as $fileInfo) {
249
+ $result[$fileInfo['id']] = $this->_saveFile(
250
+ $fileInfo['source'],
251
+ $fileInfo['target'],
252
+ (int)$fileInfo['width'],
253
+ (int)$fileInfo['height'],
254
+ $fileInfo['local_source']
255
+ );
256
+ }
257
+
258
+ echo serialize($result);
259
+ }
260
+
261
+ }
262
+
263
+ class M1_Bridge_Action_Deleteimages
264
+ {
265
+ function perform($bridge)
266
+ {
267
+ switch($bridge->config->cartType) {
268
+ case "Pinnacle361":
269
+ $this->_PinnacleDeleteImages($bridge);
270
+ break;
271
+ case "Prestashop11":
272
+ $this->_PrestaShopDeleteImages($bridge);
273
+ break;
274
+ case 'Summercart3' :
275
+ $this->_SummercartDeleteImages($bridge);
276
+ break;
277
+ }
278
+ }
279
+
280
+ function _PinnacleDeleteImages($bridge)
281
+ {
282
+ $dirs = array(
283
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'catalog/',
284
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'manufacturers/',
285
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'products/',
286
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'products/thumbs/',
287
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'products/secondary/',
288
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'products/preview/',
289
+ );
290
+
291
+ $ok = true;
292
+
293
+ foreach($dirs as $dir) {
294
+
295
+ if( !file_exists( $dir ) ) {
296
+ continue;
297
+ }
298
+
299
+ $dirHandle = opendir($dir);
300
+
301
+ while (false !== ($file = readdir($dirHandle))) {
302
+ if ($file != "." && $file != ".." && !preg_match("/^readme\.txt?$/",$file) && !preg_match("/\.bak$/i",$file)) {
303
+ $file_path = $dir . $file;
304
+ if( is_file($file_path) ) {
305
+ if(!rename($file_path, $file_path.".bak")) $ok = false;
306
+ }
307
+ }
308
+ }
309
+
310
+ closedir($dirHandle);
311
+
312
+ }
313
+
314
+ if ($ok) print "OK";
315
+ else print "ERROR";
316
+ }
317
+
318
+ function _PrestaShopDeleteImages($bridge)
319
+ {
320
+ $dirs = array(
321
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'c/',
322
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'p/',
323
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'm/',
324
+ );
325
+
326
+ $ok = true;
327
+
328
+ foreach($dirs as $dir) {
329
+
330
+ if( !file_exists( $dir ) ) {
331
+ continue;
332
+ }
333
+
334
+ $dirHandle = opendir($dir);
335
+
336
+ while (false !== ($file = readdir($dirHandle))) {
337
+ if ($file != "." && $file != ".." && preg_match( "/(\d+).*\.jpg?$/",$file )) {
338
+ $file_path = $dir . $file;
339
+ if( is_file($file_path) ) {
340
+ if(!rename($file_path, $file_path.".bak")) $ok = false;
341
+ }
342
+ }
343
+ }
344
+
345
+ closedir($dirHandle);
346
+
347
+ }
348
+
349
+ if ($ok) print "OK";
350
+ else print "ERROR";
351
+ }
352
+
353
+ function _SummercartDeleteImages($bridge)
354
+ {
355
+ $dirs = array(
356
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'categoryimages/',
357
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'manufacturer/',
358
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'productimages/',
359
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'productthumbs/',
360
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'productboximages/',
361
+ M1_STORE_BASE_DIR . $bridge->config->imagesDir . 'productlargeimages/',
362
+ );
363
+
364
+ $ok = true;
365
+
366
+ foreach($dirs as $dir) {
367
+
368
+ if( !file_exists( $dir ) ) {
369
+ continue;
370
+ }
371
+
372
+ $dirHandle = opendir($dir);
373
+
374
+ while (false !== ($file = readdir($dirHandle))) {
375
+ if (($file != ".") && ($file != "..") && !preg_match("/\.bak$/i",$file) ) {
376
+ $file_path = $dir . $file;
377
+ if( is_file($file_path) ) {
378
+ if(!rename($file_path, $file_path.".bak")) $ok = false;
379
+ }
380
+ }
381
+ }
382
+
383
+ closedir($dirHandle);
384
+
385
+ }
386
+
387
+ if ($ok) print "OK";
388
+ else print "ERROR";
389
+ }
390
+ }
391
+
392
+ class M1_Bridge_Action_Cubecart
393
+ {
394
+ function perform($bridge)
395
+ {
396
+ $dirHandle = opendir(M1_STORE_BASE_DIR . 'language/');
397
+
398
+ $languages = array();
399
+
400
+ while ($dirEntry = readdir($dirHandle)) {
401
+ if (!is_dir(M1_STORE_BASE_DIR . 'language/' . $dirEntry) || $dirEntry == '.' || $dirEntry == '..' || strpos($dirEntry, "_") !== false) {
402
+ continue;
403
+ }
404
+
405
+ $lang['id'] = $dirEntry;
406
+ $lang['iso2'] = $dirEntry;
407
+
408
+ $cnfile = "config.inc.php";
409
+
410
+ if (!file_exists(M1_STORE_BASE_DIR . 'language/' . $dirEntry . '/'. $cnfile)) {
411
+ $cnfile = "config.php";
412
+ }
413
+
414
+ if (!file_exists( M1_STORE_BASE_DIR . 'language/' . $dirEntry . '/'. $cnfile)) {
415
+ continue;
416
+ }
417
+
418
+ $str = file_get_contents(M1_STORE_BASE_DIR . 'language/' . $dirEntry . '/'.$cnfile);
419
+ preg_match("/".preg_quote('$langName')."[\s]*=[\s]*[\"\'](.*)[\"\'];/", $str, $match);
420
+
421
+ if (isset($match[1])) {
422
+ $lang['name'] = $match[1];
423
+ $languages[] = $lang;
424
+ }
425
+ }
426
+
427
+ echo serialize($languages);
428
+ }
429
+ }
430
+
431
+ class M1_Bridge_Action_Mysqlver
432
+ {
433
+ function perform($bridge)
434
+ {
435
+ $m = array();
436
+ preg_match('/^(\d+)\.(\d+)\.(\d+)/', mysql_get_server_info($bridge->getLink()), $m);
437
+ echo sprintf("%d%02d%02d", $m[1], $m[2], $m[3]);
438
+ }
439
+ }
440
+
441
+ class M1_Bridge_Action_Clearcache
442
+ {
443
+ function perform($bridge)
444
+ {
445
+ switch($bridge->config->cartType) {
446
+ case "Cubecart":
447
+ $this->_CubecartClearCache();
448
+ break;
449
+ case "Prestashop11":
450
+ $this->_PrestashopClearCache();
451
+ break;
452
+ case "Interspire":
453
+ $this->_InterspireClearCache();
454
+ break;
455
+ case "Opencart14" :
456
+ $this->_OpencartClearCache();
457
+ break;
458
+ case "XtcommerceVeyton" :
459
+ $this->_Xtcommerce4ClearCache();
460
+ break;
461
+ case "Ubercart" :
462
+ $this->_ubercartClearCache();
463
+ break;
464
+ case "Tomatocart" :
465
+ $this->_tomatocartClearCache();
466
+ break;
467
+ case "Virtuemart113" :
468
+ $this->_virtuemartClearCache();
469
+ break;
470
+ case "Magento1212" :
471
+ //$this->_magentoClearCache();
472
+ break;
473
+ case "Oscommerce3":
474
+ $this->_Oscommerce3ClearCache();
475
+ break;
476
+ case "Oxid":
477
+ $this->_OxidClearCache();
478
+ break;
479
+ case "XCart":
480
+ $this->_XcartClearCache();
481
+ break;
482
+ case "Cscart203":
483
+ $this->_CscartClearCache();
484
+ break;
485
+ case "Prestashop15":
486
+ $this->_Prestashop15ClearCache();
487
+ break;
488
+ case "Gambio":
489
+ $this->_GambioClearCache();
490
+ break;
491
+ }
492
+ }
493
+
494
+ /**
495
+ *
496
+ * @var $fileExclude - name file in format pregmatch
497
+ */
498
+
499
+ function _removeGarbage($dirs = array(), $fileExclude = '')
500
+ {
501
+ $result = true;
502
+
503
+ foreach ($dirs as $dir) {
504
+
505
+ if (!file_exists($dir)) {
506
+ continue;
507
+ }
508
+
509
+ $dirHandle = opendir($dir);
510
+
511
+ while (false !== ($file = readdir($dirHandle))) {
512
+ if ($file == "." || $file == "..") {
513
+ continue;
514
+ }
515
+
516
+ if ((trim($fileExclude) != '') && preg_match("/^" .$fileExclude . "?$/", $file)) {
517
+ continue;
518
+ }
519
+
520
+ if (is_dir($dir . $file)) {
521
+ continue;
522
+ }
523
+
524
+ if (!unlink($dir . $file)) {
525
+ $result = false;
526
+ }
527
+ }
528
+
529
+ closedir($dirHandle);
530
+ }
531
+
532
+ if ($result) {
533
+ echo 'OK';
534
+ } else {
535
+ echo 'ERROR';
536
+ }
537
+
538
+ return $result;
539
+ }
540
+
541
+ function _magentoClearCache()
542
+ {
543
+ chdir('../');
544
+
545
+ $indexes = array(
546
+ 'catalog_product_attribute',
547
+ 'catalog_product_price',
548
+ 'catalog_url',
549
+ 'catalog_product_flat',
550
+ 'catalog_category_flat',
551
+ 'catalog_category_product',
552
+ 'catalogsearch_fulltext',
553
+ 'cataloginventory_stock',
554
+ 'tag_summary'
555
+ );
556
+
557
+ $phpExecutable = getPHPExecutable();
558
+ if ($phpExecutable) {
559
+ foreach ($indexes as $index) {
560
+ exec($phpExecutable . " shell/indexer.php --reindex $index", $out);
561
+ }
562
+ echo 'OK';
563
+ } else {
564
+ echo 'Error: can not find PHP executable file.';
565
+ }
566
+
567
+ echo 'OK';
568
+ }
569
+
570
+ function _InterspireClearCache()
571
+ {
572
+ $res = true;
573
+ $file = M1_STORE_BASE_DIR . 'cache' . DIRECTORY_SEPARATOR . 'datastore' . DIRECTORY_SEPARATOR . 'RootCategories.php';
574
+ if (file_exists($file)) {
575
+ if (!unlink($file)) {
576
+ $res = false;
577
+ }
578
+ }
579
+ if ($res === true) {
580
+ echo "OK";
581
+ } else {
582
+ echo "ERROR";
583
+ }
584
+ }
585
+
586
+ function _CubecartClearCache()
587
+ {
588
+ $ok = true;
589
+
590
+ if (file_exists(M1_STORE_BASE_DIR . 'cache')) {
591
+ $dirHandle = opendir(M1_STORE_BASE_DIR . 'cache/');
592
+
593
+ while (false !== ($file = readdir($dirHandle))) {
594
+ if ($file != "." && $file != ".." && !preg_match("/^index\.html?$/", $file) && !preg_match("/^\.htaccess?$/", $file)) {
595
+ if (is_file( M1_STORE_BASE_DIR . 'cache/' . $file)) {
596
+ if (!unlink(M1_STORE_BASE_DIR . 'cache/' . $file)) {
597
+ $ok = false;
598
+ }
599
+ }
600
+ }
601
+ }
602
+
603
+ closedir($dirHandle);
604
+ }
605
+
606
+ if (file_exists(M1_STORE_BASE_DIR.'includes/extra/admin_cat_cache.txt')) {
607
+ unlink(M1_STORE_BASE_DIR.'includes/extra/admin_cat_cache.txt');
608
+ }
609
+
610
+ if ($ok) {
611
+ echo 'OK';
612
+ } else {
613
+ echo 'ERROR';
614
+ }
615
+ }
616
+
617
+ function _PrestashopClearCache()
618
+ {
619
+ $dirs = array(
620
+ M1_STORE_BASE_DIR . 'tools/smarty/compile/',
621
+ M1_STORE_BASE_DIR . 'tools/smarty/cache/',
622
+ M1_STORE_BASE_DIR . 'img/tmp/'
623
+ );
624
+
625
+ $this->_removeGarbage($dirs, 'index\.php');
626
+ }
627
+
628
+ function _OpencartClearCache()
629
+ {
630
+ $dirs = array(
631
+ M1_STORE_BASE_DIR . 'system/cache/',
632
+ );
633
+
634
+ $this->_removeGarbage($dirs, 'index\.html');
635
+ }
636
+
637
+ function _Xtcommerce4ClearCache()
638
+ {
639
+ $dirs = array(
640
+ M1_STORE_BASE_DIR . 'cache/',
641
+ );
642
+
643
+ $this->_removeGarbage($dirs, 'index\.html');
644
+ }
645
+
646
+ function _ubercartClearCache()
647
+ {
648
+ $dirs = array(
649
+ M1_STORE_BASE_DIR . 'sites/default/files/imagecache/product/',
650
+ M1_STORE_BASE_DIR . 'sites/default/files/imagecache/product_full/',
651
+ M1_STORE_BASE_DIR . 'sites/default/files/imagecache/product_list/',
652
+ M1_STORE_BASE_DIR . 'sites/default/files/imagecache/uc_category/',
653
+ M1_STORE_BASE_DIR . 'sites/default/files/imagecache/uc_thumbnail/',
654
+ );
655
+
656
+ $this->_removeGarbage($dirs);
657
+ }
658
+
659
+ function _tomatocartClearCache()
660
+ {
661
+ $dirs = array(
662
+ M1_STORE_BASE_DIR . 'includes/work/',
663
+ );
664
+
665
+ $this->_removeGarbage($dirs, '\.htaccess');
666
+ }
667
+
668
+ /**
669
+ * Try chage permissions actually :)
670
+ */
671
+ function _virtuemartClearCache()
672
+ {
673
+ $pathToImages = 'components/com_virtuemart/shop_image';
674
+
675
+ $dirParts = explode("/", $pathToImages);
676
+ $path = M1_STORE_BASE_DIR;
677
+ foreach ($dirParts as $item) {
678
+ if ($item == '') {
679
+ continue;
680
+ }
681
+
682
+ $path .= $item . DIRECTORY_SEPARATOR;
683
+ @chmod($path, 0755);
684
+ }
685
+ }
686
+
687
+ function _Oscommerce3ClearCache()
688
+ {
689
+ $dirs = array(
690
+ M1_STORE_BASE_DIR . 'osCommerce/OM/Work/Cache/',
691
+ );
692
+
693
+ $this->_removeGarbage($dirs, '\.htaccess');
694
+ }
695
+
696
+ function _GambioClearCache()
697
+ {
698
+ $dirs = array(
699
+ M1_STORE_BASE_DIR . 'cache/',
700
+ );
701
+
702
+ $this->_removeGarbage($dirs, 'index\.html');
703
+ }
704
+
705
+ function _OxidClearCache()
706
+ {
707
+ $dirs = array(
708
+ M1_STORE_BASE_DIR . 'tmp/',
709
+ );
710
+
711
+ $this->_removeGarbage($dirs, '\.htaccess');
712
+ }
713
+
714
+ function _XcartClearCache()
715
+ {
716
+ $dirs = array(
717
+ M1_STORE_BASE_DIR . 'var/cache/',
718
+ );
719
+
720
+ $this->_removeGarbage($dirs, '\.htaccess');
721
+ }
722
+
723
+ function _CscartClearCache()
724
+ {
725
+ $dir = M1_STORE_BASE_DIR . 'var/cache/';
726
+ $res = $this->removeDirRec($dir);
727
+
728
+ if ($res) {
729
+ echo 'OK';
730
+ } else {
731
+ echo 'ERROR';
732
+ }
733
+ }
734
+
735
+ function _Prestashop15ClearCache()
736
+ {
737
+ $dirs = array(
738
+ M1_STORE_BASE_DIR . 'cache/smarty/compile/',
739
+ M1_STORE_BASE_DIR . 'cache/smarty/cache/',
740
+ M1_STORE_BASE_DIR . 'img/tmp/'
741
+ );
742
+
743
+ $this->_removeGarbage($dirs, 'index\.php');
744
+ }
745
+
746
+ function removeDirRec($dir)
747
+ {
748
+ $result = true;
749
+
750
+ if ($objs = glob($dir."/*")) {
751
+ foreach ($objs as $obj) {
752
+ if (is_dir($obj)) {
753
+ //print "IS DIR! START RECURSIVE FUNCTION.\n";
754
+ $this->removeDirRec($obj);
755
+ } else {
756
+ if (!unlink($obj)) {
757
+ //print "!UNLINK FILE: ".$obj."\n";
758
+ $result = false;
759
+ }
760
+ }
761
+ }
762
+ }
763
+ if (!rmdir($dir)) {
764
+ //print "ERROR REMOVE DIR: ".$dir."\n";
765
+ $result = false;
766
+ }
767
+
768
+ return $result;
769
+ }
770
+ }
771
+
772
+
773
+ class M1_Bridge_Action_Basedirfs
774
+ {
775
+ function perform($bridge)
776
+ {
777
+ echo M1_STORE_BASE_DIR;
778
+ }
779
+ }
780
+
781
+ class M1_Bridge_Action_Phpinfo
782
+ {
783
+ function perform($bridge)
784
+ {
785
+ phpinfo();
786
+ }
787
+ }
788
+
789
+
790
+ class M1_Bridge_Action_Savefile
791
+ {
792
+ var $_imageType = null;
793
+
794
+ function perform($bridge)
795
+ {
796
+ $source = $_POST['src'];
797
+ $destination = $_POST['dst'];
798
+ $width = (int)$_POST['width'];
799
+ $height = (int)$_POST['height'];
800
+ $local = $_POST['local_source'];
801
+
802
+ echo $this->_saveFile($source, $destination, $width, $height, $local);
803
+ }
804
+
805
+ function _saveFile($source, $destination, $width, $height, $local = '')
806
+ {
807
+ if (trim($local) != '') {
808
+
809
+ if ($this->_copyLocal($local, $destination, $width, $height)) {
810
+ return "OK";
811
+ }
812
+
813
+ }
814
+
815
+ if (!preg_match('/^https?:\/\//i', $source)) {
816
+ $result = $this->_createFile($source, $destination);
817
+ } elseif ($this->_isSameHost($source)) {
818
+ $result = $this->_saveFileLocal($source, $destination);
819
+ } else {
820
+ $result = $this->_saveFileCurl($source, $destination);
821
+ }
822
+
823
+ if ($result != "OK") {
824
+ return $result;
825
+ }
826
+
827
+ $destination = M1_STORE_BASE_DIR . $destination;
828
+
829
+ if ($width != 0 && $height != 0) {
830
+ $this->_scaled2( $destination, $width, $height );
831
+ }
832
+
833
+ if ($this->cartType == "Prestashop11") {
834
+ // convert destination.gif(png) to destination.jpg
835
+ $imageGd = $this->_loadImage($destination);
836
+
837
+ if ($imageGd === false) {
838
+ return $result;
839
+ }
840
+
841
+ if (!$this->_convert($imageGd, $destination, IMAGETYPE_JPEG, 'jpg')) {
842
+ return "CONVERT FAILED";
843
+ }
844
+ }
845
+
846
+ return $result;
847
+ }
848
+
849
+ function _copyLocal($source, $destination, $width, $height)
850
+ {
851
+ $source = M1_STORE_BASE_DIR . $source;
852
+ $destination = M1_STORE_BASE_DIR . $destination;
853
+
854
+ if (!@copy($source, $destination)) {
855
+ return false;
856
+ }
857
+
858
+ if ($width != 0 && $height != 0) {
859
+ $this->_scaled2($destination, $width, $height);
860
+ }
861
+
862
+ return true;
863
+ }
864
+
865
+ function _loadImage($filename, $skipJpg = true)
866
+ {
867
+ $imageInfo = @getimagesize($filename);
868
+ if ($imageInfo === false) {
869
+ return false;
870
+ }
871
+
872
+ $this->_imageType = $imageInfo[2];
873
+
874
+ switch ($this->_imageType) {
875
+ case IMAGETYPE_JPEG:
876
+ $image = imagecreatefromjpeg($filename);
877
+ break;
878
+ case IMAGETYPE_GIF:
879
+ $image = imagecreatefromgif($filename);
880
+ break;
881
+ case IMAGETYPE_PNG:
882
+ $image = imagecreatefrompng($filename);
883
+ break;
884
+ default:
885
+ return false;
886
+ }
887
+
888
+ if ($skipJpg && ($this->_imageType == IMAGETYPE_JPEG)) {
889
+ return false;
890
+ }
891
+
892
+ return $image;
893
+ }
894
+
895
+ function _saveImage($image, $filename, $imageType = IMAGETYPE_JPEG, $compression = 85, $permissions = null)
896
+ {
897
+ $result = true;
898
+ if ($imageType == IMAGETYPE_JPEG) {
899
+ $result = imagejpeg($image, $filename, $compression);
900
+ } elseif ($imageType == IMAGETYPE_GIF) {
901
+ $result = imagegif($image, $filename);
902
+ } elseif ($imageType == IMAGETYPE_PNG) {
903
+ $result = imagepng($image, $filename);
904
+ }
905
+
906
+ if ($permissions != null) {
907
+ chmod($filename, $permissions);
908
+ }
909
+
910
+ imagedestroy($image);
911
+
912
+ return $result;
913
+ }
914
+
915
+ function _createFile($source, $destination)
916
+ {
917
+ if ($this->_create_dir(dirname($destination)) !== false) {
918
+ $destination = M1_STORE_BASE_DIR . $destination;
919
+ $body = base64_decode($source);
920
+ if ($body === false || file_put_contents($destination, $body) === false) {
921
+ return '[BRIDGE ERROR] File save failed!';
922
+ }
923
+
924
+ return 'OK';
925
+ }
926
+
927
+ return '[BRIDGE ERROR] Directory creation failed!';
928
+ }
929
+
930
+ function _saveFileLocal($source, $destination)
931
+ {
932
+ $srcInfo = parse_url($source);
933
+ $src = rtrim($_SERVER['DOCUMENT_ROOT'], "/") . $srcInfo['path'];
934
+
935
+ if ($this->_create_dir(dirname($destination)) !== false) {
936
+ $dst = M1_STORE_BASE_DIR . $destination;
937
+
938
+ if (!@copy($src, $dst)) {
939
+ return $this->_saveFileCurl($source, $destination);
940
+ }
941
+
942
+ } else {
943
+ return "[BRIDGE ERROR] Directory creation failed!";
944
+ }
945
+
946
+ return "OK";
947
+ }
948
+
949
+ function _saveFileCurl($source, $destination)
950
+ {
951
+ $source = $this->_escapeSource($source);
952
+ if ($this->_create_dir(dirname($destination)) !== false) {
953
+ $destination = M1_STORE_BASE_DIR . $destination;
954
+
955
+ $ch = curl_init();
956
+ curl_setopt($ch, CURLOPT_URL, $source);
957
+ curl_setopt($ch, CURLOPT_HEADER, 0);
958
+ curl_setopt($ch, CURLOPT_TIMEOUT, 60);
959
+ curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
960
+ curl_setopt($ch, CURLOPT_NOBODY, true);
961
+ curl_exec($ch);
962
+ $httpResponseCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
963
+
964
+ if ($httpResponseCode != 200) {
965
+ curl_close($ch);
966
+ return "[BRIDGE ERROR] Bad response received from source, HTTP code $httpResponseCode!";
967
+ }
968
+
969
+ $dst = @fopen($destination, "wb");
970
+ if ($dst === false) {
971
+ return "[BRIDGE ERROR] Can't create $destination!";
972
+ }
973
+ curl_setopt($ch, CURLOPT_NOBODY, false);
974
+ curl_setopt($ch, CURLOPT_FILE, $dst);
975
+ curl_setopt($ch, CURLOPT_HTTPGET, true);
976
+ curl_exec($ch);
977
+ if (($error_no = curl_errno($ch)) != CURLE_OK) {
978
+ return "[BRIDGE ERROR] $error_no: " . curl_error($ch);
979
+ }
980
+ curl_close($ch);
981
+ @chmod($destination, 0777);
982
+
983
+ return "OK";
984
+
985
+ } else {
986
+ return "[BRIDGE ERROR] Directory creation failed!";
987
+ }
988
+ }
989
+
990
+ function _escapeSource($source)
991
+ {
992
+ return str_replace(" ", "%20", $source);
993
+ }
994
+
995
+ function _create_dir($dir) {
996
+ $dirParts = explode("/", $dir);
997
+ $path = M1_STORE_BASE_DIR;
998
+ foreach ($dirParts as $item) {
999
+ if ($item == '') {
1000
+ continue;
1001
+ }
1002
+ $path .= $item . DIRECTORY_SEPARATOR;
1003
+ if (!is_dir($path)) {
1004
+ $res = @mkdir($path);
1005
+ if (!$res) {
1006
+ return false;
1007
+ }
1008
+ }
1009
+ @chmod($path, 0777);
1010
+ }
1011
+ return true;
1012
+ }
1013
+
1014
+ function _isSameHost($source)
1015
+ {
1016
+ $srcInfo = parse_url($source);
1017
+
1018
+ if (preg_match('/\.php$/', $srcInfo['path'])) {
1019
+ return false;
1020
+ }
1021
+
1022
+ $hostInfo = parse_url("http://" . $_SERVER['HTTP_HOST']);
1023
+ if (@$srcInfo['host'] == $hostInfo['host']) {
1024
+ return true;
1025
+ }
1026
+
1027
+ return false;
1028
+ }
1029
+
1030
+ /**
1031
+ * @param $image - GD image object
1032
+ * @param $filename - store sorce pathfile ex. M1_STORE_BASE_DIR . '/img/c/2.gif';
1033
+ * @param $type - IMAGETYPE_JPEG, IMAGETYPE_GIF or IMAGETYPE_PNG
1034
+ * @param $extension - file extension, this use for jpg or jpeg extension in prestashop
1035
+ *
1036
+ * @return true if success or false if no
1037
+ */
1038
+ function _convert($image, $filename, $type = IMAGETYPE_JPEG, $extension = '')
1039
+ {
1040
+ $end = pathinfo($filename, PATHINFO_EXTENSION);
1041
+
1042
+ if ($extension == '') {
1043
+ $extension = image_type_to_extension($type, false);
1044
+ }
1045
+
1046
+ if ($end == $extension) {
1047
+ return true;
1048
+ }
1049
+
1050
+ $width = imagesx($image);
1051
+ $height = imagesy($image);
1052
+
1053
+ $newImage = imagecreatetruecolor($width, $height);
1054
+
1055
+ /* Allow to keep nice look even if resized */
1056
+ $white = imagecolorallocate($newImage, 255, 255, 255);
1057
+ imagefill($newImage, 0, 0, $white);
1058
+ imagecopyresampled($newImage, $image, 0, 0, 0, 0, $width, $height, $width, $height );
1059
+ imagecolortransparent($newImage, $white);
1060
+
1061
+ $pathSave = rtrim($filename, $end);
1062
+
1063
+ $pathSave .= $extension;
1064
+
1065
+ return $this->_saveImage($newImage, $pathSave, $type);
1066
+ }
1067
+
1068
+ function _scaled($destination, $width, $height)
1069
+ {
1070
+ $image = $this->_loadImage($destination, false);
1071
+
1072
+ if ($image === false) {
1073
+ return;
1074
+ }
1075
+
1076
+ $originWidth = imagesx( $image );
1077
+ $originHeight = imagesy( $image );
1078
+
1079
+ $rw = (int)$height * (int)$originWidth / (int)$originHeight;
1080
+ $useHeight = ($rw <= $width);
1081
+
1082
+ if ($useHeight) {
1083
+ $width = (int)$rw;
1084
+ } else {
1085
+ $height = (int)((int)($width) * (int)($originHeight) / (int)($originWidth));
1086
+ }
1087
+
1088
+ $newImage = imagecreatetruecolor($width, $height);
1089
+ $white = imagecolorallocate($newImage, 255, 255, 255);
1090
+ imagefill($newImage, 0, 0, $white);
1091
+ imagecopyresampled($newImage, $image, 0, 0, 0, 0, $width, $height, $originWidth, $originHeight);
1092
+ imagecolortransparent($newImage, $white);
1093
+
1094
+ return $this->_saveImage($newImage, $destination, $this->_imageType, 100) ? "OK" : "CAN'T SCALE IMAGE";
1095
+ }
1096
+
1097
+ //scaled2 method optimizet for prestashop
1098
+ function _scaled2($destination, $destWidth, $destHeight)
1099
+ {
1100
+ $method = 0;
1101
+
1102
+ $sourceImage = $this->_loadImage($destination, false);
1103
+
1104
+ if ($sourceImage === false) {
1105
+ return "IMAGE NOT SUPPORTED";
1106
+ }
1107
+
1108
+ $sourceWidth = imagesx($sourceImage);
1109
+ $sourceHeight = imagesy($sourceImage);
1110
+
1111
+ $widthDiff = $destWidth / $sourceWidth;
1112
+ $heightDiff = $destHeight / $sourceHeight;
1113
+
1114
+ if ($widthDiff > 1 && $heightDiff > 1) {
1115
+ $nextWidth = $sourceWidth;
1116
+ $nextHeight = $sourceHeight;
1117
+ } else {
1118
+ if (intval($method) == 2 || (intval($method) == 0 AND $widthDiff > $heightDiff)) {
1119
+ $nextHeight = $destHeight;
1120
+ $nextWidth = intval(($sourceWidth * $nextHeight) / $sourceHeight);
1121
+ $destWidth = ((intval($method) == 0 ) ? $destWidth : $nextWidth);
1122
+ } else {
1123
+ $nextWidth = $destWidth;
1124
+ $nextHeight = intval($sourceHeight * $destWidth / $sourceWidth);
1125
+ $destHeight = (intval($method) == 0 ? $destHeight : $nextHeight);
1126
+ }
1127
+ }
1128
+
1129
+ $borderWidth = intval(($destWidth - $nextWidth) / 2);
1130
+ $borderHeight = intval(($destHeight - $nextHeight) / 2);
1131
+
1132
+ $destImage = imagecreatetruecolor($destWidth, $destHeight);
1133
+
1134
+ $white = imagecolorallocate($destImage, 255, 255, 255);
1135
+ imagefill($destImage, 0, 0, $white);
1136
+
1137
+ imagecopyresampled($destImage, $sourceImage, $borderWidth, $borderHeight, 0, 0, $nextWidth, $nextHeight, $sourceWidth, $sourceHeight);
1138
+ imagecolortransparent($destImage, $white);
1139
+
1140
+ return $this->_saveImage($destImage, $destination, $this->_imageType, 100) ? "OK" : "CAN'T SCALE IMAGE";
1141
+ }
1142
+ }
1143
+
1144
+ /**
1145
+ * @package api2cart
1146
+ * @author Vasul Babiy (v.babyi@magneticone.com)
1147
+ * @license Not public license
1148
+ * @link https://www.api2cart.com
1149
+ */
1150
+
1151
+ class M1_Mysqli
1152
+ {
1153
+ var $config = null; // config adapter
1154
+ var $result = array();
1155
+ var $dataBaseHandle = null;
1156
+
1157
+ /**
1158
+ * mysql constructor
1159
+ *
1160
+ * @param M1_Config_Adapter $config
1161
+ * @return M1_Mysql
1162
+ */
1163
+ function M1_Mysqli($config)
1164
+ {
1165
+ $this->config = $config;
1166
+ }
1167
+
1168
+ /**
1169
+ * @return bool|null|resource
1170
+ */
1171
+ function getDataBaseHandle()
1172
+ {
1173
+ if ($this->dataBaseHandle) {
1174
+ return $this->dataBaseHandle;
1175
+ }
1176
+
1177
+ $this->dataBaseHandle = $this->connect();
1178
+
1179
+ if (!$this->dataBaseHandle) {
1180
+ exit('[ERROR] MySQLi Query Error: Can not connect to DB');
1181
+ }
1182
+
1183
+ return $this->dataBaseHandle;
1184
+ }
1185
+
1186
+ /**
1187
+ * @return bool|null|resource
1188
+ */
1189
+ function connect()
1190
+ {
1191
+ $triesCount = 10;
1192
+ $link = null;
1193
+ $host = $this->config->Host . ($this->config->Port ? ':' . $this->config->Port : '');
1194
+ $password = stripslashes($this->config->Password);
1195
+
1196
+ while (!$link) {
1197
+ if (!$triesCount--) {
1198
+ break;
1199
+ }
1200
+
1201
+ $link = @mysqli_connect($host, $this->config->Username, $password);
1202
+ if (!$link) {
1203
+ sleep(5);
1204
+ }
1205
+ }
1206
+
1207
+ if ($link) {
1208
+ mysqli_select_db($link, $this->config->Dbname);
1209
+ } else {
1210
+ return false;
1211
+ }
1212
+
1213
+ return $link;
1214
+ }
1215
+
1216
+ /**
1217
+ * @param $sql
1218
+ *
1219
+ * @return array|bool|mysqli_result
1220
+ */
1221
+ function localQuery($sql)
1222
+ {
1223
+ $result = array();
1224
+ $dataBaseHandle = $this->getDataBaseHandle();
1225
+
1226
+ $sth = mysqli_query($dataBaseHandle, $sql);
1227
+
1228
+ if (is_bool($sth)) {
1229
+ return $sth;
1230
+ }
1231
+
1232
+ while (($row = mysqli_fetch_assoc($sth))) {
1233
+ $result[] = $row;
1234
+ }
1235
+
1236
+ return $result;
1237
+ }
1238
+
1239
+ /**
1240
+ * @param $sql
1241
+ * @param $fetchType
1242
+ *
1243
+ * @return array
1244
+ */
1245
+ function query($sql, $fetchType)
1246
+ {
1247
+ $result = array(
1248
+ 'result' => null,
1249
+ 'message' => ''
1250
+ );
1251
+
1252
+ $dataBaseHandle = $this->getDataBaseHandle();
1253
+
1254
+ if (!$dataBaseHandle) {
1255
+ $result['message'] = '[ERROR] MySQLi Query Error: Can not connect to DB';
1256
+ return $result;
1257
+ }
1258
+
1259
+ if (isset($_GET['disable_checks'])) {
1260
+ $this->localQuery('SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0');
1261
+ $this->localQuery("SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'");
1262
+ }
1263
+
1264
+ if (isset($_REQUEST['set_names'])) {
1265
+ @mysqli_query($dataBaseHandle, "SET NAMES " . @mysqli_real_escape_string($dataBaseHandle, $_REQUEST['set_names']));
1266
+ @mysqli_query($dataBaseHandle, "SET CHARACTER SET " . @mysqli_real_escape_string($dataBaseHandle, $_REQUEST['set_names']));
1267
+ @mysqli_query($dataBaseHandle, "SET CHARACTER_SET_CONNECTION=" . @mysqli_real_escape_string($dataBaseHandle, $_REQUEST['set_names']));
1268
+ }
1269
+
1270
+ $fetchMode = MYSQLI_ASSOC;
1271
+ switch ($fetchType) {
1272
+ case 3:
1273
+ $fetchMode = MYSQLI_BOTH;
1274
+ break;
1275
+ case 2:
1276
+ $fetchMode = MYSQLI_NUM;
1277
+ break;
1278
+ case 1:
1279
+ $fetchMode = MYSQLI_ASSOC;
1280
+ break;
1281
+ default:
1282
+ break;
1283
+ }
1284
+
1285
+ $res = mysqli_query($dataBaseHandle, $sql);
1286
+
1287
+ $triesCount = 10;
1288
+ while (mysqli_errno($dataBaseHandle) == 2013) {
1289
+ if (!$triesCount--) {
1290
+ break;
1291
+ }
1292
+ // reconnect
1293
+ $dataBaseHandle = $this->getDataBaseHandle();
1294
+ if ($dataBaseHandle) {
1295
+
1296
+ if (isset($_REQUEST['set_names'])) {
1297
+ @mysqli_query($dataBaseHandle, "SET NAMES " . @mysqli_real_escape_string($dataBaseHandle, $_REQUEST['set_names']));
1298
+ @mysqli_query($dataBaseHandle, "SET CHARACTER SET " . @mysqli_real_escape_string($dataBaseHandle, $_REQUEST['set_names']));
1299
+ @mysqli_query($dataBaseHandle, "SET CHARACTER_SET_CONNECTION=" . @mysqli_real_escape_string($dataBaseHandle, $_REQUEST['set_names']));
1300
+ }
1301
+
1302
+ // execute query once again
1303
+ $res = mysqli_query($dataBaseHandle, $sql);
1304
+ }
1305
+ }
1306
+
1307
+ if (($errno = mysqli_errno($dataBaseHandle)) != 0) {
1308
+ $result['message'] = '[ERROR] MySQLi Query Error: ' . $errno . ', ' . mysqli_error($dataBaseHandle);
1309
+ return $result;
1310
+ }
1311
+
1312
+ $fetchedFields = array();
1313
+ while ($field = mysqli_fetch_field($res)) {
1314
+ $fetchedFields[] = $field;
1315
+ }
1316
+
1317
+ $rows = array();
1318
+ while ($row = mysqli_fetch_array($res, $fetchMode)) {
1319
+ $rows[] = $row;
1320
+ }
1321
+
1322
+ if (isset($_GET['disable_checks'])) {
1323
+ $this->localQuery("SET SQL_MODE=IFNULL(@OLD_SQL_MODE,'')");
1324
+ $this->localQuery("SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS,0)");
1325
+ }
1326
+
1327
+ $result['result'] = $rows;
1328
+ $result['fetchedFields'] = $fetchedFields;
1329
+
1330
+ mysqli_free_result($res);
1331
+
1332
+ return $result;
1333
+ }
1334
+
1335
+ /**
1336
+ * @return int
1337
+ */
1338
+ function getLastInsertId()
1339
+ {
1340
+ return mysqli_insert_id($this->dataBaseHandle);
1341
+ }
1342
+
1343
+ /**
1344
+ * @return int
1345
+ */
1346
+ function getAffectedRows()
1347
+ {
1348
+ return mysqli_affected_rows($this->dataBaseHandle);
1349
+ }
1350
+
1351
+ /**
1352
+ * @return void
1353
+ */
1354
+ function __destruct()
1355
+ {
1356
+ if ($this->dataBaseHandle) {
1357
+ mysqli_close($this->dataBaseHandle);
1358
+ }
1359
+
1360
+ $this->dataBaseHandle = null;
1361
+ }
1362
+
1363
+ }
1364
+
1365
+
1366
+ class M1_Config_Adapter_Woocommerce extends M1_Config_Adapter
1367
+ {
1368
+ function M1_Config_Adapter_Woocommerce()
1369
+ {
1370
+ //@include_once M1_STORE_BASE_DIR . "wp-config.php";
1371
+ if (file_exists(M1_STORE_BASE_DIR . 'wp-config.php')) {
1372
+ $config = file_get_contents(M1_STORE_BASE_DIR . 'wp-config.php');
1373
+ } else {
1374
+ $config = file_get_contents(dirname(M1_STORE_BASE_DIR) . '/wp-config.php');
1375
+ }
1376
+
1377
+ preg_match('/define\s*\(\s*\'DB_NAME\',\s*\'(.+)\'\s*\)\s*;/', $config, $match);
1378
+ $this->Dbname = $match[1];
1379
+ preg_match('/define\s*\(\s*\'DB_USER\',\s*\'(.+)\'\s*\)\s*;/', $config, $match);
1380
+ $this->Username = $match[1];
1381
+ preg_match('/define\s*\(\s*\'DB_PASSWORD\',\s*\'(.*)\'\s*\)\s*;/', $config, $match);
1382
+ $this->Password = $match[1];
1383
+ preg_match('/define\s*\(\s*\'DB_HOST\',\s*\'(.+)\'\s*\)\s*;/', $config, $match);
1384
+ $this->setHostPort( $match[1] );
1385
+ preg_match('/\$table_prefix\s*=\s*\'(.*)\'\s*;/', $config, $match);
1386
+ $this->TblPrefix = $match[1];
1387
+ $version = $this->getCartVersionFromDb("option_value", "options", "option_name = 'woocommerce_db_version'");
1388
+
1389
+ if ( $version != '' ) {
1390
+ $this->cartVars['dbVersion'] = $version;
1391
+ }
1392
+
1393
+ $this->cartVars['categoriesDirRelative'] = 'images/categories/';
1394
+ $this->cartVars['productsDirRelative'] = 'images/products/';
1395
+ $this->imagesDir = "wp-content/uploads/images/";
1396
+ $this->categoriesImagesDir = $this->imagesDir . 'categories/';
1397
+ $this->productsImagesDir = $this->imagesDir . 'products/';
1398
+ $this->manufacturersImagesDir = $this->imagesDir;
1399
+ }
1400
+ }
1401
+
1402
+
1403
+
1404
+ class M1_Config_Adapter_Ubercart extends M1_Config_Adapter
1405
+ {
1406
+ function M1_Config_Adapter_Ubercart()
1407
+ {
1408
+ @include_once M1_STORE_BASE_DIR . "sites/default/settings.php";
1409
+
1410
+ $url = parse_url($db_url);
1411
+
1412
+ $url['user'] = urldecode($url['user']);
1413
+ // Test if database url has a password.
1414
+ $url['pass'] = isset($url['pass']) ? urldecode($url['pass']) : '';
1415
+ $url['host'] = urldecode($url['host']);
1416
+ $url['path'] = urldecode($url['path']);
1417
+ // Allow for non-standard MySQL port.
1418
+ if (isset($url['port'])) {
1419
+ $url['host'] = $url['host'] .':'. $url['port'];
1420
+ }
1421
+
1422
+ $this->setHostPort( $url['host'] );
1423
+ $this->Dbname = ltrim( $url['path'], '/' );
1424
+ $this->Username = $url['user'];
1425
+ $this->Password = $url['pass'];
1426
+
1427
+ $this->imagesDir = "/sites/default/files/";
1428
+ if( !file_exists( M1_STORE_BASE_DIR . $this->imagesDir ) ) {
1429
+ $this->imagesDir = "/files";
1430
+ }
1431
+
1432
+ if ( file_exists(M1_STORE_BASE_DIR . "/modules/ubercart/uc_cart/uc_cart.info") ) {
1433
+ $str = file_get_contents(M1_STORE_BASE_DIR . "/modules/ubercart/uc_cart/uc_cart.info");
1434
+ if ( preg_match('/version\s+=\s+".+-(.+)"/', $str, $match) != 0 ) {
1435
+ $this->cartVars['dbVersion'] = $match[1];
1436
+ unset($match);
1437
+ }
1438
+ }
1439
+
1440
+ $this->categoriesImagesDir = $this->imagesDir;
1441
+ $this->productsImagesDir = $this->imagesDir;
1442
+ $this->manufacturersImagesDir = $this->imagesDir;
1443
+ }
1444
+ }
1445
+
1446
+
1447
+
1448
+ class M1_Config_Adapter_Cubecart3 extends M1_Config_Adapter
1449
+ {
1450
+ function M1_Config_Adapter_Cubecart3()
1451
+ {
1452
+ include_once(M1_STORE_BASE_DIR . 'includes/global.inc.php');
1453
+
1454
+ $this->setHostPort($glob['dbhost']);
1455
+ $this->Dbname = $glob['dbdatabase'];
1456
+ $this->Username = $glob['dbusername'];
1457
+ $this->Password = $glob['dbpassword'];
1458
+
1459
+ $this->imagesDir = 'images/uploads';
1460
+ $this->categoriesImagesDir = $this->imagesDir;
1461
+ $this->productsImagesDir = $this->imagesDir;
1462
+ $this->manufacturersImagesDir = $this->imagesDir;
1463
+ }
1464
+ }
1465
+
1466
+ class M1_Config_Adapter_JooCart extends M1_Config_Adapter
1467
+ {
1468
+ function M1_Config_Adapter_JooCart()
1469
+ {
1470
+ require_once M1_STORE_BASE_DIR . "/configuration.php";
1471
+
1472
+ if (class_exists("JConfig")) {
1473
+
1474
+ $jconfig = new JConfig();
1475
+
1476
+ $this->setHostPort($jconfig->host);
1477
+ $this->Dbname = $jconfig->db;
1478
+ $this->Username = $jconfig->user;
1479
+ $this->Password = $jconfig->password;
1480
+
1481
+ } else {
1482
+
1483
+ $this->setHostPort($mosConfig_host);
1484
+ $this->Dbname = $mosConfig_db;
1485
+ $this->Username = $mosConfig_user;
1486
+ $this->Password = $mosConfig_password;
1487
+ }
1488
+
1489
+
1490
+ $this->imagesDir = "components/com_opencart/image/";
1491
+ $this->categoriesImagesDir = $this->imagesDir;
1492
+ $this->productsImagesDir = $this->imagesDir;
1493
+ $this->manufacturersImagesDir = $this->imagesDir;
1494
+ }
1495
+ }
1496
+
1497
+
1498
+ class M1_Config_Adapter_Prestashop11 extends M1_Config_Adapter
1499
+ {
1500
+ function M1_Config_Adapter_Prestashop11()
1501
+ {
1502
+ $confFileOne = file_get_contents(M1_STORE_BASE_DIR . "/config/settings.inc.php");
1503
+ $confFileTwo = file_get_contents(M1_STORE_BASE_DIR . "/config/config.inc.php");
1504
+
1505
+ $filesLines = array_merge(explode("\n", $confFileOne), explode("\n", $confFileTwo));
1506
+
1507
+ $execute = '$currentDir = \'\';';
1508
+
1509
+ $isComment = false;
1510
+ foreach ($filesLines as $line) {
1511
+ $startComment = preg_match("/^(\/\*)/", $line);
1512
+ $endComment = preg_match("/(\*\/)$/", $line);
1513
+
1514
+ if ($isComment) {
1515
+ if ($endComment) {
1516
+ $isComment = false;
1517
+ }
1518
+ continue;
1519
+ } elseif ($startComment) {
1520
+ $isComment = true;
1521
+ if ($endComment) {
1522
+ $isComment = false;
1523
+ }
1524
+ continue;
1525
+ }
1526
+
1527
+ if (preg_match("/^(\s*)define\(/i", $line)) {
1528
+ if ((strpos($line, '_DB_') !== false) || (strpos($line, '_PS_IMG_DIR_') !== false) || (strpos($line, '_PS_VERSION_') !== false)) {
1529
+ $execute .= " " . $line;
1530
+ }
1531
+ }
1532
+ }
1533
+
1534
+ define( '_PS_ROOT_DIR_', M1_STORE_BASE_DIR );
1535
+ eval($execute);
1536
+
1537
+ $this->setHostPort(_DB_SERVER_);
1538
+ $this->Dbname = _DB_NAME_;
1539
+ $this->Username = _DB_USER_;
1540
+ $this->Password = _DB_PASSWD_;
1541
+
1542
+ if (defined('_PS_IMG_DIR_') && defined('_PS_ROOT_DIR_')) {
1543
+
1544
+ preg_match("/(\/\w+\/)$/i", _PS_IMG_DIR_, $m);
1545
+ $this->imagesDir = $m[1];
1546
+
1547
+ } else {
1548
+ $this->imagesDir = "/img/";
1549
+ }
1550
+
1551
+ $this->categoriesImagesDir = $this->imagesDir;
1552
+ $this->productsImagesDir = $this->imagesDir;
1553
+ $this->manufacturersImagesDir = $this->imagesDir;
1554
+
1555
+ if (defined('_PS_VERSION_')) {
1556
+ $this->cartVars['dbVersion'] = _PS_VERSION_;
1557
+ }
1558
+ }
1559
+ }
1560
+
1561
+
1562
+
1563
+ class M1_Config_Adapter_Ubercart3 extends M1_Config_Adapter
1564
+ {
1565
+ function M1_Config_Adapter_Ubercart3()
1566
+ {
1567
+ @include_once M1_STORE_BASE_DIR . "sites/default/settings.php";
1568
+
1569
+ $url = $databases['default']['default'];
1570
+
1571
+ $url['username'] = urldecode($url['username']);
1572
+ $url['password'] = isset($url['password']) ? urldecode($url['password']) : '';
1573
+ $url['host'] = urldecode($url['host']);
1574
+ $url['database'] = urldecode($url['database']);
1575
+ if (isset($url['port'])) {
1576
+ $url['host'] = $url['host'] .':'. $url['port'];
1577
+ }
1578
+
1579
+ $this->setHostPort( $url['host'] );
1580
+ $this->Dbname = ltrim( $url['database'], '/' );
1581
+ $this->Username = $url['username'];
1582
+ $this->Password = $url['password'];
1583
+
1584
+ $this->imagesDir = "/sites/default/files/";
1585
+ if (!file_exists( M1_STORE_BASE_DIR . $this->imagesDir )) {
1586
+ $this->imagesDir = "/files";
1587
+ }
1588
+
1589
+ $fileInfo = M1_STORE_BASE_DIR . "/modules/ubercart/uc_cart/uc_cart.info";
1590
+ if (file_exists( $fileInfo )) {
1591
+ $str = file_get_contents( $fileInfo );
1592
+ if (preg_match('/version\s+=\s+".+-(.+)"/', $str, $match) != 0) {
1593
+ $this->cartVars['dbVersion'] = $match[1];
1594
+ unset($match);
1595
+ }
1596
+ }
1597
+
1598
+ $this->categoriesImagesDir = $this->imagesDir;
1599
+ $this->productsImagesDir = $this->imagesDir;
1600
+ $this->manufacturersImagesDir = $this->imagesDir;
1601
+ }
1602
+ }
1603
+
1604
+
1605
+ class M1_Config_Adapter_XCart extends M1_Config_Adapter
1606
+ {
1607
+ function M1_Config_Adapter_XCart()
1608
+ {
1609
+ define('XCART_START', 1);
1610
+
1611
+ $config = file_get_contents(M1_STORE_BASE_DIR . "config.php");
1612
+
1613
+ preg_match('/\$sql_host.+\'(.+)\';/', $config, $match);
1614
+ $this->setHostPort( $match[1] );
1615
+ preg_match('/\$sql_user.+\'(.+)\';/', $config, $match);
1616
+ $this->Username = $match[1];
1617
+ preg_match('/\$sql_db.+\'(.+)\';/', $config, $match);
1618
+ $this->Dbname = $match[1];
1619
+ preg_match('/\$sql_password.+\'(.*)\';/', $config, $match);
1620
+ $this->Password = $match[1];
1621
+
1622
+ $this->imagesDir = 'images/'; // xcart starting from 4.1.x hardcodes images location
1623
+ $this->categoriesImagesDir = $this->imagesDir;
1624
+ $this->productsImagesDir = $this->imagesDir;
1625
+ $this->manufacturersImagesDir = $this->imagesDir;
1626
+
1627
+ if(file_exists(M1_STORE_BASE_DIR . "VERSION")) {
1628
+ $version = file_get_contents(M1_STORE_BASE_DIR . "VERSION");
1629
+ $this->cartVars['dbVersion'] = preg_replace('/(Version| |\\n)/','',$version);
1630
+ }
1631
+
1632
+ }
1633
+ }
1634
+
1635
+ class M1_Config_Adapter_Cubecart extends M1_Config_Adapter
1636
+ {
1637
+ function M1_Config_Adapter_Cubecart()
1638
+ {
1639
+ include_once(M1_STORE_BASE_DIR . 'includes/global.inc.php');
1640
+
1641
+ $this->setHostPort($glob['dbhost']);
1642
+ $this->Dbname = $glob['dbdatabase'];
1643
+ $this->Username = $glob['dbusername'];
1644
+ $this->Password = $glob['dbpassword'];
1645
+
1646
+ $this->imagesDir = 'images';
1647
+ $this->categoriesImagesDir = $this->imagesDir;
1648
+ $this->productsImagesDir = $this->imagesDir;
1649
+ $this->manufacturersImagesDir = $this->imagesDir;
1650
+ $dirHandle = opendir(M1_STORE_BASE_DIR . 'language/');
1651
+ //settings for cube 5
1652
+ $languages = array();
1653
+ while ($dirEntry = readdir($dirHandle)) {
1654
+ $info = pathinfo($dirEntry);
1655
+ $xmlflag = false;
1656
+
1657
+ if (isset($info['extension'])) {
1658
+ $xmlflag = strtoupper($info['extension']) != "XML" ? true : false;
1659
+ }
1660
+ if (is_dir(M1_STORE_BASE_DIR . 'language/' . $dirEntry) || $dirEntry == '.' || $dirEntry == '..' || strpos($dirEntry, "_") !== false || $xmlflag) {
1661
+ continue;
1662
+ }
1663
+ $configXml = simplexml_load_file(M1_STORE_BASE_DIR . 'language/'.$dirEntry);
1664
+ if ($configXml->info->title){
1665
+ $lang['name'] = (string)$configXml->info->title;
1666
+ $lang['code'] = substr((string)$configXml->info->code,0,2);
1667
+ $lang['locale'] = substr((string)$configXml->info->code,0,2);
1668
+ $lang['currency'] = (string)$configXml->info->default_currency;
1669
+ $lang['fileName'] = str_replace(".xml","",$dirEntry);
1670
+ $languages[] = $lang;
1671
+ }
1672
+ }
1673
+ if (!empty($languages)) {
1674
+ $this->cartVars['languages'] = $languages;
1675
+ }
1676
+ if ( file_exists(M1_STORE_BASE_DIR . 'ini.inc.php') ) {
1677
+ $conf = file_get_contents (M1_STORE_BASE_DIR . 'ini.inc.php');
1678
+ preg_match("/ini\['ver'\].*/", $conf, $match);
1679
+ if (isset($match[0]) && !empty($match[0])) {
1680
+ preg_match("/\d.*/", $match[0], $project);
1681
+ if (isset($project[0]) && !empty($project[0])) {
1682
+ $version = $project[0];
1683
+ $version = str_replace(array(" ","-","_","'",");",";",")"), "", $version);
1684
+ if ($version != '') {
1685
+ $this->cartVars['dbVersion'] = strtolower($version);
1686
+ }
1687
+ }
1688
+ } else {
1689
+ preg_match("/define\('CC_VERSION.*/", $conf, $match);
1690
+ if (isset($match[0]) && !empty($match[0])) {
1691
+ preg_match("/\d.*/", $match[0], $project);
1692
+ if (isset($project[0]) && !empty($project[0])){
1693
+ $version = $project[0];
1694
+ $version = str_replace(array(" ","-","_","'",");",";",")"), "", $version);
1695
+ if ($version != '') {
1696
+ $this->cartVars['dbVersion'] = strtolower($version);
1697
+ }
1698
+ }
1699
+ }
1700
+
1701
+ }
1702
+ } elseif ( file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . 'ini.inc.php') ) {
1703
+ $conf = file_get_contents (M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . 'ini.inc.php');
1704
+ preg_match("/ini\['ver'\].*/", $conf, $match);
1705
+ if (isset($match[0]) && !empty($match[0])) {
1706
+ preg_match("/\d.*/", $match[0], $project);
1707
+ if (isset($project[0]) && !empty($project[0])) {
1708
+ $version = $project[0];
1709
+ $version = str_replace(array(" ","-","_","'",");",";",")"), "", $version);
1710
+ if ($version != '') {
1711
+ $this->cartVars['dbVersion'] = strtolower($version);
1712
+ }
1713
+ }
1714
+ } else {
1715
+ preg_match("/define\('CC_VERSION.*/", $conf, $match);
1716
+ if (isset($match[0]) && !empty($match[0])) {
1717
+ preg_match("/\d.*/", $match[0], $project);
1718
+ if (isset($project[0]) && !empty($project[0])) {
1719
+ $version = $project[0];
1720
+ $version = str_replace(array(" ","-","_","'",");",";",")"), "", $version);
1721
+ if ($version != '') {
1722
+ $this->cartVars['dbVersion'] = strtolower($version);
1723
+ }
1724
+ }
1725
+ }
1726
+ }
1727
+ }
1728
+ }
1729
+ }
1730
+
1731
+ class M1_Config_Adapter_WebAsyst extends M1_Config_Adapter
1732
+ {
1733
+ function M1_Config_Adapter_WebAsyst()
1734
+ {
1735
+ $config = simplexml_load_file(M1_STORE_BASE_DIR . 'kernel/wbs.xml');
1736
+
1737
+ $dbKey = (string)$config->FRONTEND['dbkey'];
1738
+
1739
+ $config = simplexml_load_file(M1_STORE_BASE_DIR . 'dblist'. '/' . strtoupper($dbKey) . '.xml');
1740
+
1741
+ $host = (string)$config->DBSETTINGS['SQLSERVER'];
1742
+
1743
+ $this->setHostPort($host);
1744
+ $this->Dbname = (string)$config->DBSETTINGS['DB_NAME'];
1745
+ $this->Username = (string)$config->DBSETTINGS['DB_USER'];
1746
+ $this->Password = (string)$config->DBSETTINGS['DB_PASSWORD'];
1747
+
1748
+ $this->imagesDir = 'published/publicdata/'.strtoupper($dbKey).'/attachments/SC/products_pictures';
1749
+ $this->categoriesImagesDir = $this->imagesDir;
1750
+ $this->productsImagesDir = $this->imagesDir;
1751
+ $this->manufacturersImagesDir = $this->imagesDir;
1752
+
1753
+ if ( isset($config->VERSIONS['SYSTEM']) ) {
1754
+ $this->cartVars['dbVersion'] = (string)$config->VERSIONS['SYSTEM'];
1755
+ }
1756
+ }
1757
+
1758
+ }
1759
+
1760
+ class M1_Config_Adapter_Squirrelcart242 extends M1_Config_Adapter
1761
+ {
1762
+ function M1_Config_Adapter_Squirrelcart242()
1763
+ {
1764
+ include_once(M1_STORE_BASE_DIR . 'squirrelcart/config.php');
1765
+
1766
+ $this->setHostPort($sql_host);
1767
+ $this->Dbname = $db;
1768
+ $this->Username = $sql_username;
1769
+ $this->Password = $sql_password;
1770
+
1771
+ $this->imagesDir = $img_path;
1772
+ $this->categoriesImagesDir = $img_path . "/categories";
1773
+ $this->productsImagesDir = $img_path . "/products";
1774
+ $this->manufacturersImagesDir = $img_path;
1775
+
1776
+ $version = $this->getCartVersionFromDb("DB_Version", "Store_Information", "record_number = 1");
1777
+ if ( $version != '' ) {
1778
+ $this->cartVars['dbVersion'] = $version;
1779
+ }
1780
+ }
1781
+ }
1782
+
1783
+ class M1_Config_Adapter_Opencart14 extends M1_Config_Adapter
1784
+ {
1785
+ function M1_Config_Adapter_Opencart14()
1786
+ {
1787
+ include_once( M1_STORE_BASE_DIR . "/config.php");
1788
+
1789
+ if( defined('DB_HOST') ) {
1790
+ $this->setHostPort(DB_HOST);
1791
+ } else {
1792
+ $this->setHostPort(DB_HOSTNAME);
1793
+ }
1794
+
1795
+ if( defined('DB_USER') ) {
1796
+ $this->Username = DB_USER;
1797
+ } else {
1798
+ $this->Username = DB_USERNAME;
1799
+ }
1800
+
1801
+ $this->Password = DB_PASSWORD;
1802
+
1803
+ if( defined('DB_NAME') ) {
1804
+ $this->Dbname = DB_NAME;
1805
+ } else {
1806
+ $this->Dbname = DB_DATABASE;
1807
+ }
1808
+
1809
+ $indexFileContent = '';
1810
+ $startupFileContent = '';
1811
+
1812
+ if ( file_exists(M1_STORE_BASE_DIR . "/index.php") ) {
1813
+ $indexFileContent = file_get_contents(M1_STORE_BASE_DIR . "/index.php");
1814
+ }
1815
+
1816
+ if (file_exists(M1_STORE_BASE_DIR . "/system/startup.php")) {
1817
+ $startupFileContent = file_get_contents(M1_STORE_BASE_DIR . "/system/startup.php");
1818
+ }
1819
+
1820
+ if ( preg_match("/define\('\VERSION\'\, \'(.+)\'\)/", $indexFileContent, $match) == 0 ) {
1821
+ preg_match("/define\('\VERSION\'\, \'(.+)\'\)/", $startupFileContent, $match);
1822
+ }
1823
+
1824
+ if ( count($match) > 0 ) {
1825
+ $this->cartVars['dbVersion'] = $match[1];
1826
+ unset($match);
1827
+ }
1828
+
1829
+ $this->imagesDir = "/image/";
1830
+ $this->categoriesImagesDir = $this->imagesDir;
1831
+ $this->productsImagesDir = $this->imagesDir;
1832
+ $this->manufacturersImagesDir = $this->imagesDir;
1833
+
1834
+ }
1835
+ }
1836
+
1837
+
1838
+
1839
+ class M1_Config_Adapter_Litecommerce extends M1_Config_Adapter
1840
+ {
1841
+ function M1_Config_Adapter_Litecommerce()
1842
+ {
1843
+ if ((file_exists(M1_STORE_BASE_DIR .'/etc/config.php'))){
1844
+ $file = M1_STORE_BASE_DIR .'/etc/config.php';
1845
+ $this->imagesDir = "/images";
1846
+ $this->categoriesImagesDir = $this->imagesDir."/category";
1847
+ $this->productsImagesDir = $this->imagesDir."/product";
1848
+ $this->manufacturersImagesDir = $this->imagesDir;
1849
+ } elseif(file_exists(M1_STORE_BASE_DIR .'/modules/lc_connector/litecommerce/etc/config.php')) {
1850
+ $file = M1_STORE_BASE_DIR .'/modules/lc_connector/litecommerce/etc/config.php';
1851
+ $this->imagesDir = "/modules/lc_connector/litecommerce/images";
1852
+ $this->categoriesImagesDir = $this->imagesDir."/category";
1853
+ $this->productsImagesDir = $this->imagesDir."/product";
1854
+ $this->manufacturersImagesDir = $this->imagesDir;
1855
+ }
1856
+
1857
+ $settings = parse_ini_file($file);
1858
+ $this->Host = $settings['hostspec'];
1859
+ $this->setHostPort($settings['hostspec']);
1860
+ $this->Username = $settings['username'];
1861
+ $this->Password = $settings['password'];
1862
+ $this->Dbname = $settings['database'];
1863
+ $this->TblPrefix = $settings['table_prefix'];
1864
+
1865
+ $version = $this->getCartVersionFromDb("value", "config", "name = 'version'");
1866
+ if ( $version != '' ) {
1867
+ $this->cartVars['dbVersion'] = $version;
1868
+ }
1869
+ }
1870
+ }
1871
+
1872
+
1873
+
1874
+ class M1_Config_Adapter_Oxid extends M1_Config_Adapter
1875
+ {
1876
+ function M1_Config_Adapter_Oxid()
1877
+ {
1878
+ //@include_once M1_STORE_BASE_DIR . "config.inc.php";
1879
+ $config = file_get_contents(M1_STORE_BASE_DIR . "config.inc.php");
1880
+ preg_match("/dbName(.+)?=(.+)?\'(.+)\';/", $config, $match);
1881
+ $this->Dbname = $match[3];
1882
+ preg_match("/dbUser(.+)?=(.+)?\'(.+)\';/", $config, $match);
1883
+ $this->Username = $match[3];
1884
+ preg_match("/dbPwd(.+)?=(.+)?\'(.+)\';/", $config, $match);
1885
+ $this->Password = isset($match[3])?$match[3]:'';
1886
+ preg_match("/dbHost(.+)?=(.+)?\'(.*)\';/", $config, $match);
1887
+ $this->setHostPort($match[3]);
1888
+
1889
+ //check about last slash
1890
+ $this->imagesDir = "out/pictures/";
1891
+ $this->categoriesImagesDir = $this->imagesDir;
1892
+ $this->productsImagesDir = $this->imagesDir;
1893
+ $this->manufacturersImagesDir = $this->imagesDir;
1894
+
1895
+ //add key for decoding config values in oxid db
1896
+ //check slash
1897
+ $key_config_file = file_get_contents(M1_STORE_BASE_DIR .'/core/oxconfk.php');
1898
+ preg_match("/sConfigKey(.+)?=(.+)?\"(.+)?\";/", $key_config_file, $match);
1899
+ $this->cartVars['sConfigKey'] = $match[3];
1900
+ $version = $this->getCartVersionFromDb("OXVERSION", "oxshops", "OXACTIVE=1 LIMIT 1" );
1901
+ if ( $version != '' ) {
1902
+ $this->cartVars['dbVersion'] = $version;
1903
+ }
1904
+ }
1905
+ }
1906
+
1907
+
1908
+
1909
+ class M1_Config_Adapter_XtcommerceVeyton extends M1_Config_Adapter
1910
+ {
1911
+ function M1_Config_Adapter_XtcommerceVeyton()
1912
+ {
1913
+ define('_VALID_CALL','TRUE');
1914
+ define('_SRV_WEBROOT','TRUE');
1915
+ require_once M1_STORE_BASE_DIR
1916
+ . 'conf'
1917
+ . DIRECTORY_SEPARATOR
1918
+ . 'config.php';
1919
+
1920
+ require_once M1_STORE_BASE_DIR
1921
+ . 'conf'
1922
+ . DIRECTORY_SEPARATOR
1923
+ . 'paths.php';
1924
+
1925
+ $this->setHostPort(_SYSTEM_DATABASE_HOST);
1926
+ $this->Dbname = _SYSTEM_DATABASE_DATABASE;
1927
+ $this->Username = _SYSTEM_DATABASE_USER;
1928
+ $this->Password = _SYSTEM_DATABASE_PWD;
1929
+ $this->imagesDir = _SRV_WEB_IMAGES;
1930
+ $this->TblPrefix = DB_PREFIX . "_";
1931
+
1932
+ $version = $this->getCartVersionFromDb("config_value", "config", "config_key = '_SYSTEM_VERSION'");
1933
+ if ( $version != '' ) {
1934
+ $this->cartVars['dbVersion'] = $version;
1935
+ }
1936
+
1937
+ $this->categoriesImagesDir = $this->imagesDir;
1938
+ $this->productsImagesDir = $this->imagesDir;
1939
+ $this->manufacturersImagesDir = $this->imagesDir;
1940
+ }
1941
+ }
1942
+
1943
+
1944
+ class M1_Config_Adapter_SSPremium extends M1_Config_Adapter
1945
+ {
1946
+ function M1_Config_Adapter_SSPremium()
1947
+ {
1948
+ if ( file_exists(M1_STORE_BASE_DIR . 'cfg/connect.inc.php') ){
1949
+ $config = file_get_contents(M1_STORE_BASE_DIR . 'cfg/connect.inc.php');
1950
+ preg_match("/define\(\'DB_NAME\', \'(.+)\'\);/", $config, $match);
1951
+ $this->Dbname = $match[1];
1952
+ preg_match("/define\(\'DB_USER\', \'(.+)\'\);/", $config, $match);
1953
+ $this->Username = $match[1];
1954
+ preg_match("/define\(\'DB_PASS\', \'(.*)\'\);/", $config, $match);
1955
+ $this->Password = $match[1];
1956
+ preg_match("/define\(\'DB_HOST\', \'(.+)\'\);/", $config, $match);
1957
+ $this->setHostPort( $match[1] );
1958
+
1959
+ $this->imagesDir = "products_pictures/";
1960
+ $this->categoriesImagesDir = $this->imagesDir;
1961
+ $this->productsImagesDir = $this->imagesDir;
1962
+ $this->manufacturersImagesDir = $this->imagesDir;
1963
+
1964
+ $version = $this->getCartVersionFromDb("value", "SS_system", "varName = 'version_number'");
1965
+ if ( $version != '' ) {
1966
+ $this->cartVars['dbVersion'] = $version;
1967
+ }
1968
+ } else {
1969
+ $config = include M1_STORE_BASE_DIR . "wa-config/db.php";
1970
+ $this->Dbname = $config['default']['database'];
1971
+ $this->Username = $config['default']['user'];
1972
+ $this->Password = $config['default']['password'];
1973
+ $this->setHostPort($config['default']['host']);
1974
+
1975
+ $this->imagesDir = "products_pictures/";
1976
+ $this->categoriesImagesDir = $this->imagesDir;
1977
+ $this->productsImagesDir = $this->imagesDir;
1978
+ $this->manufacturersImagesDir = $this->imagesDir;
1979
+ $this->cartVars['dbVersion'] = '5.0';
1980
+ }
1981
+
1982
+ }
1983
+
1984
+ }
1985
+
1986
+ class M1_Config_Adapter_Virtuemart113 extends M1_Config_Adapter
1987
+ {
1988
+ function M1_Config_Adapter_Virtuemart113()
1989
+ {
1990
+ require_once M1_STORE_BASE_DIR . "/configuration.php";
1991
+
1992
+ if (class_exists("JConfig")) {
1993
+
1994
+ $jconfig = new JConfig();
1995
+
1996
+ $this->setHostPort($jconfig->host);
1997
+ $this->Dbname = $jconfig->db;
1998
+ $this->Username = $jconfig->user;
1999
+ $this->Password = $jconfig->password;
2000
+
2001
+ } else {
2002
+
2003
+ $this->setHostPort($mosConfig_host);
2004
+ $this->Dbname = $mosConfig_db;
2005
+ $this->Username = $mosConfig_user;
2006
+ $this->Password = $mosConfig_password;
2007
+ }
2008
+
2009
+ if ( file_exists(M1_STORE_BASE_DIR . "/administrator/components/com_virtuemart/version.php") ) {
2010
+ $ver = file_get_contents(M1_STORE_BASE_DIR . "/administrator/components/com_virtuemart/version.php");
2011
+ if (preg_match('/\$RELEASE.+\'(.+)\'/', $ver, $match) != 0) {
2012
+ $this->cartVars['dbVersion'] = $match[1];
2013
+ unset($match);
2014
+ }
2015
+ }
2016
+
2017
+ $this->imagesDir = "components/com_virtuemart/shop_image";
2018
+ $this->categoriesImagesDir = $this->imagesDir;
2019
+ $this->productsImagesDir = $this->imagesDir;
2020
+ $this->manufacturersImagesDir = $this->imagesDir;
2021
+
2022
+ if ( is_dir( M1_STORE_BASE_DIR . 'images/stories/virtuemart/product' ) ) {
2023
+ $this->imagesDir = 'images/stories/virtuemart';
2024
+ $this->productsImagesDir = $this->imagesDir . '/product';
2025
+ $this->categoriesImagesDir = $this->imagesDir . '/category';
2026
+ $this->manufacturersImagesDir = $this->imagesDir . '/manufacturer';
2027
+ }
2028
+
2029
+ }
2030
+ }
2031
+
2032
+
2033
+ class M1_Config_Adapter_Hhgmultistore extends M1_Config_Adapter
2034
+ {
2035
+ function M1_Config_Adapter_Hhgmultistore()
2036
+ {
2037
+ define('SITE_PATH','');
2038
+ define('WEB_PATH','');
2039
+ require_once M1_STORE_BASE_DIR . "core/config/configure.php";
2040
+ require_once M1_STORE_BASE_DIR . "core/config/paths.php";
2041
+
2042
+ $baseDir = "/store_files/1/";
2043
+ $this->imagesDir = $baseDir . DIR_WS_IMAGES;
2044
+
2045
+ $this->categoriesImagesDir = $baseDir . DIR_WS_CATEGORIE_IMAGES;
2046
+ $this->productsImagesDirs['info'] = $baseDir . DIR_WS_PRODUCT_INFO_IMAGES;
2047
+ $this->productsImagesDirs['org'] = $baseDir . DIR_WS_PRODUCT_ORG_IMAGES;
2048
+ $this->productsImagesDirs['thumb'] = $baseDir . DIR_WS_PRODUCT_THUMBNAIL_IMAGES;
2049
+ $this->productsImagesDirs['popup'] = $baseDir . DIR_WS_PRODUCT_POPUP_IMAGES;
2050
+
2051
+ $this->manufacturersImagesDirs['img'] = $baseDir . DIR_WS_MANUFACTURERS_IMAGES;
2052
+ $this->manufacturersImagesDirs['org'] = $baseDir . DIR_WS_MANUFACTURERS_ORG_IMAGES;
2053
+
2054
+ $this->Host = DB_SERVER;
2055
+ $this->Username = DB_SERVER_USERNAME;
2056
+ $this->Password = DB_SERVER_PASSWORD;
2057
+ $this->Dbname = DB_DATABASE;
2058
+
2059
+ if ( file_exists(M1_STORE_BASE_DIR . "/core/config/conf.hhg_startup.php") ) {
2060
+ $ver = file_get_contents(M1_STORE_BASE_DIR . "/core/config/conf.hhg_startup.php");
2061
+ if (preg_match('/PROJECT_VERSION.+\((.+)\)\'\)/', $ver, $match) != 0) {
2062
+ $this->cartVars['dbVersion'] = $match[1];
2063
+ unset($match);
2064
+ }
2065
+ }
2066
+ }
2067
+ }
2068
+
2069
+
2070
+ class M1_Config_Adapter_Magento1212 extends M1_Config_Adapter
2071
+ {
2072
+ function M1_Config_Adapter_Magento1212()
2073
+ {
2074
+ /**
2075
+ * @var SimpleXMLElement
2076
+ */
2077
+ $config = simplexml_load_file(M1_STORE_BASE_DIR . 'app/etc/local.xml');
2078
+ $statuses = simplexml_load_file(M1_STORE_BASE_DIR . 'app/code/core/Mage/Sales/etc/config.xml');
2079
+
2080
+ $version = $statuses->modules->Mage_Sales->version;
2081
+
2082
+ $result = array();
2083
+
2084
+ if( version_compare($version, '1.4.0.25') < 0 ) {
2085
+ $statuses = $statuses->global->sales->order->statuses;
2086
+ foreach ( $statuses->children() as $status ) {
2087
+ $result[$status->getName()] = (string) $status->label;
2088
+ }
2089
+ }
2090
+
2091
+ if ( file_exists(M1_STORE_BASE_DIR . "app/Mage.php") ) {
2092
+ $ver = file_get_contents(M1_STORE_BASE_DIR . "app/Mage.php");
2093
+ if ( preg_match("/getVersionInfo[^}]+\'major\' *=> *\'(\d+)\'[^}]+\'minor\' *=> *\'(\d+)\'[^}]+\'revision\' *=> *\'(\d+)\'[^}]+\'patch\' *=> *\'(\d+)\'[^}]+}/s", $ver, $match) == 1 ) {
2094
+ $mageVersion = $match[1] . '.' . $match[2] . '.' . $match[3] . '.' . $match[4];
2095
+ $this->cartVars['dbVersion'] = $mageVersion;
2096
+ unset($match);
2097
+ }
2098
+ }
2099
+
2100
+ $this->cartVars['orderStatus'] = $result;
2101
+ $this->cartVars['AdminUrl'] = (string)$config->admin->routers->adminhtml->args->frontName;
2102
+
2103
+ $this->setHostPort((string) $config->global->resources->default_setup->connection->host);
2104
+ $this->Username = (string) $config->global->resources->default_setup->connection->username;
2105
+ $this->Dbname = (string) $config->global->resources->default_setup->connection->dbname;
2106
+ $this->Password = (string) $config->global->resources->default_setup->connection->password;
2107
+
2108
+ $this->imagesDir = 'media/';
2109
+ $this->categoriesImagesDir = $this->imagesDir . "catalog/category/";
2110
+ $this->productsImagesDir = $this->imagesDir . "catalog/product/";
2111
+ $this->manufacturersImagesDir = $this->imagesDir;
2112
+ @unlink(M1_STORE_BASE_DIR . 'app/etc/use_cache.ser');
2113
+ }
2114
+ }
2115
+
2116
+ class M1_Config_Adapter_Interspire extends M1_Config_Adapter
2117
+ {
2118
+ function M1_Config_Adapter_Interspire()
2119
+ {
2120
+ require_once M1_STORE_BASE_DIR . "config/config.php";
2121
+
2122
+ $this->setHostPort($GLOBALS['ISC_CFG']["dbServer"]);
2123
+ $this->Username = $GLOBALS['ISC_CFG']["dbUser"];
2124
+ $this->Password = $GLOBALS['ISC_CFG']["dbPass"];
2125
+ $this->Dbname = $GLOBALS['ISC_CFG']["dbDatabase"];
2126
+
2127
+ $this->imagesDir = $GLOBALS['ISC_CFG']["ImageDirectory"];
2128
+ $this->categoriesImagesDir = $this->imagesDir;
2129
+ $this->productsImagesDir = $this->imagesDir;
2130
+ $this->manufacturersImagesDir = $this->imagesDir;
2131
+
2132
+ define('DEFAULT_LANGUAGE_ISO2',$GLOBALS['ISC_CFG']["Language"]);
2133
+
2134
+ $version = $this->getCartVersionFromDb("database_version", $GLOBALS['ISC_CFG']["tablePrefix"] . "config", '1');
2135
+ if ( $version != '' ) {
2136
+ $this->cartVars['dbVersion'] = $version;
2137
+ }
2138
+ }
2139
+ }
2140
+
2141
+ class M1_Config_Adapter_Pinnacle361 extends M1_Config_Adapter
2142
+ {
2143
+ function M1_Config_Adapter_Pinnacle361()
2144
+ {
2145
+ include_once M1_STORE_BASE_DIR . 'content/engine/engine_config.php';
2146
+
2147
+ $this->imagesDir = 'images/';
2148
+ $this->categoriesImagesDir = $this->imagesDir;
2149
+ $this->productsImagesDir = $this->imagesDir;
2150
+ $this->manufacturersImagesDir = $this->imagesDir;
2151
+
2152
+ //$this->Host = DB_HOST;
2153
+ $this->setHostPort(DB_HOST);
2154
+ $this->Dbname = DB_NAME;
2155
+ $this->Username = DB_USER;
2156
+ $this->Password = DB_PASSWORD;
2157
+
2158
+ $version = $this->getCartVersionFromDb("value", (defined('DB_PREFIX') ? DB_PREFIX : '') . "settings", "name = 'AppVer'");
2159
+ if ( $version != '' ) {
2160
+ $this->cartVars['dbVersion'] = $version;
2161
+ }
2162
+ }
2163
+ }
2164
+
2165
+
2166
+
2167
+ class M1_Config_Adapter_Oscommerce22ms2 extends M1_Config_Adapter
2168
+ {
2169
+ function M1_Config_Adapter_Oscommerce22ms2()
2170
+ {
2171
+ $cur_dir = getcwd();
2172
+
2173
+ chdir(M1_STORE_BASE_DIR);
2174
+
2175
+ @require_once M1_STORE_BASE_DIR
2176
+ . "includes" . DIRECTORY_SEPARATOR
2177
+ . "configure.php";
2178
+
2179
+ chdir($cur_dir);
2180
+
2181
+ $this->imagesDir = DIR_WS_IMAGES;
2182
+
2183
+ $this->categoriesImagesDir = $this->imagesDir;
2184
+ $this->productsImagesDir = $this->imagesDir;
2185
+ if ( defined('DIR_WS_PRODUCT_IMAGES') ) {
2186
+ $this->productsImagesDir = DIR_WS_PRODUCT_IMAGES;
2187
+ }
2188
+ if ( defined('DIR_WS_ORIGINAL_IMAGES') ) {
2189
+ $this->productsImagesDir = DIR_WS_ORIGINAL_IMAGES;
2190
+ }
2191
+ $this->manufacturersImagesDir = $this->imagesDir;
2192
+
2193
+ //$this->Host = DB_SERVER;
2194
+ $this->setHostPort(DB_SERVER);
2195
+ $this->Username = DB_SERVER_USERNAME;
2196
+ $this->Password = DB_SERVER_PASSWORD;
2197
+ $this->Dbname = DB_DATABASE;
2198
+ chdir(M1_STORE_BASE_DIR);
2199
+ if ( file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . 'application_top.php') ) {
2200
+ $conf = file_get_contents (M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . "application_top.php");
2201
+ preg_match("/define\('PROJECT_VERSION.*/", $conf, $match);
2202
+ if (isset($match[0]) && !empty($match[0])) {
2203
+ preg_match("/\d.*/", $match[0], $project);
2204
+ if (isset($project[0]) && !empty($project[0])) {
2205
+ $version = $project[0];
2206
+ $version = str_replace(array(" ","-","_","'",");"), "", $version);
2207
+ if ($version != '') {
2208
+ $this->cartVars['dbVersion'] = strtolower($version);
2209
+ }
2210
+ }
2211
+ } else {
2212
+ //if another oscommerce based cart
2213
+ if ( file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . 'version.php') ) {
2214
+ @require_once M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . "version.php";
2215
+ if (defined('PROJECT_VERSION') && PROJECT_VERSION != '' ) {
2216
+ $version = PROJECT_VERSION;
2217
+ preg_match("/\d.*/", $version, $vers);
2218
+ if (isset($vers[0]) && !empty($vers[0])) {
2219
+ $version = $vers[0];
2220
+ $version = str_replace(array(" ","-","_"), "", $version);
2221
+ if ($version != '') {
2222
+ $this->cartVars['dbVersion'] = strtolower($version);
2223
+ }
2224
+ }
2225
+ //if zen_cart
2226
+ } else {
2227
+ if (defined('PROJECT_VERSION_MAJOR') && PROJECT_VERSION_MAJOR != '' ) {
2228
+ $this->cartVars['dbVersion'] = PROJECT_VERSION_MAJOR;
2229
+ }
2230
+ if (defined('PROJECT_VERSION_MINOR') && PROJECT_VERSION_MINOR != '' ) {
2231
+ $this->cartVars['dbVersion'] .= '.' . PROJECT_VERSION_MINOR;
2232
+ }
2233
+ }
2234
+ }
2235
+ }
2236
+ }
2237
+ chdir($cur_dir);
2238
+ }
2239
+ }
2240
+
2241
+
2242
+
2243
+ class M1_Config_Adapter_Tomatocart extends M1_Config_Adapter
2244
+ {
2245
+ function M1_Config_Adapter_Tomatocart()
2246
+ {
2247
+ $config = file_get_contents(M1_STORE_BASE_DIR . "includes/configure.php");
2248
+ preg_match("/define\(\'DB_DATABASE\', \'(.+)\'\);/", $config, $match);
2249
+ $this->Dbname = $match[1];
2250
+ preg_match("/define\(\'DB_SERVER_USERNAME\', \'(.+)\'\);/", $config, $match);
2251
+ $this->Username = $match[1];
2252
+ preg_match("/define\(\'DB_SERVER_PASSWORD\', \'(.*)\'\);/", $config, $match);
2253
+ $this->Password = $match[1];
2254
+ preg_match("/define\(\'DB_SERVER\', \'(.+)\'\);/", $config, $match);
2255
+ $this->setHostPort( $match[1] );
2256
+
2257
+ preg_match("/define\(\'DIR_WS_IMAGES\', \'(.+)\'\);/", $config, $match);
2258
+ $this->imagesDir = $match[1];
2259
+
2260
+ $this->categoriesImagesDir = $this->imagesDir.'categories/';
2261
+ $this->productsImagesDir = $this->imagesDir.'products/';
2262
+ $this->manufacturersImagesDir = $this->imagesDir . 'manufacturers/';
2263
+ if ( file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . 'application_top.php') ) {
2264
+ $conf = file_get_contents (M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . "application_top.php");
2265
+ preg_match("/define\('PROJECT_VERSION.*/", $conf, $match);
2266
+
2267
+ if (isset($match[0]) && !empty($match[0])) {
2268
+ preg_match("/\d.*/", $match[0], $project);
2269
+ if (isset($project[0]) && !empty($project[0])) {
2270
+ $version = $project[0];
2271
+ $version = str_replace(array(" ","-","_","'",");"), "", $version);
2272
+ if ($version != '') {
2273
+ $this->cartVars['dbVersion'] = strtolower($version);
2274
+ }
2275
+ }
2276
+ } else {
2277
+ //if another version
2278
+ if ( file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . 'version.php') ) {
2279
+ @require_once M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . "version.php";
2280
+ if (defined('PROJECT_VERSION') && PROJECT_VERSION != '' ) {
2281
+ $version = PROJECT_VERSION;
2282
+ preg_match("/\d.*/", $version, $vers);
2283
+ if (isset($vers[0]) && !empty($vers[0])) {
2284
+ $version = $vers[0];
2285
+ $version = str_replace(array(" ","-","_"), "", $version);
2286
+ if ($version != '') {
2287
+ $this->cartVars['dbVersion'] = strtolower($version);
2288
+ }
2289
+ }
2290
+ }
2291
+ }
2292
+ }
2293
+ }
2294
+ }
2295
+ }
2296
+
2297
+
2298
+
2299
+ class M1_Config_Adapter_Sunshop4 extends M1_Config_Adapter
2300
+ {
2301
+ function M1_Config_Adapter_Sunshop4()
2302
+ {
2303
+ @require_once M1_STORE_BASE_DIR
2304
+ . "include" . DIRECTORY_SEPARATOR
2305
+ . "config.php";
2306
+
2307
+ $this->imagesDir = "images/products/";
2308
+
2309
+ $this->categoriesImagesDir = $this->imagesDir;
2310
+ $this->productsImagesDir = $this->imagesDir;
2311
+ $this->manufacturersImagesDir = $this->imagesDir;
2312
+
2313
+ if ( defined('ADMIN_DIR') ) {
2314
+ $this->cartVars['AdminUrl'] = ADMIN_DIR;
2315
+ }
2316
+
2317
+ $this->setHostPort($servername);
2318
+ $this->Username = $dbusername;
2319
+ $this->Password = $dbpassword;
2320
+ $this->Dbname = $dbname;
2321
+
2322
+ if (isset($dbprefix)) {
2323
+ $this->TblPrefix = $dbprefix;
2324
+ }
2325
+
2326
+ $version = $this->getCartVersionFromDb("value", "settings", "name = 'version'");
2327
+ if ( $version != '' ) {
2328
+ $this->cartVars['dbVersion'] = $version;
2329
+ }
2330
+
2331
+ }
2332
+ }
2333
+
2334
+
2335
+
2336
+ class miSettings {
2337
+ var $arr;
2338
+
2339
+ function singleton() {
2340
+ static $instance = null;
2341
+ if ( $instance == null ) {
2342
+ $instance = new miSettings();
2343
+ }
2344
+ return $instance;
2345
+ }
2346
+
2347
+ function setArray($arr)
2348
+ {
2349
+ $this->arr[] = $arr;
2350
+ }
2351
+
2352
+ function getArray()
2353
+ {
2354
+ return $this->arr;
2355
+ }
2356
+
2357
+ }
2358
+
2359
+ class M1_Config_Adapter_Summercart3 extends M1_Config_Adapter
2360
+ {
2361
+ function M1_Config_Adapter_Summercart3()
2362
+ {
2363
+ @include_once M1_STORE_BASE_DIR . "include/miphpf/Config.php";
2364
+
2365
+ $instance = miSettings::singleton();
2366
+
2367
+ $data = $instance->getArray();
2368
+
2369
+ $this->setHostPort($data[0]['MI_DEFAULT_DB_HOST']);
2370
+ $this->Dbname = $data[0]['MI_DEFAULT_DB_NAME'];
2371
+ $this->Username = $data[0]['MI_DEFAULT_DB_USER'];
2372
+ $this->Password = $data[0]['MI_DEFAULT_DB_PASS'];
2373
+ $this->imagesDir = "/userfiles/";
2374
+
2375
+ $this->categoriesImagesDir = $this->imagesDir . "categoryimages";
2376
+ $this->productsImagesDir = $this->imagesDir . "productimages";
2377
+ $this->manufacturersImagesDir = $this->imagesDir . "manufacturer";
2378
+
2379
+ if ( file_exists(M1_STORE_BASE_DIR . "/include/VERSION") ) {
2380
+ $indexFileContent = file_get_contents(M1_STORE_BASE_DIR . "/include/VERSION");
2381
+ $this->cartVars['dbVersion'] = trim($indexFileContent);
2382
+ }
2383
+
2384
+ }
2385
+ }
2386
+
2387
+
2388
+
2389
+ class M1_Config_Adapter_Oscommerce3 extends M1_Config_Adapter
2390
+ {
2391
+ function M1_Config_Adapter_Oscommerce3()
2392
+ {
2393
+ $file = M1_STORE_BASE_DIR .'/osCommerce/OM/Config/settings.ini';
2394
+ $settings=parse_ini_file($file);
2395
+ $this->imagesDir = "/public/";
2396
+ $this->categoriesImagesDir = $this->imagesDir."/categories";
2397
+ $this->productsImagesDir = $this->imagesDir."/products";
2398
+ $this->manufacturersImagesDir = $this->imagesDir;
2399
+
2400
+ $this->Host = $settings['db_server'];
2401
+ $this->setHostPort($settings['db_server_port']);
2402
+ $this->Username = $settings['db_server_username'];
2403
+ $this->Password = $settings['db_server_password'];
2404
+ $this->Dbname = $settings['db_database'];
2405
+ }
2406
+ }
2407
+
2408
+
2409
+
2410
+ class M1_Config_Adapter_Prestashop15 extends M1_Config_Adapter
2411
+ {
2412
+ function M1_Config_Adapter_Prestashop15()
2413
+ {
2414
+ $confFileOne = file_get_contents(M1_STORE_BASE_DIR . "/config/settings.inc.php");
2415
+ $confFileTwo = file_get_contents(M1_STORE_BASE_DIR . "/config/config.inc.php");
2416
+
2417
+ $filesLines = array_merge(explode("\n", $confFileOne), explode("\n", $confFileTwo));
2418
+
2419
+ $execute = '$currentDir = \'\';';
2420
+
2421
+ $isComment = false;
2422
+ foreach ($filesLines as $line) {
2423
+ $startComment = preg_match("/^(\/\*)/", $line);
2424
+ $endComment = preg_match("/(\*\/)$/", $line);
2425
+
2426
+ if ($isComment) {
2427
+ if ($endComment) {
2428
+ $isComment = false;
2429
+ }
2430
+ continue;
2431
+ } elseif ($startComment) {
2432
+ $isComment = true;
2433
+ if ($endComment) {
2434
+ $isComment = false;
2435
+ }
2436
+ continue;
2437
+ }
2438
+
2439
+ if (preg_match("/^(\s*)define\(/i", $line)) {
2440
+ if ((strpos($line, '_DB_') !== false) || (strpos($line, '_PS_IMG_DIR_') !== false) || (strpos($line, '_PS_VERSION_') !== false)) {
2441
+ $execute .= " " . $line;
2442
+ }
2443
+ }
2444
+ }
2445
+
2446
+ define( '_PS_ROOT_DIR_', M1_STORE_BASE_DIR );
2447
+ eval($execute);
2448
+
2449
+ $this->setHostPort(_DB_SERVER_);
2450
+ $this->Dbname = _DB_NAME_;
2451
+ $this->Username = _DB_USER_;
2452
+ $this->Password = _DB_PASSWD_;
2453
+
2454
+ if (defined('_PS_IMG_DIR_') && defined('_PS_ROOT_DIR_')) {
2455
+
2456
+ preg_match("/(\/\w+\/)$/i", _PS_IMG_DIR_ ,$m);
2457
+ $this->imagesDir = $m[1];
2458
+
2459
+ } else {
2460
+ $this->imagesDir = "/img/";
2461
+ }
2462
+
2463
+ $this->categoriesImagesDir = $this->imagesDir;
2464
+ $this->productsImagesDir = $this->imagesDir;
2465
+ $this->manufacturersImagesDir = $this->imagesDir;
2466
+
2467
+ if (defined('_PS_VERSION_')) {
2468
+ $this->cartVars['dbVersion'] = _PS_VERSION_;
2469
+ }
2470
+ }
2471
+ }
2472
+
2473
+
2474
+
2475
+
2476
+ class M1_Config_Adapter_Gambio extends M1_Config_Adapter
2477
+ {
2478
+ function M1_Config_Adapter_Gambio()
2479
+ {
2480
+ $cur_dir = getcwd();
2481
+
2482
+ chdir(M1_STORE_BASE_DIR);
2483
+
2484
+ @require_once M1_STORE_BASE_DIR . "includes/configure.php";
2485
+
2486
+ chdir($cur_dir);
2487
+
2488
+ $this->imagesDir = DIR_WS_IMAGES;
2489
+
2490
+ $this->categoriesImagesDir = $this->imagesDir;
2491
+ $this->productsImagesDir = $this->imagesDir;
2492
+ if (defined('DIR_WS_PRODUCT_IMAGES')) {
2493
+ $this->productsImagesDir = DIR_WS_PRODUCT_IMAGES;
2494
+ }
2495
+ if (defined('DIR_WS_ORIGINAL_IMAGES')) {
2496
+ $this->productsImagesDir = DIR_WS_ORIGINAL_IMAGES;
2497
+ }
2498
+ $this->manufacturersImagesDir = $this->imagesDir;
2499
+
2500
+ $this->Host = DB_SERVER;
2501
+ //$this->setHostPort(DB_SERVER);
2502
+ $this->Username = DB_SERVER_USERNAME;
2503
+ $this->Password = DB_SERVER_PASSWORD;
2504
+ $this->Dbname = DB_DATABASE;
2505
+
2506
+ chdir(M1_STORE_BASE_DIR);
2507
+ if (file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . 'application_top.php')) {
2508
+ $conf = file_get_contents (M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . "application_top.php");
2509
+ preg_match("/define\('PROJECT_VERSION.*/", $conf, $match);
2510
+ if (isset($match[0]) && !empty($match[0])) {
2511
+ preg_match("/\d.*/", $match[0], $project);
2512
+ if (isset($project[0]) && !empty($project[0])) {
2513
+ $version = $project[0];
2514
+ $version = str_replace(array(" ","-","_","'",");"), "", $version);
2515
+ if ($version != '') {
2516
+ $this->cartVars['dbVersion'] = strtolower($version);
2517
+ }
2518
+ }
2519
+ } else {
2520
+ //if another oscommerce based cart
2521
+ if ( file_exists(M1_STORE_BASE_DIR . DIRECTORY_SEPARATOR . 'version_info.php') ) {
2522
+ @require_once M1_STORE_BASE_DIR . DIRECTORY_SEPARATOR . "version_info.php";
2523
+ if (defined('PROJECT_VERSION') && PROJECT_VERSION != '' ) {
2524
+ $version = PROJECT_VERSION;
2525
+ preg_match("/\d.*/", $version, $vers);
2526
+ if (isset($vers[0]) && !empty($vers[0])) {
2527
+ $version = $vers[0];
2528
+ $version = str_replace(array(" ","-","_"), "", $version);
2529
+ if ($version != '') {
2530
+ $this->cartVars['dbVersion'] = strtolower($version);
2531
+ }
2532
+ }
2533
+ //if zen_cart
2534
+ } else {
2535
+ if (defined('PROJECT_VERSION_MAJOR') && PROJECT_VERSION_MAJOR != '' ) {
2536
+ $this->cartVars['dbVersion'] = PROJECT_VERSION_MAJOR;
2537
+ }
2538
+ if (defined('PROJECT_VERSION_MINOR') && PROJECT_VERSION_MINOR != '' ) {
2539
+ $this->cartVars['dbVersion'] .= '.' . PROJECT_VERSION_MINOR;
2540
+ }
2541
+ }
2542
+ }
2543
+ }
2544
+ }
2545
+ chdir($cur_dir);
2546
+ }
2547
+ }
2548
+
2549
+
2550
+
2551
+ class M1_Config_Adapter_Shopware extends M1_Config_Adapter
2552
+ {
2553
+ function M1_Config_Adapter_Shopware()
2554
+ {
2555
+ $configs = include(M1_STORE_BASE_DIR . "config.php");
2556
+ $this->setHostPort($configs['db']['host']);
2557
+ $this->Username = $configs['db']['username'];
2558
+ $this->Password = $configs['db']['password'];
2559
+ $this->Dbname = $configs['db']['dbname'];
2560
+ }
2561
+ }
2562
+
2563
+ class M1_Config_Adapter_AceShop extends M1_Config_Adapter
2564
+ {
2565
+ function M1_Config_Adapter_AceShop()
2566
+ {
2567
+ require_once M1_STORE_BASE_DIR . "/configuration.php";
2568
+
2569
+ if (class_exists("JConfig")) {
2570
+
2571
+ $jconfig = new JConfig();
2572
+
2573
+ $this->setHostPort($jconfig->host);
2574
+ $this->Dbname = $jconfig->db;
2575
+ $this->Username = $jconfig->user;
2576
+ $this->Password = $jconfig->password;
2577
+
2578
+ } else {
2579
+
2580
+ $this->setHostPort($mosConfig_host);
2581
+ $this->Dbname = $mosConfig_db;
2582
+ $this->Username = $mosConfig_user;
2583
+ $this->Password = $mosConfig_password;
2584
+ }
2585
+
2586
+
2587
+ $this->imagesDir = "components/com_aceshop/opencart/image/";
2588
+ $this->categoriesImagesDir = $this->imagesDir;
2589
+ $this->productsImagesDir = $this->imagesDir;
2590
+ $this->manufacturersImagesDir = $this->imagesDir;
2591
+ }
2592
+ }
2593
+
2594
+
2595
+ class M1_Config_Adapter_Cscart203 extends M1_Config_Adapter
2596
+ {
2597
+ function M1_Config_Adapter_Cscart203()
2598
+ {
2599
+ define("IN_CSCART", 1);
2600
+ define("CSCART_DIR", M1_STORE_BASE_DIR);
2601
+ define("AREA", 1);
2602
+ define("DIR_ROOT", M1_STORE_BASE_DIR);
2603
+ define("DIR_CSCART", M1_STORE_BASE_DIR);
2604
+ define('DS', DIRECTORY_SEPARATOR);
2605
+ define('BOOTSTRAP', '');
2606
+ require_once M1_STORE_BASE_DIR . 'config.php';
2607
+ defined('DIR_IMAGES') or define('DIR_IMAGES', DIR_ROOT . '/images/');
2608
+
2609
+ //For CS CART 1.3.x
2610
+ if( isset( $db_host ) && isset($db_name) && isset($db_user) && isset($db_password) ) {
2611
+ $this->setHostPort($db_host);
2612
+ $this->Dbname = $db_name;
2613
+ $this->Username = $db_user;
2614
+ $this->Password = $db_password;
2615
+ $this->imagesDir = str_replace(M1_STORE_BASE_DIR, '', IMAGES_STORAGE_DIR );
2616
+ } else {
2617
+
2618
+ $this->setHostPort($config['db_host']);
2619
+ $this->Dbname = $config['db_name'];
2620
+ $this->Username = $config['db_user'];
2621
+ $this->Password = $config['db_password'];
2622
+ $this->imagesDir = str_replace(M1_STORE_BASE_DIR, '', DIR_IMAGES);
2623
+ }
2624
+
2625
+ $this->categoriesImagesDir = $this->imagesDir;
2626
+ $this->productsImagesDir = $this->imagesDir;
2627
+ $this->manufacturersImagesDir = $this->imagesDir;
2628
+
2629
+ if( defined('MAX_FILES_IN_DIR') ) {
2630
+ $this->cartVars['cs_max_files_in_dir'] = MAX_FILES_IN_DIR;
2631
+ }
2632
+
2633
+ if( defined('PRODUCT_VERSION') ) {
2634
+ $this->cartVars['dbVersion'] = PRODUCT_VERSION;
2635
+ }
2636
+ }
2637
+ }
2638
+
2639
+
2640
+ class M1_Config_Adapter_WPecommerce extends M1_Config_Adapter
2641
+ {
2642
+ function M1_Config_Adapter_WPecommerce()
2643
+ {
2644
+ //@include_once M1_STORE_BASE_DIR . "wp-config.php";
2645
+ $config = file_get_contents(M1_STORE_BASE_DIR . "wp-config.php");
2646
+ preg_match("/define\(\'DB_NAME\', \'(.+)\'\);/", $config, $match);
2647
+ $this->Dbname = $match[1];
2648
+ preg_match("/define\(\'DB_USER\', \'(.+)\'\);/", $config, $match);
2649
+ $this->Username = $match[1];
2650
+ preg_match("/define\(\'DB_PASSWORD\', \'(.*)\'\);/", $config, $match);
2651
+ $this->Password = $match[1];
2652
+ preg_match("/define\(\'DB_HOST\', \'(.+)\'\);/", $config, $match);
2653
+ $this->setHostPort( $match[1] );
2654
+ preg_match("/(table_prefix)(.*)(')(.*)(')(.*)/", $config, $match);
2655
+ $this->TblPrefix = $match[4];
2656
+ $version = $this->getCartVersionFromDb("option_value", "options", "option_name = 'wpsc_version'");
2657
+ if ( $version != '' ) {
2658
+ $this->cartVars['dbVersion'] = $version;
2659
+ } else {
2660
+ if ( file_exists(M1_STORE_BASE_DIR . "wp-content".DIRECTORY_SEPARATOR."plugins".DIRECTORY_SEPARATOR."wp-shopping-cart".DIRECTORY_SEPARATOR."wp-shopping-cart.php") ) {
2661
+ $conf = file_get_contents (M1_STORE_BASE_DIR . "wp-content".DIRECTORY_SEPARATOR."plugins".DIRECTORY_SEPARATOR."wp-shopping-cart".DIRECTORY_SEPARATOR."wp-shopping-cart.php");
2662
+ preg_match("/define\('WPSC_VERSION.*/", $conf, $match);
2663
+ if (isset($match[0]) && !empty($match[0])) {
2664
+ preg_match("/\d.*/", $match[0], $project);
2665
+ if (isset($project[0]) && !empty($project[0])) {
2666
+ $version = $project[0];
2667
+ $version = str_replace(array(" ","-","_","'",");",")",";"), "", $version);
2668
+ if ($version != '') {
2669
+ $this->cartVars['dbVersion'] = strtolower($version);
2670
+ }
2671
+ }
2672
+ }
2673
+ }
2674
+ }
2675
+ if ( file_exists(M1_STORE_BASE_DIR . "wp-content/plugins/shopp/Shopp.php") || file_exists(M1_STORE_BASE_DIR . "wp-content/plugins/wp-e-commerce/editor.php") ) {
2676
+ $this->imagesDir = "wp-content/uploads/wpsc/";
2677
+ $this->categoriesImagesDir = $this->imagesDir.'category_images/';
2678
+ $this->productsImagesDir = $this->imagesDir.'product_images/';
2679
+ $this->manufacturersImagesDir = $this->imagesDir;
2680
+ } elseif ( file_exists(M1_STORE_BASE_DIR . "wp-content/plugins/wp-e-commerce/wp-shopping-cart.php") ) {
2681
+ $this->imagesDir = "wp-content/uploads/";
2682
+ $this->categoriesImagesDir = $this->imagesDir."wpsc/category_images/";
2683
+ $this->productsImagesDir = $this->imagesDir;
2684
+ $this->manufacturersImagesDir = $this->imagesDir;
2685
+ } else {
2686
+ $this->imagesDir = "images/";
2687
+ $this->categoriesImagesDir = $this->imagesDir;
2688
+ $this->productsImagesDir = $this->imagesDir;
2689
+ $this->manufacturersImagesDir = $this->imagesDir;
2690
+ }
2691
+ }
2692
+ }
2693
+
2694
+
2695
+
2696
+ class M1_Config_Adapter_LemonStand extends M1_Config_Adapter
2697
+ {
2698
+ function M1_Config_Adapter_LemonStand()
2699
+ {
2700
+ include (M1_STORE_BASE_DIR . 'phproad/system/phpr.php');
2701
+ include (M1_STORE_BASE_DIR . 'phproad/modules/phpr/classes/phpr_securityframework.php');
2702
+
2703
+ define('PATH_APP','');
2704
+
2705
+
2706
+ if(phpversion() > 5)
2707
+ {
2708
+ eval ('Phpr::$config = new MockConfig();
2709
+ Phpr::$config->set("SECURE_CONFIG_PATH", M1_STORE_BASE_DIR . "config/config.dat");
2710
+ $framework = Phpr_SecurityFramework::create();');
2711
+ }
2712
+
2713
+ $config_content = $framework->get_config_content();
2714
+
2715
+ $this->setHostPort($config_content['mysql_params']['host']);
2716
+ $this->Dbname = $config_content['mysql_params']['database'];
2717
+ $this->Username = $config_content['mysql_params']['user'];
2718
+ $this->Password = $config_content['mysql_params']['password'];
2719
+
2720
+ $this->categoriesImagesDir = '/uploaded/thumbnails/';
2721
+ $this->productsImagesDir = '/uploaded/';
2722
+ $this->manufacturersImagesDir = '/uploaded/thumbnails/';
2723
+
2724
+ $version = $this->getCartVersionFromDb("version_str", "core_versions", "moduleId = 'shop'");
2725
+ $this->cartVars['dbVersion'] = $version;
2726
+
2727
+ }
2728
+ }
2729
+
2730
+ class MockConfig {
2731
+ var $_data = array();
2732
+ function set($key, $value)
2733
+ {
2734
+ $this->_data[$key] = $value;
2735
+ }
2736
+
2737
+ function get($key, $default = 'default')
2738
+ {
2739
+ return isset($this->_data[$key]) ? $this->_data[$key] : $default;
2740
+ }
2741
+ }
2742
+
2743
+ class M1_Config_Adapter_DrupalCommerce extends M1_Config_Adapter
2744
+ {
2745
+
2746
+ function M1_Config_Adapter_DrupalCommerce()
2747
+ {
2748
+ @include_once M1_STORE_BASE_DIR . "sites/default/settings.php";
2749
+
2750
+ $url = $databases['default']['default'];
2751
+
2752
+ $url['username'] = urldecode($url['username']);
2753
+ $url['password'] = isset($url['password']) ? urldecode($url['password']) : '';
2754
+ $url['host'] = urldecode($url['host']);
2755
+ $url['database'] = urldecode($url['database']);
2756
+ if (isset($url['port'])) {
2757
+ $url['host'] = $url['host'] .':'. $url['port'];
2758
+ }
2759
+
2760
+ $this->setHostPort( $url['host'] );
2761
+ $this->Dbname = ltrim( $url['database'], '/' );
2762
+ $this->Username = $url['username'];
2763
+ $this->Password = $url['password'];
2764
+
2765
+ $this->imagesDir = "/sites/default/files/";
2766
+ if( !file_exists( M1_STORE_BASE_DIR . $this->imagesDir ) ) {
2767
+ $this->imagesDir = "/files";
2768
+ }
2769
+
2770
+
2771
+ $fileInfo = M1_STORE_BASE_DIR . "/sites/all/modules/commerce/commerce.info";
2772
+ if ( file_exists( $fileInfo ) ) {
2773
+ $str = file_get_contents( $fileInfo );
2774
+ if ( preg_match('/version\s+=\s+".+-(.+)"/', $str, $match) != 0 ) {
2775
+ $this->cartVars['dbVersion'] = $match[1];
2776
+ unset($match);
2777
+ }
2778
+ }
2779
+
2780
+ $this->categoriesImagesDir = $this->imagesDir;
2781
+ $this->productsImagesDir = $this->imagesDir;
2782
+ $this->manufacturersImagesDir = $this->imagesDir;
2783
+
2784
+
2785
+ }
2786
+ }
2787
+
2788
+ class M1_Config_Adapter_SSFree extends M1_Config_Adapter
2789
+ {
2790
+ function M1_Config_Adapter_SSFree()
2791
+ {
2792
+ $config = file_get_contents(M1_STORE_BASE_DIR . 'cfg/connect.inc.php');
2793
+ preg_match("/define\(\'DB_NAME\', \'(.+)\'\);/", $config, $match);
2794
+ $this->Dbname = $match[1];
2795
+ preg_match("/define\(\'DB_USER\', \'(.+)\'\);/", $config, $match);
2796
+ $this->Username = $match[1];
2797
+ preg_match("/define\(\'DB_PASS\', \'(.*)\'\);/", $config, $match);
2798
+ $this->Password = $match[1];
2799
+ preg_match("/define\(\'DB_HOST\', \'(.+)\'\);/", $config, $match);
2800
+ $this->setHostPort( $match[1] );
2801
+
2802
+ $this->imagesDir = "products_pictures/";
2803
+ $this->categoriesImagesDir = $this->imagesDir;
2804
+ $this->productsImagesDir = $this->imagesDir;
2805
+ $this->manufacturersImagesDir = $this->imagesDir;
2806
+
2807
+ $generalInc = file_get_contents(M1_STORE_BASE_DIR . 'cfg/general.inc.php');
2808
+
2809
+ preg_match("/define\(\'CONF_CURRENCY_ISO3\', \'(.+)\'\);/", $generalInc, $match);
2810
+ if (count($match) != 0) {
2811
+ $this->cartVars['iso3Currency'] = $match[1];
2812
+ }
2813
+
2814
+ preg_match("/define\(\'CONF_CURRENCY_ID_LEFT\', \'(.+)\'\);/", $generalInc, $match);
2815
+ if (count($match) != 0) {
2816
+ $this->cartVars['currencySymbolLeft'] = $match[1];
2817
+ }
2818
+
2819
+ preg_match("/define\(\'CONF_CURRENCY_ID_RIGHT\', \'(.+)\'\);/", $generalInc, $match);
2820
+ if (count($match) != 0) {
2821
+ $this->cartVars['currencySymbolRight'] = $match[1];
2822
+ }
2823
+ }
2824
+
2825
+ }
2826
+
2827
+ class M1_Config_Adapter_Zencart137 extends M1_Config_Adapter
2828
+ {
2829
+ function M1_Config_Adapter_Zencart137()
2830
+ {
2831
+ $cur_dir = getcwd();
2832
+
2833
+ chdir(M1_STORE_BASE_DIR);
2834
+
2835
+ @require_once M1_STORE_BASE_DIR
2836
+ . "includes" . DIRECTORY_SEPARATOR
2837
+ . "configure.php";
2838
+
2839
+ chdir($cur_dir);
2840
+
2841
+ $this->imagesDir = DIR_WS_IMAGES;
2842
+
2843
+ $this->categoriesImagesDir = $this->imagesDir;
2844
+ $this->productsImagesDir = $this->imagesDir;
2845
+ if ( defined('DIR_WS_PRODUCT_IMAGES') ) {
2846
+ $this->productsImagesDir = DIR_WS_PRODUCT_IMAGES;
2847
+ }
2848
+ if ( defined('DIR_WS_ORIGINAL_IMAGES') ) {
2849
+ $this->productsImagesDir = DIR_WS_ORIGINAL_IMAGES;
2850
+ }
2851
+ $this->manufacturersImagesDir = $this->imagesDir;
2852
+
2853
+ //$this->Host = DB_SERVER;
2854
+ $this->setHostPort(DB_SERVER);
2855
+ $this->Username = DB_SERVER_USERNAME;
2856
+ $this->Password = DB_SERVER_PASSWORD;
2857
+ $this->Dbname = DB_DATABASE;
2858
+ if ( file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . 'version.php') ) {
2859
+ @require_once M1_STORE_BASE_DIR
2860
+ . "includes" . DIRECTORY_SEPARATOR
2861
+ . "version.php";
2862
+ $major = PROJECT_VERSION_MAJOR;
2863
+ $minor = PROJECT_VERSION_MINOR;
2864
+ if (defined('EXPECTED_DATABASE_VERSION_MAJOR') && EXPECTED_DATABASE_VERSION_MAJOR != '' ) {
2865
+ $major = EXPECTED_DATABASE_VERSION_MAJOR;
2866
+ }
2867
+ if (defined('EXPECTED_DATABASE_VERSION_MINOR') && EXPECTED_DATABASE_VERSION_MINOR != '' ) {
2868
+ $minor = EXPECTED_DATABASE_VERSION_MINOR;
2869
+ }
2870
+
2871
+ if ( $major != '' && $minor != '' ) {
2872
+ $this->cartVars['dbVersion'] = $major.'.'.$minor;
2873
+ }
2874
+
2875
+ }
2876
+ }
2877
+ }
2878
+
2879
+
2880
+
2881
+
2882
+ class M1_Config_Adapter
2883
+ {
2884
+ var $Host = 'localhost';
2885
+ var $Port = null;//"3306";
2886
+ var $Username = 'root';
2887
+ var $Password = '';
2888
+ var $Dbname = '';
2889
+ var $TblPrefix = '';
2890
+
2891
+ var $cartType = 'Oscommerce22ms2';
2892
+ var $imagesDir = '';
2893
+ var $categoriesImagesDir = '';
2894
+ var $productsImagesDir = '';
2895
+ var $manufacturersImagesDir = '';
2896
+ var $categoriesImagesDirs = '';
2897
+ var $productsImagesDirs = '';
2898
+ var $manufacturersImagesDirs = '';
2899
+
2900
+ var $languages = array();
2901
+ var $cartVars = array();
2902
+
2903
+ function create()
2904
+ {
2905
+ if (isset($_GET["action"]) && $_GET["action"] == "update") {
2906
+ return null;
2907
+ }
2908
+
2909
+ $cartType = $this->_detectCartType();
2910
+ $className = "M1_Config_Adapter_" . $cartType;
2911
+
2912
+ $obj = new $className();
2913
+ $obj->cartType = $cartType;
2914
+
2915
+ return $obj;
2916
+ }
2917
+
2918
+ function _detectCartType()
2919
+ {
2920
+ // Zencart137
2921
+ if (file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . "configure.php")
2922
+ && file_exists(M1_STORE_BASE_DIR . "ipn_main_handler.php")
2923
+ ) {
2924
+ return "Zencart137";
2925
+ }
2926
+
2927
+ //osCommerce
2928
+ /* is if not tomatocart */
2929
+ if (file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . "configure.php")
2930
+ && !file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . "toc_constants.php")
2931
+ ) {
2932
+ return "Oscommerce22ms2";
2933
+ }
2934
+
2935
+ if (file_exists(M1_STORE_BASE_DIR . "/includes/configure.php")) {
2936
+ return "Gambio";
2937
+ }
2938
+
2939
+ //JooCart
2940
+ if (file_exists(M1_STORE_BASE_DIR . '/components/com_opencart/opencart.php')) {
2941
+ return 'JooCart';
2942
+ }
2943
+
2944
+ //ACEShop
2945
+ if (file_exists(M1_STORE_BASE_DIR . '/components/com_aceshop/aceshop.php')) {
2946
+ return 'AceShop';
2947
+ }
2948
+
2949
+ //Litecommerce
2950
+ if ((file_exists(M1_STORE_BASE_DIR .'/etc/config.php'))
2951
+ || (file_exists(M1_STORE_BASE_DIR .'/modules/lc_connector/litecommerce/etc/config.php'))
2952
+ ) {
2953
+ return "Litecommerce";
2954
+ }
2955
+
2956
+ //Prestashop11
2957
+ if (file_exists(M1_STORE_BASE_DIR . "config/config.inc.php")) {
2958
+ if (file_exists(M1_STORE_BASE_DIR . "cache/class_index.php")) {
2959
+ return "Prestashop15";
2960
+ }
2961
+ return "Prestashop11";
2962
+ }
2963
+
2964
+ /*
2965
+ * Virtuemart113
2966
+ */
2967
+ if (file_exists(M1_STORE_BASE_DIR . "configuration.php")) {
2968
+ return "Virtuemart113";
2969
+ }
2970
+
2971
+ /*
2972
+ * Pinnacle361
2973
+ */
2974
+ if (file_exists(M1_STORE_BASE_DIR . 'content/engine/engine_config.php')) {
2975
+ return "Pinnacle361";
2976
+ }
2977
+
2978
+ // Magento1212, we can be sure that PHP is >= 5.2.0
2979
+ if (file_exists(M1_STORE_BASE_DIR . 'app/etc/local.xml')) {
2980
+ return "Magento1212";
2981
+ }
2982
+
2983
+ //Cubecart3
2984
+ if (file_exists(M1_STORE_BASE_DIR . 'includes/global.inc.php')) {
2985
+ return "Cubecart";
2986
+ }
2987
+
2988
+ //Cscart203 - 3
2989
+ if (file_exists(M1_STORE_BASE_DIR . "config.local.php") || file_exists(M1_STORE_BASE_DIR . "partner.php")) {
2990
+ return "Cscart203";
2991
+ }
2992
+
2993
+ //Opencart14
2994
+ if ((file_exists(M1_STORE_BASE_DIR . "system/startup.php")
2995
+ || (file_exists(M1_STORE_BASE_DIR . "common.php"))
2996
+ || (file_exists(M1_STORE_BASE_DIR . "library/locator.php"))
2997
+ ) && file_exists(M1_STORE_BASE_DIR . "config.php")
2998
+ ) {
2999
+ return "Opencart14";
3000
+ }
3001
+
3002
+ //Shopware
3003
+ if (file_exists(M1_STORE_BASE_DIR . "config.php") && file_exists(M1_STORE_BASE_DIR . "shopware.php")) {
3004
+ return "Shopware";
3005
+ }
3006
+
3007
+ //XCart
3008
+ if (file_exists(M1_STORE_BASE_DIR . "config.php")) {
3009
+ return "XCart";
3010
+ }
3011
+
3012
+ //LemonStand
3013
+ if (file_exists(M1_STORE_BASE_DIR . "boot.php")) {
3014
+ return "LemonStand";
3015
+ }
3016
+
3017
+ //Interspire
3018
+ if (file_exists(M1_STORE_BASE_DIR . "config/config.php")) {
3019
+ return "Interspire";
3020
+ }
3021
+
3022
+ //Squirrelcart242
3023
+ if (file_exists(M1_STORE_BASE_DIR . 'squirrelcart/config.php')) {
3024
+ return "Squirrelcart242";
3025
+ }
3026
+
3027
+ //Shopscript WebAsyst
3028
+ if (file_exists(M1_STORE_BASE_DIR . 'kernel/wbs.xml')) {
3029
+ return "WebAsyst";
3030
+ }
3031
+
3032
+ //Shopscript Premium
3033
+ if (file_exists(M1_STORE_BASE_DIR . 'cfg/general.inc.php') && file_exists(M1_STORE_BASE_DIR . 'cfg/connect.inc.php')) {
3034
+ return "SSFree";
3035
+ }
3036
+
3037
+ //Shopscript Premium
3038
+ if (file_exists(M1_STORE_BASE_DIR . 'cfg/connect.inc.php')) {
3039
+ return "SSPremium";
3040
+ }
3041
+
3042
+ //ShopScript5
3043
+ if (file_exists(M1_STORE_BASE_DIR . 'wa.php') && file_exists(M1_STORE_BASE_DIR . 'wa-config/db.php')) {
3044
+ return "SSPremium";
3045
+ }
3046
+
3047
+ //Summercart3
3048
+ if (file_exists(M1_STORE_BASE_DIR . 'sclic.lic') && file_exists(M1_STORE_BASE_DIR . 'include/miphpf/Config.php')) {
3049
+ return "Summercart3";
3050
+ }
3051
+
3052
+ //XtcommerceVeyton
3053
+ if (file_exists(M1_STORE_BASE_DIR . 'conf/config.php')) {
3054
+ return "XtcommerceVeyton";
3055
+ }
3056
+
3057
+ //Ubercart
3058
+ if (file_exists(M1_STORE_BASE_DIR . 'sites/default/settings.php' )) {
3059
+ if (file_exists( M1_STORE_BASE_DIR . '/modules/ubercart/uc_store/includes/coder_review_uc3x.inc')) {
3060
+ return "Ubercart3";
3061
+ } elseif (file_exists(M1_STORE_BASE_DIR . 'sites/all/modules/commerce/includes/commerce.controller.inc')) {
3062
+ return "DrupalCommerce";
3063
+ }
3064
+
3065
+ return "Ubercart";
3066
+ }
3067
+
3068
+ //Woocommerce
3069
+ if (file_exists(M1_STORE_BASE_DIR . 'wp-config.php')
3070
+ && file_exists(M1_STORE_BASE_DIR . 'wp-content/plugins/woocommerce/woocommerce.php')
3071
+ ) {
3072
+ return 'Woocommerce';
3073
+ }
3074
+
3075
+ if (file_exists(dirname(M1_STORE_BASE_DIR) . '/wp-config.php')
3076
+ && file_exists(M1_STORE_BASE_DIR . 'wp-content/plugins/woocommerce/woocommerce.php')
3077
+ ) {
3078
+ return 'Woocommerce';
3079
+ }
3080
+
3081
+ //WPecommerce
3082
+ if (file_exists(M1_STORE_BASE_DIR . 'wp-config.php')) {
3083
+ return 'WPecommerce';
3084
+ }
3085
+
3086
+ //OXID e-shop
3087
+ if (file_exists( M1_STORE_BASE_DIR . 'config.inc.php')) {
3088
+ return 'Oxid';
3089
+ }
3090
+
3091
+ //HHGMultistore
3092
+ if (file_exists(M1_STORE_BASE_DIR . 'core/config/configure.php')) {
3093
+ return 'Hhgmultistore';
3094
+ }
3095
+
3096
+ //SunShop
3097
+ if (file_exists(M1_STORE_BASE_DIR . "include" . DIRECTORY_SEPARATOR . "config.php")
3098
+ || file_exists(M1_STORE_BASE_DIR . "include" . DIRECTORY_SEPARATOR . "db_mysql.php")
3099
+ ) {
3100
+ return "Sunshop4";
3101
+ }
3102
+
3103
+ //Tomatocart
3104
+ if (file_exists(M1_STORE_BASE_DIR . "includes" . DIRECTORY_SEPARATOR . "configure.php")
3105
+ && file_exists(M1_STORE_BASE_DIR. "includes" . DIRECTORY_SEPARATOR . "toc_constants.php")
3106
+ ) {
3107
+ return 'Tomatocart';
3108
+ }
3109
+
3110
+ die ("BRIDGE_ERROR_CONFIGURATION_NOT_FOUND");
3111
+ }
3112
+
3113
+ function getAdapterPath($cartType)
3114
+ {
3115
+ return M1_STORE_BASE_DIR . M1_BRIDGE_DIRECTORY_NAME . DIRECTORY_SEPARATOR
3116
+ . "app" . DIRECTORY_SEPARATOR
3117
+ . "class" . DIRECTORY_SEPARATOR
3118
+ . "config_adapter" . DIRECTORY_SEPARATOR . $cartType . ".php";
3119
+ }
3120
+
3121
+ function setHostPort($source)
3122
+ {
3123
+ $source = trim($source);
3124
+
3125
+ if ($source == '') {
3126
+ $this->Host = 'localhost';
3127
+ return;
3128
+ }
3129
+
3130
+ $conf = explode(":", $source);
3131
+
3132
+ if (isset($conf[0]) && isset($conf[1])) {
3133
+ $this->Host = $conf[0];
3134
+ $this->Port = $conf[1];
3135
+ } elseif ($source[0] == '/') {
3136
+ $this->Host = 'localhost';
3137
+ $this->Port = $source;
3138
+ } else {
3139
+ $this->Host = $source;
3140
+ }
3141
+ }
3142
+
3143
+ function connect()
3144
+ {
3145
+ if (function_exists('mysql_connect')) {
3146
+ $link = new M1_Mysql($this);
3147
+ } elseif (function_exists('mysqli_connect')) {
3148
+ $link = new M1_Mysqli($this);
3149
+ } elseif (extension_loaded('pdo_mysql')) {
3150
+ $link = new M1_Pdo($this);
3151
+ } else {
3152
+ $link = false;
3153
+ }
3154
+
3155
+ return $link;
3156
+ }
3157
+
3158
+ function getCartVersionFromDb($field, $tableName, $where)
3159
+ {
3160
+ $version = '';
3161
+
3162
+ $link = $this->connect();
3163
+ if (!$link) {
3164
+ return '[ERROR] MySQL Query Error: Can not connect to DB';
3165
+ }
3166
+
3167
+ $result = $link->localQuery("
3168
+ SELECT " . $field . " AS version
3169
+ FROM " . $this->TblPrefix . $tableName . "
3170
+ WHERE " . $where
3171
+ );
3172
+
3173
+ if (is_array($result) && isset($result[0]['version'])) {
3174
+ $version = $result[0]['version'];
3175
+ }
3176
+
3177
+ return $version;
3178
+ }
3179
+ }
3180
+
3181
+
3182
+ class M1_Bridge
3183
+ {
3184
+ var $_link = null; //mysql connection link
3185
+ var $config = null; //config adapter
3186
+
3187
+ /**
3188
+ * Bridge constructor
3189
+ *
3190
+ * @param M1_Config_Adapter $config
3191
+ * @return M1_Bridge
3192
+ */
3193
+ function M1_Bridge($config)
3194
+ {
3195
+ $this->config = $config;
3196
+
3197
+ if ($this->getAction() != "savefile" && $this->getAction() != "update") {
3198
+ $this->_link = $this->config->connect();
3199
+ }
3200
+ }
3201
+
3202
+ function getTablesPrefix()
3203
+ {
3204
+ return $this->config->TblPrefix;
3205
+ }
3206
+
3207
+ function getLink()
3208
+ {
3209
+ return $this->_link;
3210
+ }
3211
+
3212
+ function query($sql, $fetchMode)
3213
+ {
3214
+ return $this->_link->query($sql, $fetchMode);
3215
+ }
3216
+
3217
+ function getAction()
3218
+ {
3219
+ if (isset($_GET['action'])) {
3220
+ return str_replace('.', '', $_GET['action']);
3221
+ }
3222
+
3223
+ return '';
3224
+ }
3225
+
3226
+ function run()
3227
+ {
3228
+ $action = $this->getAction();
3229
+
3230
+ if ($action != "update") {
3231
+ $this->_selfTest();
3232
+ }
3233
+
3234
+ if ($action == "checkbridge") {
3235
+ echo "BRIDGE_OK";
3236
+ return;
3237
+ }
3238
+
3239
+ if ($action == "update") {
3240
+ $this->_checkPossibilityUpdate();
3241
+ }
3242
+
3243
+ $className = "M1_Bridge_Action_" . ucfirst($action);
3244
+ if (!class_exists($className)) {
3245
+ echo 'ACTION_DO_NOT EXIST' . PHP_EOL;
3246
+ die;
3247
+ }
3248
+
3249
+ $actionObj = new $className();
3250
+ @$actionObj->cartType = @$this->config->cartType;
3251
+ $actionObj->perform($this);
3252
+ $this->_destroy();
3253
+ }
3254
+
3255
+ function isWritable($dir)
3256
+ {
3257
+ if (!@is_dir($dir)) {
3258
+ return false;
3259
+ }
3260
+
3261
+ $dh = @opendir($dir);
3262
+
3263
+ if ($dh === false) {
3264
+ return false;
3265
+ }
3266
+
3267
+ while (($entry = readdir($dh)) !== false) {
3268
+ if ($entry == "." || $entry == ".." || !@is_dir($dir . DIRECTORY_SEPARATOR . $entry)) {
3269
+ continue;
3270
+ }
3271
+
3272
+ if (!$this->isWritable($dir . DIRECTORY_SEPARATOR . $entry)) {
3273
+ return false;
3274
+ }
3275
+ }
3276
+
3277
+ if (!is_writable($dir)) {
3278
+ return false;
3279
+ }
3280
+
3281
+ return true;
3282
+ }
3283
+
3284
+ function _destroy()
3285
+ {
3286
+ $this->_link = null;
3287
+ }
3288
+
3289
+ function _checkPossibilityUpdate()
3290
+ {
3291
+ if (!is_writable(M1_STORE_BASE_DIR . "/" . M1_BRIDGE_DIRECTORY_NAME . "/")) {
3292
+ die("ERROR_TRIED_TO_PERMISSION" . M1_STORE_BASE_DIR . "/" . M1_BRIDGE_DIRECTORY_NAME . "/");
3293
+ }
3294
+
3295
+ if (!is_writable(M1_STORE_BASE_DIR . "/". M1_BRIDGE_DIRECTORY_NAME . "/bridge.php")) {
3296
+ die("ERROR_TRIED_TO_PERMISSION_BRIDGE_FILE" . M1_STORE_BASE_DIR . "/" . M1_BRIDGE_DIRECTORY_NAME . "/bridge.php");
3297
+ }
3298
+ }
3299
+
3300
+ function _selfTest()
3301
+ {
3302
+ if (!isset($_GET['ver']) || $_GET['ver'] != M1_BRIDGE_VERSION) {
3303
+ die ('ERROR_BRIDGE_VERSION_NOT_SUPPORTED');
3304
+ }
3305
+
3306
+ if (isset($_GET['token']) && $_GET['token'] == M1_TOKEN) {
3307
+ // good :)
3308
+ } else {
3309
+ die('ERROR_INVALID_TOKEN');
3310
+ }
3311
+
3312
+ if ((!isset($_GET['storetype']) || $_GET['storetype'] == 'target') && $this->getAction() == 'checkbridge') {
3313
+
3314
+ if (trim($this->config->imagesDir) != "") {
3315
+ if (!file_exists(M1_STORE_BASE_DIR . $this->config->imagesDir) && is_writable(M1_STORE_BASE_DIR)) {
3316
+ if (!@mkdir(M1_STORE_BASE_DIR . $this->config->imagesDir, 0777, true)) {
3317
+ die('ERROR_TRIED_TO_CREATE_IMAGE_DIR' . M1_STORE_BASE_DIR . $this->config->imagesDir);
3318
+ }
3319
+ }
3320
+
3321
+ if (!$this->isWritable(M1_STORE_BASE_DIR . $this->config->imagesDir)) {
3322
+ die('ERROR_NO_IMAGES_DIR '.M1_STORE_BASE_DIR . $this->config->imagesDir);
3323
+ }
3324
+ }
3325
+
3326
+ if (trim($this->config->categoriesImagesDir) != "") {
3327
+ if (!file_exists(M1_STORE_BASE_DIR . $this->config->categoriesImagesDir) && is_writable(M1_STORE_BASE_DIR)) {
3328
+ if (!@mkdir(M1_STORE_BASE_DIR . $this->config->categoriesImagesDir, 0777, true)) {
3329
+ die('ERROR_TRIED_TO_CREATE_IMAGE_DIR' . M1_STORE_BASE_DIR . $this->config->categoriesImagesDir);
3330
+ }
3331
+ }
3332
+
3333
+ if (!$this->isWritable(M1_STORE_BASE_DIR . $this->config->categoriesImagesDir)) {
3334
+ die('ERROR_NO_IMAGES_DIR '.M1_STORE_BASE_DIR . $this->config->categoriesImagesDir);
3335
+ }
3336
+ }
3337
+
3338
+ if (trim($this->config->productsImagesDir) != "") {
3339
+ if (!file_exists(M1_STORE_BASE_DIR . $this->config->productsImagesDir) && is_writable(M1_STORE_BASE_DIR)) {
3340
+ if (!@mkdir(M1_STORE_BASE_DIR . $this->config->productsImagesDir, 0777, true)) {
3341
+ die('ERROR_TRIED_TO_CREATE_IMAGE_DIR' . M1_STORE_BASE_DIR . $this->config->productsImagesDir);
3342
+ }
3343
+ }
3344
+
3345
+ if (!$this->isWritable(M1_STORE_BASE_DIR . $this->config->productsImagesDir)) {
3346
+ die('ERROR_NO_IMAGES_DIR '.M1_STORE_BASE_DIR . $this->config->productsImagesDir);
3347
+ }
3348
+ }
3349
+
3350
+ if (trim($this->config->manufacturersImagesDir) != "") {
3351
+ if (!file_exists(M1_STORE_BASE_DIR . $this->config->manufacturersImagesDir) && is_writable(M1_STORE_BASE_DIR)) {
3352
+ if (!@mkdir(M1_STORE_BASE_DIR . $this->config->manufacturersImagesDir, 0777, true)) {
3353
+ die('ERROR_TRIED_TO_CREATE_IMAGE_DIR' . M1_STORE_BASE_DIR . $this->config->manufacturersImagesDir);
3354
+ }
3355
+ }
3356
+
3357
+ if (!$this->isWritable(M1_STORE_BASE_DIR . $this->config->manufacturersImagesDir)) {
3358
+ die('ERROR_NO_IMAGES_DIR '.M1_STORE_BASE_DIR . $this->config->manufacturersImagesDir);
3359
+ }
3360
+ }
3361
+ }
3362
+ }
3363
+ }
3364
+
3365
+
3366
+ /**
3367
+ * @package api2cart
3368
+ * @author Vasul Babiy (v.babyi@magneticone.com)
3369
+ * @license Not public license
3370
+ * @link https://www.api2cart.com
3371
+ */
3372
+
3373
+ class M1_Mysql
3374
+ {
3375
+ var $config = null; // config adapter
3376
+ var $result = array();
3377
+ var $dataBaseHandle = null;
3378
+
3379
+ /**
3380
+ * mysql constructor
3381
+ *
3382
+ * @param M1_Config_Adapter $config
3383
+ * @return M1_Mysql
3384
+ */
3385
+ function M1_Mysql($config)
3386
+ {
3387
+ $this->config = $config;
3388
+ }
3389
+
3390
+ /**
3391
+ * @return bool|null|resource
3392
+ */
3393
+ function getDataBaseHandle()
3394
+ {
3395
+ if ($this->dataBaseHandle) {
3396
+ return $this->dataBaseHandle;
3397
+ }
3398
+
3399
+ $this->dataBaseHandle = $this->connect();
3400
+
3401
+ if (!$this->dataBaseHandle) {
3402
+ exit('[ERROR] MySQL Query Error: Can not connect to DB');
3403
+ }
3404
+
3405
+ return $this->dataBaseHandle;
3406
+ }
3407
+
3408
+ /**
3409
+ * @return bool|null|resource
3410
+ */
3411
+ function connect()
3412
+ {
3413
+ $triesCount = 10;
3414
+ $link = null;
3415
+ $host = $this->config->Host . ($this->config->Port ? ':' . $this->config->Port : '');
3416
+ $password = stripslashes($this->config->Password);
3417
+
3418
+ while (!$link) {
3419
+ if (!$triesCount--) {
3420
+ break;
3421
+ }
3422
+
3423
+ $link = @mysql_connect($host, $this->config->Username, $password);
3424
+ if (!$link) {
3425
+ sleep(5);
3426
+ }
3427
+ }
3428
+
3429
+ if ($link) {
3430
+ mysql_select_db($this->config->Dbname, $link);
3431
+ } else {
3432
+ return false;
3433
+ }
3434
+
3435
+ return $link;
3436
+ }
3437
+
3438
+ /**
3439
+ * @param string $sql sql query
3440
+ *
3441
+ * @return array
3442
+ */
3443
+ function localQuery($sql)
3444
+ {
3445
+ $result = array();
3446
+ $dataBaseHandle = $this->getDataBaseHandle();
3447
+
3448
+ $sth = mysql_query($sql, $dataBaseHandle);
3449
+
3450
+ if (is_bool($sth)) {
3451
+ return $sth;
3452
+ }
3453
+
3454
+ while (($row = mysql_fetch_assoc($sth)) != false) {
3455
+ $result[] = $row;
3456
+ }
3457
+
3458
+ return $result;
3459
+ }
3460
+
3461
+ /**
3462
+ * @param string $sql sql query
3463
+ * @param int $fetchType fetch Type
3464
+ *
3465
+ * @return array
3466
+ */
3467
+ function query($sql, $fetchType)
3468
+ {
3469
+ $result = array(
3470
+ 'result' => null,
3471
+ 'message' => '',
3472
+ );
3473
+ $dataBaseHandle = $this->getDataBaseHandle();
3474
+
3475
+ if (!$dataBaseHandle) {
3476
+ $result['message'] = '[ERROR] MySQL Query Error: Can not connect to DB';
3477
+ return $result;
3478
+ }
3479
+
3480
+ if (isset($_GET['disable_checks'])) {
3481
+ $this->localQuery('SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0');
3482
+ $this->localQuery("SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'");
3483
+ }
3484
+
3485
+ if (isset($_REQUEST['set_names'])) {
3486
+ @mysql_query("SET NAMES " . @mysql_real_escape_string($_REQUEST['set_names']), $dataBaseHandle);
3487
+ @mysql_query("SET CHARACTER SET " . @mysql_real_escape_string($_REQUEST['set_names']), $dataBaseHandle);
3488
+ @mysql_query("SET CHARACTER_SET_CONNECTION=" . @mysql_real_escape_string($_REQUEST['set_names']), $dataBaseHandle);
3489
+ }
3490
+
3491
+ $fetchMode = MYSQL_ASSOC;
3492
+ switch ($fetchType) {
3493
+ case 3:
3494
+ $fetchMode = MYSQL_BOTH;
3495
+ break;
3496
+ case 2:
3497
+ $fetchMode = MYSQL_NUM;
3498
+ break;
3499
+ case 1:
3500
+ $fetchMode = MYSQL_ASSOC;
3501
+ break;
3502
+ default:
3503
+ break;
3504
+ }
3505
+
3506
+ $res = mysql_query($sql, $dataBaseHandle);
3507
+
3508
+ $triesCount = 10;
3509
+ while (mysql_errno($dataBaseHandle) == 2013) {
3510
+ if (!$triesCount--) {
3511
+ break;
3512
+ }
3513
+ // reconnect
3514
+ $dataBaseHandle = $this->getDataBaseHandle();
3515
+ if ($dataBaseHandle) {
3516
+
3517
+ if (isset($_REQUEST['set_names'])) {
3518
+ @mysql_query("SET NAMES " . @mysql_real_escape_string($_REQUEST['set_names']), $dataBaseHandle);
3519
+ @mysql_query("SET CHARACTER SET " . @mysql_real_escape_string($_REQUEST['set_names']), $dataBaseHandle);
3520
+ @mysql_query("SET CHARACTER_SET_CONNECTION=" . @mysql_real_escape_string($_REQUEST['set_names']), $dataBaseHandle);
3521
+ }
3522
+
3523
+ // execute query once again
3524
+ $res = mysql_query($sql, $dataBaseHandle);
3525
+ }
3526
+ }
3527
+
3528
+ if (($errno = mysql_errno($dataBaseHandle)) != 0) {
3529
+ $result['message'] = '[ERROR] Mysql Query Error: ' . $errno . ', ' . mysql_error($dataBaseHandle);
3530
+ return $result;
3531
+ }
3532
+
3533
+ if (!is_resource($res)) {
3534
+ $result['result'] = $res;
3535
+ return $result;
3536
+ }
3537
+
3538
+ $fetchedFields = array();
3539
+ while (($field = mysql_fetch_field($res)) !== false) {
3540
+ $fetchedFields[] = $field;
3541
+ }
3542
+
3543
+ $rows = array();
3544
+ while (($row = mysql_fetch_array($res, $fetchMode)) !== false) {
3545
+ $rows[] = $row;
3546
+ }
3547
+
3548
+ if (isset($_GET['disable_checks'])) {
3549
+ $this->localQuery("SET SQL_MODE=IFNULL(@OLD_SQL_MODE,'')");
3550
+ $this->localQuery("SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS,0)");
3551
+ }
3552
+
3553
+ $result['result'] = $rows;
3554
+ $result['fetchedFields'] = $fetchedFields;
3555
+
3556
+ mysql_free_result($res);
3557
+ return $result;
3558
+ }
3559
+
3560
+ /**
3561
+ * @return int
3562
+ */
3563
+ function getLastInsertId()
3564
+ {
3565
+ return mysql_insert_id($this->dataBaseHandle);
3566
+ }
3567
+
3568
+ /**
3569
+ * @return int
3570
+ */
3571
+ function getAffectedRows()
3572
+ {
3573
+ return mysql_affected_rows($this->dataBaseHandle);
3574
+ }
3575
+
3576
+ /**
3577
+ * @return void
3578
+ */
3579
+ function __destruct()
3580
+ {
3581
+ if ($this->dataBaseHandle) {
3582
+ mysql_close($this->dataBaseHandle);
3583
+ }
3584
+
3585
+ $this->dataBaseHandle = null;
3586
+ }
3587
+ }
3588
+
3589
+
3590
+ /**
3591
+ * @package api2cart
3592
+ * @author Vasul Babiy (v.babyi@magneticone.com)
3593
+ * @license Not public license
3594
+ * @link https://www.api2cart.com
3595
+ */
3596
+
3597
+ class M1_Pdo
3598
+ {
3599
+ var $config = null; // config adapter
3600
+ var $noResult = array('delete', 'update', 'move', 'truncate', 'insert', 'set', 'create', 'drop');
3601
+ var $dataBaseHandle = null;
3602
+
3603
+ var $insertedId = 0;
3604
+ var $affectedRows = 0;
3605
+
3606
+ /**
3607
+ * pdo constructor
3608
+ *
3609
+ * @param M1_Config_Adapter $config configuration
3610
+ * @return M1_Pdo
3611
+ */
3612
+ function M1_Pdo($config)
3613
+ {
3614
+ $this->config = $config;
3615
+ }
3616
+
3617
+ /**
3618
+ * @return bool|null|PDO
3619
+ */
3620
+ function getDataBaseHandle()
3621
+ {
3622
+ if ($this->dataBaseHandle) {
3623
+ return $this->dataBaseHandle;
3624
+ }
3625
+
3626
+ $this->dataBaseHandle = $this->connect();
3627
+
3628
+ if (!$this->dataBaseHandle) {
3629
+ exit('[ERROR] MySQL Query Error: Can not connect to DB');
3630
+ }
3631
+
3632
+ return $this->dataBaseHandle;
3633
+ }
3634
+
3635
+ /**
3636
+ * @return bool|PDO
3637
+ */
3638
+ function connect()
3639
+ {
3640
+ $triesCount = 3;
3641
+ $host = $this->config->Host . ($this->config->Port ? ':' . $this->config->Port : '');
3642
+ $password = stripslashes($this->config->Password);
3643
+ $dbName = $this->config->Dbname;
3644
+
3645
+ while ($triesCount) {
3646
+ try {
3647
+ $link = new PDO("mysql:host=$host; dbname=$dbName", $this->config->Username, $password);
3648
+ $link->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
3649
+
3650
+ return $link;
3651
+
3652
+ } catch (PDOException $e) {
3653
+ $triesCount--;
3654
+
3655
+ // fix invalid port
3656
+ $host = $this->config->Host;
3657
+ }
3658
+ }
3659
+ return false;
3660
+ }
3661
+
3662
+ /**
3663
+ * @param string $sql sql query
3664
+ *
3665
+ * @return array|bool
3666
+ */
3667
+ function localQuery($sql)
3668
+ {
3669
+ $result = array();
3670
+ $dataBaseHandle = $this->getDataBaseHandle();
3671
+
3672
+ $sth = $dataBaseHandle->query($sql);
3673
+
3674
+ foreach ($this->noResult as $statement) {
3675
+ if (!$sth || strpos(strtolower(trim($sql)), $statement) === 0) {
3676
+ return true;
3677
+ }
3678
+ }
3679
+
3680
+ while (($row = $sth->fetch(PDO::FETCH_ASSOC)) != false) {
3681
+ $result[] = $row;
3682
+ }
3683
+
3684
+ return $result;
3685
+ }
3686
+
3687
+ /**
3688
+ * @param string $sql sql query
3689
+ * @param int $fetchType fetch Type
3690
+ *
3691
+ * @return array
3692
+ */
3693
+ function query($sql, $fetchType)
3694
+ {
3695
+ $result = array(
3696
+ 'result' => null,
3697
+ 'message' => '',
3698
+ 'fetchedFields' => array()
3699
+ );
3700
+ $dataBaseHandle = $this->getDataBaseHandle();
3701
+
3702
+ if (isset($_GET['disable_checks'])) {
3703
+ $dataBaseHandle->exec('SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0');
3704
+ $dataBaseHandle->exec("SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'");
3705
+ }
3706
+
3707
+ if (isset($_REQUEST['set_names'])) {
3708
+ $dataBaseHandle->exec("SET NAMES '" . ($_REQUEST['set_names']) . "'");
3709
+ $dataBaseHandle->exec("SET CHARACTER SET '" . ($_REQUEST['set_names']) . "'");
3710
+ $dataBaseHandle->exec("SET CHARACTER_SET_CONNECTION = '" . ($_REQUEST['set_names']) . "'");
3711
+ }
3712
+
3713
+ switch ($fetchType) {
3714
+ case 3:
3715
+ $dataBaseHandle->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_BOTH);
3716
+ break;
3717
+ case 2:
3718
+ $dataBaseHandle->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_NUM);
3719
+ break;
3720
+ case 1:
3721
+ default:
3722
+ $dataBaseHandle->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
3723
+ break;
3724
+ }
3725
+
3726
+ try {
3727
+ $res = $dataBaseHandle->query($sql);
3728
+ $this->affectedRows = $res->rowCount();
3729
+ $this->insertedId = $dataBaseHandle->lastInsertId();
3730
+ } catch (PDOException $e) {
3731
+ $result['message'] = '[ERROR] Mysql Query Error: ' . $e->getCode() . ', ' . $e->getMessage();
3732
+ return $result;
3733
+ }
3734
+
3735
+ foreach ($this->noResult as $statement) {
3736
+ if (!$res || strpos(strtolower(trim($sql)), $statement) === 0) {
3737
+ $result['result'] = true;
3738
+ return $result;
3739
+ }
3740
+ }
3741
+
3742
+ $rows = array();
3743
+ while (($row = $res->fetch()) !== false) {
3744
+ $rows[] = $row;
3745
+ }
3746
+
3747
+ if (isset($_GET['disable_checks'])) {
3748
+ $this->localQuery("SET SQL_MODE=IFNULL(@OLD_SQL_MODE,'')");
3749
+ $this->localQuery("SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS,0)");
3750
+ }
3751
+
3752
+ $result['result'] = $rows;
3753
+
3754
+ unset($res);
3755
+ return $result;
3756
+ }
3757
+
3758
+ /**
3759
+ * @return string|int
3760
+ */
3761
+ function getLastInsertId()
3762
+ {
3763
+ return $this->insertedId;
3764
+ }
3765
+
3766
+ /**
3767
+ * @return int
3768
+ */
3769
+ function getAffectedRows()
3770
+ {
3771
+ return $this->affectedRows;
3772
+ }
3773
+
3774
+ /**
3775
+ * @return void
3776
+ */
3777
+ function __destruct()
3778
+ {
3779
+ $this->dataBaseHandle = null;
3780
+ }
3781
+ }
3782
+
3783
+
3784
+ define('M1_BRIDGE_VERSION', '21');
3785
+
3786
+ define('M1_BRIDGE_DIRECTORY_NAME', basename(getcwd()));
3787
+
3788
+ ini_set('display_errors', 1);
3789
+ if (substr(phpversion(), 0, 1) == 5) {
3790
+ error_reporting(E_ALL & ~E_STRICT);
3791
+ } else {
3792
+ error_reporting(E_ALL);
3793
+ }
3794
+
3795
+ require_once 'config.php';
3796
+
3797
+ function stripslashes_array($array) {
3798
+ return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
3799
+ }
3800
+
3801
+ function getPHPExecutable() {
3802
+ $paths = explode(PATH_SEPARATOR, getenv('PATH'));
3803
+ $paths[] = PHP_BINDIR;
3804
+ foreach ($paths as $path) {
3805
+ // we need this for XAMPP (Windows)
3806
+ if (isset($_SERVER["WINDIR"]) && strstr($path, 'php.exe') && file_exists($path) && is_file($path)) {
3807
+ return $path;
3808
+ } else {
3809
+ $phpExecutable = $path . DIRECTORY_SEPARATOR . "php" . (isset($_SERVER["WINDIR"]) ? ".exe" : "");
3810
+ if (file_exists($phpExecutable) && is_file($phpExecutable)) {
3811
+ return $phpExecutable;
3812
+ }
3813
+ }
3814
+ }
3815
+ return false;
3816
+ }
3817
+
3818
+ if (!isset($_SERVER))
3819
+ {
3820
+ $_GET = &$HTTP_GET_VARS;
3821
+ $_POST = &$HTTP_POST_VARS;
3822
+ $_ENV = &$HTTP_ENV_VARS;
3823
+ $_SERVER = &$HTTP_SERVER_VARS;
3824
+ $_COOKIE = &$HTTP_COOKIE_VARS;
3825
+ $_REQUEST = array_merge($_GET, $_POST, $_COOKIE);
3826
+ }
3827
+
3828
+ if (get_magic_quotes_gpc()) {
3829
+ $_COOKIE = stripslashes_array($_COOKIE);
3830
+ $_FILES = stripslashes_array($_FILES);
3831
+ $_GET = stripslashes_array($_GET);
3832
+ $_POST = stripslashes_array($_POST);
3833
+ $_REQUEST = stripslashes_array($_REQUEST);
3834
+ }
3835
+
3836
+ if (isset($_SERVER['SCRIPT_FILENAME'])) {
3837
+ $scriptPath = $_SERVER['SCRIPT_FILENAME'];
3838
+ if ( isset($_SERVER['PATH_TRANSLATED']) && $_SERVER['PATH_TRANSLATED'] != "" ) {
3839
+ $scriptPath = $_SERVER['PATH_TRANSLATED'];
3840
+ }
3841
+ define("M1_STORE_BASE_DIR", preg_replace('/[^\/\\\]*[\/\\\][^\/\\\]*$/', '', $scriptPath));
3842
+ } else {
3843
+ //Windows IIS
3844
+ define("M1_STORE_BASE_DIR", preg_replace('/[^\/\\\]*[\/\\\][^\/\\\]*$/', '', realpath(dirname(__FILE__) . "/../")));
3845
+ }
3846
+ $adapter = new M1_Config_Adapter();
3847
+ $bridge = new M1_Bridge($adapter->create());
3848
+
3849
+ if (!$bridge->getLink()) {
3850
+ die ('ERROR_BRIDGE_CANT_CONNECT_DB');
3851
+ }
3852
+
3853
+ $bridge->run();
3854
+ ?>
app/code/community/Webinterpret/Connector/bridge2cart/config.php CHANGED
@@ -1 +1,20 @@
1
- <?php // THIS FILE SHOULD BE WRITEABLE BY THE WEB SERVER
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Bridge config
4
+ *
5
+ * @category Webinterpret
6
+ * @package Webinterpret_Connector
7
+ * @author Webinterpret Team <info@webinterpret.com>
8
+ * @license http://opensource.org/licenses/osl-3.0.php
9
+ */
10
+
11
+ // Load helper
12
+ if (!class_exists('Webinterpret_Bridge2Cart_Helper')) {
13
+ if (!defined('WI_HELPER_CALL_HANDLE_REQUEST')) {
14
+ define('WI_HELPER_CALL_HANDLE_REQUEST', false);
15
+ }
16
+ require_once 'helper.php';
17
+ }
18
+
19
+ // Set M1 token
20
+ define("M1_TOKEN", Webinterpret_Bridge2Cart_Helper::getWebinterpretKey());
app/code/community/Webinterpret/Connector/bridge2cart/helper.php CHANGED
@@ -56,7 +56,7 @@ if (!function_exists('getallheaders')) {
56
 
57
  class Webinterpret_Bridge2Cart_Helper
58
  {
59
- const VERSION = '1.2.7.6';
60
  const PLATFORM_MAGENTO = 'magento';
61
  const PLATFORM_UNKNOWN = 'unknown';
62
  protected static $_storeBaseDir = null;
@@ -422,10 +422,19 @@ EOD;
422
  die();
423
  }
424
 
425
- self::validateBridgeToken();
 
 
 
 
 
 
 
 
 
 
426
 
427
  // Process action
428
- $action = isset($_GET['action']) ? $_GET['action'] : false;
429
  if ($action) {
430
 
431
  // Dynamically call static method
@@ -511,6 +520,18 @@ EOD;
511
  return self::PLATFORM_UNKNOWN;
512
  }
513
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  public static function platformConfigurationUpdateAction()
515
  {
516
  $response = self::newResponse();
56
 
57
  class Webinterpret_Bridge2Cart_Helper
58
  {
59
+ const VERSION = '1.2.7.7';
60
  const PLATFORM_MAGENTO = 'magento';
61
  const PLATFORM_UNKNOWN = 'unknown';
62
  protected static $_storeBaseDir = null;
422
  die();
423
  }
424
 
425
+ $action = isset($_GET['action']) ? $_GET['action'] : false;
426
+
427
+ // Validate token
428
+ $validateToken = true;
429
+ $validateTokenExcluded = array('plugin.diagnostics');
430
+ if (in_array($action, $validateTokenExcluded)) {
431
+ $validateToken = false;
432
+ }
433
+ if ($validateToken) {
434
+ self::validateBridgeToken();
435
+ }
436
 
437
  // Process action
 
438
  if ($action) {
439
 
440
  // Dynamically call static method
520
  return self::PLATFORM_UNKNOWN;
521
  }
522
 
523
+ public static function getWebinterpretKey()
524
+ {
525
+ $platform = self::getPlatform();
526
+ if ($platform == self::PLATFORM_MAGENTO) {
527
+ self::loadMagento();
528
+ $key = Mage::getStoreConfig('webinterpret_connector/key');
529
+ } else {
530
+ throw new Exception("Method is not supported on this platform: $platform");
531
+ }
532
+ return $key;
533
+ }
534
+
535
  public static function platformConfigurationUpdateAction()
536
  {
537
  $response = self::newResponse();
app/code/community/Webinterpret/Connector/controllers/ApiController.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- /**
3
- * Api controller
4
- *
5
- * @category Webinterpret
6
- * @package Webinterpret_Connector
7
- * @author Webinterpret Team <info@webinterpret.com>
8
- * @license http://opensource.org/licenses/osl-3.0.php
9
- */
10
- class Webinterpret_Connector_ApiController extends Mage_Core_Controller_Front_Action
11
- {
12
- public function indexAction()
13
- {
14
- $dir = Mage::helper('webinterpret_connector')->getModuleBridgeDir();
15
- $path = $dir . DS . 'helper.php';
16
- if (!file_exists($path)) {
17
- $this->_forward('defaultNoRoute');
18
- return;
19
- }
20
- require_once $path;
21
- Webinterpret_Bridge2Cart_Helper::handleRequest();
22
- die();
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Webinterpret/Connector/controllers/HelperController.php CHANGED
@@ -11,14 +11,18 @@ class Webinterpret_Connector_HelperController extends Mage_Core_Controller_Front
11
  {
12
  public function indexAction()
13
  {
14
- $dir = Mage::helper('webinterpret_connector')->getModuleBridgeDir();
15
- $path = $dir . DS . 'helper.php';
16
- if (!file_exists($path)) {
17
- $this->_forward('defaultNoRoute');
18
- return;
 
 
 
 
 
 
19
  }
20
- require_once $path;
21
- Webinterpret_Bridge2Cart_Helper::handleRequest();
22
  die();
23
  }
24
 
11
  {
12
  public function indexAction()
13
  {
14
+ try {
15
+ $dir = Mage::helper('webinterpret_connector')->getModuleBridgeDir();
16
+ $path = $dir . DS . 'helper.php';
17
+ if (!file_exists($path)) {
18
+ $this->_forward('defaultNoRoute');
19
+ return;
20
+ }
21
+ require_once $path;
22
+ Webinterpret_Bridge2Cart_Helper::handleRequest();
23
+ } catch (Exception $e) {
24
+ echo $e->getMessage();
25
  }
 
 
26
  die();
27
  }
28
 
app/code/community/Webinterpret/Connector/controllers/IndexController.php CHANGED
@@ -11,13 +11,17 @@ class Webinterpret_Connector_IndexController extends Mage_Core_Controller_Front_
11
  {
12
  public function indexAction()
13
  {
14
- $dir = Mage::helper('webinterpret_connector')->getModuleBridgeDir();
15
- $path = $dir . DS . 'bridge.php';
16
- if (!file_exists($path)) {
17
- $this->_forward('defaultNoRoute');
18
- return;
 
 
 
 
 
19
  }
20
- require_once $path;
21
  die();
22
  }
23
  }
11
  {
12
  public function indexAction()
13
  {
14
+ try {
15
+ $dir = Mage::helper('webinterpret_connector')->getModuleBridgeDir();
16
+ $path = $dir . DS . 'bridge.php';
17
+ if (!file_exists($path)) {
18
+ $this->_forward('defaultNoRoute');
19
+ return;
20
+ }
21
+ require_once $path;
22
+ } catch (Exception $e) {
23
+ echo $e->getMessage();
24
  }
 
25
  die();
26
  }
27
  }
app/code/community/Webinterpret/Connector/etc/config.xml CHANGED
@@ -8,7 +8,7 @@
8
  <config>
9
  <modules>
10
  <Webinterpret_Connector>
11
- <version>1.2.7.6</version>
12
  </Webinterpret_Connector>
13
  </modules>
14
  <global>
@@ -96,8 +96,6 @@
96
  <file_repository><![CDATA[https://webstores.webinterpret.com]]></file_repository>
97
  <footer_enabled><![CDATA[1]]></footer_enabled>
98
  <footer><![CDATA[]]></footer>
99
- <product_redirect_enabled><![CDATA[1]]></product_redirect_enabled>
100
- <product_overlay_enabled><![CDATA[0]]></product_overlay_enabled>
101
  <tracking_code><![CDATA[]]></tracking_code>
102
  <plugin_id><![CDATA[]]></plugin_id>
103
  <head><![CDATA[]]></head>
8
  <config>
9
  <modules>
10
  <Webinterpret_Connector>
11
+ <version>1.2.7.7</version>
12
  </Webinterpret_Connector>
13
  </modules>
14
  <global>
96
  <file_repository><![CDATA[https://webstores.webinterpret.com]]></file_repository>
97
  <footer_enabled><![CDATA[1]]></footer_enabled>
98
  <footer><![CDATA[]]></footer>
 
 
99
  <tracking_code><![CDATA[]]></tracking_code>
100
  <plugin_id><![CDATA[]]></plugin_id>
101
  <head><![CDATA[]]></head>
app/code/community/Webinterpret/Connector/etc/system.xml CHANGED
@@ -77,17 +77,6 @@
77
  <show_in_website>0</show_in_website>
78
  <show_in_store>0</show_in_store>
79
  </footer_enabled>
80
- <product_redirect_enabled translate="label comment">
81
- <label>Country Redirector Popup</label>
82
- <comment>Redirect international visitors (using geolocation) via popup to translated product pages.</comment>
83
- <config_path>webinterpret_connector/product_redirect_enabled</config_path>
84
- <frontend_type>select</frontend_type>
85
- <source_model>adminhtml/system_config_source_yesno</source_model>
86
- <sort_order>40</sort_order>
87
- <show_in_default>1</show_in_default>
88
- <show_in_website>0</show_in_website>
89
- <show_in_store>0</show_in_store>
90
- </product_redirect_enabled>
91
  <automatic_updates_enabled translate="label comment">
92
  <label>Automatic Software Updates</label>
93
  <comment>Allow this extension to automatically update its software with new features and improvements.</comment>
@@ -110,17 +99,6 @@
110
  <show_in_website>0</show_in_website>
111
  <show_in_store>0</show_in_store>
112
  </global_notifications_enabled>
113
- <!--
114
- <tracking_code translate="label comment">
115
- <label>Footer</label>
116
- <config_path>webinterpret_connector/tracking_code</config_path>
117
- <frontend_type>textarea</frontend_type>
118
- <sort_order>70</sort_order>
119
- <show_in_default>1</show_in_default>
120
- <show_in_website>0</show_in_website>
121
- <show_in_store>0</show_in_store>
122
- </tracking_code>
123
- -->
124
  </fields>
125
  </advanced>
126
  </groups>
77
  <show_in_website>0</show_in_website>
78
  <show_in_store>0</show_in_store>
79
  </footer_enabled>
 
 
 
 
 
 
 
 
 
 
 
80
  <automatic_updates_enabled translate="label comment">
81
  <label>Automatic Software Updates</label>
82
  <comment>Allow this extension to automatically update its software with new features and improvements.</comment>
99
  <show_in_website>0</show_in_website>
100
  <show_in_store>0</show_in_store>
101
  </global_notifications_enabled>
 
 
 
 
 
 
 
 
 
 
 
102
  </fields>
103
  </advanced>
104
  </groups>
app/design/adminhtml/default/default/template/webinterpret/system/config/fieldset/status.phtml CHANGED
@@ -61,53 +61,5 @@ $report = Mage::helper('webinterpret_connector')->selfTest();
61
  </tr>
62
  <?php endforeach; ?>
63
 
64
- <?php
65
- /*
66
- <tr>
67
- <td>PHP version</td>
68
- <td class="pass">Pass</td>
69
- <td><?php echo $report['php_version']['info']; ?></td>
70
- </tr>
71
- <tr>
72
- <td>Magento version</td>
73
- <td class="pass">Pass</td>
74
- <td><?php echo $report['magento_version']['info']; ?></td>
75
- </tr>
76
- <tr>
77
- <td>OpenSSL</td>
78
- <td class="pass">Pass</td>
79
- <td><?php echo $report['openssl']['info']; ?></td>
80
- </tr>
81
- <tr>
82
- <td>Allow remote files</td>
83
- <?php if ($report['remote_files']['has_errors']): ?>
84
- <td class="fail">Fail</td>
85
- <td>
86
- <?php foreach ($report['remote_files']['errors'] as $error): ?>
87
- <?php echo "<p>" . $error . "</p>"; ?>
88
- <?php endforeach; ?>
89
- </td>
90
- <?php else: ?>
91
- <td class="pass">Pass</td>
92
- <td><?php echo $report['remote_files']['info']; ?></td>
93
- <?php endif; ?>
94
- </tr>
95
- <tr>
96
- <td>Webinterpret Key</td>
97
- <?php if ($report['webinterpret_key']['has_errors']): ?>
98
- <td class="fail">Fail</td>
99
- <td>
100
- <?php foreach ($report['webinterpret_key']['errors'] as $error): ?>
101
- <?php echo "<p>" . $error . "</p>"; ?>
102
- <?php endforeach; ?>
103
- </td>
104
- <?php else: ?>
105
- <td class="pass">Pass</td>
106
- <td><?php echo $report['webinterpret_key']['info']; ?></td>
107
- <?php endif; ?>
108
- </tr>
109
- */
110
- ?>
111
-
112
  </table>
113
  <p class="webinterpret-test-connection"><a href="<?php echo $this->getRemoteTestUrl(); ?>" target="_blank">Test Connection</a></p>
61
  </tr>
62
  <?php endforeach; ?>
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  </table>
65
  <p class="webinterpret-test-connection"><a href="<?php echo $this->getRemoteTestUrl(); ?>" target="_blank">Test Connection</a></p>
app/design/frontend/base/default/layout/webinterpret/connector.xml CHANGED
@@ -16,6 +16,13 @@ Default layout, loads most of the pages
16
  <!-- Header -->
17
  <reference name="head">
18
  <block type="webinterpret_connector/head" after="-" name="webinterpret_connector_head" as="wi_head" template="webinterpret/connector/head.phtml" />
 
 
 
 
 
 
 
19
  </reference>
20
 
21
  <!-- Footer -->
@@ -23,11 +30,6 @@ Default layout, loads most of the pages
23
  <block type="webinterpret_connector/footer" after="-" name="webinterpret_connector_footer" as="wi_footer" template="webinterpret/connector/footer.phtml" />
24
  </reference>
25
 
26
- <!-- Analytics -->
27
- <reference name="before_body_end">
28
- <block type="webinterpret_connector/analytics" before="-" name="webinterpret_connector_analytics" as="wi_analytics" template="webinterpret/connector/analytics.phtml" />
29
- </reference>
30
-
31
  </default>
32
 
33
  <!--
@@ -36,21 +38,9 @@ Product view
36
 
37
  <catalog_product_view translate="label">
38
 
39
- <!-- Header -->
40
- <reference name="head">
41
- <action method="addItem"><type>js_css</type><name>webinterpret/webinterpret-1.2.7.6.css</name></action>
42
- </reference>
43
-
44
  <!-- Product Redirect -->
45
  <reference name="before_body_end">
46
- <block type="webinterpret_connector/product_redirect" name="webinterpret_connector_product_redirect" as="wi_product_redirect" template="webinterpret/connector/product_redirect.phtml" />
47
- </reference>
48
-
49
- <!-- Product Footer -->
50
- <reference name="before_body_end">
51
- <block type="page/html_head" after="webinterpret_connector_product_redirect" name="webinterpret_connector_product_footer" as="webinterpret_connector_product_footer" template="webinterpret/connector/product_footer.phtml">
52
- <action method="addItem"><type>js</type><name>webinterpret/webinterpret-1.2.7.6.js</name></action>
53
- </block>
54
  </reference>
55
 
56
  </catalog_product_view>
16
  <!-- Header -->
17
  <reference name="head">
18
  <block type="webinterpret_connector/head" after="-" name="webinterpret_connector_head" as="wi_head" template="webinterpret/connector/head.phtml" />
19
+ <block type="core/text" name="webinterpret_connector_remote_assets_head">
20
+ <action method="setText">
21
+ <text>
22
+ <![CDATA[<script type="text/javascript" src="//d2leqgr9fez74i.cloudfront.net/common/js/webinterpret-loader.js"></script>]]>
23
+ </text>
24
+ </action>
25
+ </block>
26
  </reference>
27
 
28
  <!-- Footer -->
30
  <block type="webinterpret_connector/footer" after="-" name="webinterpret_connector_footer" as="wi_footer" template="webinterpret/connector/footer.phtml" />
31
  </reference>
32
 
 
 
 
 
 
33
  </default>
34
 
35
  <!--
38
 
39
  <catalog_product_view translate="label">
40
 
 
 
 
 
 
41
  <!-- Product Redirect -->
42
  <reference name="before_body_end">
43
+ <block type="webinterpret_connector/product_view" name="webinterpret_connector_product_view" as="wi_product_view" template="webinterpret/connector/product_view.phtml" />
 
 
 
 
 
 
 
44
  </reference>
45
 
46
  </catalog_product_view>
app/design/frontend/base/default/template/webinterpret/connector/analytics.phtml DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * @category Webinterpret
5
- * @package Webinterpret_Connector
6
- * @author Webinterpret Team <info@webinterpret.com>
7
- * @license http://opensource.org/licenses/osl-3.0.php
8
- */
9
- ?>
10
- <?php if (Mage::helper('webinterpret_connector')->isEnabled()): ?>
11
-
12
- <!-- webinterpret_analytics -->
13
- <?php echo $this->getPluginInfoCode(); ?>
14
- <?php if (!Mage::helper('webinterpret_connector')->isUserNotAllowSaveCookie()): ?>
15
- <?php echo $this->getTrackingCode(); ?>
16
- <?php endif; ?>
17
- <!-- end webinterpret_analytics -->
18
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/webinterpret/connector/footer.phtml CHANGED
@@ -8,10 +8,15 @@
8
  */
9
  ?>
10
  <?php if (Mage::helper('webinterpret_connector')->isEnabled()): ?>
11
-
12
  <!-- webinterpret_footer -->
13
  <?php if (!Mage::helper('webinterpret_connector')->isUserNotAllowSaveCookie()): ?>
14
  <?php if (Mage::helper('webinterpret_connector')->isFooterEnabled()): ?>
 
 
 
 
 
 
15
  <?php echo $this->getFooterHtml(); ?>
16
  <?php endif; ?>
17
  <?php endif; ?>
8
  */
9
  ?>
10
  <?php if (Mage::helper('webinterpret_connector')->isEnabled()): ?>
 
11
  <!-- webinterpret_footer -->
12
  <?php if (!Mage::helper('webinterpret_connector')->isUserNotAllowSaveCookie()): ?>
13
  <?php if (Mage::helper('webinterpret_connector')->isFooterEnabled()): ?>
14
+ <script>
15
+ //<![CDATA[
16
+ var _webinterpret = _webinterpret || {};
17
+ _webinterpret.plugin_id = '<?php echo $this->getPluginId() ?>';
18
+ //]]>
19
+ </script>
20
  <?php echo $this->getFooterHtml(); ?>
21
  <?php endif; ?>
22
  <?php endif; ?>
app/design/frontend/base/default/template/webinterpret/connector/head.phtml CHANGED
@@ -8,7 +8,6 @@
8
  */
9
  ?>
10
  <?php if (Mage::helper('webinterpret_connector')->isEnabled()): ?>
11
-
12
  <!-- webinterpret_head -->
13
  <?php echo $this->getHeadHtml(); ?>
14
  <!-- end webinterpret_head -->
8
  */
9
  ?>
10
  <?php if (Mage::helper('webinterpret_connector')->isEnabled()): ?>
 
11
  <!-- webinterpret_head -->
12
  <?php echo $this->getHeadHtml(); ?>
13
  <!-- end webinterpret_head -->
app/design/frontend/base/default/template/webinterpret/connector/product_footer.phtml DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * @category Webinterpret
5
- * @package Webinterpret_Connector
6
- * @author Webinterpret Team <info@webinterpret.com>
7
- * @license http://opensource.org/licenses/osl-3.0.php
8
- */
9
- ?>
10
-
11
- <!-- webinterpret_product_footer -->
12
- <?php echo $this->getCssJsHtml() ?>
13
- <!-- end webinterpret_product_footer -->
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/webinterpret/connector/product_redirect.phtml DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * @category Webinterpret
5
- * @package Webinterpret_Connector
6
- * @author Webinterpret Team <info@webinterpret.com>
7
- * @license http://opensource.org/licenses/osl-3.0.php
8
- */
9
- ?>
10
- <?php if (Mage::helper('webinterpret_connector')->isEnabled()): ?>
11
-
12
- <!-- webinterpret_product_view -->
13
- <?php if (!Mage::helper('webinterpret_connector')->isUserNotAllowSaveCookie()): ?>
14
- <?php if (Mage::helper('webinterpret_connector')->isProductRedirectEnabled()): ?>
15
- <!-- webinterpret_product_redirect -->
16
- <!--[if IE 8 ]> <div id="wi-cr" class="ie8"> <![endif]-->
17
- <!--[if (gt IE 8)|!(IE)]><!--><div id="wi-cr"><!--<![endif]-->
18
- <div id="wi-cr-modal">
19
- <div id="wi-cr-close">&times;</div>
20
- <img id="wi-cr-flag" />
21
- <p id="wi-cr-title"></p>
22
- <p id="wi-cr-text"></p>
23
- <a id="wi-cr-button"></a>
24
- </div>
25
- </div>
26
- <script>
27
- //<![CDATA[
28
- var _paq = _paq || [];
29
- _paq.push(['trackEvent', 'redirect', '<?php echo $this->buildTrackEventData("redirect", "pageview", "product_redirect") ?>']);
30
- var _webinterpret = _webinterpret || {};
31
- _webinterpret.plugin_version = '<?php echo $this->getPluginVersion() ?>';
32
- _webinterpret.product_redirect_url = '<?php echo $this->getRedirectUrl() ?>';
33
- _webinterpret.product_redirect_utm = '<?php echo $this->getUtmUrlQuery(null, "pr") ?>';
34
- _webinterpret.store_locale = '<?php echo $this->getLocaleCode() ?>';
35
- _webinterpret.store_url = '<?php echo $this->getStoreUrl() ?>';
36
- _webinterpret.product_id = '<?php echo $this->getProductId() ?>';
37
- //]]>
38
- </script>
39
- <!-- end webinterpret_product_redirect -->
40
- <?php endif; ?>
41
- <?php endif; ?>
42
- <!-- end webinterpret_product_view -->
43
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/webinterpret/connector/product_view.phtml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Webinterpret
5
+ * @package Webinterpret_Connector
6
+ * @author Webinterpret Team <info@webinterpret.com>
7
+ * @license http://opensource.org/licenses/osl-3.0.php
8
+ */
9
+ ?>
10
+ <?php if (Mage::helper('webinterpret_connector')->isEnabled()): ?>
11
+ <!-- webinterpret_product_view -->
12
+ <?php if (!Mage::helper('webinterpret_connector')->isUserNotAllowSaveCookie()): ?>
13
+ <script>
14
+ //<![CDATA[
15
+ var _webinterpret = _webinterpret || {};
16
+ _webinterpret.plugin_version = '<?php echo $this->getPluginVersion() ?>';
17
+ _webinterpret.store_locale = '<?php echo $this->getLocaleCode() ?>';
18
+ _webinterpret.store_url = '<?php echo $this->getStoreUrl() ?>';
19
+ _webinterpret.product_id = '<?php echo $this->getProductId() ?>';
20
+ //]]>
21
+ </script>
22
+ <?php endif; ?>
23
+ <!-- end webinterpret_product_view -->
24
+ <?php endif; ?>
app/locale/de_DE/Webinterpret_Connector.csv CHANGED
@@ -1,48 +1,46 @@
1
- "Webinterpret","Webinterpret"
2
- "Settings","Einstellung""
3
- "Enabled","Aktiviert"
4
- "Turn integration with Webinterpret ON or OFF.","Integration mit Webinterpret an- oder ausschalten"
5
- "Webinterpret Key","Webinterpret-Schlüssel"
6
- "Unique key for your store. If you don't have one then register at Webinterpret.com to get a new key.","Ein einzigartiger Schlüssel für Ihr Geschäft. Falls Sie keinen haben, registrieren Sie sich auf Webinterpret.com, um einen neuen Schlüssel zu erhalten."
7
- "Country Selector","Länderauswahl"
8
- "Link to your international stores in the footer. Links appear after your products have been translated.","Der Link zu Ihrem internationalen Geschäft befindet sich in der Fußzeile. Die Links erscheinen, nachdem Ihre Produkte übersetzt wurden."
9
- "Country Redirector Popup","Länder-Umleitungspopup"
10
- "Redirect international visitors (using geolocation) via popup to translated product pages.","Leitet internationale Besucher (mit der Hilfe von Geolocation) durch Popups auf die übersetzte Produktseite um."
11
- "Automatic Software Updates","Automatische Softwareaktualisierungen"
12
- "Allow this extension to automatically update its software with new features and improvements.","Erlauben Sie dieser Erweiterung, sich automatisch für neue Funktionen und Verbesserungen zu aktualisieren."
13
- "Admin Panel Notifications","Admin-Panel-Benachrichtigungen"
14
- "Display notifications in Admin Panel to help you keep track of what's new or if something has changed.","Benachrichtungen im Admin-Panel anzeigen, damit Sie immer verfolgen können, ob es etwas Neues gibt oder ob sich etwas geändert hat."
15
- "Status","Status"
16
- "To continue installing Webinterpret, <a href=""%s"">click here</a>","Um mit der Installation von Webinterpret fortzufahren, <a href=""%s"">klicken Sie hier</a>"
17
- "Webinterpret extension has stopped working. For more details, <a href=""%s"">click here</a>","Die Webinterpret-Erweiterung funktioniert nicht mehr. <a href=""%s"">Klicken Sie hier</a> für weitere Details"
18
- "Webinterpret Key is not correct. Please try again.","Der Webinterpret-Schlüssel ist nicht korrekt. Bitter versuchen Sie es erneut."
19
- "Failed to download file: %s<br>Please contact Webinterpret support.","Download der Datei fehlgeschlagen: %s<br>Bitte kontaktieren Sie den Webinterpret-Support."
20
- "Failed to write file: %s<br>Please update the file permissions and try again.","Fehler beim Schreiben der Datei: %s<br>Bitte ändern Sie Dateiberechtigungen und versuchen Sie es erneut."
21
- "Failed to read file: %s<br>Please update the file permissions and try again.","Fehler beim Lesen der Datei: %s<br>Bitte ändern Sie Dateiberechtigungen und versuchen Sie es erneut."
22
- "Webinterpret Key","Webinterpret-Schlüssel"
23
- "Key is valid","Der Schlüssel ist gültig"
24
- "Key is missing. Please enter your Webinterpret Key. If you do not have one then <a href=""https://webstores.webinterpret.com"" target=""_blank"">click here to register</a>","Der Schlüssel fehlt. Bitte geben Sie Ihren Webinterpret-Schlüssel ein. Falls Sie keinen haben, <a href=""https://webstores.webinterpret.com"" target=""_blank"">klicken Sie hier, um sich zu registrieren</a>"
25
- "Incorrect key. Please try entering your key again or <a href=""https://webstores.webinterpret.com"" target=""_blank"">get a new key</a>","Falscher Schlüssel. Bitte versuchen Sie erneut Ihren Schlüssel einzugeben oder <a href=""https://webstores.webinterpret.com"" target=""_blank"">holen Sie sich einen neuen Schlüssel</a>"
26
- "Integration","Integration"
27
- "Extension is ON","Erweiterungen sind eingeschaltet"
28
- "Integration is turned OFF. Please set ""Enabled"" field to ""Yes"" and click the ""Save Config"" button.","Integrationen sind ausgeschaltet. Bitte stellen Sie das ""Aktivieren""-Feld auf ""Ja"" und klicken Sie auf den ""Änderungen speichern""-Knopf."
29
- "Bridge Files","Dateien überbrücken"
30
- "Bridge is installed","Überbrückung ist installiert."
31
- "Bridge is not installed. Please click ""Save Config"" button to install it.","Überbrückung ist nicht installiert. Bitte klicken Sie auf den ""Kontiguration speichern""-Knopf, um sie zu installieren."
32
- "Bridge is not installed. Please set ""Enabled"" field to ""Yes"" and click the ""Save Config"" button.","Überbrückung ist nicht installiert. Bitte stellen Sie das ""Aktivieren""-Feld auf ""Ja"" und klicken Sie auf den ""Kontiguration speichern""-Knopf."
33
- "PHP","PHP"
34
- "Unsupported PHP version. Please upgrade to version 5 or higher.","Nicht unterstützte PHP-Version. Bitte upgraden Sie auf Version 5 oder neuer."
35
- "Magento","Magento"
36
- "Unsupported Magento version. Please upgrade to version 1.6 or higher.","Nicht untersützte Magento-Version. Bitte upgraden Sie auf Version 1.6 oder neuer."
37
- "OpenSSL","OpenSSL"
38
- "OpenSSL not found. Please install OpenSSL on this server.","OpenSSL nicht gefunden. Bitte installieren Sie OpenSSL auf diesem Server."
39
- "Download Method","Downloadmethode"
40
- "No supported download method was found. Please enable allow_url_fopen in php.ini or install cURL on this server.","Eine nicht unterstützte Downloadmethode wurde gefunden. Bitte aktivieren Sie allow_url_fopen in php.ini oder installieren Sie cURL auf diesem Server."
41
- "Using %s","%s wird verwendet"
42
- "Extension Files","Erweiterungsdateien"
43
- "File","Datei"
44
- "Directory","Verzeichnis"
45
- "File is not writable: %s<br>Please update the file permissions.","Datei kann nicht geschrieben werden: %s<br>Bitte ändern Sie Dateiberechtigungen."
46
- "Directory is not writable: %s<br>Please update the file permissions.","Verzeichnis kann nicht geschrieben werden: %s<br>Bitte ändern Sie Dateiberechtigungen."
47
- "File is missing: %s<br>Please upload the file or reinstall this extension using Magento Connect Manager.","Datei fehlt: %s<br>Bitte laden Sie die Datei hoch oder installieren Sie diese Erweiterung erneut mit dem Magento Connect Manager."
48
- "Extension is installed","Erweiterung wurde installiert."
1
+ "Webinterpret","Webinterpret"
2
+ "Settings","Einstellung""
3
+ "Enabled","Aktiviert"
4
+ "Turn integration with Webinterpret ON or OFF.","Integration mit Webinterpret an- oder ausschalten"
5
+ "Webinterpret Key","Webinterpret-Schlüssel"
6
+ "Unique key for your store. If you don't have one then register at Webinterpret.com to get a new key.","Ein einzigartiger Schlüssel für Ihr Geschäft. Falls Sie keinen haben, registrieren Sie sich auf Webinterpret.com, um einen neuen Schlüssel zu erhalten."
7
+ "Country Selector","Länderauswahl"
8
+ "Link to your international stores in the footer. Links appear after your products have been translated.","Der Link zu Ihrem internationalen Geschäft befindet sich in der Fußzeile. Die Links erscheinen, nachdem Ihre Produkte übersetzt wurden."
9
+ "Automatic Software Updates","Automatische Softwareaktualisierungen"
10
+ "Allow this extension to automatically update its software with new features and improvements.","Erlauben Sie dieser Erweiterung, sich automatisch für neue Funktionen und Verbesserungen zu aktualisieren."
11
+ "Admin Panel Notifications","Admin-Panel-Benachrichtigungen"
12
+ "Display notifications in Admin Panel to help you keep track of what's new or if something has changed.","Benachrichtungen im Admin-Panel anzeigen, damit Sie immer verfolgen können, ob es etwas Neues gibt oder ob sich etwas geändert hat."
13
+ "Status","Status"
14
+ "To continue installing Webinterpret, <a href=""%s"">click here</a>","Um mit der Installation von Webinterpret fortzufahren, <a href=""%s"">klicken Sie hier</a>"
15
+ "Webinterpret extension has stopped working. For more details, <a href=""%s"">click here</a>","Die Webinterpret-Erweiterung funktioniert nicht mehr. <a href=""%s"">Klicken Sie hier</a> für weitere Details"
16
+ "Webinterpret Key is not correct. Please try again.","Der Webinterpret-Schlüssel ist nicht korrekt. Bitter versuchen Sie es erneut."
17
+ "Failed to download file: %s<br>Please contact Webinterpret support.","Download der Datei fehlgeschlagen: %s<br>Bitte kontaktieren Sie den Webinterpret-Support."
18
+ "Failed to write file: %s<br>Please update the file permissions and try again.","Fehler beim Schreiben der Datei: %s<br>Bitte ändern Sie Dateiberechtigungen und versuchen Sie es erneut."
19
+ "Failed to read file: %s<br>Please update the file permissions and try again.","Fehler beim Lesen der Datei: %s<br>Bitte ändern Sie Dateiberechtigungen und versuchen Sie es erneut."
20
+ "Webinterpret Key","Webinterpret-Schlüssel"
21
+ "Key is valid","Der Schlüssel ist gültig"
22
+ "Key is missing. Please enter your Webinterpret Key. If you do not have one then <a href=""https://webstores.webinterpret.com"" target=""_blank"">click here to register</a>","Der Schlüssel fehlt. Bitte geben Sie Ihren Webinterpret-Schlüssel ein. Falls Sie keinen haben, <a href=""https://webstores.webinterpret.com"" target=""_blank"">klicken Sie hier, um sich zu registrieren</a>"
23
+ "Incorrect key. Please try entering your key again or <a href=""https://webstores.webinterpret.com"" target=""_blank"">get a new key</a>","Falscher Schlüssel. Bitte versuchen Sie erneut Ihren Schlüssel einzugeben oder <a href=""https://webstores.webinterpret.com"" target=""_blank"">holen Sie sich einen neuen Schlüssel</a>"
24
+ "Integration","Integration"
25
+ "Extension is ON","Erweiterungen sind eingeschaltet"
26
+ "Integration is turned OFF. Please set ""Enabled"" field to ""Yes"" and click the ""Save Config"" button.","Integrationen sind ausgeschaltet. Bitte stellen Sie das ""Aktivieren""-Feld auf ""Ja"" und klicken Sie auf den ""Änderungen speichern""-Knopf."
27
+ "Bridge Files","Dateien überbrücken"
28
+ "Bridge is installed","Überbrückung ist installiert."
29
+ "Bridge is not installed. Please click ""Save Config"" button to install it.","Überbrückung ist nicht installiert. Bitte klicken Sie auf den ""Kontiguration speichern""-Knopf, um sie zu installieren."
30
+ "Bridge is not installed. Please set ""Enabled"" field to ""Yes"" and click the ""Save Config"" button.","Überbrückung ist nicht installiert. Bitte stellen Sie das ""Aktivieren""-Feld auf ""Ja"" und klicken Sie auf den ""Kontiguration speichern""-Knopf."
31
+ "PHP","PHP"
32
+ "Unsupported PHP version. Please upgrade to version 5 or higher.","Nicht unterstützte PHP-Version. Bitte upgraden Sie auf Version 5 oder neuer."
33
+ "Magento","Magento"
34
+ "Unsupported Magento version. Please upgrade to version 1.6 or higher.","Nicht untersützte Magento-Version. Bitte upgraden Sie auf Version 1.6 oder neuer."
35
+ "OpenSSL","OpenSSL"
36
+ "OpenSSL not found. Please install OpenSSL on this server.","OpenSSL nicht gefunden. Bitte installieren Sie OpenSSL auf diesem Server."
37
+ "Download Method","Downloadmethode"
38
+ "No supported download method was found. Please enable allow_url_fopen in php.ini or install cURL on this server.","Eine nicht unterstützte Downloadmethode wurde gefunden. Bitte aktivieren Sie allow_url_fopen in php.ini oder installieren Sie cURL auf diesem Server."
39
+ "Using %s","%s wird verwendet"
40
+ "Extension Files","Erweiterungsdateien"
41
+ "File","Datei"
42
+ "Directory","Verzeichnis"
43
+ "File is not writable: %s<br>Please update the file permissions.","Datei kann nicht geschrieben werden: %s<br>Bitte ändern Sie Dateiberechtigungen."
44
+ "Directory is not writable: %s<br>Please update the file permissions.","Verzeichnis kann nicht geschrieben werden: %s<br>Bitte ändern Sie Dateiberechtigungen."
45
+ "File is missing: %s<br>Please upload the file or reinstall this extension using Magento Connect Manager.","Datei fehlt: %s<br>Bitte laden Sie die Datei hoch oder installieren Sie diese Erweiterung erneut mit dem Magento Connect Manager."
46
+ "Extension is installed","Erweiterung wurde installiert."
 
 
app/locale/en_US/Webinterpret_Connector.csv CHANGED
@@ -1 +1 @@
1
- "Webinterpret","Webinterpret"
1
+ "Webinterpret","Webinterpret"
js/webinterpret/flags/flag-at.png DELETED
Binary file
js/webinterpret/flags/flag-au.png DELETED
Binary file
js/webinterpret/flags/flag-be.png DELETED
Binary file
js/webinterpret/flags/flag-de.png DELETED
Binary file
js/webinterpret/flags/flag-es.png DELETED
Binary file
js/webinterpret/flags/flag-fr.png DELETED
Binary file
js/webinterpret/flags/flag-ie.png DELETED
Binary file
js/webinterpret/flags/flag-it.png DELETED
Binary file
js/webinterpret/flags/flag-uk.png DELETED
Binary file
js/webinterpret/flags/flag-us.png DELETED
Binary file
js/webinterpret/webinterpret-1.2.7.6.css DELETED
@@ -1,312 +0,0 @@
1
-
2
- #wi-cr {
3
- visibility: hidden;
4
- z-index: -9000;
5
- position: fixed;
6
- top: 0;
7
- right: 0;
8
- bottom: 0;
9
- left: 0;
10
- background: none;
11
- background-color: rgba(0, 0, 0, 0)
12
- transition: background-color 0.25s ease;
13
- -moz-transition: background-color 0.25s ease;
14
- -webkit-transition: background-color 0.25s ease;
15
- }
16
-
17
- #wi-cr.visible {
18
- visibility: visible;
19
- z-index: 9000;
20
- background-color: rgba(0, 0, 0, 0.25);
21
- }
22
-
23
- #wi-cr-modal {
24
- font-family: 'Open Sans', sans-serif;
25
- color: #333;
26
- opacity: 0;
27
- top: 50%;
28
- left: 50%;
29
- position: fixed;
30
- transform: translate(-50%, -50%);
31
- -o-transform: translate(-50%, -50%);
32
- -ms-transform: translate(-50%, -50%);
33
- -moz-transform: translate(-50%, -50%);
34
- -webkit-transform: translate(-50%, -50%);
35
- border-radius: 2px;
36
- background: white;
37
- padding: 30px;
38
- transition: opacity 0.25s ease;
39
- -moz-transition: opacity 0.25s ease;
40
- -webkit-transition: opacity 0.25s ease;
41
- }
42
-
43
- #wi-cr.visible #wi-cr-modal {
44
- opacity: 1;
45
- }
46
-
47
- #wi-cr-flag {
48
- width: 100px;
49
- height: 100px;
50
- border-radius: 100%;
51
- margin: 15px auto;
52
- display: block;
53
- box-shadow: 0px 3px 4.7px 0.3px rgba(0, 0, 0, 0.24);
54
- }
55
-
56
- #wi-cr-title,#wi-cr-button {
57
- font-weight: 600;
58
- font-size: 18px;
59
- }
60
-
61
- #wi-cr-title,#wi-cr-text {
62
- text-align: center;
63
- margin: 0 0 15px;
64
- }
65
-
66
- #wi-cr-text {
67
- font-weight: normal;
68
- font-size: 16px;
69
- }
70
-
71
- #wi-cr-button {
72
- background: #009ddf;
73
- border: 0 none;
74
- border-radius: 4px;
75
- color: white;
76
- box-shadow: 0px 3px 4.7px 0.3px rgba(0, 0, 0, 0.24);
77
- display: block;
78
- padding: 25px 70px;
79
- line-height: 1.33333;
80
- text-align: center;
81
- text-decoration: none;
82
- cursor: pointer;
83
- vertical-align: middle;
84
- touch-action: manipulation;
85
- white-space: nowrap;
86
- margin: 0 50px;
87
- }
88
-
89
- #wi-cr-close {
90
- cursor: pointer;
91
- position: absolute;
92
- right: 0;
93
- top: 0;
94
- font-size: 24px;
95
- line-height: 1;
96
- width: 24px;
97
- height: 24px;
98
- text-align: center;
99
- background: white;
100
- padding: 13px;
101
- border-radius: 100%;
102
- margin: -25px -25px 0 0;
103
- box-sizing: content-box;
104
- box-shadow: 0px 3px 4.7px 0.3px rgba(0, 0, 0, 0.24);
105
- }
106
-
107
- #wi-cr.ie8 {
108
- background:transparent;
109
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#40000000,endColorstr=#40000000);
110
- zoom: 1;
111
- }
112
-
113
- .ie8 #wi-cr-close {
114
- margin: 0 0 -25px -25px;
115
- box-shadow: none;
116
- border-radius: 0;
117
- }
118
-
119
- @media(max-width:767px) {
120
- #wi-cr-close {
121
- margin: 0 0 -25px -25px;
122
- box-shadow: none;
123
- border-radius: 0;
124
- }
125
-
126
- #wi-cr-button {
127
- margin: 0;
128
- }
129
- }
130
-
131
- /*********************************************************************/
132
-
133
- .wi-popupOpen {
134
- overflow: hidden;
135
- max-height: 100%;
136
- }
137
-
138
- #wi-overlay {
139
- z-index: 9998;
140
- opacity: 0;
141
- visibility: hidden;
142
- position: fixed;
143
- top: 0;
144
- bottom: 0;
145
- left: 0;
146
- right: 0;
147
- background-color: rgba(0,0,0,0.55);
148
-
149
- -webkit-transition: opacity 0.4s ease, visibility 0.8s linear;
150
- -moz-transition: opacity 0.4s ease, visibility 0.8s linear;
151
- -o-transition: opacity 0.4s ease, visibility 0.8s linear;
152
- transition: opacity 0.4s ease, visibility 0.8s linear;
153
- }
154
-
155
- #wi-overlay.visible {
156
- opacity: 1;
157
- visibility: visible;
158
- }
159
-
160
- #wi-overlay.hidden, #wi-fixedBar.hidden {
161
- display: none;
162
- }
163
-
164
- #wi-frame {
165
- display: block;
166
- width: 100%;
167
- height: 100%;
168
- }
169
-
170
- #wi-fixedBar {
171
- z-index: 9999;
172
- position: fixed;
173
- top: auto;
174
- left: 0;
175
- bottom: -40px;
176
- right: 0;
177
- background-color: rgba(0,0,0,0.7);
178
- padding: 7px 10px 47px 10px;
179
- font-family: Helvetica, Arial, sans-serif;
180
- line-height: 32px;
181
- color: white;
182
- -webkit-animation-duration: 0s;
183
- animation-duration: 0s;
184
- -webkit-animation-fill-mode: both;
185
- animation-fill-mode: both;
186
- -webkit-animation-timing-function: ease-in-out;
187
- animation-timing-function: ease-in-out;
188
- -webkit-animation-name: wi-bounceOutDown;
189
- animation-name: wi-bounceOutDown;
190
- }
191
-
192
- #wi-fixedBar.visible {
193
- -webkit-animation-name: wi-bounceInUp;
194
- animation-name: wi-bounceInUp;
195
- }
196
-
197
- #wi-fixedBar .wi-link, #wi-fixedBar a {
198
- color: #009ddf;
199
-
200
- -webkit-transition: color 0.3s ease;
201
- -moz-transition: color 0.3s ease;
202
- -o-transition: color 0.3s ease;
203
- transition: color 0.3s ease;
204
- }
205
-
206
- #wi-fixedBar button {
207
- color: white;
208
- background: none;
209
- border: none;
210
- padding: 0;
211
- margin: 0;
212
- vertical-align: -webkit-baseline-middle;
213
- vertical-align: middle;
214
- }
215
-
216
- #wi-fixedBar .wi-link:hover,
217
- #wi-fixedBar .wi-link:focus,
218
- #wi-fixedBar .wi-link:active,
219
- #wi-fixedBar button:hover .wi-link,
220
- #wi-fixedBar button:focus .wi-link,
221
- #wi-fixedBar button:active .wi-link {
222
- color: inherit;
223
- }
224
-
225
- #wi-fixedBar #wi-hideGlopal {
226
- float: right;
227
- height: 32px;
228
- }
229
-
230
- #wi-fixedBar #wi-flag {
231
- display: inline-block;
232
- vertical-align: middle;
233
- width: 32px;
234
- height: 32px;
235
- border: 2px solid white;
236
- margin-right: 10px;
237
- overflow: hidden;
238
-
239
- -webkit-border-radius: 50%;
240
- -moz-border-radius: 50%;
241
- -o-border-radius: 50%;
242
- border-radius: 50%;
243
-
244
- -webkit-box-shadow: 1px 1px 1px #000;
245
- -moz-box-shadow: 1px 1px 1px #000;
246
- -o-box-shadow: 1px 1px 1px #000;
247
- box-shadow: 1px 1px 1px #000;
248
- }
249
-
250
- #wi-fixedBar #wi-flag img {
251
- display: block;
252
- max-width: 100%;
253
- }
254
-
255
- @media (max-width: 765px) {
256
- .wi-visible-xs {
257
- display: inline;
258
- }
259
-
260
- .wi-hidden-xs {
261
- display: none;
262
- }
263
-
264
- .wi-popupOpen {
265
- padding-right: 0;
266
- }
267
- }
268
-
269
- @media (min-width: 766px) {
270
- .wi-hidden-xs {
271
- display: inline;
272
- }
273
-
274
- .wi-visible-xs {
275
- display: none;
276
- }
277
- }
278
-
279
- @-webkit-keyframes wi-bounceInUp {
280
- /*
281
- 0% {-webkit-transform: translateY(2000px); opacity: 0;}
282
- 60% {-webkit-transform: translateY(-30px); opacity: 1;}
283
- 80% {-webkit-transform: translateY(10px);}
284
- */
285
- 100% {-webkit-transform: translateY(0); opacity: 1;}
286
- }
287
-
288
- @keyframes wi-bounceInUp {
289
- /*
290
- 0% {transform: translateY(2000px); opacity: 0;}
291
- 60% {transform: translateY(-30px); opacity: 1;}
292
- 80% {transform: translateY(10px);}
293
- */
294
- 100% {transform: translateY(0); opacity: 1;}
295
- }
296
-
297
- @-webkit-keyframes wi-bounceOutDown {
298
- /*
299
- 0% {-webkit-transform: translateY(0);}
300
- 20% {-webkit-transform: translateY(-20px); opacity: 1;}
301
- */
302
- 100% {-webkit-transform: translateY(2000px); opacity: 0;}
303
- }
304
-
305
- @keyframes wi-bounceOutDown {
306
- /*
307
- 0% {transform: translateY(0);}
308
- 20% {transform: translateY(-20px); opacity: 1;}
309
- */
310
- 100% {transform: translateY(2000px); opacity: 0;}
311
- }
312
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/webinterpret/webinterpret-1.2.7.6.js DELETED
@@ -1,348 +0,0 @@
1
- /*! jQuery v1.12.2 | (c) jQuery Foundation | jquery.org/license */
2
- !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.2",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0;
3
- }return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ra(b),i=l.boxSizing&&"border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Sa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Oa.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+eb(b,c,e||(i?"border":"content"),f,h)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){
4
- return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g,sb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(sb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>-1)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var tb,ub,vb=n.expr.attrHandle,wb=/^(?:checked|selected)$/i,xb=l.getSetAttribute,yb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ub:tb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?yb&&xb||!wb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(xb?c:d)}}),ub={set:function(a,b,c){return b===!1?n.removeAttr(a,c):yb&&xb||!wb.test(c)?a.setAttribute(!xb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=vb[b]||n.find.attr;yb&&xb||!wb.test(b)?vb[b]=function(a,b,d){var e,f;return d||(f=vb[b],vb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,vb[b]=f),e}:vb[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),yb&&xb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):tb&&tb.set(a,b,c)}}),xb||(tb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},vb.id=vb.name=vb.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:tb.set},n.attrHooks.contenteditable={set:function(a,b,c){tb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var zb=/^(?:input|select|textarea|button|object)$/i,Ab=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):zb.test(a.nodeName)||Ab.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Bb=/[\t\r\n\f]/g;function Cb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Cb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Cb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Cb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=Cb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Cb(c)+" ").replace(Bb," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Db=a.location,Eb=n.now(),Fb=/\?/,Gb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Gb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Hb=/#.*$/,Ib=/([?&])_=[^&]*/,Jb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Kb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Lb=/^(?:GET|HEAD)$/,Mb=/^\/\//,Nb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ob={},Pb={},Qb="*/".concat("*"),Rb=Db.href,Sb=Nb.exec(Rb.toLowerCase())||[];function Tb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Ub(a,b,c,d){var e={},f=a===Pb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Vb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Wb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Xb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Rb,type:"GET",isLocal:Kb.test(Sb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Qb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Vb(Vb(a,n.ajaxSettings),b):Vb(n.ajaxSettings,a)},ajaxPrefilter:Tb(Ob),ajaxTransport:Tb(Pb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Jb.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Rb)+"").replace(Hb,"").replace(Mb,Sb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Nb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Sb[1]&&d[2]===Sb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Sb[3]||("http:"===Sb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Ub(Ob,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Lb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Fb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Ib.test(f)?f.replace(Ib,"$1_="+Eb++):f+(Fb.test(f)?"&":"?")+"_="+Eb++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Qb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Ub(Pb,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Wb(l,w,d)),v=Xb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Yb(a){return a.style&&a.style.display||n.css(a,"display")}function Zb(a){while(a&&1===a.nodeType){if("none"===Yb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Zb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var $b=/%20/g,_b=/\[\]$/,ac=/\r?\n/g,bc=/^(?:submit|button|image|reset|file)$/i,cc=/^(?:input|select|textarea|keygen)/i;function dc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||_b.test(a)?d(a,e):dc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)dc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)dc(c,a[c],b,e);return d.join("&").replace($b,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&cc.test(this.nodeName)&&!bc.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(ac,"\r\n")}}):{name:b.name,value:c.replace(ac,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?ic():d.documentMode>8?hc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&hc()||ic()}:hc;var ec=0,fc={},gc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in fc)fc[a](void 0,!0)}),l.cors=!!gc&&"withCredentials"in gc,gc=l.ajax=!!gc,gc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++ec;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete fc[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=fc[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function hc(){try{return new a.XMLHttpRequest}catch(b){}}function ic(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var jc=[],kc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=jc.pop()||n.expando+"_"+Eb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(kc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&kc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(kc,"$1"+e):b.jsonp!==!1&&(b.url+=(Fb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,jc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var lc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&lc)return lc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function mc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=mc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=mc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){
5
- return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var nc=a.jQuery,oc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=oc),b&&a.jQuery===n&&(a.jQuery=nc),n},b||(a.jQuery=a.$=n),n});
6
- var _webinterpret_jQuery = jQuery.noConflict(true);
7
-
8
- /* Piwik */
9
- var _paq = _paq || [];
10
-
11
- /* Webinterpret */
12
- var _webinterpret = _webinterpret || {};
13
-
14
- function webinterpret_urlEncode(str) {
15
- str = (str + '').toString();
16
- return encodeURIComponent(str)
17
- .replace(/!/g, '%21')
18
- .replace(/'/g, '%27')
19
- .replace(/\(/g, '%28')
20
- .replace(/\)/g, '%29')
21
- .replace(/\*/g, '%2A')
22
- .replace(/%20/g, '+');
23
- }
24
-
25
- function webinterpret_httpBuildQuery(formdata, numeric_prefix, arg_separator) {
26
- var value, key, tmp = [],
27
- that = this;
28
-
29
- var _http_build_query_helper = function(key, val, arg_separator) {
30
- var k, tmp = [];
31
- if (val === true) {
32
- val = '1';
33
- } else if (val === false) {
34
- val = '0';
35
- }
36
- if (val != null) {
37
- if (typeof val === 'object') {
38
- for (k in val) {
39
- if (val[k] != null) {
40
- tmp.push(_http_build_query_helper(key + '[' + k + ']', val[k], arg_separator));
41
- }
42
- }
43
- return tmp.join(arg_separator);
44
- } else if (typeof val !== 'function') {
45
- return webinterpret_urlEncode(key) + '=' + webinterpret_urlEncode(val);
46
- } else {
47
- throw new Error('There was an error processing for webinterpret_httpBuildQuery().');
48
- }
49
- } else {
50
- return '';
51
- }
52
- };
53
-
54
- if (!arg_separator) {
55
- arg_separator = '&';
56
- }
57
- for (key in formdata) {
58
- value = formdata[key];
59
- if (numeric_prefix && !isNaN(key)) {
60
- key = String(numeric_prefix) + key;
61
- }
62
- var query = _http_build_query_helper(key, value, arg_separator);
63
- if (query !== '') {
64
- tmp.push(query);
65
- }
66
- }
67
-
68
- return tmp.join(arg_separator);
69
- }
70
-
71
- function webinterpret_trackEvent(category, data) {
72
- var data = data || {};
73
- var category = typeof category !== 'undefined' ? category : 'unknown';
74
- data.category = category;
75
-
76
- if (typeof _webinterpret.store_locale !== 'undefined') {
77
- data.store_locale = _webinterpret.store_locale;
78
- }
79
- if (typeof _webinterpret.visitor_locale !== 'undefined') {
80
- data.visitor_locale = _webinterpret.visitor_locale;
81
- }
82
- if (typeof _webinterpret.store_url !== 'undefined') {
83
- data.store_url = _webinterpret.store_url;
84
- }
85
- if (typeof _webinterpret.product_id !== 'undefined') {
86
- data.product_id = _webinterpret.product_id;
87
- }
88
- if (typeof _webinterpret.plugin_version !== 'undefined') {
89
- data.script_version = _webinterpret.plugin_version;
90
- }
91
-
92
- if (window._paq) {
93
- _paq.push(['trackEvent', category, webinterpret_httpBuildQuery(data)]);
94
- }
95
- }
96
-
97
- /* Webinterpret.RedirectModal */
98
- (function($) {
99
- if (!$.Webinterpret) {
100
- $.Webinterpret = new Object();
101
- };
102
-
103
- $.Webinterpret.RedirectModal = function(el, options) {
104
- var base = this;
105
- base.$el = $(el);
106
- base.el = el;
107
- base.$el.data('Webinterpret.RedirectModal', base);
108
- base.visible = false;
109
-
110
- // Current time
111
- base.now = function() {
112
- return (new Date()).getTime();
113
- };
114
-
115
- // Modal expiry
116
- base.expires = function() {
117
- return base.now() + base.options.expires * 1000;
118
- };
119
-
120
- // Test if user has closed modal
121
- base.isHidden = function() {
122
- return (parseInt(localStorage.getItem('webinterpret-redirect-hide')) >= base.now());
123
- }
124
-
125
- // Parse visitor locale from request
126
- base.parseVisitorLocale = function(data) {
127
- if (!data.hasOwnProperty('url')) {
128
- return null;
129
- }
130
- if (data.url.indexOf('glopal.at') > -1) {
131
- return 'de_AT';
132
- }
133
- if (data.url.indexOf('glopal.be') > -1) {
134
- return 'fr_BE';
135
- }
136
- if (data.url.indexOf('glopal.ca') > -1) {
137
- return 'en_CA';
138
- }
139
- if (data.url.indexOf('glopal.co.uk') > -1) {
140
- return 'en_GB';
141
- }
142
- if (data.url.indexOf('glopal.com') > -1) {
143
- return 'en_US';
144
- }
145
- if (data.url.indexOf('glopal.com.au') > -1) {
146
- return 'en_AU';
147
- }
148
- if (data.url.indexOf('glopal.de') > -1) {
149
- return 'de_DE';
150
- }
151
- if (data.url.indexOf('glopal.es') > -1) {
152
- return 'es_ES';
153
- }
154
- if (data.url.indexOf('glopal.eu') > -1) {
155
- return 'en_IE';
156
- }
157
- if (data.url.indexOf('glopal.fr') > -1) {
158
- return 'fr_FR';
159
- }
160
- if (data.url.indexOf('glopal.it') > -1) {
161
- return 'it_IT';
162
- }
163
- return null;
164
- }
165
-
166
- // Fill modal with content
167
- base.fill = function(data) {
168
- data.flag = data.flag.replace('/media/webinterpret', '/js/webinterpret');
169
- $('#wi-cr-flag').attr('src', data.flag);
170
- $('#wi-cr-title').text(data.title);
171
- $('#wi-cr-text').text(data.text);
172
- if (base.options.utm) {
173
- data.url = String(data.url) + '?' + base.options.utm;
174
- }
175
- $('#wi-cr-button').text(data.button).attr('href', data.url);
176
- };
177
-
178
- // Display or hide modal
179
- base.display = function(state) {
180
- if (state === true) {
181
- webinterpret_trackEvent('redirect', { action: 'show', name: 'show_modal' });
182
- }
183
- var wi_cr = $("#wi-cr").toggleClass('visible', base.visible = !!state);
184
- if (wi_cr.is('.ie8')) {
185
- var timeout;
186
- function update_position() {
187
- var modal = $('#wi-cr-modal');
188
- modal.css('top', (wi_cr.height() - modal.outerHeight()) / 2) + 'px !important';
189
- modal.css('left', (wi_cr.width() - modal.outerWidth()) / 2) + 'px !important';
190
- }
191
- update_position();
192
- $(window).resize(function(){
193
- clearTimeout(timeout);
194
- timeout = setTimeout(update_position, 500);
195
- });
196
- }
197
- };
198
-
199
- // Initalize modal
200
- base.init = function() {
201
- try {
202
- base.options = $.extend({},$.Webinterpret.RedirectModal.defaultOptions, options);
203
-
204
- if (base.isHidden()) {
205
- webinterpret_trackEvent('redirect', { action: 'hidden', name: 'modal_is_hidden' });
206
- return;
207
- }
208
-
209
- // Click on close button
210
- $('#wi-cr-close').click(function() {
211
- base.display(false);
212
- localStorage.setItem('webinterpret-redirect-hide', base.expires().toString());
213
- webinterpret_trackEvent('redirect', { action: 'click', name: 'close_modal_button' });
214
- });
215
-
216
- // Click on page background
217
- if (base.options.closeOnPageBackgroundClick) {
218
- $('#wi-cr').click(function(e) {
219
- if (e.target != this) {
220
- return;
221
- }
222
- localStorage.setItem('webinterpret-redirect-hide', base.expires().toString());
223
- base.display(false);
224
- webinterpret_trackEvent('redirect', { action: 'click', name: 'close_page_background' });
225
- });
226
- }
227
-
228
- // Click on OK button
229
- $('#wi-cr-button').click(function(e) {
230
- if (e.target != this) {
231
- return;
232
- }
233
- e.preventDefault();
234
- base.display(false);
235
- webinterpret_trackEvent('redirect', { action: 'click', name: 'open' });
236
- window.location = $('#wi-cr-button').attr('href');
237
- });
238
-
239
- // Get modal content based on product and geolocation
240
- $.ajax({
241
- url: base.options.url,
242
- dataType: 'json',
243
- jsonp: 'callback',
244
- statusCode: { 500: function() { webinterpret_trackEvent('redirect', { action: 'error', name: 'error_500' }); }},
245
- statusCode: { 404: function() { webinterpret_trackEvent('redirect', { action: 'error', name: 'error_404' }); }},
246
- statusCode: { 403: function() { webinterpret_trackEvent('redirect', { action: 'error', name: 'error_403' }); }},
247
- statusCode: { 401: function() { webinterpret_trackEvent('redirect', { action: 'error', name: 'error_401' }); }},
248
- statusCode: { 400: function() { webinterpret_trackEvent('redirect', { action: 'error', name: 'error_400' }); }},
249
- success: function(data) {
250
- if (!data || (typeof data != 'object')) {
251
- webinterpret_trackEvent('redirect', { action: 'error', name: 'data_not_found' });
252
- return;
253
- }
254
- if (data.hasOwnProperty('status') && data.status == 'error') {
255
- if (data.hasOwnProperty('errors') && (data.errors.constructor === Array)) {
256
- if (data.errors.length > 0 && data.errors[0].hasOwnProperty('name')) {
257
- var errorCode = data.errors[0].name.toLowerCase();
258
- var errorMessage = '';
259
- if (data.errors[0].hasOwnProperty('description')) {
260
- errorMessage = data.errors[0].description;
261
- }
262
- switch (errorCode) {
263
- case 'notsupportedcountry':
264
- var countryCode = 'no_available';
265
- if (errorMessage.length > 0) {
266
- countryCode = errorMessage.substring(0, 2).toLowerCase();
267
- }
268
- webinterpret_trackEvent('redirect', { action: 'error', name: 'visitor_locale_not_supported_' + countryCode, message: errorMessage });
269
- break;
270
- case 'store_url':
271
- webinterpret_trackEvent('redirect', { action: 'error', name: 'store_url_not_found', message: errorMessage });
272
- break;
273
- case 'availability':
274
- webinterpret_trackEvent('redirect', { action: 'error', name: 'product_not_available', message: errorMessage });
275
- break;
276
- case 'id':
277
- webinterpret_trackEvent('redirect', { action: 'error', name: 'product_not_found', message: errorMessage });
278
- break;
279
- default:
280
- webinterpret_trackEvent('redirect', { action: 'error', name: 'error_unknown_' + errorCode, message: errorMessage });
281
- }
282
- return;
283
- }
284
- }
285
- webinterpret_trackEvent('redirect', { action: 'error', name: 'no_error_code_found' });
286
- return;
287
- }
288
- if (!data.hasOwnProperty('available')) {
289
- webinterpret_trackEvent('redirect', { action: 'error', name: 'availability_status_not_found' });
290
- return;
291
- }
292
-
293
- try {
294
- window._webinterpret.visitor_locale = base.parseVisitorLocale(data);
295
- base.fill(data);
296
- base.display(true);
297
- } catch (err) {
298
- webinterpret_trackEvent('redirect', { action: 'error', name: 'show_modal_failed' });
299
- }
300
- },
301
- error: function (jqXHR, textStatus, errorThrown) {
302
- webinterpret_trackEvent('redirect', { action: 'error', name: 'ajax_error_' + textStatus });
303
- }
304
- });
305
- } catch (e) {
306
- webinterpret_trackEvent('redirect', { action: 'error', name: 'init_modal_failed', message: e.message });
307
- }
308
- };
309
-
310
- base.init();
311
- };
312
-
313
- $.Webinterpret.RedirectModal.defaultOptions = {
314
- url : null,
315
- utm : null,
316
- expires : 3600,
317
- closeOnPageBackgroundClick : false,
318
- };
319
-
320
- $.fn.webinterpret_RedirectModal = function(options) {
321
- return this.each(function(){
322
- (new $.Webinterpret.RedirectModal(this, options));
323
- });
324
- };
325
-
326
- var _webinterpret_launchRedirectModal = function() {
327
- try {
328
- if ($('#wi-cr-modal').length < 1) {
329
- throw new Error('html_not_found');
330
- }
331
- if (typeof _webinterpret.product_redirect_url == 'undefined') {
332
- throw new Error('required_product_redirect_url');
333
- }
334
- if (typeof _webinterpret.product_redirect_utm == 'undefined') {
335
- throw new Error('required_product_redirect_utm');
336
- }
337
- var options = {
338
- url : _webinterpret.product_redirect_url,
339
- utm : _webinterpret.product_redirect_utm,
340
- };
341
- $('#wi-cr-modal').webinterpret_RedirectModal(options);
342
- } catch (e) {
343
- webinterpret_trackEvent('redirect', { action: 'error', name: 'launch_modal_failed', name: e.message });
344
- }
345
- }
346
- _webinterpret_launchRedirectModal();
347
-
348
- })(_webinterpret_jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/webinterpret/webinterpret.css DELETED
@@ -1,312 +0,0 @@
1
-
2
- #wi-cr {
3
- visibility: hidden;
4
- z-index: -9000;
5
- position: fixed;
6
- top: 0;
7
- right: 0;
8
- bottom: 0;
9
- left: 0;
10
- background: none;
11
- background-color: rgba(0, 0, 0, 0)
12
- transition: background-color 0.25s ease;
13
- -moz-transition: background-color 0.25s ease;
14
- -webkit-transition: background-color 0.25s ease;
15
- }
16
-
17
- #wi-cr.visible {
18
- visibility: visible;
19
- z-index: 9000;
20
- background-color: rgba(0, 0, 0, 0.25);
21
- }
22
-
23
- #wi-cr-modal {
24
- font-family: 'Open Sans', sans-serif;
25
- color: #333;
26
- opacity: 0;
27
- top: 50%;
28
- left: 50%;
29
- position: fixed;
30
- transform: translate(-50%, -50%);
31
- -o-transform: translate(-50%, -50%);
32
- -ms-transform: translate(-50%, -50%);
33
- -moz-transform: translate(-50%, -50%);
34
- -webkit-transform: translate(-50%, -50%);
35
- border-radius: 2px;
36
- background: white;
37
- padding: 30px;
38
- transition: opacity 0.25s ease;
39
- -moz-transition: opacity 0.25s ease;
40
- -webkit-transition: opacity 0.25s ease;
41
- }
42
-
43
- #wi-cr.visible #wi-cr-modal {
44
- opacity: 1;
45
- }
46
-
47
- #wi-cr-flag {
48
- width: 100px;
49
- height: 100px;
50
- border-radius: 100%;
51
- margin: 15px auto;
52
- display: block;
53
- box-shadow: 0px 3px 4.7px 0.3px rgba(0, 0, 0, 0.24);
54
- }
55
-
56
- #wi-cr-title,#wi-cr-button {
57
- font-weight: 600;
58
- font-size: 18px;
59
- }
60
-
61
- #wi-cr-title,#wi-cr-text {
62
- text-align: center;
63
- margin: 0 0 15px;
64
- }
65
-
66
- #wi-cr-text {
67
- font-weight: normal;
68
- font-size: 16px;
69
- }
70
-
71
- #wi-cr-button {
72
- background: #009ddf;
73
- border: 0 none;
74
- border-radius: 4px;
75
- color: white;
76
- box-shadow: 0px 3px 4.7px 0.3px rgba(0, 0, 0, 0.24);
77
- display: block;
78
- padding: 25px 70px;
79
- line-height: 1.33333;
80
- text-align: center;
81
- text-decoration: none;
82
- cursor: pointer;
83
- vertical-align: middle;
84
- touch-action: manipulation;
85
- white-space: nowrap;
86
- margin: 0 50px;
87
- }
88
-
89
- #wi-cr-close {
90
- cursor: pointer;
91
- position: absolute;
92
- right: 0;
93
- top: 0;
94
- font-size: 24px;
95
- line-height: 1;
96
- width: 24px;
97
- height: 24px;
98
- text-align: center;
99
- background: white;
100
- padding: 13px;
101
- border-radius: 100%;
102
- margin: -25px -25px 0 0;
103
- box-sizing: content-box;
104
- box-shadow: 0px 3px 4.7px 0.3px rgba(0, 0, 0, 0.24);
105
- }
106
-
107
- #wi-cr.ie8 {
108
- background:transparent;
109
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#40000000,endColorstr=#40000000);
110
- zoom: 1;
111
- }
112
-
113
- .ie8 #wi-cr-close {
114
- margin: 0 0 -25px -25px;
115
- box-shadow: none;
116
- border-radius: 0;
117
- }
118
-
119
- @media(max-width:767px) {
120
- #wi-cr-close {
121
- margin: 0 0 -25px -25px;
122
- box-shadow: none;
123
- border-radius: 0;
124
- }
125
-
126
- #wi-cr-button {
127
- margin: 0;
128
- }
129
- }
130
-
131
- /*********************************************************************/
132
-
133
- .wi-popupOpen {
134
- overflow: hidden;
135
- max-height: 100%;
136
- }
137
-
138
- #wi-overlay {
139
- z-index: 9998;
140
- opacity: 0;
141
- visibility: hidden;
142
- position: fixed;
143
- top: 0;
144
- bottom: 0;
145
- left: 0;
146
- right: 0;
147
- background-color: rgba(0,0,0,0.55);
148
-
149
- -webkit-transition: opacity 0.4s ease, visibility 0.8s linear;
150
- -moz-transition: opacity 0.4s ease, visibility 0.8s linear;
151
- -o-transition: opacity 0.4s ease, visibility 0.8s linear;
152
- transition: opacity 0.4s ease, visibility 0.8s linear;
153
- }
154
-
155
- #wi-overlay.visible {
156
- opacity: 1;
157
- visibility: visible;
158
- }
159
-
160
- #wi-overlay.hidden, #wi-fixedBar.hidden {
161
- display: none;
162
- }
163
-
164
- #wi-frame {
165
- display: block;
166
- width: 100%;
167
- height: 100%;
168
- }
169
-
170
- #wi-fixedBar {
171
- z-index: 9999;
172
- position: fixed;
173
- top: auto;
174
- left: 0;
175
- bottom: -40px;
176
- right: 0;
177
- background-color: rgba(0,0,0,0.7);
178
- padding: 7px 10px 47px 10px;
179
- font-family: Helvetica, Arial, sans-serif;
180
- line-height: 32px;
181
- color: white;
182
- -webkit-animation-duration: 0s;
183
- animation-duration: 0s;
184
- -webkit-animation-fill-mode: both;
185
- animation-fill-mode: both;
186
- -webkit-animation-timing-function: ease-in-out;
187
- animation-timing-function: ease-in-out;
188
- -webkit-animation-name: wi-bounceOutDown;
189
- animation-name: wi-bounceOutDown;
190
- }
191
-
192
- #wi-fixedBar.visible {
193
- -webkit-animation-name: wi-bounceInUp;
194
- animation-name: wi-bounceInUp;
195
- }
196
-
197
- #wi-fixedBar .wi-link, #wi-fixedBar a {
198
- color: #009ddf;
199
-
200
- -webkit-transition: color 0.3s ease;
201
- -moz-transition: color 0.3s ease;
202
- -o-transition: color 0.3s ease;
203
- transition: color 0.3s ease;
204
- }
205
-
206
- #wi-fixedBar button {
207
- color: white;
208
- background: none;
209
- border: none;
210
- padding: 0;
211
- margin: 0;
212
- vertical-align: -webkit-baseline-middle;
213
- vertical-align: middle;
214
- }
215
-
216
- #wi-fixedBar .wi-link:hover,
217
- #wi-fixedBar .wi-link:focus,
218
- #wi-fixedBar .wi-link:active,
219
- #wi-fixedBar button:hover .wi-link,
220
- #wi-fixedBar button:focus .wi-link,
221
- #wi-fixedBar button:active .wi-link {
222
- color: inherit;
223
- }
224
-
225
- #wi-fixedBar #wi-hideGlopal {
226
- float: right;
227
- height: 32px;
228
- }
229
-
230
- #wi-fixedBar #wi-flag {
231
- display: inline-block;
232
- vertical-align: middle;
233
- width: 32px;
234
- height: 32px;
235
- border: 2px solid white;
236
- margin-right: 10px;
237
- overflow: hidden;
238
-
239
- -webkit-border-radius: 50%;
240
- -moz-border-radius: 50%;
241
- -o-border-radius: 50%;
242
- border-radius: 50%;
243
-
244
- -webkit-box-shadow: 1px 1px 1px #000;
245
- -moz-box-shadow: 1px 1px 1px #000;
246
- -o-box-shadow: 1px 1px 1px #000;
247
- box-shadow: 1px 1px 1px #000;
248
- }
249
-
250
- #wi-fixedBar #wi-flag img {
251
- display: block;
252
- max-width: 100%;
253
- }
254
-
255
- @media (max-width: 765px) {
256
- .wi-visible-xs {
257
- display: inline;
258
- }
259
-
260
- .wi-hidden-xs {
261
- display: none;
262
- }
263
-
264
- .wi-popupOpen {
265
- padding-right: 0;
266
- }
267
- }
268
-
269
- @media (min-width: 766px) {
270
- .wi-hidden-xs {
271
- display: inline;
272
- }
273
-
274
- .wi-visible-xs {
275
- display: none;
276
- }
277
- }
278
-
279
- @-webkit-keyframes wi-bounceInUp {
280
- /*
281
- 0% {-webkit-transform: translateY(2000px); opacity: 0;}
282
- 60% {-webkit-transform: translateY(-30px); opacity: 1;}
283
- 80% {-webkit-transform: translateY(10px);}
284
- */
285
- 100% {-webkit-transform: translateY(0); opacity: 1;}
286
- }
287
-
288
- @keyframes wi-bounceInUp {
289
- /*
290
- 0% {transform: translateY(2000px); opacity: 0;}
291
- 60% {transform: translateY(-30px); opacity: 1;}
292
- 80% {transform: translateY(10px);}
293
- */
294
- 100% {transform: translateY(0); opacity: 1;}
295
- }
296
-
297
- @-webkit-keyframes wi-bounceOutDown {
298
- /*
299
- 0% {-webkit-transform: translateY(0);}
300
- 20% {-webkit-transform: translateY(-20px); opacity: 1;}
301
- */
302
- 100% {-webkit-transform: translateY(2000px); opacity: 0;}
303
- }
304
-
305
- @keyframes wi-bounceOutDown {
306
- /*
307
- 0% {transform: translateY(0);}
308
- 20% {transform: translateY(-20px); opacity: 1;}
309
- */
310
- 100% {transform: translateY(2000px); opacity: 0;}
311
- }
312
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/webinterpret/webinterpret.js DELETED
@@ -1,348 +0,0 @@
1
- /*! jQuery v1.12.2 | (c) jQuery Foundation | jquery.org/license */
2
- !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.2",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0;
3
- }return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ra(b),i=l.boxSizing&&"border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Sa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Oa.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+eb(b,c,e||(i?"border":"content"),f,h)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){
4
- return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g,sb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(sb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>-1)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var tb,ub,vb=n.expr.attrHandle,wb=/^(?:checked|selected)$/i,xb=l.getSetAttribute,yb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ub:tb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?yb&&xb||!wb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(xb?c:d)}}),ub={set:function(a,b,c){return b===!1?n.removeAttr(a,c):yb&&xb||!wb.test(c)?a.setAttribute(!xb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=vb[b]||n.find.attr;yb&&xb||!wb.test(b)?vb[b]=function(a,b,d){var e,f;return d||(f=vb[b],vb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,vb[b]=f),e}:vb[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),yb&&xb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):tb&&tb.set(a,b,c)}}),xb||(tb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},vb.id=vb.name=vb.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:tb.set},n.attrHooks.contenteditable={set:function(a,b,c){tb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var zb=/^(?:input|select|textarea|button|object)$/i,Ab=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):zb.test(a.nodeName)||Ab.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Bb=/[\t\r\n\f]/g;function Cb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Cb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Cb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Cb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=Cb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Cb(c)+" ").replace(Bb," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Db=a.location,Eb=n.now(),Fb=/\?/,Gb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Gb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Hb=/#.*$/,Ib=/([?&])_=[^&]*/,Jb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Kb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Lb=/^(?:GET|HEAD)$/,Mb=/^\/\//,Nb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ob={},Pb={},Qb="*/".concat("*"),Rb=Db.href,Sb=Nb.exec(Rb.toLowerCase())||[];function Tb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Ub(a,b,c,d){var e={},f=a===Pb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Vb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Wb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Xb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Rb,type:"GET",isLocal:Kb.test(Sb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Qb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Vb(Vb(a,n.ajaxSettings),b):Vb(n.ajaxSettings,a)},ajaxPrefilter:Tb(Ob),ajaxTransport:Tb(Pb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Jb.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Rb)+"").replace(Hb,"").replace(Mb,Sb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Nb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Sb[1]&&d[2]===Sb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Sb[3]||("http:"===Sb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Ub(Ob,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Lb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Fb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Ib.test(f)?f.replace(Ib,"$1_="+Eb++):f+(Fb.test(f)?"&":"?")+"_="+Eb++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Qb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Ub(Pb,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Wb(l,w,d)),v=Xb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Yb(a){return a.style&&a.style.display||n.css(a,"display")}function Zb(a){while(a&&1===a.nodeType){if("none"===Yb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Zb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var $b=/%20/g,_b=/\[\]$/,ac=/\r?\n/g,bc=/^(?:submit|button|image|reset|file)$/i,cc=/^(?:input|select|textarea|keygen)/i;function dc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||_b.test(a)?d(a,e):dc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)dc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)dc(c,a[c],b,e);return d.join("&").replace($b,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&cc.test(this.nodeName)&&!bc.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(ac,"\r\n")}}):{name:b.name,value:c.replace(ac,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?ic():d.documentMode>8?hc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&hc()||ic()}:hc;var ec=0,fc={},gc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in fc)fc[a](void 0,!0)}),l.cors=!!gc&&"withCredentials"in gc,gc=l.ajax=!!gc,gc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++ec;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete fc[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=fc[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function hc(){try{return new a.XMLHttpRequest}catch(b){}}function ic(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var jc=[],kc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=jc.pop()||n.expando+"_"+Eb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(kc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&kc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(kc,"$1"+e):b.jsonp!==!1&&(b.url+=(Fb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,jc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var lc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&lc)return lc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function mc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=mc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=mc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){
5
- return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var nc=a.jQuery,oc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=oc),b&&a.jQuery===n&&(a.jQuery=nc),n},b||(a.jQuery=a.$=n),n});
6
- var _webinterpret_jQuery = jQuery.noConflict(true);
7
-
8
- /* Piwik */
9
- var _paq = _paq || [];
10
-
11
- /* Webinterpret */
12
- var _webinterpret = _webinterpret || {};
13
-
14
- function webinterpret_urlEncode(str) {
15
- str = (str + '').toString();
16
- return encodeURIComponent(str)
17
- .replace(/!/g, '%21')
18
- .replace(/'/g, '%27')
19
- .replace(/\(/g, '%28')
20
- .replace(/\)/g, '%29')
21
- .replace(/\*/g, '%2A')
22
- .replace(/%20/g, '+');
23
- }
24
-
25
- function webinterpret_httpBuildQuery(formdata, numeric_prefix, arg_separator) {
26
- var value, key, tmp = [],
27
- that = this;
28
-
29
- var _http_build_query_helper = function(key, val, arg_separator) {
30
- var k, tmp = [];
31
- if (val === true) {
32
- val = '1';
33
- } else if (val === false) {
34
- val = '0';
35
- }
36
- if (val != null) {
37
- if (typeof val === 'object') {
38
- for (k in val) {
39
- if (val[k] != null) {
40
- tmp.push(_http_build_query_helper(key + '[' + k + ']', val[k], arg_separator));
41
- }
42
- }
43
- return tmp.join(arg_separator);
44
- } else if (typeof val !== 'function') {
45
- return webinterpret_urlEncode(key) + '=' + webinterpret_urlEncode(val);
46
- } else {
47
- throw new Error('There was an error processing for webinterpret_httpBuildQuery().');
48
- }
49
- } else {
50
- return '';
51
- }
52
- };
53
-
54
- if (!arg_separator) {
55
- arg_separator = '&';
56
- }
57
- for (key in formdata) {
58
- value = formdata[key];
59
- if (numeric_prefix && !isNaN(key)) {
60
- key = String(numeric_prefix) + key;
61
- }
62
- var query = _http_build_query_helper(key, value, arg_separator);
63
- if (query !== '') {
64
- tmp.push(query);
65
- }
66
- }
67
-
68
- return tmp.join(arg_separator);
69
- }
70
-
71
- function webinterpret_trackEvent(category, data) {
72
- var data = data || {};
73
- var category = typeof category !== 'undefined' ? category : 'unknown';
74
- data.category = category;
75
-
76
- if (typeof _webinterpret.store_locale !== 'undefined') {
77
- data.store_locale = _webinterpret.store_locale;
78
- }
79
- if (typeof _webinterpret.visitor_locale !== 'undefined') {
80
- data.visitor_locale = _webinterpret.visitor_locale;
81
- }
82
- if (typeof _webinterpret.store_url !== 'undefined') {
83
- data.store_url = _webinterpret.store_url;
84
- }
85
- if (typeof _webinterpret.product_id !== 'undefined') {
86
- data.product_id = _webinterpret.product_id;
87
- }
88
- if (typeof _webinterpret.plugin_version !== 'undefined') {
89
- data.script_version = _webinterpret.plugin_version;
90
- }
91
-
92
- if (window._paq) {
93
- _paq.push(['trackEvent', category, webinterpret_httpBuildQuery(data)]);
94
- }
95
- }
96
-
97
- /* Webinterpret.RedirectModal */
98
- (function($) {
99
- if (!$.Webinterpret) {
100
- $.Webinterpret = new Object();
101
- };
102
-
103
- $.Webinterpret.RedirectModal = function(el, options) {
104
- var base = this;
105
- base.$el = $(el);
106
- base.el = el;
107
- base.$el.data('Webinterpret.RedirectModal', base);
108
- base.visible = false;
109
-
110
- // Current time
111
- base.now = function() {
112
- return (new Date()).getTime();
113
- };
114
-
115
- // Modal expiry
116
- base.expires = function() {
117
- return base.now() + base.options.expires * 1000;
118
- };
119
-
120
- // Test if user has closed modal
121
- base.isHidden = function() {
122
- return (parseInt(localStorage.getItem('webinterpret-redirect-hide')) >= base.now());
123
- }
124
-
125
- // Parse visitor locale from request
126
- base.parseVisitorLocale = function(data) {
127
- if (!data.hasOwnProperty('url')) {
128
- return null;
129
- }
130
- if (data.url.indexOf('glopal.at') > -1) {
131
- return 'de_AT';
132
- }
133
- if (data.url.indexOf('glopal.be') > -1) {
134
- return 'fr_BE';
135
- }
136
- if (data.url.indexOf('glopal.ca') > -1) {
137
- return 'en_CA';
138
- }
139
- if (data.url.indexOf('glopal.co.uk') > -1) {
140
- return 'en_GB';
141
- }
142
- if (data.url.indexOf('glopal.com') > -1) {
143
- return 'en_US';
144
- }
145
- if (data.url.indexOf('glopal.com.au') > -1) {
146
- return 'en_AU';
147
- }
148
- if (data.url.indexOf('glopal.de') > -1) {
149
- return 'de_DE';
150
- }
151
- if (data.url.indexOf('glopal.es') > -1) {
152
- return 'es_ES';
153
- }
154
- if (data.url.indexOf('glopal.eu') > -1) {
155
- return 'en_IE';
156
- }
157
- if (data.url.indexOf('glopal.fr') > -1) {
158
- return 'fr_FR';
159
- }
160
- if (data.url.indexOf('glopal.it') > -1) {
161
- return 'it_IT';
162
- }
163
- return null;
164
- }
165
-
166
- // Fill modal with content
167
- base.fill = function(data) {
168
- data.flag = data.flag.replace('/media/webinterpret', '/js/webinterpret');
169
- $('#wi-cr-flag').attr('src', data.flag);
170
- $('#wi-cr-title').text(data.title);
171
- $('#wi-cr-text').text(data.text);
172
- if (base.options.utm) {
173
- data.url = String(data.url) + '?' + base.options.utm;
174
- }
175
- $('#wi-cr-button').text(data.button).attr('href', data.url);
176
- };
177
-
178
- // Display or hide modal
179
- base.display = function(state) {
180
- if (state === true) {
181
- webinterpret_trackEvent('redirect', { action: 'show', name: 'show_modal' });
182
- }
183
- var wi_cr = $("#wi-cr").toggleClass('visible', base.visible = !!state);
184
- if (wi_cr.is('.ie8')) {
185
- var timeout;
186
- function update_position() {
187
- var modal = $('#wi-cr-modal');
188
- modal.css('top', (wi_cr.height() - modal.outerHeight()) / 2) + 'px !important';
189
- modal.css('left', (wi_cr.width() - modal.outerWidth()) / 2) + 'px !important';
190
- }
191
- update_position();
192
- $(window).resize(function(){
193
- clearTimeout(timeout);
194
- timeout = setTimeout(update_position, 500);
195
- });
196
- }
197
- };
198
-
199
- // Initalize modal
200
- base.init = function() {
201
- try {
202
- base.options = $.extend({},$.Webinterpret.RedirectModal.defaultOptions, options);
203
-
204
- if (base.isHidden()) {
205
- webinterpret_trackEvent('redirect', { action: 'hidden', name: 'modal_is_hidden' });
206
- return;
207
- }
208
-
209
- // Click on close button
210
- $('#wi-cr-close').click(function() {
211
- base.display(false);
212
- localStorage.setItem('webinterpret-redirect-hide', base.expires().toString());
213
- webinterpret_trackEvent('redirect', { action: 'click', name: 'close_modal_button' });
214
- });
215
-
216
- // Click on page background
217
- if (base.options.closeOnPageBackgroundClick) {
218
- $('#wi-cr').click(function(e) {
219
- if (e.target != this) {
220
- return;
221
- }
222
- localStorage.setItem('webinterpret-redirect-hide', base.expires().toString());
223
- base.display(false);
224
- webinterpret_trackEvent('redirect', { action: 'click', name: 'close_page_background' });
225
- });
226
- }
227
-
228
- // Click on OK button
229
- $('#wi-cr-button').click(function(e) {
230
- if (e.target != this) {
231
- return;
232
- }
233
- e.preventDefault();
234
- base.display(false);
235
- webinterpret_trackEvent('redirect', { action: 'click', name: 'open' });
236
- window.location = $('#wi-cr-button').attr('href');
237
- });
238
-
239
- // Get modal content based on product and geolocation
240
- $.ajax({
241
- url: base.options.url,
242
- dataType: 'json',
243
- jsonp: 'callback',
244
- statusCode: { 500: function() { webinterpret_trackEvent('redirect', { action: 'error', name: 'error_500' }); }},
245
- statusCode: { 404: function() { webinterpret_trackEvent('redirect', { action: 'error', name: 'error_404' }); }},
246
- statusCode: { 403: function() { webinterpret_trackEvent('redirect', { action: 'error', name: 'error_403' }); }},
247
- statusCode: { 401: function() { webinterpret_trackEvent('redirect', { action: 'error', name: 'error_401' }); }},
248
- statusCode: { 400: function() { webinterpret_trackEvent('redirect', { action: 'error', name: 'error_400' }); }},
249
- success: function(data) {
250
- if (!data || (typeof data != 'object')) {
251
- webinterpret_trackEvent('redirect', { action: 'error', name: 'data_not_found' });
252
- return;
253
- }
254
- if (data.hasOwnProperty('status') && data.status == 'error') {
255
- if (data.hasOwnProperty('errors') && (data.errors.constructor === Array)) {
256
- if (data.errors.length > 0 && data.errors[0].hasOwnProperty('name')) {
257
- var errorCode = data.errors[0].name.toLowerCase();
258
- var errorMessage = '';
259
- if (data.errors[0].hasOwnProperty('description')) {
260
- errorMessage = data.errors[0].description;
261
- }
262
- switch (errorCode) {
263
- case 'notsupportedcountry':
264
- var countryCode = 'no_available';
265
- if (errorMessage.length > 0) {
266
- countryCode = errorMessage.substring(0, 2).toLowerCase();
267
- }
268
- webinterpret_trackEvent('redirect', { action: 'error', name: 'visitor_locale_not_supported_' + countryCode, message: errorMessage });
269
- break;
270
- case 'store_url':
271
- webinterpret_trackEvent('redirect', { action: 'error', name: 'store_url_not_found', message: errorMessage });
272
- break;
273
- case 'availability':
274
- webinterpret_trackEvent('redirect', { action: 'error', name: 'product_not_available', message: errorMessage });
275
- break;
276
- case 'id':
277
- webinterpret_trackEvent('redirect', { action: 'error', name: 'product_not_found', message: errorMessage });
278
- break;
279
- default:
280
- webinterpret_trackEvent('redirect', { action: 'error', name: 'error_unknown_' + errorCode, message: errorMessage });
281
- }
282
- return;
283
- }
284
- }
285
- webinterpret_trackEvent('redirect', { action: 'error', name: 'no_error_code_found' });
286
- return;
287
- }
288
- if (!data.hasOwnProperty('available')) {
289
- webinterpret_trackEvent('redirect', { action: 'error', name: 'availability_status_not_found' });
290
- return;
291
- }
292
-
293
- try {
294
- window._webinterpret.visitor_locale = base.parseVisitorLocale(data);
295
- base.fill(data);
296
- base.display(true);
297
- } catch (err) {
298
- webinterpret_trackEvent('redirect', { action: 'error', name: 'show_modal_failed' });
299
- }
300
- },
301
- error: function (jqXHR, textStatus, errorThrown) {
302
- webinterpret_trackEvent('redirect', { action: 'error', name: 'ajax_error_' + textStatus });
303
- }
304
- });
305
- } catch (e) {
306
- webinterpret_trackEvent('redirect', { action: 'error', name: 'init_modal_failed', message: e.message });
307
- }
308
- };
309
-
310
- base.init();
311
- };
312
-
313
- $.Webinterpret.RedirectModal.defaultOptions = {
314
- url : null,
315
- utm : null,
316
- expires : 3600,
317
- closeOnPageBackgroundClick : false,
318
- };
319
-
320
- $.fn.webinterpret_RedirectModal = function(options) {
321
- return this.each(function(){
322
- (new $.Webinterpret.RedirectModal(this, options));
323
- });
324
- };
325
-
326
- var _webinterpret_launchRedirectModal = function() {
327
- try {
328
- if ($('#wi-cr-modal').length < 1) {
329
- throw new Error('html_not_found');
330
- }
331
- if (typeof _webinterpret.product_redirect_url == 'undefined') {
332
- throw new Error('required_product_redirect_url');
333
- }
334
- if (typeof _webinterpret.product_redirect_utm == 'undefined') {
335
- throw new Error('required_product_redirect_utm');
336
- }
337
- var options = {
338
- url : _webinterpret.product_redirect_url,
339
- utm : _webinterpret.product_redirect_utm,
340
- };
341
- $('#wi-cr-modal').webinterpret_RedirectModal(options);
342
- } catch (e) {
343
- webinterpret_trackEvent('redirect', { action: 'error', name: 'launch_modal_failed', name: e.message });
344
- }
345
- }
346
- _webinterpret_launchRedirectModal();
347
-
348
- })(_webinterpret_jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,20 +1,21 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Webinterpret_Connector</name>
4
- <version>1.2.7.6</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Integrate Magento with Webinterpret.</summary>
10
  <description>Translate and market your products internationally with Webinterpret. This is the official Magento extension for integrating with Webinterpret.</description>
11
- <notes>- Fixed redirector close bug&#xD;
12
- - Optimized JavaScript&#xD;
 
13
  </notes>
14
  <authors><author><name>Webinterpret</name><user>webinterpret</user><email>info@webinterpret.com</email></author></authors>
15
- <date>2016-04-01</date>
16
- <time>18:04:12</time>
17
- <contents><target name="magecommunity"><dir name="Webinterpret"><dir name="Connector"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="5e1935e32f1b5d10f0b76fee427a23a6"/><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Status.php" hash="99b95c7991e91a4d4d98efdaf8007b88"/></dir></dir></dir></dir><file name="Analytics.php" hash="4a1d28d7b4c1bdd3910b00100df34334"/><file name="Footer.php" hash="ba32851bb2001e7c4bda98647f270d5a"/><file name="Head.php" hash="1261ad40df9f0dc708178d78d63158d8"/><dir name="Product"><file name="Redirect.php" hash="f78e2d3b5335c54697dbc1a2571b16db"/></dir></dir><dir name="Helper"><file name="Data.php" hash="cbb00115df97013f0b8c2a07d62626b0"/></dir><dir name="Model"><file name="Notification.php" hash="a62c3b7ff11cd2d1082c0d959d8eb295"/><file name="Observer.php" hash="7d037662b540cdce42843b7e2b95b663"/></dir><dir name="bridge2cart"><file name="bridge.php" hash="e5a5f652b9b3a52a6a62d62a37c2e730"/><file name="config.php" hash="e5a5f652b9b3a52a6a62d62a37c2e730"/><file name="helper.php" hash="89b8a8b70dcd5fafb5f3e57e32face9e"/><file name="preloader.php" hash="8a8ada3537394687defdc28d4b6077e8"/></dir><dir name="controllers"><file name="ApiController.php" hash="8992304485021375a3af10f5e61da6e8"/><file name="HelperController.php" hash="c3d5347a39df19b8618cfba5f6b46356"/><file name="IndexController.php" hash="e9e0d304539657969bfce8c2b33451a6"/></dir><dir name="etc"><file name="adminhtml.xml" hash="07e287503c40ce7c588efe7863c05002"/><file name="config.xml" hash="d103f4438d5c89b41dc5d581e6e84c87"/><file name="system.xml" hash="176949a5ba847f568be2060fd81c5e38"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Webinterpret_Connector.xml" hash="087c2742f6bcb89ed6a77921e6493feb"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="webinterpret"><file name="connector.xml" hash="c44cf17575075674c657c44f2ba6b82b"/></dir></dir><dir name="template"><dir name="webinterpret"><dir name="connector"><file name="analytics.phtml" hash="dba9f21d213d1d4440e69e60c5f1f77e"/><file name="footer.phtml" hash="94c992478fd2183a0d104cbaeb382830"/><file name="head.phtml" hash="5962f76be3d4c7cb02a908c8c17911fe"/><file name="product_footer.phtml" hash="53cc2af63450e717c67c864b5a8019c3"/><file name="product_redirect.phtml" hash="594beeb745eb1437e9b2e10624e3678c"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="webinterpret"><dir name="system"><dir name="config"><file name="activate.phtml" hash="5ef389ad58cb1be9cc666fecd8379fbf"/><dir name="fieldset"><file name="banner.phtml" hash="921b677bd3e52d9c86172bdf26ab4a37"/><file name="status.phtml" hash="658ad2722ec5678a031b2141a45d32c0"/></dir></dir></dir></dir></dir><dir name="layout"><dir name="webinterpret"><file name="connector.xml" hash="867fafe49fa978668f6e5d7027c57aa6"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="webinterpret"><dir name="flags"><file name="flag-at.png" hash="4b25c35462292c96ed63cdec1bf2a620"/><file name="flag-au.png" hash="257d4975ff4116933fefa2203246bdac"/><file name="flag-be.png" hash="6019f3255488f9ad20a94297cb727cd1"/><file name="flag-de.png" hash="f9cd1fdeec5f4324293d1a2b78ec0d4a"/><file name="flag-es.png" hash="3093c6e1acb830ee36aacf6a05792f87"/><file name="flag-fr.png" hash="b7439e4d985f157e8918a4d185abb6b1"/><file name="flag-ie.png" hash="b3532a63fa08d0f1681f73a444482199"/><file name="flag-it.png" hash="53270fd8fd0f626c839f7f260b630d48"/><file name="flag-uk.png" hash="25348c2592f135d83ba48ac2d9fc47fe"/><file name="flag-us.png" hash="99e4ef1110c6aeb4407ddbedb6bba8e7"/></dir><file name="webinterpret-1.2.7.6.css" hash="c1d5c817a9ec0c085ce843258dd7ff62"/><file name="webinterpret-1.2.7.6.js" hash="fa1b7f146a2292e076e9f213a638406b"/><file name="webinterpret.css" hash="c1d5c817a9ec0c085ce843258dd7ff62"/><file name="webinterpret.js" hash="fa1b7f146a2292e076e9f213a638406b"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Webinterpret_Connector.csv" hash="832847bc730d22c330d17732d7c52915"/></dir><dir name="de_DE"><file name="Webinterpret_Connector.csv" hash="95709b4e8cb46d02bba504f7b69dd761"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Webinterpret_Connector</name>
4
+ <version>1.2.7.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Integrate Magento with Webinterpret.</summary>
10
  <description>Translate and market your products internationally with Webinterpret. This is the official Magento extension for integrating with Webinterpret.</description>
11
+ <notes>- Redirector optimization&#xD;
12
+ - Simplified installation process&#xD;
13
+ &#xD;
14
  </notes>
15
  <authors><author><name>Webinterpret</name><user>webinterpret</user><email>info@webinterpret.com</email></author></authors>
16
+ <date>2016-05-17</date>
17
+ <time>13:18:28</time>
18
+ <contents><target name="magecommunity"><dir name="Webinterpret"><dir name="Connector"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="5e1935e32f1b5d10f0b76fee427a23a6"/><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Status.php" hash="99b95c7991e91a4d4d98efdaf8007b88"/></dir></dir></dir></dir><file name="Footer.php" hash="160f03e528d7e9411e85d524919fd280"/><file name="Head.php" hash="1261ad40df9f0dc708178d78d63158d8"/><dir name="Product"><file name="View.php" hash="3b3b40108b53d326c0dcff0e45fa8407"/></dir></dir><dir name="Helper"><file name="Data.php" hash="7db8a4f7e834b17eb16a21cf6fe66316"/></dir><dir name="Model"><file name="Notification.php" hash="a62c3b7ff11cd2d1082c0d959d8eb295"/><file name="Observer.php" hash="b3cb7f22f5bc376b6f834a211a7c205b"/></dir><dir name="bridge2cart"><file name="bridge.php" hash="cdd197a1af1a05082a8836ea24922dad"/><file name="config.php" hash="0fb8e12c8d9c293354eb4fb96a713608"/><file name="helper.php" hash="afb5e2141259c580285ac85d0c180144"/><file name="preloader.php" hash="8a8ada3537394687defdc28d4b6077e8"/></dir><dir name="controllers"><file name="HelperController.php" hash="73fb01f035db7d75eb1ee0a3d535fd0b"/><file name="IndexController.php" hash="9354193ee33ea22ebfdd0b3766a9524e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="07e287503c40ce7c588efe7863c05002"/><file name="config.xml" hash="06556566e4a0099e2f9036688b488fd5"/><file name="system.xml" hash="cfe59ca34ebfef69b900f4ad275a809a"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Webinterpret_Connector.xml" hash="087c2742f6bcb89ed6a77921e6493feb"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="webinterpret"><file name="connector.xml" hash="1226a298ca08a92008293ba4e8c09eab"/></dir></dir><dir name="template"><dir name="webinterpret"><dir name="connector"><file name="footer.phtml" hash="bd48d0e36dea0936b9f28fbdada3b8c1"/><file name="head.phtml" hash="107312871a7b2730532db8d986de5726"/><file name="product_view.phtml" hash="baf77c24eb31579162db50b7c4f2b456"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="webinterpret"><dir name="system"><dir name="config"><file name="activate.phtml" hash="5ef389ad58cb1be9cc666fecd8379fbf"/><dir name="fieldset"><file name="banner.phtml" hash="921b677bd3e52d9c86172bdf26ab4a37"/><file name="status.phtml" hash="412bd1ea314a7f0c8897e6a9225c3551"/></dir></dir></dir></dir></dir><dir name="layout"><dir name="webinterpret"><file name="connector.xml" hash="867fafe49fa978668f6e5d7027c57aa6"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Webinterpret_Connector.csv" hash="c382db753974630198cf029cf90b5d27"/></dir><dir name="de_DE"><file name="Webinterpret_Connector.csv" hash="91312fd3bd2645b88e3b3643b6b614a9"/></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
21
  </package>