BackupGuardFree - Version 1.0.6

Version Notes

Fully functional stable version

Download this release

Release Info

Developer Backup Guard
Extension BackupGuardFree
Version 1.0.6
Comparing to
See all releases


Code changes from version 1.0.5 to 1.0.6

Files changed (40) hide show
  1. app/code/community/BackupGuard/BackupGuardFree/com/.DS_Store +0 -0
  2. app/code/community/BackupGuard/BackupGuardFree/com/boot.php +1 -1
  3. app/code/community/BackupGuard/BackupGuardFree/com/config/config.magento.free.php +13 -3
  4. app/code/community/BackupGuard/BackupGuardFree/com/config/config.magento.php +19 -17
  5. app/code/community/BackupGuard/BackupGuardFree/com/config/config.php +28 -0
  6. app/code/community/BackupGuard/BackupGuardFree/com/core/.DS_Store +0 -0
  7. app/code/community/BackupGuard/BackupGuardFree/com/core/SGBoot.php +53 -20
  8. app/code/community/BackupGuard/BackupGuardFree/com/core/SGConfig.php +23 -23
  9. app/code/community/BackupGuard/BackupGuardFree/com/core/backup/SGBackup.php +147 -113
  10. app/code/community/BackupGuard/BackupGuardFree/com/core/backup/SGBackupDatabase.php +284 -241
  11. app/code/community/BackupGuard/BackupGuardFree/com/core/backup/SGBackupFiles.php +12 -10
  12. app/code/community/BackupGuard/BackupGuardFree/com/core/database/.DS_Store +0 -0
  13. app/code/community/BackupGuard/BackupGuardFree/com/core/database/SGDatabaseAdapterMagento.php +1 -1
  14. app/code/community/BackupGuard/BackupGuardFree/com/core/exception/.DS_Store +0 -0
  15. app/code/community/BackupGuard/BackupGuardFree/com/core/functions.php +77 -2
  16. app/code/community/BackupGuard/BackupGuardFree/com/core/log/.DS_Store +0 -0
  17. app/code/community/BackupGuard/BackupGuardFree/com/lib/SGMysqldump.php +26 -1
  18. app/code/community/BackupGuard/BackupGuardFree/controllers/Adminhtml/BackupguardfreeController.php +19 -1
  19. app/code/community/BackupGuard/BackupGuardFree/etc/adminhtml.xml +15 -0
  20. app/code/community/BackupGuard/BackupGuardFree/etc/config.xml +2 -2
  21. app/code/community/BackupGuard/BackupGuardFree/sql/.DS_Store +0 -0
  22. app/code/community/BackupGuard/BackupGuardFree/sql/backupguardfree_setup/mysql4-install-1.0.0.php +30 -24
  23. app/design/adminhtml/default/default/layout/backupguardfree.xml +58 -0
  24. app/design/adminhtml/default/default/template/backupguardfree/backups.phtml +31 -34
  25. app/design/adminhtml/default/default/template/backupguardfree/footer.phtml +5 -5
  26. app/design/adminhtml/default/default/template/backupguardfree/footer.settings.phtml +2 -0
  27. app/design/adminhtml/default/default/template/backupguardfree/header.phtml +1 -1
  28. app/design/adminhtml/default/default/template/backupguardfree/settings.phtml +96 -0
  29. app/design/adminhtml/default/default/template/backupguardfree/sidebar.phtml +39 -26
  30. app/design/adminhtml/default/default/template/backupguardfree/support.phtml +5 -0
  31. app/design/adminhtml/default/default/template/backupguardfree/whyupgrade.phtml +4 -0
  32. package.xml +4 -4
  33. skin/adminhtml/base/default/css/BackupGuardFree/bgstyle.less.css +51 -1
  34. skin/adminhtml/base/default/css/BackupGuardFree/spinner.css +2 -2
  35. skin/adminhtml/base/default/js/BackupGuardFree/bootstrap.min.js +4 -8
  36. skin/adminhtml/base/default/js/BackupGuardFree/less.min.js +1 -1
  37. skin/adminhtml/base/default/js/BackupGuardFree/main.js +182 -12
  38. skin/adminhtml/base/default/js/BackupGuardFree/sgbackup.js +323 -170
  39. skin/adminhtml/base/default/js/BackupGuardFree/sgrequesthandler.js +1 -1
  40. skin/adminhtml/base/default/js/BackupGuardFree/sgsettings.js +99 -0
app/code/community/BackupGuard/BackupGuardFree/com/.DS_Store CHANGED
Binary file
app/code/community/BackupGuard/BackupGuardFree/com/boot.php CHANGED
@@ -3,4 +3,4 @@ require_once(dirname(__FILE__).'/config/config.magento.free.php');
3
  require_once(dirname(__FILE__).'/config/config.magento.php');
4
  require_once(SG_CORE_PATH.'SGBoot.php');
5
 
6
- SGBoot::init();
3
  require_once(dirname(__FILE__).'/config/config.magento.php');
4
  require_once(SG_CORE_PATH.'SGBoot.php');
5
 
6
+ SGBoot::init();
app/code/community/BackupGuard/BackupGuardFree/com/config/config.magento.free.php CHANGED
@@ -1,9 +1,19 @@
1
  <?php
 
2
 
3
- define('SG_FEATURE_NOTIFICATIONS', 0);
4
- define('SG_FEATURE_SCHEDULE', 0);
5
  define('SG_FEATURE_STORAGE', 0);
6
  define('SG_FEATURE_FTP', 0);
 
7
  define('SG_FEATURE_DROPBOX', 0);
8
  define('SG_FEATURE_GOOGLE_DRIVE', 0);
9
- define('SG_FEATURE_BACKGROUND_MODE', 0);
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ define('SG_BACKUP_GUARD_VERSION', '1.0.6');
3
 
4
+ define('SG_FEATURE_DOWNLOAD_FROM_CLOUD', 0);
 
5
  define('SG_FEATURE_STORAGE', 0);
6
  define('SG_FEATURE_FTP', 0);
7
+ define('SG_FEATURE_AMAZON', 0);
8
  define('SG_FEATURE_DROPBOX', 0);
9
  define('SG_FEATURE_GOOGLE_DRIVE', 0);
10
+ define('SG_FEATURE_SCHEDULE', 0);
11
+ define('SG_FEATURE_DELETE_LOCAL_BACKUP_AFTER_UPLOAD', 0);
12
+ define('SG_FEATURE_NUMBER_OF_BACKUPS_TO_KEEP', 0);
13
+ define('SG_FEATURE_CUSTOM_BACKUP_NAME', 0);
14
+ define('SG_FEATURE_SUBDIRECTORIES', 0);
15
+ define('SG_FEATURE_BACKGROUND_MODE', 0);
16
+ define('SG_FEATURE_NOTIFICATIONS', 0);
17
+ define('SG_FEATURE_MULTI_SCHEDULE', 0);
18
+
19
+ define('SG_FEATURE_SHOW_UPGRADE_PAGE', 1);
app/code/community/BackupGuard/BackupGuardFree/com/config/config.magento.php CHANGED
@@ -10,6 +10,8 @@ define('SG_ENV_DB_PREFIX', (string)Mage::getConfig()->getTablePrefix());
10
 
11
  require_once(dirname(__FILE__).'/config.php');
12
 
 
 
13
  //Database
14
  define('SG_DB_ADAPTER', SG_ENV_ADAPTER);
15
  define('SG_DB_NAME', (string)Mage::getConfig()->getNode('global/resources/default_setup/connection/dbname'));
@@ -24,24 +26,24 @@ define('SG_APP_ROOT_DIRECTORY', Mage::getBaseDir().'/');
24
 
25
  $excludes = array(
26
  'app/code/community/BackupGuard/',
27
- 'app/etc/modules/BackupGuard_BackupGuardFree.xml',
28
- 'app/etc/modules/BackupGuard_BackupGuard.xml',
29
- 'app/design/adminhtml/default/default/layout/backupguardfree.xml',
30
- 'app/design/adminhtml/default/default/layout/backupguard.xml',
31
- 'app/design/adminhtml/default/default/template/backupguardfree/',
32
- 'app/design/adminhtml/default/default/template/backupguard/',
33
- 'app/locale/en_US/template/email/backupguard_backup_fail.html',
34
- 'app/locale/en_US/template/email/backupguard_backup_success.html',
35
- 'app/locale/en_US/template/email/backupguard_restore_fail.html',
36
- 'app/locale/en_US/template/email/backupguard_restore_success.html',
37
  'media/sg_symlinks/',
38
- 'skin/adminhtml/base/default/css/BackupGuardFree/',
39
- 'skin/adminhtml/base/default/css/BackupGuard/',
40
- 'skin/adminhtml/base/default/js/BackupGuardFree/',
41
- 'skin/adminhtml/base/default/js/BackupGuard/',
42
- 'skin/adminhtml/base/default/media/BackupGuardFree/',
43
- 'skin/adminhtml/base/default/media/BackupGuard/',
44
- 'var/log/'
45
  );
46
  define('SG_BACKUP_FILE_PATHS_EXCLUDE', implode(',', $excludes));
47
  define('SG_BACKUP_DIRECTORY', SG_APP_PATH.'../sg_backups/'); //backups will be stored here
10
 
11
  require_once(dirname(__FILE__).'/config.php');
12
 
13
+ define('SG_ENV_CORE_TABLE', SG_MAGENTO_CORE_TABLE);
14
+
15
  //Database
16
  define('SG_DB_ADAPTER', SG_ENV_ADAPTER);
17
  define('SG_DB_NAME', (string)Mage::getConfig()->getNode('global/resources/default_setup/connection/dbname'));
26
 
27
  $excludes = array(
28
  'app/code/community/BackupGuard/',
29
+ 'app/etc/modules/BackupGuard_BackupGuardFree.xml',
30
+ 'app/etc/modules/BackupGuard_BackupGuard.xml',
31
+ 'app/design/adminhtml/default/default/layout/backupguardfree.xml',
32
+ 'app/design/adminhtml/default/default/layout/backupguard.xml',
33
+ 'app/design/adminhtml/default/default/template/backupguardfree/',
34
+ 'app/design/adminhtml/default/default/template/backupguard/',
35
+ 'app/locale/en_US/template/email/backupguard_backup_fail.html',
36
+ 'app/locale/en_US/template/email/backupguard_backup_success.html',
37
+ 'app/locale/en_US/template/email/backupguard_restore_fail.html',
38
+ 'app/locale/en_US/template/email/backupguard_restore_success.html',
39
  'media/sg_symlinks/',
40
+ 'skin/adminhtml/base/default/css/BackupGuardFree/',
41
+ 'skin/adminhtml/base/default/css/BackupGuard/',
42
+ 'skin/adminhtml/base/default/js/BackupGuardFree/',
43
+ 'skin/adminhtml/base/default/js/BackupGuard/',
44
+ 'skin/adminhtml/base/default/media/BackupGuardFree/',
45
+ 'skin/adminhtml/base/default/media/BackupGuard/',
46
+ 'var/log/'
47
  );
48
  define('SG_BACKUP_FILE_PATHS_EXCLUDE', implode(',', $excludes));
49
  define('SG_BACKUP_DIRECTORY', SG_APP_PATH.'../sg_backups/'); //backups will be stored here
app/code/community/BackupGuard/BackupGuardFree/com/config/config.php CHANGED
@@ -23,6 +23,14 @@ define('SG_LOG_LEVEL_LOW', 4);
23
  define('SG_BACKUP_LOG_POS_START', 1);
24
  define('SG_BACKUP_LOG_POS_END', 2);
25
 
 
 
 
 
 
 
 
 
26
  //Backup timeout in seconds
27
  define('SG_BACKUP_TIMEOUT', 180);
28
 
@@ -34,6 +42,23 @@ define('SGBP_EXT', 'sgbp');
34
 
35
  define('SG_NOTICE_EXECUTION_TIMEOUT', 'timeoutError');
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  //Backup
38
  define('SG_ACTION_STATUS_CREATED', 0);
39
  define('SG_ACTION_STATUS_IN_PROGRESS_DB', 1);
@@ -62,6 +87,8 @@ define('SG_MAIL_RESTORE_FAIL_SUBJECT', 'Restore Failed');
62
  define('SG_STORAGE_FTP', 1);
63
  define('SG_STORAGE_DROPBOX', 2);
64
  define('SG_STORAGE_GOOGLE_DRIVE', 3);
 
 
65
  define('SG_STORAGE_GOOGLE_DRIVE_CLIENT_ID', '1030123017859-vfdlqkjhiuuu5n36pbov93v9ruo6jpj5.apps.googleusercontent.com');
66
  define('SG_STORAGE_GOOGLE_DRIVE_SECRET', 'oUcZwC17q5ZSbYahnQkGYpyH');
67
  define('SG_STORAGE_GOOGLE_DRIVE_REDIRECT_URI', 'https://backup-guard.com/gdrive/');
@@ -79,3 +106,4 @@ define('SG_BACKUP_UPLOAD_TO_STORAGES', ''); //list of storage ids separated by c
79
  //Database tables
80
  define('SG_ACTION_TABLE_NAME', SG_ENV_DB_PREFIX.'sg_action');
81
  define('SG_CONFIG_TABLE_NAME', SG_ENV_DB_PREFIX.'sg_config');
 
23
  define('SG_BACKUP_LOG_POS_START', 1);
24
  define('SG_BACKUP_LOG_POS_END', 2);
25
 
26
+ define('SG_DB_PREFIX_REPLACEMENT', '%%sg_db_prefix%%');
27
+
28
+ define('SG_SHCEDULE_STATUS_INACTIVE', 0);
29
+ define('SG_SHCEDULE_STATUS_PENDING', 1);
30
+
31
+ //Number of backups to keep on server by default
32
+ define('SG_NUMBER_OF_BACKUPS_TO_KEEP', 100);
33
+
34
  //Backup timeout in seconds
35
  define('SG_BACKUP_TIMEOUT', 180);
36
 
42
 
43
  define('SG_NOTICE_EXECUTION_TIMEOUT', 'timeoutError');
44
 
45
+ define('SG_WORDPRESS_CORE_TABLE', SG_ENV_DB_PREFIX.'options');
46
+ define('SG_MAGENTO_CORE_TABLE', SG_ENV_DB_PREFIX.'core_config_data');
47
+
48
+ //Backup file default prefix
49
+ define('SG_BACKUP_FILE_NAME_DEFAULT_PREFIX', 'sg_backup_');
50
+
51
+ //Default folder name for storage upload
52
+ define('SG_BACKUP_DEFAULT_FOLDER_NAME', 'sg_backups');
53
+
54
+ //Schedule action name prefix
55
+ define('SG_SCHEDULE_ACTION', 'backup_guard_schedule_action');
56
+
57
+ define('SG_SCHEDULER_DEFAULT_ID', 1);
58
+
59
+ //one day in seconds
60
+ define('SG_ONE_DAY_IN_SECONDS', 24*60*60);
61
+
62
  //Backup
63
  define('SG_ACTION_STATUS_CREATED', 0);
64
  define('SG_ACTION_STATUS_IN_PROGRESS_DB', 1);
87
  define('SG_STORAGE_FTP', 1);
88
  define('SG_STORAGE_DROPBOX', 2);
89
  define('SG_STORAGE_GOOGLE_DRIVE', 3);
90
+ define('SG_STORAGE_AMAZON', 4);
91
+
92
  define('SG_STORAGE_GOOGLE_DRIVE_CLIENT_ID', '1030123017859-vfdlqkjhiuuu5n36pbov93v9ruo6jpj5.apps.googleusercontent.com');
93
  define('SG_STORAGE_GOOGLE_DRIVE_SECRET', 'oUcZwC17q5ZSbYahnQkGYpyH');
94
  define('SG_STORAGE_GOOGLE_DRIVE_REDIRECT_URI', 'https://backup-guard.com/gdrive/');
106
  //Database tables
107
  define('SG_ACTION_TABLE_NAME', SG_ENV_DB_PREFIX.'sg_action');
108
  define('SG_CONFIG_TABLE_NAME', SG_ENV_DB_PREFIX.'sg_config');
109
+ define('SG_SCHEDULE_TABLE_NAME', SG_ENV_DB_PREFIX.'sg_schedule');
app/code/community/BackupGuard/BackupGuardFree/com/core/.DS_Store CHANGED
Binary file
app/code/community/BackupGuard/BackupGuardFree/com/core/SGBoot.php CHANGED
@@ -4,7 +4,7 @@ require_once(SG_CORE_PATH.'functions.php');
4
  require_once(SG_CORE_PATH.'SGPing.php');
5
  require_once(SG_DATABASE_PATH.'SGDatabase.php');
6
  require_once(SG_CORE_PATH.'SGConfig.php');
7
- @include_once(SG_SCHEDULE_PATH.'SGSchedule.php');
8
 
9
  class SGBoot
10
  {
@@ -18,7 +18,6 @@ class SGBoot
18
  //remove execution time limit
19
  @set_time_limit(0);
20
 
21
-
22
  //load all config variables from database
23
  SGConfig::getAll();
24
 
@@ -38,41 +37,55 @@ class SGBoot
38
 
39
  public static function install()
40
  {
41
- try
42
- {
43
- $sgdb = SGDatabase::getInstance();
44
 
 
45
  //create config table
46
  $res = $sgdb->query('DROP TABLE IF EXISTS `'.SG_CONFIG_TABLE_NAME.'`;');
47
- if ($res===false)
48
- {
49
  throw new SGExceptionDatabaseError('Could not execute query');
50
  }
 
51
  $res = $sgdb->query('CREATE TABLE `'.SG_CONFIG_TABLE_NAME.'` (
52
  `ckey` varchar(100) NOT NULL,
53
- `cvalue` varchar(255) NOT NULL,
54
  PRIMARY KEY (`ckey`)
55
  );');
56
- if ($res===false)
57
- {
58
  throw new SGExceptionDatabaseError('Could not execute query');
59
  }
60
 
61
  //populate config table
62
  $res = $sgdb->query("INSERT INTO `".SG_CONFIG_TABLE_NAME."` VALUES
 
63
  ('SG_BACKUP_SYNCHRONOUS_STORAGE_UPLOAD','1'),
64
  ('SG_NOTIFICATIONS_ENABLED','0'),
65
  ('SG_NOTIFICATIONS_EMAIL_ADDRESS',''),
66
  ('SG_STORAGE_BACKUPS_FOLDER_NAME','sg_backups');");
67
- if ($res===false)
68
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  throw new SGExceptionDatabaseError('Could not execute query');
70
  }
71
 
72
  //create action table
73
  $res = $sgdb->query('DROP TABLE IF EXISTS `'.SG_ACTION_TABLE_NAME.'`;');
74
- if ($res===false)
75
- {
76
  throw new SGExceptionDatabaseError('Could not execute query');
77
  }
78
  $res = $sgdb->query("CREATE TABLE `".SG_ACTION_TABLE_NAME."` (
@@ -84,23 +97,37 @@ class SGBoot
84
  `progress` tinyint(3) unsigned NOT NULL DEFAULT '0',
85
  `start_date` datetime NOT NULL,
86
  `update_date` datetime DEFAULT NULL,
 
87
  PRIMARY KEY (`id`)
88
  );");
89
- if ($res===false)
90
- {
91
  throw new SGExceptionDatabaseError('Could not execute query');
92
  }
93
  }
94
- catch (SGException $exception)
95
- {
96
  die($exception);
97
  }
98
  }
99
 
 
 
 
 
 
 
 
 
100
  public static function uninstall($deleteBackups = false)
101
  {
102
  try
103
  {
 
 
 
 
 
 
 
104
  $sgdb = SGDatabase::getInstance();
105
 
106
  //drop config table
@@ -110,6 +137,12 @@ class SGBoot
110
  throw new SGExceptionDatabaseError('Could not execute query');
111
  }
112
 
 
 
 
 
 
 
113
  //drop action table
114
  $res = $sgdb->query('DROP TABLE IF EXISTS `'.SG_ACTION_TABLE_NAME.'`;');
115
  if ($res===false)
@@ -175,9 +208,9 @@ class SGBoot
175
  private static function checkMinimumRequirements()
176
  {
177
  //check PHP version
178
- if (version_compare(PHP_VERSION, '5.3.0', '<'))
179
  {
180
- die('PHP >=5.3.0 version required.');
181
  }
182
 
183
  //check ZLib library
4
  require_once(SG_CORE_PATH.'SGPing.php');
5
  require_once(SG_DATABASE_PATH.'SGDatabase.php');
6
  require_once(SG_CORE_PATH.'SGConfig.php');
7
+ @include_once(SG_BACKUP_PATH.'SGBackupSchedule.php');
8
 
9
  class SGBoot
10
  {
18
  //remove execution time limit
19
  @set_time_limit(0);
20
 
 
21
  //load all config variables from database
22
  SGConfig::getAll();
23
 
37
 
38
  public static function install()
39
  {
40
+ $sgdb = SGDatabase::getInstance();
 
 
41
 
42
+ try {
43
  //create config table
44
  $res = $sgdb->query('DROP TABLE IF EXISTS `'.SG_CONFIG_TABLE_NAME.'`;');
45
+ if ($res===false) {
 
46
  throw new SGExceptionDatabaseError('Could not execute query');
47
  }
48
+
49
  $res = $sgdb->query('CREATE TABLE `'.SG_CONFIG_TABLE_NAME.'` (
50
  `ckey` varchar(100) NOT NULL,
51
+ `cvalue` text NOT NULL,
52
  PRIMARY KEY (`ckey`)
53
  );');
54
+ if ($res===false) {
 
55
  throw new SGExceptionDatabaseError('Could not execute query');
56
  }
57
 
58
  //populate config table
59
  $res = $sgdb->query("INSERT INTO `".SG_CONFIG_TABLE_NAME."` VALUES
60
+ ('SG_BACKUP_GUARD_VERSION','".SG_BACKUP_GUARD_VERSION."'),
61
  ('SG_BACKUP_SYNCHRONOUS_STORAGE_UPLOAD','1'),
62
  ('SG_NOTIFICATIONS_ENABLED','0'),
63
  ('SG_NOTIFICATIONS_EMAIL_ADDRESS',''),
64
  ('SG_STORAGE_BACKUPS_FOLDER_NAME','sg_backups');");
65
+ if ($res===false) {
66
+ throw new SGExceptionDatabaseError('Could not execute query');
67
+ }
68
+
69
+ //create schedule table
70
+ $res = $sgdb->query('DROP TABLE IF EXISTS `'.SG_SCHEDULE_TABLE_NAME.'`;');
71
+ if ($res===false) {
72
+ throw new SGExceptionDatabaseError('Could not execute query');
73
+ }
74
+ $res = $sgdb->query('CREATE TABLE `'.SG_SCHEDULE_TABLE_NAME.'` (
75
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
76
+ `label` varchar(255) NOT NULL,
77
+ `status` tinyint(3) unsigned NOT NULL,
78
+ `schedule_options` varchar(255) NOT NULL,
79
+ `backup_options` text NOT NULL,
80
+ PRIMARY KEY (`id`)
81
+ );');
82
+ if ($res===false) {
83
  throw new SGExceptionDatabaseError('Could not execute query');
84
  }
85
 
86
  //create action table
87
  $res = $sgdb->query('DROP TABLE IF EXISTS `'.SG_ACTION_TABLE_NAME.'`;');
88
+ if ($res===false) {
 
89
  throw new SGExceptionDatabaseError('Could not execute query');
90
  }
91
  $res = $sgdb->query("CREATE TABLE `".SG_ACTION_TABLE_NAME."` (
97
  `progress` tinyint(3) unsigned NOT NULL DEFAULT '0',
98
  `start_date` datetime NOT NULL,
99
  `update_date` datetime DEFAULT NULL,
100
+ `options` text NOT NULL,
101
  PRIMARY KEY (`id`)
102
  );");
103
+ if ($res===false) {
 
104
  throw new SGExceptionDatabaseError('Could not execute query');
105
  }
106
  }
107
+ catch (SGException $exception) {
 
108
  die($exception);
109
  }
110
  }
111
 
112
+ private static function cleanupSchedules()
113
+ {
114
+ $schedules = SGBackupSchedule::getAllSchedules();
115
+ foreach ($schedules as $schedule) {
116
+ SGBackupSchedule::remove($schedule['id']);
117
+ }
118
+ }
119
+
120
  public static function uninstall($deleteBackups = false)
121
  {
122
  try
123
  {
124
+ @unlink(SG_PING_FILE_PATH);
125
+
126
+ if(self::isFeatureAvailable('SCHEDULE')) {
127
+ self::cleanupSchedules();
128
+ }
129
+
130
+
131
  $sgdb = SGDatabase::getInstance();
132
 
133
  //drop config table
137
  throw new SGExceptionDatabaseError('Could not execute query');
138
  }
139
 
140
+ //drop schedule table
141
+ $res = $sgdb->query('DROP TABLE IF EXISTS `'.SG_SCHEDULE_TABLE_NAME.'`;');
142
+ if ($res===false) {
143
+ throw new SGExceptionDatabaseError('Could not execute query');
144
+ }
145
+
146
  //drop action table
147
  $res = $sgdb->query('DROP TABLE IF EXISTS `'.SG_ACTION_TABLE_NAME.'`;');
148
  if ($res===false)
208
  private static function checkMinimumRequirements()
209
  {
210
  //check PHP version
211
+ if (version_compare(PHP_VERSION, '5.3.3', '<'))
212
  {
213
+ die('PHP >=5.3.3 version required.');
214
  }
215
 
216
  //check ZLib library
app/code/community/BackupGuard/BackupGuardFree/com/core/SGConfig.php CHANGED
@@ -20,24 +20,25 @@ class SGConfig
20
 
21
  public static function get($key, $forced = false)
22
  {
23
- if (!$forced)
24
- {
25
- if (isset(self::$values[$key]))
26
- {
27
  return self::$values[$key];
28
  }
29
 
30
- if (defined($key))
31
- {
32
  return constant($key);
33
  }
34
  }
35
-
36
  $sgdb = SGDatabase::getInstance();
37
- $data = $sgdb->query('SELECT cvalue, NOW() FROM '.SG_CONFIG_TABLE_NAME.' WHERE ckey = %s', array($key));
38
 
39
- if (!$data)
40
- {
 
 
 
 
41
  return null;
42
  }
43
 
@@ -48,20 +49,19 @@ class SGConfig
48
  public static function getAll()
49
  {
50
  $sgdb = SGDatabase::getInstance();
51
- $configs = $sgdb->query('SELECT * FROM '.SG_CONFIG_TABLE_NAME);
52
 
53
- if (!$configs)
54
- {
55
- return null;
56
- }
57
-
58
- $currentConfigs = array();
59
- foreach ($configs as $config)
60
- {
61
- self::$values[$config['ckey']] = $config['cvalue'];
62
- $currentConfigs[$config['ckey']] = $config['cvalue'];
63
  }
64
 
65
- return $currentConfigs;
66
  }
67
- }
20
 
21
  public static function get($key, $forced = false)
22
  {
23
+ if (!$forced) {
24
+ if (isset(self::$values[$key])) {
 
 
25
  return self::$values[$key];
26
  }
27
 
28
+ if (defined($key)) {
 
29
  return constant($key);
30
  }
31
  }
32
+
33
  $sgdb = SGDatabase::getInstance();
34
+ $data = array();
35
 
36
+ $res = $sgdb->query("SHOW TABLES LIKE '".SG_CONFIG_TABLE_NAME."'");
37
+ if ($res) {
38
+ $data = $sgdb->query('SELECT cvalue, NOW() FROM '.SG_CONFIG_TABLE_NAME.' WHERE ckey = %s', array($key));
39
+ }
40
+
41
+ if (!count($data)) {
42
  return null;
43
  }
44
 
49
  public static function getAll()
50
  {
51
  $sgdb = SGDatabase::getInstance();
52
+ $configs = array();
53
 
54
+ $res = $sgdb->query("SHOW TABLES LIKE '".SG_CONFIG_TABLE_NAME."'");
55
+ if ($res) {
56
+ $res = $sgdb->query('SELECT * FROM '.SG_CONFIG_TABLE_NAME);
57
+ if ($res) {
58
+ foreach ($res as $config) {
59
+ self::$values[$config['ckey']] = $config['cvalue'];
60
+ $configs[$config['ckey']] = $config['cvalue'];
61
+ }
62
+ }
 
63
  }
64
 
65
+ return $configs;
66
  }
67
+ }
app/code/community/BackupGuard/BackupGuardFree/com/core/backup/SGBackup.php CHANGED
@@ -28,49 +28,42 @@ class SGBackup implements SGIBackupDelegate
28
 
29
  public function __construct()
30
  {
31
- $this->filesBackupAvailable = SGConfig::get('SG_ACTION_BACKUP_FILES_AVAILABLE');
32
- $this->databaseBackupAvailable = SGConfig::get('SG_ACTION_BACKUP_DATABASE_AVAILABLE');
33
- $this->backgroundMode = SGConfig::get('SG_BACKUP_IN_BACKGROUND_MODE');
34
-
35
  $this->backupFiles = new SGBackupFiles();
36
  $this->backupFiles->setDelegate($this);
37
 
38
- if ($this->databaseBackupAvailable)
39
- {
40
- $this->backupDatabase = new SGBackupDatabase();
41
- $this->backupDatabase->setDelegate($this);
42
- }
43
  }
44
 
45
- public function handleBackupExecutionTimeout()
46
  {
47
- $backupDatabase = new SGBackupDatabase();
48
- $backupFiles = new SGBackupFiles();
49
- $databaseBackupAvailable = SGConfig::get('SG_ACTION_BACKUP_DATABASE_AVAILABLE');
50
- $filesBackupAvailable = SGConfig::get('SG_ACTION_BACKUP_FILES_AVAILABLE');
 
 
 
51
 
 
 
52
  $filesBackupPath = SG_BACKUP_DIRECTORY.$this->fileName.'/'.$this->fileName.'.sgbp';
53
  $databaseBackupPath = SG_BACKUP_DIRECTORY.$this->fileName.'/'.$this->fileName.'.sql';
54
 
55
- if ($databaseBackupAvailable)
56
- {
57
- $backupDatabase->setFilePath($databaseBackupPath);
58
- $backupDatabase->cancel();
59
- }
60
 
61
- $backupFiles->setFilePath($filesBackupPath);
62
- $backupFiles->cancel();
63
 
64
- if (SGBoot::isFeatureAvailable('NOTIFICATIONS'))
65
- {
66
  SGBackupMailNotification::sendBackupNotification(false);
67
  }
68
  }
69
 
70
- public function handleRestoreExecutionTimeout()
71
  {
72
- if (SGBoot::isFeatureAvailable('NOTIFICATIONS'))
73
- {
74
  SGBackupMailNotification::sendRestoreNotification(false);
75
  }
76
  }
@@ -97,7 +90,7 @@ class SGBackup implements SGIBackupDelegate
97
  $this->prepareBackupLogFile($backupPath, true);
98
  }
99
 
100
- //Stop all the running actions related tp the specific backup, like backup, upload...
101
  $allActions = self::getRunningActions();
102
  foreach ($allActions as $action) {
103
  self::changeActionStatus($action['id'], SG_ACTION_STATUS_ERROR);
@@ -116,9 +109,29 @@ class SGBackup implements SGIBackupDelegate
116
  $res = $sgdb->query('UPDATE '.SG_ACTION_TABLE_NAME.' SET status=%d,'.$progress.' update_date=%s WHERE name=%d AND type=%d', array($status, @date('Y-m-d H:i:s'), $actionName, $type));
117
  }
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  /* Backup implementation */
120
 
121
- public function backup()
122
  {
123
  $this->fileName = self::getBackupFileName();
124
  $this->prepareBackupFolder(SG_BACKUP_DIRECTORY.$this->fileName);
@@ -126,27 +139,29 @@ class SGBackup implements SGIBackupDelegate
126
 
127
  try
128
  {
129
- $this->prepareForBackup();
 
130
 
131
- if ($this->databaseBackupAvailable)
132
- {
 
 
 
133
  $this->backupDatabase->setFilePath($this->databaseBackupPath);
134
  $this->backupFiles->addDontExclude(realpath($this->databaseBackupPath));
135
 
136
- if (!$this->filesBackupAvailable)
137
- {
138
- SGConfig::set('SG_BACKUP_FILE_PATHS', '', false);
139
  }
140
 
141
  $this->backupDatabase->backup($this->databaseBackupPath);
142
-
143
  $rootDirectory = realpath(SGConfig::get('SG_APP_ROOT_DIRECTORY')).'/';
144
  $path = substr(realpath($this->databaseBackupPath), strlen($rootDirectory));
145
  $this->backupFiles->addDontExclude(realpath($this->databaseBackupPath));
146
- $backupItems = SGConfig::get('SG_BACKUP_FILE_PATHS');
147
  $allItems = $backupItems?explode(',', $backupItems):array();
148
  $allItems[] = $path;
149
- SGConfig::set('SG_BACKUP_FILE_PATHS', implode(',', $allItems), false);
150
 
151
  $currentStatus = $this->getCurrentActionStatus();
152
  if ($currentStatus==SG_ACTION_STATUS_CANCELLING || $currentStatus==SG_ACTION_STATUS_CANCELLED)
@@ -157,7 +172,7 @@ class SGBackup implements SGIBackupDelegate
157
  self::changeActionStatus($this->actionId, SG_ACTION_STATUS_IN_PROGRESS_FILES);
158
  }
159
 
160
- $this->backupFiles->backup($this->filesBackupPath);
161
  $this->didFinishBackup();
162
  }
163
  catch (SGException $exception)
@@ -197,10 +212,16 @@ class SGBackup implements SGIBackupDelegate
197
  }
198
  }
199
 
 
 
 
 
 
200
  private function backupUploadToStorages()
201
  {
202
  //check list of storages to upload if any
203
- $uploadToStorages = SGConfig::get('SG_BACKUP_SYNCHRONOUS_STORAGE_UPLOAD');
 
204
  if (SGBoot::isFeatureAvailable('STORAGE') && $uploadToStorages)
205
  {
206
  while (count($this->queuedStorageUploads))
@@ -209,21 +230,25 @@ class SGBackup implements SGIBackupDelegate
209
  SGBackupStorage::getInstance()->startUploadByActionId($actionId);
210
  array_shift($this->queuedStorageUploads);
211
  }
 
 
 
 
212
  }
213
  }
214
 
215
  private function cleanUp()
216
  {
217
  //delete sql file
218
- if ($this->databaseBackupAvailable)
219
- {
220
- $this->backupDatabase->cancel();
221
  }
222
  }
223
 
224
  private static function getBackupFileName()
225
  {
226
- return 'sg_backup_'.(@date('YmdHis'));
 
227
  }
228
 
229
  private function prepareBackupFolder($backupPath)
@@ -281,16 +306,15 @@ class SGBackup implements SGIBackupDelegate
281
  $this->databaseBackupPath = SG_BACKUP_DIRECTORY.$this->fileName.'/'.$this->fileName.'.sql';
282
  }
283
 
284
- private function prepareUploadToStorages()
285
  {
286
- $uploadToStorages = SGConfig::get('SG_BACKUP_UPLOAD_TO_STORAGES');
287
- if (SGBoot::isFeatureAvailable('STORAGE') && $uploadToStorages)
288
- {
289
  $storages = explode(',', $uploadToStorages);
290
  $arr = array();
291
- foreach ($storages as $storageId)
292
- {
293
- $actionId = SGBackupStorage::queueBackupForUpload($this->fileName, $storageId);
294
  $arr[] = $actionId;
295
  }
296
  $this->queuedStorageUploads = $arr;
@@ -303,7 +327,7 @@ class SGBackup implements SGIBackupDelegate
303
  SGConfig::set('SG_RUNNING_ACTION', 1, true);
304
  }
305
 
306
- private function prepareForBackup()
307
  {
308
  //start logging
309
  SGBackupLog::writeAction('backup', SG_BACKUP_LOG_POS_START);
@@ -313,7 +337,7 @@ class SGBackup implements SGIBackupDelegate
313
 
314
  //create action inside db
315
  $status = $this->databaseBackupAvailable?SG_ACTION_STATUS_IN_PROGRESS_DB:SG_ACTION_STATUS_IN_PROGRESS_FILES;
316
- $this->actionId = self::createAction($this->fileName, SG_ACTION_TYPE_BACKUP, $status);
317
 
318
  //set paths
319
  $this->setBackupPaths();
@@ -330,7 +354,7 @@ class SGBackup implements SGIBackupDelegate
330
  $this->prepareAdditionalConfigurations();
331
 
332
  //check if upload to storages is needed
333
- $this->prepareUploadToStorages();
334
  }
335
 
336
  public function cancel()
@@ -342,8 +366,6 @@ class SGBackup implements SGIBackupDelegate
342
 
343
  $this->backupFiles->cancel();
344
 
345
- SGBackupLog::write('Backup cancelled');
346
-
347
  throw new SGExceptionSkip();
348
  }
349
 
@@ -535,10 +557,10 @@ class SGBackup implements SGIBackupDelegate
535
  return ($warningsFiles||$warningsDatabase);
536
  }
537
 
538
- public static function createAction($name, $type, $status, $subtype = 0)
539
  {
540
  $sgdb = SGDatabase::getInstance();
541
- $res = $sgdb->query('INSERT INTO '.SG_ACTION_TABLE_NAME.' (name, type, subtype, status, start_date) VALUES (%s, %d, %d, %d, %s)', array($name, $type, $subtype, $status, @date('Y-m-d H:i:s')));
542
  if (!$res)
543
  {
544
  throw new SGExceptionDatabaseError('Could not create action');
@@ -642,7 +664,7 @@ class SGBackup implements SGIBackupDelegate
642
  foreach ($files as $file) {
643
  $fileInfo = self::getBackupFileInfo($file);
644
 
645
- if ($fileInfo['extension'] == SGBP_EXT) {
646
  @mkdir($path.$fileInfo['filename'], 0777);
647
 
648
  if(file_exists($path.$fileInfo['filename'])) {
@@ -668,89 +690,101 @@ class SGBackup implements SGIBackupDelegate
668
  self::autodetectBackups();
669
  clearstatcache();
670
 
 
 
 
 
671
  if ($handle = @opendir($path)) {
672
  $sgdb = SGDatabase::getInstance();
673
- $data = $sgdb->query('SELECT id, name, type, subtype, status, progress, update_date FROM '.SG_ACTION_TABLE_NAME);
674
  $allBackups = array();
675
  foreach ($data as $row) {
676
  $allBackups[$row['name']][] = $row;
677
  }
678
 
679
- while (($file = readdir($handle)) !== false) {
680
- if ($file === '.' || $file === '..') {
681
  continue;
682
  }
683
 
684
- if (substr($file, 0, 10)=='sg_backup_') {
685
- $backup = array();
686
- $backup['name'] = $file;
687
- $backup['files'] = file_exists($path.$file.'/'.$file.'.sgbp')?1:0;
688
- $backup['backup_log'] = file_exists($path.$file.'/'.$file.'_backup.log')?1:0;
689
- $backup['restore_log'] = file_exists($path.$file.'/'.$file.'_restore.log')?1:0;
690
- if (!$backup['files'] && !$backup['backup_log'] && !$backup['restore_log']) {
691
- continue;
692
- }
693
- $backupRow = null;
694
- if (isset($allBackups[$file])) {
695
- $skip = false;
696
- foreach ($allBackups[$file] as $row) {
697
- if ($row['status']==SG_ACTION_STATUS_IN_PROGRESS_FILES || $backupRow['status']==SG_ACTION_STATUS_IN_PROGRESS_DB) {
698
- $backupRow = $row;
699
- break;
700
- }
701
- else if (($row['status']==SG_ACTION_STATUS_CANCELLING || $row['status']==SG_ACTION_STATUS_CANCELLED) && $row['type']!=SG_ACTION_TYPE_UPLOAD) {
702
- $skip = true;
703
- break;
704
- }
705
-
706
  $backupRow = $row;
707
-
708
- if ($row['status']==SG_ACTION_STATUS_FINISHED_WARNINGS || $row['status']==SG_ACTION_STATUS_ERROR) {
709
- if ($row['type'] == SG_ACTION_TYPE_UPLOAD && file_exists(SG_BACKUP_DIRECTORY.$file.DS.$file.'.sgbp')) {
710
- $backupRow['status'] = SG_ACTION_STATUS_FINISHED_WARNINGS;
711
- }
712
- }
713
  }
714
-
715
- if ($skip===true) {
716
- continue;
717
  }
718
- }
719
 
720
- if ($backupRow) {
721
- $backup['active'] = ($backupRow['status']==SG_ACTION_STATUS_IN_PROGRESS_FILES||
722
- $backupRow['status']==SG_ACTION_STATUS_IN_PROGRESS_DB||
723
- $backupRow['status']==SG_ACTION_STATUS_CREATED)?1:0;
724
 
725
- $backup['status'] = $backupRow['status'];
726
- $backup['type'] = (int)$backupRow['type'];
727
- $backup['subtype'] = (int)$backupRow['subtype'];
728
- $backup['progress'] = (int)$backupRow['progress'];
729
- $backup['id'] = (int)$backupRow['id'];
730
- }
731
- else {
732
- $backup['active'] = 0;
733
  }
734
 
735
- $size = '';
736
- if ($backup['files']) {
737
- $size = number_format(realFilesize($path.$file.'/'.$file.'.sgbp')/1024.0/1024.0, 2, '.', '').' MB';
738
  }
 
739
 
740
- $backup['size'] = $size;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
741
 
742
- $modifiedTime = filemtime($path.$file.'/.');
743
- $backup['date'] = @date('Y-m-d H:i', $modifiedTime);
744
- $backups[$modifiedTime] = $backup;
745
  }
 
 
 
 
 
 
 
746
  }
747
  closedir($handle);
748
  }
749
 
750
- krsort($backups);
751
  return array_values($backups);
752
  }
753
 
 
 
 
 
 
754
  public static function deleteBackup($backupName, $deleteAction = true)
755
  {
756
  deleteDirectory(SG_BACKUP_DIRECTORY.$backupName);
28
 
29
  public function __construct()
30
  {
 
 
 
 
31
  $this->backupFiles = new SGBackupFiles();
32
  $this->backupFiles->setDelegate($this);
33
 
34
+ $this->backupDatabase = new SGBackupDatabase();
35
+ $this->backupDatabase->setDelegate($this);
 
 
 
36
  }
37
 
38
+ public function getScheduleParamsById($id)
39
  {
40
+ $sgdb = SGDatabase::getInstance();
41
+ $res = $sgdb->query('SELECT * FROM '.SG_SCHEDULE_TABLE_NAME.' WHERE id=%d', array($id));
42
+ if (empty($res)) {
43
+ return '';
44
+ }
45
+ return $res[0];
46
+ }
47
 
48
+ private function handleBackupExecutionTimeout()
49
+ {
50
  $filesBackupPath = SG_BACKUP_DIRECTORY.$this->fileName.'/'.$this->fileName.'.sgbp';
51
  $databaseBackupPath = SG_BACKUP_DIRECTORY.$this->fileName.'/'.$this->fileName.'.sql';
52
 
53
+ $this->backupDatabase->setFilePath($databaseBackupPath);
54
+ $this->backupDatabase->cancel();
 
 
 
55
 
56
+ $this->backupFiles->setFilePath($filesBackupPath);
57
+ $this->backupFiles->cancel();
58
 
59
+ if (SGBoot::isFeatureAvailable('NOTIFICATIONS')) {
 
60
  SGBackupMailNotification::sendBackupNotification(false);
61
  }
62
  }
63
 
64
+ private function handleRestoreExecutionTimeout()
65
  {
66
+ if (SGBoot::isFeatureAvailable('NOTIFICATIONS')) {
 
67
  SGBackupMailNotification::sendRestoreNotification(false);
68
  }
69
  }
90
  $this->prepareBackupLogFile($backupPath, true);
91
  }
92
 
93
+ //Stop all the running actions related to the specific backup, like backup, upload...
94
  $allActions = self::getRunningActions();
95
  foreach ($allActions as $action) {
96
  self::changeActionStatus($action['id'], SG_ACTION_STATUS_ERROR);
109
  $res = $sgdb->query('UPDATE '.SG_ACTION_TABLE_NAME.' SET status=%d,'.$progress.' update_date=%s WHERE name=%d AND type=%d', array($status, @date('Y-m-d H:i:s'), $actionName, $type));
110
  }
111
 
112
+ public function listStorage($storage)
113
+ {
114
+ if (SGBoot::isFeatureAvailable('DOWNLOAD_FROM_CLOUD')) {
115
+ $listOfFiles = SGBackupStorage::getInstance()->listStorage($storage);
116
+ return $listOfFiles;
117
+ }
118
+
119
+ return array();
120
+ }
121
+
122
+ public function downloadBackupArchiveFromCloud($archive, $storage, $size)
123
+ {
124
+ $result = false;
125
+ if (SGBoot::isFeatureAvailable('DOWNLOAD_FROM_CLOUD')) {
126
+ $result = SGBackupStorage::getInstance()->downloadBackupArchiveFromCloud($storage, $archive, $size);
127
+ }
128
+
129
+ return $result;
130
+ }
131
+
132
  /* Backup implementation */
133
 
134
+ public function backup($options)
135
  {
136
  $this->fileName = self::getBackupFileName();
137
  $this->prepareBackupFolder(SG_BACKUP_DIRECTORY.$this->fileName);
139
 
140
  try
141
  {
142
+ $this->filesBackupAvailable = isset($options['SG_ACTION_BACKUP_FILES_AVAILABLE'])?$options['SG_ACTION_BACKUP_FILES_AVAILABLE']:false;
143
+ $this->databaseBackupAvailable = isset($options['SG_ACTION_BACKUP_DATABASE_AVAILABLE'])?$options['SG_ACTION_BACKUP_DATABASE_AVAILABLE']:false;
144
 
145
+ $this->backgroundMode = isset($options['SG_BACKUP_IN_BACKGROUND_MODE'])?$options['SG_BACKUP_IN_BACKGROUND_MODE']:false;
146
+
147
+ $this->prepareForBackup($options);
148
+
149
+ if ($this->databaseBackupAvailable) {
150
  $this->backupDatabase->setFilePath($this->databaseBackupPath);
151
  $this->backupFiles->addDontExclude(realpath($this->databaseBackupPath));
152
 
153
+ if (!$this->filesBackupAvailable) {
154
+ $options['SG_BACKUP_FILE_PATHS'] = '';
 
155
  }
156
 
157
  $this->backupDatabase->backup($this->databaseBackupPath);
 
158
  $rootDirectory = realpath(SGConfig::get('SG_APP_ROOT_DIRECTORY')).'/';
159
  $path = substr(realpath($this->databaseBackupPath), strlen($rootDirectory));
160
  $this->backupFiles->addDontExclude(realpath($this->databaseBackupPath));
161
+ $backupItems = $options['SG_BACKUP_FILE_PATHS'];
162
  $allItems = $backupItems?explode(',', $backupItems):array();
163
  $allItems[] = $path;
164
+ $options['SG_BACKUP_FILE_PATHS'] = implode(',', $allItems);
165
 
166
  $currentStatus = $this->getCurrentActionStatus();
167
  if ($currentStatus==SG_ACTION_STATUS_CANCELLING || $currentStatus==SG_ACTION_STATUS_CANCELLED)
172
  self::changeActionStatus($this->actionId, SG_ACTION_STATUS_IN_PROGRESS_FILES);
173
  }
174
 
175
+ $this->backupFiles->backup($this->filesBackupPath, $options);
176
  $this->didFinishBackup();
177
  }
178
  catch (SGException $exception)
212
  }
213
  }
214
 
215
+ private function shouldDeleteBackupAfterUpload()
216
+ {
217
+ return SGConfig::get('SG_DELETE_BACKUP_AFTER_UPLOAD')?true:false;
218
+ }
219
+
220
  private function backupUploadToStorages()
221
  {
222
  //check list of storages to upload if any
223
+ $uploadToStorages = count($this->queuedStorageUploads)?true:false;
224
+ $isDeleteLocalBackupFeatureAvailable = SGBoot::isFeatureAvailable('DELETE_LOCAL_BACKUP_AFTER_UPLOAD');
225
  if (SGBoot::isFeatureAvailable('STORAGE') && $uploadToStorages)
226
  {
227
  while (count($this->queuedStorageUploads))
230
  SGBackupStorage::getInstance()->startUploadByActionId($actionId);
231
  array_shift($this->queuedStorageUploads);
232
  }
233
+
234
+ if ($this->shouldDeleteBackupAfterUpload() && $uploadToStorages && $isDeleteLocalBackupFeatureAvailable) {
235
+ @unlink(SG_BACKUP_DIRECTORY.$this->fileName.'/'.$this->fileName.'.'.SGBP_EXT);
236
+ }
237
  }
238
  }
239
 
240
  private function cleanUp()
241
  {
242
  //delete sql file
243
+ if ($this->databaseBackupAvailable) {
244
+ @unlink($this->databaseBackupPath);
 
245
  }
246
  }
247
 
248
  private static function getBackupFileName()
249
  {
250
+ $sgBackupPrefix = SGConfig::get('SG_BACKUP_FILE_NAME_PREFIX')?SGConfig::get('SG_BACKUP_FILE_NAME_PREFIX'):SG_BACKUP_FILE_NAME_DEFAULT_PREFIX;
251
+ return $sgBackupPrefix.(@date('YmdHis'));
252
  }
253
 
254
  private function prepareBackupFolder($backupPath)
306
  $this->databaseBackupPath = SG_BACKUP_DIRECTORY.$this->fileName.'/'.$this->fileName.'.sql';
307
  }
308
 
309
+ private function prepareUploadToStorages($options)
310
  {
311
+ $uploadToStorages = $options['SG_BACKUP_UPLOAD_TO_STORAGES'];
312
+
313
+ if (SGBoot::isFeatureAvailable('STORAGE') && $uploadToStorages) {
314
  $storages = explode(',', $uploadToStorages);
315
  $arr = array();
316
+ foreach ($storages as $storageId) {
317
+ $actionId = SGBackupStorage::queueBackupForUpload($this->fileName, $storageId, $options);
 
318
  $arr[] = $actionId;
319
  }
320
  $this->queuedStorageUploads = $arr;
327
  SGConfig::set('SG_RUNNING_ACTION', 1, true);
328
  }
329
 
330
+ private function prepareForBackup($options)
331
  {
332
  //start logging
333
  SGBackupLog::writeAction('backup', SG_BACKUP_LOG_POS_START);
337
 
338
  //create action inside db
339
  $status = $this->databaseBackupAvailable?SG_ACTION_STATUS_IN_PROGRESS_DB:SG_ACTION_STATUS_IN_PROGRESS_FILES;
340
+ $this->actionId = self::createAction($this->fileName, SG_ACTION_TYPE_BACKUP, $status, 0, json_encode($options));
341
 
342
  //set paths
343
  $this->setBackupPaths();
354
  $this->prepareAdditionalConfigurations();
355
 
356
  //check if upload to storages is needed
357
+ $this->prepareUploadToStorages($options);
358
  }
359
 
360
  public function cancel()
366
 
367
  $this->backupFiles->cancel();
368
 
 
 
369
  throw new SGExceptionSkip();
370
  }
371
 
557
  return ($warningsFiles||$warningsDatabase);
558
  }
559
 
560
+ public static function createAction($name, $type, $status, $subtype = 0, $options = '')
561
  {
562
  $sgdb = SGDatabase::getInstance();
563
+ $res = $sgdb->query('INSERT INTO '.SG_ACTION_TABLE_NAME.' (name, type, subtype, status, start_date, options) VALUES (%s, %d, %d, %d, %s, %s)', array($name, $type, $subtype, $status, @date('Y-m-d H:i:s'), $options));
564
  if (!$res)
565
  {
566
  throw new SGExceptionDatabaseError('Could not create action');
664
  foreach ($files as $file) {
665
  $fileInfo = self::getBackupFileInfo($file);
666
 
667
+ if (@$fileInfo['extension'] == SGBP_EXT) {
668
  @mkdir($path.$fileInfo['filename'], 0777);
669
 
670
  if(file_exists($path.$fileInfo['filename'])) {
690
  self::autodetectBackups();
691
  clearstatcache();
692
 
693
+ if (SGBoot::isFeatureAvailable('NUMBER_OF_BACKUPS_TO_KEEP')) {
694
+ backupGuardOutdatedBackupsCleanup($path);
695
+ }
696
+
697
  if ($handle = @opendir($path)) {
698
  $sgdb = SGDatabase::getInstance();
699
+ $data = $sgdb->query('SELECT id, name, type, subtype, status, progress, update_date, options FROM '.SG_ACTION_TABLE_NAME);
700
  $allBackups = array();
701
  foreach ($data as $row) {
702
  $allBackups[$row['name']][] = $row;
703
  }
704
 
705
+ while (($entry = readdir($handle)) !== false) {
706
+ if ($entry === '.' || $entry === '..' || !is_dir($path.$entry)) {
707
  continue;
708
  }
709
 
710
+ $backup = array();
711
+ $backup['name'] = $entry;
712
+ $backup['id'] = '';
713
+ $backup['status'] = '';
714
+ $backup['files'] = file_exists($path.$entry.'/'.$entry.'.sgbp')?1:0;
715
+ $backup['backup_log'] = file_exists($path.$entry.'/'.$entry.'_backup.log')?1:0;
716
+ $backup['restore_log'] = file_exists($path.$entry.'/'.$entry.'_restore.log')?1:0;
717
+ $backup['options'] = '';
718
+ if (!$backup['files'] && !$backup['backup_log'] && !$backup['restore_log']) {
719
+ continue;
720
+ }
721
+ $backupRow = null;
722
+ if (isset($allBackups[$entry])) {
723
+ $skip = false;
724
+ foreach ($allBackups[$entry] as $row) {
725
+ if ($row['status']==SG_ACTION_STATUS_IN_PROGRESS_FILES || $row['status']==SG_ACTION_STATUS_IN_PROGRESS_DB) {
 
 
 
 
 
 
726
  $backupRow = $row;
727
+ break;
 
 
 
 
 
728
  }
729
+ else if (($row['status']==SG_ACTION_STATUS_CANCELLING || $row['status']==SG_ACTION_STATUS_CANCELLED) && $row['type']!=SG_ACTION_TYPE_UPLOAD) {
730
+ $skip = true;
731
+ break;
732
  }
 
733
 
734
+ $backupRow = $row;
 
 
 
735
 
736
+ if ($row['status']==SG_ACTION_STATUS_FINISHED_WARNINGS || $row['status']==SG_ACTION_STATUS_ERROR) {
737
+ if ($row['type'] == SG_ACTION_TYPE_UPLOAD && file_exists(SG_BACKUP_DIRECTORY.$entry.'/'.$entry.'.sgbp')) {
738
+ $backupRow['status'] = SG_ACTION_STATUS_FINISHED_WARNINGS;
739
+ }
740
+ }
 
 
 
741
  }
742
 
743
+ if ($skip===true) {
744
+ continue;
 
745
  }
746
+ }
747
 
748
+ if ($backupRow) {
749
+ $backup['active'] = ($backupRow['status']==SG_ACTION_STATUS_IN_PROGRESS_FILES||
750
+ $backupRow['status']==SG_ACTION_STATUS_IN_PROGRESS_DB||
751
+ $backupRow['status']==SG_ACTION_STATUS_CREATED)?1:0;
752
+
753
+ $backup['status'] = $backupRow['status'];
754
+ $backup['type'] = (int)$backupRow['type'];
755
+ $backup['subtype'] = (int)$backupRow['subtype'];
756
+ $backup['progress'] = (int)$backupRow['progress'];
757
+ $backup['id'] = (int)$backupRow['id'];
758
+ $backup['options'] = $backupRow['options'];
759
+ }
760
+ else {
761
+ $backup['active'] = 0;
762
+ }
763
 
764
+ $size = '';
765
+ if ($backup['files']) {
766
+ $size = number_format(realFilesize($path.$entry.'/'.$entry.'.sgbp')/1024.0/1024.0, 2, '.', '').' MB';
767
  }
768
+
769
+ $backup['size'] = $size;
770
+
771
+ $modifiedTime = filemtime($path.$entry.'/.');
772
+ $backup['date'] = @date('Y-m-d H:i', $modifiedTime);
773
+ $backup['modifiedTime'] = $modifiedTime;
774
+ $backups[] = $backup;
775
  }
776
  closedir($handle);
777
  }
778
 
779
+ usort($backups, array('SGBackup', 'sort'));
780
  return array_values($backups);
781
  }
782
 
783
+ public static function sort($arg1, $arg2)
784
+ {
785
+ return $arg1['modifiedTime']>$arg2['modifiedTime']?-1:1;
786
+ }
787
+
788
  public static function deleteBackup($backupName, $deleteAction = true)
789
  {
790
  deleteDirectory(SG_BACKUP_DIRECTORY.$backupName);
app/code/community/BackupGuard/BackupGuardFree/com/core/backup/SGBackupDatabase.php CHANGED
@@ -4,245 +4,288 @@ require_once(SG_LIB_PATH.'SGMysqldump.php');
4
 
5
  class SGBackupDatabase implements SGIMysqldumpDelegate
6
  {
7
- private $sgdb = null;
8
- private $backupFilePath = '';
9
- private $delegate = null;
10
- private $cancelled = false;
11
- private $nextProgressUpdate = 0;
12
- private $totalRowCount = 0;
13
- private $currentRowCount = 0;
14
- private $warningsFound = false;
15
-
16
- public function __construct()
17
- {
18
- $this->sgdb = SGDatabase::getInstance();
19
- }
20
-
21
- public function setDelegate(SGIBackupDelegate $delegate)
22
- {
23
- $this->delegate = $delegate;
24
- }
25
-
26
- public function setFilePath($filePath)
27
- {
28
- $this->backupFilePath = $filePath;
29
- }
30
-
31
- public function didFindWarnings()
32
- {
33
- return $this->warningsFound;
34
- }
35
-
36
- public function backup($filePath)
37
- {
38
- $this->backupFilePath = $filePath;
39
- $this->progressUpdateInterval = SGConfig::get('SG_ACTION_PROGRESS_UPDATE_INTERVAL');
40
-
41
- SGBackupLog::writeAction('backup database', SG_BACKUP_LOG_POS_START);
42
- $this->resetBackupProgress();
43
-
44
- $this->export();
45
- SGBackupLog::writeAction('backup database', SG_BACKUP_LOG_POS_END);
46
- }
47
-
48
- public function restore($filePath)
49
- {
50
- SGBackupLog::writeAction('restore database', SG_BACKUP_LOG_POS_START);
51
- $this->backupFilePath = $filePath;
52
- $this->resetRestoreProgress();
53
- $this->import();
54
- SGBackupLog::writeAction('restore database', SG_BACKUP_LOG_POS_END);
55
- }
56
-
57
- private function export()
58
- {
59
- if (!$this->isWritable($this->backupFilePath))
60
- {
61
- throw new SGExceptionForbidden('Permission denied. File is not writable: '.$this->backupFilePath);
62
- }
63
-
64
- $tablesToExclude = explode(',', SGConfig::get('SG_BACKUP_DATABASE_EXCLUDE'));
65
-
66
- $dump = new SGMysqldump($this->sgdb, SG_DB_NAME, 'mysql', array(
67
- 'exclude-tables'=>$tablesToExclude,
68
- 'skip-dump-date'=>true,
69
- 'skip-comments'=>true,
70
- 'skip-tz-utz'=>true,
71
- 'add-drop-table'=>true,
72
- 'no-autocommit'=>false,
73
- 'single-transaction'=>false,
74
- 'lock-tables'=>false,
75
- 'add-locks'=>false
76
- ));
77
- $dump->setDelegate($this);
78
- $dump->start($this->backupFilePath);
79
- }
80
-
81
- private function import()
82
- {
83
- $fileHandle = @fopen($this->backupFilePath, 'r');
84
- if (!is_resource($fileHandle))
85
- {
86
- throw new SGExceptionForbidden('Could not open file: '.$this->backupFilePath);
87
- }
88
- $importQuery = '';
89
- while (($row = @fgets($fileHandle)) !== false)
90
- {
91
- $importQuery .= $row;
92
- $trimmedRow = trim($row);
93
-
94
- if (strpos($trimmedRow, 'CREATE TABLE') !== false)
95
- {
96
- $strLength = strlen($trimmedRow);
97
- $strCtLength = strlen('CREATE TABLE ');
98
- $length = $strLength - $strCtLength - 2;
99
- $tableName = substr($trimmedRow, $strCtLength, $length);
100
- SGBackupLog::write('Importing table: '.$tableName);
101
- }
102
-
103
- if($trimmedRow && substr($trimmedRow, -9) == "/*SGEnd*/")
104
- {
105
- $importQuery = str_replace("/*SGEnd*/", "", $importQuery);
106
- $res = $this->sgdb->exec($importQuery);
107
- if ($res===false)
108
- {
109
- throw new SGExceptionDatabaseError('Could not execute query: '.$importQuery);
110
- }
111
- $importQuery = '';
112
- }
113
- $this->currentRowCount++;
114
- SGPing::update();
115
- $this->updateProgress();
116
- }
117
- @fclose($fileHandle);
118
- }
119
-
120
- public function didExportRow()
121
- {
122
- $this->currentRowCount++;
123
- SGPing::update();
124
-
125
- if ($this->updateProgress())
126
- {
127
- if ($this->delegate && $this->delegate->isCancelled())
128
- {
129
- $this->cancelled = true;
130
- return;
131
- }
132
- }
133
-
134
- if (SGBoot::isFeatureAvailable('BACKGROUND_MODE') && $this->delegate->isBackgroundMode())
135
- {
136
- SGBackgroundMode::next();
137
- }
138
- }
139
-
140
- public function cancel()
141
- {
142
- @unlink($this->backupFilePath);
143
- }
144
-
145
- private function resetBackupProgress()
146
- {
147
- $this->totalRowCount = 0;
148
- $this->currentRowCount = 0;
149
- $tableNames = $this->getTables();
150
- foreach ($tableNames as $table)
151
- {
152
- $this->totalRowCount += $this->getTableRowsCount($table);
153
- }
154
- $this->nextProgressUpdate = $this->progressUpdateInterval;
155
- SGBackupLog::write('Total tables to backup: '.count($tableNames));
156
- SGBackupLog::write('Total rows to backup: '.$this->totalRowCount);
157
- }
158
-
159
- private function resetRestoreProgress()
160
- {
161
- $this->totalRowCount = $this->getFileLinesCount($this->backupFilePath);
162
- $this->currentRowCount = 0;
163
- $this->progressUpdateInterval = SGConfig::get('SG_ACTION_PROGRESS_UPDATE_INTERVAL');
164
- $this->nextProgressUpdate = $this->progressUpdateInterval;
165
- }
166
-
167
- private function getTables()
168
- {
169
- $tableNames = array();
170
- $tables = $this->sgdb->query('SHOW TABLES FROM `'.SG_DB_NAME.'`');
171
- if (!$tables)
172
- {
173
- throw new SGExceptionDatabaseError('Could not get tables of database: '.SG_DB_NAME);
174
- }
175
- foreach ($tables as $table)
176
- {
177
- $tableName = $table['Tables_in_'.SG_DB_NAME];
178
- $tablesToExclude = explode(',', SGConfig::get('SG_BACKUP_DATABASE_EXCLUDE'));
179
- if (in_array($tableName, $tablesToExclude))
180
- {
181
- continue;
182
- }
183
- $tableNames[] = $tableName;
184
- }
185
- return $tableNames;
186
- }
187
-
188
- private function getTableRowsCount($tableName)
189
- {
190
- $count = 0;
191
- $tableRowsNum = $this->sgdb->query('SELECT COUNT(*) AS total FROM '.$tableName);
192
- $count = @$tableRowsNum[0]['total'];
193
- return $count;
194
- }
195
-
196
- private function getFileLinesCount($filePath)
197
- {
198
- $fileHandle = @fopen($filePath, 'rb');
199
- if (!is_resource($fileHandle))
200
- {
201
- throw new SGExceptionForbidden('Could not open file: '.$filePath);
202
- }
203
-
204
- $linecount = 0;
205
- while (!feof($fileHandle))
206
- {
207
- $linecount += substr_count(fread($fileHandle, 8192), "\n");
208
- }
209
-
210
- @fclose($fileHandle);
211
- return $linecount;
212
- }
213
-
214
- private function updateProgress()
215
- {
216
- $progress = round($this->currentRowCount*100.0/$this->totalRowCount);
217
-
218
- if ($progress>=$this->nextProgressUpdate)
219
- {
220
- $this->nextProgressUpdate += $this->progressUpdateInterval;
221
-
222
- if ($this->delegate)
223
- {
224
- $this->delegate->didUpdateProgress($progress);
225
- }
226
-
227
- return true;
228
- }
229
-
230
- return false;
231
- }
232
-
233
- /* Helper Functions */
234
-
235
- private function isWritable($filePath)
236
- {
237
- if (!file_exists($filePath))
238
- {
239
- $fp = @fopen($filePath, 'wb');
240
- if (!$fp)
241
- {
242
- throw new SGExceptionForbidden('Could not open file: '.$filePath);
243
- }
244
- @fclose($fp);
245
- }
246
- return is_writable($filePath);
247
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  }
4
 
5
  class SGBackupDatabase implements SGIMysqldumpDelegate
6
  {
7
+ private $sgdb = null;
8
+ private $backupFilePath = '';
9
+ private $delegate = null;
10
+ private $cancelled = false;
11
+ private $nextProgressUpdate = 0;
12
+ private $totalRowCount = 0;
13
+ private $currentRowCount = 0;
14
+ private $warningsFound = false;
15
+ private $backupReplacements = array(
16
+ SG_ENV_DB_PREFIX => SG_DB_PREFIX_REPLACEMENT
17
+ );
18
+ private $restoreReplacements = array(
19
+ SG_DB_PREFIX_REPLACEMENT => SG_ENV_DB_PREFIX
20
+ );
21
+
22
+ public function __construct()
23
+ {
24
+ $this->sgdb = SGDatabase::getInstance();
25
+ }
26
+
27
+ public function setDelegate(SGIBackupDelegate $delegate)
28
+ {
29
+ $this->delegate = $delegate;
30
+ }
31
+
32
+ public function setFilePath($filePath)
33
+ {
34
+ $this->backupFilePath = $filePath;
35
+ }
36
+
37
+ public function didFindWarnings()
38
+ {
39
+ return $this->warningsFound;
40
+ }
41
+
42
+ public function backup($filePath)
43
+ {
44
+ $this->backupFilePath = $filePath;
45
+ $this->progressUpdateInterval = SGConfig::get('SG_ACTION_PROGRESS_UPDATE_INTERVAL');
46
+
47
+ SGBackupLog::writeAction('backup database', SG_BACKUP_LOG_POS_START);
48
+ $this->resetBackupProgress();
49
+
50
+ $this->export();
51
+ SGBackupLog::writeAction('backup database', SG_BACKUP_LOG_POS_END);
52
+ }
53
+
54
+ public function restore($filePath)
55
+ {
56
+ $sgdb = SGDatabase::getInstance();
57
+ if (SG_ENV_ADAPTER == SG_ENV_WORDPRESS) {
58
+ $siteUrl = get_site_url();
59
+ $home = get_home_url();
60
+ }
61
+ else{
62
+ $siteUrl = Mage::getStoreConfig('web/unsecure/base_url', 0);
63
+ $home = Mage::getStoreConfig('web/secure/base_url', 0);
64
+ }
65
+
66
+ SGBackupLog::writeAction('restore database', SG_BACKUP_LOG_POS_START);
67
+ $this->backupFilePath = $filePath;
68
+ $this->resetRestoreProgress();
69
+ $this->import();
70
+
71
+ if (SG_ENV_ADAPTER == SG_ENV_WORDPRESS) {
72
+ $query = "UPDATE ".SG_ENV_CORE_TABLE." SET option_value=%s WHERE option_name='siteurl'";
73
+ $sgdb->query($query, array($siteUrl));
74
+ $query = "UPDATE ".SG_ENV_CORE_TABLE." SET option_value=%s WHERE option_name='home'";
75
+ $sgdb->query($query, array($home));
76
+ }
77
+ else {
78
+ $query = "UPDATE ".SG_ENV_CORE_TABLE." SET value=%s WHERE path='web/unsecure/base_url'";
79
+ $sgdb->query($query, array($siteUrl));
80
+ $query = "UPDATE ".SG_ENV_CORE_TABLE." SET value=%s WHERE path='web/secure/base_url'";
81
+ $sgdb->query($query, array($home));
82
+ }
83
+
84
+ SGBackupLog::writeAction('restore database', SG_BACKUP_LOG_POS_END);
85
+ }
86
+
87
+ private function export()
88
+ {
89
+ if (!$this->isWritable($this->backupFilePath))
90
+ {
91
+ throw new SGExceptionForbidden('Permission denied. File is not writable: '.$this->backupFilePath);
92
+ }
93
+
94
+ $tablesToExclude = explode(',', SGConfig::get('SG_BACKUP_DATABASE_EXCLUDE'));
95
+
96
+ $dump = new SGMysqldump($this->sgdb, SG_DB_NAME, 'mysql', array(
97
+ 'exclude-tables'=>$tablesToExclude,
98
+ 'skip-dump-date'=>true,
99
+ 'skip-comments'=>true,
100
+ 'skip-tz-utz'=>true,
101
+ 'add-drop-table'=>true,
102
+ 'no-autocommit'=>false,
103
+ 'single-transaction'=>false,
104
+ 'lock-tables'=>false,
105
+ 'add-locks'=>false
106
+ ));
107
+
108
+ $dump->setDelegate($this);
109
+ $dump->setReplacements($this->backupReplacements);
110
+ $dump->start($this->backupFilePath);
111
+ }
112
+
113
+ public function prepareQueryToExec($query)
114
+ {
115
+ return processReplacements($query, $this->restoreReplacements);
116
+ }
117
+
118
+ private function import()
119
+ {
120
+ $fileHandle = @fopen($this->backupFilePath, 'r');
121
+ if (!is_resource($fileHandle))
122
+ {
123
+ throw new SGExceptionForbidden('Could not open file: '.$this->backupFilePath);
124
+ }
125
+ $importQuery = '';
126
+ while (($row = @fgets($fileHandle)) !== false)
127
+ {
128
+ $importQuery .= $row;
129
+ $trimmedRow = trim($row);
130
+
131
+ if (strpos($trimmedRow, 'CREATE TABLE') !== false)
132
+ {
133
+ $strLength = strlen($trimmedRow);
134
+ $strCtLength = strlen('CREATE TABLE ');
135
+ $length = $strLength - $strCtLength - 2;
136
+ $tableName = substr($trimmedRow, $strCtLength, $length);
137
+ $tableName = str_replace(SG_DB_PREFIX_REPLACEMENT, SG_ENV_DB_PREFIX, $tableName);
138
+ SGBackupLog::write('Importing table: '.$tableName);
139
+ }
140
+
141
+ if($trimmedRow && substr($trimmedRow, -9) == "/*SGEnd*/")
142
+ {
143
+ $importQuery = $this->prepareQueryToExec($importQuery);
144
+ $importQuery = str_replace("/*SGEnd*/", "", $importQuery);
145
+ $res = $this->sgdb->exec($importQuery);
146
+ if ($res===false)
147
+ {
148
+ throw new SGExceptionDatabaseError('Could not execute query: '.$importQuery);
149
+ }
150
+ $importQuery = '';
151
+ }
152
+ $this->currentRowCount++;
153
+ SGPing::update();
154
+ $this->updateProgress();
155
+ }
156
+ @fclose($fileHandle);
157
+ }
158
+
159
+ public function didExportRow()
160
+ {
161
+ $this->currentRowCount++;
162
+ SGPing::update();
163
+
164
+ if ($this->updateProgress())
165
+ {
166
+ if ($this->delegate && $this->delegate->isCancelled())
167
+ {
168
+ $this->cancelled = true;
169
+ return;
170
+ }
171
+ }
172
+
173
+ if (SGBoot::isFeatureAvailable('BACKGROUND_MODE') && $this->delegate->isBackgroundMode())
174
+ {
175
+ SGBackgroundMode::next();
176
+ }
177
+ }
178
+
179
+ public function cancel()
180
+ {
181
+ $pathinfo = pathinfo($this->backupFilePath);
182
+ $dir = SG_BACKUP_DIRECTORY.$pathinfo['filename'];
183
+ if ($dir != SG_BACKUP_DIRECTORY) {
184
+ deleteDirectory($dir);
185
+ }
186
+ }
187
+
188
+ private function resetBackupProgress()
189
+ {
190
+ $this->totalRowCount = 0;
191
+ $this->currentRowCount = 0;
192
+ $tableNames = $this->getTables();
193
+ foreach ($tableNames as $table)
194
+ {
195
+ $this->totalRowCount += $this->getTableRowsCount($table);
196
+ }
197
+ $this->nextProgressUpdate = $this->progressUpdateInterval;
198
+ SGBackupLog::write('Total tables to backup: '.count($tableNames));
199
+ SGBackupLog::write('Total rows to backup: '.$this->totalRowCount);
200
+ }
201
+
202
+ private function resetRestoreProgress()
203
+ {
204
+ $this->totalRowCount = $this->getFileLinesCount($this->backupFilePath);
205
+ $this->currentRowCount = 0;
206
+ $this->progressUpdateInterval = SGConfig::get('SG_ACTION_PROGRESS_UPDATE_INTERVAL');
207
+ $this->nextProgressUpdate = $this->progressUpdateInterval;
208
+ }
209
+
210
+ private function getTables()
211
+ {
212
+ $tableNames = array();
213
+ $tables = $this->sgdb->query('SHOW TABLES FROM `'.SG_DB_NAME.'`');
214
+ if (!$tables)
215
+ {
216
+ throw new SGExceptionDatabaseError('Could not get tables of database: '.SG_DB_NAME);
217
+ }
218
+ foreach ($tables as $table)
219
+ {
220
+ $tableName = $table['Tables_in_'.SG_DB_NAME];
221
+ $tablesToExclude = explode(',', SGConfig::get('SG_BACKUP_DATABASE_EXCLUDE'));
222
+ if (in_array($tableName, $tablesToExclude))
223
+ {
224
+ continue;
225
+ }
226
+ $tableNames[] = $tableName;
227
+ }
228
+ return $tableNames;
229
+ }
230
+
231
+ private function getTableRowsCount($tableName)
232
+ {
233
+ $count = 0;
234
+ $tableRowsNum = $this->sgdb->query('SELECT COUNT(*) AS total FROM '.$tableName);
235
+ $count = @$tableRowsNum[0]['total'];
236
+ return $count;
237
+ }
238
+
239
+ private function getFileLinesCount($filePath)
240
+ {
241
+ $fileHandle = @fopen($filePath, 'rb');
242
+ if (!is_resource($fileHandle))
243
+ {
244
+ throw new SGExceptionForbidden('Could not open file: '.$filePath);
245
+ }
246
+
247
+ $linecount = 0;
248
+ while (!feof($fileHandle))
249
+ {
250
+ $linecount += substr_count(fread($fileHandle, 8192), "\n");
251
+ }
252
+
253
+ @fclose($fileHandle);
254
+ return $linecount;
255
+ }
256
+
257
+ private function updateProgress()
258
+ {
259
+ $progress = round($this->currentRowCount*100.0/$this->totalRowCount);
260
+
261
+ if ($progress>=$this->nextProgressUpdate)
262
+ {
263
+ $this->nextProgressUpdate += $this->progressUpdateInterval;
264
+
265
+ if ($this->delegate)
266
+ {
267
+ $this->delegate->didUpdateProgress($progress);
268
+ }
269
+
270
+ return true;
271
+ }
272
+
273
+ return false;
274
+ }
275
+
276
+ /* Helper Functions */
277
+
278
+ private function isWritable($filePath)
279
+ {
280
+ if (!file_exists($filePath))
281
+ {
282
+ $fp = @fopen($filePath, 'wb');
283
+ if (!$fp)
284
+ {
285
+ throw new SGExceptionForbidden('Could not open file: '.$filePath);
286
+ }
287
+ @fclose($fp);
288
+ }
289
+ return is_writable($filePath);
290
+ }
291
  }
app/code/community/BackupGuard/BackupGuardFree/com/core/backup/SGBackupFiles.php CHANGED
@@ -41,22 +41,19 @@ class SGBackupFiles implements SGArchiveDelegate
41
  return $this->warningsFound;
42
  }
43
 
44
- public function backup($filePath)
45
  {
46
  SGBackupLog::writeAction('backup files', SG_BACKUP_LOG_POS_START);
47
 
48
- $excludeFilePaths = SGConfig::get('SG_BACKUP_FILE_PATHS_EXCLUDE');
49
- if (!$excludeFilePaths)
50
- {
51
- $this->excludeFilePaths = array();
52
  }
53
- else
54
- {
55
- $this->excludeFilePaths = explode(',', $excludeFilePaths);
56
  }
57
 
58
  $this->filePath = $filePath;
59
- $backupItems = SGConfig::get('SG_BACKUP_FILE_PATHS');
60
  $allItems = explode(',', $backupItems);
61
 
62
  $this->sgbp = new SGArchive($filePath, 'w');
@@ -241,7 +238,12 @@ class SGBackupFiles implements SGArchiveDelegate
241
 
242
  public function cancel()
243
  {
244
- @unlink($this->filePath);
 
 
 
 
 
245
  }
246
 
247
  private function addFileToArchive($path)
41
  return $this->warningsFound;
42
  }
43
 
44
+ public function backup($filePath, $options)
45
  {
46
  SGBackupLog::writeAction('backup files', SG_BACKUP_LOG_POS_START);
47
 
48
+ if (strlen($options['SG_BACKUP_FILE_PATHS_EXCLUDE'])) {
49
+ $this->excludeFilePaths = explode(',', $options['SG_BACKUP_FILE_PATHS_EXCLUDE']);
 
 
50
  }
51
+ else{
52
+ $this->excludeFilePaths = array();
 
53
  }
54
 
55
  $this->filePath = $filePath;
56
+ $backupItems = $options['SG_BACKUP_FILE_PATHS'];
57
  $allItems = explode(',', $backupItems);
58
 
59
  $this->sgbp = new SGArchive($filePath, 'w');
238
 
239
  public function cancel()
240
  {
241
+ $pathinfo = pathinfo($this->filePath);
242
+ $dir = SG_BACKUP_DIRECTORY.$pathinfo['filename'];
243
+
244
+ if ($dir != SG_BACKUP_DIRECTORY) {
245
+ deleteDirectory($dir);
246
+ }
247
  }
248
 
249
  private function addFileToArchive($path)
app/code/community/BackupGuard/BackupGuardFree/com/core/database/.DS_Store DELETED
Binary file
app/code/community/BackupGuard/BackupGuardFree/com/core/database/SGDatabaseAdapterMagento.php CHANGED
@@ -61,4 +61,4 @@ class SGDatabaseAdapterMagento implements SGIDatabaseAdapter
61
  {
62
  print_r($this->link->errorInfo());
63
  }
64
- }
61
  {
62
  print_r($this->link->errorInfo());
63
  }
64
+ }
app/code/community/BackupGuard/BackupGuardFree/com/core/exception/.DS_Store DELETED
Binary file
app/code/community/BackupGuard/BackupGuardFree/com/core/functions.php CHANGED
@@ -1,4 +1,67 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  function realFilesize($filename)
3
  {
4
  $fp = fopen($filename, 'r');
@@ -139,7 +202,19 @@ function downloadFileSymlink($safedir, $filename)
139
  closedir($handle);
140
 
141
  mkdir($downloaddir . $string, 0777);
142
- symlink($safedir . $filename, $downloaddir . $string . "/" . $filename);
143
- header("Location: " . $downloadURL . $string . "/" . $filename);
 
 
 
 
 
 
 
 
 
 
 
 
144
  exit;
145
  }
1
  <?php
2
+
3
+ function backupGuardOutdatedBackupsCleanup($path)
4
+ {
5
+ if (SGBoot::isFeatureAvailable('NUMBER_OF_BACKUPS_TO_KEEP')) {
6
+ $amountOfBackupsToKeep = SGConfig::get('SG_AMOUNT_OF_BACKUPS_TO_KEEP')?SGConfig::get('SG_AMOUNT_OF_BACKUPS_TO_KEEP'):SG_NUMBER_OF_BACKUPS_TO_KEEP;
7
+ $backups = backupGuardScanBackupsDirectory($path);
8
+ while (count($backups) > $amountOfBackupsToKeep) {
9
+ $backup = key($backups);
10
+ array_shift($backups);
11
+ deleteDirectory($path.$backup);
12
+ }
13
+ }
14
+ }
15
+
16
+ function backupGuardScanBackupsDirectory($path)
17
+ {
18
+ $backups = scandir($path);
19
+ $backupFolders = array();
20
+ foreach ($backups as $key => $backup) {
21
+ if ($backup == "." || $backup == "..") {
22
+ continue;
23
+ }
24
+
25
+ if (is_dir($path.$backup)) {
26
+ $backupFolders[$backup] = filemtime($path.$backup);
27
+ }
28
+ }
29
+ // Sort(from low to high) backups by creation date
30
+ asort($backupFolders);
31
+ return $backupFolders;
32
+ }
33
+
34
+ function backupGuardSymlinksCleanup($dir)
35
+ {
36
+ if (is_dir($dir)) {
37
+ $objects = scandir($dir);
38
+ foreach ($objects as $object) {
39
+ if ($object == "." || $object == "..") {
40
+ continue;
41
+ }
42
+
43
+ if (filetype($dir.$object) != "dir") {
44
+ @unlink($dir.$object);
45
+ }
46
+ else {
47
+ backupGuardSymlinksCleanup($dir.$object.'/');
48
+ @rmdir($dir.$object);
49
+ }
50
+ }
51
+ }
52
+ else {
53
+ @unlink($dir);
54
+ }
55
+ return;
56
+ }
57
+
58
+ function processReplacements($str, $replacements)
59
+ {
60
+ foreach ($replacements as $find => $replace) {
61
+ return str_replace($find, $replace, $str);
62
+ }
63
+ }
64
+
65
  function realFilesize($filename)
66
  {
67
  $fp = fopen($filename, 'r');
202
  closedir($handle);
203
 
204
  mkdir($downloaddir . $string, 0777);
205
+ $res = @symlink($safedir . $filename, $downloaddir . $string . "/" . $filename);
206
+ if ($res) {
207
+ header('Content-Type: application/octet-stream');
208
+ header('Content-Disposition: attachment;filename='.$filename);
209
+ header("Location: " . $downloadURL . $string . "/" . $filename);
210
+ }
211
+ else{
212
+ if(SG_ENV_ADAPTER == SG_ENV_WORDPRESS) {
213
+ wp_die('Symlink / shortcut creation failed! Seems your server configurations don’t allow symlink creation, so we’re unable to provide you the direct download url. You can download your backup using any FTP client. All backups and related stuff we locate “/wp-content/uploads/backup-guard” directory. If you need this functionality, you should check out your server configurations and make sure you don’t have any limitation related to symlink creation.');
214
+ }
215
+ elseif (SG_ENV_ADAPTER == SG_ENV_MAGENTO) {
216
+ die('Symlink / shortcut creation failed! Seems your server configurations don’t allow symlink creation, so we’re unable to provide you the direct download url. You can download your backup using any FTP client. All backups and related stuff we locate “/wp-content/uploads/backup-guard” directory. If you need this functionality, you should check out your server configurations and make sure you don’t have any limitation related to symlink creation.');
217
+ }
218
+ }
219
  exit;
220
  }
app/code/community/BackupGuard/BackupGuardFree/com/core/log/.DS_Store DELETED
Binary file
app/code/community/BackupGuard/BackupGuardFree/com/lib/SGMysqldump.php CHANGED
@@ -110,6 +110,11 @@ class SGMysqldump
110
  $this->delegate = $delegate;
111
  }
112
 
 
 
 
 
 
113
  /**
114
  * Custom array_replace_recursive to be used if PHP < 5.3
115
  * Replaces elements from passed arrays into the first array recursively
@@ -498,7 +503,9 @@ class SGMysqldump
498
  } elseif ($columnTypes[$colName]['is_numeric']) {
499
  $ret[] = $colValue;
500
  } else {
501
- $ret[] = "'".str_replace("'", "''", $colValue)."'";
 
 
502
  }
503
  }
504
  return $ret;
@@ -710,6 +717,7 @@ abstract class CompressMethod
710
 
711
  abstract class CompressManagerFactory
712
  {
 
713
  /**
714
  * @param string $c
715
  * @return CompressBzip2|CompressGzip|CompressNone
@@ -725,6 +733,19 @@ abstract class CompressManagerFactory
725
 
726
  return new $method;
727
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
728
  }
729
 
730
  class CompressBzip2 extends CompressManagerFactory
@@ -750,6 +771,8 @@ class CompressBzip2 extends CompressManagerFactory
750
 
751
  public function write($str)
752
  {
 
 
753
  if (false === ($bytesWritten = bzwrite($this->fileHandler, $str))) {
754
  throw new Exception("Writting to file failed! Probably, there is no more free space left?");
755
  }
@@ -785,6 +808,7 @@ class CompressGzip extends CompressManagerFactory
785
 
786
  public function write($str)
787
  {
 
788
  if (false === ($bytesWritten = gzwrite($this->fileHandler, $str))) {
789
  throw new Exception("Writting to file failed! Probably, there is no more free space left?");
790
  }
@@ -813,6 +837,7 @@ class CompressNone extends CompressManagerFactory
813
 
814
  public function write($str)
815
  {
 
816
  if (false === ($bytesWritten = fwrite($this->fileHandler, $str))) {
817
  throw new Exception("Writting to file failed! Probably, there is no more free space left?");
818
  }
110
  $this->delegate = $delegate;
111
  }
112
 
113
+ public function setReplacements($replacements)
114
+ {
115
+ $this->compressManager->setReplacements($replacements);
116
+ }
117
+
118
  /**
119
  * Custom array_replace_recursive to be used if PHP < 5.3
120
  * Replaces elements from passed arrays into the first array recursively
503
  } elseif ($columnTypes[$colName]['is_numeric']) {
504
  $ret[] = $colValue;
505
  } else {
506
+ $str = "'".str_replace("'", "''", $colValue)."'";
507
+ $str = str_replace("\\", "\\\\", $str);
508
+ $ret[] = $str;
509
  }
510
  }
511
  return $ret;
717
 
718
  abstract class CompressManagerFactory
719
  {
720
+ private static $replacements = array();
721
  /**
722
  * @param string $c
723
  * @return CompressBzip2|CompressGzip|CompressNone
733
 
734
  return new $method;
735
  }
736
+
737
+ public function setReplacements($replacements)
738
+ {
739
+ //Make sure param is valid assoc array
740
+ if (is_array($replacements)) {
741
+ self::$replacements = $replacements;
742
+ }
743
+ }
744
+
745
+ public static function prepareToWrite($str)
746
+ {
747
+ return processReplacements($str, self::$replacements);
748
+ }
749
  }
750
 
751
  class CompressBzip2 extends CompressManagerFactory
771
 
772
  public function write($str)
773
  {
774
+ //$str = self::prepareToWrite($str);
775
+
776
  if (false === ($bytesWritten = bzwrite($this->fileHandler, $str))) {
777
  throw new Exception("Writting to file failed! Probably, there is no more free space left?");
778
  }
808
 
809
  public function write($str)
810
  {
811
+ $str = self::prepareToWrite($str);
812
  if (false === ($bytesWritten = gzwrite($this->fileHandler, $str))) {
813
  throw new Exception("Writting to file failed! Probably, there is no more free space left?");
814
  }
837
 
838
  public function write($str)
839
  {
840
+ $str = self::prepareToWrite($str);
841
  if (false === ($bytesWritten = fwrite($this->fileHandler, $str))) {
842
  throw new Exception("Writting to file failed! Probably, there is no more free space left?");
843
  }
app/code/community/BackupGuard/BackupGuardFree/controllers/Adminhtml/BackupguardfreeController.php CHANGED
@@ -17,9 +17,27 @@ class BackupGuard_BackupGuardFree_Adminhtml_BackupguardfreeController extends Ma
17
  $this->renderLayout();
18
  }
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  public function ajaxAction()
21
  {
22
  $params = $this->getRequest()->getParams();
23
  include(SG_PUBLIC_AJAX_PATH.$params['action'].'.php');
24
  }
25
- }
17
  $this->renderLayout();
18
  }
19
 
20
+ public function settingsAction()
21
+ {
22
+ $this->_initAction();
23
+ $this->renderLayout();
24
+ }
25
+
26
+ public function supportAction()
27
+ {
28
+ $this->_initAction();
29
+ $this->renderLayout();
30
+ }
31
+
32
+ public function whyupgradeAction()
33
+ {
34
+ $this->_initAction();
35
+ $this->renderLayout();
36
+ }
37
+
38
  public function ajaxAction()
39
  {
40
  $params = $this->getRequest()->getParams();
41
  include(SG_PUBLIC_AJAX_PATH.$params['action'].'.php');
42
  }
43
+ }
app/code/community/BackupGuard/BackupGuardFree/etc/adminhtml.xml CHANGED
@@ -11,6 +11,21 @@
11
  <action>adminhtml/backupguardfree/backups</action>
12
  <sort_order>0</sort_order>
13
  </backups>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  </children>
15
  </backupguardfree>
16
  </menu>
11
  <action>adminhtml/backupguardfree/backups</action>
12
  <sort_order>0</sort_order>
13
  </backups>
14
+ <settings module="backupguardfree">
15
+ <title>Settings</title>
16
+ <action>adminhtml/backupguardfree/settings</action>
17
+ <sort_order>1</sort_order>
18
+ </settings>
19
+ <support module="backupguardfree">
20
+ <title>Support</title>
21
+ <action>adminhtml/backupguardfree/support</action>
22
+ <sort_order>2</sort_order>
23
+ </support>
24
+ <whyupgrade module="backupguardfree">
25
+ <title>Why upgrade?</title>
26
+ <action>adminhtml/backupguardfree/whyupgrade</action>
27
+ <sort_order>3</sort_order>
28
+ </whyupgrade>
29
  </children>
30
  </backupguardfree>
31
  </menu>
app/code/community/BackupGuard/BackupGuardFree/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <BackupGuard_BackupGuardFree>
5
- <version>1.0.0</version>
6
  </BackupGuard_BackupGuardFree>
7
  </modules>
8
  <admin>
@@ -55,4 +55,4 @@
55
  </backupguardfree>
56
  </helpers>
57
  </global>
58
- </config>
2
  <config>
3
  <modules>
4
  <BackupGuard_BackupGuardFree>
5
+ <version>1.0.6</version>
6
  </BackupGuard_BackupGuardFree>
7
  </modules>
8
  <admin>
55
  </backupguardfree>
56
  </helpers>
57
  </global>
58
+ </config>
app/code/community/BackupGuard/BackupGuardFree/sql/.DS_Store DELETED
Binary file
app/code/community/BackupGuard/BackupGuardFree/sql/backupguardfree_setup/mysql4-install-1.0.0.php CHANGED
@@ -1,33 +1,39 @@
1
  <?php
2
  require_once(dirname(__FILE__).'/../../com/config/config.magento.php');
 
3
 
4
  $installer = $this;
5
 
6
  $installer->startSetup();
7
 
8
- $installer->run("DROP TABLE IF EXISTS `".SG_CONFIG_TABLE_NAME."`;
9
- CREATE TABLE `".SG_CONFIG_TABLE_NAME."` (
10
- `ckey` varchar(255) NOT NULL,
11
- `cvalue` varchar(255) NOT NULL,
12
- PRIMARY KEY (`ckey`)
13
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
14
- INSERT INTO `".SG_CONFIG_TABLE_NAME."` VALUES
15
- ('SG_BACKUP_SYNCHRONOUS_STORAGE_UPLOAD','1'),
16
- ('SG_NOTIFICATIONS_ENABLED','0'),
17
- ('SG_NOTIFICATIONS_EMAIL_ADDRESS',''),
18
- ('SG_STORAGE_BACKUPS_FOLDER_NAME','sg_backups');
19
 
20
- DROP TABLE IF EXISTS `".SG_ACTION_TABLE_NAME."`;
21
- CREATE TABLE `".SG_ACTION_TABLE_NAME."` (
22
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
23
- `name` varchar(255) NOT NULL,
24
- `type` tinyint(3) unsigned NOT NULL,
25
- `subtype` tinyint(3) unsigned NOT NULL DEFAULT '0',
26
- `status` tinyint(3) unsigned NOT NULL,
27
- `progress` tinyint(3) unsigned NOT NULL DEFAULT '0',
28
- `start_date` datetime NOT NULL,
29
- `update_date` datetime DEFAULT NULL,
30
- PRIMARY KEY (`id`)
31
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
32
 
33
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  require_once(dirname(__FILE__).'/../../com/config/config.magento.php');
3
+ require_once(dirname(__FILE__).'/../../com/config/config.magento.free.php');
4
 
5
  $installer = $this;
6
 
7
  $installer->startSetup();
8
 
9
+ $installer->run(
10
+ "DROP TABLE IF EXISTS `".SG_CONFIG_TABLE_NAME."`;
11
+ CREATE TABLE `".SG_CONFIG_TABLE_NAME."` (
12
+ `ckey` varchar(255) NOT NULL,
13
+ `cvalue` text NOT NULL,
14
+ PRIMARY KEY (`ckey`)
15
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 
 
 
16
 
17
+ INSERT INTO `".SG_CONFIG_TABLE_NAME."` VALUES
18
+ ('SG_BACKUP_GUARD_VERSION','".SG_BACKUP_GUARD_VERSION."'),
19
+ ('SG_BACKUP_SYNCHRONOUS_STORAGE_UPLOAD','1'),
20
+ ('SG_NOTIFICATIONS_ENABLED','0'),
21
+ ('SG_NOTIFICATIONS_EMAIL_ADDRESS',''),
22
+ ('SG_STORAGE_BACKUPS_FOLDER_NAME','sg_backups');
 
 
 
 
 
 
23
 
24
+ DROP TABLE IF EXISTS `".SG_ACTION_TABLE_NAME."`;
25
+ CREATE TABLE `".SG_ACTION_TABLE_NAME."` (
26
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
27
+ `name` varchar(255) NOT NULL,
28
+ `type` tinyint(3) unsigned NOT NULL,
29
+ `subtype` tinyint(3) unsigned NOT NULL DEFAULT '0',
30
+ `status` tinyint(3) unsigned NOT NULL,
31
+ `progress` tinyint(3) unsigned NOT NULL DEFAULT '0',
32
+ `start_date` datetime NOT NULL,
33
+ `update_date` datetime DEFAULT NULL,
34
+ `options` text NOT NULL,
35
+ PRIMARY KEY (`id`)
36
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
37
+ );
38
+
39
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/backupguardfree.xml CHANGED
@@ -22,4 +22,62 @@
22
  </action>
23
  </reference>
24
  </adminhtml_backupguardfree_backups>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  </layout>
22
  </action>
23
  </reference>
24
  </adminhtml_backupguardfree_backups>
25
+ <adminhtml_backupguardfree_settings>
26
+ <reference name="content">
27
+ <block type="core/template" name="header" template="backupguardfree/header.phtml" />
28
+ <block type="core/template" name="sidebar" template="backupguardfree/sidebar.phtml" />
29
+ <block type="core/template" name="backups" template="backupguardfree/settings.phtml" />
30
+ <block type="core/template" name="modal" template="backupguardfree/modal.phtml" />
31
+ <block type="core/template" name="footer" template="backupguardfree/footer.phtml" />
32
+ <block type="core/template" name="footer_schedule" template="backupguardfree/footer.settings.phtml" />
33
+ </reference>
34
+ <reference name="head">
35
+ <action method="addItem">
36
+ <type>skin_css</type>
37
+ <name>css/BackupGuardFree/bgstyle.less.css</name>
38
+ </action>
39
+ <action method="addItem">
40
+ <type>skin_css</type>
41
+ <name>css/BackupGuardFree/spinner.css</name>
42
+ </action>
43
+ </reference>
44
+ </adminhtml_backupguardfree_settings>
45
+ <adminhtml_backupguardfree_support>
46
+ <reference name="content">
47
+ <block type="core/template" name="header" template="backupguardfree/header.phtml" />
48
+ <block type="core/template" name="sidebar" template="backupguardfree/sidebar.phtml" />
49
+ <block type="core/template" name="backups" template="backupguardfree/support.phtml" />
50
+ <block type="core/template" name="modal" template="backupguardfree/modal.phtml" />
51
+ <block type="core/template" name="footer" template="backupguardfree/footer.phtml" />
52
+ </reference>
53
+ <reference name="head">
54
+ <action method="addItem">
55
+ <type>skin_css</type>
56
+ <name>css/BackupGuardFree/bgstyle.less.css</name>
57
+ </action>
58
+ <action method="addItem">
59
+ <type>skin_css</type>
60
+ <name>css/BackupGuardFree/spinner.css</name>
61
+ </action>
62
+ </reference>
63
+ </adminhtml_backupguardfree_support>
64
+ <adminhtml_backupguardfree_whyupgrade>
65
+ <reference name="content">
66
+ <block type="core/template" name="header" template="backupguardfree/header.phtml" />
67
+ <block type="core/template" name="sidebar" template="backupguardfree/sidebar.phtml" />
68
+ <block type="core/template" name="backups" template="backupguardfree/whyupgrade.phtml" />
69
+ <block type="core/template" name="modal" template="backupguardfree/modal.phtml" />
70
+ <block type="core/template" name="footer" template="backupguardfree/footer.phtml" />
71
+ </reference>
72
+ <reference name="head">
73
+ <action method="addItem">
74
+ <type>skin_css</type>
75
+ <name>css/BackupGuardFree/bgstyle.less.css</name>
76
+ </action>
77
+ <action method="addItem">
78
+ <type>skin_css</type>
79
+ <name>css/BackupGuardFree/spinner.css</name>
80
+ </action>
81
+ </reference>
82
+ </adminhtml_backupguardfree_whyupgrade>
83
  </layout>
app/design/adminhtml/default/default/template/backupguardfree/backups.phtml CHANGED
@@ -12,8 +12,9 @@
12
  <table class="table table-striped paginated sg-backup-table">
13
  <thead>
14
  <tr>
 
15
  <th><?php _t('Filename')?></th>
16
- <th><?php _t('size')?></th>
17
  <th><?php _t('Date')?></th>
18
  <th><?php _t('Status')?></th>
19
  <th><?php _t('Actions')?></th>
@@ -22,49 +23,42 @@
22
  <tbody>
23
  <?php if(empty($backups)):?>
24
  <tr>
25
- <td colspan="5"><?php _t('No backups found.')?></td>
26
  </tr>
27
  <?php endif;?>
28
  <?php foreach($backups as $backup): ?>
29
  <tr>
 
30
  <td><?php echo $backup['name'] ?></td>
31
- <td><?php echo $backup['size'] ?></td>
32
  <td><?php echo $backup['date'] ?></td>
33
- <td id="sg-status-tabe-data" <?php echo $backup['active']?'data-toggle="tooltip" data-placement="top" data-original-title="" data-container="#sg-wrapper"':''?>>
34
- <?php if($backup['active']):
35
- $activeOptions = json_decode(SGConfig::get('SG_ACTIVE_BACKUP_OPTIONS'), true);
36
- $filteredStatuses = filterStatusesByActionType($backup, $activeOptions);
37
- ?>
38
- <input type="hidden" id="sg-active-action-id" value="<?php echo $backup['id']; ?>"/>
39
- <?php foreach ($filteredStatuses as $statusCode): ?>
40
- <span class="btn-xs sg-status-icon sg-status-<?php echo $statusCode; ?>">&nbsp;</span>
41
- <?php endforeach; ?>
42
- <div class="progress sg-progress">
43
- <div class="progress-bar progress-bar-danger"></div>
44
- </div>
45
- <?php else: ?>
46
- <?php if ($backup['status'] == SG_ACTION_STATUS_FINISHED_WARNINGS): ?>
47
- <span class="glyphicon glyphicon-warning-sign btn-xs text-warning" data-toggle="tooltip" data-placement="top" data-original-title="<?php
48
- if($backup['type']==SG_ACTION_TYPE_BACKUP): echo _t('Warnings found during backup',true);
49
- elseif($backup['type']==SG_ACTION_TYPE_RESTORE): echo _t('Warnings found during restore',true);
50
- else: echo _t('Warnings found during upload',true);
51
- endif;
52
- ?>" data-container="#sg-wrapper"></span>
53
- <?php elseif ($backup['status'] == SG_ACTION_STATUS_ERROR): ?>
54
- <span class="glyphicon glyphicon-warning-sign btn-xs text-danger" data-toggle="tooltip" data-placement="top" data-original-title="<?php
55
- if($backup['type']==SG_ACTION_TYPE_BACKUP): echo _t('Errors found during backup',true);
56
- elseif($backup['type']==SG_ACTION_TYPE_RESTORE): echo _t('Errors found during restore',true);
57
- else: echo _t('Errors found during upload',true);
58
- endif;
59
- ?>" data-container="#sg-wrapper"></span>
60
  <?php else: ?>
61
- <span class="glyphicon glyphicon-ok btn-xs text-success"></span>
62
- <?php endif;?>
63
- <?php endif; ?>
 
 
 
 
 
 
64
  </td>
65
  <td>
66
  <?php if($backup['active']): ?>
67
- <a class="btn btn-danger btn-xs sg-cancel-backup" href="javascript:void(0)" title="<?php _t('Stop')?>">&nbsp;<i class="glyphicon glyphicon-stop" aria-hidden="true"></i>&nbsp;</a>
 
 
68
  <?php else: ?>
69
  <a href="javascript:void(0)" data-sgbackup-name="<?php echo $backup['name'];?>" data-remote="deleteBackup" class="btn btn-danger btn-xs sg-remove-backup" title="<?php _t('Delete')?>">&nbsp;<i class="glyphicon glyphicon-remove" aria-hidden="true"></i>&nbsp;</a>
70
  <div class="btn-group">
@@ -107,6 +101,9 @@
107
  <?php endforeach; ?>
108
  </tbody>
109
  </table>
 
 
 
110
  <div class="text-right">
111
  <ul class="pagination"></ul>
112
  </div>
12
  <table class="table table-striped paginated sg-backup-table">
13
  <thead>
14
  <tr>
15
+ <th><input type="checkbox" id="sg-checkbox-select-all" autocomplete="off"></th>
16
  <th><?php _t('Filename')?></th>
17
+ <th><?php _t('Size')?></th>
18
  <th><?php _t('Date')?></th>
19
  <th><?php _t('Status')?></th>
20
  <th><?php _t('Actions')?></th>
23
  <tbody>
24
  <?php if(empty($backups)):?>
25
  <tr>
26
+ <td colspan="6"><?php _t('No backups found.')?></td>
27
  </tr>
28
  <?php endif;?>
29
  <?php foreach($backups as $backup): ?>
30
  <tr>
31
+ <td> <input type="checkbox" autocomplete="off" value="<?php echo $backup['name']?>" <?php echo $backup['active']?'disabled':''?>> </td>
32
  <td><?php echo $backup['name'] ?></td>
33
+ <td><?php echo !$backup['active']?$backup['size']:'' ?></td>
34
  <td><?php echo $backup['date'] ?></td>
35
+ <td id="sg-status-tabe-data-<?php echo $backup['id']?>" <?php echo $backup['active']?'data-toggle="tooltip" data-placement="top" data-original-title="" data-container="#sg-wrapper"':''?>>
36
+ <?php if($backup['active']):
37
+ $filteredStatuses = filterStatusesByActionType($backup, $backup['options']);
38
+ ?>
39
+ <input type="hidden" class="sg-active-action-id" value="<?php echo $backup['id'];?>"/>
40
+ <?php foreach ($filteredStatuses as $statusCode): ?>
41
+ <span class="btn-xs sg-status-icon sg-status-<?php echo $statusCode; ?>">&nbsp;</span>
42
+ <?php endforeach; ?>
43
+ <div class="sg-progress progress">
44
+ <div class="progress-bar progress-bar-danger"></div>
45
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  <?php else: ?>
47
+ <?php if ($backup['status'] == SG_ACTION_STATUS_FINISHED_WARNINGS): ?>
48
+ <span class="glyphicon glyphicon-warning-sign btn-xs text-warning" data-toggle="tooltip" data-placement="top" data-original-title="<?php if($backup['type']==SG_ACTION_TYPE_BACKUP): echo _t('Warnings found during backup',true); elseif($backup['type']==SG_ACTION_TYPE_RESTORE): echo _t('Warnings found during restore',true); else: echo _t('Warnings found during upload',true); endif; ?>" data-container="#sg-wrapper"></span>
49
+ <?php elseif ($backup['status'] == SG_ACTION_STATUS_ERROR): ?>
50
+ <span class="glyphicon glyphicon-warning-sign btn-xs text-danger" data-toggle="tooltip" data-placement="top" data-original-title="<?php if($backup['type']==SG_ACTION_TYPE_BACKUP): echo _t('Errors found during backup',true); elseif($backup['type']==SG_ACTION_TYPE_RESTORE): echo _t('Errors found during restore',true); else: echo _t('Errors found during upload',true);
51
+ endif; ?>" data-container="#sg-wrapper"></span>
52
+ <?php else: ?>
53
+ <span class="glyphicon glyphicon-ok btn-xs text-success"></span>
54
+ <?php endif;?>
55
+ <?php endif; ?>
56
  </td>
57
  <td>
58
  <?php if($backup['active']): ?>
59
+ <?php if($backup['type'] != SG_ACTION_TYPE_RESTORE): ?>
60
+ <a class="btn btn-danger btn-xs sg-cancel-backup" sg-data-backup-id="<?php echo $backup['id']?>" href="javascript:void(0)" title="<?php _t('Stop')?>">&nbsp;<i class="glyphicon glyphicon-stop" aria-hidden="true"></i>&nbsp;</a>
61
+ <?php endif; ?>
62
  <?php else: ?>
63
  <a href="javascript:void(0)" data-sgbackup-name="<?php echo $backup['name'];?>" data-remote="deleteBackup" class="btn btn-danger btn-xs sg-remove-backup" title="<?php _t('Delete')?>">&nbsp;<i class="glyphicon glyphicon-remove" aria-hidden="true"></i>&nbsp;</a>
64
  <div class="btn-group">
101
  <?php endforeach; ?>
102
  </tbody>
103
  </table>
104
+
105
+ <button id="sg-delete-multi-backups" class="pull-left btn btn-danger"><?php _t('Delete')?></button>
106
+
107
  <div class="text-right">
108
  <ul class="pagination"></ul>
109
  </div>
app/design/adminhtml/default/default/template/backupguardfree/footer.phtml CHANGED
@@ -8,7 +8,7 @@ SG_AJAX_URL = '<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/backupgua
8
  function getAjaxUrl(url) {
9
  if (typeof url != 'undefined') return SG_AJAX_URL+'action/'+url;
10
  return SG_AJAX_URL;
11
- }
12
  function getFormKey() {
13
  return '<?php echo Mage::getSingleton("core/session")->getFormKey(); ?>';
14
  }
@@ -31,9 +31,9 @@ function getFormKey() {
31
  var isBootstrapEvent = false;
32
  if (window.jQuery) {
33
  var all = jQuery('*');
34
- jQuery.each(['hide.bs.dropdown',
35
- 'hide.bs.collapse',
36
- 'hide.bs.modal',
37
  'hide.bs.tooltip',
38
  'hide.bs.popover'], function(index, eventName) {
39
  all.on(eventName, function( event ) {
@@ -52,4 +52,4 @@ function getFormKey() {
52
  }
53
  });
54
  })();
55
- </script>
8
  function getAjaxUrl(url) {
9
  if (typeof url != 'undefined') return SG_AJAX_URL+'action/'+url;
10
  return SG_AJAX_URL;
11
+ }
12
  function getFormKey() {
13
  return '<?php echo Mage::getSingleton("core/session")->getFormKey(); ?>';
14
  }
31
  var isBootstrapEvent = false;
32
  if (window.jQuery) {
33
  var all = jQuery('*');
34
+ jQuery.each(['hide.bs.dropdown',
35
+ 'hide.bs.collapse',
36
+ 'hide.bs.modal',
37
  'hide.bs.tooltip',
38
  'hide.bs.popover'], function(index, eventName) {
39
  all.on(eventName, function( event ) {
52
  }
53
  });
54
  })();
55
+ </script>
app/design/adminhtml/default/default/template/backupguardfree/footer.settings.phtml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/BackupGuardFree/sgsettings.js') ?>"></script>
2
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('js/BackupGuardFree/bootstrap-switch.min.js') ?>"></script>
app/design/adminhtml/default/default/template/backupguardfree/header.phtml CHANGED
@@ -5,4 +5,4 @@
5
  ?>
6
  <div class="sg-spinner"></div>
7
  <div class="sg-wrapper-less">
8
- <div id="sg-wrapper" style="display: none;">
5
  ?>
6
  <div class="sg-spinner"></div>
7
  <div class="sg-wrapper-less">
8
+ <div id="sg-wrapper">
app/design/adminhtml/default/default/template/backupguardfree/settings.phtml ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $isNotificationEnabled = SGConfig::get('SG_NOTIFICATIONS_ENABLED');
3
+ $userEmail = SGConfig::get('SG_NOTIFICATIONS_EMAIL_ADDRESS');
4
+ $isDeleteBackupAfterUploadEnabled = SGConfig::get('SG_DELETE_BACKUP_AFTER_UPLOAD');
5
+ $intervalSelectElement = array(
6
+ '1000'=>'1 second',
7
+ '2000'=>'2 seconds',
8
+ '3000'=>'3 seconds',
9
+ '5000'=>'5 seconds',
10
+ '7000'=>'7 seconds',
11
+ '10000'=>'10 seconds'
12
+ );
13
+ $selectedInterval = SGConfig::get('SG_AJAX_REQUEST_FREQUENCY')?SGConfig::get('SG_AJAX_REQUEST_FREQUENCY'):SG_AJAX_DEFAULT_REQUEST_FREQUENCY;
14
+ ?>
15
+ <div id="sg-content-wrapper">
16
+ <div class="container-fluid">
17
+ <div class="row sg-settings-container">
18
+ <div class="col-md-12">
19
+ <form class="form-horizontal" method="post" data-sgform="ajax" data-type="sgsettings">
20
+ <fieldset>
21
+ <legend><?php echo _t('General settings')?></legend>
22
+ <?php if(SGBoot::isFeatureAvailable('NOTIFICATIONS')): ?>
23
+ <div class="form-group">
24
+ <label class="col-md-8 sg-control-label sg-user-info">
25
+ <?php echo _t('Email notifications');
26
+ if(!empty($userEmail)): ?>
27
+ <br/><span class="text-muted sg-user-email sg-helper-block"><?php echo $userEmail; ?></span>
28
+ <?php endif?>
29
+ </label>
30
+ <div class="col-md-3 pull-right text-right">
31
+ <label class="sg-switch-container">
32
+ <input type="checkbox" name="sgIsEmailNotification" class="sg-switch sg-email-switch" <?php echo $isNotificationEnabled?'checked="checked"':''?> data-remote="settings">
33
+ </label>
34
+ </div>
35
+ </div>
36
+ <div class="sg-general-settings">
37
+ <div class="form-group">
38
+ <label class="col-md-4 sg-control-label" for="sg-email"><?php echo _t('Enter email')?></label>
39
+ <div class="col-md-8">
40
+ <input id="sg-email" name="sgUserEmail" type="email" placeholder="example@domain.com" class="form-control input-md" value="<?php echo @$userEmail?>">
41
+ </div>
42
+ </div>
43
+ </div>
44
+ <?php endif; ?>
45
+ <?php if(SGBoot::isFeatureAvailable('DELETE_LOCAL_BACKUP_AFTER_UPLOAD')): ?>
46
+ <div class="form-group">
47
+ <label class="col-md-8 sg-control-label">
48
+ <?php echo _t('Delete local backup after upload'); ?>
49
+ </label>
50
+ <div class="col-md-3 pull-right text-right">
51
+ <label class="sg-switch-container">
52
+ <input type="checkbox" name="delete-backup-after-upload" class="sg-switch" <?php echo $isDeleteBackupAfterUploadEnabled?'checked="checked"':''?>>
53
+ </label>
54
+ </div>
55
+ </div>
56
+ <?php endif; ?>
57
+ <?php if(SGBoot::isFeatureAvailable('NUMBER_OF_BACKUPS_TO_KEEP')): ?>
58
+ <div class="form-group">
59
+ <label class="col-md-5 sg-control-label" for='amount-of-backups-to-keep'><?php echo _t('Amount of backups to keep on loacl PC')?></label>
60
+ <div class="col-md-5 pull-right text-right">
61
+ <input class="form-control" id='amount-of-backups-to-keep' name='amount-of-backups-to-keep' type="text" value="<?php echo SGConfig::get('SG_AMOUNT_OF_BACKUPS_TO_KEEP')?SGConfig::get('SG_AMOUNT_OF_BACKUPS_TO_KEEP'):SG_NUMBER_OF_BACKUPS_TO_KEEP?>">
62
+ </div>
63
+ </div>
64
+ <?php endif; ?>
65
+
66
+ <?php if(SGBoot::isFeatureAvailable('CUSTOM_BACKUP_NAME')): ?>
67
+ <div class="form-group">
68
+ <label class="col-md-5 sg-control-label"><?php echo _t('Backup file name')?></label>
69
+ <div class="col-md-5 pull-right text-right">
70
+ <input id="backup-file-name" name="backup-file-name" type="text" class="form-control input-md" value="<?php echo SGConfig::get('SG_BACKUP_FILE_NAME_PREFIX')?SGConfig::get('SG_BACKUP_FILE_NAME_PREFIX'):SG_BACKUP_FILE_NAME_DEFAULT_PREFIX?>">
71
+ </div>
72
+ </div>
73
+ <?php endif; ?>
74
+ <div class="form-group">
75
+ <label class="col-md-7 sg-control-label" for="sg-email"><?php echo _t('AJAX request frequency')?></label>
76
+ <div class="col-md-5">
77
+ <?php echo selectElement($intervalSelectElement, array('id'=>'sg-ajax-interval', 'name'=>'ajaxInterval', 'class'=>'form-control'), '', $selectedInterval);?>
78
+ </div>
79
+ </div>
80
+ <div class="form-group">
81
+ <label class="col-md-5"><?php echo _t('Backup destination path'); ?></label>
82
+ <div class="col-md-6 pull-right text-right">
83
+ <span><?php echo str_replace(realpath(SG_APP_ROOT_DIRECTORY).'/', "" ,realpath(SG_BACKUP_DIRECTORY)); ?></span>
84
+ </div>
85
+ </div>
86
+ <div class="form-group">
87
+ <label class="col-md-4 control-label" for="button1id"></label>
88
+ <div class="col-md-8">
89
+ <button type="button" id="sg-save-settings" class="btn btn-success pull-right" onclick="sgBackup.sgsettings();"><?php _t('Save')?></button>
90
+ </div>
91
+ </div>
92
+ </fieldset>
93
+ </form>
94
+ </div>
95
+ </div>
96
+ </div>
app/design/adminhtml/default/default/template/backupguardfree/sidebar.phtml CHANGED
@@ -1,29 +1,42 @@
1
  <?php
2
- $url = $_SERVER['REQUEST_URI'];
3
- function sgBuildUrl($action) {
4
- return Mage::helper("adminhtml")->getUrl("adminhtml/backupguardfree/".$action);
5
- }
6
  ?>
7
  <div id="sg-sidebar-wrapper" class="metro">
8
- <nav class="sidebar dark">
9
- <ul>
10
- <li class="title"><a class="sg-site-url" target="_blank" href="<?php echo SG_BACKUP_SITE_URL;?>"></a></li>
11
- <li class="<?php echo strpos($url,'backups')?'active':''?>"><a href="<?php echo sgBuildUrl('backups'); ?>"><span class="glyphicon glyphicon-hdd"></span>Backups</a></li>
12
- <?php if(SGBoot::isFeatureAvailable('STORAGE')): ?>
13
- <li class="<?php echo strpos($url,'cloud')?'active':''?>"><a href="<?php echo sgBuildUrl('cloud'); ?>"><span class="glyphicon glyphicon-cloud" aria-hidden="true"></span>Cloud</a></li>
14
- <?php endif; ?>
15
- <?php if(SGBoot::isFeatureAvailable('SCHEDULE')): ?>
16
- <li class="<?php echo strpos($url,'schedule')?'active':''?>"><a href="<?php echo sgBuildUrl('schedule'); ?>"><span class="glyphicon glyphicon-time" aria-hidden="true"></span>Schedule</a></li>
17
- <?php endif; ?>
18
- <?php if(SGBoot::isFeatureAvailable('NOTIFICATIONS')): ?>
19
- <li class="<?php echo strpos($url,'settings')?'active':''?>"><a href="<?php echo sgBuildUrl('settings'); ?>"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span>Settings</a></li>
20
- <?php endif; ?>
21
- </ul>
22
- </nav>
23
- <?php if(!SGBoot::isFeatureAvailable('SCHEDULE')): ?>
24
- <div class="sg-alert-pro">
25
- <p>Backup to cloud, automatization, mail notifications, and more in our PRO package! </p>
26
- <p><a class="btn btn-primary" target="_blank" href="<?php echo SG_BACKUP_GUARD_PRO_URL; ?>">Buy now!</a></p>
27
- </div>
28
- <?php endif; ?>
29
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ $url = $_SERVER['REQUEST_URI'];
3
+ function sgBuildUrl($action) {
4
+ return Mage::helper("adminhtml")->getUrl("adminhtml/backupguardfree/".$action);
5
+ }
6
  ?>
7
  <div id="sg-sidebar-wrapper" class="metro">
8
+ <nav class="sidebar dark">
9
+ <ul>
10
+ <li class="title"><a class="sg-site-url" target="_blank" href="<?php echo SG_BACKUP_SITE_URL;?>"></a></li>
11
+ <li class="<?php echo strpos($url,'backups')?'active':''?>">
12
+ <a href="<?php echo sgBuildUrl('backups'); ?>">
13
+ <span class="glyphicon glyphicon-hdd"></span>
14
+ Backups
15
+ </a>
16
+ </li>
17
+ <li class="<?php echo strpos($url,'settings')?'active':''?>">
18
+ <a href="<?php echo sgBuildUrl('settings'); ?>">
19
+ <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
20
+ Settings
21
+ </a>
22
+ </li>
23
+ <li class="<?php echo strpos($url,'support')?'active':''?>">
24
+ <a href="<?php echo sgBuildUrl('support'); ?>">
25
+ <span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
26
+ Support
27
+ </a>
28
+ </li>
29
+ <li class="<?php echo strpos($url,'whyupgrade')?'active':''?>">
30
+ <a href="<?php echo sgBuildUrl('whyupgrade'); ?>">
31
+ <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
32
+ Why upgrade?
33
+ </a>
34
+ </li>
35
+ </ul>
36
+ </nav>
37
+
38
+ <div class="sg-alert-pro">
39
+ <p>Backup to cloud, automatization, mail notifications, and more in our PRO package! </p>
40
+ <p><a class="btn btn-primary" target="_blank" href="<?php echo SG_BACKUP_GUARD_PRO_URL; ?>">Buy now!</a></p>
41
+ </div>
42
+ </div>
app/design/adminhtml/default/default/template/backupguardfree/support.phtml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <div id="sg-content-wrapper">
2
+ <div class="sg-wrap-container">
3
+ <iframe id="sg-backup-guard-iframe" src="<?php echo SG_BACKUP_SUPPORT_URL?>"></iframe>
4
+ </div>
5
+
app/design/adminhtml/default/default/template/backupguardfree/whyupgrade.phtml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <div id="sg-content-wrapper">
2
+ <div class="sg-wrap-container">
3
+ <iframe id="sg-backup-guard-iframe" src="<?php echo SG_BACKUP_UPGRADE_URL?>"></iframe>
4
+ </div>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>BackupGuardFree</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Backup Guard is the best backup choice for Magento. We offer the easiest way to backup and restore your Magento based online business.</description>
11
  <notes>Fully functional stable version</notes>
12
  <authors><author><name>Backup Guard</name><user>backupguard</user><email>info@backup-guard.com</email></author></authors>
13
- <date>2016-03-15</date>
14
- <time>11:41:26</time>
15
- <contents><target name="magecommunity"><dir name="BackupGuard"><dir name="BackupGuardFree"><dir name="Helper"><file name="Data.php" hash="04b15859891eb315cd1f354d257e1d65"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Model"><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="845be9f6ac2a30c5b3f21a929903209d"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="66db1361e49569b58e3e8aedb992b9fc"/></dir><file name=".DS_Store" hash="646b26ad78ebc3149e23ed5c835878c0"/></dir><dir name="com"><file name="boot.php" hash="910d37979bd2962cdbf8d3dcd4c104bc"/><dir name="config"><file name="config.magento.free.php" hash="d50267dd6088e2332f1a6892088aba75"/><file name="config.magento.php" hash="6d6f459154033d32a5b3d9eaa2d2d2ca"/><file name="config.php" hash="9bd047850c31149313bc8d358c0e3afa"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="core"><file name="SGBoot.php" hash="0da9b9a7cbf93b64c306857c0577d581"/><file name="SGConfig.php" hash="0faca670ac378139cc90e59575cb3557"/><file name="SGPing.php" hash="cf5dddf3714848edba171a3f652ce0d0"/><dir name="backup"><file name="SGBackup.php" hash="9f6375b414173eaeb0e8d59d8282475b"/><file name="SGBackupDatabase.php" hash="2f390ca11863945e098666d1590e658c"/><file name="SGBackupFiles.php" hash="614f763ce3c147d36399f2ca4378e679"/><file name="SGBackupLog.php" hash="bf0ec89ead6df0ce99d6cb5fe951ec47"/><file name="SGIBackupDelegate.php" hash="b5db5f3afdf588d1808f15634b4493ca"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="database"><file name="SGDatabase.php" hash="dff778077ceb81ee00f1188ce57b5dac"/><file name="SGDatabaseAdapterMagento.php" hash="f51364359af1e8dd76c135d2d9b8039f"/><file name="SGIDatabaseAdapter.php" hash="6146b2b2f14180b8427367ffedba1291"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="exception"><file name="SGException.php" hash="9a69304caf29f2970adc0aa556f5e3b5"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name="functions.php" hash="b74abfd7267aa3f512638a51e82bdccb"/><dir name="log"><file name="SGFileLogHandler.php" hash="e69c778949e19e440c7233628bf213fb"/><file name="SGILogHandler.php" hash="cda58db6525b5815fc90788826763ea3"/><file name="SGLog.php" hash="62a8ebece354ceda02d4d76ddf28e1e1"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="af5667afdc58429867d97873427b94e3"/></dir><dir name="lib"><file name="BigInteger.php" hash="b295e37ff7afb37201b8cb8c2f52d689"/><file name="SGArchive.php" hash="745cd1034c32587aa1f541e389ae8c6d"/><file name="SGMysqldump.php" hash="68f9db9ca58471b343c4317f1dc26590"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="2b1e654a646f22d57c5c1f2732170a6a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BackupguardfreeController.php" hash="b6bb4c98174f0d6d18e24c7347cdffef"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="548f6d732905524bd07fe9a5dc4a66c1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="cacd8bd0d96b43e2f0d4f6eb15ac6a1b"/><file name="config.xml" hash="8d9f3ac91236a58ff5d712be7b61f4d5"/></dir><dir name="public"><dir name="ajax"><file name="cancelBackup.php" hash="e1861e440be94b399f3744c0c5560a96"/><file name="checkBackupCreation.php" hash="1c69edf496a5241af0c40d731a6bbb51"/><file name="checkRestoreCreation.php" hash="1c69edf496a5241af0c40d731a6bbb51"/><file name="deleteBackup.php" hash="6528bbfabb79b17ab93053b6c931aab0"/><file name="downloadBackup.php" hash="98f7783387fe9cc6bb35751777429ecd"/><file name="getAction.php" hash="7a3c4b5a4daa5fe0491aaacf98484959"/><file name="getRunningActions.php" hash="26e7a9de98697d0712696eb3f5be6bb3"/><file name="hideNotice.php" hash="2fe634a46ebe98166f031cc625fb0e96"/><file name="importBackup.php" hash="eff8b0ffd25301544f26df5f799067d1"/><file name="manualBackup.php" hash="bc8f991a7fb71a823d3a0093edd2eb74"/><file name="modalImport.php" hash="d4ee99d6460eb1124e34b6f305ff1d88"/><file name="modalManualBackup.php" hash="ffd029e26382fa53de6d489ebcc72235"/><file name="resetStatus.php" hash="5a84a0e1782abf906ca9e31333c5320a"/><file name="restore.php" hash="f8c69735cfaa5aafa75fe5e232679577"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name="boot.php" hash="d053522b871ce96d76beb03fe391e82e"/><dir name="config"><file name="config.magento.php" hash="eafbf7040d89ec1fdd549cb7fb53d9c9"/><file name="config.php" hash="e9190f3d1f76335854d84818280f5eb7"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="include"><file name="functions.php" hash="b8fed6ffa90cedeb7f3d58dc7a3c6983"/><file name="notification.magento.php" hash="07795085e0f996eac67797847ebb8e76"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="2f012ad187ee2a6283a004465ff8e45f"/></dir><dir name="sg_backups"><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/><file name=".htaccess" hash="5cc8a02be988615b049f5abecba2f3a0"/></dir><dir name="sql"><dir name="backupguardfree_setup"><file name="mysql4-install-1.0.0.php" hash="d62412fdd789784f2f8fa8846d13277e"/></dir><file name=".DS_Store" hash="20e6e71aa70dbc92d48b82c1d0bcfb86"/></dir><file name=".DS_Store" hash="b36313724d1b3ea50fb621534bad508e"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="backupguardfree.xml" hash="9ec35e7858eccd45d4e4a7fcd8ea117a"/></dir><dir name="template"><dir name="backupguardfree"><file name="backups.phtml" hash="918f0a5de161ff139eb1e9c22d71f908"/><file name="footer.phtml" hash="9f20a07d22abc146767b82a60f0fc0b4"/><file name="header.phtml" hash="4b7c727dcb4418641d7197e055a6fd2b"/><file name="modal.phtml" hash="4c05d97029f503498c64122cfb8d1b5c"/><file name="sidebar.phtml" hash="e82a3846fb4a5aaa415a99c3956df16d"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="BackupGuard_BackupGuardFree.xml" hash="614e5b35bdeb05dda35f45e07134ff01"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="css"><dir name="BackupGuardFree"><file name="bgstyle.less.css" hash="cd2266d14889c669646a133f18753eec"/><file name="bootstrap-switch.min.css" hash="a5fc24bfc254551bf97471e959a1a3c2"/><file name="bootstrap.css" hash="b2e9c4ecf3b7cec6e1c4c640aa5c53c6"/><file name="fonts.css" hash="7b665c6a2cd31f95c47cec63b2cdbb49"/><file name="main.css" hash="b00db9909061e896729a2f1e38d4f0b8"/><file name="spinner.css" hash="e9c9db39afbe5c9ee3c2ab02f5842be8"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir><dir name="js"><dir name="BackupGuardFree"><file name="bootstrap-switch.min.js" hash="12ce5d59f687e3c2a8d8395aee0c89b3"/><file name="bootstrap.min.js" hash="c5df4cc68652b407c8367147e1851c00"/><file name="jquery.min.js" hash="5790ead7ad3ba27397aedfa3d263b867"/><file name="less.min.js" hash="4cc1b709ea0594b927222ddb3a144dbd"/><file name="main.js" hash="126f5e26602b50a9068b41eac277ec6c"/><file name="sgbackup.js" hash="197251cf66324e8df0a8556e3ccb9379"/><file name="sgrequesthandler.js" hash="8393a85a58356387aedb81d1978b498b"/><file name="sgrequesthandler.magento.js" hash="d84ede2a4ec4fd6996927239aa0e2943"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir><dir name="media"><dir name="BackupGuardFree"><dir name="fonts"><file name="ODelI1aHBYDBqgeIAH2zlCxe5Tewm2_XWfbGchcXw4g.woff2" hash="c1bd5cd2c67859ed361a10bf2b25a270"/><file name="ODelI1aHBYDBqgeIAH2zlIa1YDtoarzwSXxTHggEXMw.woff2" hash="e39654b1857c430c950a507c50087b8a"/><file name="ODelI1aHBYDBqgeIAH2zlJbPFduIYtoLzwST68uhz_Y.woff2" hash="00bfa19cecc3900646c108e4ac706488"/><file name="OpenSans-Bold.woff" hash="cc42266cd7747dc5baf34d3c9346588f"/><file name="OpenSans-Light.woff" hash="32eb33cb1b3372cc5407ca24dc49d95f"/><file name="OpenSans.woff" hash="48a40d69fc0470991491bb9da3ea7126"/><file name="PTSerif-Caption.woff" hash="fbab4b1c8cc18cbd06cd64819399b110"/><file name="glyphicons-halflings-regular.eot" hash="f4769f9bdb7466be65088239c12046d1"/><file name="glyphicons-halflings-regular.svg" hash="89889688147bd7575d6327160d64e760"/><file name="glyphicons-halflings-regular.ttf" hash="e18bbf611f2a2e43afc071aa2f4e1512"/><file name="glyphicons-halflings-regular.woff" hash="fa2772327f55d8198301fdb8bcfc8158"/><file name="glyphicons-halflings-regular.woff2" hash="448c34a56d699c29117adc64c43affeb"/><file name="iconFont.dev.svg" hash="942fceb470bcb3b81f0ef4709c48c7d1"/><file name="iconFont.eot" hash="a4a081fea840239c3290acc40d518db3"/><file name="iconFont.json" hash="0dedee782ccf65d36f2599d22be70b56"/><file name="iconFont.svg" hash="e40fc64f66bc515730527b23da86bd5d"/><file name="iconFont.ttf" hash="a166f24c519d354ea121438fa010f7c9"/><file name="iconFont.woff" hash="1576a03757affd80023c2b76909670f2"/><file name="metroSysIcons.svg" hash="6e9df107d3ce5f4a9429bb6707781ff2"/><file name="metroSysIcons.ttf" hash="429d6273d7dde27cc53ada319ee8e94c"/><file name="metroSysIcons.woff" hash="133f18b18ab4338f4cd03c116b470afd"/><file name="toadOcfmlt9b38dHJxOBGCD5K6T8I4oZ1X3Xvlj_UeP3rGVtsTkPsbDajuO5ueQw.woff2" hash="b8f60b344e356217bccd52f5b7c5e1fe"/><file name="toadOcfmlt9b38dHJxOBGCP2LEk6lMzYsRqr3dHFImA.woff2" hash="7fde7742449b0174b0a6664889897c80"/><file name="toadOcfmlt9b38dHJxOBGDOFnJNygIkrHciC8BWzbCz3rGVtsTkPsbDajuO5ueQw.woff2" hash="79d99634f030bd764a7f239a78893862"/><file name="toadOcfmlt9b38dHJxOBGJkF8H8ye47wsfpWywda8og.woff2" hash="578d4394a9a36694716553db11ad034e"/><file name="toadOcfmlt9b38dHJxOBGMms7UHsIbjUxEJqIwog-i_3rGVtsTkPsbDajuO5ueQw.woff2" hash="44d45f6c370bee3815fa581e8ad65ed8"/><file name="toadOcfmlt9b38dHJxOBGO4s1Ux4PuImWPk5fSr6HPL3rGVtsTkPsbDajuO5ueQw.woff2" hash="d5c08021e6abbb3fbb610f4044cfd4fe"/></dir><dir name="img"><file name="backup-icons.png" hash="cfcb9705b8fc349229fa581bd906587c"/><file name="backup-icons@2x.png" hash="7407484458d8162a31f7e91a0ae3698d"/><file name="sg-ajax-loader.gif" hash="8a496edb52adab003987ab0ec33327f2"/><file name="sglogo.png" hash="08a7c06afb560f20d8c68c4843fb6a9b"/><file name="sgselect.png" hash="68f8964fd17f66faec62d2220b8c6fc3"/><file name="social-icons@2x.png" hash="cf43b681c85416d48800da97deadeeb4"/></dir><file name=".DS_Store" hash="7c9b6b8c6d59b6c19ee5d1044f9edc28"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><extension><name>zlib</name><min/><max/></extension></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>BackupGuardFree</name>
4
+ <version>1.0.6</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
10
  <description>Backup Guard is the best backup choice for Magento. We offer the easiest way to backup and restore your Magento based online business.</description>
11
  <notes>Fully functional stable version</notes>
12
  <authors><author><name>Backup Guard</name><user>backupguard</user><email>info@backup-guard.com</email></author></authors>
13
+ <date>2016-06-09</date>
14
+ <time>06:59:55</time>
15
+ <contents><target name="magecommunity"><dir name="BackupGuard"><dir name="BackupGuardFree"><dir name="Helper"><file name="Data.php" hash="04b15859891eb315cd1f354d257e1d65"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Model"><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="845be9f6ac2a30c5b3f21a929903209d"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="66db1361e49569b58e3e8aedb992b9fc"/></dir><file name=".DS_Store" hash="646b26ad78ebc3149e23ed5c835878c0"/></dir><dir name="com"><file name="boot.php" hash="d56d0465e4b3cc3683d9bbcfeec43c85"/><dir name="config"><file name="config.magento.free.php" hash="4c66874906fa448afb44c8d606a8ac11"/><file name="config.magento.php" hash="08eb0a5aac089a2d1c78fdc575712e02"/><file name="config.php" hash="a140db1de393b81860f29d37936d4751"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="core"><file name="SGBoot.php" hash="3f83146e59fc8683c528f12022b527c5"/><file name="SGConfig.php" hash="b855e6cfa987e16b6020a47f1e711d63"/><file name="SGPing.php" hash="cf5dddf3714848edba171a3f652ce0d0"/><dir name="backup"><file name="SGBackup.php" hash="d3948cea533de8c7682654bca33bacb7"/><file name="SGBackupDatabase.php" hash="f5e37c73a169716ad707ec68b0451220"/><file name="SGBackupFiles.php" hash="668282432cd24dd902739794ceaa5dad"/><file name="SGBackupLog.php" hash="bf0ec89ead6df0ce99d6cb5fe951ec47"/><file name="SGIBackupDelegate.php" hash="b5db5f3afdf588d1808f15634b4493ca"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="database"><file name="SGDatabase.php" hash="dff778077ceb81ee00f1188ce57b5dac"/><file name="SGDatabaseAdapterMagento.php" hash="a6605eaf2aaa6bccec68aff28643d25d"/><file name="SGIDatabaseAdapter.php" hash="6146b2b2f14180b8427367ffedba1291"/></dir><dir name="exception"><file name="SGException.php" hash="9a69304caf29f2970adc0aa556f5e3b5"/></dir><file name="functions.php" hash="312a1361603587d4276c6c83fd0e4eec"/><dir name="log"><file name="SGFileLogHandler.php" hash="e69c778949e19e440c7233628bf213fb"/><file name="SGILogHandler.php" hash="cda58db6525b5815fc90788826763ea3"/><file name="SGLog.php" hash="62a8ebece354ceda02d4d76ddf28e1e1"/></dir><file name=".DS_Store" hash="dd45ca0787ad63b742834dbf7e24fdef"/></dir><dir name="lib"><file name="BigInteger.php" hash="b295e37ff7afb37201b8cb8c2f52d689"/><file name="SGArchive.php" hash="745cd1034c32587aa1f541e389ae8c6d"/><file name="SGMysqldump.php" hash="31ea5d794aa292677c9d042328d12187"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="43093c9c684ae42c12f7a26b95bb46d6"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BackupguardfreeController.php" hash="68c64826dffb49c18985539b6ab862a6"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="548f6d732905524bd07fe9a5dc4a66c1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="caabe1c7a65c8604d48d90b5c4c3c392"/><file name="config.xml" hash="53dc770078a7f305be5669498e3a5f39"/></dir><dir name="public"><dir name="ajax"><file name="cancelBackup.php" hash="e1861e440be94b399f3744c0c5560a96"/><file name="checkBackupCreation.php" hash="1c69edf496a5241af0c40d731a6bbb51"/><file name="checkRestoreCreation.php" hash="1c69edf496a5241af0c40d731a6bbb51"/><file name="deleteBackup.php" hash="96fb4cf3d9c20c0e6c2da1a70d555f1f"/><file name="downloadBackup.php" hash="98f7783387fe9cc6bb35751777429ecd"/><file name="getAction.php" hash="f4a97f89404c84b88d56ddb602236407"/><file name="getRunningActions.php" hash="2cb572210c5d29131f8dec6941eb0ef9"/><file name="hideNotice.php" hash="2fe634a46ebe98166f031cc625fb0e96"/><file name="importBackup.php" hash="eff8b0ffd25301544f26df5f799067d1"/><file name="manualBackup.php" hash="b2e3d054288d85d88adafea2ed5b9e4f"/><file name="modalImport.php" hash="659d96283586c3c0d08b411cf377bcdf"/><file name="modalManualBackup.php" hash="f4468c6d63b0844ead27764934d26c38"/><file name="modalPrivacy.php" hash="dfa89abc0f20ab41f6a32c36919d5a70"/><file name="modalReview.php" hash="5c291362daecda6962c6c12b0119c28b"/><file name="modalTerms.php" hash="ba2251dfd35a070e5868f2c20fb1a664"/><file name="resetStatus.php" hash="0b497956258705554d79e2b6851dad6f"/><file name="restore.php" hash="d897c95ef91cd797a9f731178b90e14d"/><file name="setReviewPopupState.php" hash="84838c074502959e5a9f46f607e52861"/><file name="settings.php" hash="fae4b305836cd309c6357b4816adeba1"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name="boot.php" hash="d053522b871ce96d76beb03fe391e82e"/><dir name="config"><file name="config.magento.php" hash="f35690ebefc83873f7821461cc327560"/><file name="config.php" hash="e9190f3d1f76335854d84818280f5eb7"/></dir><dir name="include"><file name="functions.php" hash="8002cd3557d4c2e2d7e68977f8dca344"/><file name="notification.magento.php" hash="07795085e0f996eac67797847ebb8e76"/></dir><file name=".DS_Store" hash="07d82b22a56b59f48452b3103a8509d7"/></dir><dir name="sg_backups"><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/><file name=".htaccess" hash="5cc8a02be988615b049f5abecba2f3a0"/></dir><dir name="sql"><dir name="backupguardfree_setup"><file name="mysql4-install-1.0.0.php" hash="f288119ba141e2212c05249cc21c46eb"/></dir></dir><file name=".DS_Store" hash="b36313724d1b3ea50fb621534bad508e"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="backupguardfree.xml" hash="1b2a00a7807179a3bed836dc071b3b97"/></dir><dir name="template"><dir name="backupguardfree"><file name="backups.phtml" hash="8eb1a94fb5ac63c84ac734a47e652403"/><file name="footer.phtml" hash="76bd40c19b946f5d4460e6a735ac5a66"/><file name="footer.settings.phtml" hash="1f2214ec44a81348eba17954d696118c"/><file name="header.phtml" hash="3bcb4036f914c262844e526e0b83b760"/><file name="modal.phtml" hash="4c05d97029f503498c64122cfb8d1b5c"/><file name="settings.phtml" hash="e021c688b55c6f2a2379479b5a3b84f0"/><file name="sidebar.phtml" hash="5f017d66e2231845bee9bb8a21aea1b5"/><file name="support.phtml" hash="836c96ed2c693283943373152e579abb"/><file name="whyupgrade.phtml" hash="c12a72200c17b76c32c3ae485a598195"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="BackupGuard_BackupGuardFree.xml" hash="614e5b35bdeb05dda35f45e07134ff01"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="css"><dir name="BackupGuardFree"><file name="bgstyle.less.css" hash="fc1071041c9169e6c8ff7c2f245c378c"/><file name="bootstrap-switch.min.css" hash="a5fc24bfc254551bf97471e959a1a3c2"/><file name="bootstrap.css" hash="b2e9c4ecf3b7cec6e1c4c640aa5c53c6"/><file name="fonts.css" hash="7b665c6a2cd31f95c47cec63b2cdbb49"/><file name="main.css" hash="b00db9909061e896729a2f1e38d4f0b8"/><file name="spinner.css" hash="f6551696c7b1194afd769f8904c7dbdd"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir><dir name="js"><dir name="BackupGuardFree"><file name="bootstrap-switch.min.js" hash="12ce5d59f687e3c2a8d8395aee0c89b3"/><file name="bootstrap.min.js" hash="c5b5b2fa19bd66ff23211d9f844e0131"/><file name="jquery.min.js" hash="5790ead7ad3ba27397aedfa3d263b867"/><file name="less.min.js" hash="19e526aafd8841af87d97e1df2534083"/><file name="main.js" hash="a1448b435254fefd62c5e86bb2b7a24f"/><file name="sgbackup.js" hash="73f6a05366c96eedc3e4a7081531e3fc"/><file name="sgrequesthandler.js" hash="b01321f462b8062816b37f75b8af50cc"/><file name="sgrequesthandler.magento.js" hash="d84ede2a4ec4fd6996927239aa0e2943"/><file name="sgsettings.js" hash="f74b41eee7d6fdba854515d0bcb1bf8b"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir><dir name="media"><dir name="BackupGuardFree"><dir name="fonts"><file name="ODelI1aHBYDBqgeIAH2zlCxe5Tewm2_XWfbGchcXw4g.woff2" hash="c1bd5cd2c67859ed361a10bf2b25a270"/><file name="ODelI1aHBYDBqgeIAH2zlIa1YDtoarzwSXxTHggEXMw.woff2" hash="e39654b1857c430c950a507c50087b8a"/><file name="ODelI1aHBYDBqgeIAH2zlJbPFduIYtoLzwST68uhz_Y.woff2" hash="00bfa19cecc3900646c108e4ac706488"/><file name="OpenSans-Bold.woff" hash="cc42266cd7747dc5baf34d3c9346588f"/><file name="OpenSans-Light.woff" hash="32eb33cb1b3372cc5407ca24dc49d95f"/><file name="OpenSans.woff" hash="48a40d69fc0470991491bb9da3ea7126"/><file name="PTSerif-Caption.woff" hash="fbab4b1c8cc18cbd06cd64819399b110"/><file name="glyphicons-halflings-regular.eot" hash="f4769f9bdb7466be65088239c12046d1"/><file name="glyphicons-halflings-regular.svg" hash="89889688147bd7575d6327160d64e760"/><file name="glyphicons-halflings-regular.ttf" hash="e18bbf611f2a2e43afc071aa2f4e1512"/><file name="glyphicons-halflings-regular.woff" hash="fa2772327f55d8198301fdb8bcfc8158"/><file name="glyphicons-halflings-regular.woff2" hash="448c34a56d699c29117adc64c43affeb"/><file name="iconFont.dev.svg" hash="942fceb470bcb3b81f0ef4709c48c7d1"/><file name="iconFont.eot" hash="a4a081fea840239c3290acc40d518db3"/><file name="iconFont.json" hash="0dedee782ccf65d36f2599d22be70b56"/><file name="iconFont.svg" hash="e40fc64f66bc515730527b23da86bd5d"/><file name="iconFont.ttf" hash="a166f24c519d354ea121438fa010f7c9"/><file name="iconFont.woff" hash="1576a03757affd80023c2b76909670f2"/><file name="metroSysIcons.svg" hash="6e9df107d3ce5f4a9429bb6707781ff2"/><file name="metroSysIcons.ttf" hash="429d6273d7dde27cc53ada319ee8e94c"/><file name="metroSysIcons.woff" hash="133f18b18ab4338f4cd03c116b470afd"/><file name="toadOcfmlt9b38dHJxOBGCD5K6T8I4oZ1X3Xvlj_UeP3rGVtsTkPsbDajuO5ueQw.woff2" hash="b8f60b344e356217bccd52f5b7c5e1fe"/><file name="toadOcfmlt9b38dHJxOBGCP2LEk6lMzYsRqr3dHFImA.woff2" hash="7fde7742449b0174b0a6664889897c80"/><file name="toadOcfmlt9b38dHJxOBGDOFnJNygIkrHciC8BWzbCz3rGVtsTkPsbDajuO5ueQw.woff2" hash="79d99634f030bd764a7f239a78893862"/><file name="toadOcfmlt9b38dHJxOBGJkF8H8ye47wsfpWywda8og.woff2" hash="578d4394a9a36694716553db11ad034e"/><file name="toadOcfmlt9b38dHJxOBGMms7UHsIbjUxEJqIwog-i_3rGVtsTkPsbDajuO5ueQw.woff2" hash="44d45f6c370bee3815fa581e8ad65ed8"/><file name="toadOcfmlt9b38dHJxOBGO4s1Ux4PuImWPk5fSr6HPL3rGVtsTkPsbDajuO5ueQw.woff2" hash="d5c08021e6abbb3fbb610f4044cfd4fe"/></dir><dir name="img"><file name="backup-icons.png" hash="cfcb9705b8fc349229fa581bd906587c"/><file name="backup-icons@2x.png" hash="7407484458d8162a31f7e91a0ae3698d"/><file name="sg-ajax-loader.gif" hash="8a496edb52adab003987ab0ec33327f2"/><file name="sglogo.png" hash="08a7c06afb560f20d8c68c4843fb6a9b"/><file name="sgselect.png" hash="68f8964fd17f66faec62d2220b8c6fc3"/><file name="social-icons@2x.png" hash="cf43b681c85416d48800da97deadeeb4"/></dir><file name=".DS_Store" hash="7c9b6b8c6d59b6c19ee5d1044f9edc28"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><extension><name>zlib</name><min/><max/></extension></required></dependencies>
18
  </package>
skin/adminhtml/base/default/css/BackupGuardFree/bgstyle.less.css CHANGED
@@ -1,3 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  .sg-wrapper-less {
2
  /* vietnamese */
3
  /* latin-ext */
@@ -6951,7 +6995,7 @@
6951
  width: calc(100% - 210px);
6952
  /*Same as sidebar*/
6953
  border-left: 1px #333333 solid;
6954
- min-height: 450px;
6955
  background-color: #ffffff;
6956
  }
6957
  .sg-wrapper-less #sg-content-wrapper .container-fluid {
@@ -7423,6 +7467,12 @@
7423
  background-image: url('../../media/BackupGuardFree/img/backup-icons@2x.png');
7424
  }
7425
  }
 
 
 
 
 
 
7426
  .sg-wrapper-less .sg-status-1 {
7427
  background-position: -20px -20px;
7428
  }
1
+ #modal-import-1,
2
+ #sg-modal-inport-from,
3
+ #modal-import-3 {
4
+ padding: 0;
5
+ }
6
+
7
+ #sg-checkbox-select-all {
8
+ margin-top: 0;
9
+ }
10
+
11
+ .sg-wrap-container {
12
+ height: 553px;
13
+ width: 100%;
14
+ }
15
+
16
+ #sg-backup-guard-iframe {
17
+ width: 100%;
18
+ height: 100%;
19
+ }
20
+
21
+ #modal-import-2 {
22
+ margin-top: 15px;
23
+ }
24
+
25
+ #modal-import-1 .form-group{
26
+ margin-bottom: 0;
27
+ }
28
+
29
+ #modal-import-1 .table{
30
+ margin-bottom: 0;
31
+ }
32
+
33
+ #modal-import-3 .form-group{
34
+ margin-bottom: 0;
35
+ }
36
+
37
+ #modal-import-3 .table{
38
+ margin-bottom: 0;
39
+ }
40
+
41
+ .file-select-radio {
42
+ padding-left: 15px !important;
43
+ }
44
+
45
  .sg-wrapper-less {
46
  /* vietnamese */
47
  /* latin-ext */
6995
  width: calc(100% - 210px);
6996
  /*Same as sidebar*/
6997
  border-left: 1px #333333 solid;
6998
+ min-height: 540px;
6999
  background-color: #ffffff;
7000
  }
7001
  .sg-wrapper-less #sg-content-wrapper .container-fluid {
7467
  background-image: url('../../media/BackupGuardFree/img/backup-icons@2x.png');
7468
  }
7469
  }
7470
+ .sg-wrapper-less .sg-status-34 {
7471
+ background-position: -80px -20px;
7472
+ }
7473
+ .sg-wrapper-less .sg-status-34.active {
7474
+ background-position: -80px 0px;
7475
+ }
7476
  .sg-wrapper-less .sg-status-1 {
7477
  background-position: -20px -20px;
7478
  }
skin/adminhtml/base/default/css/BackupGuardFree/spinner.css CHANGED
@@ -7,6 +7,6 @@
7
  background-color: transparent;
8
  width: 32px;
9
  height: 32px;
10
- background-image: url('../../media/BackupGuard/img/sg-ajax-loader.gif');
11
  background-repeat: no-repeat;
12
- }
7
  background-color: transparent;
8
  width: 32px;
9
  height: 32px;
10
+ background-image: url('../../media/BackupGuardFree/img/sg-ajax-loader.gif');
11
  background-repeat: no-repeat;
12
+ }
skin/adminhtml/base/default/js/BackupGuardFree/bootstrap.min.js CHANGED
@@ -1,11 +1,7 @@
1
  /*!
2
- * Bootstrap v3.3.4 (http://getbootstrap.com)
3
  * Copyright 2011-2015 Twitter, Inc.
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
  */
6
-
7
- /*!
8
- * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=0f25f663c3c3195f7d3f)
9
- * Config saved to config.json and https://gist.github.com/0f25f663c3c3195f7d3f
10
- */
11
- if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.alert");n||o.data("bs.alert",n=new i(this)),"string"==typeof e&&n[e].call(o)})}var o='[data-dismiss="alert"]',i=function(e){t(e).on("click",o,this.close)};i.VERSION="3.3.2",i.TRANSITION_DURATION=150,i.prototype.close=function(e){function o(){r.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var r=t(s);e&&e.preventDefault(),r.length||(r=n.closest(".alert")),r.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(r.removeClass("in"),t.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",o).emulateTransitionEnd(i.TRANSITION_DURATION):o())};var n=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=i,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",o,i.prototype.close)}(jQuery),+function(t){"use strict";function e(e){e&&3===e.which||(t(n).remove(),t(s).each(function(){var i=t(this),n=o(i),s={relatedTarget:this};n.hasClass("open")&&(n.trigger(e=t.Event("hide.bs.dropdown",s)),e.isDefaultPrevented()||(i.attr("aria-expanded","false"),n.removeClass("open").trigger("hidden.bs.dropdown",s)))}))}function o(e){var o=e.attr("data-target");o||(o=e.attr("href"),o=o&&/#[A-Za-z]/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var i=o&&t(o);return i&&i.length?i:e.parent()}function i(e){return this.each(function(){var o=t(this),i=o.data("bs.dropdown");i||o.data("bs.dropdown",i=new r(this)),"string"==typeof e&&i[e].call(o)})}var n=".dropdown-backdrop",s='[data-toggle="dropdown"]',r=function(e){t(e).on("click.bs.dropdown",this.toggle)};r.VERSION="3.3.2",r.prototype.toggle=function(i){var n=t(this);if(!n.is(".disabled, :disabled")){var s=o(n),r=s.hasClass("open");if(e(),!r){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e);var a={relatedTarget:this};if(s.trigger(i=t.Event("show.bs.dropdown",a)),i.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger("shown.bs.dropdown",a)}return!1}},r.prototype.keydown=function(e){if(/(38|40|27|32)/.test(e.which)&&!/input|textarea/i.test(e.target.tagName)){var i=t(this);if(e.preventDefault(),e.stopPropagation(),!i.is(".disabled, :disabled")){var n=o(i),r=n.hasClass("open");if(!r&&27!=e.which||r&&27==e.which)return 27==e.which&&n.find(s).trigger("focus"),i.trigger("click");var a=" li:not(.disabled):visible a",l=n.find('[role="menu"]'+a+', [role="listbox"]'+a);if(l.length){var d=l.index(e.target);38==e.which&&d>0&&d--,40==e.which&&d<l.length-1&&d++,~d||(d=0),l.eq(d).trigger("focus")}}}};var a=t.fn.dropdown;t.fn.dropdown=i,t.fn.dropdown.Constructor=r,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=a,this},t(document).on("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",s,r.prototype.toggle).on("keydown.bs.dropdown.data-api",s,r.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',r.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',r.prototype.keydown)}(jQuery),+function(t){"use strict";function e(e,i){return this.each(function(){var n=t(this),s=n.data("bs.modal"),r=t.extend({},o.DEFAULTS,n.data(),"object"==typeof e&&e);s||n.data("bs.modal",s=new o(this,r)),"string"==typeof e?s[e](i):r.show&&s.show(i)})}var o=function(e,o){this.options=o,this.$body=t(document.body),this.$element=t(e),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};o.VERSION="3.3.2",o.TRANSITION_DURATION=300,o.BACKDROP_TRANSITION_DURATION=150,o.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},o.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},o.prototype.show=function(e){var i=this,n=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(n),this.isShown||n.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){i.$element.one("mouseup.dismiss.bs.modal",function(e){t(e.target).is(i.$element)&&(i.ignoreBackdropClick=!0)})}),this.backdrop(function(){var n=t.support.transition&&i.$element.hasClass("fade");i.$element.parent().length||i.$element.appendTo(i.$body),i.$element.show().scrollTop(0),i.adjustDialog(),n&&i.$element[0].offsetWidth,i.$element.addClass("in").attr("aria-hidden",!1),i.enforceFocus();var s=t.Event("shown.bs.modal",{relatedTarget:e});n?i.$dialog.one("bsTransitionEnd",function(){i.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(o.TRANSITION_DURATION):i.$element.trigger("focus").trigger(s)}))},o.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(o.TRANSITION_DURATION):this.hideModal())},o.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},o.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},o.prototype.resize=function(){this.isShown?t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this)):t(window).off("resize.bs.modal")},o.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},o.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},o.prototype.backdrop=function(e){var i=this,n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&n;if(this.$backdrop=t('<div class="modal-backdrop '+n+'" />').appendTo('#sg-wrapper'),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(o.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var r=function(){i.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(o.BACKDROP_TRANSITION_DURATION):r()}else e&&e()},o.prototype.handleUpdate=function(){this.adjustDialog()},o.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},o.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},o.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},o.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",t+this.scrollbarWidth)},o.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},o.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var i=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=o,t.fn.modal.noConflict=function(){return t.fn.modal=i,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(o){var i=t(this),n=i.attr("href"),s=t(i.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,"")),r=s.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(n)&&n},s.data(),i.data());i.is("a")&&o.preventDefault(),s.one("show.bs.modal",function(t){t.isDefaultPrevented()||s.one("hidden.bs.modal",function(){i.is(":visible")&&i.trigger("focus")})}),e.call(s,r,this)})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),n=i.data("bs.tooltip"),s="object"==typeof e&&e;(n||!/destroy|hide/.test(e))&&(n||i.data("bs.tooltip",n=new o(this,s)),"string"==typeof e&&n[e]())})}var o=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};o.VERSION="3.3.2",o.TRANSITION_DURATION=150,o.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},o.prototype.init=function(e,o,i){if(this.enabled=!0,this.type=e,this.$element=t(o),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&t(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var r=n[s];if("click"==r)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=r){var a="hover"==r?"mouseenter":"focusin",l="hover"==r?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},o.prototype.getDefaults=function(){return o.DEFAULTS},o.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},o.prototype.getDelegateOptions=function(){var e={},o=this.getDefaults();return this._options&&t.each(this._options,function(t,i){o[t]!=i&&(e[t]=i)}),e},o.prototype.enter=function(e){var o=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return o&&o.$tip&&o.$tip.is(":visible")?void(o.hoverState="in"):(o||(o=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,o)),clearTimeout(o.timeout),o.hoverState="in",o.options.delay&&o.options.delay.show?void(o.timeout=setTimeout(function(){"in"==o.hoverState&&o.show()},o.options.delay.show)):o.show())},o.prototype.leave=function(e){var o=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return o||(o=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,o)),clearTimeout(o.timeout),o.hoverState="out",o.options.delay&&o.options.delay.hide?void(o.timeout=setTimeout(function(){"out"==o.hoverState&&o.hide()},o.options.delay.hide)):o.hide()},o.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var i=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!i)return;var n=this,s=this.tip(),r=this.getUID(this.type);this.setContent(),s.attr("id",r),this.$element.attr("aria-describedby",r),this.options.animation&&s.addClass("fade");var a="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,d=l.test(a);d&&(a=a.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(a).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element);var h=this.getPosition(),p=s[0].offsetWidth,c=s[0].offsetHeight;if(d){var f=a,u=this.options.container?t(this.options.container):this.$element.parent(),m=this.getPosition(u);a="bottom"==a&&h.bottom+c>m.bottom?"top":"top"==a&&h.top-c<m.top?"bottom":"right"==a&&h.right+p>m.width?"left":"left"==a&&h.left-p<m.left?"right":a,s.removeClass(f).addClass(a)}var g=this.getCalculatedOffset(a,h,p,c);this.applyPlacement(g,a);var v=function(){var t=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==t&&n.leave(n)};t.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",v).emulateTransitionEnd(o.TRANSITION_DURATION):v()}},o.prototype.applyPlacement=function(e,o){var i=this.tip(),n=i[0].offsetWidth,s=i[0].offsetHeight,r=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(r)&&(r=0),isNaN(a)&&(a=0),e.top=e.top+r,e.left=e.left+a,t.offset.setOffset(i[0],t.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),i.addClass("in");var l=i[0].offsetWidth,d=i[0].offsetHeight;"top"==o&&d!=s&&(e.top=e.top+s-d);var h=this.getViewportAdjustedDelta(o,e,l,d);h.left?e.left+=h.left:e.top+=h.top;var p=/top|bottom/.test(o),c=p?2*h.left-n+l:2*h.top-s+d,f=p?"offsetWidth":"offsetHeight";i.offset(e),this.replaceArrow(c,i[0][f],p)},o.prototype.replaceArrow=function(t,e,o){this.arrow().css(o?"left":"top",50*(1-t/e)+"%").css(o?"top":"left","")},o.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},o.prototype.hide=function(e){function i(){"in"!=n.hoverState&&s.detach(),n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}var n=this,s=t(this.$tip),r=t.Event("hide.bs."+this.type);return this.$element.trigger(r),r.isDefaultPrevented()?void 0:(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",i).emulateTransitionEnd(o.TRANSITION_DURATION):i(),this.hoverState=null,this)},o.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},o.prototype.hasContent=function(){return this.getTitle()},o.prototype.getPosition=function(e){e=e||this.$element;var o=e[0],i="BODY"==o.tagName,n=o.getBoundingClientRect();null==n.width&&(n=t.extend({},n,{width:n.right-n.left,height:n.bottom-n.top}));var s=i?{top:0,left:0}:e.offset(),r={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},a=i?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},n,r,a,s)},o.prototype.getCalculatedOffset=function(t,e,o,i){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-o/2}:"top"==t?{top:e.top-i,left:e.left+e.width/2-o/2}:"left"==t?{top:e.top+e.height/2-i/2,left:e.left-o}:{top:e.top+e.height/2-i/2,left:e.left+e.width}},o.prototype.getViewportAdjustedDelta=function(t,e,o,i){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,r=this.getPosition(this.$viewport);if(/right|left/.test(t)){var a=e.top-s-r.scroll,l=e.top+s-r.scroll+i;a<r.top?n.top=r.top-a:l>r.top+r.height&&(n.top=r.top+r.height-l)}else{var d=e.left-s,h=e.left+s+o;d<r.left?n.left=r.left-d:h>r.width&&(n.left=r.left+r.width-h)}return n},o.prototype.getTitle=function(){var t,e=this.$element,o=this.options;return t=e.attr("data-original-title")||("function"==typeof o.title?o.title.call(e[0]):o.title)},o.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},o.prototype.tip=function(){return this.$tip=this.$tip||t(this.options.template)},o.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},o.prototype.enable=function(){this.enabled=!0},o.prototype.disable=function(){this.enabled=!1},o.prototype.toggleEnabled=function(){this.enabled=!this.enabled},o.prototype.toggle=function(e){var o=this;e&&(o=t(e.currentTarget).data("bs."+this.type),o||(o=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,o))),o.tip().hasClass("in")?o.leave(o):o.enter(o)},o.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type)})};var i=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=o,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=i,this}}(jQuery);
1
  /*!
2
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
3
  * Copyright 2011-2015 Twitter, Inc.
4
+ * Licensed under the MIT license
5
  */
6
+ if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");
7
+ d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
 
 
 
 
skin/adminhtml/base/default/js/BackupGuardFree/less.min.js CHANGED
@@ -10,7 +10,7 @@
10
  /** * @license Apache v2
11
  */
12
 
13
- !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b){var c=a("./utils").addDataAttr,d=a("./browser");b.exports=function(a,b){c(b,d.currentScript(a)),void 0===b.isFileProtocol&&(b.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(a.location.protocol)),b.async=b.async||!1,b.fileAsync=b.fileAsync||!1,b.poll=b.poll||(b.isFileProtocol?1e3:1500),b.env=b.env||("127.0.0.1"==a.location.hostname||"0.0.0.0"==a.location.hostname||"localhost"==a.location.hostname||a.location.port&&a.location.port.length>0||b.isFileProtocol?"development":"production");var e=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);e&&(b.dumpLineNumbers=e[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0)}},{"./browser":3,"./utils":9}],2:[function(a,b){a("promise/polyfill.js");var c=window.less||{};a("./add-default-options")(window,c);var d=b.exports=a("./index")(window,c);c.onReady&&(/!watch/.test(window.location.hash)&&d.watch(),d.pageLoadFinished=d.registerStylesheets().then(function(){return d.refresh("development"===d.env)}))},{"./add-default-options":1,"./index":7,"promise/polyfill.js":94}],3:[function(a,b){var c=a("./utils");b.exports={createCSS:function(a,b,d){var e=d.href||"",f="less:"+(d.title||c.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),d.media&&i.setAttribute("media",d.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=d&&d.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":9}],4:[function(a,b){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,e),d.setItem(a+":timestamp",b)}catch(f){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b){var c=d&&d.getItem(a),e=d&&d.getItem(a+":timestamp");return e&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(e).valueOf()?c:void 0}}}},{}],5:[function(a,b){var c=a("./utils"),d=a("./browser");b.exports=function(a,b,e){function f(b,f){var g,h,i="less-error-message:"+c.extractId(f||""),j='<li><label>{line}</label><pre class="{class}">{content}</pre></li>',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="<h3>"+(b.type||"Syntax")+"Error: "+(b.message||"There is an error in your .less file")+'</h3><p>in <a href="'+m+'">'+n+"</a> ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.extract&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":</p><ul>"+l.join("")+"</ul>"),b.stack&&(b.extract||e.logLevel>=4)&&(h+="<br/>Stack Trace</br />"+b.stack.split("\n").slice(1).join("<br/>")),k.innerHTML=h,d.createCSS(a.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),k.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===e.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(a,b){e.errorReporting&&"html"!==e.errorReporting?"console"===e.errorReporting?k(a,b):"function"==typeof e.errorReporting&&e.errorReporting("add",a,b):f(a,b)}function h(b){var d=a.document.getElementById("less-error-message:"+c.extractId(b));d&&d.parentNode.removeChild(d)}function i(){}function j(a){e.errorReporting&&"html"!==e.errorReporting?"console"===e.errorReporting?i(a):"function"==typeof e.errorReporting&&e.errorReporting("remove",a):h(a)}function k(a,c){var d="{line} {content}",f=a.filename||c,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,b,c){void 0!==a.extract[b]&&g.push(d.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.extract&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||e.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}return{add:g,remove:j}}},{"./browser":3,"./utils":9}],6:[function(a,b){b.exports=function(b,c){function d(){if(window.XMLHttpRequest&&!("file:"===window.location.protocol&&"ActiveXObject"in window))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return c.error("browser doesn't support AJAX."),null}}var e=a("../less/environment/abstract-file-manager.js"),f={},g=function(){};return g.prototype=new e,g.prototype.alwaysMakePathsAbsolute=function(){return!0},g.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},g.prototype.doXHR=function(a,e,f,g){function h(b,c,d){b.status>=200&&300>b.status?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var i=d(),j=b.isFileProtocol?b.fileAsync:b.async;"function"==typeof i.overrideMimeType&&i.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),i.open("GET",a,j),i.setRequestHeader("Accept",e||"text/x-less, text/css; q=0.9, */*; q=0.5"),i.send(null),b.isFileProtocol&&!b.fileAsync?0===i.status||i.status>=200&&300>i.status?f(i.responseText):g(i.status,a):j?i.onreadystatechange=function(){4==i.readyState&&h(i,f,g)}:h(i,f,g)},g.prototype.supports=function(){return!0},g.prototype.clearFileCache=function(){f={}},g.prototype.loadFile=function(a,b,c,d,e){b&&!this.isPathAbsolute(a)&&(a=b+a),c=c||{};var g=this.extractUrlParts(a,window.location.href),h=g.url;if(c.useFileCache&&f[h])try{var i=f[h];e(null,{contents:i,filename:h,webInfo:{lastModified:new Date}})}catch(j){e({filename:h,message:"Error loading file "+h+" error was "+j.message})}else this.doXHR(h,c.mime,function(a,b){f[h]=a,e(null,{contents:a,filename:h,webInfo:{lastModified:b}})},function(a,b){e({type:"File",message:"'"+b+"' wasn't found ("+a+")",href:h})})},g}},{"../less/environment/abstract-file-manager.js":14}],7:[function(a,b){var c=a("./utils").addDataAttr,d=a("./browser");b.exports=function(b,e){function f(a){return e.postProcessor&&"function"==typeof e.postProcessor&&(a=e.postProcessor.call(a,a)||a),a}function g(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function h(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function i(a){for(var b,c=m.getElementsByTagName("style"),d=0;c.length>d;d++)if(b=c[d],b.type.match(t)){var f=g(e);f.modifyVars=a;var i=b.innerHTML||"";f.filename=m.location.href.replace(/#.*$/,""),n.render(i,f,h(function(a,b,c){b?r.add(b,"inline"):(a.type="text/css",a.styleSheet?a.styleSheet.cssText=c.css:a.innerHTML=c.css)},null,b))}}function j(a,b,d,h,i){function j(c){var e=c.contents,g=c.filename,i=c.webInfo,j={currentDirectory:q.getPath(g),filename:g,rootFilename:g,relativeUrls:k.relativeUrls};if(j.entryPath=j.currentDirectory,j.rootpath=k.rootpath||j.currentDirectory,i&&(i.remaining=h,!k.modifyVars)){var l=s.getCSS(g,i);if(!d&&l)return i.local=!0,void b(null,l,e,a,i,g)}r.remove(g),k.rootFileInfo=j,n.render(e,k,function(c,d){c?(c.href=g,b(c)):(d.css=f(d.css),k.modifyVars||s.setCSS(a.href,i.lastModified,d.css),b(null,d.css,e,a,i,g))})}var k=g(e);c(k,a),k.mime=a.type,i&&(k.modifyVars=i),q.loadFile(a.href,null,k,o,function(a,c){return a?void b(a):void j(c)})}function k(a,b,c){for(var d=0;n.sheets.length>d;d++)j(n.sheets[d],a,b,n.sheets.length-(d+1),c)}function l(){"development"===n.env&&(n.watchTimer=setInterval(function(){n.watchMode&&(q.clearFileCache(),k(function(a,c,e,f){a?r.add(a,a.href||f.href):c&&d.createCSS(b.document,c,f)}))},e.poll))}var m=b.document,n=a("../less")();n.options=e;var o=n.environment,p=a("./file-manager")(e,n.logger),q=new p;o.addFileManager(q),n.FileManager=p,a("./log-listener")(n,e);var r=a("./error-reporting")(b,n,e),s=n.cache=e.cache||a("./cache")(b,e,n.logger);e.functions&&n.functions.functionRegistry.addMultiple(e.functions);var t=/^text\/(x-)?less$/;return n.watch=function(){return n.watchMode||(n.env="development",l()),this.watchMode=!0,!0},n.unwatch=function(){return clearInterval(n.watchTimer),this.watchMode=!1,!1},n.registerStylesheets=function(){return new Promise(function(a){var b=m.getElementsByTagName("link");n.sheets=[];for(var c=0;b.length>c;c++)("less_inc"===b[c].id||b[c].rel.match(/stylesheet/)&&b[c].type.match(t))&&n.sheets.push(b[c]);a()})},n.modifyVars=function(a){return n.refresh(!0,a,!1)},n.refresh=function(a,c,e){return(a||e)&&e!==!1&&q.clearFileCache(),new Promise(function(e,f){var g,h,j;g=h=new Date,k(function(a,c,i,k,l){return a?(r.add(a,a.href||k.href),void f(a)):(n.logger.info(l.local?"loading "+k.href+" from cache.":"rendered "+k.href+" successfully."),d.createCSS(b.document,c,k),n.logger.info("css for "+k.href+" generated in "+(new Date-h)+"ms"),0===l.remaining&&(j=new Date-g,n.logger.info("less has finished. css generated in "+j+"ms"),e({startTime:g,endTime:h,totalMilliseconds:j,sheets:n.sheets.length})),void(h=new Date))},a,c),i(c)})},n.refreshStyles=i,n}},{"../less":29,"./browser":3,"./cache":4,"./error-reporting":5,"./file-manager":6,"./log-listener":8,"./utils":9}],8:[function(a,b){b.exports=function(a,b){var c=4,d=3,e=2,f=1;b.logLevel="undefined"!=typeof b.logLevel?b.logLevel:"development"===b.env?d:f,b.loggers||(b.loggers=[{debug:function(a){b.logLevel>=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;b.loggers.length>g;g++)a.logger.addListener(b.loggers[g])}},{}],9:[function(a,b){b.exports={extractId:function(a){return a.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/[\?\&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")},addDataAttr:function(a,b){for(var c in b.dataset)if(b.dataset.hasOwnProperty(c))if("env"===c||"dumpLineNumbers"===c||"rootpath"===c||"errorReporting"===c)a[c]=b.dataset[c];else try{a[c]=JSON.parse(b.dataset[c])}catch(d){}}}},{}],10:[function(a,b){var c={};b.exports=c;var d=function(a,b,c){if(a)for(var d=0;c.length>d;d++)a.hasOwnProperty(c[d])&&(b[c[d]]=a[c[d]])},e=["paths","relativeUrls","rootpath","strictImports","insecure","dumpLineNumbers","compress","syncImport","chunkInput","mime","useFileCache","processImports","reference","pluginManager"];c.Parse=function(a){d(a,this,e),"string"==typeof this.paths&&(this.paths=[this.paths])};var f=["paths","compress","ieCompat","strictMath","strictUnits","sourceMap","importMultiple","urlArgs","javascriptEnabled","pluginManager","importantScope"];c.Eval=function(a,b){d(a,this,f),"string"==typeof this.paths&&(this.paths=[this.paths]),this.frames=b||[],this.importantScope=this.importantScope||[]},c.Eval.prototype.inParenthesis=function(){this.parensStack||(this.parensStack=[]),this.parensStack.push(!0)},c.Eval.prototype.outOfParenthesis=function(){this.parensStack.pop()},c.Eval.prototype.isMathOn=function(){return this.strictMath?this.parensStack&&this.parensStack.length:!0},c.Eval.prototype.isPathRelative=function(a){return!/^(?:[a-z-]+:|\/|#)/i.test(a)},c.Eval.prototype.normalizePath=function(a){var b,c=a.split("/").reverse();for(a=[];0!==c.length;)switch(b=c.pop()){case".":break;case"..":0===a.length||".."===a[a.length-1]?a.push(b):a.pop();break;default:a.push(b)}return a.join("/")}},{}],11:[function(a,b){b.exports={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},{}],12:[function(a,b){b.exports={colors:a("./colors"),unitConversions:a("./unit-conversions")}},{"./colors":11,"./unit-conversions":13}],13:[function(a,b){b.exports={length:{m:1,cm:.01,mm:.001,"in":.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}}},{}],14:[function(a,b){var c=function(){};c.prototype.getPath=function(a){var b=a.lastIndexOf("?");return b>0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),0>b&&(b=a.lastIndexOf("\\")),0>b?"":a.slice(0,b+1)},c.prototype.tryAppendExtension=function(a,b){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+b},c.prototype.tryAppendLessExtension=function(a){return this.tryAppendExtension(a,".less")},c.prototype.supportsSync=function(){return!1},c.prototype.alwaysMakePathsAbsolute=function(){return!1},c.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\|#)/i.test(a)},c.prototype.join=function(a,b){return a?a+b:b},c.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;d>c&&h.directories[c]===g.directories[c];c++);for(f=h.directories.slice(c),e=g.directories.slice(c),c=0;f.length-1>c;c++)i+="../";for(c=0;e.length-1>c;c++)i+=e[c]+"/";return i},c.prototype.extractUrlParts=function(a,b){var c,d,e=/^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i,f=a.match(e),g={},h=[];if(!f)throw new Error("Could not parse sheet href - '"+a+"'");if(b&&(!f[1]||f[2])){if(d=b.match(e),!d)throw new Error("Could not parse page url - '"+b+"'");f[1]=f[1]||d[1]||"",f[2]||(f[3]=d[3]+f[3])}if(f[3]){for(h=f[3].replace(/\\/g,"/").split("/"),c=0;h.length>c;c++)"."===h[c]&&(h.splice(c,1),c-=1);for(c=0;h.length>c;c++)".."===h[c]&&c>0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=(f[1]||"")+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g},b.exports=c},{}],15:[function(a,b){var c=a("../logger"),d=function(a,b){this.fileManagers=b||[],a=a||{};for(var c=["encodeBase64","mimeLookup","charsetLookup","getSourceMapGenerator"],d=[],e=d.concat(c),f=0;e.length>f;f++){var g=e[f],h=a[g];h?this[g]=h.bind(a):d.length>f&&this.warn("missing required function in environment - "+g)}};d.prototype.getFileManager=function(a,b,d,e,f){a||c.warn("getFileManager called with no filename.. Please report this issue. continuing."),null==b&&c.warn("getFileManager called with null directory.. Please report this issue. continuing.");var g=this.fileManagers;d.pluginManager&&(g=[].concat(g).concat(d.pluginManager.getFileManagers()));for(var h=g.length-1;h>=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,d,e))return i}return null},d.prototype.addFileManager=function(a){this.fileManagers.push(a)},d.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=d},{"../logger":31}],16:[function(a){function b(a,b,d){var e,f,g,h,i=b.alpha,j=d.alpha,k=[];g=j+i*(1-j);for(var l=0;3>l;l++)e=b.rgb[l]/255,f=d.rgb[l]/255,h=a(e,f),g&&(h=(j*f+i*(e-j*(e+f-h)))/g),k[l]=255*h;return new c(k,g)}var c=a("../tree/color"),d=a("./function-registry"),e={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,1>=a?e.multiply(a,b):e.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return e.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var f in e)e.hasOwnProperty(f)&&(b[f]=b.bind(null,e[f]));d.addMultiple(b)},{"../tree/color":48,"./function-registry":21}],17:[function(a){function b(a){return Math.min(1,Math.max(0,a))}function c(a){return f.hsla(a.h,a.s,a.l,a.a)}function d(a){if(a instanceof g)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function e(a,b){return a instanceof g&&a.unit.is("%")?parseFloat(a.value*b/100):d(a)}var f,g=a("../tree/dimension"),h=a("../tree/color"),i=a("../tree/quoted"),j=a("../tree/anonymous"),k=a("./function-registry");f={rgb:function(a,b,c){return f.rgba(a,b,c,1)},rgba:function(a,b,c,f){var g=[a,b,c].map(function(a){return e(a,255)});return f=d(f),new h(g,f)},hsl:function(a,b,c){return f.hsla(a,b,c,1)},hsla:function(a,c,e,g){function h(a){return a=0>a?a+1:a>1?a-1:a,1>6*a?j+(i-j)*a*6:1>2*a?i:2>3*a?j+(i-j)*(2/3-a)*6:j}a=d(a)%360/360,c=b(d(c)),e=b(d(e)),g=b(d(g));var i=.5>=e?e*(c+1):e+c-e*c,j=2*e-i;return f.rgba(255*h(a+1/3),255*h(a),255*h(a-1/3),g)},hsv:function(a,b,c){return f.hsva(a,b,c,1)},hsva:function(a,b,c,e){a=d(a)%360/360*360,b=d(b),c=d(c),e=d(e);var g,h;g=Math.floor(a/60%6),h=a/60-g;var i=[c,c*(1-b),c*(1-h*b),c*(1-(1-h)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return f.rgba(255*i[j[g][0]],255*i[j[g][1]],255*i[j[g][2]],e)},hue:function(a){return new g(a.toHSL().h)},saturation:function(a){return new g(100*a.toHSL().s,"%")},lightness:function(a){return new g(100*a.toHSL().l,"%")},hsvhue:function(a){return new g(a.toHSV().h)},hsvsaturation:function(a){return new g(100*a.toHSV().s,"%")},hsvvalue:function(a){return new g(100*a.toHSV().v,"%")},red:function(a){return new g(a.rgb[0])},green:function(a){return new g(a.rgb[1])},blue:function(a){return new g(a.rgb[2])},alpha:function(a){return new g(a.toHSL().a)},luma:function(a){return new g(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new g(b*a.alpha*100,"%")},saturate:function(a,d,e){if(!a.rgb)return null;var f=a.toHSL();return f.s+="undefined"!=typeof e&&"relative"===e.value?f.s*d.value/100:d.value/100,f.s=b(f.s),c(f)},desaturate:function(a,d,e){var f=a.toHSL();return f.s-="undefined"!=typeof e&&"relative"===e.value?f.s*d.value/100:d.value/100,f.s=b(f.s),c(f)},lighten:function(a,d,e){var f=a.toHSL();return f.l+="undefined"!=typeof e&&"relative"===e.value?f.l*d.value/100:d.value/100,f.l=b(f.l),c(f)},darken:function(a,d,e){var f=a.toHSL();return f.l-="undefined"!=typeof e&&"relative"===e.value?f.l*d.value/100:d.value/100,f.l=b(f.l),c(f)},fadein:function(a,d,e){var f=a.toHSL();return f.a+="undefined"!=typeof e&&"relative"===e.value?f.a*d.value/100:d.value/100,f.a=b(f.a),c(f)},fadeout:function(a,d,e){var f=a.toHSL();return f.a-="undefined"!=typeof e&&"relative"===e.value?f.a*d.value/100:d.value/100,f.a=b(f.a),c(f)},fade:function(a,d){var e=a.toHSL();return e.a=d.value/100,e.a=b(e.a),c(e)},spin:function(a,b){var d=a.toHSL(),e=(d.h+b.value)%360;return d.h=0>e?360+e:e,c(d)},mix:function(a,b,c){a.toHSL&&b.toHSL||(console.log(b.type),console.dir(b)),c||(c=new g(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,i=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,j=1-i,k=[a.rgb[0]*i+b.rgb[0]*j,a.rgb[1]*i+b.rgb[1]*j,a.rgb[2]*i+b.rgb[2]*j],l=a.alpha*d+b.alpha*(1-d);return new h(k,l)},greyscale:function(a){return f.desaturate(a,new g(100))},contrast:function(a,b,c,e){if(!a.rgb)return null;if("undefined"==typeof c&&(c=f.rgba(255,255,255,1)),"undefined"==typeof b&&(b=f.rgba(0,0,0,1)),b.luma()>c.luma()){var g=c;c=b,b=g}return e="undefined"==typeof e?.43:d(e),a.luma()<e?c:b},argb:function(a){return new j(a.toARGB())},color:function(a){if(a instanceof i&&/^#([a-f0-9]{6}|[a-f0-9]{3})$/i.test(a.value))return new h(a.value.slice(1));if(a instanceof h||(a=h.fromKeyword(a.value)))return a.value=void 0,a;throw{type:"Argument",message:"argument must be a color keyword or 3/6 digit hex e.g. #FFF"}},tint:function(a,b){return f.mix(f.rgb(255,255,255),a,b)},shade:function(a,b){return f.mix(f.rgb(0,0,0),a,b)}},k.addMultiple(f)},{"../tree/anonymous":44,"../tree/color":48,"../tree/dimension":54,"../tree/quoted":71,"./function-registry":21}],18:[function(a,b){b.exports=function(b){var c=a("../tree/quoted"),d=a("../tree/url"),e=a("./function-registry"),f=function(a,b){return new d(b,a.index,a.currentFileInfo).eval(a.context)},g=a("../logger");e.add("data-uri",function(a,e){e||(e=a,a=null);var h=a&&a.value,i=e.value,j=this.currentFileInfo,k=j.relativeUrls?j.currentDirectory:j.entryPath,l=i.indexOf("#"),m="";-1!==l&&(m=i.slice(l),i=i.slice(0,l));var n=b.getFileManager(i,k,this.context,b,!0);if(!n)return f(this,e);var o=!1;if(a)o=/;base64$/.test(h);else{if(h=b.mimeLookup(i),"image/svg+xml"===h)o=!1;else{var p=b.charsetLookup(h);o=["US-ASCII","UTF-8"].indexOf(p)<0}o&&(h+=";base64")}var q=n.loadFileSync(i,k,this.context,b);if(!q.contents)return g.warn("Skipped data-uri embedding of "+i+" because file not found"),f(this,e||a);var r=q.contents;if(o&&!b.encodeBase64)return f(this,e);r=o?b.encodeBase64(r):encodeURIComponent(r);var s="data:"+h+","+r+m,t=32768;return s.length>=t&&this.context.ieCompat!==!1?(g.warn("Skipped data-uri embedding of "+i+" because its size ("+s.length+" characters) exceeds IE8-safe "+t+" characters!"),f(this,e||a)):new d(new c('"'+s+'"',s,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":31,"../tree/quoted":71,"../tree/url":78,"./function-registry":21}],19:[function(a,b){var c=a("../tree/keyword"),d=a("./function-registry"),e={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;return null!=a?a?c.True:c.False:void 0},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};d.add("default",e.eval.bind(e)),b.exports=e},{"../tree/keyword":63,"./function-registry":21}],20:[function(a,b){var c=a("../tree/expression"),d=function(a,b,c,d){this.name=a.toLowerCase(),this.index=c,this.context=b,this.currentFileInfo=d,this.func=b.frames[0].functionRegistry.get(this.name)};d.prototype.isValid=function(){return Boolean(this.func)},d.prototype.call=function(a){return Array.isArray(a)&&(a=a.filter(function(a){return"Comment"===a.type?!1:!0}).map(function(a){if("Expression"===a.type){var b=a.value.filter(function(a){return"Comment"===a.type?!1:!0});return 1===b.length?b[0]:new c(b)}return a})),this.func.apply(this,a)},b.exports=d},{"../tree/expression":57}],21:[function(a,b){function c(a){return{_data:{},add:function(a,b){a=a.toLowerCase(),this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(b){return this._data[b]||a&&a.get(b)},inherit:function(){return c(this)}}}b.exports=c(null)},{}],22:[function(a,b){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./color":17,"./color-blending":16,"./data-uri":18,"./default":19,"./function-caller":20,"./function-registry":21,"./math":23,"./number":24,"./string":25,"./svg":26,"./types":27}],23:[function(a){function b(a,b,d){if(!(d instanceof c))throw{type:"Argument",message:"argument must be a number"};return null==b?b=d.unit:d=d.unify(),new c(a(parseFloat(d.value)),b)}var c=a("../tree/dimension"),d=a("./function-registry"),e={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"};for(var f in e)e.hasOwnProperty(f)&&(e[f]=b.bind(null,Math[f],e[f]));e.round=function(a,c){var d="undefined"==typeof c?0:c.value;return b(function(a){return a.toFixed(d)},null,a)},d.addMultiple(e)},{"../tree/dimension":54,"./function-registry":21}],24:[function(a){var b=a("../tree/dimension"),c=a("../tree/anonymous"),d=a("./function-registry"),e=function(a,d){switch(d=Array.prototype.slice.call(d),d.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var e,f,g,h,i,j,k,l,m=[],n={};for(e=0;d.length>e;e++)if(g=d[e],g instanceof b)if(h=""===g.unit.toString()&&void 0!==l?new b(g.value,l).unify():g.unify(),j=""===h.unit.toString()&&void 0!==k?k:h.unit.toString(),k=""!==j&&void 0===k||""!==j&&""===m[0].unify().unit.toString()?j:k,l=""!==j&&void 0===l?g.unit.toString():l,f=void 0!==n[""]&&""!==j&&j===k?n[""]:n[j],void 0!==f)i=""===m[f].unit.toString()&&void 0!==l?new b(m[f].value,l).unify():m[f].unify(),(a&&i.value>h.value||!a&&h.value>i.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(d[e].value)&&Array.prototype.push.apply(d,Array.prototype.slice.call(d[e].value));return 1==m.length?m[0]:(d=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new c((a?"min":"max")+"("+d+")"))};d.addMultiple({min:function(){return e(!0,arguments)},max:function(){return e(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new b(Math.PI)},mod:function(a,c){return new b(a.value%c.value,a.unit)},pow:function(a,c){if("number"==typeof a&&"number"==typeof c)a=new b(a),c=new b(c);else if(!(a instanceof b&&c instanceof b))throw{type:"Argument",message:"arguments must be numbers"};return new b(Math.pow(a.value,c.value),a.unit)},percentage:function(a){return new b(100*a.value,"%")}})},{"../tree/anonymous":44,"../tree/dimension":54,"./function-registry":21}],25:[function(a){var b=a("../tree/quoted"),c=a("../tree/anonymous"),d=a("../tree/javascript"),e=a("./function-registry");e.addMultiple({e:function(a){return new c(a instanceof d?a.evaluated:a.value)},escape:function(a){return new c(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,c,d,e){var f=a.value;return d="Quoted"===d.type?d.value:d.toCSS(),f=f.replace(new RegExp(c.value,e?e.value:""),d),new b(a.quote||"",f,a.escaped)},"%":function(a){for(var c=Array.prototype.slice.call(arguments,1),d=a.value,e=0;c.length>e;e++)d=d.replace(/%[sda]/i,function(a){var b="Quoted"===c[e].type&&a.match(/s/i)?c[e].value:c[e].toCSS();return a.match(/[A-Z]$/)?encodeURIComponent(b):b});return d=d.replace(/%%/g,"%"),new b(a.quote||"",d,a.escaped)}})},{"../tree/anonymous":44,"../tree/javascript":61,"../tree/quoted":71,"./function-registry":21}],26:[function(a,b){b.exports=function(){var b=a("../tree/dimension"),c=a("../tree/color"),d=a("../tree/expression"),e=a("../tree/quoted"),f=a("../tree/url"),g=a("./function-registry");g.add("svg-gradient",function(a){function g(){throw{type:"Argument",message:"svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] or direction, color list"}}var h,i,j,k,l,m,n,o,p="linear",q='x="0" y="0" width="1" height="1"',r={compress:!1},s=a.toCSS(r);switch(2==arguments.length?(arguments[1].value.length<2&&g(),h=arguments[1].value):arguments.length<3?g():h=Array.prototype.slice.call(arguments,1),s){case"to bottom":i='x1="0%" y1="0%" x2="0%" y2="100%"';break;case"to right":i='x1="0%" y1="0%" x2="100%" y2="0%"';break;case"to bottom right":i='x1="0%" y1="0%" x2="100%" y2="100%"';break;case"to top right":i='x1="0%" y1="100%" x2="100%" y2="0%"';break;case"ellipse":case"ellipse at center":p="radial",i='cx="50%" cy="50%" r="75%"',q='x="-50" y="-50" width="101" height="101"';break;default:throw{type:"Argument",message:"svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'"}}for(j='<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><'+p+'Gradient id="gradient" gradientUnits="userSpaceOnUse" '+i+">",
14
  k=0;h.length>k;k+=1)h[k]instanceof d?(l=h[k].value[0],m=h[k].value[1]):(l=h[k],m=void 0),l instanceof c&&((0===k||k+1===h.length)&&void 0===m||m instanceof b)||g(),n=m?m.toCSS(r):0===k?"0%":"100%",o=l.alpha,j+='<stop offset="'+n+'" stop-color="'+l.toRGB()+'"'+(1>o?' stop-opacity="'+o+'"':"")+"/>";return j+="</"+p+"Gradient><rect "+q+' fill="url(#gradient)" /></svg>',j=encodeURIComponent(j),j="data:image/svg+xml,"+j,new f(new e("'"+j+"'",j,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":48,"../tree/dimension":54,"../tree/expression":57,"../tree/quoted":71,"../tree/url":78,"./function-registry":21}],27:[function(a){var b=a("../tree/keyword"),c=a("../tree/detached-ruleset"),d=a("../tree/dimension"),e=a("../tree/color"),f=a("../tree/quoted"),g=a("../tree/anonymous"),h=a("../tree/url"),i=a("../tree/operation"),j=a("./function-registry"),k=function(a,c){return a instanceof c?b.True:b.False},l=function(a,c){if(void 0===c)throw{type:"Argument",message:"missing the required second argument to isunit."};if(c="string"==typeof c.value?c.value:c,"string"!=typeof c)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."};return a instanceof d&&a.unit.is(c)?b.True:b.False},m=function(a){var b=Array.isArray(a.value)?a.value:Array(a);return b};j.addMultiple({isruleset:function(a){return k(a,c)},iscolor:function(a){return k(a,e)},isnumber:function(a){return k(a,d)},isstring:function(a){return k(a,f)},iskeyword:function(a){return k(a,b)},isurl:function(a){return k(a,h)},ispixel:function(a){return l(a,"px")},ispercentage:function(a){return l(a,"%")},isem:function(a){return l(a,"em")},isunit:l,unit:function(a,c){if(!(a instanceof d))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof i?". Have you forgotten parenthesis?":"")};return c=c?c instanceof b?c.value:c.toCSS():"",new d(a.value,c)},"get-unit":function(a){return new g(a.unit)},extract:function(a,b){return b=b.value-1,m(a)[b]},length:function(a){return new d(m(a).length)}})},{"../tree/anonymous":44,"../tree/color":48,"../tree/detached-ruleset":53,"../tree/dimension":54,"../tree/keyword":63,"../tree/operation":69,"../tree/quoted":71,"../tree/url":78,"./function-registry":21}],28:[function(a,b){var c=a("./contexts"),d=a("./parser/parser"),e=a("./plugins/function-importer");b.exports=function(a){var b=function(a,b){this.rootFilename=b.filename,this.paths=a.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=a.mime,this.error=null,this.context=a,this.queue=[],this.files={}};return b.prototype.push=function(b,f,g,h,i){var j=this;this.queue.push(b);var k=function(a,c,d){j.queue.splice(j.queue.indexOf(b),1);var e=d===j.rootFilename;h.optional&&a?i(null,{rules:[]},!1,null):(j.files[d]=c,a&&!j.error&&(j.error=a),i(a,c,e,d))},l={relativeUrls:this.context.relativeUrls,entryPath:g.entryPath,rootpath:g.rootpath,rootFilename:g.rootFilename},m=a.getFileManager(b,g.currentDirectory,this.context,a);if(!m)return void k({message:"Could not find a file-manager for "+b});f&&(b=m.tryAppendExtension(b,h.plugin?".js":".less"));var n=function(a){var b=a.filename,f=a.contents.replace(/^\uFEFF/,"");l.currentDirectory=m.getPath(b),l.relativeUrls&&(l.rootpath=m.join(j.context.rootpath||"",m.pathDiff(l.currentDirectory,l.entryPath)),!m.isPathAbsolute(l.rootpath)&&m.alwaysMakePathsAbsolute()&&(l.rootpath=m.join(l.entryPath,l.rootpath))),l.filename=b;var i=new c.Parse(j.context);i.processImports=!1,j.contents[b]=f,(g.reference||h.reference)&&(l.reference=!0),h.plugin?new e(i,l).eval(f,function(a,c){k(a,c,b)}):h.inline?k(null,f,b):new d(i,j,l).parse(f,function(a,c){k(a,c,b)})},o=m.loadFile(b,g.currentDirectory,this.context,a,function(a,b){a?k(a):n(b)});o&&o.then(n,k)},b}},{"./contexts":10,"./parser/parser":36,"./plugins/function-importer":38}],29:[function(a,b){b.exports=function(b,c){var d,e,f,g,h,i={version:[2,5,0],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")};return i}},{"./contexts":10,"./data":12,"./environment/abstract-file-manager":14,"./environment/environment":15,"./functions":22,"./import-manager":28,"./less-error":30,"./logger":31,"./parse":33,"./parse-tree":32,"./parser/parser":36,"./plugin-manager":37,"./render":39,"./source-map-builder":40,"./source-map-output":41,"./transform-tree":42,"./tree":60,"./utils":81,"./visitors":85}],30:[function(a,b){var c=a("./utils"),d=b.exports=function(a,b,d){Error.call(this);var e=a.filename||d;if(b&&e){var f=b.contents[e],g=c.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&c.getLocation(a.call,f).line,k=f.split("\n");this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.callLine=j+1,this.callExtract=k[j],this.column=i,this.extract=[k[h-1],k[h],k[h+1]]}this.message=a.message,this.stack=a.stack};if("undefined"==typeof Object.create){var e=function(){};e.prototype=Error.prototype,d.prototype=new e}else d.prototype=Object.create(Error.prototype);d.prototype.constructor=d},{"./utils":81}],31:[function(a,b){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;this._listeners.length>b;b++)if(this._listeners[b]===a)return void this._listeners.splice(b,1)},_fireEvent:function(a,b){for(var c=0;this._listeners.length>c;c++){var d=this._listeners[c][a];d&&d(b)}},_listeners:[]}},{}],32:[function(a,b){var c=a("./less-error"),d=a("./transform-tree"),e=a("./logger");b.exports=function(a){var b=function(a,b){this.root=a,this.imports=b};return b.prototype.toCSS=function(b){var f,g,h={};try{f=d(this.root,b)}catch(i){throw new c(i,this.imports)}try{var j=Boolean(b.compress);j&&e.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");var k={compress:j,dumpLineNumbers:b.dumpLineNumbers,strictUnits:Boolean(b.strictUnits),numPrecision:8};b.sourceMap?(g=new a(b.sourceMap),h.css=g.toCSS(f,k,this.imports)):h.css=f.toCSS(k)}catch(i){throw new c(i,this.imports)}if(b.pluginManager)for(var l=b.pluginManager.getPostProcessors(),m=0;l.length>m;m++)h.css=l[m].process(h.css,{sourceMap:g,options:b,imports:this.imports});b.sourceMap&&(h.map=g.getExternalSourceMap()),h.imports=[];for(var n in this.imports.files)this.imports.files.hasOwnProperty(n)&&n!==this.imports.rootFilename&&h.imports.push(n);return h},b}},{"./less-error":30,"./logger":31,"./transform-tree":42}],33:[function(a,b){var c,d=a("./contexts"),e=a("./parser/parser"),f=a("./plugin-manager");b.exports=function(b,g,h){var i=function(b,g,j){if(g=g||{},"function"==typeof g&&(j=g,g={}),!j){c||(c="undefined"==typeof Promise?a("promise"):Promise);var k=this;return new c(function(a,c){i.call(k,b,g,function(b,d){b?c(b):a(d)})})}var l,m,n=new f(this);if(n.addPlugins(g.plugins),g.pluginManager=n,l=new d.Parse(g),g.rootFileInfo)m=g.rootFileInfo;else{var o=g.filename||"input",p=o.replace(/[^\/\\]*$/,"");m={filename:o,relativeUrls:l.relativeUrls,rootpath:l.rootpath||"",currentDirectory:p,entryPath:p,rootFilename:o},m.rootpath&&"/"!==m.rootpath.slice(-1)&&(m.rootpath+="/")}var q=new h(l,m);new e(l,q,m).parse(b,function(a,b){return a?j(a):void j(null,b,q,g)},g)};return i}},{"./contexts":10,"./parser/parser":36,"./plugin-manager":37,promise:void 0}],34:[function(a,b){b.exports=function(a,b){function c(b){var c=h-q;512>c&&!b||!c||(p.push(a.slice(q,h+1)),q=h+1)}var d,e,f,g,h,i,j,k,l,m=a.length,n=0,o=0,p=[],q=0;for(h=0;m>h;h++)if(j=a.charCodeAt(h),!(j>=97&&122>=j||34>j))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(m-1>h){h++;continue}return b("unescaped `\\`",h);case 34:case 39:case 96:for(l=0,i=h,h+=1;m>h;h++)if(k=a.charCodeAt(h),!(k>96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;if(k=a.charCodeAt(h+1),47==k)for(h+=2;m>h&&(k=a.charCodeAt(h),!(13>=k)||10!=k&&13!=k);h++);else if(42==k){for(f=i=h,h+=2;m-1>h&&(k=a.charCodeAt(h),125==k&&(g=h),42!=k||47!=a.charCodeAt(h+1));h++);if(h==m-1)return b("missing closing `*/`",i);h++}continue;case 42:if(m-1>h&&47==a.charCodeAt(h+1))return b("unmatched `/*`",h);continue}return 0!==n?f>d&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],35:[function(a,b){var c=a("./chunker");b.exports=function(){var a,b,d,e,f,g,h,i=[],j={};j.save=function(){h=j.i,i.push({current:g,i:j.i,j:b})},j.restore=function(a){(j.i>d||j.i===d&&a&&!e)&&(d=j.i,e=a);var c=i.pop();g=c.current,h=j.i=c.i,b=c.j},j.forget=function(){i.pop()},j.isWhitespace=function(b){var c=j.i+(b||0),d=a.charCodeAt(c);return d===k||d===n||d===l||d===m},j.$re=function(a){j.i>h&&(g=g.slice(j.i-h),h=j.i);var b=a.exec(g);return b?(s(b[0].length),"string"==typeof b?b:1===b.length?b[0]:b):null},j.$char=function(b){return a.charAt(j.i)!==b?null:(s(1),b)},j.$str=function(b){for(var c=b.length,d=0;c>d;d++)if(a.charAt(j.i+d)!==b.charAt(d))return null;return s(c),b},j.$quoted=function(){var b=a.charAt(j.i);if("'"===b||'"'===b){for(var c=a.length,d=j.i,e=1;c>e+d;e++){var f=a.charAt(e+d);switch(f){case"\\":e++;continue;case"\r":case"\n":break;case b:var g=a.substr(d,e+1);return s(e+1),g}}return null}};var k=32,l=9,m=10,n=13,o=43,p=44,q=47,r=57;j.autoCommentAbsorb=!0,j.commentStore=[],j.finished=!1;var s=function(c){for(var d,e,i,o=j.i,p=b,r=j.i-h,t=j.i+g.length-r,u=j.i+=c,v=a;t>j.i;j.i++){if(d=v.charCodeAt(j.i),j.autoCommentAbsorb&&d===q){if(e=v.charAt(j.i+1),"/"===e){i={index:j.i,isLineComment:!0};var w=v.indexOf("\n",j.i+2);0>w&&(w=t),j.i=w,i.text=v.substr(i.i,j.i-i.i),j.commentStore.push(i);continue}if("*"===e){var x=v.indexOf("*/",j.i+2);if(x>=0){i={index:j.i,text:v.substr(j.i,x+2-j.i),isLineComment:!1},j.i+=i.text.length-1,j.commentStore.push(i);continue}}break}if(d!==k&&d!==m&&d!==l&&d!==n)break}if(g=g.slice(c+j.i-u+r),h=j.i,!g.length){if(f.length-1>b)return g=f[++b],s(0),!0;j.finished=!0}return o!==j.i||p!==b};return j.peek=function(b){if("string"==typeof b){for(var c=0;b.length>c;c++)if(a.charAt(j.i+c)!==b.charAt(c))return!1;return!0}return b.test(g)},j.peekChar=function(b){return a.charAt(j.i)===b},j.currentChar=function(){return a.charAt(j.i)},j.getInput=function(){return a},j.peekNotNumeric=function(){var b=a.charCodeAt(j.i);return b>r||o>b||b===q||b===p},j.start=function(e,i,k){a=e,j.i=b=h=d=0,f=i?c(e,k):[e],g=f[0],s(0)},j.end=function(){var b,c=j.i>=a.length;return d>j.i&&(b=e,j.i=d),{isFinished:c,furthest:j.i,furthestPossibleErrorMessage:b,furthestReachedEnd:j.i>=a.length-1,furthestChar:a[j.i]}},j}},{"./chunker":34}],36:[function(a,b){var c=a("../less-error"),d=a("../tree"),e=a("../visitors"),f=a("./parser-input"),g=a("../utils"),h=function i(a,b,h){function j(a,b){var c="[object Function]"===Object.prototype.toString.call(a)?a.call(n):o.$re(a);return c?c:void l(b||("string"==typeof a?"expected '"+a+"' got '"+o.currentChar()+"'":"unexpected token"))}function k(a,b){return o.$char(a)?a:void l(b||"expected '"+a+"' got '"+o.currentChar()+"'")}function l(a,d){throw new c({index:o.i,filename:h.filename,type:d||"Syntax",message:a},b)}function m(a){var b=h.filename;return{lineNumber:g.getLocation(a,o.getInput()).line+1,fileName:b}}var n,o=f();return{parse:function(f,g,j){var k,l,m,n,p=null,q="";if(l=j&&j.globalVars?i.serializeVars(j.globalVars)+"\n":"",m=j&&j.modifyVars?"\n"+i.serializeVars(j.modifyVars):"",a.pluginManager)for(var r=a.pluginManager.getPreProcessors(),s=0;r.length>s;s++)f=r[s].process(f,{context:a,imports:b,fileInfo:h});(l||j&&j.banner)&&(q=(j&&j.banner?j.banner:"")+l,n=b.contentsIgnoredChars,n[h.filename]=n[h.filename]||0,n[h.filename]+=q.length),f=f.replace(/\r\n?/g,"\n"),f=q+f.replace(/^\uFEFF/,"")+m,b.contents[h.filename]=f;try{o.start(f,a.chunkInput,function(a,d){throw new c({index:d,type:"Parse",message:a,filename:h.filename},b)}),k=new d.Ruleset(null,this.parsers.primary()),k.root=!0,k.firstRoot=!0}catch(t){return g(new c(t,b,h.filename))}var u=o.end();if(!u.isFinished){var v=u.furthestPossibleErrorMessage;v||(v="Unrecognised input","}"===u.furthestChar?v+=". Possibly missing opening '{'":")"===u.furthestChar?v+=". Possibly missing opening '('":u.furthestReachedEnd&&(v+=". Possibly missing something")),p=new c({type:"Parse",message:v,index:u.furthest,filename:h.filename},b)}var w=function(a){return a=p||a||b.error,a?(a instanceof c||(a=new c(a,b,h.filename)),g(a)):g(null,k)};return a.processImports===!1?w():void new e.ImportVisitor(b,w).run(k)},parsers:n={primary:function(){for(var a,b=this.mixin,c=[];;){for(;;){if(a=this.comment(),!a)break;c.push(a)}if(o.finished)break;if(o.peek("}"))break;if(a=this.extendRule())c=c.concat(a);else if(a=b.definition()||this.rule()||this.ruleset()||b.call()||this.rulesetCall()||this.directive())c.push(a);else{for(var d=!1;o.$char(";");)d=!0;if(!d)break}}return c},comment:function(){if(o.commentStore.length){var a=o.commentStore.shift();return new d.Comment(a.text,a.isLineComment,a.index,h)}},entities:{quoted:function(){var a,b=o.i,c=!1;return o.save(),o.$char("~")&&(c=!0),(a=o.$quoted())?(o.forget(),new d.Quoted(a.charAt(0),a.substr(1,a.length-2),c,b,h)):void o.restore()},keyword:function(){var a=o.$char("%")||o.$re(/^[_A-Za-z-][_A-Za-z0-9-]*/);return a?d.Color.fromKeyword(a)||new d.Keyword(a):void 0},call:function(){var a,b,c,e,f=o.i;if(!o.peek(/^url\(/i))return o.save(),(a=o.$re(/^([\w-]+|%|progid:[\w\.]+)\(/))?(a=a[1],b=a.toLowerCase(),"alpha"===b&&(e=n.alpha())?(o.forget(),e):(c=this.arguments(),o.$char(")")?(o.forget(),new d.Call(a,c,f,h)):void o.restore("Could not parse call arguments or missing ')'"))):void o.forget()},arguments:function(){for(var a,b=[];;){if(a=this.assignment()||n.expression(),!a)break;if(b.push(a),!o.$char(","))break}return b},literal:function(){return this.dimension()||this.color()||this.quoted()||this.unicodeDescriptor()},assignment:function(){var a,b;return o.save(),(a=o.$re(/^\w+(?=\s?=)/i))&&o.$char("=")&&(b=n.entity())?(o.forget(),new d.Assignment(a,b)):void o.restore()},url:function(){var a,b=o.i;return o.autoCommentAbsorb=!1,o.$str("url(")?(a=this.quoted()||this.variable()||o.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",o.autoCommentAbsorb=!0,k(")"),new d.URL(null!=a.value||a instanceof d.Variable?a:new d.Anonymous(a),b,h)):void(o.autoCommentAbsorb=!0)},variable:function(){var a,b=o.i;return"@"===o.currentChar()&&(a=o.$re(/^@@?[\w-]+/))?new d.Variable(a,b,h):void 0},variableCurly:function(){var a,b=o.i;return"@"===o.currentChar()&&(a=o.$re(/^@\{([\w-]+)\}/))?new d.Variable("@"+a[1],b,h):void 0},color:function(){var a;if("#"===o.currentChar()&&(a=o.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){var b=a.input.match(/^#([\w]+).*/);return b=b[1],b.match(/^[A-Fa-f0-9]+$/)||l("Invalid HEX color code"),new d.Color(a[1])}},dimension:function(){if(!o.peekNotNumeric()){var a=o.$re(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/i);return a?new d.Dimension(a[1],a[2]):void 0}},unicodeDescriptor:function(){var a;return a=o.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/),a?new d.UnicodeDescriptor(a[0]):void 0},javascript:function(){var a,b=o.i;o.save();var c=o.$char("~"),e=o.$char("`");return e?(a=o.$re(/^[^`]*`/))?(o.forget(),new d.JavaScript(a.substr(0,a.length-1),Boolean(c),b,h)):void o.restore("invalid javascript definition"):void o.restore()}},variable:function(){var a;return"@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*:/))?a[1]:void 0},rulesetCall:function(){var a;return"@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*\(\s*\)\s*;/))?new d.RulesetCall(a[1]):void 0},extend:function(a){var b,c,e,f,g,h=o.i;if(o.$str(a?"&:extend(":":extend(")){do{for(e=null,b=null;!(e=o.$re(/^(all)(?=\s*(\)|,))/))&&(c=this.element());)b?b.push(c):b=[c];e=e&&e[1],b||l("Missing target selector for :extend()."),g=new d.Extend(new d.Selector(b),e,h),f?f.push(g):f=[g]}while(o.$char(","));return j(/^\)/),a&&j(/^;/),f}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var a,b,c,e,f,g,i=o.currentChar(),j=!1,l=o.i;if("."===i||"#"===i){for(o.save();;){if(a=o.i,e=o.$re(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!e)break;c=new d.Element(f,e,a,h),b?b.push(c):b=[c],f=o.$char(">")}return b&&(o.$char("(")&&(g=this.args(!0).args,k(")")),n.important()&&(j=!0),n.end())?(o.forget(),new d.mixin.Call(b,g,l,h,j)):void o.restore()}},args:function(a){var b,c,e,f,g,h,i=n.entities,j={args:null,variadic:!1},k=[],m=[],p=[];for(o.save();;){if(a)h=n.detachedRuleset()||n.expression();else{if(o.commentStore.length=0,o.$str("...")){j.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?m:p).push({variadic:!0});break}h=i.variable()||i.literal()||i.keyword()}if(!h)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var q=null;if(a?h.value&&1==h.value.length&&(q=h.value[0]):q=h,q&&q instanceof d.Variable)if(o.$char(":")){if(k.length>0&&(b&&l("Cannot mix ; and , as delimiter types"),c=!0),g=n.detachedRuleset()||n.expression(),!g){if(!a)return o.restore(),j.args=[],j;l("could not understand value for named argument")}f=e=q.name}else{if(!a&&o.$str("...")){j.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?m:p).push({name:h.name,variadic:!0});break}a||(e=f=q.name,g=null)}g&&k.push(g),p.push({name:f,value:g}),o.$char(",")||(o.$char(";")||b)&&(c&&l("Cannot mix ; and , as delimiter types"),b=!0,k.length>1&&(g=new d.Value(k)),m.push({name:e,value:g}),e=null,k=[],c=!1)}return o.forget(),j.args=b?m:p,j},definition:function(){var a,b,c,e,f=[],g=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),b=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(e=j(n.conditions,"expected condition")),c=n.block())return o.forget(),new d.mixin.Definition(a,f,c,e,g);o.restore()}else o.forget()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()},end:function(){return o.$char(";")||o.peek("}")},alpha:function(){var a;if(o.$re(/^opacity=/i))return a=o.$re(/^\d+/),a||(a=j(this.entities.variable,"Could not parse alpha")),k(")"),new d.Alpha(a)},element:function(){var a,b,c,e=o.i;return b=this.combinator(),a=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[\.#:](?=@)/)||this.entities.variableCurly(),a||(o.save(),o.$char("(")?(c=this.selector())&&o.$char(")")?(a=new d.Paren(c),o.forget()):o.restore("Missing closing ')'"):o.forget()),a?new d.Element(b,a,e,h):void 0},combinator:function(){var a=o.currentChar();if("/"===a){o.save();var b=o.$re(/^\/[a-z]+\//i);if(b)return o.forget(),new d.Combinator(b);o.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(o.i++,"^"===a&&"^"===o.currentChar()&&(a="^^",o.i++);o.isWhitespace();)o.i++;return new d.Combinator(a)}return new d.Combinator(o.isWhitespace(-1)?" ":null)},lessSelector:function(){return this.selector(!0)},selector:function(a){for(var b,c,e,f,g,i,k,m=o.i;(a&&(c=this.extend())||a&&(i=o.$str("when"))||(f=this.element()))&&(i?k=j(this.conditions,"expected condition"):k?l("CSS guard can only be used at the end of selector"):c?g=g?g.concat(c):c:(g&&l("Extend can only be used at the end of selector"),e=o.currentChar(),b?b.push(f):b=[f],f=null),"{"!==e&&"}"!==e&&";"!==e&&","!==e&&")"!==e););return b?new d.Selector(b,g,k,m,h):void(g&&l("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(o.$char("[")){var a,b,c,e=this.entities;return(a=e.variableCurly())||(a=j(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=o.$re(/^[|~*$^]?=/),c&&(b=e.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||e.variableCurly()),k("]"),new d.Attribute(a,c,b)}},block:function(){var a;return o.$char("{")&&(a=this.primary())&&o.$char("}")?a:void 0},blockRuleset:function(){var a=this.block();return a&&(a=new d.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();return a?new d.DetachedRuleset(a):void 0},ruleset:function(){var b,c,e,f;for(o.save(),a.dumpLineNumbers&&(f=m(o.i));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],o.commentStore.length=0,c.condition&&b.length>1&&l("Guards are only currently allowed on a single selector."),!o.$char(","))break;c.condition&&l("Guards are only currently allowed on a single selector."),o.commentStore.length=0}if(b&&(e=this.block())){o.forget();var g=new d.Ruleset(b,e,a.strictImports);return a.dumpLineNumbers&&(g.debugInfo=f),g}o.restore()},rule:function(b){var c,e,f,g,i,j=o.i,k=o.currentChar();if("."!==k&&"#"!==k&&"&"!==k&&":"!==k)if(o.save(),c=this.variable()||this.ruleProperty()){if(i="string"==typeof c,i&&(e=this.detachedRuleset()),o.commentStore.length=0,!e){g=!i&&c.length>1&&c.pop().value;var l=!b&&(a.compress||i);if(l&&(e=this.value()),!e&&(e=this.anonymousValue()))return o.forget(),new d.Rule(c,e,!1,g,j,h);l||e||(e=this.value()),f=this.important()}if(e&&this.end())return o.forget(),new d.Rule(c,e,f,g,j,h);if(o.restore(),e&&!b)return this.rule(!0)}else o.forget()},anonymousValue:function(){var a=o.$re(/^([^@+\/'"*`(;{}-]*);/);return a?new d.Anonymous(a[1]):void 0},"import":function(){var a,b,c=o.i,e=o.$re(/^@import?\s+/);if(e){var f=(e?this.importOptions():null)||{};if(a=this.entities.quoted()||this.entities.url())return b=this.mediaFeatures(),o.$char(";")||(o.i=c,l("missing semi-colon or unrecognised media features on import")),b=b&&new d.Value(b),new d.Import(a,b,f,c,h);o.i=c,l("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!o.$char("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!o.$char(","))break}while(a);return k(")"),d},importOption:function(){var a=o.$re(/^(less|css|multiple|once|inline|reference|optional)/);return a?a[1]:void 0},mediaFeature:function(){var a,b,c=this.entities,e=[];o.save();do if(a=c.keyword()||c.variable())e.push(a);else if(o.$char("(")){if(b=this.property(),a=this.value(),!o.$char(")"))return o.restore("Missing closing ')'"),null;if(b&&a)e.push(new d.Paren(new d.Rule(b,a,null,null,o.i,h,!0)));else{if(!a)return o.restore("badly formed media feature definition"),null;e.push(new d.Paren(a))}}while(a);return o.forget(),e.length>0?new d.Expression(e):void 0},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!o.$char(","))break}else if(a=b.variable(),a&&(c.push(a),!o.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,c,e,f;return a.dumpLineNumbers&&(f=m(o.i)),o.save(),o.$str("@media")?(b=this.mediaFeatures(),(c=this.block())?(o.forget(),e=new d.Media(c,b,o.i,h),a.dumpLineNumbers&&(e.debugInfo=f),e):void o.restore("media definitions require block statements after any features")):void o.restore()},plugin:function(){var a,b=o.i,c=o.$re(/^@plugin?\s+/);if(c){var e={plugin:!0};if(a=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=b,l("missing semi-colon on plugin")),new d.Import(a,null,e,b,h);o.i=b,l("malformed plugin statement")}},directive:function(){var b,c,e,f,g,i,j,k=o.i,n=!0,p=!0;if("@"===o.currentChar()){if(c=this["import"]()||this.plugin()||this.media())return c;if(o.save(),b=o.$re(/^@[a-z-]+/)){switch(f=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(f="@"+b.slice(b.indexOf("-",2)+1)),f){case"@counter-style":g=!0,n=!0;break;case"@charset":g=!0,n=!1;break;case"@namespace":i=!0,n=!1;break;case"@keyframes":g=!0;break;case"@host":case"@page":j=!0;break;case"@document":case"@supports":j=!0,p=!1}return o.commentStore.length=0,g?(c=this.entity(),c||l("expected "+b+" identifier")):i?(c=this.expression(),c||l("expected "+b+" expression")):j&&(c=(o.$re(/^[^{;]+/)||"").trim(),c&&(c=new d.Anonymous(c))),n&&(e=this.blockRuleset()),e||!n&&c&&o.$char(";")?(o.forget(),new d.Directive(b,c,e,k,h,a.dumpLineNumbers?m(k):null,!1,p)):void o.restore("directive options not recognised")}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!o.$char(",")))break;while(a);return b.length>0?new d.Value(b):void 0},important:function(){return"!"===o.currentChar()?o.$re(/^! *important/):void 0},sub:function(){var a,b;return o.save(),o.$char("(")?(a=this.addition(),a&&o.$char(")")?(o.forget(),b=new d.Expression([a]),b.parens=!0,b):void o.restore("Expected ')'")):void o.restore()},multiplication:function(){var a,b,c,e,f;if(a=this.operand()){for(f=o.isWhitespace(-1);;){if(o.peek(/^\/[*\/]/))break;if(o.save(),c=o.$char("/")||o.$char("*"),!c){o.forget();break}if(b=this.operand(),!b){o.restore();break}o.forget(),a.parensInOp=!0,b.parensInOp=!0,e=new d.Operation(c,[e||a,b],f),f=o.isWhitespace(-1)}return e||a}},addition:function(){var a,b,c,e,f;if(a=this.multiplication()){for(f=o.isWhitespace(-1);;){if(c=o.$re(/^[-+]\s+/)||!f&&(o.$char("+")||o.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,e=new d.Operation(c,[e||a,b],f),f=o.isWhitespace(-1)}return e||a}},conditions:function(){var a,b,c,e=o.i;if(a=this.condition()){for(;;){if(!o.peek(/^,\s*(not\s*)?\(/)||!o.$char(","))break;if(b=this.condition(),!b)break;c=new d.Condition("or",c||a,b,e)}return c||a}},condition:function(){var a,b,c,e,f=this.entities,g=o.i,h=!1;return o.$str("not")&&(h=!0),k("("),a=this.addition()||f.keyword()||f.quoted(),a?(o.$char(">")?e=o.$char("=")?">=":">":o.$char("<")?e=o.$char("=")?"<=":"<":o.$char("=")&&(e=o.$char(">")?"=>":o.$char("<")?"=<":"="),e?(b=this.addition()||f.keyword()||f.quoted(),b?c=new d.Condition(e,a,b,g,h):l("expected expression")):c=new d.Condition("=",a,new d.Keyword("true"),g,h),k(")"),o.$str("and")?new d.Condition("and",c,this.condition()):c):void 0},operand:function(){var a,b=this.entities;o.peek(/^-[@\(]/)&&(a=o.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.call();return a&&(c.parensInOp=!0,c=new d.Negative(c)),c},expression:function(){var a,b,c=[];do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),o.peek(/^\/[\/*]/)||(b=o.$char("/"),b&&c.push(new d.Anonymous(b)))));while(a);return c.length>0?new d.Expression(c):void 0},property:function(){var a=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);return a?a[1]:void 0},ruleProperty:function(){function a(a){var b=o.i,c=o.$re(a);return c?(f.push(b),e.push(c[1])):void 0}var b,c,e=[],f=[];o.save();var g=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(g)return e=[new d.Keyword(g[1])],o.forget(),e;for(a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/))break;if(e.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===e[0]&&(e.shift(),f.shift()),c=0;e.length>c;c++)b=e[c],e[c]="@"!==b.charAt(0)?new d.Keyword(b):new d.Variable("@"+b.slice(2,-1),f[c],h);return e}o.restore()}}}};h.serializeVars=function(a){var b="";for(var c in a)if(Object.hasOwnProperty.call(a,c)){var d=a[c];b+=("@"===c[0]?"":"@")+c+": "+d+(";"===String(d).slice(-1)?"":";")}return b},b.exports=h},{"../less-error":30,"../tree":60,"../utils":81,"../visitors":85,"./parser-input":35}],37:[function(a,b){var c=function(a){this.less=a,this.visitors=[],this.preProcessors=[],this.postProcessors=[],this.installedPlugins=[],this.fileManagers=[]};c.prototype.addPlugins=function(a){if(a)for(var b=0;a.length>b;b++)this.addPlugin(a[b])},c.prototype.addPlugin=function(a){this.installedPlugins.push(a),a.install(this.less,this)},c.prototype.addVisitor=function(a){this.visitors.push(a)},c.prototype.addPreProcessor=function(a,b){var c;for(c=0;this.preProcessors.length>c&&!(this.preProcessors[c].priority>=b);c++);this.preProcessors.splice(c,0,{preProcessor:a,priority:b})},c.prototype.addPostProcessor=function(a,b){var c;for(c=0;this.postProcessors.length>c&&!(this.postProcessors[c].priority>=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},c.prototype.addFileManager=function(a){this.fileManagers.push(a)},c.prototype.getPreProcessors=function(){for(var a=[],b=0;this.preProcessors.length>b;b++)a.push(this.preProcessors[b].preProcessor);return a},c.prototype.getPostProcessors=function(){for(var a=[],b=0;this.postProcessors.length>b;b++)a.push(this.postProcessors[b].postProcessor);return a},c.prototype.getVisitors=function(){return this.visitors},c.prototype.getFileManagers=function(){return this.fileManagers},b.exports=c},{}],38:[function(a,b){var c=a("../less-error"),d=a("../tree"),e=b.exports=function(a,b){this.fileInfo=b};e.prototype.eval=function(a,b){var e,f,g={};f={add:function(a,b){g[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){g[b]=a[b]})}};try{e=new Function("functions","tree","fileInfo",a),e(f,d,this.fileInfo)}catch(h){b(new c({message:"Plugin evaluation error: '"+h.name+": "+h.message.replace(/["]/g,"'")+"'",filename:this.fileInfo.filename}),null)}b(null,{functions:g})}},{"../less-error":30,"../tree":60}],39:[function(a,b){var c;b.exports=function(b,d){var e=function(b,f,g){if("function"==typeof f&&(g=f,f={}),!g){c||(c="undefined"==typeof Promise?a("promise"):Promise);var h=this;return new c(function(a,c){e.call(h,b,f,function(b,d){b?c(b):a(d)})})}this.parse(b,f,function(a,b,c,e){if(a)return g(a);var f;try{var h=new d(b,c);f=h.toCSS(e)}catch(a){return g(a)}g(null,f)})};return e}},{promise:void 0}],40:[function(a,b){b.exports=function(a,b){var c=function(a){this.options=a};return c.prototype.toCSS=function(b,c,d){var e=new a({contentsIgnoredCharsMap:d.contentsIgnoredChars,rootNode:b,contentsMap:d.contents,sourceMapFilename:this.options.sourceMapFilename,sourceMapURL:this.options.sourceMapURL,outputFilename:this.options.sourceMapOutputFilename,sourceMapBasepath:this.options.sourceMapBasepath,sourceMapRootpath:this.options.sourceMapRootpath,outputSourceFiles:this.options.outputSourceFiles,sourceMapGenerator:this.options.sourceMapGenerator,sourceMapFileInline:this.options.sourceMapFileInline}),f=e.toCSS(c);return this.sourceMap=e.sourceMap,this.sourceMapURL=e.sourceMapURL,this.options.sourceMapInputFilename&&(this.sourceMapInputFilename=e.normalizeFilename(this.options.sourceMapInputFilename)),f+this.getCSSAppendage()},c.prototype.getCSSAppendage=function(){var a=this.sourceMapURL;if(this.options.sourceMapFileInline){if(void 0===this.sourceMap)return"";a="data:application/json;base64,"+b.encodeBase64(this.sourceMap)}return a?"/*# sourceMappingURL="+a+" */":""},c.prototype.getExternalSourceMap=function(){return this.sourceMap},c.prototype.setExternalSourceMap=function(a){this.sourceMap=a},c.prototype.isInline=function(){return this.options.sourceMapFileInline},c.prototype.getSourceMapURL=function(){return this.sourceMapURL},c.prototype.getOutputFilename=function(){return this.options.sourceMapOutputFilename},c.prototype.getInputFilename=function(){return this.sourceMapInputFilename},c}},{}],41:[function(a,b){b.exports=function(a){var b=function(b){this._css=[],this._rootNode=b.rootNode,this._contentsMap=b.contentsMap,this._contentsIgnoredCharsMap=b.contentsIgnoredCharsMap,b.sourceMapFilename&&(this._sourceMapFilename=b.sourceMapFilename.replace(/\\/g,"/")),this._outputFilename=b.outputFilename,this.sourceMapURL=b.sourceMapURL,b.sourceMapBasepath&&(this._sourceMapBasepath=b.sourceMapBasepath.replace(/\\/g,"/")),
15
  b.sourceMapRootpath?(this._sourceMapRootpath=b.sourceMapRootpath.replace(/\\/g,"/"),"/"!==this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1)&&(this._sourceMapRootpath+="/")):this._sourceMapRootpath="",this._outputSourceFiles=b.outputSourceFiles,this._sourceMapGeneratorConstructor=a.getSourceMapGenerator(),this._lineNumber=0,this._column=0};return b.prototype.normalizeFilename=function(a){return a=a.replace(/\\/g,"/"),this._sourceMapBasepath&&0===a.indexOf(this._sourceMapBasepath)&&(a=a.substring(this._sourceMapBasepath.length),("\\"===a.charAt(0)||"/"===a.charAt(0))&&(a=a.substring(1))),(this._sourceMapRootpath||"")+a},b.prototype.add=function(a,b,c,d){if(a){var e,f,g,h,i;if(b){var j=this._contentsMap[b.filename];this._contentsIgnoredCharsMap[b.filename]&&(c-=this._contentsIgnoredCharsMap[b.filename],0>c&&(c=0),j=j.slice(this._contentsIgnoredCharsMap[b.filename])),j=j.substring(0,c),f=j.split("\n"),h=f[f.length-1]}if(e=a.split("\n"),g=e[e.length-1],b)if(d)for(i=0;e.length>i;i++)this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+i+1,column:0===i?this._column:0},original:{line:f.length+i,column:0===i?h.length:0},source:this.normalizeFilename(b.filename)});else this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+1,column:this._column},original:{line:f.length,column:h.length},source:this.normalizeFilename(b.filename)});1===e.length?this._column+=g.length:(this._lineNumber+=e.length-1,this._column=g.length),this._css.push(a)}},b.prototype.isEmpty=function(){return 0===this._css.length},b.prototype.toCSS=function(a){if(this._sourceMapGenerator=new this._sourceMapGeneratorConstructor({file:this._outputFilename,sourceRoot:null}),this._outputSourceFiles)for(var b in this._contentsMap)if(this._contentsMap.hasOwnProperty(b)){var c=this._contentsMap[b];this._contentsIgnoredCharsMap[b]&&(c=c.slice(this._contentsIgnoredCharsMap[b])),this._sourceMapGenerator.setSourceContent(this.normalizeFilename(b),c)}if(this._rootNode.genCSS(a,this),this._css.length>0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],42:[function(a,b){var c=a("./contexts"),d=a("./visitors"),e=a("./tree");b.exports=function(a,b){b=b||{};var f,g=b.variables,h=new c.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b])),new e.Rule("@"+a,b,!1,null,0)}),h.frames=[new e.Ruleset(null,g)]);var i,j=[],k=[new d.JoinSelectorVisitor,new d.ExtendVisitor,new d.ToCSSVisitor({compress:Boolean(b.compress)})];if(b.pluginManager){var l=b.pluginManager.getVisitors();for(i=0;l.length>i;i++){var m=l[i];m.isPreEvalVisitor?j.push(m):m.isPreVisitor?k.splice(0,0,m):k.push(m)}}for(i=0;j.length>i;i++)j[i].run(a);for(f=a.eval(h),i=0;k.length>i;i++)k[i].run(f);return f}},{"./contexts":10,"./tree":60,"./visitors":85}],43:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Alpha",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.eval=function(a){return this.value.eval?new d(this.value.eval(a)):this},d.prototype.genCSS=function(a,b){b.add("alpha(opacity="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value),b.add(")")},b.exports=d},{"./node":68}],44:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e){this.value=a,this.index=b,this.mapLines=d,this.currentFileInfo=c,this.rulesetLike="undefined"==typeof e?!1:e};d.prototype=new c,d.prototype.type="Anonymous",d.prototype.eval=function(){return new d(this.value,this.index,this.currentFileInfo,this.mapLines,this.rulesetLike)},d.prototype.compare=function(a){return a.toCSS&&this.toCSS()===a.toCSS()?0:void 0},d.prototype.isRulesetLike=function(){return this.rulesetLike},d.prototype.genCSS=function(a,b){b.add(this.value,this.currentFileInfo,this.index,this.mapLines)},b.exports=d},{"./node":68}],45:[function(a,b){var c=a("./node"),d=function(a,b){this.key=a,this.value=b};d.prototype=new c,d.prototype.type="Assignment",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.eval=function(a){return this.value.eval?new d(this.key,this.value.eval(a)):this},d.prototype.genCSS=function(a,b){b.add(this.key+"="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value)},b.exports=d},{"./node":68}],46:[function(a,b){var c=a("./node"),d=function(a,b,c){this.key=a,this.op=b,this.value=c};d.prototype=new c,d.prototype.type="Attribute",d.prototype.eval=function(a){return new d(this.key.eval?this.key.eval(a):this.key,this.op,this.value&&this.value.eval?this.value.eval(a):this.value)},d.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},d.prototype.toCSS=function(a){var b=this.key.toCSS?this.key.toCSS(a):this.key;return this.op&&(b+=this.op,b+=this.value.toCSS?this.value.toCSS(a):this.value),"["+b+"]"},b.exports=d},{"./node":68}],47:[function(a,b){var c=a("./node"),d=a("../functions/function-caller"),e=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Call",e.prototype.accept=function(a){this.args&&(this.args=a.visitArray(this.args))},e.prototype.eval=function(a){var b,c=this.args.map(function(b){return b.eval(a)}),f=new d(this.name,a,this.index,this.currentFileInfo);if(f.isValid())try{if(b=f.call(c),null!=b)return b}catch(g){throw{type:g.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(g.message?": "+g.message:""),index:this.index,filename:this.currentFileInfo.filename}}return new e(this.name,c,this.index,this.currentFileInfo)},e.prototype.genCSS=function(a,b){b.add(this.name+"(",this.currentFileInfo,this.index);for(var c=0;this.args.length>c;c++)this.args[c].genCSS(a,b),this.args.length>c+1&&b.add(", ");b.add(")")},b.exports=e},{"../functions/function-caller":20,"./node":68}],48:[function(a,b){function c(a,b){return Math.min(Math.max(a,0),b)}function d(a){return"#"+a.map(function(a){return a=c(Math.round(a),255),(16>a?"0":"")+a.toString(16)}).join("")}var e=a("./node"),f=a("../data/colors"),g=function(a,b){this.rgb=Array.isArray(a)?a:6==a.length?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha="number"==typeof b?b:1};g.prototype=new e,g.prototype.type="Color",g.prototype.luma=function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255;return a=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4),b=.03928>=b?b/12.92:Math.pow((b+.055)/1.055,2.4),c=.03928>=c?c/12.92:Math.pow((c+.055)/1.055,2.4),.2126*a+.7152*b+.0722*c},g.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},g.prototype.toCSS=function(a,b){var d,e,f=a&&a.compress&&!b;if(this.value)return this.value;if(e=this.fround(a,this.alpha),1>e)return"rgba("+this.rgb.map(function(a){return c(Math.round(a),255)}).concat(c(e,1)).join(","+(f?"":" "))+")";if(d=this.toRGB(),f){var g=d.split("");g[1]===g[2]&&g[3]===g[4]&&g[5]===g[6]&&(d="#"+g[1]+g[3]+g[5])}return d},g.prototype.operate=function(a,b,c){for(var d=[],e=this.alpha*(1-c.alpha)+c.alpha,f=0;3>f;f++)d[f]=this._operate(a,b,this.rgb[f],c.rgb[f]);return new g(d,e)},g.prototype.toRGB=function(){return d(this.rgb)},g.prototype.toHSL=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=(g+h)/2,j=g-h;if(g===h)a=b=0;else{switch(b=i>.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,l:i,a:f}},g.prototype.toHSV=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=0;else{switch(g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,v:i,a:f}},g.prototype.toARGB=function(){return d([255*this.alpha].concat(this.rgb))},g.prototype.compare=function(a){return a.rgb&&a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:void 0},g.fromKeyword=function(a){var b,c=a.toLowerCase();return f.hasOwnProperty(c)?b=new g(f[c].slice(1)):"transparent"===c&&(b=new g([0,0,0],0)),b?(b.value=a,b):void 0},b.exports=g},{"../data/colors":11,"./node":68}],49:[function(a,b){var c=a("./node"),d=function(a){" "===a?(this.value=" ",this.emptyOrWhitespace=!0):(this.value=a?a.trim():"",this.emptyOrWhitespace=""===this.value)};d.prototype=new c,d.prototype.type="Combinator";var e={"":!0," ":!0,"|":!0};d.prototype.genCSS=function(a,b){var c=a.compress||e[this.value]?"":" ";b.add(c+this.value+c)},b.exports=d},{"./node":68}],50:[function(a,b){var c=a("./node"),d=a("./debug-info"),e=function(a,b,c,d){this.value=a,this.isLineComment=b,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Comment",e.prototype.genCSS=function(a,b){this.debugInfo&&b.add(d(a,this),this.currentFileInfo,this.index),b.add(this.value)},e.prototype.isSilent=function(a){var b=this.currentFileInfo&&this.currentFileInfo.reference&&!this.isReferenced,c=a.compress&&"!"!==this.value[2];return this.isLineComment||b||c},e.prototype.markReferenced=function(){this.isReferenced=!0},b.exports=e},{"./debug-info":52,"./node":68}],51:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e};d.prototype=new c,d.prototype.type="Condition",d.prototype.accept=function(a){this.lvalue=a.visit(this.lvalue),this.rvalue=a.visit(this.rvalue)},d.prototype.eval=function(a){var b=function(a,b,d){switch(a){case"and":return b&&d;case"or":return b||d;default:switch(c.compare(b,d)){case-1:return"<"===a||"=<"===a||"<="===a;case 0:return"="===a||">="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=d},{"./node":68}],52:[function(a,b){var c=function(a,b,d){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=c.asComment(b);break;case"mediaquery":e=c.asMediaQuery(b);break;case"all":e=c.asComment(b)+(d||"")+c.asMediaQuery(b)}return e};c.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},c.asMediaQuery=function(a){var b=a.debugInfo.fileName;return/^[a-z]+:\/\//i.test(b)||(b="file://"+b),"@media -sass-debug-info{filename{font-family:"+b.replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=c},{}],53:[function(a,b){var c=a("./node"),d=a("../contexts"),e=function(a,b){this.ruleset=a,this.frames=b};e.prototype=new c,e.prototype.type="DetachedRuleset",e.prototype.evalFirst=!0,e.prototype.accept=function(a){this.ruleset=a.visit(this.ruleset)},e.prototype.eval=function(a){var b=this.frames||a.frames.slice(0);return new e(this.ruleset,b)},e.prototype.callEval=function(a){return this.ruleset.eval(this.frames?new d.Eval(a,this.frames.concat(a.frames)):a)},b.exports=e},{"../contexts":10,"./node":68}],54:[function(a,b){var c=a("./node"),d=a("../data/unit-conversions"),e=a("./unit"),f=a("./color"),g=function(a,b){this.value=parseFloat(a),this.unit=b&&b instanceof e?b:new e(b?[b]:void 0)};g.prototype=new c,g.prototype.type="Dimension",g.prototype.accept=function(a){this.unit=a.visit(this.unit)},g.prototype.eval=function(){return this},g.prototype.toColor=function(){return new f([this.value,this.value,this.value])},g.prototype.genCSS=function(a,b){if(a&&a.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var c=this.fround(a,this.value),d=String(c);if(0!==c&&1e-6>c&&c>-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&1>c&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},g.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e=c.unit.clone(),this.unit.backupUnit&&(e.backupUnit=this.unit.backupUnit);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new g(d,e)},g.prototype.compare=function(a){var b,d;if(!(a instanceof g))return void 0;if(this.unit.isEmpty()||a.unit.isEmpty())b=this,d=a;else if(b=this.unify(),d=a.unify(),0!==b.unit.compare(d.unit))return void 0;return c.numericCompare(b.value,d.value)},g.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},g.prototype.convertTo=function(a){var b,c,e,f,h,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in d)d[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}h=function(a,b){return e.hasOwnProperty(a)?(b?i/=e[a]/e[f]:i*=e[a]/e[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],e=d[c],j.map(h));return j.cancel(),new g(i,j)},b.exports=g},{"../data/unit-conversions":13,"./color":48,"./node":68,"./unit":77}],55:[function(a,b){var c=a("./node"),d=a("./selector"),e=a("./ruleset"),f=function(a,b,c,e,f,g,h,i){var j;if(this.name=a,this.value=b,c)for(Array.isArray(c)?this.rules=c:(this.rules=[c],this.rules[0].selectors=new d([],null,null,this.index,f).createEmptySelectors()),j=0;this.rules.length>j;j++)this.rules[j].allowImports=!0;this.index=e,this.currentFileInfo=f,this.debugInfo=g,this.isReferenced=h,this.isRooted=i||!1};f.prototype=new c,f.prototype.type="Directive",f.prototype.accept=function(a){var b=this.value,c=this.rules;c&&(this.rules=a.visitArray(c)),b&&(this.value=a.visit(b))},f.prototype.isRulesetLike=function(){return this.rules||!this.isCharset()},f.prototype.isCharset=function(){return"@charset"===this.name},f.prototype.genCSS=function(a,b){var c=this.value,d=this.rules;b.add(this.name,this.currentFileInfo,this.index),c&&(b.add(" "),c.genCSS(a,b)),d?this.outputRuleset(a,b,d):b.add(";")},f.prototype.eval=function(a){var b,c,d=this.value,e=this.rules;return b=a.mediaPath,c=a.mediaBlocks,a.mediaPath=[],a.mediaBlocks=[],d&&(d=d.eval(a)),e&&(e=[e[0].eval(a)],e[0].root=!0),a.mediaPath=b,a.mediaBlocks=c,new f(this.name,d,e,this.index,this.currentFileInfo,this.debugInfo,this.isReferenced,this.isRooted)},f.prototype.variable=function(a){return this.rules?e.prototype.variable.call(this.rules[0],a):void 0},f.prototype.find=function(){return this.rules?e.prototype.find.apply(this.rules[0],arguments):void 0},f.prototype.rulesets=function(){return this.rules?e.prototype.rulesets.apply(this.rules[0]):void 0},f.prototype.markReferenced=function(){var a,b;if(this.isReferenced=!0,this.rules)for(b=this.rules,a=0;b.length>a;a++)b[a].markReferenced&&b[a].markReferenced()},f.prototype.getIsReferenced=function(){return!this.currentFileInfo||!this.currentFileInfo.reference||this.isReferenced},f.prototype.outputRuleset=function(a,b,c){var d,e=c.length;if(a.tabLevel=(0|a.tabLevel)+1,a.compress){for(b.add("{"),d=0;e>d;d++)c[d].genCSS(a,b);return b.add("}"),void a.tabLevel--}var f="\n"+Array(a.tabLevel).join(" "),g=f+" ";if(e){for(b.add(" {"+g),c[0].genCSS(a,b),d=1;e>d;d++)b.add(g),c[d].genCSS(a,b);b.add(f+"}")}else b.add(" {"+f+"}");a.tabLevel--},b.exports=f},{"./node":68,"./ruleset":74,"./selector":75}],56:[function(a,b){var c=a("./node"),d=a("./paren"),e=a("./combinator"),f=function(a,b,c,d){this.combinator=a instanceof e?a:new e(a),this.value="string"==typeof b?b.trim():b?b:"",this.index=c,this.currentFileInfo=d};f.prototype=new c,f.prototype.type="Element",f.prototype.accept=function(a){var b=this.value;this.combinator=a.visit(this.combinator),"object"==typeof b&&(this.value=a.visit(b))},f.prototype.eval=function(a){return new f(this.combinator,this.value.eval?this.value.eval(a):this.value,this.index,this.currentFileInfo)},f.prototype.genCSS=function(a,b){b.add(this.toCSS(a),this.currentFileInfo,this.index)},f.prototype.toCSS=function(a){a=a||{};var b=this.value,c=a.firstSelector;return b instanceof d&&(a.firstSelector=!0),b=b.toCSS?b.toCSS(a):b,a.firstSelector=c,""===b&&"&"===this.combinator.value.charAt(0)?"":this.combinator.toCSS(a)+b},b.exports=f},{"./combinator":49,"./node":68,"./paren":70}],57:[function(a,b){var c=a("./node"),d=a("./paren"),e=a("./comment"),f=function(a){if(this.value=a,!a)throw new Error("Expression requires an array parameter")};f.prototype=new c,f.prototype.type="Expression",f.prototype.accept=function(a){this.value=a.visitArray(this.value)},f.prototype.eval=function(a){var b,c=this.parens&&!this.parensInOp,e=!1;return c&&a.inParenthesis(),this.value.length>1?b=new f(this.value.map(function(b){return b.eval(a)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(e=!0),b=this.value[0].eval(a)):b=this,c&&a.outOfParenthesis(),this.parens&&this.parensInOp&&!a.isMathOn()&&!e&&(b=new d(b)),b},f.prototype.genCSS=function(a,b){for(var c=0;this.value.length>c;c++)this.value[c].genCSS(a,b),this.value.length>c+1&&b.add(" ")},f.prototype.throwAwayComments=function(){this.value=this.value.filter(function(a){return!(a instanceof e)})},b.exports=f},{"./comment":50,"./node":68,"./paren":70}],58:[function(a,b){var c=a("./node"),d=function e(a,b,c){switch(this.selector=a,this.option=b,this.index=c,this.object_id=e.next_id++,this.parent_ids=[this.object_id],b){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}};d.next_id=0,d.prototype=new c,d.prototype.type="Extend",d.prototype.accept=function(a){this.selector=a.visit(this.selector)},d.prototype.eval=function(a){return new d(this.selector.eval(a),this.option,this.index)},d.prototype.clone=function(){return new d(this.selector,this.option,this.index)},d.prototype.findSelfSelectors=function(a){var b,c,d=[];for(b=0;a.length>b;b++)c=a[b].elements,b>0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[{elements:d}]},b.exports=d},{"./node":68}],59:[function(a,b){var c=a("./node"),d=a("./media"),e=a("./url"),f=a("./quoted"),g=a("./ruleset"),h=a("./anonymous"),i=function(a,b,c,d,e){if(this.options=c,this.index=d,this.path=a,this.features=b,this.currentFileInfo=e,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var f=this.getPath();f&&/[#\.\&\?\/]css([\?;].*)?$/.test(f)&&(this.css=!0)}};i.prototype=new c,i.prototype.type="Import",i.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),this.options.plugin||this.options.inline||!this.root||(this.root=a.visit(this.root))},i.prototype.genCSS=function(a,b){this.css&&void 0===this.path.currentFileInfo.reference&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},i.prototype.getPath=function(){return this.path instanceof e?this.path.value.value:this.path.value},i.prototype.isVariableImport=function(){var a=this.path;return a instanceof e&&(a=a.value),a instanceof f?a.containsVariables():!0},i.prototype.evalForImport=function(a){var b=this.path;return b instanceof e&&(b=b.value),new i(b.eval(a),this.features,this.options,this.index,this.currentFileInfo)},i.prototype.evalPath=function(a){var b=this.path.eval(a),c=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(b instanceof e)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d)}b.value=a.normalizePath(b.value)}return b},i.prototype.eval=function(a){var b,c,e=this.features&&this.features.eval(a);if(this.options.plugin)return c=a.frames[0]&&a.frames[0].functionRegistry,c&&this.root&&this.root.functions&&c.addMultiple(this.root.functions),[];if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var f=new h(this.root,0,{filename:this.importedFilename},!0,!0);return this.features?new d([f],this.features.value):[f]}if(this.css){var j=new i(this.evalPath(a),e,this.options,this.index);if(!j.css&&this.error)throw this.error;return j}return b=new g(null,this.root.rules.slice(0)),b.evalImports(a),this.features?new d(b.rules,this.features.value):b.rules},b.exports=i},{"./anonymous":44,"./media":64,"./node":68,"./quoted":71,"./ruleset":74,"./url":78}],60:[function(a,b){var c={};c.Node=a("./node"),c.Alpha=a("./alpha"),c.Color=a("./color"),c.Directive=a("./directive"),c.DetachedRuleset=a("./detached-ruleset"),c.Operation=a("./operation"),c.Dimension=a("./dimension"),c.Unit=a("./unit"),c.Keyword=a("./keyword"),c.Variable=a("./variable"),c.Ruleset=a("./ruleset"),c.Element=a("./element"),c.Attribute=a("./attribute"),c.Combinator=a("./combinator"),c.Selector=a("./selector"),c.Quoted=a("./quoted"),c.Expression=a("./expression"),c.Rule=a("./rule"),c.Call=a("./call"),c.URL=a("./url"),c.Import=a("./import"),c.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},c.Comment=a("./comment"),c.Anonymous=a("./anonymous"),c.Value=a("./value"),c.JavaScript=a("./javascript"),c.Assignment=a("./assignment"),c.Condition=a("./condition"),c.Paren=a("./paren"),c.Media=a("./media"),c.UnicodeDescriptor=a("./unicode-descriptor"),c.Negative=a("./negative"),c.Extend=a("./extend"),c.RulesetCall=a("./ruleset-call"),b.exports=c},{"./alpha":43,"./anonymous":44,"./assignment":45,"./attribute":46,"./call":47,"./color":48,"./combinator":49,"./comment":50,"./condition":51,"./detached-ruleset":53,"./dimension":54,"./directive":55,"./element":56,"./expression":57,"./extend":58,"./import":59,"./javascript":61,"./keyword":63,"./media":64,"./mixin-call":65,"./mixin-definition":66,"./negative":67,"./node":68,"./operation":69,"./paren":70,"./quoted":71,"./rule":72,"./ruleset":74,"./ruleset-call":73,"./selector":75,"./unicode-descriptor":76,"./unit":77,"./url":78,"./value":79,"./variable":80}],61:[function(a,b){var c=a("./js-eval-node"),d=a("./dimension"),e=a("./quoted"),f=a("./anonymous"),g=function(a,b,c,d){this.escaped=b,this.expression=a,this.index=c,this.currentFileInfo=d};g.prototype=new c,g.prototype.type="JavaScript",g.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a);return"number"==typeof b?new d(b):"string"==typeof b?new e('"'+b+'"',b,this.escaped,this.index):new f(Array.isArray(b)?b.join(", "):b)},b.exports=g},{"./anonymous":44,"./dimension":54,"./js-eval-node":62,"./quoted":71}],62:[function(a,b){var c=a("./node"),d=a("./variable"),e=function(){};e.prototype=new c,e.prototype.evaluateJavaScript=function(a,b){var c,e=this,f={};if(void 0!==b.javascriptEnabled&&!b.javascriptEnabled)throw{message:"You are using JavaScript, which has been disabled.",filename:this.currentFileInfo.filename,index:this.index};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return e.jsify(new d("@"+c,e.index,e.currentFileInfo).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.currentFileInfo.filename,index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.currentFileInfo.filename,index:this.index}}return c},e.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=e},{"./node":68,"./variable":80}],63:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Keyword",d.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},d.True=new d("true"),d.False=new d("false"),b.exports=d},{"./node":68}],64:[function(a,b){var c=a("./ruleset"),d=a("./value"),e=a("./selector"),f=a("./anonymous"),g=a("./expression"),h=a("./directive"),i=function(a,b,f,g){this.index=f,this.currentFileInfo=g;var h=new e([],null,null,this.index,this.currentFileInfo).createEmptySelectors();this.features=new d(b),this.rules=[new c(h,a)],this.rules[0].allowImports=!0};i.prototype=new h,i.prototype.type="Media",i.prototype.isRulesetLike=!0,i.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},i.prototype.genCSS=function(a,b){b.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},i.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new i(null,[],this.index,this.currentFileInfo);this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo);var c=!1;a.strictMath||(c=!0,a.strictMath=!0);try{b.features=this.features.eval(a)}finally{c&&(a.strictMath=!1)}return a.mediaPath.push(b),a.mediaBlocks.push(b),this.rules[0].functionRegistry=a.frames[0].functionRegistry.inherit(),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},i.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var d=new e([],null,null,this.index,this.currentFileInfo).createEmptySelectors();b=new c(d,a.mediaBlocks),b.multiMedia=!0}return delete a.mediaBlocks,delete a.mediaPath,b},i.prototype.evalNested=function(a){var b,e,h=a.mediaPath.concat([this]);for(b=0;h.length>b;b++)e=h[b].features instanceof d?h[b].features.value:h[b].features,h[b]=Array.isArray(e)?e:[e];return this.features=new d(this.permute(h).map(function(a){for(a=a.map(function(a){return a.toCSS?a:new f(a)}),b=a.length-1;b>0;b--)a.splice(b,0,new f("and"));return new g(a)})),new c([],[])},i.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;c.length>d;d++)for(var e=0;a[0].length>e;e++)b.push([a[0][e]].concat(c[d]));return b},i.prototype.bubbleSelectors=function(a){a&&(this.rules=[new c(a.slice(0),[this.rules[0]])])},b.exports=i},{"./anonymous":44,"./directive":55,"./expression":57,"./ruleset":74,"./selector":75,"./value":79}],65:[function(a,b){var c=a("./node"),d=a("./selector"),e=a("./mixin-definition"),f=a("../functions/default"),g=function(a,b,c,e,f){this.selector=new d(a),this.arguments=b&&b.length?b:null,this.index=c,this.currentFileInfo=e,this.important=f};g.prototype=new c,g.prototype.type="MixinCall",g.prototype.accept=function(a){this.selector&&(this.selector=a.visit(this.selector)),this.arguments&&(this.arguments=a.visitArray(this.arguments))},g.prototype.eval=function(a){function b(b,c){var d,e;for(k=0;2>k;k++){for(w[k]=!0,f.value(k),d=0;c.length>d&&w[k];d++)e=c[d],e.matchCondition&&(w[k]=w[k]&&e.matchCondition(null,a));b.matchCondition&&(w[k]=w[k]&&b.matchCondition(h,a))}return w[0]||w[1]?w[0]!=w[1]?w[1]?z:A:y:x}var c,d,g,h,i,j,k,l,m,n,o,p,q,r,s,t=[],u=!1,v=[],w=[],x=-1,y=0,z=1,A=2;for(h=this.arguments&&this.arguments.map(function(b){return{name:b.name,value:b.value.eval(a)}}),s=function(b){return b.matchArgs(null,a)},i=0;a.frames.length>i;i++)if((c=a.frames[i].find(this.selector,null,s)).length>0){for(m=!0,j=0;c.length>j;j++){for(d=c[j].rule,g=c[j].path,l=!1,k=0;a.frames.length>k;k++)if(!(d instanceof e)&&d===(a.frames[k].originalRuleset||a.frames[k])){l=!0;break}l||d.matchArgs(h,a)&&(o={mixin:d,group:b(d,g)},o.group!==x&&v.push(o),u=!0)}for(f.reset(),q=[0,0,0],j=0;v.length>j;j++)q[v[j].group]++;if(q[y]>0)p=A;else if(p=z,q[z]+q[A]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(h)+"`",index:this.index,filename:this.currentFileInfo.filename};for(j=0;v.length>j;j++)if(o=v[j].group,o===y||o===p)try{d=v[j].mixin,d instanceof e||(r=d.originalRuleset||d,d=new e("",[],d.rules,null,!1),d.originalRuleset=r),Array.prototype.push.apply(t,d.evalCall(a,h,this.important).rules)}catch(B){throw{message:B.message,index:this.index,filename:this.currentFileInfo.filename,stack:B.stack}}if(u){if(!this.currentFileInfo||!this.currentFileInfo.reference)for(i=0;t.length>i;i++)n=t[i],n.markReferenced&&n.markReferenced();return t}}throw m?{type:"Runtime",message:"No matching definition was found for `"+this.format(h)+"`",index:this.index,filename:this.currentFileInfo.filename}:{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.currentFileInfo.filename}},g.prototype.format=function(a){return this.selector.toCSS().trim()+"("+(a?a.map(function(a){var b="";return a.name&&(b+=a.name+":"),b+=a.value.toCSS?a.value.toCSS():"???"}).join(", "):"")+")"},b.exports=g},{"../functions/default":19,"./mixin-definition":66,"./node":68,"./selector":75}],66:[function(a,b){var c=a("./selector"),d=a("./element"),e=a("./ruleset"),f=a("./rule"),g=a("./expression"),h=a("../contexts"),i=function(a,b,e,f,g,h){this.name=a,this.selectors=[new c([new d(null,a,this.index,this.currentFileInfo)])],this.params=b,this.condition=f,this.variadic=g,this.arity=b.length,this.rules=e,this._lookups={},this.required=b.reduce(function(a,b){return!b.name||b.name&&!b.value?a+1:a},0),this.frames=h};i.prototype=new e,i.prototype.type="MixinDefinition",i.prototype.evalFirst=!0,i.prototype.accept=function(a){this.params&&this.params.length&&(this.params=a.visitArray(this.params)),this.rules=a.visitArray(this.rules),this.condition&&(this.condition=a.visit(this.condition))},i.prototype.evalParams=function(a,b,c,d){var i,j,k,l,m,n,o,p,q=new e(null,null),r=this.params.slice(0),s=0;if(b.frames&&b.frames[0]&&b.frames[0].functionRegistry&&(q.functionRegistry=b.frames[0].functionRegistry.inherit()),b=new h.Eval(b,[q].concat(b.frames)),c)for(c=c.slice(0),s=c.length,k=0;s>k;k++)if(j=c[k],n=j&&j.name){for(o=!1,l=0;r.length>l;l++)if(!d[l]&&n===r[l].name){d[l]=j.value.eval(a),q.prependRule(new f(n,j.value.eval(a))),o=!0;break}if(o){c.splice(k,1),k--;continue}throw{type:"Runtime",message:"Named argument for "+this.name+" "+c[k].name+" not found"}}for(p=0,k=0;r.length>k;k++)if(!d[k]){if(j=c&&c[p],n=r[k].name)if(r[k].variadic){for(i=[],l=p;s>l;l++)i.push(c[l].value.eval(a));q.prependRule(new f(n,new g(i).eval(a)))}else{if(m=j&&j.value)m=m.eval(a);else{if(!r[k].value)throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+s+" for "+this.arity+")"};m=r[k].value.eval(b),q.resetCache()}q.prependRule(new f(n,m)),d[k]=m}if(r[k].variadic&&c)for(l=p;s>l;l++)d[l]=c[l].value.eval(a);p++}return q},i.prototype.makeImportant=function(){var a=this.rules?this.rules.map(function(a){return a.makeImportant?a.makeImportant(!0):a}):this.rules,b=new i(this.name,this.params,a,this.condition,this.variadic,this.frames);return b},i.prototype.eval=function(a){return new i(this.name,this.params,this.rules,this.condition,this.variadic,this.frames||a.frames.slice(0))},i.prototype.evalCall=function(a,b,c){var d,i,j=[],k=this.frames?this.frames.concat(a.frames):a.frames,l=this.evalParams(a,new h.Eval(a,k),b,j);return l.prependRule(new f("@arguments",new g(j).eval(a))),d=this.rules.slice(0),i=new e(null,d),i.originalRuleset=this,i=i.eval(new h.Eval(a,[this,l].concat(k))),c&&(i=i.makeImportant()),i},i.prototype.matchCondition=function(a,b){return this.condition&&!this.condition.eval(new h.Eval(b,[this.evalParams(b,new h.Eval(b,this.frames?this.frames.concat(b.frames):b.frames),a,[])].concat(this.frames).concat(b.frames)))?!1:!0},i.prototype.matchArgs=function(a,b){var c,d=a&&a.length||0;if(this.variadic){if(this.required-1>d)return!1}else{if(this.required>d)return!1;
16
 
10
  /** * @license Apache v2
11
  */
12
 
13
+ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b){var c=a("./utils").addDataAttr,d=a("./browser");b.exports=function(a,b){c(b,d.currentScript(a)),void 0===b.isFileProtocol&&(b.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(a.location.protocol)),b.async=b.async||!1,b.fileAsync=b.fileAsync||!1,b.poll=b.poll||(b.isFileProtocol?1e3:1500),b.env=b.env||("127.0.0.1"==a.location.hostname||"0.0.0.0"==a.location.hostname||"localhost"==a.location.hostname||a.location.port&&a.location.port.length>0||b.isFileProtocol?"development":"production");var e=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);e&&(b.dumpLineNumbers=e[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0)}},{"./browser":3,"./utils":9}],2:[function(a,b){a("promise/polyfill.js");var c=window.less||{};a("./add-default-options")(window,c);var d=b.exports=a("./index")(window,c);c.onReady&&(/!watch/.test(window.location.hash)&&d.watch(),d.pageLoadFinished=d.registerStylesheets().then(function(){return d.refresh("development"===d.env)}))},{"./add-default-options":1,"./index":7,"promise/polyfill.js":94}],3:[function(a,b){var c=a("./utils");b.exports={createCSS:function(a,b,d){var e=d.href||"",f="less:"+(d.title||c.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),d.media&&i.setAttribute("media",d.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=d&&d.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":9}],4:[function(a,b){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,e),d.setItem(a+":timestamp",b)}catch(f){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b){var c=d&&d.getItem(a),e=d&&d.getItem(a+":timestamp");return e&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(e).valueOf()?c:void 0}}}},{}],5:[function(a,b){var c=a("./utils"),d=a("./browser");b.exports=function(a,b,e){function f(b,f){var g,h,i="less-error-message:"+c.extractId(f||""),j='<li><label>{line}</label><pre class="{class}">{content}</pre></li>',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="<h3>"+(b.type||"Syntax")+"Error: "+(b.message||"There is an error in your .less file")+'</h3><p>in <a href="'+m+'">'+n+"</a> ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.extract&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":</p><ul>"+l.join("")+"</ul>"),b.stack&&(b.extract||e.logLevel>=4)&&(h+="<br/>Stack Trace</br />"+b.stack.split("\n").slice(1).join("<br/>")),k.innerHTML=h,d.createCSS(a.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),k.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===e.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(a,b){e.errorReporting&&"html"!==e.errorReporting?"console"===e.errorReporting?k(a,b):"function"==typeof e.errorReporting&&e.errorReporting("add",a,b):f(a,b)}function h(b){var d=a.document.getElementById("less-error-message:"+c.extractId(b));d&&d.parentNode.removeChild(d)}function i(){}function j(a){e.errorReporting&&"html"!==e.errorReporting?"console"===e.errorReporting?i(a):"function"==typeof e.errorReporting&&e.errorReporting("remove",a):h(a)}function k(a,c){var d="{line} {content}",f=a.filename||c,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,b,c){void 0!==a.extract[b]&&g.push(d.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.extract&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||e.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}return{add:g,remove:j}}},{"./browser":3,"./utils":9}],6:[function(a,b){b.exports=function(b,c){function d(){if(window.XMLHttpRequest&&!("file:"===window.location.protocol&&"ActiveXObject"in window))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return c.error("browser doesn't support AJAX."),null}}var e=a("../less/environment/abstract-file-manager.js"),f={},g=function(){};return g.prototype=new e,g.prototype.alwaysMakePathsAbsolute=function(){return!0},g.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},g.prototype.doXHR=function(a,e,f,g){function h(b,c,d){b.status>=200&&300>b.status?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var i=d(),j=b.isFileProtocol?b.fileAsync:b.async;"function"==typeof i.overrideMimeType&&i.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),i.open("GET",a,j),i.setRequestHeader("Accept",e||"text/x-less, text/css; q=0.9, */*; q=0.5"),i.send(null),b.isFileProtocol&&!b.fileAsync?0===i.status||i.status>=200&&300>i.status?f(i.responseText):g(i.status,a):j?i.onreadystatechange=function(){4==i.readyState&&h(i,f,g)}:h(i,f,g)},g.prototype.supports=function(){return!0},g.prototype.clearFileCache=function(){f={}},g.prototype.loadFile=function(a,b,c,d,e){b&&!this.isPathAbsolute(a)&&(a=b+a),c=c||{};var g=this.extractUrlParts(a,window.location.href),h=g.url;if(c.useFileCache&&f[h])try{var i=f[h];e(null,{contents:i,filename:h,webInfo:{lastModified:new Date}})}catch(j){e({filename:h,message:"Error loading file "+h+" error was "+j.message})}else this.doXHR(h,c.mime,function(a,b){f[h]=a,e(null,{contents:a,filename:h,webInfo:{lastModified:b}})},function(a,b){e({type:"File",message:"'"+b+"' wasn't found ("+a+")",href:h})})},g}},{"../less/environment/abstract-file-manager.js":14}],7:[function(a,b){var c=a("./utils").addDataAttr,d=a("./browser");b.exports=function(b,e){function f(a){return e.postProcessor&&"function"==typeof e.postProcessor&&(a=e.postProcessor.call(a,a)||a),a}function g(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function h(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function i(a){for(var b,c=m.getElementsByTagName("style"),d=0;c.length>d;d++)if(b=c[d],b.type.match(t)){var f=g(e);f.modifyVars=a;var i=b.innerHTML||"";f.filename=m.location.href.replace(/#.*$/,""),n.render(i,f,h(function(a,b,c){b?r.add(b,"inline"):(a.type="text/css",a.styleSheet?a.styleSheet.cssText=c.css:a.innerHTML=c.css)},null,b))}}function j(a,b,d,h,i){function j(c){var e=c.contents,g=c.filename,i=c.webInfo,j={currentDirectory:q.getPath(g),filename:g,rootFilename:g,relativeUrls:k.relativeUrls};if(j.entryPath=j.currentDirectory,j.rootpath=k.rootpath||j.currentDirectory,i&&(i.remaining=h,!k.modifyVars)){var l=s.getCSS(g,i);if(!d&&l)return i.local=!0,void b(null,l,e,a,i,g)}r.remove(g),k.rootFileInfo=j,n.render(e,k,function(c,d){c?(c.href=g,b(c)):(d.css=f(d.css),k.modifyVars||s.setCSS(a.href,i.lastModified,d.css),b(null,d.css,e,a,i,g))})}var k=g(e);c(k,a),k.mime=a.type,i&&(k.modifyVars=i),q.loadFile(a.href,null,k,o,function(a,c){return a?void b(a):void j(c)})}function k(a,b,c){for(var d=0;n.sheets.length>d;d++)j(n.sheets[d],a,b,n.sheets.length-(d+1),c)}function l(){"development"===n.env&&(n.watchTimer=setInterval(function(){n.watchMode&&(q.clearFileCache(),k(function(a,c,e,f){a?r.add(a,a.href||f.href):c&&d.createCSS(b.document,c,f)}))},e.poll))}var m=b.document,n=a("../less")();n.options=e;var o=n.environment,p=a("./file-manager")(e,n.logger),q=new p;o.addFileManager(q),n.FileManager=p,a("./log-listener")(n,e);var r=a("./error-reporting")(b,n,e),s=n.cache=e.cache||a("./cache")(b,e,n.logger);e.functions&&n.functions.functionRegistry.addMultiple(e.functions);var t=/^text\/(x-)?less$/;return n.watch=function(){return n.watchMode||(n.env="development",l()),this.watchMode=!0,!0},n.unwatch=function(){return clearInterval(n.watchTimer),this.watchMode=!1,!1},n.registerStylesheets=function(){return new Promise(function(a){var b=m.getElementsByTagName("link");n.sheets=[];for(var c=0;b.length>c;c++)("stylesheet/less"===b[c].rel||b[c].rel.match(/stylesheet/)&&b[c].type.match(t))&&n.sheets.push(b[c]);a()})},n.modifyVars=function(a){return n.refresh(!0,a,!1)},n.refresh=function(a,c,e){return(a||e)&&e!==!1&&q.clearFileCache(),new Promise(function(e,f){var g,h,j;g=h=new Date,k(function(a,c,i,k,l){return a?(r.add(a,a.href||k.href),void f(a)):(n.logger.info(l.local?"loading "+k.href+" from cache.":"rendered "+k.href+" successfully."),d.createCSS(b.document,c,k),n.logger.info("css for "+k.href+" generated in "+(new Date-h)+"ms"),0===l.remaining&&(j=new Date-g,n.logger.info("less has finished. css generated in "+j+"ms"),e({startTime:g,endTime:h,totalMilliseconds:j,sheets:n.sheets.length})),void(h=new Date))},a,c),i(c)})},n.refreshStyles=i,n}},{"../less":29,"./browser":3,"./cache":4,"./error-reporting":5,"./file-manager":6,"./log-listener":8,"./utils":9}],8:[function(a,b){b.exports=function(a,b){var c=4,d=3,e=2,f=1;b.logLevel="undefined"!=typeof b.logLevel?b.logLevel:"development"===b.env?d:f,b.loggers||(b.loggers=[{debug:function(a){b.logLevel>=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;b.loggers.length>g;g++)a.logger.addListener(b.loggers[g])}},{}],9:[function(a,b){b.exports={extractId:function(a){return a.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/[\?\&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")},addDataAttr:function(a,b){for(var c in b.dataset)if(b.dataset.hasOwnProperty(c))if("env"===c||"dumpLineNumbers"===c||"rootpath"===c||"errorReporting"===c)a[c]=b.dataset[c];else try{a[c]=JSON.parse(b.dataset[c])}catch(d){}}}},{}],10:[function(a,b){var c={};b.exports=c;var d=function(a,b,c){if(a)for(var d=0;c.length>d;d++)a.hasOwnProperty(c[d])&&(b[c[d]]=a[c[d]])},e=["paths","relativeUrls","rootpath","strictImports","insecure","dumpLineNumbers","compress","syncImport","chunkInput","mime","useFileCache","processImports","reference","pluginManager"];c.Parse=function(a){d(a,this,e),"string"==typeof this.paths&&(this.paths=[this.paths])};var f=["paths","compress","ieCompat","strictMath","strictUnits","sourceMap","importMultiple","urlArgs","javascriptEnabled","pluginManager","importantScope"];c.Eval=function(a,b){d(a,this,f),"string"==typeof this.paths&&(this.paths=[this.paths]),this.frames=b||[],this.importantScope=this.importantScope||[]},c.Eval.prototype.inParenthesis=function(){this.parensStack||(this.parensStack=[]),this.parensStack.push(!0)},c.Eval.prototype.outOfParenthesis=function(){this.parensStack.pop()},c.Eval.prototype.isMathOn=function(){return this.strictMath?this.parensStack&&this.parensStack.length:!0},c.Eval.prototype.isPathRelative=function(a){return!/^(?:[a-z-]+:|\/|#)/i.test(a)},c.Eval.prototype.normalizePath=function(a){var b,c=a.split("/").reverse();for(a=[];0!==c.length;)switch(b=c.pop()){case".":break;case"..":0===a.length||".."===a[a.length-1]?a.push(b):a.pop();break;default:a.push(b)}return a.join("/")}},{}],11:[function(a,b){b.exports={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},{}],12:[function(a,b){b.exports={colors:a("./colors"),unitConversions:a("./unit-conversions")}},{"./colors":11,"./unit-conversions":13}],13:[function(a,b){b.exports={length:{m:1,cm:.01,mm:.001,"in":.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}}},{}],14:[function(a,b){var c=function(){};c.prototype.getPath=function(a){var b=a.lastIndexOf("?");return b>0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),0>b&&(b=a.lastIndexOf("\\")),0>b?"":a.slice(0,b+1)},c.prototype.tryAppendExtension=function(a,b){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+b},c.prototype.tryAppendLessExtension=function(a){return this.tryAppendExtension(a,".less")},c.prototype.supportsSync=function(){return!1},c.prototype.alwaysMakePathsAbsolute=function(){return!1},c.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\|#)/i.test(a)},c.prototype.join=function(a,b){return a?a+b:b},c.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;d>c&&h.directories[c]===g.directories[c];c++);for(f=h.directories.slice(c),e=g.directories.slice(c),c=0;f.length-1>c;c++)i+="../";for(c=0;e.length-1>c;c++)i+=e[c]+"/";return i},c.prototype.extractUrlParts=function(a,b){var c,d,e=/^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i,f=a.match(e),g={},h=[];if(!f)throw new Error("Could not parse sheet href - '"+a+"'");if(b&&(!f[1]||f[2])){if(d=b.match(e),!d)throw new Error("Could not parse page url - '"+b+"'");f[1]=f[1]||d[1]||"",f[2]||(f[3]=d[3]+f[3])}if(f[3]){for(h=f[3].replace(/\\/g,"/").split("/"),c=0;h.length>c;c++)"."===h[c]&&(h.splice(c,1),c-=1);for(c=0;h.length>c;c++)".."===h[c]&&c>0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=(f[1]||"")+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g},b.exports=c},{}],15:[function(a,b){var c=a("../logger"),d=function(a,b){this.fileManagers=b||[],a=a||{};for(var c=["encodeBase64","mimeLookup","charsetLookup","getSourceMapGenerator"],d=[],e=d.concat(c),f=0;e.length>f;f++){var g=e[f],h=a[g];h?this[g]=h.bind(a):d.length>f&&this.warn("missing required function in environment - "+g)}};d.prototype.getFileManager=function(a,b,d,e,f){a||c.warn("getFileManager called with no filename.. Please report this issue. continuing."),null==b&&c.warn("getFileManager called with null directory.. Please report this issue. continuing.");var g=this.fileManagers;d.pluginManager&&(g=[].concat(g).concat(d.pluginManager.getFileManagers()));for(var h=g.length-1;h>=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,d,e))return i}return null},d.prototype.addFileManager=function(a){this.fileManagers.push(a)},d.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=d},{"../logger":31}],16:[function(a){function b(a,b,d){var e,f,g,h,i=b.alpha,j=d.alpha,k=[];g=j+i*(1-j);for(var l=0;3>l;l++)e=b.rgb[l]/255,f=d.rgb[l]/255,h=a(e,f),g&&(h=(j*f+i*(e-j*(e+f-h)))/g),k[l]=255*h;return new c(k,g)}var c=a("../tree/color"),d=a("./function-registry"),e={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,1>=a?e.multiply(a,b):e.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return e.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var f in e)e.hasOwnProperty(f)&&(b[f]=b.bind(null,e[f]));d.addMultiple(b)},{"../tree/color":48,"./function-registry":21}],17:[function(a){function b(a){return Math.min(1,Math.max(0,a))}function c(a){return f.hsla(a.h,a.s,a.l,a.a)}function d(a){if(a instanceof g)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function e(a,b){return a instanceof g&&a.unit.is("%")?parseFloat(a.value*b/100):d(a)}var f,g=a("../tree/dimension"),h=a("../tree/color"),i=a("../tree/quoted"),j=a("../tree/anonymous"),k=a("./function-registry");f={rgb:function(a,b,c){return f.rgba(a,b,c,1)},rgba:function(a,b,c,f){var g=[a,b,c].map(function(a){return e(a,255)});return f=d(f),new h(g,f)},hsl:function(a,b,c){return f.hsla(a,b,c,1)},hsla:function(a,c,e,g){function h(a){return a=0>a?a+1:a>1?a-1:a,1>6*a?j+(i-j)*a*6:1>2*a?i:2>3*a?j+(i-j)*(2/3-a)*6:j}a=d(a)%360/360,c=b(d(c)),e=b(d(e)),g=b(d(g));var i=.5>=e?e*(c+1):e+c-e*c,j=2*e-i;return f.rgba(255*h(a+1/3),255*h(a),255*h(a-1/3),g)},hsv:function(a,b,c){return f.hsva(a,b,c,1)},hsva:function(a,b,c,e){a=d(a)%360/360*360,b=d(b),c=d(c),e=d(e);var g,h;g=Math.floor(a/60%6),h=a/60-g;var i=[c,c*(1-b),c*(1-h*b),c*(1-(1-h)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return f.rgba(255*i[j[g][0]],255*i[j[g][1]],255*i[j[g][2]],e)},hue:function(a){return new g(a.toHSL().h)},saturation:function(a){return new g(100*a.toHSL().s,"%")},lightness:function(a){return new g(100*a.toHSL().l,"%")},hsvhue:function(a){return new g(a.toHSV().h)},hsvsaturation:function(a){return new g(100*a.toHSV().s,"%")},hsvvalue:function(a){return new g(100*a.toHSV().v,"%")},red:function(a){return new g(a.rgb[0])},green:function(a){return new g(a.rgb[1])},blue:function(a){return new g(a.rgb[2])},alpha:function(a){return new g(a.toHSL().a)},luma:function(a){return new g(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new g(b*a.alpha*100,"%")},saturate:function(a,d,e){if(!a.rgb)return null;var f=a.toHSL();return f.s+="undefined"!=typeof e&&"relative"===e.value?f.s*d.value/100:d.value/100,f.s=b(f.s),c(f)},desaturate:function(a,d,e){var f=a.toHSL();return f.s-="undefined"!=typeof e&&"relative"===e.value?f.s*d.value/100:d.value/100,f.s=b(f.s),c(f)},lighten:function(a,d,e){var f=a.toHSL();return f.l+="undefined"!=typeof e&&"relative"===e.value?f.l*d.value/100:d.value/100,f.l=b(f.l),c(f)},darken:function(a,d,e){var f=a.toHSL();return f.l-="undefined"!=typeof e&&"relative"===e.value?f.l*d.value/100:d.value/100,f.l=b(f.l),c(f)},fadein:function(a,d,e){var f=a.toHSL();return f.a+="undefined"!=typeof e&&"relative"===e.value?f.a*d.value/100:d.value/100,f.a=b(f.a),c(f)},fadeout:function(a,d,e){var f=a.toHSL();return f.a-="undefined"!=typeof e&&"relative"===e.value?f.a*d.value/100:d.value/100,f.a=b(f.a),c(f)},fade:function(a,d){var e=a.toHSL();return e.a=d.value/100,e.a=b(e.a),c(e)},spin:function(a,b){var d=a.toHSL(),e=(d.h+b.value)%360;return d.h=0>e?360+e:e,c(d)},mix:function(a,b,c){a.toHSL&&b.toHSL||(console.log(b.type),console.dir(b)),c||(c=new g(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,i=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,j=1-i,k=[a.rgb[0]*i+b.rgb[0]*j,a.rgb[1]*i+b.rgb[1]*j,a.rgb[2]*i+b.rgb[2]*j],l=a.alpha*d+b.alpha*(1-d);return new h(k,l)},greyscale:function(a){return f.desaturate(a,new g(100))},contrast:function(a,b,c,e){if(!a.rgb)return null;if("undefined"==typeof c&&(c=f.rgba(255,255,255,1)),"undefined"==typeof b&&(b=f.rgba(0,0,0,1)),b.luma()>c.luma()){var g=c;c=b,b=g}return e="undefined"==typeof e?.43:d(e),a.luma()<e?c:b},argb:function(a){return new j(a.toARGB())},color:function(a){if(a instanceof i&&/^#([a-f0-9]{6}|[a-f0-9]{3})$/i.test(a.value))return new h(a.value.slice(1));if(a instanceof h||(a=h.fromKeyword(a.value)))return a.value=void 0,a;throw{type:"Argument",message:"argument must be a color keyword or 3/6 digit hex e.g. #FFF"}},tint:function(a,b){return f.mix(f.rgb(255,255,255),a,b)},shade:function(a,b){return f.mix(f.rgb(0,0,0),a,b)}},k.addMultiple(f)},{"../tree/anonymous":44,"../tree/color":48,"../tree/dimension":54,"../tree/quoted":71,"./function-registry":21}],18:[function(a,b){b.exports=function(b){var c=a("../tree/quoted"),d=a("../tree/url"),e=a("./function-registry"),f=function(a,b){return new d(b,a.index,a.currentFileInfo).eval(a.context)},g=a("../logger");e.add("data-uri",function(a,e){e||(e=a,a=null);var h=a&&a.value,i=e.value,j=this.currentFileInfo,k=j.relativeUrls?j.currentDirectory:j.entryPath,l=i.indexOf("#"),m="";-1!==l&&(m=i.slice(l),i=i.slice(0,l));var n=b.getFileManager(i,k,this.context,b,!0);if(!n)return f(this,e);var o=!1;if(a)o=/;base64$/.test(h);else{if(h=b.mimeLookup(i),"image/svg+xml"===h)o=!1;else{var p=b.charsetLookup(h);o=["US-ASCII","UTF-8"].indexOf(p)<0}o&&(h+=";base64")}var q=n.loadFileSync(i,k,this.context,b);if(!q.contents)return g.warn("Skipped data-uri embedding of "+i+" because file not found"),f(this,e||a);var r=q.contents;if(o&&!b.encodeBase64)return f(this,e);r=o?b.encodeBase64(r):encodeURIComponent(r);var s="data:"+h+","+r+m,t=32768;return s.length>=t&&this.context.ieCompat!==!1?(g.warn("Skipped data-uri embedding of "+i+" because its size ("+s.length+" characters) exceeds IE8-safe "+t+" characters!"),f(this,e||a)):new d(new c('"'+s+'"',s,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":31,"../tree/quoted":71,"../tree/url":78,"./function-registry":21}],19:[function(a,b){var c=a("../tree/keyword"),d=a("./function-registry"),e={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;return null!=a?a?c.True:c.False:void 0},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};d.add("default",e.eval.bind(e)),b.exports=e},{"../tree/keyword":63,"./function-registry":21}],20:[function(a,b){var c=a("../tree/expression"),d=function(a,b,c,d){this.name=a.toLowerCase(),this.index=c,this.context=b,this.currentFileInfo=d,this.func=b.frames[0].functionRegistry.get(this.name)};d.prototype.isValid=function(){return Boolean(this.func)},d.prototype.call=function(a){return Array.isArray(a)&&(a=a.filter(function(a){return"Comment"===a.type?!1:!0}).map(function(a){if("Expression"===a.type){var b=a.value.filter(function(a){return"Comment"===a.type?!1:!0});return 1===b.length?b[0]:new c(b)}return a})),this.func.apply(this,a)},b.exports=d},{"../tree/expression":57}],21:[function(a,b){function c(a){return{_data:{},add:function(a,b){a=a.toLowerCase(),this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(b){return this._data[b]||a&&a.get(b)},inherit:function(){return c(this)}}}b.exports=c(null)},{}],22:[function(a,b){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./color":17,"./color-blending":16,"./data-uri":18,"./default":19,"./function-caller":20,"./function-registry":21,"./math":23,"./number":24,"./string":25,"./svg":26,"./types":27}],23:[function(a){function b(a,b,d){if(!(d instanceof c))throw{type:"Argument",message:"argument must be a number"};return null==b?b=d.unit:d=d.unify(),new c(a(parseFloat(d.value)),b)}var c=a("../tree/dimension"),d=a("./function-registry"),e={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"};for(var f in e)e.hasOwnProperty(f)&&(e[f]=b.bind(null,Math[f],e[f]));e.round=function(a,c){var d="undefined"==typeof c?0:c.value;return b(function(a){return a.toFixed(d)},null,a)},d.addMultiple(e)},{"../tree/dimension":54,"./function-registry":21}],24:[function(a){var b=a("../tree/dimension"),c=a("../tree/anonymous"),d=a("./function-registry"),e=function(a,d){switch(d=Array.prototype.slice.call(d),d.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var e,f,g,h,i,j,k,l,m=[],n={};for(e=0;d.length>e;e++)if(g=d[e],g instanceof b)if(h=""===g.unit.toString()&&void 0!==l?new b(g.value,l).unify():g.unify(),j=""===h.unit.toString()&&void 0!==k?k:h.unit.toString(),k=""!==j&&void 0===k||""!==j&&""===m[0].unify().unit.toString()?j:k,l=""!==j&&void 0===l?g.unit.toString():l,f=void 0!==n[""]&&""!==j&&j===k?n[""]:n[j],void 0!==f)i=""===m[f].unit.toString()&&void 0!==l?new b(m[f].value,l).unify():m[f].unify(),(a&&i.value>h.value||!a&&h.value>i.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(d[e].value)&&Array.prototype.push.apply(d,Array.prototype.slice.call(d[e].value));return 1==m.length?m[0]:(d=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new c((a?"min":"max")+"("+d+")"))};d.addMultiple({min:function(){return e(!0,arguments)},max:function(){return e(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new b(Math.PI)},mod:function(a,c){return new b(a.value%c.value,a.unit)},pow:function(a,c){if("number"==typeof a&&"number"==typeof c)a=new b(a),c=new b(c);else if(!(a instanceof b&&c instanceof b))throw{type:"Argument",message:"arguments must be numbers"};return new b(Math.pow(a.value,c.value),a.unit)},percentage:function(a){return new b(100*a.value,"%")}})},{"../tree/anonymous":44,"../tree/dimension":54,"./function-registry":21}],25:[function(a){var b=a("../tree/quoted"),c=a("../tree/anonymous"),d=a("../tree/javascript"),e=a("./function-registry");e.addMultiple({e:function(a){return new c(a instanceof d?a.evaluated:a.value)},escape:function(a){return new c(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,c,d,e){var f=a.value;return d="Quoted"===d.type?d.value:d.toCSS(),f=f.replace(new RegExp(c.value,e?e.value:""),d),new b(a.quote||"",f,a.escaped)},"%":function(a){for(var c=Array.prototype.slice.call(arguments,1),d=a.value,e=0;c.length>e;e++)d=d.replace(/%[sda]/i,function(a){var b="Quoted"===c[e].type&&a.match(/s/i)?c[e].value:c[e].toCSS();return a.match(/[A-Z]$/)?encodeURIComponent(b):b});return d=d.replace(/%%/g,"%"),new b(a.quote||"",d,a.escaped)}})},{"../tree/anonymous":44,"../tree/javascript":61,"../tree/quoted":71,"./function-registry":21}],26:[function(a,b){b.exports=function(){var b=a("../tree/dimension"),c=a("../tree/color"),d=a("../tree/expression"),e=a("../tree/quoted"),f=a("../tree/url"),g=a("./function-registry");g.add("svg-gradient",function(a){function g(){throw{type:"Argument",message:"svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] or direction, color list"}}var h,i,j,k,l,m,n,o,p="linear",q='x="0" y="0" width="1" height="1"',r={compress:!1},s=a.toCSS(r);switch(2==arguments.length?(arguments[1].value.length<2&&g(),h=arguments[1].value):arguments.length<3?g():h=Array.prototype.slice.call(arguments,1),s){case"to bottom":i='x1="0%" y1="0%" x2="0%" y2="100%"';break;case"to right":i='x1="0%" y1="0%" x2="100%" y2="0%"';break;case"to bottom right":i='x1="0%" y1="0%" x2="100%" y2="100%"';break;case"to top right":i='x1="0%" y1="100%" x2="100%" y2="0%"';break;case"ellipse":case"ellipse at center":p="radial",i='cx="50%" cy="50%" r="75%"',q='x="-50" y="-50" width="101" height="101"';break;default:throw{type:"Argument",message:"svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'"}}for(j='<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><'+p+'Gradient id="gradient" gradientUnits="userSpaceOnUse" '+i+">",
14
  k=0;h.length>k;k+=1)h[k]instanceof d?(l=h[k].value[0],m=h[k].value[1]):(l=h[k],m=void 0),l instanceof c&&((0===k||k+1===h.length)&&void 0===m||m instanceof b)||g(),n=m?m.toCSS(r):0===k?"0%":"100%",o=l.alpha,j+='<stop offset="'+n+'" stop-color="'+l.toRGB()+'"'+(1>o?' stop-opacity="'+o+'"':"")+"/>";return j+="</"+p+"Gradient><rect "+q+' fill="url(#gradient)" /></svg>',j=encodeURIComponent(j),j="data:image/svg+xml,"+j,new f(new e("'"+j+"'",j,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":48,"../tree/dimension":54,"../tree/expression":57,"../tree/quoted":71,"../tree/url":78,"./function-registry":21}],27:[function(a){var b=a("../tree/keyword"),c=a("../tree/detached-ruleset"),d=a("../tree/dimension"),e=a("../tree/color"),f=a("../tree/quoted"),g=a("../tree/anonymous"),h=a("../tree/url"),i=a("../tree/operation"),j=a("./function-registry"),k=function(a,c){return a instanceof c?b.True:b.False},l=function(a,c){if(void 0===c)throw{type:"Argument",message:"missing the required second argument to isunit."};if(c="string"==typeof c.value?c.value:c,"string"!=typeof c)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."};return a instanceof d&&a.unit.is(c)?b.True:b.False},m=function(a){var b=Array.isArray(a.value)?a.value:Array(a);return b};j.addMultiple({isruleset:function(a){return k(a,c)},iscolor:function(a){return k(a,e)},isnumber:function(a){return k(a,d)},isstring:function(a){return k(a,f)},iskeyword:function(a){return k(a,b)},isurl:function(a){return k(a,h)},ispixel:function(a){return l(a,"px")},ispercentage:function(a){return l(a,"%")},isem:function(a){return l(a,"em")},isunit:l,unit:function(a,c){if(!(a instanceof d))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof i?". Have you forgotten parenthesis?":"")};return c=c?c instanceof b?c.value:c.toCSS():"",new d(a.value,c)},"get-unit":function(a){return new g(a.unit)},extract:function(a,b){return b=b.value-1,m(a)[b]},length:function(a){return new d(m(a).length)}})},{"../tree/anonymous":44,"../tree/color":48,"../tree/detached-ruleset":53,"../tree/dimension":54,"../tree/keyword":63,"../tree/operation":69,"../tree/quoted":71,"../tree/url":78,"./function-registry":21}],28:[function(a,b){var c=a("./contexts"),d=a("./parser/parser"),e=a("./plugins/function-importer");b.exports=function(a){var b=function(a,b){this.rootFilename=b.filename,this.paths=a.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=a.mime,this.error=null,this.context=a,this.queue=[],this.files={}};return b.prototype.push=function(b,f,g,h,i){var j=this;this.queue.push(b);var k=function(a,c,d){j.queue.splice(j.queue.indexOf(b),1);var e=d===j.rootFilename;h.optional&&a?i(null,{rules:[]},!1,null):(j.files[d]=c,a&&!j.error&&(j.error=a),i(a,c,e,d))},l={relativeUrls:this.context.relativeUrls,entryPath:g.entryPath,rootpath:g.rootpath,rootFilename:g.rootFilename},m=a.getFileManager(b,g.currentDirectory,this.context,a);if(!m)return void k({message:"Could not find a file-manager for "+b});f&&(b=m.tryAppendExtension(b,h.plugin?".js":".less"));var n=function(a){var b=a.filename,f=a.contents.replace(/^\uFEFF/,"");l.currentDirectory=m.getPath(b),l.relativeUrls&&(l.rootpath=m.join(j.context.rootpath||"",m.pathDiff(l.currentDirectory,l.entryPath)),!m.isPathAbsolute(l.rootpath)&&m.alwaysMakePathsAbsolute()&&(l.rootpath=m.join(l.entryPath,l.rootpath))),l.filename=b;var i=new c.Parse(j.context);i.processImports=!1,j.contents[b]=f,(g.reference||h.reference)&&(l.reference=!0),h.plugin?new e(i,l).eval(f,function(a,c){k(a,c,b)}):h.inline?k(null,f,b):new d(i,j,l).parse(f,function(a,c){k(a,c,b)})},o=m.loadFile(b,g.currentDirectory,this.context,a,function(a,b){a?k(a):n(b)});o&&o.then(n,k)},b}},{"./contexts":10,"./parser/parser":36,"./plugins/function-importer":38}],29:[function(a,b){b.exports=function(b,c){var d,e,f,g,h,i={version:[2,5,0],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")};return i}},{"./contexts":10,"./data":12,"./environment/abstract-file-manager":14,"./environment/environment":15,"./functions":22,"./import-manager":28,"./less-error":30,"./logger":31,"./parse":33,"./parse-tree":32,"./parser/parser":36,"./plugin-manager":37,"./render":39,"./source-map-builder":40,"./source-map-output":41,"./transform-tree":42,"./tree":60,"./utils":81,"./visitors":85}],30:[function(a,b){var c=a("./utils"),d=b.exports=function(a,b,d){Error.call(this);var e=a.filename||d;if(b&&e){var f=b.contents[e],g=c.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&c.getLocation(a.call,f).line,k=f.split("\n");this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.callLine=j+1,this.callExtract=k[j],this.column=i,this.extract=[k[h-1],k[h],k[h+1]]}this.message=a.message,this.stack=a.stack};if("undefined"==typeof Object.create){var e=function(){};e.prototype=Error.prototype,d.prototype=new e}else d.prototype=Object.create(Error.prototype);d.prototype.constructor=d},{"./utils":81}],31:[function(a,b){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;this._listeners.length>b;b++)if(this._listeners[b]===a)return void this._listeners.splice(b,1)},_fireEvent:function(a,b){for(var c=0;this._listeners.length>c;c++){var d=this._listeners[c][a];d&&d(b)}},_listeners:[]}},{}],32:[function(a,b){var c=a("./less-error"),d=a("./transform-tree"),e=a("./logger");b.exports=function(a){var b=function(a,b){this.root=a,this.imports=b};return b.prototype.toCSS=function(b){var f,g,h={};try{f=d(this.root,b)}catch(i){throw new c(i,this.imports)}try{var j=Boolean(b.compress);j&&e.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");var k={compress:j,dumpLineNumbers:b.dumpLineNumbers,strictUnits:Boolean(b.strictUnits),numPrecision:8};b.sourceMap?(g=new a(b.sourceMap),h.css=g.toCSS(f,k,this.imports)):h.css=f.toCSS(k)}catch(i){throw new c(i,this.imports)}if(b.pluginManager)for(var l=b.pluginManager.getPostProcessors(),m=0;l.length>m;m++)h.css=l[m].process(h.css,{sourceMap:g,options:b,imports:this.imports});b.sourceMap&&(h.map=g.getExternalSourceMap()),h.imports=[];for(var n in this.imports.files)this.imports.files.hasOwnProperty(n)&&n!==this.imports.rootFilename&&h.imports.push(n);return h},b}},{"./less-error":30,"./logger":31,"./transform-tree":42}],33:[function(a,b){var c,d=a("./contexts"),e=a("./parser/parser"),f=a("./plugin-manager");b.exports=function(b,g,h){var i=function(b,g,j){if(g=g||{},"function"==typeof g&&(j=g,g={}),!j){c||(c="undefined"==typeof Promise?a("promise"):Promise);var k=this;return new c(function(a,c){i.call(k,b,g,function(b,d){b?c(b):a(d)})})}var l,m,n=new f(this);if(n.addPlugins(g.plugins),g.pluginManager=n,l=new d.Parse(g),g.rootFileInfo)m=g.rootFileInfo;else{var o=g.filename||"input",p=o.replace(/[^\/\\]*$/,"");m={filename:o,relativeUrls:l.relativeUrls,rootpath:l.rootpath||"",currentDirectory:p,entryPath:p,rootFilename:o},m.rootpath&&"/"!==m.rootpath.slice(-1)&&(m.rootpath+="/")}var q=new h(l,m);new e(l,q,m).parse(b,function(a,b){return a?j(a):void j(null,b,q,g)},g)};return i}},{"./contexts":10,"./parser/parser":36,"./plugin-manager":37,promise:void 0}],34:[function(a,b){b.exports=function(a,b){function c(b){var c=h-q;512>c&&!b||!c||(p.push(a.slice(q,h+1)),q=h+1)}var d,e,f,g,h,i,j,k,l,m=a.length,n=0,o=0,p=[],q=0;for(h=0;m>h;h++)if(j=a.charCodeAt(h),!(j>=97&&122>=j||34>j))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(m-1>h){h++;continue}return b("unescaped `\\`",h);case 34:case 39:case 96:for(l=0,i=h,h+=1;m>h;h++)if(k=a.charCodeAt(h),!(k>96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;if(k=a.charCodeAt(h+1),47==k)for(h+=2;m>h&&(k=a.charCodeAt(h),!(13>=k)||10!=k&&13!=k);h++);else if(42==k){for(f=i=h,h+=2;m-1>h&&(k=a.charCodeAt(h),125==k&&(g=h),42!=k||47!=a.charCodeAt(h+1));h++);if(h==m-1)return b("missing closing `*/`",i);h++}continue;case 42:if(m-1>h&&47==a.charCodeAt(h+1))return b("unmatched `/*`",h);continue}return 0!==n?f>d&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],35:[function(a,b){var c=a("./chunker");b.exports=function(){var a,b,d,e,f,g,h,i=[],j={};j.save=function(){h=j.i,i.push({current:g,i:j.i,j:b})},j.restore=function(a){(j.i>d||j.i===d&&a&&!e)&&(d=j.i,e=a);var c=i.pop();g=c.current,h=j.i=c.i,b=c.j},j.forget=function(){i.pop()},j.isWhitespace=function(b){var c=j.i+(b||0),d=a.charCodeAt(c);return d===k||d===n||d===l||d===m},j.$re=function(a){j.i>h&&(g=g.slice(j.i-h),h=j.i);var b=a.exec(g);return b?(s(b[0].length),"string"==typeof b?b:1===b.length?b[0]:b):null},j.$char=function(b){return a.charAt(j.i)!==b?null:(s(1),b)},j.$str=function(b){for(var c=b.length,d=0;c>d;d++)if(a.charAt(j.i+d)!==b.charAt(d))return null;return s(c),b},j.$quoted=function(){var b=a.charAt(j.i);if("'"===b||'"'===b){for(var c=a.length,d=j.i,e=1;c>e+d;e++){var f=a.charAt(e+d);switch(f){case"\\":e++;continue;case"\r":case"\n":break;case b:var g=a.substr(d,e+1);return s(e+1),g}}return null}};var k=32,l=9,m=10,n=13,o=43,p=44,q=47,r=57;j.autoCommentAbsorb=!0,j.commentStore=[],j.finished=!1;var s=function(c){for(var d,e,i,o=j.i,p=b,r=j.i-h,t=j.i+g.length-r,u=j.i+=c,v=a;t>j.i;j.i++){if(d=v.charCodeAt(j.i),j.autoCommentAbsorb&&d===q){if(e=v.charAt(j.i+1),"/"===e){i={index:j.i,isLineComment:!0};var w=v.indexOf("\n",j.i+2);0>w&&(w=t),j.i=w,i.text=v.substr(i.i,j.i-i.i),j.commentStore.push(i);continue}if("*"===e){var x=v.indexOf("*/",j.i+2);if(x>=0){i={index:j.i,text:v.substr(j.i,x+2-j.i),isLineComment:!1},j.i+=i.text.length-1,j.commentStore.push(i);continue}}break}if(d!==k&&d!==m&&d!==l&&d!==n)break}if(g=g.slice(c+j.i-u+r),h=j.i,!g.length){if(f.length-1>b)return g=f[++b],s(0),!0;j.finished=!0}return o!==j.i||p!==b};return j.peek=function(b){if("string"==typeof b){for(var c=0;b.length>c;c++)if(a.charAt(j.i+c)!==b.charAt(c))return!1;return!0}return b.test(g)},j.peekChar=function(b){return a.charAt(j.i)===b},j.currentChar=function(){return a.charAt(j.i)},j.getInput=function(){return a},j.peekNotNumeric=function(){var b=a.charCodeAt(j.i);return b>r||o>b||b===q||b===p},j.start=function(e,i,k){a=e,j.i=b=h=d=0,f=i?c(e,k):[e],g=f[0],s(0)},j.end=function(){var b,c=j.i>=a.length;return d>j.i&&(b=e,j.i=d),{isFinished:c,furthest:j.i,furthestPossibleErrorMessage:b,furthestReachedEnd:j.i>=a.length-1,furthestChar:a[j.i]}},j}},{"./chunker":34}],36:[function(a,b){var c=a("../less-error"),d=a("../tree"),e=a("../visitors"),f=a("./parser-input"),g=a("../utils"),h=function i(a,b,h){function j(a,b){var c="[object Function]"===Object.prototype.toString.call(a)?a.call(n):o.$re(a);return c?c:void l(b||("string"==typeof a?"expected '"+a+"' got '"+o.currentChar()+"'":"unexpected token"))}function k(a,b){return o.$char(a)?a:void l(b||"expected '"+a+"' got '"+o.currentChar()+"'")}function l(a,d){throw new c({index:o.i,filename:h.filename,type:d||"Syntax",message:a},b)}function m(a){var b=h.filename;return{lineNumber:g.getLocation(a,o.getInput()).line+1,fileName:b}}var n,o=f();return{parse:function(f,g,j){var k,l,m,n,p=null,q="";if(l=j&&j.globalVars?i.serializeVars(j.globalVars)+"\n":"",m=j&&j.modifyVars?"\n"+i.serializeVars(j.modifyVars):"",a.pluginManager)for(var r=a.pluginManager.getPreProcessors(),s=0;r.length>s;s++)f=r[s].process(f,{context:a,imports:b,fileInfo:h});(l||j&&j.banner)&&(q=(j&&j.banner?j.banner:"")+l,n=b.contentsIgnoredChars,n[h.filename]=n[h.filename]||0,n[h.filename]+=q.length),f=f.replace(/\r\n?/g,"\n"),f=q+f.replace(/^\uFEFF/,"")+m,b.contents[h.filename]=f;try{o.start(f,a.chunkInput,function(a,d){throw new c({index:d,type:"Parse",message:a,filename:h.filename},b)}),k=new d.Ruleset(null,this.parsers.primary()),k.root=!0,k.firstRoot=!0}catch(t){return g(new c(t,b,h.filename))}var u=o.end();if(!u.isFinished){var v=u.furthestPossibleErrorMessage;v||(v="Unrecognised input","}"===u.furthestChar?v+=". Possibly missing opening '{'":")"===u.furthestChar?v+=". Possibly missing opening '('":u.furthestReachedEnd&&(v+=". Possibly missing something")),p=new c({type:"Parse",message:v,index:u.furthest,filename:h.filename},b)}var w=function(a){return a=p||a||b.error,a?(a instanceof c||(a=new c(a,b,h.filename)),g(a)):g(null,k)};return a.processImports===!1?w():void new e.ImportVisitor(b,w).run(k)},parsers:n={primary:function(){for(var a,b=this.mixin,c=[];;){for(;;){if(a=this.comment(),!a)break;c.push(a)}if(o.finished)break;if(o.peek("}"))break;if(a=this.extendRule())c=c.concat(a);else if(a=b.definition()||this.rule()||this.ruleset()||b.call()||this.rulesetCall()||this.directive())c.push(a);else{for(var d=!1;o.$char(";");)d=!0;if(!d)break}}return c},comment:function(){if(o.commentStore.length){var a=o.commentStore.shift();return new d.Comment(a.text,a.isLineComment,a.index,h)}},entities:{quoted:function(){var a,b=o.i,c=!1;return o.save(),o.$char("~")&&(c=!0),(a=o.$quoted())?(o.forget(),new d.Quoted(a.charAt(0),a.substr(1,a.length-2),c,b,h)):void o.restore()},keyword:function(){var a=o.$char("%")||o.$re(/^[_A-Za-z-][_A-Za-z0-9-]*/);return a?d.Color.fromKeyword(a)||new d.Keyword(a):void 0},call:function(){var a,b,c,e,f=o.i;if(!o.peek(/^url\(/i))return o.save(),(a=o.$re(/^([\w-]+|%|progid:[\w\.]+)\(/))?(a=a[1],b=a.toLowerCase(),"alpha"===b&&(e=n.alpha())?(o.forget(),e):(c=this.arguments(),o.$char(")")?(o.forget(),new d.Call(a,c,f,h)):void o.restore("Could not parse call arguments or missing ')'"))):void o.forget()},arguments:function(){for(var a,b=[];;){if(a=this.assignment()||n.expression(),!a)break;if(b.push(a),!o.$char(","))break}return b},literal:function(){return this.dimension()||this.color()||this.quoted()||this.unicodeDescriptor()},assignment:function(){var a,b;return o.save(),(a=o.$re(/^\w+(?=\s?=)/i))&&o.$char("=")&&(b=n.entity())?(o.forget(),new d.Assignment(a,b)):void o.restore()},url:function(){var a,b=o.i;return o.autoCommentAbsorb=!1,o.$str("url(")?(a=this.quoted()||this.variable()||o.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",o.autoCommentAbsorb=!0,k(")"),new d.URL(null!=a.value||a instanceof d.Variable?a:new d.Anonymous(a),b,h)):void(o.autoCommentAbsorb=!0)},variable:function(){var a,b=o.i;return"@"===o.currentChar()&&(a=o.$re(/^@@?[\w-]+/))?new d.Variable(a,b,h):void 0},variableCurly:function(){var a,b=o.i;return"@"===o.currentChar()&&(a=o.$re(/^@\{([\w-]+)\}/))?new d.Variable("@"+a[1],b,h):void 0},color:function(){var a;if("#"===o.currentChar()&&(a=o.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){var b=a.input.match(/^#([\w]+).*/);return b=b[1],b.match(/^[A-Fa-f0-9]+$/)||l("Invalid HEX color code"),new d.Color(a[1])}},dimension:function(){if(!o.peekNotNumeric()){var a=o.$re(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/i);return a?new d.Dimension(a[1],a[2]):void 0}},unicodeDescriptor:function(){var a;return a=o.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/),a?new d.UnicodeDescriptor(a[0]):void 0},javascript:function(){var a,b=o.i;o.save();var c=o.$char("~"),e=o.$char("`");return e?(a=o.$re(/^[^`]*`/))?(o.forget(),new d.JavaScript(a.substr(0,a.length-1),Boolean(c),b,h)):void o.restore("invalid javascript definition"):void o.restore()}},variable:function(){var a;return"@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*:/))?a[1]:void 0},rulesetCall:function(){var a;return"@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*\(\s*\)\s*;/))?new d.RulesetCall(a[1]):void 0},extend:function(a){var b,c,e,f,g,h=o.i;if(o.$str(a?"&:extend(":":extend(")){do{for(e=null,b=null;!(e=o.$re(/^(all)(?=\s*(\)|,))/))&&(c=this.element());)b?b.push(c):b=[c];e=e&&e[1],b||l("Missing target selector for :extend()."),g=new d.Extend(new d.Selector(b),e,h),f?f.push(g):f=[g]}while(o.$char(","));return j(/^\)/),a&&j(/^;/),f}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var a,b,c,e,f,g,i=o.currentChar(),j=!1,l=o.i;if("."===i||"#"===i){for(o.save();;){if(a=o.i,e=o.$re(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!e)break;c=new d.Element(f,e,a,h),b?b.push(c):b=[c],f=o.$char(">")}return b&&(o.$char("(")&&(g=this.args(!0).args,k(")")),n.important()&&(j=!0),n.end())?(o.forget(),new d.mixin.Call(b,g,l,h,j)):void o.restore()}},args:function(a){var b,c,e,f,g,h,i=n.entities,j={args:null,variadic:!1},k=[],m=[],p=[];for(o.save();;){if(a)h=n.detachedRuleset()||n.expression();else{if(o.commentStore.length=0,o.$str("...")){j.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?m:p).push({variadic:!0});break}h=i.variable()||i.literal()||i.keyword()}if(!h)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var q=null;if(a?h.value&&1==h.value.length&&(q=h.value[0]):q=h,q&&q instanceof d.Variable)if(o.$char(":")){if(k.length>0&&(b&&l("Cannot mix ; and , as delimiter types"),c=!0),g=n.detachedRuleset()||n.expression(),!g){if(!a)return o.restore(),j.args=[],j;l("could not understand value for named argument")}f=e=q.name}else{if(!a&&o.$str("...")){j.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?m:p).push({name:h.name,variadic:!0});break}a||(e=f=q.name,g=null)}g&&k.push(g),p.push({name:f,value:g}),o.$char(",")||(o.$char(";")||b)&&(c&&l("Cannot mix ; and , as delimiter types"),b=!0,k.length>1&&(g=new d.Value(k)),m.push({name:e,value:g}),e=null,k=[],c=!1)}return o.forget(),j.args=b?m:p,j},definition:function(){var a,b,c,e,f=[],g=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),b=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(e=j(n.conditions,"expected condition")),c=n.block())return o.forget(),new d.mixin.Definition(a,f,c,e,g);o.restore()}else o.forget()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()},end:function(){return o.$char(";")||o.peek("}")},alpha:function(){var a;if(o.$re(/^opacity=/i))return a=o.$re(/^\d+/),a||(a=j(this.entities.variable,"Could not parse alpha")),k(")"),new d.Alpha(a)},element:function(){var a,b,c,e=o.i;return b=this.combinator(),a=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[\.#:](?=@)/)||this.entities.variableCurly(),a||(o.save(),o.$char("(")?(c=this.selector())&&o.$char(")")?(a=new d.Paren(c),o.forget()):o.restore("Missing closing ')'"):o.forget()),a?new d.Element(b,a,e,h):void 0},combinator:function(){var a=o.currentChar();if("/"===a){o.save();var b=o.$re(/^\/[a-z]+\//i);if(b)return o.forget(),new d.Combinator(b);o.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(o.i++,"^"===a&&"^"===o.currentChar()&&(a="^^",o.i++);o.isWhitespace();)o.i++;return new d.Combinator(a)}return new d.Combinator(o.isWhitespace(-1)?" ":null)},lessSelector:function(){return this.selector(!0)},selector:function(a){for(var b,c,e,f,g,i,k,m=o.i;(a&&(c=this.extend())||a&&(i=o.$str("when"))||(f=this.element()))&&(i?k=j(this.conditions,"expected condition"):k?l("CSS guard can only be used at the end of selector"):c?g=g?g.concat(c):c:(g&&l("Extend can only be used at the end of selector"),e=o.currentChar(),b?b.push(f):b=[f],f=null),"{"!==e&&"}"!==e&&";"!==e&&","!==e&&")"!==e););return b?new d.Selector(b,g,k,m,h):void(g&&l("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(o.$char("[")){var a,b,c,e=this.entities;return(a=e.variableCurly())||(a=j(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=o.$re(/^[|~*$^]?=/),c&&(b=e.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||e.variableCurly()),k("]"),new d.Attribute(a,c,b)}},block:function(){var a;return o.$char("{")&&(a=this.primary())&&o.$char("}")?a:void 0},blockRuleset:function(){var a=this.block();return a&&(a=new d.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();return a?new d.DetachedRuleset(a):void 0},ruleset:function(){var b,c,e,f;for(o.save(),a.dumpLineNumbers&&(f=m(o.i));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],o.commentStore.length=0,c.condition&&b.length>1&&l("Guards are only currently allowed on a single selector."),!o.$char(","))break;c.condition&&l("Guards are only currently allowed on a single selector."),o.commentStore.length=0}if(b&&(e=this.block())){o.forget();var g=new d.Ruleset(b,e,a.strictImports);return a.dumpLineNumbers&&(g.debugInfo=f),g}o.restore()},rule:function(b){var c,e,f,g,i,j=o.i,k=o.currentChar();if("."!==k&&"#"!==k&&"&"!==k&&":"!==k)if(o.save(),c=this.variable()||this.ruleProperty()){if(i="string"==typeof c,i&&(e=this.detachedRuleset()),o.commentStore.length=0,!e){g=!i&&c.length>1&&c.pop().value;var l=!b&&(a.compress||i);if(l&&(e=this.value()),!e&&(e=this.anonymousValue()))return o.forget(),new d.Rule(c,e,!1,g,j,h);l||e||(e=this.value()),f=this.important()}if(e&&this.end())return o.forget(),new d.Rule(c,e,f,g,j,h);if(o.restore(),e&&!b)return this.rule(!0)}else o.forget()},anonymousValue:function(){var a=o.$re(/^([^@+\/'"*`(;{}-]*);/);return a?new d.Anonymous(a[1]):void 0},"import":function(){var a,b,c=o.i,e=o.$re(/^@import?\s+/);if(e){var f=(e?this.importOptions():null)||{};if(a=this.entities.quoted()||this.entities.url())return b=this.mediaFeatures(),o.$char(";")||(o.i=c,l("missing semi-colon or unrecognised media features on import")),b=b&&new d.Value(b),new d.Import(a,b,f,c,h);o.i=c,l("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!o.$char("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!o.$char(","))break}while(a);return k(")"),d},importOption:function(){var a=o.$re(/^(less|css|multiple|once|inline|reference|optional)/);return a?a[1]:void 0},mediaFeature:function(){var a,b,c=this.entities,e=[];o.save();do if(a=c.keyword()||c.variable())e.push(a);else if(o.$char("(")){if(b=this.property(),a=this.value(),!o.$char(")"))return o.restore("Missing closing ')'"),null;if(b&&a)e.push(new d.Paren(new d.Rule(b,a,null,null,o.i,h,!0)));else{if(!a)return o.restore("badly formed media feature definition"),null;e.push(new d.Paren(a))}}while(a);return o.forget(),e.length>0?new d.Expression(e):void 0},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!o.$char(","))break}else if(a=b.variable(),a&&(c.push(a),!o.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,c,e,f;return a.dumpLineNumbers&&(f=m(o.i)),o.save(),o.$str("@media")?(b=this.mediaFeatures(),(c=this.block())?(o.forget(),e=new d.Media(c,b,o.i,h),a.dumpLineNumbers&&(e.debugInfo=f),e):void o.restore("media definitions require block statements after any features")):void o.restore()},plugin:function(){var a,b=o.i,c=o.$re(/^@plugin?\s+/);if(c){var e={plugin:!0};if(a=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=b,l("missing semi-colon on plugin")),new d.Import(a,null,e,b,h);o.i=b,l("malformed plugin statement")}},directive:function(){var b,c,e,f,g,i,j,k=o.i,n=!0,p=!0;if("@"===o.currentChar()){if(c=this["import"]()||this.plugin()||this.media())return c;if(o.save(),b=o.$re(/^@[a-z-]+/)){switch(f=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(f="@"+b.slice(b.indexOf("-",2)+1)),f){case"@counter-style":g=!0,n=!0;break;case"@charset":g=!0,n=!1;break;case"@namespace":i=!0,n=!1;break;case"@keyframes":g=!0;break;case"@host":case"@page":j=!0;break;case"@document":case"@supports":j=!0,p=!1}return o.commentStore.length=0,g?(c=this.entity(),c||l("expected "+b+" identifier")):i?(c=this.expression(),c||l("expected "+b+" expression")):j&&(c=(o.$re(/^[^{;]+/)||"").trim(),c&&(c=new d.Anonymous(c))),n&&(e=this.blockRuleset()),e||!n&&c&&o.$char(";")?(o.forget(),new d.Directive(b,c,e,k,h,a.dumpLineNumbers?m(k):null,!1,p)):void o.restore("directive options not recognised")}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!o.$char(",")))break;while(a);return b.length>0?new d.Value(b):void 0},important:function(){return"!"===o.currentChar()?o.$re(/^! *important/):void 0},sub:function(){var a,b;return o.save(),o.$char("(")?(a=this.addition(),a&&o.$char(")")?(o.forget(),b=new d.Expression([a]),b.parens=!0,b):void o.restore("Expected ')'")):void o.restore()},multiplication:function(){var a,b,c,e,f;if(a=this.operand()){for(f=o.isWhitespace(-1);;){if(o.peek(/^\/[*\/]/))break;if(o.save(),c=o.$char("/")||o.$char("*"),!c){o.forget();break}if(b=this.operand(),!b){o.restore();break}o.forget(),a.parensInOp=!0,b.parensInOp=!0,e=new d.Operation(c,[e||a,b],f),f=o.isWhitespace(-1)}return e||a}},addition:function(){var a,b,c,e,f;if(a=this.multiplication()){for(f=o.isWhitespace(-1);;){if(c=o.$re(/^[-+]\s+/)||!f&&(o.$char("+")||o.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,e=new d.Operation(c,[e||a,b],f),f=o.isWhitespace(-1)}return e||a}},conditions:function(){var a,b,c,e=o.i;if(a=this.condition()){for(;;){if(!o.peek(/^,\s*(not\s*)?\(/)||!o.$char(","))break;if(b=this.condition(),!b)break;c=new d.Condition("or",c||a,b,e)}return c||a}},condition:function(){var a,b,c,e,f=this.entities,g=o.i,h=!1;return o.$str("not")&&(h=!0),k("("),a=this.addition()||f.keyword()||f.quoted(),a?(o.$char(">")?e=o.$char("=")?">=":">":o.$char("<")?e=o.$char("=")?"<=":"<":o.$char("=")&&(e=o.$char(">")?"=>":o.$char("<")?"=<":"="),e?(b=this.addition()||f.keyword()||f.quoted(),b?c=new d.Condition(e,a,b,g,h):l("expected expression")):c=new d.Condition("=",a,new d.Keyword("true"),g,h),k(")"),o.$str("and")?new d.Condition("and",c,this.condition()):c):void 0},operand:function(){var a,b=this.entities;o.peek(/^-[@\(]/)&&(a=o.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.call();return a&&(c.parensInOp=!0,c=new d.Negative(c)),c},expression:function(){var a,b,c=[];do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),o.peek(/^\/[\/*]/)||(b=o.$char("/"),b&&c.push(new d.Anonymous(b)))));while(a);return c.length>0?new d.Expression(c):void 0},property:function(){var a=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);return a?a[1]:void 0},ruleProperty:function(){function a(a){var b=o.i,c=o.$re(a);return c?(f.push(b),e.push(c[1])):void 0}var b,c,e=[],f=[];o.save();var g=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(g)return e=[new d.Keyword(g[1])],o.forget(),e;for(a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/))break;if(e.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===e[0]&&(e.shift(),f.shift()),c=0;e.length>c;c++)b=e[c],e[c]="@"!==b.charAt(0)?new d.Keyword(b):new d.Variable("@"+b.slice(2,-1),f[c],h);return e}o.restore()}}}};h.serializeVars=function(a){var b="";for(var c in a)if(Object.hasOwnProperty.call(a,c)){var d=a[c];b+=("@"===c[0]?"":"@")+c+": "+d+(";"===String(d).slice(-1)?"":";")}return b},b.exports=h},{"../less-error":30,"../tree":60,"../utils":81,"../visitors":85,"./parser-input":35}],37:[function(a,b){var c=function(a){this.less=a,this.visitors=[],this.preProcessors=[],this.postProcessors=[],this.installedPlugins=[],this.fileManagers=[]};c.prototype.addPlugins=function(a){if(a)for(var b=0;a.length>b;b++)this.addPlugin(a[b])},c.prototype.addPlugin=function(a){this.installedPlugins.push(a),a.install(this.less,this)},c.prototype.addVisitor=function(a){this.visitors.push(a)},c.prototype.addPreProcessor=function(a,b){var c;for(c=0;this.preProcessors.length>c&&!(this.preProcessors[c].priority>=b);c++);this.preProcessors.splice(c,0,{preProcessor:a,priority:b})},c.prototype.addPostProcessor=function(a,b){var c;for(c=0;this.postProcessors.length>c&&!(this.postProcessors[c].priority>=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},c.prototype.addFileManager=function(a){this.fileManagers.push(a)},c.prototype.getPreProcessors=function(){for(var a=[],b=0;this.preProcessors.length>b;b++)a.push(this.preProcessors[b].preProcessor);return a},c.prototype.getPostProcessors=function(){for(var a=[],b=0;this.postProcessors.length>b;b++)a.push(this.postProcessors[b].postProcessor);return a},c.prototype.getVisitors=function(){return this.visitors},c.prototype.getFileManagers=function(){return this.fileManagers},b.exports=c},{}],38:[function(a,b){var c=a("../less-error"),d=a("../tree"),e=b.exports=function(a,b){this.fileInfo=b};e.prototype.eval=function(a,b){var e,f,g={};f={add:function(a,b){g[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){g[b]=a[b]})}};try{e=new Function("functions","tree","fileInfo",a),e(f,d,this.fileInfo)}catch(h){b(new c({message:"Plugin evaluation error: '"+h.name+": "+h.message.replace(/["]/g,"'")+"'",filename:this.fileInfo.filename}),null)}b(null,{functions:g})}},{"../less-error":30,"../tree":60}],39:[function(a,b){var c;b.exports=function(b,d){var e=function(b,f,g){if("function"==typeof f&&(g=f,f={}),!g){c||(c="undefined"==typeof Promise?a("promise"):Promise);var h=this;return new c(function(a,c){e.call(h,b,f,function(b,d){b?c(b):a(d)})})}this.parse(b,f,function(a,b,c,e){if(a)return g(a);var f;try{var h=new d(b,c);f=h.toCSS(e)}catch(a){return g(a)}g(null,f)})};return e}},{promise:void 0}],40:[function(a,b){b.exports=function(a,b){var c=function(a){this.options=a};return c.prototype.toCSS=function(b,c,d){var e=new a({contentsIgnoredCharsMap:d.contentsIgnoredChars,rootNode:b,contentsMap:d.contents,sourceMapFilename:this.options.sourceMapFilename,sourceMapURL:this.options.sourceMapURL,outputFilename:this.options.sourceMapOutputFilename,sourceMapBasepath:this.options.sourceMapBasepath,sourceMapRootpath:this.options.sourceMapRootpath,outputSourceFiles:this.options.outputSourceFiles,sourceMapGenerator:this.options.sourceMapGenerator,sourceMapFileInline:this.options.sourceMapFileInline}),f=e.toCSS(c);return this.sourceMap=e.sourceMap,this.sourceMapURL=e.sourceMapURL,this.options.sourceMapInputFilename&&(this.sourceMapInputFilename=e.normalizeFilename(this.options.sourceMapInputFilename)),f+this.getCSSAppendage()},c.prototype.getCSSAppendage=function(){var a=this.sourceMapURL;if(this.options.sourceMapFileInline){if(void 0===this.sourceMap)return"";a="data:application/json;base64,"+b.encodeBase64(this.sourceMap)}return a?"/*# sourceMappingURL="+a+" */":""},c.prototype.getExternalSourceMap=function(){return this.sourceMap},c.prototype.setExternalSourceMap=function(a){this.sourceMap=a},c.prototype.isInline=function(){return this.options.sourceMapFileInline},c.prototype.getSourceMapURL=function(){return this.sourceMapURL},c.prototype.getOutputFilename=function(){return this.options.sourceMapOutputFilename},c.prototype.getInputFilename=function(){return this.sourceMapInputFilename},c}},{}],41:[function(a,b){b.exports=function(a){var b=function(b){this._css=[],this._rootNode=b.rootNode,this._contentsMap=b.contentsMap,this._contentsIgnoredCharsMap=b.contentsIgnoredCharsMap,b.sourceMapFilename&&(this._sourceMapFilename=b.sourceMapFilename.replace(/\\/g,"/")),this._outputFilename=b.outputFilename,this.sourceMapURL=b.sourceMapURL,b.sourceMapBasepath&&(this._sourceMapBasepath=b.sourceMapBasepath.replace(/\\/g,"/")),
15
  b.sourceMapRootpath?(this._sourceMapRootpath=b.sourceMapRootpath.replace(/\\/g,"/"),"/"!==this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1)&&(this._sourceMapRootpath+="/")):this._sourceMapRootpath="",this._outputSourceFiles=b.outputSourceFiles,this._sourceMapGeneratorConstructor=a.getSourceMapGenerator(),this._lineNumber=0,this._column=0};return b.prototype.normalizeFilename=function(a){return a=a.replace(/\\/g,"/"),this._sourceMapBasepath&&0===a.indexOf(this._sourceMapBasepath)&&(a=a.substring(this._sourceMapBasepath.length),("\\"===a.charAt(0)||"/"===a.charAt(0))&&(a=a.substring(1))),(this._sourceMapRootpath||"")+a},b.prototype.add=function(a,b,c,d){if(a){var e,f,g,h,i;if(b){var j=this._contentsMap[b.filename];this._contentsIgnoredCharsMap[b.filename]&&(c-=this._contentsIgnoredCharsMap[b.filename],0>c&&(c=0),j=j.slice(this._contentsIgnoredCharsMap[b.filename])),j=j.substring(0,c),f=j.split("\n"),h=f[f.length-1]}if(e=a.split("\n"),g=e[e.length-1],b)if(d)for(i=0;e.length>i;i++)this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+i+1,column:0===i?this._column:0},original:{line:f.length+i,column:0===i?h.length:0},source:this.normalizeFilename(b.filename)});else this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+1,column:this._column},original:{line:f.length,column:h.length},source:this.normalizeFilename(b.filename)});1===e.length?this._column+=g.length:(this._lineNumber+=e.length-1,this._column=g.length),this._css.push(a)}},b.prototype.isEmpty=function(){return 0===this._css.length},b.prototype.toCSS=function(a){if(this._sourceMapGenerator=new this._sourceMapGeneratorConstructor({file:this._outputFilename,sourceRoot:null}),this._outputSourceFiles)for(var b in this._contentsMap)if(this._contentsMap.hasOwnProperty(b)){var c=this._contentsMap[b];this._contentsIgnoredCharsMap[b]&&(c=c.slice(this._contentsIgnoredCharsMap[b])),this._sourceMapGenerator.setSourceContent(this.normalizeFilename(b),c)}if(this._rootNode.genCSS(a,this),this._css.length>0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],42:[function(a,b){var c=a("./contexts"),d=a("./visitors"),e=a("./tree");b.exports=function(a,b){b=b||{};var f,g=b.variables,h=new c.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b])),new e.Rule("@"+a,b,!1,null,0)}),h.frames=[new e.Ruleset(null,g)]);var i,j=[],k=[new d.JoinSelectorVisitor,new d.ExtendVisitor,new d.ToCSSVisitor({compress:Boolean(b.compress)})];if(b.pluginManager){var l=b.pluginManager.getVisitors();for(i=0;l.length>i;i++){var m=l[i];m.isPreEvalVisitor?j.push(m):m.isPreVisitor?k.splice(0,0,m):k.push(m)}}for(i=0;j.length>i;i++)j[i].run(a);for(f=a.eval(h),i=0;k.length>i;i++)k[i].run(f);return f}},{"./contexts":10,"./tree":60,"./visitors":85}],43:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Alpha",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.eval=function(a){return this.value.eval?new d(this.value.eval(a)):this},d.prototype.genCSS=function(a,b){b.add("alpha(opacity="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value),b.add(")")},b.exports=d},{"./node":68}],44:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e){this.value=a,this.index=b,this.mapLines=d,this.currentFileInfo=c,this.rulesetLike="undefined"==typeof e?!1:e};d.prototype=new c,d.prototype.type="Anonymous",d.prototype.eval=function(){return new d(this.value,this.index,this.currentFileInfo,this.mapLines,this.rulesetLike)},d.prototype.compare=function(a){return a.toCSS&&this.toCSS()===a.toCSS()?0:void 0},d.prototype.isRulesetLike=function(){return this.rulesetLike},d.prototype.genCSS=function(a,b){b.add(this.value,this.currentFileInfo,this.index,this.mapLines)},b.exports=d},{"./node":68}],45:[function(a,b){var c=a("./node"),d=function(a,b){this.key=a,this.value=b};d.prototype=new c,d.prototype.type="Assignment",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.eval=function(a){return this.value.eval?new d(this.key,this.value.eval(a)):this},d.prototype.genCSS=function(a,b){b.add(this.key+"="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value)},b.exports=d},{"./node":68}],46:[function(a,b){var c=a("./node"),d=function(a,b,c){this.key=a,this.op=b,this.value=c};d.prototype=new c,d.prototype.type="Attribute",d.prototype.eval=function(a){return new d(this.key.eval?this.key.eval(a):this.key,this.op,this.value&&this.value.eval?this.value.eval(a):this.value)},d.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},d.prototype.toCSS=function(a){var b=this.key.toCSS?this.key.toCSS(a):this.key;return this.op&&(b+=this.op,b+=this.value.toCSS?this.value.toCSS(a):this.value),"["+b+"]"},b.exports=d},{"./node":68}],47:[function(a,b){var c=a("./node"),d=a("../functions/function-caller"),e=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Call",e.prototype.accept=function(a){this.args&&(this.args=a.visitArray(this.args))},e.prototype.eval=function(a){var b,c=this.args.map(function(b){return b.eval(a)}),f=new d(this.name,a,this.index,this.currentFileInfo);if(f.isValid())try{if(b=f.call(c),null!=b)return b}catch(g){throw{type:g.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(g.message?": "+g.message:""),index:this.index,filename:this.currentFileInfo.filename}}return new e(this.name,c,this.index,this.currentFileInfo)},e.prototype.genCSS=function(a,b){b.add(this.name+"(",this.currentFileInfo,this.index);for(var c=0;this.args.length>c;c++)this.args[c].genCSS(a,b),this.args.length>c+1&&b.add(", ");b.add(")")},b.exports=e},{"../functions/function-caller":20,"./node":68}],48:[function(a,b){function c(a,b){return Math.min(Math.max(a,0),b)}function d(a){return"#"+a.map(function(a){return a=c(Math.round(a),255),(16>a?"0":"")+a.toString(16)}).join("")}var e=a("./node"),f=a("../data/colors"),g=function(a,b){this.rgb=Array.isArray(a)?a:6==a.length?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha="number"==typeof b?b:1};g.prototype=new e,g.prototype.type="Color",g.prototype.luma=function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255;return a=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4),b=.03928>=b?b/12.92:Math.pow((b+.055)/1.055,2.4),c=.03928>=c?c/12.92:Math.pow((c+.055)/1.055,2.4),.2126*a+.7152*b+.0722*c},g.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},g.prototype.toCSS=function(a,b){var d,e,f=a&&a.compress&&!b;if(this.value)return this.value;if(e=this.fround(a,this.alpha),1>e)return"rgba("+this.rgb.map(function(a){return c(Math.round(a),255)}).concat(c(e,1)).join(","+(f?"":" "))+")";if(d=this.toRGB(),f){var g=d.split("");g[1]===g[2]&&g[3]===g[4]&&g[5]===g[6]&&(d="#"+g[1]+g[3]+g[5])}return d},g.prototype.operate=function(a,b,c){for(var d=[],e=this.alpha*(1-c.alpha)+c.alpha,f=0;3>f;f++)d[f]=this._operate(a,b,this.rgb[f],c.rgb[f]);return new g(d,e)},g.prototype.toRGB=function(){return d(this.rgb)},g.prototype.toHSL=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=(g+h)/2,j=g-h;if(g===h)a=b=0;else{switch(b=i>.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,l:i,a:f}},g.prototype.toHSV=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=0;else{switch(g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,v:i,a:f}},g.prototype.toARGB=function(){return d([255*this.alpha].concat(this.rgb))},g.prototype.compare=function(a){return a.rgb&&a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:void 0},g.fromKeyword=function(a){var b,c=a.toLowerCase();return f.hasOwnProperty(c)?b=new g(f[c].slice(1)):"transparent"===c&&(b=new g([0,0,0],0)),b?(b.value=a,b):void 0},b.exports=g},{"../data/colors":11,"./node":68}],49:[function(a,b){var c=a("./node"),d=function(a){" "===a?(this.value=" ",this.emptyOrWhitespace=!0):(this.value=a?a.trim():"",this.emptyOrWhitespace=""===this.value)};d.prototype=new c,d.prototype.type="Combinator";var e={"":!0," ":!0,"|":!0};d.prototype.genCSS=function(a,b){var c=a.compress||e[this.value]?"":" ";b.add(c+this.value+c)},b.exports=d},{"./node":68}],50:[function(a,b){var c=a("./node"),d=a("./debug-info"),e=function(a,b,c,d){this.value=a,this.isLineComment=b,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Comment",e.prototype.genCSS=function(a,b){this.debugInfo&&b.add(d(a,this),this.currentFileInfo,this.index),b.add(this.value)},e.prototype.isSilent=function(a){var b=this.currentFileInfo&&this.currentFileInfo.reference&&!this.isReferenced,c=a.compress&&"!"!==this.value[2];return this.isLineComment||b||c},e.prototype.markReferenced=function(){this.isReferenced=!0},b.exports=e},{"./debug-info":52,"./node":68}],51:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e};d.prototype=new c,d.prototype.type="Condition",d.prototype.accept=function(a){this.lvalue=a.visit(this.lvalue),this.rvalue=a.visit(this.rvalue)},d.prototype.eval=function(a){var b=function(a,b,d){switch(a){case"and":return b&&d;case"or":return b||d;default:switch(c.compare(b,d)){case-1:return"<"===a||"=<"===a||"<="===a;case 0:return"="===a||">="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=d},{"./node":68}],52:[function(a,b){var c=function(a,b,d){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=c.asComment(b);break;case"mediaquery":e=c.asMediaQuery(b);break;case"all":e=c.asComment(b)+(d||"")+c.asMediaQuery(b)}return e};c.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},c.asMediaQuery=function(a){var b=a.debugInfo.fileName;return/^[a-z]+:\/\//i.test(b)||(b="file://"+b),"@media -sass-debug-info{filename{font-family:"+b.replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=c},{}],53:[function(a,b){var c=a("./node"),d=a("../contexts"),e=function(a,b){this.ruleset=a,this.frames=b};e.prototype=new c,e.prototype.type="DetachedRuleset",e.prototype.evalFirst=!0,e.prototype.accept=function(a){this.ruleset=a.visit(this.ruleset)},e.prototype.eval=function(a){var b=this.frames||a.frames.slice(0);return new e(this.ruleset,b)},e.prototype.callEval=function(a){return this.ruleset.eval(this.frames?new d.Eval(a,this.frames.concat(a.frames)):a)},b.exports=e},{"../contexts":10,"./node":68}],54:[function(a,b){var c=a("./node"),d=a("../data/unit-conversions"),e=a("./unit"),f=a("./color"),g=function(a,b){this.value=parseFloat(a),this.unit=b&&b instanceof e?b:new e(b?[b]:void 0)};g.prototype=new c,g.prototype.type="Dimension",g.prototype.accept=function(a){this.unit=a.visit(this.unit)},g.prototype.eval=function(){return this},g.prototype.toColor=function(){return new f([this.value,this.value,this.value])},g.prototype.genCSS=function(a,b){if(a&&a.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var c=this.fround(a,this.value),d=String(c);if(0!==c&&1e-6>c&&c>-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&1>c&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},g.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e=c.unit.clone(),this.unit.backupUnit&&(e.backupUnit=this.unit.backupUnit);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new g(d,e)},g.prototype.compare=function(a){var b,d;if(!(a instanceof g))return void 0;if(this.unit.isEmpty()||a.unit.isEmpty())b=this,d=a;else if(b=this.unify(),d=a.unify(),0!==b.unit.compare(d.unit))return void 0;return c.numericCompare(b.value,d.value)},g.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},g.prototype.convertTo=function(a){var b,c,e,f,h,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in d)d[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}h=function(a,b){return e.hasOwnProperty(a)?(b?i/=e[a]/e[f]:i*=e[a]/e[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],e=d[c],j.map(h));return j.cancel(),new g(i,j)},b.exports=g},{"../data/unit-conversions":13,"./color":48,"./node":68,"./unit":77}],55:[function(a,b){var c=a("./node"),d=a("./selector"),e=a("./ruleset"),f=function(a,b,c,e,f,g,h,i){var j;if(this.name=a,this.value=b,c)for(Array.isArray(c)?this.rules=c:(this.rules=[c],this.rules[0].selectors=new d([],null,null,this.index,f).createEmptySelectors()),j=0;this.rules.length>j;j++)this.rules[j].allowImports=!0;this.index=e,this.currentFileInfo=f,this.debugInfo=g,this.isReferenced=h,this.isRooted=i||!1};f.prototype=new c,f.prototype.type="Directive",f.prototype.accept=function(a){var b=this.value,c=this.rules;c&&(this.rules=a.visitArray(c)),b&&(this.value=a.visit(b))},f.prototype.isRulesetLike=function(){return this.rules||!this.isCharset()},f.prototype.isCharset=function(){return"@charset"===this.name},f.prototype.genCSS=function(a,b){var c=this.value,d=this.rules;b.add(this.name,this.currentFileInfo,this.index),c&&(b.add(" "),c.genCSS(a,b)),d?this.outputRuleset(a,b,d):b.add(";")},f.prototype.eval=function(a){var b,c,d=this.value,e=this.rules;return b=a.mediaPath,c=a.mediaBlocks,a.mediaPath=[],a.mediaBlocks=[],d&&(d=d.eval(a)),e&&(e=[e[0].eval(a)],e[0].root=!0),a.mediaPath=b,a.mediaBlocks=c,new f(this.name,d,e,this.index,this.currentFileInfo,this.debugInfo,this.isReferenced,this.isRooted)},f.prototype.variable=function(a){return this.rules?e.prototype.variable.call(this.rules[0],a):void 0},f.prototype.find=function(){return this.rules?e.prototype.find.apply(this.rules[0],arguments):void 0},f.prototype.rulesets=function(){return this.rules?e.prototype.rulesets.apply(this.rules[0]):void 0},f.prototype.markReferenced=function(){var a,b;if(this.isReferenced=!0,this.rules)for(b=this.rules,a=0;b.length>a;a++)b[a].markReferenced&&b[a].markReferenced()},f.prototype.getIsReferenced=function(){return!this.currentFileInfo||!this.currentFileInfo.reference||this.isReferenced},f.prototype.outputRuleset=function(a,b,c){var d,e=c.length;if(a.tabLevel=(0|a.tabLevel)+1,a.compress){for(b.add("{"),d=0;e>d;d++)c[d].genCSS(a,b);return b.add("}"),void a.tabLevel--}var f="\n"+Array(a.tabLevel).join(" "),g=f+" ";if(e){for(b.add(" {"+g),c[0].genCSS(a,b),d=1;e>d;d++)b.add(g),c[d].genCSS(a,b);b.add(f+"}")}else b.add(" {"+f+"}");a.tabLevel--},b.exports=f},{"./node":68,"./ruleset":74,"./selector":75}],56:[function(a,b){var c=a("./node"),d=a("./paren"),e=a("./combinator"),f=function(a,b,c,d){this.combinator=a instanceof e?a:new e(a),this.value="string"==typeof b?b.trim():b?b:"",this.index=c,this.currentFileInfo=d};f.prototype=new c,f.prototype.type="Element",f.prototype.accept=function(a){var b=this.value;this.combinator=a.visit(this.combinator),"object"==typeof b&&(this.value=a.visit(b))},f.prototype.eval=function(a){return new f(this.combinator,this.value.eval?this.value.eval(a):this.value,this.index,this.currentFileInfo)},f.prototype.genCSS=function(a,b){b.add(this.toCSS(a),this.currentFileInfo,this.index)},f.prototype.toCSS=function(a){a=a||{};var b=this.value,c=a.firstSelector;return b instanceof d&&(a.firstSelector=!0),b=b.toCSS?b.toCSS(a):b,a.firstSelector=c,""===b&&"&"===this.combinator.value.charAt(0)?"":this.combinator.toCSS(a)+b},b.exports=f},{"./combinator":49,"./node":68,"./paren":70}],57:[function(a,b){var c=a("./node"),d=a("./paren"),e=a("./comment"),f=function(a){if(this.value=a,!a)throw new Error("Expression requires an array parameter")};f.prototype=new c,f.prototype.type="Expression",f.prototype.accept=function(a){this.value=a.visitArray(this.value)},f.prototype.eval=function(a){var b,c=this.parens&&!this.parensInOp,e=!1;return c&&a.inParenthesis(),this.value.length>1?b=new f(this.value.map(function(b){return b.eval(a)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(e=!0),b=this.value[0].eval(a)):b=this,c&&a.outOfParenthesis(),this.parens&&this.parensInOp&&!a.isMathOn()&&!e&&(b=new d(b)),b},f.prototype.genCSS=function(a,b){for(var c=0;this.value.length>c;c++)this.value[c].genCSS(a,b),this.value.length>c+1&&b.add(" ")},f.prototype.throwAwayComments=function(){this.value=this.value.filter(function(a){return!(a instanceof e)})},b.exports=f},{"./comment":50,"./node":68,"./paren":70}],58:[function(a,b){var c=a("./node"),d=function e(a,b,c){switch(this.selector=a,this.option=b,this.index=c,this.object_id=e.next_id++,this.parent_ids=[this.object_id],b){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}};d.next_id=0,d.prototype=new c,d.prototype.type="Extend",d.prototype.accept=function(a){this.selector=a.visit(this.selector)},d.prototype.eval=function(a){return new d(this.selector.eval(a),this.option,this.index)},d.prototype.clone=function(){return new d(this.selector,this.option,this.index)},d.prototype.findSelfSelectors=function(a){var b,c,d=[];for(b=0;a.length>b;b++)c=a[b].elements,b>0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[{elements:d}]},b.exports=d},{"./node":68}],59:[function(a,b){var c=a("./node"),d=a("./media"),e=a("./url"),f=a("./quoted"),g=a("./ruleset"),h=a("./anonymous"),i=function(a,b,c,d,e){if(this.options=c,this.index=d,this.path=a,this.features=b,this.currentFileInfo=e,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var f=this.getPath();f&&/[#\.\&\?\/]css([\?;].*)?$/.test(f)&&(this.css=!0)}};i.prototype=new c,i.prototype.type="Import",i.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),this.options.plugin||this.options.inline||!this.root||(this.root=a.visit(this.root))},i.prototype.genCSS=function(a,b){this.css&&void 0===this.path.currentFileInfo.reference&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},i.prototype.getPath=function(){return this.path instanceof e?this.path.value.value:this.path.value},i.prototype.isVariableImport=function(){var a=this.path;return a instanceof e&&(a=a.value),a instanceof f?a.containsVariables():!0},i.prototype.evalForImport=function(a){var b=this.path;return b instanceof e&&(b=b.value),new i(b.eval(a),this.features,this.options,this.index,this.currentFileInfo)},i.prototype.evalPath=function(a){var b=this.path.eval(a),c=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(b instanceof e)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d)}b.value=a.normalizePath(b.value)}return b},i.prototype.eval=function(a){var b,c,e=this.features&&this.features.eval(a);if(this.options.plugin)return c=a.frames[0]&&a.frames[0].functionRegistry,c&&this.root&&this.root.functions&&c.addMultiple(this.root.functions),[];if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var f=new h(this.root,0,{filename:this.importedFilename},!0,!0);return this.features?new d([f],this.features.value):[f]}if(this.css){var j=new i(this.evalPath(a),e,this.options,this.index);if(!j.css&&this.error)throw this.error;return j}return b=new g(null,this.root.rules.slice(0)),b.evalImports(a),this.features?new d(b.rules,this.features.value):b.rules},b.exports=i},{"./anonymous":44,"./media":64,"./node":68,"./quoted":71,"./ruleset":74,"./url":78}],60:[function(a,b){var c={};c.Node=a("./node"),c.Alpha=a("./alpha"),c.Color=a("./color"),c.Directive=a("./directive"),c.DetachedRuleset=a("./detached-ruleset"),c.Operation=a("./operation"),c.Dimension=a("./dimension"),c.Unit=a("./unit"),c.Keyword=a("./keyword"),c.Variable=a("./variable"),c.Ruleset=a("./ruleset"),c.Element=a("./element"),c.Attribute=a("./attribute"),c.Combinator=a("./combinator"),c.Selector=a("./selector"),c.Quoted=a("./quoted"),c.Expression=a("./expression"),c.Rule=a("./rule"),c.Call=a("./call"),c.URL=a("./url"),c.Import=a("./import"),c.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},c.Comment=a("./comment"),c.Anonymous=a("./anonymous"),c.Value=a("./value"),c.JavaScript=a("./javascript"),c.Assignment=a("./assignment"),c.Condition=a("./condition"),c.Paren=a("./paren"),c.Media=a("./media"),c.UnicodeDescriptor=a("./unicode-descriptor"),c.Negative=a("./negative"),c.Extend=a("./extend"),c.RulesetCall=a("./ruleset-call"),b.exports=c},{"./alpha":43,"./anonymous":44,"./assignment":45,"./attribute":46,"./call":47,"./color":48,"./combinator":49,"./comment":50,"./condition":51,"./detached-ruleset":53,"./dimension":54,"./directive":55,"./element":56,"./expression":57,"./extend":58,"./import":59,"./javascript":61,"./keyword":63,"./media":64,"./mixin-call":65,"./mixin-definition":66,"./negative":67,"./node":68,"./operation":69,"./paren":70,"./quoted":71,"./rule":72,"./ruleset":74,"./ruleset-call":73,"./selector":75,"./unicode-descriptor":76,"./unit":77,"./url":78,"./value":79,"./variable":80}],61:[function(a,b){var c=a("./js-eval-node"),d=a("./dimension"),e=a("./quoted"),f=a("./anonymous"),g=function(a,b,c,d){this.escaped=b,this.expression=a,this.index=c,this.currentFileInfo=d};g.prototype=new c,g.prototype.type="JavaScript",g.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a);return"number"==typeof b?new d(b):"string"==typeof b?new e('"'+b+'"',b,this.escaped,this.index):new f(Array.isArray(b)?b.join(", "):b)},b.exports=g},{"./anonymous":44,"./dimension":54,"./js-eval-node":62,"./quoted":71}],62:[function(a,b){var c=a("./node"),d=a("./variable"),e=function(){};e.prototype=new c,e.prototype.evaluateJavaScript=function(a,b){var c,e=this,f={};if(void 0!==b.javascriptEnabled&&!b.javascriptEnabled)throw{message:"You are using JavaScript, which has been disabled.",filename:this.currentFileInfo.filename,index:this.index};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return e.jsify(new d("@"+c,e.index,e.currentFileInfo).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.currentFileInfo.filename,index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.currentFileInfo.filename,index:this.index}}return c},e.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=e},{"./node":68,"./variable":80}],63:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Keyword",d.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},d.True=new d("true"),d.False=new d("false"),b.exports=d},{"./node":68}],64:[function(a,b){var c=a("./ruleset"),d=a("./value"),e=a("./selector"),f=a("./anonymous"),g=a("./expression"),h=a("./directive"),i=function(a,b,f,g){this.index=f,this.currentFileInfo=g;var h=new e([],null,null,this.index,this.currentFileInfo).createEmptySelectors();this.features=new d(b),this.rules=[new c(h,a)],this.rules[0].allowImports=!0};i.prototype=new h,i.prototype.type="Media",i.prototype.isRulesetLike=!0,i.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},i.prototype.genCSS=function(a,b){b.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},i.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new i(null,[],this.index,this.currentFileInfo);this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo);var c=!1;a.strictMath||(c=!0,a.strictMath=!0);try{b.features=this.features.eval(a)}finally{c&&(a.strictMath=!1)}return a.mediaPath.push(b),a.mediaBlocks.push(b),this.rules[0].functionRegistry=a.frames[0].functionRegistry.inherit(),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},i.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var d=new e([],null,null,this.index,this.currentFileInfo).createEmptySelectors();b=new c(d,a.mediaBlocks),b.multiMedia=!0}return delete a.mediaBlocks,delete a.mediaPath,b},i.prototype.evalNested=function(a){var b,e,h=a.mediaPath.concat([this]);for(b=0;h.length>b;b++)e=h[b].features instanceof d?h[b].features.value:h[b].features,h[b]=Array.isArray(e)?e:[e];return this.features=new d(this.permute(h).map(function(a){for(a=a.map(function(a){return a.toCSS?a:new f(a)}),b=a.length-1;b>0;b--)a.splice(b,0,new f("and"));return new g(a)})),new c([],[])},i.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;c.length>d;d++)for(var e=0;a[0].length>e;e++)b.push([a[0][e]].concat(c[d]));return b},i.prototype.bubbleSelectors=function(a){a&&(this.rules=[new c(a.slice(0),[this.rules[0]])])},b.exports=i},{"./anonymous":44,"./directive":55,"./expression":57,"./ruleset":74,"./selector":75,"./value":79}],65:[function(a,b){var c=a("./node"),d=a("./selector"),e=a("./mixin-definition"),f=a("../functions/default"),g=function(a,b,c,e,f){this.selector=new d(a),this.arguments=b&&b.length?b:null,this.index=c,this.currentFileInfo=e,this.important=f};g.prototype=new c,g.prototype.type="MixinCall",g.prototype.accept=function(a){this.selector&&(this.selector=a.visit(this.selector)),this.arguments&&(this.arguments=a.visitArray(this.arguments))},g.prototype.eval=function(a){function b(b,c){var d,e;for(k=0;2>k;k++){for(w[k]=!0,f.value(k),d=0;c.length>d&&w[k];d++)e=c[d],e.matchCondition&&(w[k]=w[k]&&e.matchCondition(null,a));b.matchCondition&&(w[k]=w[k]&&b.matchCondition(h,a))}return w[0]||w[1]?w[0]!=w[1]?w[1]?z:A:y:x}var c,d,g,h,i,j,k,l,m,n,o,p,q,r,s,t=[],u=!1,v=[],w=[],x=-1,y=0,z=1,A=2;for(h=this.arguments&&this.arguments.map(function(b){return{name:b.name,value:b.value.eval(a)}}),s=function(b){return b.matchArgs(null,a)},i=0;a.frames.length>i;i++)if((c=a.frames[i].find(this.selector,null,s)).length>0){for(m=!0,j=0;c.length>j;j++){for(d=c[j].rule,g=c[j].path,l=!1,k=0;a.frames.length>k;k++)if(!(d instanceof e)&&d===(a.frames[k].originalRuleset||a.frames[k])){l=!0;break}l||d.matchArgs(h,a)&&(o={mixin:d,group:b(d,g)},o.group!==x&&v.push(o),u=!0)}for(f.reset(),q=[0,0,0],j=0;v.length>j;j++)q[v[j].group]++;if(q[y]>0)p=A;else if(p=z,q[z]+q[A]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(h)+"`",index:this.index,filename:this.currentFileInfo.filename};for(j=0;v.length>j;j++)if(o=v[j].group,o===y||o===p)try{d=v[j].mixin,d instanceof e||(r=d.originalRuleset||d,d=new e("",[],d.rules,null,!1),d.originalRuleset=r),Array.prototype.push.apply(t,d.evalCall(a,h,this.important).rules)}catch(B){throw{message:B.message,index:this.index,filename:this.currentFileInfo.filename,stack:B.stack}}if(u){if(!this.currentFileInfo||!this.currentFileInfo.reference)for(i=0;t.length>i;i++)n=t[i],n.markReferenced&&n.markReferenced();return t}}throw m?{type:"Runtime",message:"No matching definition was found for `"+this.format(h)+"`",index:this.index,filename:this.currentFileInfo.filename}:{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.currentFileInfo.filename}},g.prototype.format=function(a){return this.selector.toCSS().trim()+"("+(a?a.map(function(a){var b="";return a.name&&(b+=a.name+":"),b+=a.value.toCSS?a.value.toCSS():"???"}).join(", "):"")+")"},b.exports=g},{"../functions/default":19,"./mixin-definition":66,"./node":68,"./selector":75}],66:[function(a,b){var c=a("./selector"),d=a("./element"),e=a("./ruleset"),f=a("./rule"),g=a("./expression"),h=a("../contexts"),i=function(a,b,e,f,g,h){this.name=a,this.selectors=[new c([new d(null,a,this.index,this.currentFileInfo)])],this.params=b,this.condition=f,this.variadic=g,this.arity=b.length,this.rules=e,this._lookups={},this.required=b.reduce(function(a,b){return!b.name||b.name&&!b.value?a+1:a},0),this.frames=h};i.prototype=new e,i.prototype.type="MixinDefinition",i.prototype.evalFirst=!0,i.prototype.accept=function(a){this.params&&this.params.length&&(this.params=a.visitArray(this.params)),this.rules=a.visitArray(this.rules),this.condition&&(this.condition=a.visit(this.condition))},i.prototype.evalParams=function(a,b,c,d){var i,j,k,l,m,n,o,p,q=new e(null,null),r=this.params.slice(0),s=0;if(b.frames&&b.frames[0]&&b.frames[0].functionRegistry&&(q.functionRegistry=b.frames[0].functionRegistry.inherit()),b=new h.Eval(b,[q].concat(b.frames)),c)for(c=c.slice(0),s=c.length,k=0;s>k;k++)if(j=c[k],n=j&&j.name){for(o=!1,l=0;r.length>l;l++)if(!d[l]&&n===r[l].name){d[l]=j.value.eval(a),q.prependRule(new f(n,j.value.eval(a))),o=!0;break}if(o){c.splice(k,1),k--;continue}throw{type:"Runtime",message:"Named argument for "+this.name+" "+c[k].name+" not found"}}for(p=0,k=0;r.length>k;k++)if(!d[k]){if(j=c&&c[p],n=r[k].name)if(r[k].variadic){for(i=[],l=p;s>l;l++)i.push(c[l].value.eval(a));q.prependRule(new f(n,new g(i).eval(a)))}else{if(m=j&&j.value)m=m.eval(a);else{if(!r[k].value)throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+s+" for "+this.arity+")"};m=r[k].value.eval(b),q.resetCache()}q.prependRule(new f(n,m)),d[k]=m}if(r[k].variadic&&c)for(l=p;s>l;l++)d[l]=c[l].value.eval(a);p++}return q},i.prototype.makeImportant=function(){var a=this.rules?this.rules.map(function(a){return a.makeImportant?a.makeImportant(!0):a}):this.rules,b=new i(this.name,this.params,a,this.condition,this.variadic,this.frames);return b},i.prototype.eval=function(a){return new i(this.name,this.params,this.rules,this.condition,this.variadic,this.frames||a.frames.slice(0))},i.prototype.evalCall=function(a,b,c){var d,i,j=[],k=this.frames?this.frames.concat(a.frames):a.frames,l=this.evalParams(a,new h.Eval(a,k),b,j);return l.prependRule(new f("@arguments",new g(j).eval(a))),d=this.rules.slice(0),i=new e(null,d),i.originalRuleset=this,i=i.eval(new h.Eval(a,[this,l].concat(k))),c&&(i=i.makeImportant()),i},i.prototype.matchCondition=function(a,b){return this.condition&&!this.condition.eval(new h.Eval(b,[this.evalParams(b,new h.Eval(b,this.frames?this.frames.concat(b.frames):b.frames),a,[])].concat(this.frames).concat(b.frames)))?!1:!0},i.prototype.matchArgs=function(a,b){var c,d=a&&a.length||0;if(this.variadic){if(this.required-1>d)return!1}else{if(this.required>d)return!1;
16
 
skin/adminhtml/base/default/js/BackupGuardFree/main.js CHANGED
@@ -1,10 +1,20 @@
1
  sgBackup = {};
2
  sgBackup.isModalOpen = false;
3
  SG_CURRENT_ACTIVE_AJAX = '';
4
- SG_NOTICE_EXECUTION_TIMEOUT = 'timeoutError';
 
 
 
 
5
 
6
  jQuery(document).ready( function() {
7
  sgBackup.init();
 
 
 
 
 
 
8
  jQuery('.dismiss-button').on('click', function(){
9
  jQuery('#timeout-error-msg').hide();
10
  var dismissHandler = new sgRequestHandler('hideNotice',{notice: SG_NOTICE_EXECUTION_TIMEOUT});
@@ -20,6 +30,11 @@ sgBackup.init = function(){
20
  //SG Modal popup logic
21
  sgBackup.initModals = function(){
22
  jQuery('[data-toggle="modal"][href], [data-toggle="modal"][data-remote]').off('click').on('click', function(e) {
 
 
 
 
 
23
  e.preventDefault();
24
  var btn = jQuery(this),
25
  url = btn.attr('data-remote'),
@@ -33,7 +48,7 @@ sgBackup.initModals = function(){
33
  }
34
  sgBackup.showAjaxSpinner('#sg-content-wrapper');
35
 
36
- var ajaxHandler = new sgRequestHandler(url, {});
37
  ajaxHandler.type = 'GET';
38
  ajaxHandler.dataType = 'html';
39
  ajaxHandler.callback = function(data, error) {
@@ -41,10 +56,16 @@ sgBackup.initModals = function(){
41
  if (error===false) {
42
  jQuery('#sg-modal').append(data);
43
  }
44
- modal.one('hidden.bs.modal', function() {
45
  if(SG_CURRENT_ACTIVE_AJAX != '') {
 
 
 
46
  SG_CURRENT_ACTIVE_AJAX.abort();
 
47
  }
 
 
48
  modal.html('');
49
  }).modal('show');
50
  sgBackup.didOpenModal(modalName);
@@ -59,6 +80,13 @@ sgBackup.didOpenModal = function(modalName){
59
  sgBackup.initManualBackupTooltips();
60
  }
61
  else if(modalName == 'import'){
 
 
 
 
 
 
 
62
  sgBackup.initFileUpload();
63
  }
64
  else if(modalName == 'ftp-settings'){
@@ -68,8 +96,32 @@ sgBackup.didOpenModal = function(modalName){
68
  }
69
  })
70
  }
71
- else if(modalName == ''){
 
 
 
 
 
 
 
 
 
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
  };
75
 
@@ -86,7 +138,7 @@ sgBackup.alertGenerator = function(content, alertClass){
86
  sgalert+=value+'<br/>';
87
  });
88
  }
89
- else{
90
  sgalert+=content.replace('[','').replace(']','').replace('"','');
91
  }
92
  sgalert+='</div>';
@@ -94,11 +146,15 @@ sgBackup.alertGenerator = function(content, alertClass){
94
  };
95
 
96
  sgBackup.scrollToElement = function(id){
97
- if(jQuery(id).length) {
98
- // Scroll
99
- jQuery('html,body').animate({
100
- scrollTop: jQuery(id).offset().top
101
- }, 'slow');
 
 
 
 
102
  }
103
  };
104
 
@@ -113,5 +169,119 @@ sgBackup.hideAjaxSpinner = function(){
113
  jQuery('.sg-spinner').remove();
114
  };
115
 
116
- jQuery('#sg-wrapper').show();
117
- jQuery('.sg-spinner').remove();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  sgBackup = {};
2
  sgBackup.isModalOpen = false;
3
  SG_CURRENT_ACTIVE_AJAX = '';
4
+ SG_NOTICE_EXECUTION_TIMEOUT = 'timeoutError'
5
+
6
+ jQuery(window).load(function() {
7
+ sgBackup.showReviewModal();
8
+ });
9
 
10
  jQuery(document).ready( function() {
11
  sgBackup.init();
12
+ if(typeof SG_AJAX_REQUEST_FREQUENCY === 'undefined'){
13
+ SG_AJAX_REQUEST_FREQUENCY = 2000;
14
+ }
15
+
16
+ sgBackup.hideAjaxSpinner();
17
+
18
  jQuery('.dismiss-button').on('click', function(){
19
  jQuery('#timeout-error-msg').hide();
20
  var dismissHandler = new sgRequestHandler('hideNotice',{notice: SG_NOTICE_EXECUTION_TIMEOUT});
30
  //SG Modal popup logic
31
  sgBackup.initModals = function(){
32
  jQuery('[data-toggle="modal"][href], [data-toggle="modal"][data-remote]').off('click').on('click', function(e) {
33
+ var param = '';
34
+ if (typeof jQuery(this).attr('data-sgbp-params') !== 'undefined'){
35
+ param = jQuery(this).attr('data-sgbp-params');
36
+ }
37
+
38
  e.preventDefault();
39
  var btn = jQuery(this),
40
  url = btn.attr('data-remote'),
48
  }
49
  sgBackup.showAjaxSpinner('#sg-content-wrapper');
50
 
51
+ var ajaxHandler = new sgRequestHandler(url, {param: param});
52
  ajaxHandler.type = 'GET';
53
  ajaxHandler.dataType = 'html';
54
  ajaxHandler.callback = function(data, error) {
56
  if (error===false) {
57
  jQuery('#sg-modal').append(data);
58
  }
59
+ modal.on('hide.bs.modal', function() {
60
  if(SG_CURRENT_ACTIVE_AJAX != '') {
61
+ if (!confirm('Are you sure you want to cancel?')) {
62
+ return false;
63
+ }
64
  SG_CURRENT_ACTIVE_AJAX.abort();
65
+ SG_CURRENT_ACTIVE_AJAX = '';
66
  }
67
+ });
68
+ modal.one('hidden.bs.modal', function() {
69
  modal.html('');
70
  }).modal('show');
71
  sgBackup.didOpenModal(modalName);
80
  sgBackup.initManualBackupTooltips();
81
  }
82
  else if(modalName == 'import'){
83
+ jQuery('#modal-import-2').hide();
84
+ jQuery('#modal-import-3').hide();
85
+ jQuery('#switch-modal-import-pages-back').hide();
86
+ jQuery('#uploadSgbpFile').hide();
87
+ if(jQuery('#modal-import-1').length == 0) {
88
+ sgBackup.toggleDownloadFromPCPage();
89
+ }
90
  sgBackup.initFileUpload();
91
  }
92
  else if(modalName == 'ftp-settings'){
96
  }
97
  })
98
  }
99
+ else if(modalName == 'manual-review'){
100
+ var action = 'setReviewPopupState';
101
+ jQuery('#sgLeaveReview').click(function(){
102
+ var reviewUrl = jQuery(this).attr('data-review-url');
103
+ //Never show again
104
+ var reviewState = 2;
105
+ var ajaxHandler = new sgRequestHandler(action, {reviewState: reviewState});
106
+ ajaxHandler.run();
107
+ window.open(reviewUrl);
108
+ });
109
 
110
+ jQuery('#sgDontAskAgain').click(function(){
111
+ //Never show again
112
+ var reviewState = 2;
113
+ var ajaxHandler = new sgRequestHandler(action, {reviewState: reviewState});
114
+ ajaxHandler.run();
115
+ });
116
+
117
+ jQuery('#sgAskLater').click(function(){
118
+ var reviewState = 0;
119
+ var ajaxHandler = new sgRequestHandler(action, {reviewState: reviewState});
120
+ ajaxHandler.run();
121
+ });
122
+ }
123
+ else if(modalName == 'create-schedule') {
124
+ sgBackup.initScheduleCreation();
125
  }
126
  };
127
 
138
  sgalert+=value+'<br/>';
139
  });
140
  }
141
+ else if(content != ''){
142
  sgalert+=content.replace('[','').replace(']','').replace('"','');
143
  }
144
  sgalert+='</div>';
146
  };
147
 
148
  sgBackup.scrollToElement = function(id){
149
+ if(jQuery(id).position()){
150
+ if(jQuery(id).position().top < jQuery(window).scrollTop()){
151
+ //scroll up
152
+ jQuery('html,body').animate({scrollTop:jQuery(id).position().top}, 1000);
153
+ }
154
+ else if(jQuery(id).position().top + jQuery(id).height() > jQuery(window).scrollTop() + (window.innerHeight || document.documentElement.clientHeight)){
155
+ //scroll down
156
+ jQuery('html,body').animate({scrollTop:jQuery(id).position().top - (window.innerHeight || document.documentElement.clientHeight) + jQuery(id).height() + 15}, 1000);
157
+ }
158
  }
159
  };
160
 
169
  jQuery('.sg-spinner').remove();
170
  };
171
 
172
+ sgBackup.showReviewModal = function(){
173
+ if(typeof sgShowReview != 'undefined') {
174
+ jQuery('#sg-review').trigger("click");
175
+ }
176
+ };
177
+
178
+ sgBackup.initTablePagination = function(){
179
+ jQuery.fn.sgTablePagination = function(opts){
180
+ var jQuerythis = this,
181
+ defaults = {
182
+ perPage: 7,
183
+ showPrevNext: false,
184
+ hidePageNumbers: false,
185
+ pagerSelector: 'pagination'
186
+ },
187
+ settings = jQuery.extend(defaults, opts);
188
+
189
+ var listElement = jQuerythis.children('tbody');
190
+ var perPage = settings.perPage;
191
+ var children = listElement.children();
192
+ var pager = jQuery('.pager');
193
+
194
+ if (typeof settings.childSelector!="undefined") {
195
+ children = listElement.find(settings.childSelector);
196
+ }
197
+
198
+ if (typeof settings.pagerSelector!="undefined") {
199
+ pager = jQuery(settings.pagerSelector);
200
+ }
201
+
202
+ var numItems = children.size();
203
+ var numPages = Math.ceil(numItems/perPage);
204
+
205
+ pager.data("curr",0);
206
+
207
+ if (settings.showPrevNext){
208
+ jQuery('<li><a href="#" class="prev_link">«</a></li>').appendTo(pager);
209
+ }
210
+
211
+ var curr = 0;
212
+ while(numPages > curr && (settings.hidePageNumbers==false)){
213
+ jQuery('<li><a href="#" class="page_link">'+(curr+1)+'</a></li>').appendTo(pager);
214
+ curr++;
215
+ }
216
+
217
+ if(curr<=1){
218
+ jQuery(settings.pagerSelector).parent('div').hide();
219
+ jQuery('.page_link').hide();
220
+ }
221
+
222
+ if (settings.showPrevNext){
223
+ jQuery('<li><a href="#" class="next_link">»</a></li>').appendTo(pager);
224
+ }
225
+
226
+ pager.find('.page_link:first').addClass('active');
227
+ pager.find('.prev_link').hide();
228
+ if (numPages<=1) {
229
+ pager.find('.next_link').hide();
230
+ }
231
+ pager.children().eq(1).addClass("active");
232
+
233
+ children.hide();
234
+ children.slice(0, perPage).show();
235
+
236
+ pager.find('li .page_link').click(function(){
237
+ var clickedPage = jQuery(this).html().valueOf()-1;
238
+ goTo(clickedPage,perPage);
239
+ return false;
240
+ });
241
+ pager.find('li .prev_link').click(function(){
242
+ previous();
243
+ return false;
244
+ });
245
+ pager.find('li .next_link').click(function(){
246
+ next();
247
+ return false;
248
+ });
249
+
250
+ function previous(){
251
+ var goToPage = parseInt(pager.data("curr")) - 1;
252
+ goTo(goToPage);
253
+ }
254
+
255
+ function next(){
256
+ goToPage = parseInt(pager.data("curr")) + 1;
257
+ goTo(goToPage);
258
+ }
259
+
260
+ function goTo(page){
261
+ var startAt = page * perPage,
262
+ endOn = startAt + perPage;
263
+
264
+ children.css('display','none').slice(startAt, endOn).show();
265
+
266
+ if (page>=1) {
267
+ pager.find('.prev_link').show();
268
+ }
269
+ else {
270
+ pager.find('.prev_link').hide();
271
+ }
272
+
273
+ if (page<(numPages-1)) {
274
+ pager.find('.next_link').show();
275
+ }
276
+ else {
277
+ pager.find('.next_link').hide();
278
+ }
279
+
280
+ pager.data("curr",page);
281
+ pager.children().removeClass("active");
282
+ pager.children().eq(page+1).addClass("active");
283
+
284
+ }
285
+ };
286
+ jQuery('table.paginated').sgTablePagination({pagerSelector:'.pagination',showPrevNext:true,hidePageNumbers:false,perPage:7});
287
+ };
skin/adminhtml/base/default/js/BackupGuardFree/sgbackup.js CHANGED
@@ -1,3 +1,5 @@
 
 
1
  jQuery(document).on('change', '.btn-file :file', function() {
2
  var input = jQuery(this),
3
  numFiles = input.get(0).files ? input.get(0).files.length : 1,
@@ -10,9 +12,70 @@ jQuery(document).ready( function() {
10
  sgBackup.initRestore();
11
  sgBackup.initActiveAction();
12
  sgBackup.initBackupDeletion();
 
 
13
  jQuery('span[data-toggle=tooltip]').tooltip();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  });
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  //SGManual Backup AJAX callback
17
  sgBackup.manualBackup = function(){
18
  var error = [];
@@ -37,8 +100,8 @@ sgBackup.manualBackup = function(){
37
  }
38
  //If any error show it and abort ajax
39
  if(error.length){
40
- var alert = sgBackup.alertGenerator(error, 'alert-danger');
41
- jQuery('#sg-modal .modal-header').prepend(alert);
42
  return false;
43
  }
44
 
@@ -51,14 +114,83 @@ sgBackup.manualBackup = function(){
51
  var resetStatusHandler = new sgRequestHandler('resetStatus', {});
52
  resetStatusHandler.callback = function(response, error){
53
  var manualBackupForm = jQuery('#manualBackup');
54
- var manualBackupHandler = new sgRequestHandler('manualBackup',manualBackupForm.serialize());
55
  manualBackupHandler.dataIsObject = false;
 
 
 
 
 
 
 
 
56
  manualBackupHandler.run();
57
  sgBackup.checkBackupCreation();
58
  };
59
  resetStatusHandler.run();
60
  };
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  //Init file upload
63
  sgBackup.initFileUpload = function(){
64
  var isFileSelected = false;
@@ -66,180 +198,192 @@ sgBackup.initFileUpload = function(){
66
  var input = jQuery(this).parents('.input-group').find(':text'),
67
  log = numFiles > 1 ? numFiles + ' files selected' : label;
68
 
69
- if( input.length ) {
70
  input.val(log);
71
  isFileSelected = true;
72
- } else {
73
- if( log ) alert(log);
 
74
  }
75
  });
 
76
  jQuery('#uploadSgbpFile').click(function(){
77
- jQuery('.alert').remove();
78
- if(!isFileSelected){
79
- var alert = sgBackup.alertGenerator('Please select a file.', 'alert-danger');
80
- jQuery('#sg-modal .modal-header').prepend(alert);
81
- return false;
82
  }
83
-
84
- var sguploadFile = new FormData(),
85
- url = jQuery(this).attr('data-remote'),
86
- sgAllowedFileSize = jQuery('.sg-backup-upload-input').attr('data-max-file-size'),
87
- sgFile = jQuery('input[name=sgbpFile]')[0].files[0];
88
- sguploadFile.append('sgbpFile', sgFile);
89
- if(sgFile.size > sgAllowedFileSize){
90
- var alert = sgBackup.alertGenerator('File is too large.', 'alert-danger');
91
- jQuery('#sg-modal .modal-header').prepend(alert);
92
- return false;
93
  }
94
- jQuery('#uploadSgbpFile').attr('disabled','disabled');
95
- jQuery('#uploadSgbpFile').html('Uploading please wait...');
96
-
97
- var ajaxHandler = new sgRequestHandler(url, sguploadFile, {
98
- contentType: false,
99
- cache: false,
100
- xhr: function() { // Custom XMLHttpRequest
101
- var myXhr = jQuery.ajaxSettings.xhr();
102
- if(myXhr.upload){ // Check if upload property exists
103
- myXhr.upload.addEventListener('progress',sgBackup.fileUploadProgress, false); // For handling the progress of the upload
104
- }
105
- return myXhr;
106
- },
107
- processData: false
108
- });
109
- ajaxHandler.callback = function(response, error){
110
- jQuery('.alert').remove();
111
- if(typeof response.success !== 'undefined'){
112
- location.reload();
113
- }
114
- else{
115
- //if error
116
- var alert = sgBackup.alertGenerator(response, 'alert-danger');
117
- jQuery('#sg-modal .modal-header').prepend(alert);
118
-
119
- jQuery('#uploadSgbpFile').removeAttr('disabled');
120
- jQuery('#uploadSgbpFile').html('Upload');
121
- }
122
- };
123
- SG_CURRENT_ACTIVE_AJAX = ajaxHandler.run();
124
  });
125
  };
126
 
127
- sgBackup.fileUploadProgress = function(e){
128
- if(e.lengthComputable){
129
- jQuery('#uploadSgbpFile').html('Uploading ('+ Math.round((e.loaded*100.0)/ e.total)+'%)');
 
 
 
 
 
 
 
 
 
 
 
 
130
  }
131
  }
132
 
133
- sgBackup.initTablePagination = function(){
134
- jQuery.fn.sgTablePagination = function(opts){
135
- var jQuerythis = this,
136
- defaults = {
137
- perPage: 7,
138
- showPrevNext: false,
139
- hidePageNumbers: false,
140
- pagerSelector: 'pagination'
141
- },
142
- settings = jQuery.extend(defaults, opts);
143
-
144
- var listElement = jQuerythis.children('tbody');
145
- var perPage = settings.perPage;
146
- var children = listElement.children();
147
- var pager = jQuery('.pager');
148
-
149
- if (typeof settings.childSelector!="undefined") {
150
- children = listElement.find(settings.childSelector);
151
- }
152
 
153
- if (typeof settings.pagerSelector!="undefined") {
154
- pager = jQuery(settings.pagerSelector);
155
- }
156
 
157
- var numItems = children.size();
158
- var numPages = Math.ceil(numItems/perPage);
 
159
 
160
- pager.data("curr",0);
 
 
 
161
 
162
- if (settings.showPrevNext){
163
- jQuery('<li><a href="#" class="prev_link">«</a></li>').appendTo(pager);
164
- }
 
 
 
165
 
166
- var curr = 0;
167
- while(numPages > curr && (settings.hidePageNumbers==false)){
168
- jQuery('<li><a href="#" class="page_link">'+(curr+1)+'</a></li>').appendTo(pager);
169
- curr++;
170
- }
 
171
 
172
- if(curr<=1){
173
- jQuery(settings.pagerSelector).parent('div').hide();
174
- jQuery('.page_link').hide();
175
- }
 
 
176
 
177
- if (settings.showPrevNext){
178
- jQuery('<li><a href="#" class="next_link">»</a></li>').appendTo(pager);
179
- }
180
 
181
- pager.find('.page_link:first').addClass('active');
182
- pager.find('.prev_link').hide();
183
- if (numPages<=1) {
184
- pager.find('.next_link').hide();
185
- }
186
- pager.children().eq(1).addClass("active");
187
 
188
- children.hide();
189
- children.slice(0, perPage).show();
 
190
 
191
- pager.find('li .page_link').click(function(){
192
- var clickedPage = jQuery(this).html().valueOf()-1;
193
- goTo(clickedPage,perPage);
194
- return false;
195
- });
196
- pager.find('li .prev_link').click(function(){
197
- previous();
198
- return false;
199
- });
200
- pager.find('li .next_link').click(function(){
201
- next();
202
- return false;
203
- });
204
 
205
- function previous(){
206
- var goToPage = parseInt(pager.data("curr")) - 1;
207
- goTo(goToPage);
208
  }
209
-
210
- function next(){
211
- goToPage = parseInt(pager.data("curr")) + 1;
212
- goTo(goToPage);
 
 
213
  }
 
214
 
215
- function goTo(page){
216
- var startAt = page * perPage,
217
- endOn = startAt + perPage;
218
-
219
- children.css('display','none').slice(startAt, endOn).show();
220
 
221
- if (page>=1) {
222
- pager.find('.prev_link').show();
223
- }
224
- else {
225
- pager.find('.prev_link').hide();
226
- }
 
227
 
228
- if (page<(numPages-1)) {
229
- pager.find('.next_link').show();
230
- }
231
- else {
232
- pager.find('.next_link').hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  }
 
 
 
 
234
 
235
- pager.data("curr",page);
236
- pager.children().removeClass("active");
237
- pager.children().eq(page+1).addClass("active");
 
 
 
 
 
 
238
 
 
 
239
  }
240
  };
241
- jQuery('table.paginated').sgTablePagination({pagerSelector:'.pagination',showPrevNext:true,hidePageNumbers:false,perPage:7});
242
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
 
244
  sgBackup.checkBackupCreation = function(){
245
  var sgBackupCreationHandler = new sgRequestHandler('checkBackupCreation', {});
@@ -277,6 +421,7 @@ sgBackup.initManualBackupTooltips = function(){
277
  jQuery('[for=cloud-ftp]').tooltip();
278
  jQuery('[for=cloud-dropbox]').tooltip();
279
  jQuery('[for=cloud-gdrive]').tooltip();
 
280
  };
281
 
282
  sgBackup.initRestore = function(){
@@ -286,6 +431,12 @@ sgBackup.initRestore = function(){
286
  sgBackup.showAjaxSpinner('#sg-content-wrapper');
287
  var resetStatusHandler = new sgRequestHandler('resetStatus');
288
  resetStatusHandler.callback = function(response) {
 
 
 
 
 
 
289
  var restoreHandler = new sgRequestHandler('restore',{bname: bname});
290
  restoreHandler.run();
291
  sgBackup.checkRestoreCreation();
@@ -296,41 +447,36 @@ sgBackup.initRestore = function(){
296
  };
297
 
298
  sgBackup.initActiveAction = function(){
299
- if(jQuery('#sg-active-action-id').length<=0){
300
  return;
301
  }
302
- SG_ACTIVE_ACTION_ID = jQuery('#sg-active-action-id').val();
 
 
 
 
 
303
  //Cancel Button
304
  jQuery('.sg-cancel-backup').click(function(){
305
  if (confirm('Are you sure?')) {
306
- var sgCancelHandler = new sgRequestHandler('cancelBackup', {actionId: SG_ACTIVE_ACTION_ID});
 
307
  sgCancelHandler.run();
308
  }
309
  });
310
- //GetProgress
311
- sgBackup.getActionProgress(SG_ACTIVE_ACTION_ID);
 
 
 
312
  };
313
 
314
  sgBackup.getActionProgress = function(actionId){
315
- var progressBar = jQuery('.sg-progress .progress-bar');
 
316
  var sgActionHandler = new sgRequestHandler('getAction', {actionId: actionId});
317
  //Init tooltip
318
- var statusTooltip = jQuery('td[data-toggle=tooltip]').tooltip();
319
-
320
- var sgRunningActionsHandler = new sgRequestHandler('getRunningActions', {});
321
- sgRunningActionsHandler.callback = function(response){
322
- if(response){
323
- SG_ACTIVE_ACTION_ID = response.id;
324
- sgActionHandler.data = {actionId: response.id};
325
- sgActionHandler.run();
326
- }
327
- else{
328
- jQuery('[class*=sg-status]').addClass('active');
329
- jQuery('.sg-progress').remove();
330
- jQuery('#sg-active-action-id').remove();
331
- location.reload();
332
- }
333
- };
334
 
335
  sgActionHandler.callback = function(response){
336
  if(response){
@@ -338,10 +484,15 @@ sgBackup.getActionProgress = function(actionId){
338
  var progressInPercents = response.progress+'%';
339
  progressBar.width(progressInPercents);
340
  sgBackup.statusUpdate(statusTooltip, response, progressInPercents);
341
- sgActionHandler.run();
 
 
342
  }
343
  else{
344
- sgRunningActionsHandler.run();
 
 
 
345
  }
346
  };
347
  sgActionHandler.run();
@@ -380,6 +531,9 @@ sgBackup.statusUpdate = function(tooltip, response, progressInPercents){
380
  else if(response.subtype == '3'){
381
  tooltipText = 'Uploading to Google Drive - '+progressInPercents;
382
  }
 
 
 
383
  cloudIcon.prevAll('[class*=sg-status]').addClass('active');
384
  }
385
  tooltip.attr('data-original-title',tooltipText);
@@ -401,9 +555,8 @@ sgBackup.initBackupDeletion = function(){
401
  jQuery('.sg-remove-backup').click(function(){
402
  var btn = jQuery(this),
403
  url = btn.attr('data-remote'),
404
- backupName = btn.attr('data-sgbackup-name');
405
  if (confirm('Are you sure?')) {
406
- sgBackup.showAjaxSpinner('#sg-content-wrapper');
407
  var ajaxHandler = new sgRequestHandler(url, {backupName: backupName});
408
  ajaxHandler.callback = function (response) {
409
  location.reload();
@@ -411,4 +564,4 @@ sgBackup.initBackupDeletion = function(){
411
  ajaxHandler.run();
412
  }
413
  });
414
- };
1
+ SG_ACTIVE_DOWNLOAD_AJAX = '';
2
+
3
  jQuery(document).on('change', '.btn-file :file', function() {
4
  var input = jQuery(this),
5
  numFiles = input.get(0).files ? input.get(0).files.length : 1,
12
  sgBackup.initRestore();
13
  sgBackup.initActiveAction();
14
  sgBackup.initBackupDeletion();
15
+ sgBackup.toggleMultiDeleteButton();
16
+
17
  jQuery('span[data-toggle=tooltip]').tooltip();
18
+
19
+ jQuery('#sg-checkbox-select-all').on('change', function(){
20
+ var checkAll = jQuery('#sg-checkbox-select-all');
21
+ jQuery('tbody input[type="checkbox"]:not(:disabled)').prop('checked', checkAll.prop('checked'));
22
+ sgBackup.toggleMultiDeleteButton();
23
+ });
24
+
25
+ jQuery('#sg-delete-multi-backups').on('click', function(){
26
+ var backups = jQuery('tbody input[type="checkbox"]:checked');
27
+ var backupNames = [];
28
+ backups.each(function(i){
29
+ backupNames[i] = jQuery(this).val();
30
+ });
31
+
32
+ if (backupNames.length) {
33
+ sgBackup.deleteMultiBackups(backupNames);
34
+ }
35
+ });
36
+
37
+
38
+ jQuery('tbody input[type="checkbox"]').on('change', function(){
39
+ var numberOfBackups = jQuery('tbody input[type="checkbox"]').length;
40
+ var numberOfChoosenBackups = sgBackup.getSelectedBackupsNumber();
41
+ var isCheked = jQuery(this).is(':checked');
42
+ sgBackup.toggleMultiDeleteButton();
43
+
44
+ if(!isCheked) {
45
+ jQuery('#sg-checkbox-select-all').prop('checked', false);
46
+ }
47
+ else {
48
+ if (numberOfBackups == numberOfChoosenBackups) {
49
+ jQuery('#sg-checkbox-select-all').prop('checked', true);
50
+ }
51
+ }
52
+ });
53
  });
54
 
55
+ sgBackup.getSelectedBackupsNumber = function() {
56
+ return jQuery('tbody input[type="checkbox"]:checked').length
57
+ }
58
+
59
+ sgBackup.toggleMultiDeleteButton = function() {
60
+ var numberOfChoosenBackups = sgBackup.getSelectedBackupsNumber();
61
+ var target = jQuery('#sg-delete-multi-backups');
62
+
63
+ if (numberOfChoosenBackups > 0) {
64
+ target.show();
65
+ }
66
+ else {
67
+ target.hide();
68
+ }
69
+ }
70
+
71
+ sgBackup.deleteMultiBackups = function(backupNames){
72
+ var ajaxHandler = new sgRequestHandler('deleteBackup', {backupName: backupNames});
73
+ ajaxHandler.callback = function (response) {
74
+ location.reload();
75
+ };
76
+ ajaxHandler.run();
77
+ }
78
+
79
  //SGManual Backup AJAX callback
80
  sgBackup.manualBackup = function(){
81
  var error = [];
100
  }
101
  //If any error show it and abort ajax
102
  if(error.length){
103
+ var sgAlert = sgBackup.alertGenerator(error, 'alert-danger');
104
+ jQuery('#sg-modal .modal-header').prepend(sgAlert);
105
  return false;
106
  }
107
 
114
  var resetStatusHandler = new sgRequestHandler('resetStatus', {});
115
  resetStatusHandler.callback = function(response, error){
116
  var manualBackupForm = jQuery('#manualBackup');
117
+ var manualBackupHandler = new sgRequestHandler('manualBackup', manualBackupForm.serialize());
118
  manualBackupHandler.dataIsObject = false;
119
+ //If error
120
+ if(typeof response.success === 'undefined') {
121
+ var sgAlert = sgBackup.alertGenerator(response, 'alert-danger');
122
+ jQuery('#sg-modal .modal-header').prepend(sgAlert);
123
+ alert(response);
124
+ location.reload();
125
+ return false;
126
+ }
127
  manualBackupHandler.run();
128
  sgBackup.checkBackupCreation();
129
  };
130
  resetStatusHandler.run();
131
  };
132
 
133
+ sgBackup.cancelDonwload = function() {
134
+ var target = jQuery('input[name="select-archive-to-download"]:checked');
135
+ var name = target.attr('file-name');
136
+
137
+ var cancelDonwloadHandler = new sgRequestHandler('cancelDownload', {name: name});
138
+ cancelDonwloadHandler.callback = function(response){
139
+ SG_ACTIVE_DOWNLOAD_AJAX.abort();
140
+ sgBackup.hideAjaxSpinner();
141
+ location.reload();
142
+ }
143
+ cancelDonwloadHandler.run();
144
+ }
145
+
146
+ sgBackup.listStorage = function(importFrom){
147
+ var listStorage = new sgRequestHandler('listStorage', {storage: importFrom});
148
+ sgBackup.showAjaxSpinner('#sg-modal-inport-from');
149
+ jQuery('#sg-archive-list-table tbody').empty();
150
+
151
+ jQuery('#sg-modal').off('hide.bs.modal').on('hide.bs.modal', function(e){
152
+
153
+ if (SG_ACTIVE_DOWNLOAD_AJAX) {
154
+ if (!confirm('Are you sure you want to cancel import?')) {
155
+ e.preventDefault();
156
+ return false;
157
+ }
158
+
159
+ sgBackup.cancelDonwload();
160
+ }
161
+
162
+ });
163
+
164
+ listStorage.callback = function(response, error) {
165
+ sgBackup.hideAjaxSpinner();
166
+ listOfFiles = response;
167
+ var content = '';
168
+ if (!listOfFiles) {
169
+ content = '<tr><td colspan="4">No backups found.</td></tr>';
170
+ }
171
+ else {
172
+ jQuery.each(listOfFiles, function( key, value ) {
173
+ content += '<tr>';
174
+ content += '<td class="file-select-radio"><input type="radio" file-name="'+value.name+'" name="select-archive-to-download" size="'+value.size+'" storage="'+importFrom+'" value="'+value.path+'"></td>';
175
+ content += '<td>'+value.name+'</td>';
176
+ content += '<td>'+sgBackup.convertBytesToMegabytes(value.size)+'</td>';
177
+ content += '<td>'+value.date+'</td>';
178
+ content += '</tr>';
179
+ });
180
+ }
181
+
182
+ jQuery('#sg-archive-list-table tbody').append(content);
183
+ sgBackup.toggleDownloadFromCloudPage();
184
+ }
185
+
186
+ listStorage.run();
187
+ }
188
+
189
+
190
+ sgBackup.convertBytesToMegabytes = function ($bytes) {
191
+ return ($bytes/(1024*1024)).toFixed(2);
192
+ }
193
+
194
  //Init file upload
195
  sgBackup.initFileUpload = function(){
196
  var isFileSelected = false;
198
  var input = jQuery(this).parents('.input-group').find(':text'),
199
  log = numFiles > 1 ? numFiles + ' files selected' : label;
200
 
201
+ if (input.length) {
202
  input.val(log);
203
  isFileSelected = true;
204
+ }
205
+ else {
206
+ if(log) alert(log);
207
  }
208
  });
209
+
210
  jQuery('#uploadSgbpFile').click(function(){
211
+ if(jQuery('#modal-import-2').is(":visible")){
212
+ sgBackup.downloadFromPC(this, isFileSelected);
 
 
 
213
  }
214
+ else{
215
+ var target = jQuery('input[name="select-archive-to-download"]:checked');
216
+ var path = target.val();
217
+ var name = target.attr('file-name');
218
+ var storage = target.attr('storage');
219
+ var size = target.attr('size');
220
+ sgBackup.downloadFromCloud(path, name, storage, size);
 
 
 
221
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  });
223
  };
224
 
225
+ sgBackup.nextPage = function(){
226
+ var importFrom = jQuery('input[name="storage-radio"]:checked').val();
227
+ jQuery('.alert').remove();
228
+
229
+ if (!importFrom) {
230
+ var alert = sgBackup.alertGenerator('Please select one off the options', 'alert-danger');
231
+ jQuery('#sg-modal .modal-header').prepend(alert);
232
+ }
233
+ else {
234
+ if (importFrom == 'local-pc') {
235
+ sgBackup.toggleDownloadFromPCPage();
236
+ }
237
+ else {
238
+ sgBackup.listStorage(importFrom);
239
+ }
240
  }
241
  }
242
 
243
+ sgBackup.previousPage = function(){
244
+ if(jQuery('#modal-import-2').is(":visible")){
245
+ jQuery('#modal-import-2').hide();
246
+ }
247
+ else{
248
+ jQuery('#modal-import-3').hide();
249
+ }
 
 
 
 
 
 
 
 
 
 
 
 
250
 
251
+ sgBackup.toggleNavigationButtons();
 
 
252
 
253
+ jQuery('#modal-import-1').show();
254
+ jQuery('#uploadSgbpFile').hide();
255
+ }
256
 
257
+ sgBackup.toggleNavigationButtons = function(){
258
+ jQuery('#switch-modal-import-pages-next').toggle();
259
+ jQuery('#switch-modal-import-pages-back').toggle();
260
+ }
261
 
262
+ sgBackup.toggleDownloadFromPCPage = function(){
263
+ sgBackup.toggleNavigationButtons();
264
+ jQuery('#modal-import-1').toggle();
265
+ jQuery('#modal-import-2').toggle();
266
+ jQuery('#uploadSgbpFile').toggle();
267
+ }
268
 
269
+ sgBackup.toggleDownloadFromCloudPage = function(){
270
+ sgBackup.toggleNavigationButtons();
271
+ jQuery('#modal-import-1').toggle();
272
+ jQuery('#modal-import-3').toggle();
273
+ jQuery('#uploadSgbpFile').toggle();
274
+ }
275
 
276
+ sgBackup.downloadFromCloud = function (path, name, storage, size) {
277
+ sgBackup.showAjaxSpinner('.modal-dialog');
278
+ var error = [];
279
+ if (!path) {
280
+ error.push('Please choose one of the files.');
281
+ }
282
 
283
+ jQuery('.alert').remove();
 
 
284
 
285
+ if(error.length){
286
+ sgBackup.hideAjaxSpinner();
287
+ var sgAlert = sgBackup.alertGenerator(error, 'alert-danger');
288
+ jQuery('#sg-modal .modal-header').prepend(sgAlert);
289
+ return false;
290
+ }
291
 
292
+ var downloadFromCloudHandler = new sgRequestHandler('downloadFromCloud', {path: path, storage: storage, size: size});
293
+ jQuery('#uploadSgbpFile').attr('disabled','disabled');
294
+ jQuery('#switch-modal-import-pages-back').hide();
295
 
296
+ downloadFromCloudHandler.callback = function (response, error){
297
+ sgBackup.hideAjaxSpinner();
298
+ jQuery('.alert').remove();
 
 
 
 
 
 
 
 
 
 
299
 
300
+ if (typeof response.success !== 'undefined') {
301
+ location.reload();
 
302
  }
303
+ else {
304
+ jQuery('#uploadSgbpFile').html('Import');
305
+ var sgAlert = sgBackup.alertGenerator('Colud not download file', 'alert-danger');
306
+ jQuery('#uploadSgbpFile').attr('disabled', false);
307
+ jQuery('#switch-modal-import-pages-back').toggle();
308
+ jQuery('#sg-modal .modal-header').prepend(sgAlert);
309
  }
310
+ }
311
 
312
+ SG_ACTIVE_DOWNLOAD_AJAX = downloadFromCloudHandler.run();
313
+ sgBackup.fileDownloadProgress(name, size);
314
+ }
 
 
315
 
316
+ sgBackup.downloadFromPC = function(target, isFileSelected){
317
+ jQuery('.alert').remove();
318
+ if(!isFileSelected){
319
+ var alert = sgBackup.alertGenerator('Please select a file.', 'alert-danger');
320
+ jQuery('#sg-modal .modal-header').prepend(alert);
321
+ return false;
322
+ }
323
 
324
+ var sguploadFile = new FormData(),
325
+ url = jQuery(target).attr('data-remote'),
326
+ sgAllowedFileSize = jQuery('.sg-backup-upload-input').attr('data-max-file-size'),
327
+ sgFile = jQuery('input[name=sgbpFile]')[0].files[0];
328
+ sguploadFile.append('sgbpFile', sgFile);
329
+ if(sgFile.size > sgAllowedFileSize){
330
+ var alert = sgBackup.alertGenerator('File is too large.', 'alert-danger');
331
+ jQuery('#sg-modal .modal-header').prepend(alert);
332
+ return false;
333
+ }
334
+ jQuery('#uploadSgbpFile').attr('disabled','disabled');
335
+ jQuery('#uploadSgbpFile').html('Importing please wait...');
336
+
337
+ var ajaxHandler = new sgRequestHandler(url, sguploadFile, {
338
+ contentType: false,
339
+ cache: false,
340
+ xhr: function() { // Custom XMLHttpRequest
341
+ var myXhr = jQuery.ajaxSettings.xhr();
342
+ if(myXhr.upload){ // Check if upload property exists
343
+ myXhr.upload.addEventListener('progress',sgBackup.fileUploadProgress, false); // For handling the progress of the upload
344
  }
345
+ return myXhr;
346
+ },
347
+ processData: false
348
+ });
349
 
350
+ ajaxHandler.callback = function(response, error){
351
+ jQuery('.alert').remove();
352
+ if(typeof response.success !== 'undefined'){
353
+ location.reload();
354
+ }
355
+ else{
356
+ //if error
357
+ var alert = sgBackup.alertGenerator(response, 'alert-danger');
358
+ jQuery('#sg-modal .modal-header').prepend(alert);
359
 
360
+ jQuery('#uploadSgbpFile').removeAttr('disabled');
361
+ jQuery('#uploadSgbpFile').html('Import');
362
  }
363
  };
364
+ SG_CURRENT_ACTIVE_AJAX = ajaxHandler.run();
365
+ }
366
+
367
+ sgBackup.fileDownloadProgress = function(file, size){
368
+ var getFileDownloadProgress = new sgRequestHandler('getFileDownloadProgress', {file: file, size: size});
369
+
370
+ getFileDownloadProgress.callback = function(response){
371
+ if (typeof response.progress !== 'undefined') {
372
+ jQuery('#uploadSgbpFile').html('Importing ('+ Math.round(response.progress)+'%)');
373
+ setTimeout(function () {
374
+ getFileDownloadProgress.run();
375
+ }, SG_AJAX_REQUEST_FREQUENCY);
376
+ }
377
+ }
378
+
379
+ getFileDownloadProgress.run();
380
+ }
381
+
382
+ sgBackup.fileUploadProgress = function(e){
383
+ if(e.lengthComputable){
384
+ jQuery('#uploadSgbpFile').html('Importing ('+ Math.round((e.loaded*100.0)/ e.total)+'%)');
385
+ }
386
+ }
387
 
388
  sgBackup.checkBackupCreation = function(){
389
  var sgBackupCreationHandler = new sgRequestHandler('checkBackupCreation', {});
421
  jQuery('[for=cloud-ftp]').tooltip();
422
  jQuery('[for=cloud-dropbox]').tooltip();
423
  jQuery('[for=cloud-gdrive]').tooltip();
424
+ jQuery('[for=cloud-amazon]').tooltip();
425
  };
426
 
427
  sgBackup.initRestore = function(){
431
  sgBackup.showAjaxSpinner('#sg-content-wrapper');
432
  var resetStatusHandler = new sgRequestHandler('resetStatus');
433
  resetStatusHandler.callback = function(response) {
434
+ //If error
435
+ if(typeof response.success === 'undefined') {
436
+ alert(response);
437
+ location.reload();
438
+ return false;
439
+ }
440
  var restoreHandler = new sgRequestHandler('restore',{bname: bname});
441
  restoreHandler.run();
442
  sgBackup.checkRestoreCreation();
447
  };
448
 
449
  sgBackup.initActiveAction = function(){
450
+ if(jQuery('.sg-active-action-id').length<=0){
451
  return;
452
  }
453
+
454
+ var activeActionsIds = [];
455
+ jQuery('.sg-active-action-id').each(function() {
456
+ activeActionsIds.push(jQuery(this).val());
457
+ });
458
+
459
  //Cancel Button
460
  jQuery('.sg-cancel-backup').click(function(){
461
  if (confirm('Are you sure?')) {
462
+ var actionId = jQuery(this).attr('sg-data-backup-id');
463
+ var sgCancelHandler = new sgRequestHandler('cancelBackup', {actionId: actionId});
464
  sgCancelHandler.run();
465
  }
466
  });
467
+
468
+ for (var i = 0; i < activeActionsIds.length; i++) {
469
+ //GetProgress
470
+ sgBackup.getActionProgress(activeActionsIds[i]);
471
+ }
472
  };
473
 
474
  sgBackup.getActionProgress = function(actionId){
475
+ var progressBar = jQuery('.sg-progress .progress-bar', '#sg-status-tabe-data-'+actionId);
476
+
477
  var sgActionHandler = new sgRequestHandler('getAction', {actionId: actionId});
478
  //Init tooltip
479
+ var statusTooltip = jQuery('#sg-status-tabe-data-'+actionId+'[data-toggle=tooltip]').tooltip();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
480
 
481
  sgActionHandler.callback = function(response){
482
  if(response){
484
  var progressInPercents = response.progress+'%';
485
  progressBar.width(progressInPercents);
486
  sgBackup.statusUpdate(statusTooltip, response, progressInPercents);
487
+ setTimeout(function () {
488
+ sgActionHandler.run();
489
+ }, SG_AJAX_REQUEST_FREQUENCY);
490
  }
491
  else{
492
+ jQuery('[class*=sg-status]').addClass('active');
493
+ jQuery('.sg-progress').remove();
494
+ jQuery('.sg-active-action-id').remove();
495
+ location.reload();
496
  }
497
  };
498
  sgActionHandler.run();
531
  else if(response.subtype == '3'){
532
  tooltipText = 'Uploading to Google Drive - '+progressInPercents;
533
  }
534
+ else if(response.subtype == '4') {
535
+ tooltipText = 'Uploading to Amazon S3 - '+progressInPercents;
536
+ }
537
  cloudIcon.prevAll('[class*=sg-status]').addClass('active');
538
  }
539
  tooltip.attr('data-original-title',tooltipText);
555
  jQuery('.sg-remove-backup').click(function(){
556
  var btn = jQuery(this),
557
  url = btn.attr('data-remote'),
558
+ backupName = [btn.attr('data-sgbackup-name')];
559
  if (confirm('Are you sure?')) {
 
560
  var ajaxHandler = new sgRequestHandler(url, {backupName: backupName});
561
  ajaxHandler.callback = function (response) {
562
  location.reload();
564
  ajaxHandler.run();
565
  }
566
  });
567
+ };
skin/adminhtml/base/default/js/BackupGuardFree/sgrequesthandler.js CHANGED
@@ -38,4 +38,4 @@ sgRequestHandler.prototype.run = function(){
38
  jQuery.extend(settings, this.params);
39
 
40
  return jQuery.ajax(settings);
41
- };
38
  jQuery.extend(settings, this.params);
39
 
40
  return jQuery.ajax(settings);
41
+ };
skin/adminhtml/base/default/js/BackupGuardFree/sgsettings.js ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready( function() {
2
+ sgBackup.initGeneralSettingsSwitchButtons();
3
+ });
4
+
5
+ sgBackup.initGeneralSettingsSwitchButtons = function() {
6
+ jQuery('.sg-switch').bootstrapSwitch();
7
+ jQuery('.sg-email-switch').on('switchChange.bootstrapSwitch', function (event, state) {
8
+ jQuery('.alert').remove();
9
+ var url = jQuery(this).attr('data-remote');
10
+ //If switch is on
11
+ if(state) {
12
+ jQuery('.sg-general-settings').fadeToggle();
13
+ }
14
+ else {
15
+ var ajaxHandler = new sgRequestHandler(url, {cancel: true});
16
+ ajaxHandler.callback = function(response){
17
+ jQuery('.sg-user-email').remove();
18
+ jQuery('.sg-general-settings').hide();
19
+ };
20
+ ajaxHandler.run();
21
+ jQuery('#sg-user-email').remove();
22
+ }
23
+ jQuery('#sg-email').val('');
24
+ });
25
+ };
26
+
27
+ sgBackup.sgsettings = function(){
28
+ var settingsForm = jQuery('form[data-type=sgsettings]');
29
+ var error = [];
30
+ //Validation
31
+ jQuery('.alert').remove();
32
+
33
+ if(jQuery('.sg-email-switch').is(":checked")){
34
+ if(!isValidEmailAddress(jQuery('#sg-email').val())){
35
+ error.push('Please enter valid email.');
36
+ }
37
+ }
38
+
39
+ var backupFileName = jQuery('#backup-file-name').val();
40
+
41
+ if (typeof amountOfBackups !== 'undefined' && !backupFileName) {
42
+ error.push('Please enter backup file name.');
43
+ }
44
+
45
+ var amountOfBackups = jQuery('#amount-of-backups-to-keep').val();
46
+
47
+ if (typeof amountOfBackups !== 'undefined' && !jQuery.isNumeric(amountOfBackups)) {
48
+ error.push('Please enter a valid number of backups to keep on your server!');
49
+ }
50
+
51
+ //If any error show it and abort ajax
52
+ if(error.length){
53
+ var alert = sgBackup.alertGenerator(error, 'alert-danger');
54
+ jQuery('.sg-settings-container legend').after(alert);
55
+ sgBackup.scrollToElement('.alert');
56
+ return false;
57
+ }
58
+
59
+ //Before sending
60
+ var userEmail = jQuery('#sg-email').val();
61
+ jQuery('#sg-save-settings').attr('disabled','disabled');
62
+ jQuery('#sg-save-settings').html('Saving...');
63
+
64
+ //On Success
65
+ var ajaxHandler = new sgRequestHandler('settings', settingsForm.serialize());
66
+ ajaxHandler.dataIsObject = false;
67
+ ajaxHandler.callback = function(response){
68
+ jQuery('.alert').remove();
69
+ if(typeof response.success !== 'undefined'){
70
+ var alert = sgBackup.alertGenerator('Successfully saved.', 'alert-success');
71
+ jQuery('.sg-settings-container legend').after(alert);
72
+ sgBackup.addUserInfo(userEmail);
73
+ //jQuery('.sg-switch').bootstrapSwitch('state', true, true);
74
+ jQuery('.sg-general-settings').fadeOut();
75
+ }
76
+ else{
77
+ //if error
78
+ var alert = sgBackup.alertGenerator(response, 'alert-danger');
79
+ jQuery('.sg-settings-container legend').after(alert);
80
+ }
81
+
82
+ //Always
83
+ jQuery('#sg-save-settings').removeAttr('disabled','disabled');
84
+ jQuery('#sg-save-settings').html('Save');
85
+ sgBackup.scrollToElement('.alert');
86
+ };
87
+ ajaxHandler.run();
88
+ };
89
+
90
+ sgBackup.addUserInfo = function(info){
91
+ jQuery('.sg-user-info .sg-helper-block').remove();
92
+ jQuery('.sg-user-info br').remove();
93
+ jQuery('.sg-user-info').append('<br/><span class="text-muted sg-user-email sg-helper-block">'+info+'</span>');
94
+ };
95
+
96
+ function isValidEmailAddress(emailAddress) {
97
+ var pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i);
98
+ return pattern.test(emailAddress);
99
+ };