· 8 years ago · Aug 18, 2018, 12:10 AM
1<?php
2/*
3 Copyright 2011-17 snapcreek.com
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License, version 3, as
7 published by the Free Software Foundation.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 GPL v3 https://www.gnu.org/licenses/gpl-3.0.en.html
18 */
19
20if (file_exists('dtoken.php')) {
21 //This is most likely inside the snapshot folder.
22
23 //DOWNLOAD ONLY: (Only enable download from within the snapshot directory)
24 if (isset($_GET['get']) && isset($_GET['file'])) {
25 //Clean the input, strip out anything not alpha-numeric or "_.", so restricts
26 //only downloading files in same folder, and removes risk of allowing directory
27 //separators in other charsets (vulnerability in older IIS servers), also
28 //strips out anything that might cause it to use an alternate stream since
29 //that would require :// near the front.
30 $filename = preg_replace('/[^a-zA-Z0-9_.]*/','',$_GET['file']);
31 if (strlen($filename) && file_exists($filename) && (strstr($filename, '_installer.php'))) {
32 //Attempt to push the file to the browser
33 header('Content-Description: File Transfer');
34 header('Content-Type: application/octet-stream');
35 header('Content-Disposition: attachment; filename=installer.php');
36 header('Content-Transfer-Encoding: binary');
37 header('Expires: 0');
38 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
39 header('Pragma: public');
40 header('Content-Length: ' . filesize($filename));
41 @ob_clean();
42 @flush();
43 if (@readfile($filename) == false) {
44 $data = file_get_contents($filename);
45 if ($data == false) {
46 die("Unable to read installer file. The server currently has readfile and file_get_contents disabled on this server. Please contact your server admin to remove this restriction");
47 } else {
48 print $data;
49 }
50 }
51 } else {
52 header("HTTP/1.1 404 Not Found", true, 404);
53 header("Status: 404 Not Found");
54 }
55 }
56 //Prevent Access from rovers or direct browsing in snapshop directory, or when
57 //requesting to download a file, should not go past this point.
58 exit;
59}
60
61/* ==============================================================================================
62ADVANCED FEATURES - Allows admins to perform aditional logic on the import.
63
64$GLOBALS['REPLACE_LIST']
65 Add additional search and replace items to step 2 for the serialize engine.
66 Place directly below $GLOBALS['REPLACE_LIST'] variable below your items
67 EXAMPLE:
68 array_push($GLOBALS['REPLACE_LIST'], array('search' => 'https://oldurl/', 'replace' => 'https://newurl/'));
69 array_push($GLOBALS['REPLACE_LIST'], array('search' => 'ftps://oldurl/', 'replace' => 'ftps://newurl/'));
70 ================================================================================================= */
71
72// Some machines don’t have this set so just do it here.
73date_default_timezone_set('UTC');
74
75//PATCH FOR IIS: Does not support REQUEST_URI
76if (!isset($_SERVER['REQUEST_URI'])) {
77 $_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],0);
78 if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
79 $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
80 }
81}
82
83//COMPARE VALUES
84$GLOBALS['DUPX_DEBUG'] = false;
85$GLOBALS['FW_CREATED'] = '2018-08-17 23:50:41';
86$GLOBALS['FW_VERSION_DUP'] = '1.2.40';
87$GLOBALS['FW_VERSION_WP'] = '4.9.8';
88$GLOBALS['FW_VERSION_DB'] = '5.6.38';
89$GLOBALS['FW_VERSION_PHP'] = '7.2.1';
90$GLOBALS['FW_VERSION_OS'] = 'Darwin';
91//GENERAL
92$GLOBALS['FW_TABLEPREFIX'] = 'wp_';
93$GLOBALS['FW_URL_OLD'] = 'http://localhost:8888/Stage';
94$GLOBALS['FW_PACKAGE_NAME'] = '20180817_stage2018_efc2a154621e41d35724180817235041_archive.zip';
95$GLOBALS['FW_PACKAGE_NOTES'] = '';
96$GLOBALS['FW_PACKAGE_EST_SIZE'] = 499795199;
97$GLOBALS['FW_SECURE_NAME'] = '20180817_stage2018_efc2a154621e41d35724180817235041';
98$GLOBALS['FW_DBHOST'] = '';
99$GLOBALS['FW_DBHOST'] = empty($GLOBALS['FW_DBHOST']) ? 'localhost' : $GLOBALS['FW_DBHOST'];
100$GLOBALS['FW_DBPORT'] = '';
101$GLOBALS['FW_DBPORT'] = empty($GLOBALS['FW_DBPORT']) ? 3306 : $GLOBALS['FW_DBPORT'];
102$GLOBALS['FW_DBNAME'] = '';
103$GLOBALS['FW_DBUSER'] = '';
104$GLOBALS['FW_DBPASS'] = '';
105$GLOBALS['FW_BLOGNAME'] = 'Stage 2018';
106$GLOBALS['FW_WPROOT'] = '/Applications/MAMP/htdocs/Stage/';
107$GLOBALS['FW_WPLOGIN_URL'] = 'http://localhost:8888/Stage/wp-login.php';
108$GLOBALS['FW_OPTS_DELETE'] = json_decode('["duplicator_ui_view_state","duplicator_package_active","duplicator_settings"]', true);
109$GLOBALS['FW_DUPLICATOR_VERSION'] = '1.2.40';
110$GLOBALS['FW_ARCHIVE_ONLYDB'] = 0;
111
112//DATABASE SETUP: all time in seconds
113$GLOBALS['DB_MAX_TIME'] = 5000;
114$GLOBALS['DB_MAX_PACKETS'] = 268435456;
115$GLOBALS['DB_FCGI_FLUSH'] = false;
116ini_set('mysql.connect_timeout', '5000');
117
118//PHP SETUP: all time in seconds
119ini_set('memory_limit', '2048M');
120ini_set("max_execution_time", '5000');
121ini_set("max_input_time", '5000');
122ini_set('default_socket_timeout', '5000');
123@set_time_limit(0);
124
125$GLOBALS['DBCHARSET_DEFAULT'] = 'utf8';
126$GLOBALS['DBCOLLATE_DEFAULT'] = 'utf8_general_ci';
127$GLOBALS['FAQ_URL'] = 'https://snapcreek.com/duplicator/docs/faqs-tech';
128$GLOBALS['NOW_DATE'] = @date("Y-m-d-H:i:s");
129$GLOBALS['DB_RENAME_PREFIX'] = 'x-bak__';
130
131//UPDATE TABLE SETTINGS
132$GLOBALS['REPLACE_LIST'] = array();
133
134
135/** ================================================================================================
136 END ADVANCED FEATURES: Do not edit below here.
137 =================================================================================================== */
138
139//CONSTANTS
140define("DUPLICATOR_INIT", 1);
141define("DUPLICATOR_SSDIR_NAME", 'wp-snapshots'); //This should match DUPLICATOR_SSDIR_NAME in duplicator.php
142
143//SHARED POST PARMS
144$_POST['action_step'] = isset($_POST['action_step']) ? $_POST['action_step'] : "1";
145
146/** Host has several combinations :
147localhost | localhost:55 | localhost: | http://localhost | http://localhost:55 */
148$_POST['dbhost'] = isset($_POST['dbhost']) ? trim($_POST['dbhost']) : null;
149$_POST['dbport'] = isset($_POST['dbport']) ? trim($_POST['dbport']) : 3306;
150$_POST['dbuser'] = isset($_POST['dbuser']) ? trim($_POST['dbuser']) : null;
151$_POST['dbpass'] = isset($_POST['dbpass']) ? trim($_POST['dbpass']) : null;
152$_POST['dbname'] = isset($_POST['dbname']) ? trim($_POST['dbname']) : null;
153$_POST['dbcharset'] = isset($_POST['dbcharset']) ? trim($_POST['dbcharset']) : $GLOBALS['DBCHARSET_DEFAULT'];
154$_POST['dbcollate'] = isset($_POST['dbcollate']) ? trim($_POST['dbcollate']) : $GLOBALS['DBCOLLATE_DEFAULT'];
155
156//GLOBALS
157$GLOBALS['SQL_FILE_NAME'] = "installer-data.sql";
158$GLOBALS['LOG_FILE_NAME'] = "installer-log.txt";
159$GLOBALS['LOGGING'] = isset($_POST['logging']) ? $_POST['logging'] : 1;
160$GLOBALS['CURRENT_ROOT_PATH'] = dirname(__FILE__);
161$GLOBALS['CHOWN_ROOT_PATH'] = @chmod("{$GLOBALS['CURRENT_ROOT_PATH']}", 0755);
162$GLOBALS['CHOWN_LOG_PATH'] = @chmod("{$GLOBALS['CURRENT_ROOT_PATH']}/{$GLOBALS['LOG_FILE_NAME']}", 0644);
163$GLOBALS['URL_SSL'] = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? true : false;
164$GLOBALS['URL_PATH'] = ($GLOBALS['URL_SSL']) ? "https://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}" : "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
165$GLOBALS['PHP_MEMORY_LIMIT'] = ini_get('memory_limit') === false ? 'n/a' : ini_get('memory_limit');
166$GLOBALS['PHP_SUHOSIN_ON'] = extension_loaded('suhosin') ? 'enabled' : 'disabled';
167$GLOBALS['ARCHIVE_PATH'] = $GLOBALS['CURRENT_ROOT_PATH'] . '/' . $GLOBALS['FW_PACKAGE_NAME'];
168$GLOBALS['ARCHIVE_PATH'] = str_replace("\\", "/", $GLOBALS['ARCHIVE_PATH']);
169
170//Restart log if user starts from step 1
171if ($_POST['action_step'] == 1 && ! isset($_GET['help'])) {
172 $GLOBALS['LOG_FILE_HANDLE'] = @fopen($GLOBALS['LOG_FILE_NAME'], "w+");
173} else {
174 $GLOBALS['LOG_FILE_HANDLE'] = @fopen($GLOBALS['LOG_FILE_NAME'], "a+");
175}
176?>
177<?php
178/**
179 * Various Static Utility methods for working with the installer
180 *
181 * Standard: PSR-2
182 * @link http://www.php-fig.org/psr/psr-2 Full Documentation
183 *
184 * @package SC\DUPX\U
185 *
186 */
187class DUPX_U
188{
189
190 /**
191 * Adds a slash to the end of a file or directory path
192 *
193 * @param string $path A path
194 *
195 * @return string The original $path with a with '/' added to the end.
196 */
197 public static function addSlash($path)
198 {
199 $last_char = substr($path, strlen($path) - 1, 1);
200 if ($last_char != '/') {
201 $path .= '/';
202 }
203 return $path;
204 }
205
206 /**
207 * Return a string with the elapsed time
208 *
209 * @see getMicrotime()
210 *
211 * @param mixed number $end The final time in the sequence to measure
212 * @param mixed number $start The start time in the sequence to measure
213 *
214 * @return string The time elapsed from $start to $end
215 */
216 public static function elapsedTime($end, $start)
217 {
218 return sprintf("%.4f sec.", abs($end - $start));
219 }
220
221 /**
222 * Convert all applicable characters to HTML entities
223 *
224 * @param string $string String that needs conversion
225 * @param bool $echo Echo or return as a variable
226 *
227 * @return string Escaped string.
228 */
229 public static function escapeHTML($string = '', $echo = false)
230 {
231 $output = htmlentities($string, ENT_QUOTES, 'UTF-8');
232 if ($echo) {
233 echo $output;
234 } else {
235 return $output;
236 }
237 }
238
239 /**
240 * Returns 256 spaces
241 *
242 * PHP_SAPI for fcgi requires a data flush of at least 256
243 * bytes every 40 seconds or else it forces a script halt
244 *
245 * @return string A series of 256 spaces ' '
246 */
247 public static function fcgiFlush()
248 {
249 echo(str_repeat(' ', 256));
250 @flush();
251 }
252
253 /**
254 * Get current microtime as a float. Method is used for simple profiling
255 *
256 * @see elapsedTime
257 *
258 * @return string A float in the form "msec sec", where sec is the number of seconds since the Unix epoch
259 */
260 public static function getMicrotime()
261 {
262 return microtime(true);
263 }
264
265 /**
266 * Returns the active plugins for the WordPress website in the package
267 *
268 * @param obj $dbh A database connection handle
269 *
270 * @return array $list A list of active plugins
271 */
272 public static function getActivePlugins($dbh)
273 {
274 $query = @mysqli_query($dbh, "SELECT option_value FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE option_name = 'active_plugins' ");
275 if ($query) {
276 $row = @mysqli_fetch_array($query);
277 $all_plugins = unserialize($row[0]);
278 if (is_array($all_plugins)) {
279 return $all_plugins;
280 }
281 }
282 return array();
283 }
284
285 /**
286 * Check to see if the internet is accessible
287 *
288 * Note: fsocketopen on windows doesn't seem to honor $timeout setting.
289 *
290 * @param string $url A url e.g without prefix "ajax.googleapis.com"
291 * @param string $port A valid port number
292 *
293 * @return bool Returns true PHP can request the URL
294 */
295 public static function isURLActive($url, $port, $timeout = 5)
296 {
297 if (function_exists('fsockopen')) {
298 @ini_set("default_socket_timeout", 5);
299 $port = isset($port) && is_integer($port) ? $port : 80;
300 $connected = @fsockopen($url, $port, $errno, $errstr, $timeout); //website and port
301 if ($connected) {
302 @fclose($connected);
303 return true;
304 }
305 return false;
306 } else {
307 return false;
308 }
309 }
310
311 /**
312 * Does a string have non ascii characters
313 *
314 * @param string $string Any string blob
315 *
316 * @return bool Returns true if any non ascii character is found in the blob
317 */
318 public static function isNonASCII($string)
319 {
320 return preg_match('/[^\x20-\x7f]/', $string);
321 }
322
323
324 /**
325 * Is the string JSON
326 *
327 * @param string $string Any string blob
328 *
329 * @return bool Returns true if the string is JSON encoded
330 */
331 public static function isJSON($string)
332 {
333 return is_string($string) && is_array(json_decode($string, true)) ? true : false;
334 }
335
336 /**
337 * The characters that are special in the replacement value of preg_replace are not the
338 * same characters that are special in the pattern. Allows for '$' to be safely passed.
339 *
340 * @param string $str The string to replace on
341 */
342 public static function pregReplacementQuote($str)
343 {
344 return preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', $str);
345 }
346
347 /**
348 * Display human readable byte sizes
349 *
350 * @param string $size The size in bytes
351 *
352 * @return string Human readable bytes such as 50MB, 1GB
353 */
354 public static function readableByteSize($size)
355 {
356 try {
357 $units = array('B', 'KB', 'MB', 'GB', 'TB');
358 for ($i = 0; $size >= 1024 && $i < 4; $i++)
359 $size /= 1024;
360 return round($size, 2).$units[$i];
361 } catch (Exception $e) {
362 return "n/a";
363 }
364 }
365
366 /**
367 * Converts shorthand memory notation value to bytes
368 *
369 * @param $val Memory size shorthand notation string such as 10M, 1G
370 *
371 * @returns int The byte representation of the shorthand $val
372 */
373 public static function getBytes($val)
374 {
375 $val = trim($val);
376 $last = strtolower($val[strlen($val) - 1]);
377 switch ($last) {
378 // The 'G' modifier is available since PHP 5.1.0
379 case 'g':
380 $val *= 1024;
381 case 'm':
382 $val *= 1024;
383 case 'k':
384 $val *= 1024;
385 break;
386 default :
387 $val = null;
388 }
389 return $val;
390 }
391
392 /**
393 * Makes path safe for any OS for PHP
394 *
395 * Paths should ALWAYS READ be "/"
396 * uni: /home/path/file.txt
397 * win: D:/home/path/file.txt
398 *
399 * @param string $path The path to make safe
400 *
401 * @return string The original $path with a with all slashes facing '/'.
402 */
403 public static function setSafePath($path)
404 {
405 return str_replace("\\", "/", $path);
406 }
407
408 /**
409 * Looks for a list of strings in a string and returns each list item that is found
410 *
411 * @param array $list An array of strings to search for
412 * @param string $haystack The string blob to search through
413 *
414 * @return array An array of strings from the $list array found in the $haystack
415 */
416 public static function getListValues($list, $haystack)
417 {
418 $found = array();
419 foreach ($list as $var) {
420 if (strstr($haystack, $var) !== false) {
421 array_push($found, $var);
422 }
423 }
424 return $found;
425 }
426
427 /**
428 * Makes path unsafe for any OS for PHP used primarily to show default
429 * Windows OS path standard
430 *
431 * @param string $path The path to make unsafe
432 *
433 * @return string The original $path with a with all slashes facing '\'.
434 */
435 public static function unsetSafePath($path)
436 {
437 return str_replace("/", "\\", $path);
438 }
439
440 /**
441 * Sanitize input for XSS code
442 *
443 * @param string $val The value to sanitize
444 *
445 * @return string Returns the input value cleaned up.
446 */
447 public static function sanitize($input)
448 {
449 return filter_var($input, FILTER_SANITIZE_STRING);
450 }
451
452 /**
453 * Check PHP version
454 *
455 * @param string $version PHP version we looking for
456 *
457 * @return boolean Returns true if version is same or above.
458 */
459 public static function isVersion($version)
460 {
461 return (version_compare(PHP_VERSION, $version) >= 0);
462 }
463
464}
465?>
466<?php
467
468/**
469 * Lightweight abstraction layer for common simple server based routines
470 *
471 * Standard: PSR-2
472 * @link http://www.php-fig.org/psr/psr-2 Full Documentation
473 *
474 * @package SC\DUPX\Server
475 *
476 */
477class DUPX_Server
478{
479 /**
480 * Returns true if safe mode is enabled
481 */
482 public static $php_safe_mode_on = false;
483
484 /**
485 * The servers current PHP version
486 */
487 public static $php_version = 0;
488
489 /**
490 * The minimum PHP version the installer will support
491 */
492 public static $php_version_min = "5.2.7";
493
494 /**
495 * Is the current servers version of PHP safe to use with the installer
496 */
497 public static $php_version_safe = false;
498
499
500 /**
501 * Is PHP 5.3 or better running
502 */
503 public static $php_version_53_plus;
504
505 /**
506 * Used to init the static properties
507 */
508 public static function init()
509 {
510 self::$php_safe_mode_on = in_array(strtolower(@ini_get('safe_mode')), array('on', 'yes', 'true', 1, "1"));
511 self::$php_version = phpversion();
512 self::$php_version_safe = DUPX_U::isVersion(self::$php_version_min);
513 self::$php_version_53_plus = DUPX_U::isVersion('5.3.0');
514 }
515
516 /**
517 * Is the directory provided writable by PHP
518 *
519 * @param string $path A physical directory path
520 *
521 * @return bool Returns true if PHP can write to the path provided
522 */
523 public static function isDirWritable($path)
524 {
525 if (!@is_writeable($path)) return false;
526
527 if (is_dir($path)) {
528 if ($dh = @opendir($path)) {
529 closedir($dh);
530 } else {
531 return false;
532 }
533 }
534 return true;
535 }
536
537 /**
538 * Can this server process in shell_exec mode
539 *
540 * @return bool Returns true is the server can run shell_exec commands
541 */
542 public static function hasShellExec()
543 {
544 if (array_intersect(array('shell_exec', 'escapeshellarg', 'escapeshellcmd', 'extension_loaded'), array_map('trim', explode(',', @ini_get('disable_functions'))))) return false;
545
546 //Suhosin: http://www.hardened-php.net/suhosin/
547 //Will cause PHP to silently fail.
548 if (extension_loaded('suhosin')) return false;
549
550 // Can we issue a simple echo command?
551 if (!@shell_exec('echo duplicator')) return false;
552
553 return true;
554 }
555
556 /**
557 * Returns the path where the zip command can be called on this server
558 *
559 * @return string The path to where the zip command can be processed
560 */
561 public static function getUnzipPath()
562 {
563 $filepath = null;
564 if (self::hasShellExec()) {
565 if (shell_exec('hash unzip 2>&1') == NULL) {
566 $filepath = 'unzip';
567 } else {
568 $try_paths = array(
569 '/usr/bin/unzip',
570 '/opt/local/bin/unzip');
571 foreach ($try_paths as $path) {
572 if (file_exists($path)) {
573 $filepath = $path;
574 break;
575 }
576 }
577 }
578 }
579 return $filepath;
580 }
581
582
583 /**
584 * A safe method used to copy larger files
585 *
586 * @param string $source The path to the file being copied
587 * @param string $destination The path to the file being made
588 *
589 * @return bool True if the file was copied
590 */
591 public static function copyFile($source, $destination)
592 {
593 try {
594 $sp = fopen($source, 'r');
595 $op = fopen($destination, 'w');
596
597 while (!feof($sp)) {
598 $buffer = fread($sp, 512); // use a buffer of 512 bytes
599 fwrite($op, $buffer);
600 }
601 // close handles
602 fclose($op);
603 fclose($sp);
604 return true;
605
606 } catch (Exception $ex) {
607 return false;
608 }
609 }
610
611
612 /**
613 * Returns an array of zip files found in the current executing directory
614 *
615 * @return array of zip files
616 */
617 public static function getZipFiles()
618 {
619 $files = array();
620 foreach (glob("*.zip") as $name) {
621 if (file_exists($name)) {
622 $files[] = $name;
623 }
624 }
625
626 if (count($files) > 0) {
627 return $files;
628 }
629
630 //FALL BACK: Windows XP has bug with glob,
631 //add secondary check for PHP lameness
632 if ($dh = opendir('.')) {
633 while (false !== ($name = readdir($dh))) {
634 $ext = substr($name, strrpos($name, '.') + 1);
635 if (in_array($ext, array("zip"))) {
636 $files[] = $name;
637 }
638 }
639 closedir($dh);
640 }
641
642 return $files;
643 }
644}
645//INIT Class Properties
646DUPX_Server::init();
647?>
648<?php
649
650/**
651 * Lightweight abstraction layer for common simple database routines
652 *
653 * Standard: PSR-2
654 * @link http://www.php-fig.org/psr/psr-2 Full Documentation
655 *
656 * @package SC\DUPX\DB
657 *
658 */
659class DUPX_DB
660{
661
662 /**
663 * MySQL connection wrapper with support for port
664 *
665 * @param string $host The server host name
666 * @param string $username The server DB user name
667 * @param string $password The server DB password
668 * @param string $dbname The server DB name
669 * @param int $port The server DB port
670 *
671 * @return database connection handle
672 */
673 public static function connect($host, $username, $password, $dbname = '', $port = null)
674 {
675 //sock connections
676 if ('sock' === substr($host, -4)) {
677 $url_parts = parse_url($host);
678 $dbh = @mysqli_connect('localhost', $username, $password, $dbname, null, $url_parts['path']);
679 } else {
680 $dbh = @mysqli_connect($host, $username, $password, $dbname, $port);
681 }
682 return $dbh;
683 }
684
685 /**
686 * Count the tables in a given database
687 *
688 * @param obj $dbh A valid database link handle
689 * @param string $dbname Database to count tables in
690 *
691 * @return int The number of tables in the database
692 */
693 public static function countTables($dbh, $dbname)
694 {
695 $res = mysqli_query($dbh, "SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = '{$dbname}' ");
696 $row = mysqli_fetch_row($res);
697 return is_null($row) ? 0 : $row[0];
698 }
699
700 /**
701 * Returns the number of rows in a table
702 *
703 * @param obj $dbh A valid database link handle
704 * @param string $name A valid table name
705 */
706 public static function countTableRows($dbh, $name)
707 {
708 $total = mysqli_query($dbh, "SELECT COUNT(*) FROM `$name`");
709 if ($total) {
710 $total = @mysqli_fetch_array($total);
711 return $total[0];
712 } else {
713 return 0;
714 }
715 }
716
717 /**
718 * Returns the tables for a database as an array
719 *
720 * @param obj $dbh A valid database link handle
721 *
722 * @return array A list of all table names
723 */
724 public static function getTables($dbh)
725 {
726 $query = @mysqli_query($dbh, 'SHOW TABLES');
727 if ($query) {
728 while ($table = @mysqli_fetch_array($query)) {
729 $all_tables[] = $table[0];
730 }
731 if (isset($all_tables) && is_array($all_tables)) {
732 return $all_tables;
733 }
734 }
735 return array();
736 }
737
738 /**
739 * Get the requested MySQL system variable
740 *
741 * @param obj $dbh A valid database link handle
742 * @param string $name The database variable name to lookup
743 *
744 * @return string the server variable to query for
745 */
746 public static function getVariable($dbh, $name)
747 {
748 $result = @mysqli_query($dbh, "SHOW VARIABLES LIKE '{$name}'");
749 $row = @mysqli_fetch_array($result);
750 @mysqli_free_result($result);
751 return isset($row[1]) ? $row[1] : null;
752 }
753
754 /**
755 * Gets the MySQL database version number
756 *
757 * @param obj $dbh A valid database link handle
758 * @param bool $full True: Gets the full version
759 * False: Gets only the numeric portion i.e. 5.5.6 or 10.1.2 (for MariaDB)
760 *
761 * @return false|string 0 on failure, version number on success
762 */
763 public static function getVersion($dbh, $full = false)
764 {
765 if ($full) {
766 $version = self::getVariable($dbh, 'version');
767 } else {
768 $version = preg_replace('/[^0-9.].*/', '', self::getVariable($dbh, 'version'));
769 }
770
771 $version = is_null($version) ? null : $version;
772 return empty($version) ? 0 : $version;
773 }
774
775 /**
776 * Returns a more detailed string about the msyql server version
777 * For example on some systems the result is 5.5.5-10.1.21-MariaDB
778 * this format is helpful for providing the user a full overview
779 *
780 * @param conn $dbh Database connection handle
781 *
782 * @return string The full details of mysql
783 */
784 public static function getServerInfo($dbh)
785 {
786 return mysqli_get_server_info($dbh);
787 }
788
789 /**
790 * Get an array of all supported collation names
791 *
792 * @param conn $dbh Database connection handle
793 *
794 * @return array
795 */
796 public static function getSupportedCollationsList($dbh)
797 {
798 $collations = array();
799
800 $query = "SHOW COLLATION";
801 if ($result = $dbh->query($query)) {
802
803 while ($row = $result->fetch_assoc()) {
804 $collations[] = $row["Collation"];
805 }
806
807 }
808 $result->free();
809
810 return $collations;
811 }
812
813 /**
814 * Determine if a MySQL database supports a particular feature
815 *
816 * @param conn $dbh Database connection handle
817 * @param string $feature the feature to check for
818 *
819 * @return bool
820 */
821 public static function hasAbility($dbh, $feature)
822 {
823 $version = self::getVersion($dbh);
824
825 switch (strtolower($feature)) {
826 case 'collation' :
827 case 'group_concat' :
828 case 'subqueries' :
829 return version_compare($version, '4.1', '>=');
830 case 'set_charset' :
831 return version_compare($version, '5.0.7', '>=');
832 };
833 return false;
834 }
835
836 /**
837 * Sets the MySQL connection's character set.
838 *
839 * @param resource $dbh The resource given by mysqli_connect
840 * @param string $charset The character set (optional)
841 * @param string $collate The collation (optional)
842 *
843 * @return bool True on success
844 */
845 public static function setCharset($dbh, $charset = null, $collate = null)
846 {
847 $charset = (!isset($charset) ) ? $GLOBALS['DBCHARSET_DEFAULT'] : $charset;
848 $collate = (!isset($collate) ) ? $GLOBALS['DBCOLLATE_DEFAULT'] : $collate;
849
850 if (self::hasAbility($dbh, 'collation') && !empty($charset)) {
851 if (function_exists('mysqli_set_charset') && self::hasAbility($dbh, 'set_charset')) {
852 return mysqli_set_charset($dbh, $charset);
853 } else {
854 $sql = " SET NAMES {$charset}";
855 if (!empty($collate)) $sql .= " COLLATE {$collate}";
856 return mysqli_query($dbh, $sql);
857 }
858 }
859 }
860}
861?>
862<?php
863
864define('ERR_CONFIG_FOUND', 'A wp-config.php already exists in this location. This error prevents users from accidentally overwriting the wrong directories contents. You have three options: <ul><li>Empty this root directory except for the package and installer and try again.</li><li>Delete just the wp-config.php file and try again. This will over-write all other files in the directory.</li><li>Check the "Manual package extraction" checkbox under advanced options to skip extraction</li></ul>');
865define('ERR_ZIPNOTFOUND', 'The packaged zip file was not found. Be sure the zip package is in the same directory as the installer file and as the correct permissions. If you are trying to reinstall a package you can copy the package from the "' . DUPLICATOR_SSDIR_NAME . '" directory back up to your root which is the same location as your installer.php file.');
866define('ERR_ZIPOPEN', 'Failed to open zip archive file. Please be sure the archive is completely downloaded before running the installer. Try to extract the archive manually to make sure the file is not corrupted.');
867define('ERR_ZIPEXTRACTION', 'Errors extracting zip file. Portions or part of the zip archive did not extract correctly. Try to extract the archive manually with a client side program like unzip/win-zip/winrar or your hosts cPanel to make sure the file is not corrupted. If the file extracts correctly then there is an invalid file or directory that PHP is unable to extract. This can happen if your moving from one operating system to another where certain naming conventions work on one environment and not another. <br/><br/> <b>Workarounds:</b> <br/> 1. Create a new package and be sure to exclude any directories that have invalid names or files in them. This warning will be displayed on the scan results under "Name Checks". <br/> 2. Manually extract the zip file with a client side program or your hosts cPanel. Then under options in step 1 of this installer check the "Manual Archive Extraction" option and perform the install.');
868define('ERR_ZIPMANUAL', 'When choosing manual package extraction, the contents of the package must already be extracted and the wp-config.php and database.sql files must be present in the same directory as the installer.php for the process to continue. Please manually extract the package into the current directory before continuing in manual extraction mode. Also validate that the wp-config.php and database.sql files are present.');
869define('ERR_MAKELOG', 'PHP is having issues writing to the log file <b>' . DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']) . '\installer-log.txt .</b> In order for the Duplicator to proceed validate your owner/group and permission settings for PHP on this path. Try temporarily setting you permissions to 777 to see if the issue gets resolved. If you are on a shared hosting environment please contact your hosting company and tell them you are getting errors writing files to the path above when using PHP.');
870define('ERR_ZIPARCHIVE', 'In order to extract the archive.zip file the PHP ZipArchive module must be installed. Please read the FAQ for more details. You can still install this package but you will need to check the Manual package extraction checkbox found in the Advanced Options. Please read the online user guide for details in performing a manual package extraction.');
871define('ERR_MYSQLI_SUPPORT', 'In order to complete an install the mysqli extension for PHP is required. If you are on a hosted server please contact your host and request that mysqli be enabled. For more information visit: http://php.net/manual/en/mysqli.installation.php');
872define('ERR_DBCONNECT', 'DATABASE CONNECTION FAILED!<br/>');
873define('ERR_DBCONNECT_CREATE', 'DATABASE CREATION FAILURE!<br/> Unable to create database "%s". Check to make sure the user has "Create" privileges. Some hosts will restrict creation of a database only through the cpanel. Try creating the database manually to proceed with installation. If the database already exists then check the radio button labeled "Connect and Remove All Data" which will remove all existing tables.');
874define('ERR_DBTRYCLEAN', 'DATABASE CREATION FAILURE!<br/> Unable to remove all tables from database "%s".<br/> Please remove all tables from this database and try the installation again.');
875define('ERR_DBCREATE', 'The database "%s" does not exists.<br/> Change mode to create in order to create a new database.');
876define('ERR_DBEMPTY', 'The database "%s" has "%s" tables. The Duplicator only works with an EMPTY database. Enable the action "Connect and Remove All Data" radio button to remove all tables and or create a new database. Some hosting providers do not allow table removal from scripts. In this case you will need to login to your hosting providers control panel and remove the tables manually. Please contact your hosting provider for further details. Always backup all your data before proceeding!');
877define('ERR_TESTDB_UTF8', 'UTF8 Characters were detected as part of the database connection string. If your connection fails be sure to update the MySQL my.ini configuration file setting to support UTF8 characters by enabling this option [character_set_server=utf8] and restarting the database server.');
878define('ERR_TESTDB_VERSION_INFO', 'The current version detected was released prior to MySQL 5.5.3 which had a release date of April 8th 2010. WordPress 4.2 included support for utf8mb4 which is only supported in MySQL server 5.5.3+. It is highly recommended to upgrade your version of MySQL server on this server to be more compatible with recent releases of WordPress and avoid issues with install errors.');
879define('ERR_TESTDB_VERSION_COMPAT', 'In order to avoid database incompatibility issues make sure the database versions between the build and installer servers are as close as possible. If the package was created on a newer database version than where it is being installed then you might run into issues.<br/><br/> It is best to make sure the server where the installer is running has the same or higher version number than where it was built. If the major and minor version are the same or close for example [5.7 to 5.6], then the migration should work without issues. A version pair of [5.7 to 5.1] is more likely to cause issues unless you have a very simple setup. If the versions are too far apart work with your hosting provider to upgrade the MySQL engine on this server.<br/><br/> <b>MariaDB:</b> If see a version of 10.N.N then the database distribution is a MariaDB flavor of MySQL. While the distributions are very close there are some subtle differences. Some operating systems will report the version such as "5.5.5-10.1.21-MariaDB" showing the correlation of both. Please visit the online <a href="https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-compatibility/" target="_blank">MariaDB versus MySQL - Compatibility</a> page for more details.<br/><br/> Please note these messages are simply notices. It is highly recommended that you continue with the install process and closely monitor the installer-log.txt file along with the install report found on step 3 of the installer. Be sure to look for any notices/warnings/errors in these locations to validate the install process did not detect any errors. If any issues are found please visit the FAQ pages and see the question <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=database_incompatibility#faq-installer-260-q" target="_blank">What if I get database errors or general warnings on the install report?</a>.');
880
881
882/**
883 * Class used to log information to the installer-log.txt file
884 *
885 * Standard: PSR-2
886 * @link http://www.php-fig.org/psr/psr-2 Full Documentation
887 *
888 * @package SC\DUPX\Log
889 *
890 */
891class DUPX_Log
892{
893
894 /**
895 * Used to write debug info to the text log file
896 *
897 * @param string $msg Any text data
898 * @param int $loglevel Log level
899 *
900 * @return string Write info to both the log and browser
901 */
902 public static function info($msg, $logging = 1)
903 {
904 if ($logging <= $GLOBALS["LOGGING"]) {
905 @fwrite($GLOBALS["LOG_FILE_HANDLE"], "{$msg}\n");
906 }
907 }
908
909 /**
910 * Used to write errors to the text log file
911 *
912 * @param string $msg Any text data
913 * @param int $loglevel Log level
914 *
915 * @return string Write errors to both the log and browser
916 */
917 public static function error($msg)
918 {
919 $breaks = array("<br />","<br>","<br/>");
920 $log_msg = str_ireplace($breaks, "\r\n", $msg);
921 $log_msg = strip_tags($log_msg);
922 @fwrite($GLOBALS["LOG_FILE_HANDLE"], "\nINSTALLER ERROR:\n{$log_msg}\n");
923 @fclose($GLOBALS["LOG_FILE_HANDLE"]);
924 die("<div class='dupx-ui-error'><hr size='1' /><b style='color:#B80000;'>INSTALL ERROR!</b><br/>{$msg}</div>");
925 }
926}
927?>
928<?php
929
930/**
931 * Walks every table in db that then walks every row and column replacing searches with replaces
932 * large tables are split into 50k row blocks to save on memory.
933 *
934 * Standard: PSR-2
935 * @link http://www.php-fig.org/psr/psr-2 Full Documentation
936 *
937 * @package SC\DUPX\UpdateEngine
938 *
939 */
940class DUPX_UpdateEngine
941{
942
943 /**
944 * Used to report on all log errors into the installer-txt.log
945 *
946 * @param string $report The report error array of all error types
947 *
948 * @return string Writes the results of the update engine tables to the log
949 */
950 public static function logErrors($report)
951 {
952 if (!empty($report['errsql'])) {
953 DUPX_Log::info("--------------------------------------");
954 DUPX_Log::info("DATA-REPLACE ERRORS (MySQL)");
955 foreach ($report['errsql'] as $error) {
956 DUPX_Log::info($error);
957 }
958 DUPX_Log::info("");
959 }
960 if (!empty($report['errser'])) {
961 DUPX_Log::info("--------------------------------------");
962 DUPX_Log::info("DATA-REPLACE ERRORS (Serialization):");
963 foreach ($report['errser'] as $error) {
964 DUPX_Log::info($error);
965 }
966 DUPX_Log::info("");
967 }
968 if (!empty($report['errkey'])) {
969 DUPX_Log::info("--------------------------------------");
970 DUPX_Log::info("DATA-REPLACE ERRORS (Key):");
971 DUPX_Log::info('Use SQL: SELECT @row := @row + 1 as row, t.* FROM some_table t, (SELECT @row := 0) r');
972 foreach ($report['errkey'] as $error) {
973 DUPX_Log::info($error);
974 }
975 }
976 }
977
978 /**
979 * Used to report on all log stats into the installer-txt.log
980 *
981 * @param string $report The report stats array of all error types
982 *
983 * @return string Writes the results of the update engine tables to the log
984 */
985 public static function logStats($report)
986 {
987 if (!empty($report) && is_array($report)) {
988 $stats = "--------------------------------------\n";
989 $srchnum = 0;
990 foreach ($GLOBALS['REPLACE_LIST'] as $item) {
991 $srchnum++;
992 $stats .= sprintf("Search{$srchnum}:\t'%s' \nChange{$srchnum}:\t'%s' \n", $item['search'], $item['replace']);
993 }
994 $stats .= sprintf("SCANNED:\tTables:%d \t|\t Rows:%d \t|\t Cells:%d \n", $report['scan_tables'], $report['scan_rows'], $report['scan_cells']);
995 $stats .= sprintf("UPDATED:\tTables:%d \t|\t Rows:%d \t|\t Cells:%d \n", $report['updt_tables'], $report['updt_rows'], $report['updt_cells']);
996 $stats .= sprintf("ERRORS:\t\t%d \nRUNTIME:\t%f sec", $report['err_all'], $report['time']);
997 DUPX_Log::info($stats);
998 }
999 }
1000
1001 /**
1002 * Returns only the text type columns of a table ignoring all numeric types
1003 *
1004 * @param obj $dbh A valid database link handle
1005 * @param string $table A valid table name
1006 *
1007 * @return array All the column names of a table
1008 */
1009 public static function getTextColumns($dbh, $table)
1010 {
1011 $type_where = "type NOT LIKE 'tinyint%' AND ";
1012 $type_where .= "type NOT LIKE 'smallint%' AND ";
1013 $type_where .= "type NOT LIKE 'mediumint%' AND ";
1014 $type_where .= "type NOT LIKE 'int%' AND ";
1015 $type_where .= "type NOT LIKE 'bigint%' AND ";
1016 $type_where .= "type NOT LIKE 'float%' AND ";
1017 $type_where .= "type NOT LIKE 'double%' AND ";
1018 $type_where .= "type NOT LIKE 'decimal%' AND ";
1019 $type_where .= "type NOT LIKE 'numeric%' AND ";
1020 $type_where .= "type NOT LIKE 'date%' AND ";
1021 $type_where .= "type NOT LIKE 'time%' AND ";
1022 $type_where .= "type NOT LIKE 'year%' ";
1023
1024 $result = mysqli_query($dbh, "SHOW COLUMNS FROM `{$table}` WHERE {$type_where}");
1025 if (!$result) {
1026 return null;
1027 }
1028 $fields = array();
1029 if (mysqli_num_rows($result) > 0) {
1030 while ($row = mysqli_fetch_assoc($result)) {
1031 $fields[] = $row['Field'];
1032 }
1033 }
1034
1035 //Return Primary which is needed for index lookup
1036 //$result = mysqli_query($dbh, "SHOW INDEX FROM `{$table}` WHERE KEY_NAME LIKE '%PRIMARY%'"); 1.1.15 updated
1037 $result = mysqli_query($dbh, "SHOW INDEX FROM `{$table}`");
1038 if (mysqli_num_rows($result) > 0) {
1039 while ($row = mysqli_fetch_assoc($result)) {
1040 $fields[] = $row['Column_name'];
1041 }
1042 }
1043
1044 return (count($fields) > 0) ? $fields : null;
1045 }
1046
1047 /**
1048 * Begins the processing for replace logic
1049 *
1050 * @param mysql $dbh The db connection object
1051 * @param array $list Key value pair of 'search' and 'replace' arrays
1052 * @param array $tables The tables we want to look at
1053 * @param array $fullsearch Search every column regardless of its data type
1054 *
1055 * @return array Collection of information gathered during the run.
1056 */
1057 public static function load($dbh, $list = array(), $tables = array(), $fullsearch = false)
1058 {
1059 $report = array(
1060 'scan_tables' => 0,
1061 'scan_rows' => 0,
1062 'scan_cells' => 0,
1063 'updt_tables' => 0,
1064 'updt_rows' => 0,
1065 'updt_cells' => 0,
1066 'errsql' => array(),
1067 'errser' => array(),
1068 'errkey' => array(),
1069 'errsql_sum' => 0,
1070 'errser_sum' => 0,
1071 'errkey_sum' => 0,
1072 'time' => '',
1073 'err_all' => 0
1074 );
1075
1076 function set_sql_column_safe(&$str) {
1077 $str = "`$str`";
1078 }
1079
1080 $profile_start = DUPX_U::getMicrotime();
1081 if (is_array($tables) && !empty($tables)) {
1082
1083 foreach ($tables as $table) {
1084 $report['scan_tables'] ++;
1085 $columns = array();
1086
1087 // Get a list of columns in this table
1088 $fields = mysqli_query($dbh, 'DESCRIBE '.$table);
1089 while ($column = mysqli_fetch_array($fields)) {
1090 $columns[$column['Field']] = $column['Key'] == 'PRI' ? true : false;
1091 }
1092
1093 // Count the number of rows we have in the table if large we'll split into blocks
1094 $row_count = mysqli_query($dbh, "SELECT COUNT(*) FROM `{$table}`");
1095 $rows_result = mysqli_fetch_array($row_count);
1096 @mysqli_free_result($row_count);
1097 $row_count = $rows_result[0];
1098 if ($row_count == 0) {
1099 DUPX_Log::info("{$table}^ ({$row_count})");
1100 continue;
1101 }
1102
1103 $page_size = 25000;
1104 $offset = ($page_size + 1);
1105 $pages = ceil($row_count / $page_size);
1106
1107 // Grab the columns of the table. Only grab text based columns because
1108 // they are the only data types that should allow any type of search/replace logic
1109 $colList = '*';
1110 $colMsg = '*';
1111 if (!$fullsearch) {
1112 $colList = self::getTextColumns($dbh, $table);
1113 if ($colList != null && is_array($colList)) {
1114 array_walk($colList, set_sql_column_safe);
1115 $colList = implode(',', $colList);
1116 }
1117 $colMsg = (empty($colList)) ? '*' : '~';
1118 }
1119
1120 if (empty($colList)) {
1121 DUPX_Log::info("{$table}^ ({$row_count})");
1122 continue;
1123 } else {
1124 DUPX_Log::info("{$table}{$colMsg} ({$row_count})");
1125 }
1126
1127 //Paged Records
1128 for ($page = 0; $page < $pages; $page++) {
1129 $current_row = 0;
1130 $start = $page * $page_size;
1131 $end = $start + $page_size;
1132 $sql = sprintf("SELECT {$colList} FROM `%s` LIMIT %d, %d", $table, $start, $offset);
1133 $data = mysqli_query($dbh, $sql);
1134
1135 if (!$data) $report['errsql'][] = mysqli_error($dbh);
1136
1137 $scan_count = ($row_count < $end) ? $row_count : $end;
1138 DUPX_Log::info("\tScan => {$start} of {$scan_count}", 2);
1139
1140 //Loops every row
1141 while ($row = mysqli_fetch_array($data)) {
1142 $report['scan_rows'] ++;
1143 $current_row++;
1144 $upd_col = array();
1145 $upd_sql = array();
1146 $where_sql = array();
1147 $upd = false;
1148 $serial_err = 0;
1149 $is_unkeyed = !in_array(true,$columns);
1150
1151 //Loops every cell
1152 foreach ($columns as $column => $primary_key) {
1153 $report['scan_cells'] ++;
1154 $edited_data = $data_to_fix = $row[$column];
1155 $base64converted = false;
1156 $txt_found = false;
1157
1158 //Unkeyed table code
1159 //Added this here to add all columns to $where_sql
1160 //The if statement with $txt_found would skip additional columns
1161 if($is_unkeyed && ! empty($data_to_fix)) {
1162 $where_sql[] = $column.' = "'.mysqli_real_escape_string($dbh, $data_to_fix).'"';
1163 }
1164
1165 //Only replacing string values
1166 if (!empty($row[$column]) && !is_numeric($row[$column]) && $primary_key != 1) {
1167 //Base 64 detection
1168 if (base64_decode($row[$column], true)) {
1169 $decoded = base64_decode($row[$column], true);
1170 if (self::isSerialized($decoded)) {
1171 $edited_data = $decoded;
1172 $base64converted = true;
1173 }
1174 }
1175
1176 //Skip table cell if match not found
1177 foreach ($list as $item) {
1178 if (strpos($edited_data, $item['search']) !== false) {
1179 $txt_found = true;
1180 break;
1181 }
1182 }
1183 if (!$txt_found) {
1184 continue;
1185 }
1186
1187 //Replace logic - level 1: simple check on any string or serialized strings
1188 foreach ($list as $item) {
1189 $edited_data = self::recursiveUnserializeReplace($item['search'], $item['replace'], $edited_data);
1190 }
1191
1192 //Replace logic - level 2: repair serialized strings that have become broken
1193 $serial_check = self::fixSerialString($edited_data);
1194 if ($serial_check['fixed']) {
1195 $edited_data = $serial_check['data'];
1196 } elseif ($serial_check['tried'] && !$serial_check['fixed']) {
1197 $serial_err++;
1198 }
1199 }
1200
1201 //Change was made
1202 if ($edited_data != $data_to_fix || $serial_err > 0) {
1203 $report['updt_cells'] ++;
1204 //Base 64 encode
1205 if ($base64converted) {
1206 $edited_data = base64_encode($edited_data);
1207 }
1208 $upd_col[] = $column;
1209 $upd_sql[] = $column.' = "'.mysqli_real_escape_string($dbh, $edited_data).'"';
1210 $upd = true;
1211 }
1212
1213 if ($primary_key) {
1214 $where_sql[] = $column.' = "'.mysqli_real_escape_string($dbh, $data_to_fix).'"';
1215 }
1216 }
1217
1218 //PERFORM ROW UPDATE
1219 if ($upd && !empty($where_sql)) {
1220 $sql = "UPDATE `{$table}` SET ".implode(', ', $upd_sql).' WHERE '.implode(' AND ', array_filter($where_sql));
1221 $result = mysqli_query($dbh, $sql);
1222 if ($result) {
1223 if ($serial_err > 0) {
1224 $report['errser'][] = "SELECT " . implode(', ', $upd_col) . " FROM `{$table}` WHERE " . implode(' AND ', array_filter($where_sql)) . ';';
1225 }
1226 $report['updt_rows']++;
1227 } else {
1228 $report['errsql'][] = ($GLOBALS["LOGGING"] == 1)
1229 ? 'DB ERROR: ' . mysqli_error($dbh)
1230 : 'DB ERROR: ' . mysqli_error($dbh) . "\nSQL: [{$sql}]\n";
1231 }
1232
1233 //DEBUG ONLY:
1234 DUPX_Log::info("\t{$sql}\n", 3);
1235
1236 } elseif ($upd) {
1237 $report['errkey'][] = sprintf("Row [%s] on Table [%s] requires a manual update.", $current_row, $table);
1238 }
1239 }
1240 //DUPX_U::fcgiFlush();
1241 @mysqli_free_result($data);
1242 }
1243
1244 if ($upd) {
1245 $report['updt_tables'] ++;
1246 }
1247 }
1248 }
1249 $profile_end = DUPX_U::getMicrotime();
1250 $report['time'] = DUPX_U::elapsedTime($profile_end, $profile_start);
1251 $report['errsql_sum'] = empty($report['errsql']) ? 0 : count($report['errsql']);
1252 $report['errser_sum'] = empty($report['errser']) ? 0 : count($report['errser']);
1253 $report['errkey_sum'] = empty($report['errkey']) ? 0 : count($report['errkey']);
1254 $report['err_all'] = $report['errsql_sum'] + $report['errser_sum'] + $report['errkey_sum'];
1255 return $report;
1256 }
1257
1258 /**
1259 * Take a serialized array and unserialized it replacing elements and
1260 * unserializing any subordinate arrays and performing the replace.
1261 *
1262 * @param string $from String we're looking to replace.
1263 * @param string $to What we want it to be replaced with
1264 * @param array $data Used to pass any subordinate arrays back to in.
1265 * @param bool $serialised Does the array passed via $data need serializing.
1266 *
1267 * @return array The original array with all elements replaced as needed.
1268 */
1269 public static function recursiveUnserializeReplace($from = '', $to = '', $data = '', $serialised = false)
1270 {
1271 // some unseriliased data cannot be re-serialised eg. SimpleXMLElements
1272 try {
1273 if (is_string($data) && ($unserialized = @unserialize($data)) !== false) {
1274 $data = self::recursiveUnserializeReplace($from, $to, $unserialized, true);
1275 } elseif (is_array($data)) {
1276 $_tmp = array();
1277 foreach ($data as $key => $value) {
1278 $_tmp[$key] = self::recursiveUnserializeReplace($from, $to, $value, false);
1279 }
1280 $data = $_tmp;
1281 unset($_tmp);
1282
1283 /* CJL
1284 Check for an update to the key of an array e.g. [http://localhost/projects/wpplugins/] => 1.41
1285 This could have unintended consequences would need to enable with full-search needs more testing
1286 if (array_key_exists($from, $data))
1287 {
1288 $data[$to] = $data[$from];
1289 unset($data[$from]);
1290 } */
1291 } elseif (is_object($data)) {
1292 /* RSR Old logic that didn't work with Beaver Builder - they didn't want to create a brand new
1293 object instead reused the existing one...
1294 $dataClass = get_class($data);
1295 $_tmp = new $dataClass();
1296 foreach ($data as $key => $value) {
1297 $_tmp->$key = self::recursiveUnserializeReplace($from, $to, $value, false);
1298 }
1299 $data = $_tmp;
1300 unset($_tmp); */
1301
1302 // RSR NEW LOGIC
1303 $_tmp = $data;
1304 $props = get_object_vars($data);
1305 foreach ($props as $key => $value) {
1306 $_tmp->$key = self::recursiveUnserializeReplace($from, $to, $value, false);
1307 }
1308 $data = $_tmp;
1309 unset($_tmp);
1310 } else {
1311 if (is_string($data)) {
1312 $data = str_replace($from, $to, $data);
1313 }
1314 }
1315
1316 if ($serialised) return serialize($data);
1317 } catch (Exception $error) {
1318 DUPX_Log::info("\nRECURSIVE UNSERIALIZE ERROR: With string\n".$error, 2);
1319 }
1320 return $data;
1321 }
1322
1323 /**
1324 * Test if a string in properly serialized
1325 *
1326 * @param string $data Any string type
1327 *
1328 * @return bool Is the string a serialized string
1329 */
1330 public static function isSerialized($data)
1331 {
1332 $test = @unserialize(($data));
1333 return ($test !== false || $test === 'b:0;') ? true : false;
1334 }
1335
1336 /**
1337 * Fixes the string length of a string object that has been serialized but the length is broken
1338 *
1339 * @param string $data The string ojbect to recalculate the size on.
1340 *
1341 * @return string A serialized string that fixes and string length types
1342 */
1343 public static function fixSerialString($data)
1344 {
1345 $result = array('data' => $data, 'fixed' => false, 'tried' => false);
1346 if (preg_match("/s:[0-9]+:/", $data)) {
1347 if (!self::isSerialized($data)) {
1348 $regex = '!(?<=^|;)s:(\d+)(?=:"(.*?)";(?:}|a:|s:|b:|d:|i:|o:|N;))!s';
1349 $serial_string = preg_match('/^s:[0-9]+:"(.*$)/s', trim($data), $matches);
1350 //Nested serial string
1351 if ($serial_string) {
1352 $inner = preg_replace_callback($regex, 'DUPX_UpdateEngine::fixStringCallback', rtrim($matches[1], '";'));
1353 $serialized_fixed = 's:'.strlen($inner).':"'.$inner.'";';
1354 } else {
1355 $serialized_fixed = preg_replace_callback($regex, 'DUPX_UpdateEngine::fixStringCallback', $data);
1356 }
1357
1358 if (self::isSerialized($serialized_fixed)) {
1359 $result['data'] = $serialized_fixed;
1360 $result['fixed'] = true;
1361 }
1362 $result['tried'] = true;
1363 }
1364 }
1365 return $result;
1366 }
1367
1368 /**
1369 * The call back method call from via fixSerialString
1370 */
1371 private static function fixStringCallback($matches)
1372 {
1373 return 's:'.strlen(($matches[2]));
1374 }
1375}
1376?>
1377<?php
1378
1379/**
1380 * Class used to update and edit and update the wp-config.php
1381 *
1382 * Standard: PSR-2
1383 * @link http://www.php-fig.org/psr/psr-2 Full Documentation
1384 *
1385 * @package SC\DUPX\WPConfig
1386 *
1387 */
1388class DUPX_WPConfig
1389{
1390
1391 /**
1392 * Updates the web server config files in Step 1
1393 *
1394 * @return null
1395 */
1396 public static function updateStandard()
1397 {
1398 if (!file_exists('wp-config.php')) return;
1399
1400 $root_path = DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']);
1401 $wpconfig = @file_get_contents('wp-config.php', true);
1402
1403 $patterns = array(
1404 "/'DB_NAME',\s*'.*?'/",
1405 "/'DB_USER',\s*'.*?'/",
1406 "/'DB_PASSWORD',\s*'.*?'/",
1407 "/'DB_HOST',\s*'.*?'/");
1408
1409 $db_host = ($_POST['dbport'] == 3306) ? $_POST['dbhost'] : "{$_POST['dbhost']}:{$_POST['dbport']}";
1410
1411 $replace = array(
1412 "'DB_NAME', ".'\''.$_POST['dbname'].'\'',
1413 "'DB_USER', ".'\''.$_POST['dbuser'].'\'',
1414 "'DB_PASSWORD', ".'\''.DUPX_U::pregReplacementQuote($_POST['dbpass']).'\'',
1415 "'DB_HOST', ".'\''.$db_host.'\'');
1416
1417 //SSL CHECKS
1418 if ($_POST['ssl_admin']) {
1419 if (!strstr($wpconfig, 'FORCE_SSL_ADMIN')) {
1420 $wpconfig = $wpconfig.PHP_EOL."define('FORCE_SSL_ADMIN', true);";
1421 }
1422 } else {
1423 array_push($patterns, "/'FORCE_SSL_ADMIN',\s*true/");
1424 array_push($replace, "'FORCE_SSL_ADMIN', false");
1425 }
1426
1427 //CACHE CHECKS
1428 if ($_POST['cache_wp']) {
1429 if (!strstr($wpconfig, 'WP_CACHE')) {
1430 $wpconfig = $wpconfig.PHP_EOL."define('WP_CACHE', true);";
1431 }
1432 } else {
1433 array_push($patterns, "/'WP_CACHE',\s*true/");
1434 array_push($replace, "'WP_CACHE', false");
1435 }
1436 if (!$_POST['cache_path']) {
1437 array_push($patterns, "/'WPCACHEHOME',\s*'.*?'/");
1438 array_push($replace, "'WPCACHEHOME', ''");
1439 }
1440
1441 if (!is_writable("{$root_path}/wp-config.php")) {
1442 if (file_exists("{$root_path}/wp-config.php")) {
1443 chmod("{$root_path}/wp-config.php", 0644) ? DUPX_Log::info('File Permission Update: wp-config.php set to 0644') : DUPX_Log::info('WARNING: Unable to update file permissions and write to wp-config.php. Please visit the online FAQ for setting file permissions and work with your hosting provider or server administrator to enable this installer.php script to write to the wp-config.php file.');
1444 } else {
1445 DUPX_Log::info('WARNING: Unable to locate wp-config.php file. Be sure the file is present in your archive.');
1446 }
1447 }
1448
1449 $wpconfig = preg_replace($patterns, $replace, $wpconfig);
1450 file_put_contents('wp-config.php', $wpconfig);
1451 $wpconfig = null;
1452 }
1453
1454 /**
1455 * Updates the web server config files in Step 1
1456 *
1457 * @return null
1458 */
1459 public static function updateExtended()
1460 {
1461 $config_file = '';
1462 if (!file_exists('wp-config.php')) {
1463 return $config_file;
1464 }
1465
1466 $root_path = DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']);
1467 $wpconfig_path = "{$root_path}/wp-config.php";
1468 $config_file = @file_get_contents($wpconfig_path, true);
1469
1470 $patterns = array(
1471 "/('|\")WP_HOME.*?\)\s*;/",
1472 "/('|\")WP_SITEURL.*?\)\s*;/");
1473 $replace = array(
1474 "'WP_HOME', '{$_POST['url_new']}');",
1475 "'WP_SITEURL', '{$_POST['url_new']}');");
1476
1477 //Not sure how well tokenParser works on all servers so only using for not critical constants at this point.
1478 //$count checks for dynamic variable types such as: define('WP_TEMP_DIR', 'D:/' . $var . 'somepath/');
1479 //which should not be updated.
1480 $defines = self::tokenParser($wpconfig_path);
1481
1482 //WP_CONTENT_DIR
1483 if (isset($defines['WP_CONTENT_DIR'])) {
1484 $val = str_replace($_POST['path_old'], $_POST['path_new'], DUPX_U::setSafePath($defines['WP_CONTENT_DIR']), $count);
1485 if ($count > 0) {
1486 array_push($patterns, "/('|\")WP_CONTENT_DIR.*?\)\s*;/");
1487 array_push($replace, "'WP_CONTENT_DIR', '{$val}');");
1488 }
1489 }
1490
1491 //WP_CONTENT_URL
1492 if (isset($defines['WP_CONTENT_URL'])) {
1493 $val = str_replace($_POST['url_old'] . '/', $_POST['url_new'] . '/', $defines['WP_CONTENT_URL'], $count);
1494 if ($count > 0) {
1495 array_push($patterns, "/('|\")WP_CONTENT_URL.*?\)\s*;/");
1496 array_push($replace, "'WP_CONTENT_URL', '{$val}');");
1497 }
1498 }
1499
1500 //WP_TEMP_DIR
1501 if (isset($defines['WP_TEMP_DIR'])) {
1502 $val = str_replace($_POST['path_old'], $_POST['path_new'], DUPX_U::setSafePath($defines['WP_TEMP_DIR']) , $count);
1503 if ($count > 0) {
1504 array_push($patterns, "/('|\")WP_TEMP_DIR.*?\)\s*;/");
1505 array_push($replace, "'WP_TEMP_DIR', '{$val}');");
1506 }
1507 }
1508
1509 //DOMAIN_CURRENT_SITE
1510 if (isset($defines['DOMAIN_CURRENT_SITE'])) {
1511 $mu_newDomainHost = parse_url($_POST['url_new'], PHP_URL_HOST);
1512 array_push($patterns, "/('|\")DOMAIN_CURRENT_SITE.*?\)\s*;/");
1513 array_push($replace, "'DOMAIN_CURRENT_SITE', '{$mu_newDomainHost}');");
1514 }
1515
1516 //PATH_CURRENT_SITE
1517 if (isset($defines['PATH_CURRENT_SITE'])) {
1518 $mu_newUrlPath = parse_url($_POST['url_new'], PHP_URL_PATH);
1519 array_push($patterns, "/('|\")PATH_CURRENT_SITE.*?\)\s*;/");
1520 array_push($replace, "'PATH_CURRENT_SITE', '{$mu_newUrlPath}');");
1521 }
1522
1523 $config_file = preg_replace($patterns, $replace, $config_file);
1524 file_put_contents($wpconfig_path, $config_file);
1525 $config_file = file_get_contents($wpconfig_path, true);
1526
1527 return $config_file;
1528 }
1529
1530
1531 public static function tokenParser($wpconfig_path) {
1532
1533 $defines = array();
1534 $wpconfig_file = @file_get_contents($wpconfig_path);
1535
1536 if (!function_exists('token_get_all')) {
1537 DUPX_Log::info("\nNOTICE: PHP function 'token_get_all' does not exist so skipping WP_CONTENT_DIR and WP_CONTENT_URL processing.");
1538 return $defines;
1539 }
1540
1541 if ($wpconfig_file === false) {
1542 return $defines;
1543 }
1544
1545 $defines = array();
1546 $tokens = token_get_all($wpconfig_file);
1547 $token = reset($tokens);
1548 while ($token) {
1549 if (is_array($token)) {
1550 if ($token[0] == T_WHITESPACE || $token[0] == T_COMMENT || $token[0] == T_DOC_COMMENT) {
1551 // do nothing
1552 } else if ($token[0] == T_STRING && strtolower($token[1]) == 'define') {
1553 $state = 1;
1554 } else if ($state == 2 && self::isConstant($token[0])) {
1555 $key = $token[1];
1556 $state = 3;
1557 } else if ($state == 4 && self::isConstant($token[0])) {
1558 $value = $token[1];
1559 $state = 5;
1560 }
1561 } else {
1562 $symbol = trim($token);
1563 if ($symbol == '(' && $state == 1) {
1564 $state = 2;
1565 } else if ($symbol == ',' && $state == 3) {
1566 $state = 4;
1567 } else if ($symbol == ')' && $state == 5) {
1568 $defines[self::tokenStrip($key)] = self::tokenStrip($value);
1569 $state = 0;
1570 }
1571 }
1572 $token = next($tokens);
1573 }
1574
1575 return $defines;
1576
1577 }
1578
1579 private static function tokenStrip($value)
1580 {
1581 return preg_replace('!^([\'"])(.*)\1$!', '$2', $value);
1582 }
1583
1584 private static function isConstant($token)
1585 {
1586 return $token == T_CONSTANT_ENCAPSED_STRING || $token == T_STRING || $token == T_LNUMBER || $token == T_DNUMBER;
1587 }
1588
1589
1590}
1591?>
1592<?php
1593
1594/**
1595 * Class used to update and edit web server configuration files
1596 *
1597 * Standard: PSR-2
1598 * @link http://www.php-fig.org/psr/psr-2 Full Documentation
1599 *
1600 * @package SC\DUPX\ServerConfig
1601 *
1602 */
1603class DUPX_ServerConfig
1604{
1605
1606 /**
1607 * Clear .htaccess and web.config files and backup
1608 *
1609 * @return null
1610 */
1611 public static function reset()
1612 {
1613
1614
1615 DUPX_Log::info("\nWEB SERVER CONFIGURATION FILE RESET:");
1616 $timeStamp = date("ymdHis");
1617
1618 //Apache
1619 @copy('.htaccess', ".htaccess.{$timeStamp}.orig");
1620 @unlink('.htaccess');
1621 @file_put_contents('.htaccess', "#Reset by Duplicator Installer. Original can be found in .htaccess.{$timeStamp}.orig");
1622
1623 //IIS
1624 @copy('web.config', "web.config.{$timeStamp}.orig");
1625 @unlink('web.config');
1626 $xml_contents = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
1627 $xml_contents .= "<!-- Reset by Duplicator Installer. Original can be found in web.config.{$timeStamp}.orig -->\n";
1628 $xml_contents .= "<configuration></configuration>\n";
1629 @file_put_contents('web.config', $xml_contents);
1630
1631 //.user.ini - For WordFence
1632 @copy('.user.ini', ".user.ini.{$timeStamp}.orig");
1633 @unlink('.user.ini');
1634
1635 DUPX_Log::info("- Backup of .htaccess/web.config made to *.{$timeStamp}.orig");
1636 DUPX_Log::info("- Reset of .htaccess/web.config files");
1637
1638
1639 @chmod('.htaccess', 0644);
1640 }
1641
1642 /**
1643 * Resets the .htaccess file to a very slimed down version with new paths
1644 *
1645 * @return null
1646 */
1647 public static function setup($dbh)
1648 {
1649 if (!isset($_POST['url_new'])) {
1650 return;
1651 }
1652
1653 DUPX_Log::info("\nWEB SERVER CONFIGURATION FILE BASIC SETUP:");
1654 $currdata = parse_url($_POST['url_old']);
1655 $newdata = parse_url($_POST['url_new']);
1656 $currpath = DUPX_U::addSlash(isset($currdata['path']) ? $currdata['path'] : "");
1657 $newpath = DUPX_U::addSlash(isset($newdata['path']) ? $newdata['path'] : "");
1658 $timestamp = date("Y-m-d H:i:s");
1659 $update_msg = "# This file was updated by Duplicator on {$timestamp}. See .htaccess.orig for the original .htaccess file.\n";
1660 $update_msg .= "# Please note that other plugins and resources write to this file. If the time-stamp above is different\n";
1661 $update_msg .= "# than the current time-stamp on the file system then another resource has updated this file.\n";
1662 $update_msg .= "# Duplicator only writes to this file once during the install process while running the installer.php file.\n";
1663
1664 $empty_htaccess = false;
1665 $query_result = @mysqli_query($dbh, "SELECT option_value FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE option_name = 'permalink_structure' ");
1666
1667 //If the permalink is set to Plain then don't update the rewrite rules
1668 if ($query_result) {
1669 $row = @mysqli_fetch_array($query_result);
1670 if ($row != null) {
1671 $permalink_structure = trim($row[0]);
1672 $empty_htaccess = empty($permalink_structure);
1673 }
1674 }
1675
1676 if ($empty_htaccess) {
1677 $tmp_htaccess = "{$update_msg}";
1678 DUPX_Log::info("- No permalink structures set creating blank .htaccess file.");
1679 } else {
1680 $tmp_htaccess = <<<HTACCESS
1681{$update_msg}
1682# BEGIN WordPress
1683<IfModule mod_rewrite.c>
1684RewriteEngine On
1685RewriteBase {$newpath}
1686RewriteRule ^index\.php$ - [L]
1687RewriteCond %{REQUEST_FILENAME} !-f
1688RewriteCond %{REQUEST_FILENAME} !-d
1689RewriteRule . {$newpath}index.php [L]
1690</IfModule>
1691# END WordPress
1692HTACCESS;
1693 DUPX_Log::info("- Preparing .htaccess file with basic setup.");
1694 }
1695
1696 file_put_contents('.htaccess', $tmp_htaccess);
1697 @chmod('.htaccess', 0644);
1698 DUPX_Log::info("Basic .htaccess file edit complete. If using IIS web.config this process will need to be done manually.");
1699
1700 }
1701}
1702?>
1703<?php
1704if (isset($_POST['action_ajax'])) :
1705
1706 //Alternative control switch structer will not work in this case
1707 //see: http://php.net/manual/en/control-structures.alternative-syntax.php
1708 //Some clients will create double spaces such as the FTP client which
1709 //will break example found online
1710 switch ($_POST['action_ajax']) :
1711
1712 case "1": ?><?php
1713
1714//POST PARAMS
1715$_POST['archive_name'] = isset($_POST['archive_name']) ? $_POST['archive_name'] : null;
1716$_POST['archive_engine'] = isset($_POST['archive_engine']) ? $_POST['archive_engine'] : 'manual';
1717$_POST['archive_filetime'] = (isset($_POST['archive_filetime'])) ? $_POST['archive_filetime'] : 'current';
1718$_POST['retain_config'] = (isset($_POST['retain_config']) && $_POST['retain_config'] == '1') ? true : false;
1719$_POST['exe_safe_mode'] = (isset($_POST['exe_safe_mode'])) ? $_POST['exe_safe_mode'] : 0;
1720//LOGGING
1721$POST_LOG = $_POST;
1722unset($POST_LOG['dbpass']);
1723ksort($POST_LOG);
1724
1725//PAGE VARS
1726$php_max_time = @ini_get("max_execution_time");
1727$php_max_time = ($php_max_time == 0) ? "[0] time limit restriction disabled" : "[{$php_max_time}] time limit restriction enabled";
1728$root_path = DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']);
1729$package_path = "{$root_path}/{$_POST['archive_name']}";
1730$ajax1_start = DUPX_U::getMicrotime();
1731$zip_support = class_exists('ZipArchive') ? 'Enabled' : 'Not Enabled';
1732$JSON = array();
1733$JSON['pass'] = 0;
1734
1735/** JSON RESPONSE: Most sites have warnings turned off by default, but if they're turned on the warnings
1736 cause errors in the JSON data Here we hide the status so warning level is reset at it at the end */
1737if (!headers_sent()) {
1738 header('Content-Type: application/json');
1739}
1740$ajax1_error_level = error_reporting();
1741error_reporting(E_ERROR);
1742
1743//===============================
1744//ERROR MESSAGES
1745//===============================
1746($GLOBALS['LOG_FILE_HANDLE'] != false) or DUPX_Log::error(ERR_MAKELOG);
1747
1748if (!$GLOBALS['FW_ARCHIVE_ONLYDB']) {
1749 //ERR_ZIPMANUAL
1750 if ($_POST['archive_engine'] == 'manual') {
1751 if (!file_exists("wp-config.php") && !file_exists("database.sql")) {
1752 DUPX_Log::error(ERR_ZIPMANUAL);
1753 }
1754 } else {
1755 //ERR_CONFIG_FOUND
1756 (!file_exists('wp-config.php'))
1757 or DUPX_Log::error(ERR_CONFIG_FOUND);
1758 //ERR_ZIPNOTFOUND
1759 (is_readable("{$package_path}"))
1760 or DUPX_Log::error(ERR_ZIPNOTFOUND);
1761 }
1762}
1763
1764
1765
1766DUPX_Log::info("********************************************************************************");
1767DUPX_Log::info('* DUPLICATOR-LITE: INSTALL-LOG');
1768DUPX_Log::info("* VERSION: {$GLOBALS['FW_DUPLICATOR_VERSION']}");
1769DUPX_Log::info('* STEP-1 START @ '.@date('h:i:s'));
1770DUPX_Log::info('* NOTICE: Do NOT post this data to public sites or forums');
1771DUPX_Log::info("********************************************************************************");
1772DUPX_Log::info("PHP VERSION:\t".phpversion().' | SAPI: '.php_sapi_name());
1773DUPX_Log::info("PHP TIME LIMIT:\t{$php_max_time}");
1774DUPX_Log::info("PHP MEMORY:\t".$GLOBALS['PHP_MEMORY_LIMIT'].' | SUHOSIN: '.$GLOBALS['PHP_SUHOSIN_ON']);
1775DUPX_Log::info("SERVER:\t\t{$_SERVER['SERVER_SOFTWARE']}");
1776DUPX_Log::info("DOC ROOT:\t{$root_path}");
1777DUPX_Log::info("DOC ROOT 755:\t".var_export($GLOBALS['CHOWN_ROOT_PATH'], true));
1778DUPX_Log::info("LOG FILE 644:\t".var_export($GLOBALS['CHOWN_LOG_PATH'], true));
1779DUPX_Log::info("REQUEST URL:\t{$GLOBALS['URL_PATH']}");
1780DUPX_Log::info("SAFE MODE :\t{$_POST['exe_safe_mode']}");
1781
1782$log = "--------------------------------------\n";
1783$log .= "POST DATA\n";
1784$log .= "--------------------------------------\n";
1785$log .= print_r($POST_LOG, true);
1786DUPX_Log::info($log, 2);
1787
1788$log = "--------------------------------------\n";
1789$log .= "ARCHIVE EXTRACTION\n";
1790$log .= "--------------------------------------\n";
1791$log .= "NAME:\t{$_POST['archive_name']}\n";
1792$log .= "SIZE:\t".DUPX_U::readableByteSize(@filesize($_POST['archive_name']))."\n";
1793$log .= "ZIP:\t{$zip_support} (ZipArchive Support)";
1794DUPX_Log::info($log);
1795
1796
1797if ($_POST['archive_engine'] == 'manual') {
1798 DUPX_Log::info("\n** PACKAGE EXTRACTION IS IN MANUAL MODE ** \n");
1799} else {
1800 if ($GLOBALS['FW_PACKAGE_NAME'] != $_POST['archive_name']) {
1801 $log = "\n--------------------------------------\n";
1802 $log .= "WARNING: This package set may be incompatible! \nBelow is a summary of the package this installer was built with and the package used. \n";
1803 $log .= "To guarantee accuracy the installer and archive should match. For details see the online FAQs.";
1804 $log .= "\nCREATED WITH:\t{$GLOBALS['FW_PACKAGE_NAME']} \nPROCESSED WITH:\t{$_POST['archive_name']} \n";
1805 $log .= "--------------------------------------\n";
1806 DUPX_Log::info($log);
1807 }
1808
1809 if (!class_exists('ZipArchive')) {
1810 DUPX_Log::info("ERROR: Stopping install process. Trying to extract without ZipArchive module installed. Please use the 'Manual Package extraction' mode to extract zip file.");
1811 DUPX_Log::error(ERR_ZIPARCHIVE);
1812 }
1813
1814 $target = $root_path;
1815 $zip = new ZipArchive();
1816 if ($zip->open($_POST['archive_name']) === TRUE) {
1817
1818 DUPX_Log::info("\n>>> START EXTRACTION:");
1819 if (!$zip->extractTo($target)) {
1820 DUPX_Log::error(ERR_ZIPEXTRACTION);
1821 }
1822 $log = print_r($zip, true);
1823
1824 //Keep original timestamp on the file
1825 if ($_POST['archive_filetime'] == 'original') {
1826 $log .= "File timestamp is 'Original' mode.\n";
1827 for ($idx = 0; $s = $zip->statIndex($idx); $idx++) {
1828 touch($target.DIRECTORY_SEPARATOR.$s['name'], $s['mtime']);
1829 }
1830 } else {
1831 $now = date("Y-m-d H:i:s");
1832 $log .= "File timestamp is 'Current' mode: {$now}\n";
1833 }
1834
1835 $close_response = $zip->close();
1836 $log .= "<<< EXTRACTION COMPLETE: " . var_export($close_response, true);
1837 DUPX_Log::info($log);
1838 } else {
1839 DUPX_Log::error(ERR_ZIPOPEN);
1840 }
1841}
1842
1843//===============================
1844//RESET SERVER CONFIG FILES
1845//===============================
1846if ($_POST['retain_config']) {
1847 DUPX_Log::info("\nNOTICE: Manual update of permalinks required see: Admin > Settings > Permalinks > Click Save Changes");
1848 DUPX_Log::info("Retaining the original htaccess, user.ini or web.config files may cause issues with the setup of this site.");
1849 DUPX_Log::info("If you run into issues during or after the install process please uncheck the 'Config Files' checkbox labeled:");
1850 DUPX_Log::info("'Retain original .htaccess, .user.ini and web.config' from Step 1 and re-run the installer. Backups of the");
1851 DUPX_Log::info("orginal config files will be made and can be merged per required directive.");
1852} else {
1853 DUPX_ServerConfig::reset();
1854}
1855
1856
1857//FINAL RESULTS
1858$ajax1_end = DUPX_U::getMicrotime();
1859$ajax1_sum = DUPX_U::elapsedTime($ajax1_end, $ajax1_start);
1860DUPX_Log::info("\nSTEP-1 COMPLETE @ " . @date('h:i:s') . " - RUNTIME: {$ajax1_sum}");
1861
1862
1863$JSON['pass'] = 1;
1864echo json_encode($JSON);
1865error_reporting($ajax1_error_level);
1866die('');
1867?><?php break;
1868
1869 case "2": ?><?php
1870//POST PARAMS
1871$_POST['dbaction'] = isset($_POST['dbaction']) ? $_POST['dbaction'] : 'create';
1872$_POST['dbnbsp'] = (isset($_POST['dbnbsp']) && $_POST['dbnbsp'] == '1') ? true : false;
1873$_POST['ssl_admin'] = (isset($_POST['ssl_admin'])) ? true : false;
1874$_POST['cache_wp'] = (isset($_POST['cache_wp'])) ? true : false;
1875$_POST['cache_path'] = (isset($_POST['cache_path'])) ? true : false;
1876$_POST['archive_name'] = isset($_POST['archive_name']) ? $_POST['archive_name'] : null;
1877$_POST['retain_config'] = (isset($_POST['retain_config']) && $_POST['retain_config'] == '1') ? true : false;
1878$_POST['dbcollatefb'] = isset($_POST['dbcollatefb']) ? $_POST['dbcollatefb'] : false;
1879
1880//LOGGING
1881$POST_LOG = $_POST;
1882unset($POST_LOG['dbpass']);
1883ksort($POST_LOG);
1884
1885//PAGE VARS
1886$date_time = @date('h:i:s');
1887$root_path = DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']);
1888$ajax2_start = DUPX_U::getMicrotime();
1889$JSON = array();
1890$JSON['pass'] = 0;
1891
1892/** JSON RESPONSE: Most sites have warnings turned off by default, but if they're turned on the warnings
1893cause errors in the JSON data Here we hide the status so warning level is reset at it at the end*/
1894$ajax1_error_level = error_reporting();
1895error_reporting(E_ERROR);
1896
1897//====================================================================================================
1898//DATABASE TEST CONNECTION
1899//====================================================================================================
1900if (isset($_GET['dbtest']))
1901{
1902 $html = "";
1903 $baseport = parse_url($_POST['dbhost'], PHP_URL_PORT);
1904 $dbConn = DUPX_DB::connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], null, $_POST['dbport']);
1905 $dbErr = mysqli_connect_error();
1906
1907 $dbFound = mysqli_select_db($dbConn, $_POST['dbname']);
1908 $port_view = (is_int($baseport) || substr($_POST['dbhost'], -1) == ":") ? "Port=[Set in Host]" : "Port={$_POST['dbport']}";
1909
1910 $tstSrv = ($dbConn) ? "<div class='dupx-pass'>Success</div>" : "<div class='dupx-fail'>Fail</div>";
1911 $tstDB = ($dbFound) ? "<div class='dupx-pass'>Success</div>" : "<div class='dupx-fail'>Fail</div>";
1912
1913 $dbversion_info = DUPX_DB::getServerInfo($dbConn);
1914 $dbversion_info = empty($dbversion_info) ? 'no connection' : $dbversion_info;
1915 $dbversion_info_fail = version_compare(DUPX_DB::getVersion($dbConn), '5.5.3') < 0;
1916
1917 $dbversion_compat = DUPX_DB::getVersion($dbConn);
1918 $dbversion_compat = empty($dbversion_compat) ? 'no connection' : $dbversion_compat;
1919 $dbversion_compat_fail = version_compare($dbversion_compat, $GLOBALS['FW_VERSION_DB']) < 0;
1920
1921 $tstInfo = ($dbversion_info_fail)
1922 ? "<div class='dupx-notice'>{$dbversion_info}</div>"
1923 : "<div class='dupx-pass'>{$dbversion_info}</div>";
1924
1925 $tstCompat = ($dbversion_compat_fail)
1926 ? "<div class='dupx-notice'>This Server: [{$dbversion_compat}] -- Package Server: [{$GLOBALS['FW_VERSION_DB']}]</div>"
1927 : "<div class='dupx-pass'>This Server: [{$dbversion_compat}] -- Package Server: [{$GLOBALS['FW_VERSION_DB']}]</div>";
1928
1929 $html .= <<<DATA
1930 <div class='s2-db-test'>
1931 <small>
1932 Using Connection String:<br/>
1933 Host={$_POST['dbhost']}; Database={$_POST['dbname']}; Uid={$_POST['dbuser']}; Pwd={$_POST['dbpass']}; {$port_view}
1934 </small>
1935 <table class='s2-db-test-dtls'>
1936 <tr>
1937 <td>Host:</td>
1938 <td>{$tstSrv}</td>
1939 </tr>
1940 <tr>
1941 <td>Database:</td>
1942 <td>{$tstDB}</td>
1943 </tr>
1944 <tr>
1945 <td>Version:</td>
1946 <td>{$tstInfo}</td>
1947 </tr>
1948 <tr>
1949 <td>Compatibility:</td>
1950 <td>{$tstCompat}</td>
1951 </tr>
1952 </table>
1953DATA;
1954
1955 //--------------------------------
1956 //WARNING: DB has tables with create option
1957 if ($_POST['dbaction'] == 'create')
1958 {
1959 $tblcount = DUPX_DB::countTables($dbConn, $_POST['dbname']);
1960 $html .= ($tblcount > 0)
1961 ? "<div class='warn-msg'><b>WARNING:</b> " . sprintf(ERR_DBEMPTY, $_POST['dbname'], $tblcount) . "</div>"
1962 : '';
1963 }
1964
1965 //WARNNG: Input has utf8
1966 $dbConnItems = array($_POST['dbhost'], $_POST['dbuser'], $_POST['dbname'],$_POST['dbpass']);
1967 $dbUTF8_tst = false;
1968 foreach ($dbConnItems as $value)
1969 {
1970 if (DUPX_U::isNonASCII($value)) {
1971 $dbUTF8_tst = true;
1972 break;
1973 }
1974 }
1975
1976 //WARNING: UTF8 Data in Connection String
1977 $html .= (! $dbConn && $dbUTF8_tst)
1978 ? "<div class='warn-msg'><b>WARNING:</b> " . ERR_TESTDB_UTF8 . "</div>"
1979 : '';
1980
1981 //NOTICE: Version Too Low
1982 $html .= ($dbversion_info_fail)
1983 ? "<div class='warn-msg'><b>NOTICE:</b> " . ERR_TESTDB_VERSION_INFO . "</div>"
1984 : '';
1985
1986 //NOTICE: Version Incompatibility
1987 $html .= ($dbversion_compat_fail)
1988 ? "<div class='warn-msg'><b>NOTICE:</b> " . ERR_TESTDB_VERSION_COMPAT . "</div>"
1989 : '';
1990
1991 $html .= "</div>";
1992 die($html);
1993}
1994
1995//===============================
1996//ERROR MESSAGES
1997//===============================
1998//ERR_MAKELOG
1999($GLOBALS['LOG_FILE_HANDLE'] != false) or DUPX_Log::error(ERR_MAKELOG);
2000
2001//ERR_MYSQLI_SUPPORT
2002function_exists('mysqli_connect') or DUPX_Log::error(ERR_MYSQLI_SUPPORT);
2003
2004//ERR_DBCONNECT
2005$dbh = DUPX_DB::connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], null, $_POST['dbport']);
2006@mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
2007($dbh) or DUPX_Log::error(ERR_DBCONNECT . mysqli_connect_error());
2008if ($_POST['dbaction'] == 'empty') {
2009 mysqli_select_db($dbh, $_POST['dbname']) or DUPX_Log::error(sprintf(ERR_DBCREATE, $_POST['dbname']));
2010}
2011//ERR_DBEMPTY
2012if ($_POST['dbaction'] == 'create' ) {
2013 $tblcount = DUPX_DB::countTables($dbh, $_POST['dbname']);
2014 if ($tblcount > 0) {
2015 DUPX_Log::error(sprintf(ERR_DBEMPTY, $_POST['dbname'], $tblcount));
2016 }
2017}
2018
2019$log = <<<LOG
2020\n\n********************************************************************************
2021* DUPLICATOR-LITE: INSTALL-LOG
2022* STEP-2 START @ {$date_time}
2023* NOTICE: Do NOT post to public sites or forums
2024********************************************************************************
2025LOG;
2026DUPX_Log::info($log);
2027
2028$log = "--------------------------------------\n";
2029$log .= "POST DATA\n";
2030$log .= "--------------------------------------\n";
2031$log .= print_r($POST_LOG, true);
2032DUPX_Log::info($log, 2);
2033
2034
2035//====================================================================================================
2036//DATABASE ROUTINES
2037//====================================================================================================
2038$log = '';
2039$faq_url = $GLOBALS['FAQ_URL'];
2040$utm_prefix = '?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=';
2041$db_file_size = filesize('database.sql');
2042$php_mem = $GLOBALS['PHP_MEMORY_LIMIT'];
2043$php_mem_range = DUPX_U::getBytes($GLOBALS['PHP_MEMORY_LIMIT']);
2044$php_mem_range = $php_mem_range == null ? 0 : $php_mem_range - 5000000; //5 MB Buffer
2045
2046//Fatal Memory errors from file_get_contents is not catchable.
2047//Try to warn ahead of time with a buffer in memory difference
2048if ($db_file_size >= $php_mem_range && $php_mem_range != 0)
2049{
2050 $db_file_size = DUPX_U::readableByteSize($db_file_size);
2051 $msg = "\nWARNING: The database script is '{$db_file_size}' in size. The PHP memory allocation is set\n";
2052 $msg .= "at '{$php_mem}'. There is a high possibility that the installer script will fail with\n";
2053 $msg .= "a memory allocation error when trying to load the database.sql file. It is\n";
2054 $msg .= "recommended to increase the 'memory_limit' setting in the php.ini config file.\n";
2055 $msg .= "see: {$faq_url}{$utm_prefix}inst_step2_lgdbscript#faq-trouble-056-q \n";
2056 DUPX_Log::info($msg);
2057}
2058
2059@chmod("{$root_path}/database.sql", 0777);
2060$sql_file = file_get_contents('database.sql', true);
2061
2062//ERROR: Reading database.sql file
2063if ($sql_file === FALSE || strlen($sql_file) < 10)
2064{
2065 $msg = "<b>Unable to read the database.sql file from the archive. Please check these items:</b> <br/>";
2066 $msg .= "1. Validate permissions and/or group-owner rights on these items: <br/>";
2067 $msg .= " - File: database.sql <br/> - Directory: [{$root_path}] <br/>";
2068 $msg .= "<i>see: <a href='{$faq_url}{$utm_prefix}inst_step2_dbperms#faq-trouble-055-q' target='_blank'>{$faq_url}#faq-trouble-055-q</a></i> <br/>";
2069 $msg .= "2. Validate the database.sql file exists and is in the root of the archive.zip file <br/>";
2070 $msg .= "<i>see: <a href='{$faq_url}{$utm_prefix}inst_step2_sqlroot#faq-installer-020-q' target='_blank'>{$faq_url}#faq-installer-020-q</a></i> <br/>";
2071 DUPX_Log::error($msg);
2072}
2073
2074//Removes invalid space characters
2075//Complex Subject See: http://webcollab.sourceforge.net/unicode.html
2076if ($_POST['dbnbsp'])
2077{
2078 DUPX_Log::info("NOTICE: Ran fix non-breaking space characters\n");
2079 $sql_file = preg_replace('/\xC2\xA0/', ' ', $sql_file);
2080}
2081
2082//Write new contents to install-data.sql
2083$sql_file_copy_status = file_put_contents($GLOBALS['SQL_FILE_NAME'], $sql_file);
2084$sql_result_file_data = explode(";\n", $sql_file);
2085$sql_result_file_length = count($sql_result_file_data);
2086$sql_result_file_path = "{$root_path}/{$GLOBALS['SQL_FILE_NAME']}";
2087$sql_file = null;
2088$db_collatefb_log = '';
2089
2090if($_POST['dbcollatefb']){
2091 $supportedCollations = DUPX_DB::getSupportedCollationsList($dbh);
2092 $collation_arr = array(
2093 'utf8mb4_unicode_520_ci',
2094 'utf8mb4_unicode_520',
2095 'utf8mb4_unicode_ci',
2096 'utf8mb4',
2097 'utf8_unicode_520_ci',
2098 'utf8_unicode_520',
2099 'utf8_unicode_ci',
2100 'utf8'
2101 );
2102 $latest_supported_collation = '';
2103 $latest_supported_index = -1;
2104
2105 foreach ($collation_arr as $key => $val){
2106 if(in_array($val,$supportedCollations)){
2107 $latest_supported_collation = $val;
2108 $latest_supported_index = $key;
2109 break;
2110 }
2111 }
2112
2113 //No need to replace if current DB is up to date
2114 if($latest_supported_index != 0){
2115 for($i=0; $i < $latest_supported_index; $i++){
2116 foreach ($sql_result_file_data as $index => $col_sql_query){
2117 if(strpos($col_sql_query,$collation_arr[$i]) !== false){
2118 $sql_result_file_data[$index] = str_replace($collation_arr[$i], $latest_supported_collation, $col_sql_query);
2119 if(strpos($collation_arr[$i],'utf8mb4') !== false && strpos($latest_supported_collation,'utf8mb4') === false){
2120 $sql_result_file_data[$index] = str_replace('utf8mb4','utf8',$sql_result_file_data[$index]);
2121 }
2122 $sub_query = str_replace("\n", '', substr($col_sql_query, 0, 75));
2123 $db_collatefb_log .= " - Collation '{$collation_arr[$i]}' set to '{$latest_supported_collation}' on query [{$sub_query}...]\n";
2124 }
2125 }
2126 }
2127 }
2128}
2129
2130//WARNING: Create installer-data.sql failed
2131if ($sql_file_copy_status === FALSE || filesize($sql_result_file_path) == 0 || !is_readable($sql_result_file_path))
2132{
2133 $sql_file_size = DUPX_U::readableByteSize(filesize('database.sql'));
2134 $msg = "\nWARNING: Unable to properly copy database.sql ({$sql_file_size}) to {$GLOBALS['SQL_FILE_NAME']}. Please check these items:\n";
2135 $msg .= "- Validate permissions and/or group-owner rights on database.sql and directory [{$root_path}] \n";
2136 $msg .= "- see: {$faq_url}{$utm_prefix}inst_step2_copydbsql#faq-trouble-055-q \n";
2137 DUPX_Log::info($msg);
2138}
2139
2140//=================================
2141//START DB RUN
2142@mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
2143@mysqli_query($dbh, "SET max_allowed_packet = {$GLOBALS['DB_MAX_PACKETS']}");
2144DUPX_DB::setCharset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
2145
2146//Will set mode to null only for this db handle session
2147//sql_mode can cause db create issues on some systems
2148$qry_session_custom = true;
2149switch ($_POST['dbmysqlmode']) {
2150 case 'DISABLE':
2151 @mysqli_query($dbh, "SET SESSION sql_mode = ''");
2152 break;
2153 case 'CUSTOM':
2154 $dbmysqlmode_opts = $_POST['dbmysqlmode_opts'];
2155 $qry_session_custom = @mysqli_query($dbh, "SET SESSION sql_mode = '{$dbmysqlmode_opts}'");
2156 if ($qry_session_custom == false) {
2157 $sql_error = mysqli_error($dbh);
2158 $log = "WARNING: Trying to set a custom sql_mode setting issue has been detected:\n{$sql_error}.\n";
2159 $log .= "For more details visit: http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html\n";
2160 }
2161 break;
2162}
2163
2164//Set defaults in-case the variable could not be read
2165$dbvar_maxtime = DUPX_DB::getVariable($dbh, 'wait_timeout');
2166$dbvar_maxpacks = DUPX_DB::getVariable($dbh, 'max_allowed_packet');
2167$dbvar_sqlmode = DUPX_DB::getVariable($dbh, 'sql_mode');
2168$dbvar_maxtime = is_null($dbvar_maxtime) ? 300 : $dbvar_maxtime;
2169$dbvar_maxpacks = is_null($dbvar_maxpacks) ? 1048576 : $dbvar_maxpacks;
2170$dbvar_sqlmode = empty($dbvar_sqlmode) ? 'NOT_SET' : $dbvar_sqlmode;
2171$dbvar_version = DUPX_DB::getVersion($dbh);
2172$sql_file_size1 = DUPX_U::readableByteSize(@filesize("database.sql"));
2173$sql_file_size2 = DUPX_U::readableByteSize(@filesize("{$GLOBALS['SQL_FILE_NAME']}"));
2174$db_collatefb = isset($_POST['dbcollatefb']) ? 'On' : 'Off';
2175
2176
2177DUPX_Log::info("--------------------------------------");
2178DUPX_Log::info("DATABASE ENVIRONMENT");
2179DUPX_Log::info("--------------------------------------");
2180DUPX_Log::info("MYSQL VERSION:\tThis Server: {$dbvar_version} -- Build Server: {$GLOBALS['FW_VERSION_DB']}");
2181DUPX_Log::info("FILE SIZE:\tdatabase.sql ({$sql_file_size1}) - installer-data.sql ({$sql_file_size2})");
2182DUPX_Log::info("TIMEOUT:\t{$dbvar_maxtime}");
2183DUPX_Log::info("MAXPACK:\t{$dbvar_maxpacks}");
2184DUPX_Log::info("SQLMODE:\t{$dbvar_sqlmode}");
2185DUPX_Log::info("NEW SQL FILE:\t[{$sql_result_file_path}]");
2186DUPX_Log::info("COLLATE RESET:\t{$db_collatefb}\n{$db_collatefb_log}");
2187
2188if ($qry_session_custom == false) {
2189 DUPX_Log::info("\n{$log}\n");
2190}
2191
2192//CREATE DB
2193switch ($_POST['dbaction']) {
2194 case "create":
2195 mysqli_query($dbh, "CREATE DATABASE IF NOT EXISTS `{$_POST['dbname']}`");
2196 mysqli_select_db($dbh, $_POST['dbname'])
2197 or DUPX_Log::error(sprintf(ERR_DBCONNECT_CREATE, $_POST['dbname']));
2198 break;
2199 case "empty":
2200 //DROP DB TABLES
2201 $drop_log = "Database already empty. Ready for install.";
2202 $sql = "SHOW FULL TABLES WHERE Table_Type != 'VIEW'";
2203 $found_tables = null;
2204 if ($result = mysqli_query($dbh, $sql)) {
2205 while ($row = mysqli_fetch_row($result)) {
2206 $found_tables[] = $row[0];
2207 }
2208 if (count($found_tables) > 0) {
2209 foreach ($found_tables as $table_name) {
2210 $sql = "DROP TABLE `{$_POST['dbname']}`.`{$table_name}`";
2211 if (!$result = mysqli_query($dbh, $sql)) {
2212 DUPX_Log::error(sprintf(ERR_DBTRYCLEAN, $_POST['dbname']));
2213 }
2214 }
2215 }
2216 $drop_log = count($found_tables);
2217 }
2218 break;
2219}
2220
2221
2222//WRITE DATA
2223DUPX_Log::info("--------------------------------------");
2224DUPX_Log::info("DATABASE RESULTS");
2225DUPX_Log::info("--------------------------------------");
2226$profile_start = DUPX_U::getMicrotime();
2227$fcgi_buffer_pool = 5000;
2228$fcgi_buffer_count = 0;
2229$dbquery_rows = 0;
2230$dbtable_rows = 1;
2231$dbquery_errs = 0;
2232$counter = 0;
2233@mysqli_autocommit($dbh, false);
2234
2235while ($counter < $sql_result_file_length) {
2236
2237 $query_strlen = strlen(trim($sql_result_file_data[$counter]));
2238
2239 if ($dbvar_maxpacks < $query_strlen) {
2240
2241 DUPX_Log::info("**ERROR** Query size limit [length={$query_strlen}] [sql=" . substr($sql_result_file_data[$counter], 0, 75) . "...]");
2242 $dbquery_errs++;
2243
2244 } elseif ($query_strlen > 0) {
2245
2246 @mysqli_free_result(@mysqli_query($dbh, ($sql_result_file_data[$counter])));
2247 $err = mysqli_error($dbh);
2248
2249 //Check to make sure the connection is alive
2250 if (!empty($err)) {
2251
2252 if (!mysqli_ping($dbh)) {
2253 mysqli_close($dbh);
2254 $dbh = DUPX_DB::connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname'], $_POST['dbport'] );
2255 // Reset session setup
2256 @mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
2257 DUPX_DB::setCharset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
2258 }
2259 DUPX_Log::info("**ERROR** database error write '{$err}' - [sql=" . substr($sql_result_file_data[$counter], 0, 75) . "...]");
2260 $dbquery_errs++;
2261
2262 //Buffer data to browser to keep connection open
2263 } else {
2264 if ($GLOBALS['DB_FCGI_FLUSH'] && $fcgi_buffer_count++ > $fcgi_buffer_pool) {
2265 $fcgi_buffer_count = 0;
2266 DUPX_U::fcgiFlush();
2267 }
2268 $dbquery_rows++;
2269 }
2270 }
2271 $counter++;
2272}
2273@mysqli_commit($dbh);
2274@mysqli_autocommit($dbh, true);
2275
2276DUPX_Log::info("ERRORS FOUND:\t{$dbquery_errs}");
2277DUPX_Log::info("TABLES DROPPED:\t{$drop_log}");
2278DUPX_Log::info("QUERIES RAN:\t{$dbquery_rows}\n");
2279
2280$dbtable_count = 0;
2281if ($result = mysqli_query($dbh, "SHOW TABLES")) {
2282 while ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {
2283 $table_rows = DUPX_DB::countTableRows($dbh, $row[0]);
2284 $dbtable_rows += $table_rows;
2285 DUPX_Log::info("{$row[0]}: ({$table_rows})");
2286 $dbtable_count++;
2287 }
2288 @mysqli_free_result($result);
2289}
2290
2291if ($dbtable_count == 0) {
2292 DUPX_Log::error("No tables where created during step 2 of the install. Please review the <a href='installer-log.txt' target='install_log'>installer-log.txt</a> file for
2293 ERROR messages. You may have to manually run the installer-data.sql with a tool like phpmyadmin to validate the data input. If you have enabled compatibility mode
2294 during the package creation process then the database server version your using may not be compatible with this script.\n");
2295}
2296
2297
2298//DATA CLEANUP: Perform Transient Cache Cleanup
2299//Remove all duplicator entries and record this one since this is a new install.
2300$dbdelete_count = 0;
2301@mysqli_query($dbh, "DELETE FROM `{$GLOBALS['FW_TABLEPREFIX']}duplicator_packages`");
2302$dbdelete_count1 = @mysqli_affected_rows($dbh) or 0;
2303@mysqli_query($dbh, "DELETE FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE `option_name` LIKE ('_transient%') OR `option_name` LIKE ('_site_transient%')");
2304$dbdelete_count2 = @mysqli_affected_rows($dbh) or 0;
2305$dbdelete_count = (abs($dbdelete_count1) + abs($dbdelete_count2));
2306DUPX_Log::info("\nRemoved '{$dbdelete_count}' cache/transient rows");
2307//Reset Duplicator Options
2308foreach ($GLOBALS['FW_OPTS_DELETE'] as $value) {
2309 mysqli_query($dbh, "DELETE FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE `option_name` = '{$value}'");
2310}
2311
2312@mysqli_close($dbh);
2313
2314//FINAL RESULTS
2315$profile_end = DUPX_U::getMicrotime();
2316$ajax2_end = DUPX_U::getMicrotime();
2317$ajax1_sum = DUPX_U::elapsedTime($ajax2_end, $ajax2_start);
2318DUPX_Log::info("\nCREATE/INSTALL RUNTIME: " . DUPX_U::elapsedTime($profile_end, $profile_start));
2319DUPX_Log::info('STEP-2 COMPLETE @ ' . @date('h:i:s') . " - RUNTIME: {$ajax1_sum}");
2320
2321$JSON['pass'] = 1;
2322$JSON['table_count'] = $dbtable_count;
2323$JSON['table_rows'] = $dbtable_rows;
2324$JSON['query_errs'] = $dbquery_errs;
2325echo json_encode($JSON);
2326error_reporting($ajax1_error_level);
2327die('');
2328?><?php break;
2329
2330 case "3": ?><?php
2331// Exit if accessed directly from admin
2332if (function_exists('duplicator_secure_check')) {
2333 duplicator_secure_check();
2334}
2335
2336/** JSON RESPONSE: Most sites have warnings turned off by default, but if they're turned on the warnings
2337cause errors in the JSON data Here we hide the status so warning level is reset at it at the end*/
2338$ajax2_error_level = error_reporting();
2339error_reporting(E_ERROR);
2340
2341//====================================================================================================
2342//DATABASE UPDATES
2343//====================================================================================================
2344
2345$ajax2_start = DUPX_U::getMicrotime();
2346
2347//MYSQL CONNECTION
2348$dbh = DUPX_DB::connect($_POST['dbhost'], $_POST['dbuser'], html_entity_decode($_POST['dbpass']), $_POST['dbname'], $_POST['dbport']);
2349$charset_server = @mysqli_character_set_name($dbh);
2350@mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
2351DUPX_DB::setCharset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
2352
2353//POST PARAMS
2354$_POST['blogname'] = mysqli_real_escape_string($dbh, $_POST['blogname']);
2355$_POST['postguid'] = isset($_POST['postguid']) && $_POST['postguid'] == 1 ? 1 : 0;
2356$_POST['fullsearch'] = isset($_POST['fullsearch']) && $_POST['fullsearch'] == 1 ? 1 : 0;
2357$_POST['path_old'] = isset($_POST['path_old']) ? trim($_POST['path_old']) : null;
2358$_POST['path_new'] = isset($_POST['path_new']) ? trim($_POST['path_new']) : null;
2359$_POST['siteurl'] = isset($_POST['siteurl']) ? rtrim(trim($_POST['siteurl']), '/') : null;
2360$_POST['tables'] = isset($_POST['tables']) && is_array($_POST['tables']) ? array_map('stripcslashes', $_POST['tables']) : array();
2361$_POST['url_old'] = isset($_POST['url_old']) ? trim($_POST['url_old']) : null;
2362$_POST['url_new'] = isset($_POST['url_new']) ? rtrim(trim($_POST['url_new']), '/') : null;
2363$_POST['retain_config'] = (isset($_POST['retain_config']) && $_POST['retain_config'] == '1') ? true : false;
2364$_POST['exe_safe_mode'] = isset($_POST['exe_safe_mode']) ? $_POST['exe_safe_mode'] : 0;
2365//LOGGING
2366$POST_LOG = $_POST;
2367unset($POST_LOG['tables']);
2368unset($POST_LOG['plugins']);
2369unset($POST_LOG['dbpass']);
2370ksort($POST_LOG);
2371
2372$date = @date('h:i:s');
2373$charset_client = @mysqli_character_set_name($dbh);
2374
2375$log = <<<LOG
2376\n\n********************************************************************************
2377* DUPLICATOR-LITE: INSTALL-LOG
2378* STEP-3 START @ {$date}
2379* NOTICE: Do NOT post to public sites or forums
2380********************************************************************************
2381CHARSET SERVER:\t{$charset_server}
2382CHARSET CLIENT:\t{$charset_client}
2383LOG;
2384DUPX_Log::info($log);
2385
2386//Detailed logging
2387$log = "--------------------------------------\n";
2388$log .= "POST DATA\n";
2389$log .= "--------------------------------------\n";
2390$log .= print_r($POST_LOG, true);
2391$log .= "--------------------------------------\n";
2392$log .= "SCANNED TABLES\n";
2393$log .= "--------------------------------------\n";
2394$log .= (isset($_POST['tables']) && count($_POST['tables'] > 0))
2395 ? print_r($_POST['tables'], true)
2396 : 'No tables selected to update';
2397$log .= "--------------------------------------\n";
2398$log .= "KEEP PLUGINS ACTIVE\n";
2399$log .= "--------------------------------------\n";
2400$log .= (isset($_POST['plugins']) && count($_POST['plugins'] > 0))
2401 ? print_r($_POST['plugins'], true)
2402 : 'No plugins selected for activation';
2403DUPX_Log::info($log, 2);
2404
2405//UPDATE SETTINGS
2406$blog_name = $_POST['blogname'];
2407$plugin_list = (isset($_POST['plugins'])) ? $_POST['plugins'] : array();
2408// Force Duplicator active so we the security cleanup will be available
2409if (!in_array('duplicator/duplicator.php', $plugin_list)) {
2410 $plugin_list[] = 'duplicator/duplicator.php';
2411}
2412$serial_plugin_list = @serialize($plugin_list);
2413
2414mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$blog_name}' WHERE option_name = 'blogname' ");
2415mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$serial_plugin_list}' WHERE option_name = 'active_plugins' ");
2416
2417$log = "--------------------------------------\n";
2418$log .= "SERIALIZER ENGINE\n";
2419$log .= "[*] scan every column\n";
2420$log .= "[~] scan only text columns\n";
2421$log .= "[^] no searchable columns\n";
2422$log .= "--------------------------------------";
2423DUPX_Log::info($log);
2424
2425$url_old_json = str_replace('"', "", json_encode($_POST['url_old']));
2426$url_new_json = str_replace('"', "", json_encode($_POST['url_new']));
2427$path_old_json = str_replace('"', "", json_encode($_POST['path_old']));
2428$path_new_json = str_replace('"', "", json_encode($_POST['path_new']));
2429
2430//DIRS PATHS
2431array_push($GLOBALS['REPLACE_LIST'],
2432 array('search' => $_POST['path_old'], 'replace' => $_POST['path_new']),
2433 array('search' => $path_old_json, 'replace' => $path_new_json),
2434 array('search' => urlencode($_POST['path_old']), 'replace' => urlencode($_POST['path_new'])),
2435 array('search' => rtrim(DUPX_U::unsetSafePath($_POST['path_old']), '\\'), 'replace' => rtrim($_POST['path_new'], '/'))
2436);
2437
2438
2439//SEARCH WITH NO PROTOCAL: RAW "//"
2440$url_old_raw = str_ireplace(array('http://', 'https://'), '//', $_POST['url_old']);
2441$url_new_raw = str_ireplace(array('http://', 'https://'), '//', $_POST['url_new']);
2442$url_old_raw_json = str_replace('"', "", json_encode($url_old_raw));
2443$url_new_raw_json = str_replace('"', "", json_encode($url_new_raw));
2444array_push($GLOBALS['REPLACE_LIST'],
2445 //RAW
2446 array('search' => $url_old_raw, 'replace' => $url_new_raw),
2447 array('search' => $url_old_raw_json, 'replace' => $url_new_raw_json),
2448 array('search' => urlencode($url_old_raw), 'replace' => urlencode($url_new_raw))
2449);
2450
2451
2452//SEARCH HTTP(S) EXPLICIT REQUEST
2453//Because the raw replace above has already changed all urls just fix https/http issue
2454//if the user has explicitly asked other-wise word boundary issues will occur:
2455//Old site: http://mydomain.com/somename/
2456//New site: http://mydomain.com/somename-dup/
2457//Result: http://mydomain.com/somename-dup-dup/
2458if (stristr($_POST['url_old'], 'http:') && stristr($_POST['url_new'], 'https:') ) {
2459 $url_old_http = str_ireplace('https:', 'http:', $_POST['url_new']);
2460 $url_new_http = $_POST['url_new'];
2461 $url_old_http_json = str_replace('"', "", json_encode($url_old_http));
2462 $url_new_http_json = str_replace('"', "", json_encode($url_new_http));
2463
2464} elseif(stristr($_POST['url_old'], 'https:') && stristr($_POST['url_new'], 'http:')) {
2465 $url_old_http = str_ireplace('http:', 'https:', $_POST['url_new']);
2466 $url_new_http = $_POST['url_new'];
2467 $url_old_http_json = str_replace('"', "", json_encode($url_old_http));
2468 $url_new_http_json = str_replace('"', "", json_encode($url_new_http));
2469}
2470if(isset($url_old_http)){
2471 array_push($GLOBALS['REPLACE_LIST'],
2472 array('search' => $url_old_http, 'replace' => $url_new_http),
2473 array('search' => $url_old_http_json, 'replace' => $url_new_http_json),
2474 array('search' => urlencode($url_old_http), 'replace' => urlencode($url_new_http))
2475 );
2476}
2477
2478//Remove trailing slashes
2479function _dupx_array_rtrim(&$value) {
2480 $value = rtrim($value, '\/');
2481}
2482array_walk_recursive($GLOBALS['REPLACE_LIST'], _dupx_array_rtrim);
2483
2484@mysqli_autocommit($dbh, false);
2485$report = DUPX_UpdateEngine::load($dbh, $GLOBALS['REPLACE_LIST'], $_POST['tables'], $_POST['fullsearch']);
2486@mysqli_commit($dbh);
2487@mysqli_autocommit($dbh, true);
2488
2489
2490//BUILD JSON RESPONSE
2491$JSON = array();
2492$JSON['step2'] = json_decode(urldecode($_POST['json']));
2493$JSON['step3'] = $report;
2494$JSON['step3']['warn_all'] = 0;
2495$JSON['step3']['warnlist'] = array();
2496
2497DUPX_UpdateEngine::logStats($report);
2498DUPX_UpdateEngine::logErrors($report);
2499
2500//Reset the postguid data
2501if ($_POST['postguid']) {
2502 mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}posts` SET guid = REPLACE(guid, '{$_POST['url_new']}', '{$_POST['url_old']}')");
2503 $update_guid = @mysqli_affected_rows($dbh) or 0;
2504 DUPX_Log::info("Reverted '{$update_guid}' post guid columns back to '{$_POST['url_old']}'");
2505}
2506
2507/** FINAL UPDATES: Must happen after the global replace to prevent double pathing
2508 http://xyz.com/abc01 will become http://xyz.com/abc0101 with trailing data */
2509mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['url_new']}' WHERE option_name = 'home' ");
2510mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['siteurl']}' WHERE option_name = 'siteurl' ");
2511mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}options` (option_value, option_name) VALUES('{$_POST['exe_safe_mode']}','duplicator_exe_safe_mode')");
2512//===============================================
2513//CONFIGURATION FILE UPDATES
2514//===============================================
2515DUPX_Log::info("\n====================================");
2516DUPX_Log::info('CONFIGURATION FILE UPDATES:');
2517DUPX_Log::info("====================================\n");
2518DUPX_WPConfig::updateStandard();
2519$config_file = DUPX_WPConfig::updateExtended();
2520DUPX_Log::info("UPDATED WP-CONFIG: {$root_path}/wp-config.php' (if present)");
2521
2522//Web Server Config Updates
2523if (!isset($_POST['url_new']) || $_POST['retain_config']) {
2524 DUPX_Log::info("\nNOTICE: Manual update of permalinks required see: Admin > Settings > Permalinks > Click Save Changes");
2525 DUPX_Log::info("Retaining the original htaccess, user.ini or web.config files may cause issues with the setup of this site.");
2526 DUPX_Log::info("If you run into issues during or after the install process please uncheck the 'Config Files' checkbox labeled:");
2527 DUPX_Log::info("'Retain original .htaccess, .user.ini and web.config' from Step 1 and re-run the installer. Backups of the");
2528 DUPX_Log::info("orginal config files will be made and can be merged per required directive.");
2529} else {
2530 DUPX_ServerConfig::setup($dbh);
2531}
2532
2533
2534//===============================================
2535//GENERAL UPDATES & CLEANUP
2536//===============================================
2537DUPX_Log::info("\n====================================");
2538DUPX_Log::info('GENERAL UPDATES & CLEANUP:');
2539DUPX_Log::info("====================================\n");
2540
2541/** CREATE NEW USER LOGIC */
2542if (strlen($_POST['wp_username']) >= 4 && strlen($_POST['wp_password']) >= 6) {
2543
2544 $newuser_check = mysqli_query($dbh, "SELECT COUNT(*) AS count FROM `{$GLOBALS['FW_TABLEPREFIX']}users` WHERE user_login = '{$_POST['wp_username']}' ");
2545 $newuser_row = mysqli_fetch_row($newuser_check);
2546 $newuser_count = is_null($newuser_row) ? 0 : $newuser_row[0];
2547
2548 if ($newuser_count == 0) {
2549
2550 $newuser_datetime = @date("Y-m-d H:i:s");
2551 $newuser_security = mysqli_real_escape_string($dbh, 'a:1:{s:13:"administrator";s:1:"1";}');
2552
2553 $newuser_test1 = @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}users`
2554 (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_registered`, `user_activation_key`, `user_status`, `display_name`)
2555 VALUES ('{$_POST['wp_username']}', MD5('{$_POST['wp_password']}'), '{$_POST['wp_username']}', '', '{$newuser_datetime}', '', '0', '{$_POST['wp_username']}')");
2556
2557 $newuser_insert_id = mysqli_insert_id($dbh);
2558
2559 $newuser_test2 = @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta`
2560 (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', '{$GLOBALS['FW_TABLEPREFIX']}capabilities', '{$newuser_security}')");
2561
2562 $newuser_test3 = @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta`
2563 (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', '{$GLOBALS['FW_TABLEPREFIX']}user_level', '10')");
2564
2565 //Misc Meta-Data Settings:
2566 @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', 'rich_editing', 'true')");
2567 @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', 'admin_color', 'fresh')");
2568 @mysqli_query($dbh, "INSERT INTO `{$GLOBALS['FW_TABLEPREFIX']}usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES ('{$newuser_insert_id}', 'nickname', '{$_POST['wp_username']}')");
2569
2570 if ($newuser_test1 && $newuser_test2 && $newuser_test3) {
2571 DUPX_Log::info("NEW WP-ADMIN USER: New username '{$_POST['wp_username']}' was created successfully \n ");
2572 } else {
2573 $newuser_warnmsg = "NEW WP-ADMIN USER: Failed to create the user '{$_POST['wp_username']}' \n ";
2574 $JSON['step3']['warnlist'][] = $newuser_warnmsg;
2575 DUPX_Log::info($newuser_warnmsg);
2576 }
2577 }
2578 else {
2579 $newuser_warnmsg = "NEW WP-ADMIN USER: Username '{$_POST['wp_username']}' already exists in the database. Unable to create new account \n";
2580 $JSON['step3']['warnlist'][] = $newuser_warnmsg;
2581 DUPX_Log::info($newuser_warnmsg);
2582 }
2583}
2584
2585/** ==============================
2586 * MU Updates*/
2587$mu_newDomain = parse_url($_POST['url_new']);
2588$mu_oldDomain = parse_url($_POST['url_old']);
2589$mu_newDomainHost = $mu_newDomain['host'];
2590$mu_oldDomainHost = $mu_oldDomain['host'];
2591$mu_newUrlPath = parse_url($_POST['url_new'], PHP_URL_PATH);
2592$mu_oldUrlPath = parse_url($_POST['url_old'], PHP_URL_PATH);
2593
2594//Force a path for PATH_CURRENT_SITE
2595$mu_newUrlPath = (empty($mu_newUrlPath) || ($mu_newUrlPath == '/')) ? '/' : rtrim($mu_newUrlPath, '/') . '/';
2596$mu_oldUrlPath = (empty($mu_oldUrlPath) || ($mu_oldUrlPath == '/')) ? '/' : rtrim($mu_oldUrlPath, '/') . '/';
2597
2598$mu_updates = @mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}blogs` SET domain = '{$mu_newDomainHost}' WHERE domain = '{$mu_oldDomainHost}'");
2599if ($mu_updates) {
2600 DUPX_Log::info("Update MU table blogs: domain {$mu_newDomainHost} ");
2601 DUPX_Log::info("UPDATE `{$GLOBALS['FW_TABLEPREFIX']}blogs` SET domain = '{$mu_newDomainHost}' WHERE domain = '{$mu_oldDomainHost}'");
2602}
2603
2604
2605//Create snapshots directory in order to
2606//compensate for permissions on some servers
2607if (!file_exists(DUPLICATOR_SSDIR_NAME)) {
2608 mkdir(DUPLICATOR_SSDIR_NAME, 0755);
2609 DUPX_Log::info("- Created directory ". DUPLICATOR_SSDIR_NAME);
2610}
2611$fp = fopen(DUPLICATOR_SSDIR_NAME . '/index.php', 'w');
2612fclose($fp);
2613DUPX_Log::info("- Created file ". DUPLICATOR_SSDIR_NAME . '/index.php');
2614
2615
2616
2617//===============================================
2618//NOTICES TESTS
2619//===============================================
2620DUPX_Log::info("\n====================================");
2621DUPX_Log::info("NOTICES");
2622DUPX_Log::info("====================================\n");
2623$config_vars = array('WPCACHEHOME', 'COOKIE_DOMAIN', 'WP_SITEURL', 'WP_HOME', 'WP_TEMP_DIR');
2624$config_found = DUPX_U::getListValues($config_vars, $config_file);
2625
2626//Config File:
2627if (! empty($config_found)) {
2628 $msg = "NOTICE: The wp-config.php has the following values set [" . implode(", ", $config_found) . "]. \n";
2629 $msg .= 'Please validate these values are correct in your wp-config.php file. See the codex link for more details: https://codex.wordpress.org/Editing_wp-config.php';
2630 $JSON['step3']['warnlist'][] = $msg;
2631 DUPX_Log::info($msg);
2632}
2633
2634//Database:
2635$result = @mysqli_query($dbh, "SELECT option_value FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE option_name IN ('upload_url_path','upload_path')");
2636if ($result) {
2637 while ($row = mysqli_fetch_row($result)) {
2638 if (strlen($row[0])) {
2639 $msg = "NOTICE: The media settings values in the table '{$GLOBALS['FW_TABLEPREFIX']}options' has at least one the following values ['upload_url_path','upload_path'] set. \n";
2640 $msg .= "Please validate these settings by logging into your wp-admin and going to Settings->Media area and validating the 'Uploading Files' section";
2641 $JSON['step3']['warnlist'][] = $msg;
2642 DUPX_Log::info($msg);
2643 break;
2644 }
2645 }
2646}
2647
2648if (empty($JSON['step3']['warnlist'])) {
2649 DUPX_Log::info("No Notices Found\n");
2650}
2651
2652$JSON['step3']['warn_all'] = empty($JSON['step3']['warnlist']) ? 0 : count($JSON['step3']['warnlist']);
2653
2654mysqli_close($dbh);
2655
2656
2657
2658$ajax2_end = DUPX_U::getMicrotime();
2659$ajax2_sum = DUPX_U::elapsedTime($ajax2_end, $ajax2_start);
2660DUPX_Log::info("\nSTEP 3 COMPLETE @ " . @date('h:i:s') . " - RUNTIME: {$ajax2_sum}\n\n");
2661
2662$JSON['step3']['pass'] = 1;
2663error_reporting($ajax2_error_level);
2664die(json_encode($JSON));
2665?><?php break;
2666
2667 endswitch;
2668
2669 @fclose($GLOBALS["LOG_FILE_HANDLE"]);
2670 die("");
2671
2672endif;
2673?>
2674
2675
2676<!DOCTYPE html>
2677<html>
2678<head>
2679 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2680 <meta name="robots" content="noindex,nofollow">
2681 <title>Duplicator</title>
2682 <?php
2683 // Exit if accessed directly
2684 if (! defined('DUPLICATOR_INIT')) {
2685 $_baseURL = "http://" . strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
2686 header("HTTP/1.1 301 Moved Permanently");
2687 header("Location: $_baseURL");
2688 exit;
2689 }
2690?>
2691<?php if( DUPX_U::isURLActive("ajax.googleapis.com", 443) ): ?>
2692 <link rel='stylesheet' href='//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css' type='text/css' media='all' />
2693<?php else: ?>
2694 <style type="text/css">
2695 /*! jQuery UI - v1.11.2 - 2014-12-20
2696 * http://jqueryui.com
2697 * Includes: core.css, progressbar.css, theme.css
2698 * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
2699 * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
2700
2701 .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
2702 </style>
2703<?php endif; ?>
2704
2705
2706<style type="text/css">
2707/*! * CSS Modal
2708 * Copyright (c) 2015 CreativeDream
2709 * Website https://github.com/CreativeDream/jquery.modal
2710 * Version: 1.2.3 (10-04-2015)
2711*/
2712#modal-window{background-color:rgba(0,0,0,.35)}#modal-window>*{margin:0;padding:0;border:0;font:inherit;line-height:normal;vertical-align:baseline}#modal-window .modal-box{position:absolute;margin-bottom:10px;top:40%!important;background-color:#fff;font-family:sans-serif;color:#444;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;-webkit-box-shadow:0 0 7px rgba(0,0,0,.3);-moz-box-shadow:0 0 7px rgba(0,0,0,.3);box-shadow:0 0 7px rgba(0,0,0,.3);outline:0;overflow:hidden}#modal-window .modal-box.modal-size-normal{width:560px}#modal-window .modal-box.modal-size-small{width:350px}#modal-window .modal-box.modal-size-large{width:1000px}@media only screen and (max-width :580px){#modal-window .modal-box.modal-size-normal{width:96%;left:0!important;margin-left:2%!important;margin-right:2%}}@media only screen and (max-width :1020px){#modal-window .modal-box.modal-size-large{width:96%;left:0!important;margin-left:2%!important;margin-right:2%}}@media only screen and (max-width :370px){#modal-window .modal-box.modal-size-small{width:96%;left:0!important;margin-left:2%!important;margin-right:2%}}#modal-window .modal-box .modal-title{position:relative;padding:12px 15px;border-bottom:1px solid #e5e5e5;font-size:20px;overflow:hidden}#modal-window .modal-box .modal-title h3{font-size:20px;font-weight:400;line-height:normal;display:inline-block;margin:0;padding:0}#modal-window .modal-box .modal-title .modal-close-btn{position:absolute;display:block;width:14px;height:14px;right:20px;top:50%;margin-top:-7px;cursor:pointer;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpGNzdGMTE3NDA3MjA2ODExOEMxNDkyODc0N0NBMUEwNCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3N0ZBOTUxNzNERkIxMUUyQUZGMEFDRjY0RjNFODlDOCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3N0ZBOTUxNjNERkIxMUUyQUZGMEFDRjY0RjNFODlDOCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkY3N0YxMTc0MDcyMDY4MTE4MDgzRkQyMTE2MTM0QUNBIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkY3N0YxMTc0MDcyMDY4MTE4QzE0OTI4NzQ3Q0ExQTA0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+5Ke+4QAAAMlJREFUeNqkk90KwyAMha0dvp/ghfthsFcb67YLYe83EBdZlCxL3KCFU0nM+WqjTqUUs+bZ1Nd2d6jDDDqDHqCk1AeQBx1B+Xa9vAFovmNBwFwSzAvIoWKFWJxciNGxmJtp3FeQMDkziCEfcCTObYUUEPE3JAg3xwawZKJBMsm5kZkDNIhqlgC0+J/cFyAIDTOD3fkABKXbeQSxP8xRaWyHNIAfdFvbHU8BJ9JdqdscktDTD9ITtCcnTLpMDRLwMlWPmdZe55cAAwD+1kOdnSr5eQAAAABJRU5ErkJggg==) center no-repeat;background-size:14px,14px;opacity:.5;filter:alpha(opacity=50)}#modal-window .modal-box .modal-title .modal-close-btn:hover{opacity:1;filter:alpha(opacity=100)}#modal-window .modal-box .modal-text{font-size:14px;padding:18px 15px;overflow-y:auto}#modal-window .modal-box img{height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#modal-window .modal-box .modal-text input.modal-prompt-input{width:97%;width:-webkit-calc(100% - 14px);width:-moz-calc(100% - 14px);width:calc(100% - 14px);display:block;outline:0;border:1px solid #ddd;border-top:1px solid #ccc;margin:10px 0;padding:6px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 0 2px #eee;-moz-box-shadow:inset 0 0 2px #eee;box-shadow:inset 0 0 2px #eee;-webkit-transition:all .1s linear;transition:all .1s linear}#modal-window .modal-box .modal-text input.modal-prompt-input:hover{border:1px solid #bbb;border-top:1px solid #aaa}#modal-window .modal-box .modal-text input.modal-prompt-input:active,#modal-window .modal-box .modal-text input.modal-prompt-input:focus{border-color:rgba(82,168,236,.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.3);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.3);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.3)}#modal-window .modal-box .modal-buttons{padding:10px 15px;text-align:right;background-color:#f9f9f9;border-top:1px solid #ddd}#modal-window .modal-box .modal-buttons a.modal-btn{display:inline-block;padding:8px 12px;outline:0;border:1px solid transparent;cursor:pointer;text-decoration:none;text-align:center;white-space:nowrap;font-size:12px;font-weight:700;line-height:normal;color:#555;vertical-align:middle}#modal-window .modal-box .modal-buttons a.modal-btn:active,a.modal-btn:focus{outline:0!important}#modal-window .modal-box .modal-buttons a.modal-btn:active,a.modal-btn.active{-webkit-box-shadow:inset 0 0 7px rgba(0,0,0,.2);-moz-box-shadow:inset 0 0 7px rgba(0,0,0,.2);box-shadow:inset 0 0 7px rgba(0,0,0,.2)}#modal-window .modal-box .modal-buttons a.modal-btn+a.modal-btn{margin-left:5px}#modal-window .modal-box .modal-buttons a.modal-btn.btn-disabled{cursor:not-allowed;pointer-events:none;opacity:.65;filter:alpha(opacity=65)}#modal-window .modal-box .modal-buttons a.modal-btn.btn-large{padding:8px 14px;font-size:16px}#modal-window .modal-box .modal-buttons a.modal-btn.btn-small{padding:6px 8px;font-size:10px}#modal-window .modal-box .modal-buttons a.modal-btn.btn-rounded{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}#modal-window .modal-box .modal-buttons a.modal-btn.btn-circle{-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}#modal-window .modal-box .modal-buttons a.modal-btn.btn-square{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}#modal-window .modal-box .modal-buttons a.modal-btn i,#modal-window .modal-box .modal-buttons a.modal-btn img{vertical-align:middle;display:inline-block;float:left;max-height:16px;margin-right:5px}#modal-window .modal-box .modal-buttons a.modal-btn{background-color:#fcfcfc;border-color:#c9c9c9;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.08);-moz-box-shadow:0 1px 1px rgba(0,0,0,.08);box-shadow:0 1px 1px rgba(0,0,0,.08)}#modal-window .modal-box .modal-buttons a.modal-btn.btn-green{background-color:#5cb85c;border-color:#4cae4c;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-green:hover{background-color:#449d44;border-color:#398439;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-purple{background-color:#8149B4;border-color:#6922AD;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-purple:hover{background-color:#6f32a8;border-color:#5b149e;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-orange{background-color:#f7aa47;border-color:#eea236;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-orange:hover{background-color:#f69f2f;border-color:#d58512;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-pink{background-color:#ff6264;border-color:#eb5b5c;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-pink:hover{background-color:#ff484b;border-color:#e53a3d;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-turquoise{background-color:#00b19d;border-color:#11a594;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-turquoise:hover{background-color:#009886;border-color:#0b8173;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-green{background-color:#8dc63f;border-color:#7db432;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-green:hover{background-color:#82b838;border-color:#75a336;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-blue{background-color:#428bca;border-color:#357ebd;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-blue:hover{background-color:#3071a9;border-color:#285e8e;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-blue{background-color:#0e62c7;border-color:#0D54AA;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-blue:hover{background-color:#0c56af;border-color:#0B4992;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-red{background-color:#cc3f44;border-color:#bd1b21;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-red:hover{background-color:#ab2d32;border-color:#96050b;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-red{background-color:#d9534f;border-color:#d43f3a;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-red:hover{background-color:#c9302c;border-color:#ac2925;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-yellow{background-color:#ffba00;border-color:#e4a703;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-yellow:hover{background-color:#f0bb2e;border-color:#dba71a;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-black{background-color:#444;border-color:#313131;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-black:hover{background-color:#333;border-color:#222;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-white{background-color:#fff;color:#555;border:1px solid #ddd}#modal-window .modal-box .modal-buttons a.modal-btn.btn-white:hover{background-color:#f7f7f7;border:1px solid #ccc}#modal-window .modal-box .modal-buttons a.modal-btn.btn-white:active,#modal-window .modal-box .modal-buttons a.modal-btn.btn-white:focus{-webkit-box-shadow:inset 0 0 10px rgba(0,0,0,.1);-moz-box-shadow:inset 0 0 10px rgba(0,0,0,.1);box-shadow:inset 0 0 10px rgba(0,0,0,.1)}#modal-window .modal-box.modal-type-success .modal-title{background-color:#61b832}#modal-window .modal-box.modal-type-warning .modal-title{background-color:#f1b40e}#modal-window .modal-box.modal-type-error .modal-title{background-color:#de4343}#modal-window .modal-box.modal-type-info .modal-title{background-color:#4ea5cd}#modal-window .modal-box.modal-type-inverted .modal-title{background-color:#232B31}#modal-window .modal-box.modal-type-primary .modal-title{background-color:#428bca}#modal-window .modal-box.modal-type-error .modal-title,#modal-window .modal-box.modal-type-info .modal-title,#modal-window .modal-box.modal-type-inverted .modal-title,#modal-window .modal-box.modal-type-primary .modal-title,#modal-window .modal-box.modal-type-success .modal-title,#modal-window .modal-box.modal-type-warning .modal-title{color:#FFF;text-shadow:0 1px 3px rgba(0,0,0,.25);border-bottom-color:transparent}#modal-window .modal-box.modal-type-error .modal-title .modal-close-btn,#modal-window .modal-box.modal-type-info .modal-title .modal-close-btn,#modal-window .modal-box.modal-type-inverted .modal-title .modal-close-btn,#modal-window .modal-box.modal-type-primary .modal-title .modal-close-btn,#modal-window .modal-box.modal-type-success .modal-title .modal-close-btn,#modal-window .modal-box.modal-type-warning .modal-title .modal-close-btn{background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBoj k8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAKNJREFUeNqkk9EKwyAMRdMKfqG/WBD2hYWMs4epZBLjoBcEibnHNokHIE90mn0SkUtESpBfWk4aEUCABLz46gZKi9tV2hktNwEDUPnVDLHmrmoBBdAFxDNrv2D+RA+yNM+AFWRp9gARRL3inot2vf+MSdQqT3f0C6tqawTZmcumxQNwbQrmQS4LyGaUNRhlNaOc5xrkNp6e2UJqNwNyPH3OnwEACDCs273A8sIAAAAASUVORK5CYII=') center no-repeat}#modal-window .modal-box.modal-theme-reseted{background:0 0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}#modal-window .modal-box.modal-theme-reseted .modal-title{border-bottom:0;padding:0}#modal-window .modal-box.modal-theme-reseted .modal-title .modal-close-btn{right:0}#modal-window .modal-box.modal-theme-reseted .modal-text{padding:0}#modal-window .modal-box.modal-theme-reseted .modal-buttons{border-top:0;background:0 0;padding:0}
2713
2714/*CSS ICONS
2715http://androidcss.com/css-shape-icon-generator/
2716*/
2717
2718.dupx-plus-square{display:inline-block!important;position:relative;width:14px;height:14px;border-radius:25%;background-color:#000000;box-sizing:content-box}
2719.dupx-plus-square:before{position:absolute;content:'';margin:auto;width:calc(14px/8);height:calc(14px/1.5);background-color:#fff;top:0;bottom:0;left:0;right:0}
2720.dupx-plus-square:after{position:absolute;content:'';margin:auto;width:calc(14px/1.5);height:calc(14px/8);background-color:#fff;top:0;bottom:0;left:0;right:0}
2721
2722.dupx-minus-square{display:inline-block!important;position:relative;width:14px;height:14px;border-radius:25%;background-color:#000000;box-sizing:content-box}
2723.dupx-minus-square:after{position:absolute;content:'';margin:auto;width:calc(14px/1.5);height:calc(14px/10);background-color:#fff;top:0;bottom:0;left:0;right:0}
2724
2725
2726</style>
2727
2728
2729 <style>
2730 body {font-family:Verdana,Arial,sans-serif; font-size:13px;}
2731 fieldset {border:1px solid silver; border-radius:5px; padding:10px}
2732 h3 {margin:1px; padding:1px; font-size:13px;}
2733 a {color:#222}
2734 a:hover{color:gray}
2735 input[type=text], input[type=password], select {width:97%; border-radius:2px; border:1px solid silver; padding:4px; font-family:Verdana,Arial,sans-serif;}
2736 select {padding-left:0; width:99%}
2737 select:disabled {background:#EBEBE4}
2738 input.readonly {background-color:#efefef;}
2739
2740 /* ============================
2741 COMMON VIEWS
2742 ============================ */
2743 div#content {border:1px solid #CDCDCD; width:750px; min-height:550px; margin:auto; margin-top:18px; border-radius:5px; box-shadow:0 8px 6px -6px #333; font-size:13px}
2744 div#content-inner {padding:10px 25px; min-height:550px}
2745 form.content-form {min-height:550px; position:relative; line-height:17px}
2746 div.status-badge-pass {border-radius:4px; color:#fff; padding:0 4px 0 4px; font-size:12px; min-width:30px; text-align:center; background-color:#418446;display:inline-block }
2747 div.status-badge-fail {border-radius:4px; color:#fff; padding:0 4px 0 4px; font-size:12px; min-width:30px; text-align:center; background-color:maroon; display:inline-block}
2748
2749 /* WIZARD STEPS */
2750 table.dupx-header {border-top-left-radius:5px; border-top-right-radius:5px; width:100%; box-shadow:0 5px 3px -3px #999; background-color:#F1F1F1; font-weight:bold;}
2751 .dupx-header-version {white-space:nowrap; color:#777; font-size:11px; font-style:italic; text-align:right; padding:0 15px 5px 0; line-height:14px; font-weight:normal;}
2752 .dupx-header-version a {color:#555;}
2753 div.dupx-logfile-link {float:right; font-weight:normal; font-size:11px; font-style:italic}
2754 div#progress-area {padding:5px; margin:150px 0 0 0px; text-align:center;}
2755 div#ajaxerr-data {padding:5px; height:350px; width:99%; border:1px solid silver; border-radius:5px; background-color:#efefef; font-size:13px; overflow-y:scroll; line-height:24px}
2756
2757 /*TITLE HEADERS */
2758 div.hdr-main {font-size:22px; padding:0 0 5px 0; border-bottom:1px solid #D3D3D3; font-weight:bold; margin:15px 0 20px 0;}
2759 div.hdr-main span.step {color:#DB4B38}
2760 div.hdr-sub1 {font-size:18px; margin-bottom:5px;border:1px solid #D3D3D3;padding:7px; background-color:#f9f9f9; font-weight:bold; border-radius:4px}
2761 div.hdr-sub1 a {cursor:pointer; text-decoration: none !important}
2762 div.hdr-sub1:hover {cursor:pointer; background-color:#f1f1f1; border:1px solid #dcdcdc; }
2763 div.hdr-sub1:hover a{color:#000}
2764 div.hdr-sub2 {font-size:15px; padding:2px 2px 2px 0; border-bottom:1px solid #D3D3D3; font-weight:bold; margin-bottom:5px; border:none}
2765 div.hdr-sub3 {font-size:15px; padding:2px 2px 2px 0; border-bottom:1px solid #D3D3D3; font-weight:bold; margin-bottom:5px;}
2766 div.hdr-sub4 {font-size:15px; padding:7px; border:1px solid #D3D3D3;; font-weight:bold; background-color:#e9e9e9;}
2767 div.hdr-sub4:hover {background-color:#dfdfdf; cursor:pointer}
2768
2769 /* BUTTONS */
2770 div.dupx-footer-buttons {position:absolute; bottom:10px; padding:10px; right:0}
2771 div.dupx-footer-buttons input:hover, button:hover {border:1px solid #000}
2772 div.dupx-footer-buttons input[disabled=disabled]{background-color:#F4F4F4; color:silver; border:1px solid silver;}
2773 div.dupx-footer-buttons button[disabled]{background-color:#F4F4F4; color:silver; border:1px solid silver;}
2774 button.default-btn, input.default-btn {
2775 cursor:pointer; color:#fff; font-size:16px; border-radius:5px; padding:8px 25px 6px 25px;
2776 background-color:#13659C; border:1px solid gray;
2777 }
2778 table.dupx-opts {width:100%; border:0px;}
2779 table.dupx-opts td{white-space:nowrap; padding:3px;}
2780 table.dupx-opts td:first-child{width:125px; font-weight: bold}
2781 table.dupx-advopts td:first-child{width:125px; font-weight:bold}
2782 table.dupx-advopts td label{min-width:60px; display:inline-block; cursor:pointer}
2783
2784 .dupx-pass {display:inline-block; color:green;}
2785 .dupx-fail {display:inline-block; color:#AF0000;}
2786 .dupx-notice {display:inline-block; color:#000;}
2787 div.dupx-ui-error {padding-top:2px; font-size:13px; line-height: 20px}
2788
2789 /*Dialog Info */
2790 div.dlg-serv-info {line-height:22px; font-size:12px; margin:0}
2791 div.dlg-serv-info div.info-txt {text-align: center; font-size:11px; font-style:italic}
2792 div.dlg-serv-info label {display:inline-block; width:175px; font-weight: bold}
2793 div.dlg-serv-info div.hdr {background-color: #dfdfdf; font-weight: bold; margin-top:5px; border-radius: 4px; padding:2px 5px 2px 5px; border: 1px solid silver; font-size: 16px}
2794 div#modal-window div.modal-title {background-color:#D0D0D0}
2795 div#modal-window div.modal-text {padding-top:10px !important}
2796 div.archive-onlydb {color:#DB4B38; font-weight:normal; position:absolute; top:5px; right:20px; font-style:italic; font-size:11px}
2797
2798 /* ======================================
2799 STEP 1 VIEW
2800 ====================================== */
2801 table.s1-archive-local {width:100%}
2802 table.s1-archive-local td {padding:4px 4px 4px 4px}
2803 table.s1-archive-local td:first-child {font-weight:bold; width:55px}
2804 div#s1-area-sys-setup {padding:5px 0 0 10px}
2805 div#s1-area-sys-setup div.info-top {text-align:center; font-style:italic; font-size:11px; padding:0 5px 5px 5px}
2806 table.s1-checks-area {width:100%; margin:0; padding:0}
2807 table.s1-checks-area td.title {font-size:16px; width:100%}
2808 table.s1-checks-area td.title small {font-size:11px; font-weight:normal}
2809 table.s1-checks-area td.toggle {font-size:11px; margin-right:7px; font-weight:normal}
2810
2811 div.s1-reqs {background-color:#efefef; border:1px solid silver; border-radius:5px; margin-top:-5px}
2812 div.s1-reqs div.header {background-color:#E0E0E0; color:#000; border-bottom: 1px solid silver; padding:2px; font-weight:bold }
2813 div.s1-reqs div.notice {background-color:#E0E0E0; color:#000; text-align:center; font-size:12px; border-bottom: 1px solid silver; padding:2px; font-style:italic}
2814 div.s1-reqs div.status {float:right; border-radius:4px; color:#fff; padding:0 4px 0 4px; margin:4px 5px 0 0; font-size:12px; min-width:30px; text-align:center; font-weight:bold}
2815 div.s1-reqs div.pass {background-color:green;}
2816 div.s1-reqs div.fail {background-color:maroon;}
2817 div.s1-reqs div.title {padding:4px; font-size:13px;}
2818 div.s1-reqs div.title:hover {background-color:#dfdfdf; cursor:pointer}
2819 div.s1-reqs div.info {padding:8px 8px 20px 8px; background-color:#fff; display:none; line-height:18px; font-size: 12px}
2820 div.s1-reqs div.info a {color:#485AA3;}
2821 div.s1-archive-failed-msg {padding:15px; border:1px dashed silver; font-size: 12px; border-radius:5px}
2822 div.s1-err-msg {padding:8px; border:1px dashed #999; margin:20px 0 20px 0px; border-radius:5px; color:maroon}
2823
2824 /*Terms and Notices*/
2825 div#s1-warning-check label{cursor:pointer;}
2826 div#s1-warning-msg {padding:5px;font-size:12px; color:#333; line-height:14px;font-style:italic; overflow-y:scroll; height:250px; border:1px solid #dfdfdf; background:#fff; border-radius:3px}
2827 div#s1-warning-check {padding:3px; font-size:14px; font-weight:normal;}
2828 input#accept-warnings {height: 17px; width:17px}
2829
2830 /* ======================================
2831 STEP 2 VIEW
2832 ====================================== */
2833 /*Toggle Buttons */
2834 div.s2-btngrp {text-align:center; margin:0 auto 10px auto}
2835 div.s2-btngrp input[type=button] {font-size:14px; padding:6px; width:120px; border:1px solid silver; cursor:pointer}
2836 div.s2-btngrp input[type=button]:first-child {border-radius:5px 0 0 5px; margin-right:-2px}
2837 div.s2-btngrp input[type=button]:last-child {border-radius:0 5px 5px 0; margin-left:-4px}
2838 div.s2-btngrp input[type=button].active {background-color:#13659C; color:#fff;}
2839 div.s2-btngrp input[type=button].in-active {background-color:#E4E4E4; }
2840 div.s2-btngrp input[type=button]:hover {border:1px solid #999}
2841
2842 div.s2-modes {padding:0px 15px 0 0px;}
2843 div#s2-dbconn {margin:auto; text-align:center; margin:15px 0 10px 0px}
2844 input.s2-small-btn {height:25px; border:1px solid gray; border-radius:3px; cursor:pointer}
2845 table.s2-opts-dbhost td {padding:0; margin:0}
2846 input#s2-dbport-btn { width:80px}
2847 div.s2-db-test small{display:block; font-style:italic; color:#333; padding:3px 2px 5px 2px; border-bottom:1px dashed silver; margin-bottom:10px; text-align: center }
2848 table.s2-db-test-dtls {text-align: left; margin: auto}
2849 table.s2-db-test-dtls td:first-child {font-weight: bold}
2850 div#s2-dbconn-test-msg {font-size:12px}
2851 div#s2-dbconn-status {border:1px solid silver; border-radius:3px; background-color:#f9f9f9; padding:2px 5px; margin-top:10px; height:175px; overflow-y: scroll}
2852 div#s2-dbconn-status div.warn-msg {text-align: left; padding:5px; margin:10px 0 10px 0}
2853 div#s2-dbconn-status div.warn-msg b{color:maroon}
2854
2855 /*cPanel Tab */
2856 div#s2-cpnl-pane {display: none; min-height: 190px;}
2857 div.s2-gopro {color: black; margin-top:10px; padding:0 20px 10px 20px; border: 1px solid silver; background-color:#F6F6F6; border-radius: 4px}
2858 div.s2-gopro h2 {text-align: center; margin:10px}
2859 div.s2-gopro small {font-style: italic}
2860 div.s2-cpanel-login {padding:15px; color:#fff; text-align:center; margin:15px 5px 15px 5px; border:1px solid silver; border-radius:5px; background-color:#13659C; font-size:14px; line-height:22px}
2861 div.s2-cpanel-off {padding:15px; color:#fff; text-align:center; margin:15px 5px 15px 5px; border:1px solid silver; border-radius:5px; background-color:#b54949; font-size:14px; line-height:22px}
2862
2863 /*Advanced Options & Warning Area*/
2864 div#s2-area-adv-opts label {cursor: pointer}
2865 div#s2-warning {padding:5px;font-size:12px; color:gray; line-height:12px;font-style:italic; overflow-y:scroll; height:150px; border:1px solid #dfdfdf; background-color:#fff; border-radius:3px}
2866 div#s2-warning-check {padding:5px; font-size:12px; font-weight:normal; font-style:italic;}
2867 div#s2-warning-check label {cursor: pointer; line-height: 14px}
2868 div#s2-warning-emptydb {display:none; color:#AF2222; margin:2px 0 0 0; font-size: 11px}
2869 table.s2-advopts label.radio {width:50px; display:inline-block}
2870
2871 /* ======================================
2872 STEP 3 VIEW
2873 ====================================== */
2874 table.s3-table-inputs {width:100%; border:0px;}
2875 table.s3-table-inputs td{white-space:nowrap; padding:2px;}
2876 table.s3-table-inputs td:first-child{font-weight: bold; width:125px}
2877 div#s3-adv-opts {margin-top:5px; }
2878 div.s3-allnonelinks {font-size:11px; float:right;}
2879 select#plugins {width:330px; height:100px}
2880 select#tables {width:330px; height:100px}
2881
2882 /* password indicator */
2883 .top_testresult{font-weight:bold; font-size:11px; color:#222; padding:1px 1px 1px 4px; margin:4px 0 0 0px; width:495px; dislay:inline-block}
2884 .top_testresult span{margin:0;}
2885 .top_shortPass{background:#edabab; border:1px solid #bc0000;display:block;}
2886 .top_badPass{background:#edabab;border:1px solid #bc0000;display:block;}
2887 .top_goodPass{background:#ffffe0; border:1px solid #e6db55; display:block;}
2888 .top_strongPass{background:#d3edab; border:1px solid #73bc00; display:block;}
2889
2890 /* ======================================
2891 STEP 4 VIEW
2892 ====================================== */
2893 div.s4-final-title {color:#BE2323;font-size:18px}
2894 div.s4-connect {font-size:12px; text-align:center; font-style:italic; position:absolute; bottom:10px; padding:10px; width:100%; margin-top:20px}
2895 table.s4-report-results,
2896 table.s4-report-errs {border-collapse:collapse; border:1px solid #dfdfdf; }
2897 table.s4-report-errs td {text-align:center; width:33%}
2898 table.s4-report-results th, table.s4-report-errs th {background-color:#efefef; padding:0px; font-size:13px; padding:0px}
2899 table.s4-report-results td, table.s4-report-errs td {padding:0px; white-space:nowrap; border:1px solid #dfdfdf; text-align:center; font-size:12px}
2900 table.s4-report-results td:first-child {text-align:left; font-weight:bold; padding-left:3px}
2901 div.s4-err-title {background-color:#dfdfdf; font-weight: bold; margin:-3px 0 15px 0; padding:5px; border-radius:3px; font-size:13px}
2902
2903 div.s4-err-msg {padding:8px; display:none; border:1px dashed #999; margin:10px 0 20px 0px; border-radius:5px;}
2904 div.s4-err-msg div.content{padding:5px; font-size:11px; line-height:17px; max-height:125px; overflow-y:scroll; border:1px solid silver; margin:3px; }
2905 div.s4-err-msg div.info-error{padding:7px; background-color:#f9c9c9; border:1px solid silver; border-radius:2px; font-size:12px; line-height:16px }
2906 div.s4-err-msg div.info-notice{padding:7px; background-color:#FCFEC5; border:1px solid silver; border-radius:2px; font-size:12px; line-height:16px;}
2907 table.s4-final-step {width:100%;}
2908 table.s4-final-step td {padding:5px 15px 5px 5px}
2909 table.s4-final-step td:first-child {white-space:nowrap;}
2910 div.s4-go-back {border-top:1px dotted #dfdfdf; margin:auto; font-style:italic; font-size:10px; color:#333}
2911 a.s4-final-btns {display: block; width:145px; padding:5px; line-height: 1.4; background-color:#F1F1F1; border:1px solid silver;
2912 color: #000; box-shadow: 5px 5px 5px -5px #949494; text-decoration: none; text-align: center; border-radius: 4px;
2913 }
2914 a.s4-final-btns:hover {background-color: #dfdfdf;}
2915 div.s4-gopro-btn {text-align:center; font-size:14px; margin:auto; width:200px; font-style: italic; font-weight:bold}
2916 div.s4-gopro-btn a{color:green}
2917
2918
2919 /* PARSLEY:Overrides*/
2920 input.parsley-error, textarea.parsley-error, select.parsley-error {
2921 color:#B94A48 !important; background-color:#F2DEDE !important; border:1px solid #EED3D7 !important;
2922 }
2923 ul.parsley-errors-list {margin:1px 0 0 -40px; list-style-type:none; font-size:10px}
2924
2925 /* ============================
2926 STEP 5 HELP
2927 ============================ */
2928 div.help-target {float:right; font-size:11px}
2929 div#main-help a.help-target {display:block; margin:5px}
2930 div#main-help sup {font-size:11px; font-weight:normal; font-style:italic; color:blue}
2931 div.help-online {text-align:center; font-size:18px; padding:10px 0 0 0; line-height:24px}
2932 div.help {color:#555; font-style:italic; font-size:11px; padding:4px; border-top:1px solid #dfdfdf}
2933 div.help-page {padding:5px 0 0 5px}
2934 div.help-page fieldset {margin-bottom:25px}
2935 div#main-help {font-size:13px; line-height:17px}
2936 div#main-help h2 {background-color:#F1F1F1; border:1px solid silver; border-radius:4px; padding:10px; margin:26px 0 8px 0; font-size:22px; }
2937 div#main-help h3 {border-bottom:1px solid silver; padding:8px; margin:4px 0 8px 0; font-size:20px}
2938 div#main-help span.step {color:#DB4B38}
2939 table.help-opt {width: 100%; border: none; border-collapse: collapse; margin:5px 0 0 0;}
2940 table.help-opt td.section {background-color:#dfdfdf;}
2941 table.help-opt td, th {padding:7px; border:1px solid silver;}
2942 table.help-opt td:first-child {font-weight:bold; padding-right:10px; white-space:nowrap}
2943 table.help-opt th {background: #333; color: #fff;border:1px solid #333; padding:3px}
2944
2945
2946 <?php if ($GLOBALS['DUPX_DEBUG']) : ?>
2947 .dupx-debug {display:block; margin:4px 0 30px 0; font-size:11px;}
2948 .dupx-debug label {font-weight:bold; display:block; margin:6px 0 2px 0}
2949 .dupx-debug textarea {width:95%; height:100px; font-size:11px}
2950 <?php else : ?>
2951 .dupx-debug {display:none}
2952 <?php endif; ?>
2953 small.s3-warn {color: maroon;font-style: italic;}
2954 div.s4-warn {color: maroon;}
2955
2956</style>
2957 <?php
2958 // Exit if accessed directly
2959 if (! defined('DUPLICATOR_INIT')) {
2960 $_baseURL = "http://" . strlen($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
2961 header("HTTP/1.1 301 Moved Permanently");
2962 header("Location: $_baseURL");
2963 exit;
2964 }
2965?>
2966<!-- ========================================
2967JQUERY ASSETS -->
2968<?php if(DUPX_U::isURLActive("ajax.googleapis.com", 443) ): ?>
2969 <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
2970 <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
2971<?php else: ?>
2972 <script type="text/javascript">
2973 /*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
2974 !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=mb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=nb(b);function qb(){}qb.prototype=d.filters=d.pseudos,d.setFilters=new qb,g=gb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?gb.error(a):z(a,i).slice(0)};function rb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)
2975 },removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Yb,Zb,$b=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))
2976 },removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec=/#.*$/,fc=/([?&])_=[^&]*/,gc=/^(.*?):[ \t]*([^\r\n]*)$/gm,hc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ic=/^(?:GET|HEAD)$/,jc=/^\/\//,kc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lc={},mc={},nc="*/".concat("*"),oc=a.location.href,pc=kc.exec(oc.toLowerCase())||[];function qc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rc(a,b,c,d){var e={},f=a===mc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function uc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:oc,type:"GET",isLocal:hc.test(pc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sc(sc(a,n.ajaxSettings),b):sc(n.ajaxSettings,a)},ajaxPrefilter:qc(lc),ajaxTransport:qc(mc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gc.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||oc)+"").replace(ec,"").replace(jc,pc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pc[1]&&h[2]===pc[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pc[3]||("http:"===pc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rc(lc,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ic.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fc.test(d)?d.replace(fc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rc(mc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tc(k,v,f)),u=uc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vc=/%20/g,wc=/\[\]$/,xc=/\r?\n/g,yc=/^(?:submit|button|image|reset|file)$/i,zc=/^(?:input|select|textarea|keygen)/i;function Ac(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wc.test(a)?d(a,e):Ac(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ac(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ac(c,a[c],b,e);return d.join("&").replace(vc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zc.test(this.nodeName)&&!yc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xc,"\r\n")}}):{name:b.name,value:c.replace(xc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bc=0,Cc={},Dc={0:200,1223:204},Ec=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cc)Cc[a]()}),k.cors=!!Ec&&"withCredentials"in Ec,k.ajax=Ec=!!Ec,n.ajaxTransport(function(a){var b;return k.cors||Ec&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Dc[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fc=[],Gc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hc)return Hc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ic=a.document.documentElement;function Jc(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ic;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ic})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kc=a.jQuery,Lc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lc),b&&a.jQuery===n&&(a.jQuery=Kc),n},typeof b===U&&(a.jQuery=a.$=n),n});
2977 </script>
2978 <script type="text/javascript">
2979 /*! jQuery UI - v1.11.2 - 2014-12-20
2980 * http://jqueryui.com
2981 * Includes: core.js, widget.js, progressbar.js
2982 * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
2983 (function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var s=0,n=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,a=n.call(arguments,1),o=0,r=a.length;r>o;o++)for(i in a[o])s=a[o][i],a[o].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(a){var o="string"==typeof a,r=n.call(arguments,1),h=this;return a=!o&&r.length?e.widget.extend.apply(null,[a].concat(r)):a,o?this.each(function(){var i,n=e.data(this,s);return"instance"===a?(h=n,!1):n?e.isFunction(n[a])&&"_"!==a.charAt(0)?(i=n[a].apply(n,r),i!==n&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+a+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var t=e.data(this,s);t?(t.option(a||{}),t._init&&t._init()):e.data(this,s,new i(a,this))}),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget,e.widget("ui.progressbar",{version:"1.11.2",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}})});
2984 </script>
2985<?php endif; ?>
2986
2987<!-- ========================================
2988KNOCKOUT ASSETS -->
2989<?php if( DUPX_U::isURLActive("ajax.aspnetcdn.com", 443) ): ?>
2990 <script src="//ajax.aspnetcdn.com/ajax/knockout/knockout-2.2.1.js"></script>
2991<?php else: ?>
2992 <script type="text/javascript">
2993 // Knockout JavaScript library v2.2.1
2994 // (c) Steven Sanderson - http://knockoutjs.com/
2995 // License: MIT (http://www.opensource.org/licenses/mit-license.php)
2996
2997 (function() {function j(w){throw w;}var m=!0,p=null,r=!1;function u(w){return function(){return w}};var x=window,y=document,ga=navigator,F=window.jQuery,I=void 0;
2998 function L(w){function ha(a,d,c,e,f){var g=[];a=b.j(function(){var a=d(c,f)||[];0<g.length&&(b.a.Ya(M(g),a),e&&b.r.K(e,p,[c,a,f]));g.splice(0,g.length);b.a.P(g,a)},p,{W:a,Ka:function(){return 0==g.length||!b.a.X(g[0])}});return{M:g,j:a.pa()?a:I}}function M(a){for(;a.length&&!b.a.X(a[0]);)a.splice(0,1);if(1<a.length){for(var d=a[0],c=a[a.length-1],e=[d];d!==c;){d=d.nextSibling;if(!d)return;e.push(d)}Array.prototype.splice.apply(a,[0,a.length].concat(e))}return a}function S(a,b,c,e,f){var g=Math.min,
2999 h=Math.max,k=[],l,n=a.length,q,s=b.length,v=s-n||1,G=n+s+1,J,A,z;for(l=0;l<=n;l++){A=J;k.push(J=[]);z=g(s,l+v);for(q=h(0,l-1);q<=z;q++)J[q]=q?l?a[l-1]===b[q-1]?A[q-1]:g(A[q]||G,J[q-1]||G)+1:q+1:l+1}g=[];h=[];v=[];l=n;for(q=s;l||q;)s=k[l][q]-1,q&&s===k[l][q-1]?h.push(g[g.length]={status:c,value:b[--q],index:q}):l&&s===k[l-1][q]?v.push(g[g.length]={status:e,value:a[--l],index:l}):(g.push({status:"retained",value:b[--q]}),--l);if(h.length&&v.length){a=10*n;var t;for(b=c=0;(f||b<a)&&(t=h[c]);c++){for(e=
3000 0;k=v[e];e++)if(t.value===k.value){t.moved=k.index;k.moved=t.index;v.splice(e,1);b=e=0;break}b+=e}}return g.reverse()}function T(a,d,c,e,f){f=f||{};var g=a&&N(a),g=g&&g.ownerDocument,h=f.templateEngine||O;b.za.vb(c,h,g);c=h.renderTemplate(c,e,f,g);("number"!=typeof c.length||0<c.length&&"number"!=typeof c[0].nodeType)&&j(Error("Template engine must return an array of DOM nodes"));g=r;switch(d){case "replaceChildren":b.e.N(a,c);g=m;break;case "replaceNode":b.a.Ya(a,c);g=m;break;case "ignoreTargetNode":break;
3001 default:j(Error("Unknown renderMode: "+d))}g&&(U(c,e),f.afterRender&&b.r.K(f.afterRender,p,[c,e.$data]));return c}function N(a){return a.nodeType?a:0<a.length?a[0]:p}function U(a,d){if(a.length){var c=a[0],e=a[a.length-1];V(c,e,function(a){b.Da(d,a)});V(c,e,function(a){b.s.ib(a,[d])})}}function V(a,d,c){var e;for(d=b.e.nextSibling(d);a&&(e=a)!==d;)a=b.e.nextSibling(e),(1===e.nodeType||8===e.nodeType)&&c(e)}function W(a,d,c){a=b.g.aa(a);for(var e=b.g.Q,f=0;f<a.length;f++){var g=a[f].key;if(e.hasOwnProperty(g)){var h=
3002 e[g];"function"===typeof h?(g=h(a[f].value))&&j(Error(g)):h||j(Error("This template engine does not support the '"+g+"' binding within its templates"))}}a="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+b.g.ba(a)+" } })()})";return c.createJavaScriptEvaluatorBlock(a)+d}function X(a,d,c,e){function f(a){return function(){return k[a]}}function g(){return k}var h=0,k,l;b.j(function(){var n=c&&c instanceof b.z?c:new b.z(b.a.d(c)),q=n.$data;e&&b.eb(a,n);if(k=("function"==typeof d?
3003 d(n,a):d)||b.J.instance.getBindings(a,n)){if(0===h){h=1;for(var s in k){var v=b.c[s];v&&8===a.nodeType&&!b.e.I[s]&&j(Error("The binding '"+s+"' cannot be used with virtual elements"));if(v&&"function"==typeof v.init&&(v=(0,v.init)(a,f(s),g,q,n))&&v.controlsDescendantBindings)l!==I&&j(Error("Multiple bindings ("+l+" and "+s+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.")),l=s}h=2}if(2===h)for(s in k)(v=b.c[s])&&"function"==
3004 typeof v.update&&(0,v.update)(a,f(s),g,q,n)}},p,{W:a});return{Nb:l===I}}function Y(a,d,c){var e=m,f=1===d.nodeType;f&&b.e.Ta(d);if(f&&c||b.J.instance.nodeHasBindings(d))e=X(d,p,a,c).Nb;e&&Z(a,d,!f)}function Z(a,d,c){for(var e=b.e.firstChild(d);d=e;)e=b.e.nextSibling(d),Y(a,d,c)}function $(a,b){var c=aa(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:p}function aa(a,b){for(var c=a,e=1,f=[];c=c.nextSibling;){if(H(c)&&(e--,0===e))return f;f.push(c);B(c)&&e++}b||j(Error("Cannot find closing comment tag to match: "+
3005 a.nodeValue));return p}function H(a){return 8==a.nodeType&&(K?a.text:a.nodeValue).match(ia)}function B(a){return 8==a.nodeType&&(K?a.text:a.nodeValue).match(ja)}function P(a,b){for(var c=p;a!=c;)c=a,a=a.replace(ka,function(a,c){return b[c]});return a}function la(){var a=[],d=[];this.save=function(c,e){var f=b.a.i(a,c);0<=f?d[f]=e:(a.push(c),d.push(e))};this.get=function(c){c=b.a.i(a,c);return 0<=c?d[c]:I}}function ba(a,b,c){function e(e){var g=b(a[e]);switch(typeof g){case "boolean":case "number":case "string":case "function":f[e]=
3006 g;break;case "object":case "undefined":var h=c.get(g);f[e]=h!==I?h:ba(g,b,c)}}c=c||new la;a=b(a);if(!("object"==typeof a&&a!==p&&a!==I&&!(a instanceof Date)))return a;var f=a instanceof Array?[]:{};c.save(a,f);var g=a;if(g instanceof Array){for(var h=0;h<g.length;h++)e(h);"function"==typeof g.toJSON&&e("toJSON")}else for(h in g)e(h);return f}function ca(a,d){if(a)if(8==a.nodeType){var c=b.s.Ua(a.nodeValue);c!=p&&d.push({sb:a,Fb:c})}else if(1==a.nodeType)for(var c=0,e=a.childNodes,f=e.length;c<f;c++)ca(e[c],
3007 d)}function Q(a,d,c,e){b.c[a]={init:function(a){b.a.f.set(a,da,{});return{controlsDescendantBindings:m}},update:function(a,g,h,k,l){h=b.a.f.get(a,da);g=b.a.d(g());k=!c!==!g;var n=!h.Za;if(n||d||k!==h.qb)n&&(h.Za=b.a.Ia(b.e.childNodes(a),m)),k?(n||b.e.N(a,b.a.Ia(h.Za)),b.Ea(e?e(l,g):l,a)):b.e.Y(a),h.qb=k}};b.g.Q[a]=r;b.e.I[a]=m}function ea(a,d,c){c&&d!==b.k.q(a)&&b.k.T(a,d);d!==b.k.q(a)&&b.r.K(b.a.Ba,p,[a,"change"])}var b="undefined"!==typeof w?w:{};b.b=function(a,d){for(var c=a.split("."),e=b,f=0;f<
3008 c.length-1;f++)e=e[c[f]];e[c[c.length-1]]=d};b.p=function(a,b,c){a[b]=c};b.version="2.2.1";b.b("version",b.version);b.a=new function(){function a(a,d){if("input"!==b.a.u(a)||!a.type||"click"!=d.toLowerCase())return r;var c=a.type;return"checkbox"==c||"radio"==c}var d=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,c={},e={};c[/Firefox\/2/i.test(ga.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];c.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");
3009 for(var f in c){var g=c[f];if(g.length)for(var h=0,k=g.length;h<k;h++)e[g[h]]=f}var l={propertychange:m},n,c=3;f=y.createElement("div");for(g=f.getElementsByTagName("i");f.innerHTML="\x3c!--[if gt IE "+ ++c+"]><i></i><![endif]--\x3e",g[0];);n=4<c?c:I;return{Na:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],o:function(a,b){for(var d=0,c=a.length;d<c;d++)b(a[d])},i:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var d=0,c=a.length;d<
3010 c;d++)if(a[d]===b)return d;return-1},lb:function(a,b,d){for(var c=0,e=a.length;c<e;c++)if(b.call(d,a[c]))return a[c];return p},ga:function(a,d){var c=b.a.i(a,d);0<=c&&a.splice(c,1)},Ga:function(a){a=a||[];for(var d=[],c=0,e=a.length;c<e;c++)0>b.a.i(d,a[c])&&d.push(a[c]);return d},V:function(a,b){a=a||[];for(var d=[],c=0,e=a.length;c<e;c++)d.push(b(a[c]));return d},fa:function(a,b){a=a||[];for(var d=[],c=0,e=a.length;c<e;c++)b(a[c])&&d.push(a[c]);return d},P:function(a,b){if(b instanceof Array)a.push.apply(a,
3011 b);else for(var d=0,c=b.length;d<c;d++)a.push(b[d]);return a},extend:function(a,b){if(b)for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);return a},ka:function(a){for(;a.firstChild;)b.removeNode(a.firstChild)},Hb:function(a){a=b.a.L(a);for(var d=y.createElement("div"),c=0,e=a.length;c<e;c++)d.appendChild(b.A(a[c]));return d},Ia:function(a,d){for(var c=0,e=a.length,g=[];c<e;c++){var f=a[c].cloneNode(m);g.push(d?b.A(f):f)}return g},N:function(a,d){b.a.ka(a);if(d)for(var c=0,e=d.length;c<e;c++)a.appendChild(d[c])},
3012 Ya:function(a,d){var c=a.nodeType?[a]:a;if(0<c.length){for(var e=c[0],g=e.parentNode,f=0,h=d.length;f<h;f++)g.insertBefore(d[f],e);f=0;for(h=c.length;f<h;f++)b.removeNode(c[f])}},bb:function(a,b){7>n?a.setAttribute("selected",b):a.selected=b},D:function(a){return(a||"").replace(d,"")},Rb:function(a,d){for(var c=[],e=(a||"").split(d),f=0,g=e.length;f<g;f++){var h=b.a.D(e[f]);""!==h&&c.push(h)}return c},Ob:function(a,b){a=a||"";return b.length>a.length?r:a.substring(0,b.length)===b},tb:function(a,b){if(b.compareDocumentPosition)return 16==
3013 (b.compareDocumentPosition(a)&16);for(;a!=p;){if(a==b)return m;a=a.parentNode}return r},X:function(a){return b.a.tb(a,a.ownerDocument)},u:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},n:function(b,d,c){var e=n&&l[d];if(!e&&"undefined"!=typeof F){if(a(b,d)){var f=c;c=function(a,b){var d=this.checked;b&&(this.checked=b.nb!==m);f.call(this,a);this.checked=d}}F(b).bind(d,c)}else!e&&"function"==typeof b.addEventListener?b.addEventListener(d,c,r):"undefined"!=typeof b.attachEvent?b.attachEvent("on"+
3014 d,function(a){c.call(b,a)}):j(Error("Browser doesn't support addEventListener or attachEvent"))},Ba:function(b,d){(!b||!b.nodeType)&&j(Error("element must be a DOM node when calling triggerEvent"));if("undefined"!=typeof F){var c=[];a(b,d)&&c.push({nb:b.checked});F(b).trigger(d,c)}else"function"==typeof y.createEvent?"function"==typeof b.dispatchEvent?(c=y.createEvent(e[d]||"HTMLEvents"),c.initEvent(d,m,m,x,0,0,0,0,0,r,r,r,r,0,b),b.dispatchEvent(c)):j(Error("The supplied element doesn't support dispatchEvent")):
3015 "undefined"!=typeof b.fireEvent?(a(b,d)&&(b.checked=b.checked!==m),b.fireEvent("on"+d)):j(Error("Browser doesn't support triggering events"))},d:function(a){return b.$(a)?a():a},ua:function(a){return b.$(a)?a.t():a},da:function(a,d,c){if(d){var e=/[\w-]+/g,f=a.className.match(e)||[];b.a.o(d.match(e),function(a){var d=b.a.i(f,a);0<=d?c||f.splice(d,1):c&&f.push(a)});a.className=f.join(" ")}},cb:function(a,d){var c=b.a.d(d);if(c===p||c===I)c="";if(3===a.nodeType)a.data=c;else{var e=b.e.firstChild(a);
3016 !e||3!=e.nodeType||b.e.nextSibling(e)?b.e.N(a,[y.createTextNode(c)]):e.data=c;b.a.wb(a)}},ab:function(a,b){a.name=b;if(7>=n)try{a.mergeAttributes(y.createElement("<input name='"+a.name+"'/>"),r)}catch(d){}},wb:function(a){9<=n&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},ub:function(a){if(9<=n){var b=a.style.width;a.style.width=0;a.style.width=b}},Lb:function(a,d){a=b.a.d(a);d=b.a.d(d);for(var c=[],e=a;e<=d;e++)c.push(e);return c},L:function(a){for(var b=[],d=0,c=a.length;d<
3017 c;d++)b.push(a[d]);return b},Pb:6===n,Qb:7===n,Z:n,Oa:function(a,d){for(var c=b.a.L(a.getElementsByTagName("input")).concat(b.a.L(a.getElementsByTagName("textarea"))),e="string"==typeof d?function(a){return a.name===d}:function(a){return d.test(a.name)},f=[],g=c.length-1;0<=g;g--)e(c[g])&&f.push(c[g]);return f},Ib:function(a){return"string"==typeof a&&(a=b.a.D(a))?x.JSON&&x.JSON.parse?x.JSON.parse(a):(new Function("return "+a))():p},xa:function(a,d,c){("undefined"==typeof JSON||"undefined"==typeof JSON.stringify)&&
3018 j(Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"));return JSON.stringify(b.a.d(a),d,c)},Jb:function(a,d,c){c=c||{};var e=c.params||{},f=c.includeFields||this.Na,g=a;if("object"==typeof a&&"form"===b.a.u(a))for(var g=a.action,h=f.length-1;0<=h;h--)for(var k=b.a.Oa(a,f[h]),l=k.length-1;0<=l;l--)e[k[l].name]=k[l].value;d=b.a.d(d);var n=y.createElement("form");
3019 n.style.display="none";n.action=g;n.method="post";for(var w in d)a=y.createElement("input"),a.name=w,a.value=b.a.xa(b.a.d(d[w])),n.appendChild(a);for(w in e)a=y.createElement("input"),a.name=w,a.value=e[w],n.appendChild(a);y.body.appendChild(n);c.submitter?c.submitter(n):n.submit();setTimeout(function(){n.parentNode.removeChild(n)},0)}}};b.b("utils",b.a);b.b("utils.arrayForEach",b.a.o);b.b("utils.arrayFirst",b.a.lb);b.b("utils.arrayFilter",b.a.fa);b.b("utils.arrayGetDistinctValues",b.a.Ga);b.b("utils.arrayIndexOf",
3020 b.a.i);b.b("utils.arrayMap",b.a.V);b.b("utils.arrayPushAll",b.a.P);b.b("utils.arrayRemoveItem",b.a.ga);b.b("utils.extend",b.a.extend);b.b("utils.fieldsIncludedWithJsonPost",b.a.Na);b.b("utils.getFormFields",b.a.Oa);b.b("utils.peekObservable",b.a.ua);b.b("utils.postJson",b.a.Jb);b.b("utils.parseJson",b.a.Ib);b.b("utils.registerEventHandler",b.a.n);b.b("utils.stringifyJson",b.a.xa);b.b("utils.range",b.a.Lb);b.b("utils.toggleDomNodeCssClass",b.a.da);b.b("utils.triggerEvent",b.a.Ba);b.b("utils.unwrapObservable",
3021 b.a.d);Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Array.prototype.slice.call(arguments);a=c.shift();return function(){return b.apply(a,c.concat(Array.prototype.slice.call(arguments)))}});b.a.f=new function(){var a=0,d="__ko__"+(new Date).getTime(),c={};return{get:function(a,d){var c=b.a.f.la(a,r);return c===I?I:c[d]},set:function(a,d,c){c===I&&b.a.f.la(a,r)===I||(b.a.f.la(a,m)[d]=c)},la:function(b,f){var g=b[d];if(!g||!("null"!==g&&c[g])){if(!f)return I;g=b[d]="ko"+
3022 a++;c[g]={}}return c[g]},clear:function(a){var b=a[d];return b?(delete c[b],a[d]=p,m):r}}};b.b("utils.domData",b.a.f);b.b("utils.domData.clear",b.a.f.clear);b.a.F=new function(){function a(a,d){var e=b.a.f.get(a,c);e===I&&d&&(e=[],b.a.f.set(a,c,e));return e}function d(c){var e=a(c,r);if(e)for(var e=e.slice(0),k=0;k<e.length;k++)e[k](c);b.a.f.clear(c);"function"==typeof F&&"function"==typeof F.cleanData&&F.cleanData([c]);if(f[c.nodeType])for(e=c.firstChild;c=e;)e=c.nextSibling,8===c.nodeType&&d(c)}
3023 var c="__ko_domNodeDisposal__"+(new Date).getTime(),e={1:m,8:m,9:m},f={1:m,9:m};return{Ca:function(b,d){"function"!=typeof d&&j(Error("Callback must be a function"));a(b,m).push(d)},Xa:function(d,e){var f=a(d,r);f&&(b.a.ga(f,e),0==f.length&&b.a.f.set(d,c,I))},A:function(a){if(e[a.nodeType]&&(d(a),f[a.nodeType])){var c=[];b.a.P(c,a.getElementsByTagName("*"));for(var k=0,l=c.length;k<l;k++)d(c[k])}return a},removeNode:function(a){b.A(a);a.parentNode&&a.parentNode.removeChild(a)}}};b.A=b.a.F.A;b.removeNode=
3024 b.a.F.removeNode;b.b("cleanNode",b.A);b.b("removeNode",b.removeNode);b.b("utils.domNodeDisposal",b.a.F);b.b("utils.domNodeDisposal.addDisposeCallback",b.a.F.Ca);b.b("utils.domNodeDisposal.removeDisposeCallback",b.a.F.Xa);b.a.ta=function(a){var d;if("undefined"!=typeof F)if(F.parseHTML)d=F.parseHTML(a);else{if((d=F.clean([a]))&&d[0]){for(a=d[0];a.parentNode&&11!==a.parentNode.nodeType;)a=a.parentNode;a.parentNode&&a.parentNode.removeChild(a)}}else{var c=b.a.D(a).toLowerCase();d=y.createElement("div");
3025 c=c.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!c.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!c.indexOf("<td")||!c.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];a="ignored<div>"+c[1]+a+c[2]+"</div>";for("function"==typeof x.innerShiv?d.appendChild(x.innerShiv(a)):d.innerHTML=a;c[0]--;)d=d.lastChild;d=b.a.L(d.lastChild.childNodes)}return d};b.a.ca=function(a,d){b.a.ka(a);d=b.a.d(d);if(d!==p&&d!==I)if("string"!=typeof d&&(d=d.toString()),
3026 "undefined"!=typeof F)F(a).html(d);else for(var c=b.a.ta(d),e=0;e<c.length;e++)a.appendChild(c[e])};b.b("utils.parseHtmlFragment",b.a.ta);b.b("utils.setHtml",b.a.ca);var R={};b.s={ra:function(a){"function"!=typeof a&&j(Error("You can only pass a function to ko.memoization.memoize()"));var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);R[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},hb:function(a,b){var c=R[a];c===I&&j(Error("Couldn't find any memo with ID "+
3027 a+". Perhaps it's already been unmemoized."));try{return c.apply(p,b||[]),m}finally{delete R[a]}},ib:function(a,d){var c=[];ca(a,c);for(var e=0,f=c.length;e<f;e++){var g=c[e].sb,h=[g];d&&b.a.P(h,d);b.s.hb(c[e].Fb,h);g.nodeValue="";g.parentNode&&g.parentNode.removeChild(g)}},Ua:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:p}};b.b("memoization",b.s);b.b("memoization.memoize",b.s.ra);b.b("memoization.unmemoize",b.s.hb);b.b("memoization.parseMemoText",b.s.Ua);b.b("memoization.unmemoizeDomNodeAndDescendants",
3028 b.s.ib);b.Ma={throttle:function(a,d){a.throttleEvaluation=d;var c=p;return b.j({read:a,write:function(b){clearTimeout(c);c=setTimeout(function(){a(b)},d)}})},notify:function(a,d){a.equalityComparer="always"==d?u(r):b.m.fn.equalityComparer;return a}};b.b("extenders",b.Ma);b.fb=function(a,d,c){this.target=a;this.ha=d;this.rb=c;b.p(this,"dispose",this.B)};b.fb.prototype.B=function(){this.Cb=m;this.rb()};b.S=function(){this.w={};b.a.extend(this,b.S.fn);b.p(this,"subscribe",this.ya);b.p(this,"extend",
3029 this.extend);b.p(this,"getSubscriptionsCount",this.yb)};b.S.fn={ya:function(a,d,c){c=c||"change";var e=new b.fb(this,d?a.bind(d):a,function(){b.a.ga(this.w[c],e)}.bind(this));this.w[c]||(this.w[c]=[]);this.w[c].push(e);return e},notifySubscribers:function(a,d){d=d||"change";this.w[d]&&b.r.K(function(){b.a.o(this.w[d].slice(0),function(b){b&&b.Cb!==m&&b.ha(a)})},this)},yb:function(){var a=0,b;for(b in this.w)this.w.hasOwnProperty(b)&&(a+=this.w[b].length);return a},extend:function(a){var d=this;if(a)for(var c in a){var e=
3030 b.Ma[c];"function"==typeof e&&(d=e(d,a[c]))}return d}};b.Qa=function(a){return"function"==typeof a.ya&&"function"==typeof a.notifySubscribers};b.b("subscribable",b.S);b.b("isSubscribable",b.Qa);var C=[];b.r={mb:function(a){C.push({ha:a,La:[]})},end:function(){C.pop()},Wa:function(a){b.Qa(a)||j(Error("Only subscribable things can act as dependencies"));if(0<C.length){var d=C[C.length-1];d&&!(0<=b.a.i(d.La,a))&&(d.La.push(a),d.ha(a))}},K:function(a,b,c){try{return C.push(p),a.apply(b,c||[])}finally{C.pop()}}};
3031 var ma={undefined:m,"boolean":m,number:m,string:m};b.m=function(a){function d(){if(0<arguments.length){if(!d.equalityComparer||!d.equalityComparer(c,arguments[0]))d.H(),c=arguments[0],d.G();return this}b.r.Wa(d);return c}var c=a;b.S.call(d);d.t=function(){return c};d.G=function(){d.notifySubscribers(c)};d.H=function(){d.notifySubscribers(c,"beforeChange")};b.a.extend(d,b.m.fn);b.p(d,"peek",d.t);b.p(d,"valueHasMutated",d.G);b.p(d,"valueWillMutate",d.H);return d};b.m.fn={equalityComparer:function(a,
3032 b){return a===p||typeof a in ma?a===b:r}};var E=b.m.Kb="__ko_proto__";b.m.fn[E]=b.m;b.ma=function(a,d){return a===p||a===I||a[E]===I?r:a[E]===d?m:b.ma(a[E],d)};b.$=function(a){return b.ma(a,b.m)};b.Ra=function(a){return"function"==typeof a&&a[E]===b.m||"function"==typeof a&&a[E]===b.j&&a.zb?m:r};b.b("observable",b.m);b.b("isObservable",b.$);b.b("isWriteableObservable",b.Ra);b.R=function(a){0==arguments.length&&(a=[]);a!==p&&(a!==I&&!("length"in a))&&j(Error("The argument passed when initializing an observable array must be an array, or null, or undefined."));
3033 var d=b.m(a);b.a.extend(d,b.R.fn);return d};b.R.fn={remove:function(a){for(var b=this.t(),c=[],e="function"==typeof a?a:function(b){return b===a},f=0;f<b.length;f++){var g=b[f];e(g)&&(0===c.length&&this.H(),c.push(g),b.splice(f,1),f--)}c.length&&this.G();return c},removeAll:function(a){if(a===I){var d=this.t(),c=d.slice(0);this.H();d.splice(0,d.length);this.G();return c}return!a?[]:this.remove(function(d){return 0<=b.a.i(a,d)})},destroy:function(a){var b=this.t(),c="function"==typeof a?a:function(b){return b===
3034 a};this.H();for(var e=b.length-1;0<=e;e--)c(b[e])&&(b[e]._destroy=m);this.G()},destroyAll:function(a){return a===I?this.destroy(u(m)):!a?[]:this.destroy(function(d){return 0<=b.a.i(a,d)})},indexOf:function(a){var d=this();return b.a.i(d,a)},replace:function(a,b){var c=this.indexOf(a);0<=c&&(this.H(),this.t()[c]=b,this.G())}};b.a.o("pop push reverse shift sort splice unshift".split(" "),function(a){b.R.fn[a]=function(){var b=this.t();this.H();b=b[a].apply(b,arguments);this.G();return b}});b.a.o(["slice"],
3035 function(a){b.R.fn[a]=function(){var b=this();return b[a].apply(b,arguments)}});b.b("observableArray",b.R);b.j=function(a,d,c){function e(){b.a.o(z,function(a){a.B()});z=[]}function f(){var a=h.throttleEvaluation;a&&0<=a?(clearTimeout(t),t=setTimeout(g,a)):g()}function g(){if(!q)if(n&&w())A();else{q=m;try{var a=b.a.V(z,function(a){return a.target});b.r.mb(function(c){var d;0<=(d=b.a.i(a,c))?a[d]=I:z.push(c.ya(f))});for(var c=s.call(d),e=a.length-1;0<=e;e--)a[e]&&z.splice(e,1)[0].B();n=m;h.notifySubscribers(l,
3036 "beforeChange");l=c}finally{b.r.end()}h.notifySubscribers(l);q=r;z.length||A()}}function h(){if(0<arguments.length)return"function"===typeof v?v.apply(d,arguments):j(Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.")),this;n||g();b.r.Wa(h);return l}function k(){return!n||0<z.length}var l,n=r,q=r,s=a;s&&"object"==typeof s?(c=s,s=c.read):(c=c||{},s||(s=c.read));"function"!=typeof s&&j(Error("Pass a function that returns the value of the ko.computed"));
3037 var v=c.write,G=c.disposeWhenNodeIsRemoved||c.W||p,w=c.disposeWhen||c.Ka||u(r),A=e,z=[],t=p;d||(d=c.owner);h.t=function(){n||g();return l};h.xb=function(){return z.length};h.zb="function"===typeof c.write;h.B=function(){A()};h.pa=k;b.S.call(h);b.a.extend(h,b.j.fn);b.p(h,"peek",h.t);b.p(h,"dispose",h.B);b.p(h,"isActive",h.pa);b.p(h,"getDependenciesCount",h.xb);c.deferEvaluation!==m&&g();if(G&&k()){A=function(){b.a.F.Xa(G,arguments.callee);e()};b.a.F.Ca(G,A);var D=w,w=function(){return!b.a.X(G)||D()}}return h};
3038 b.Bb=function(a){return b.ma(a,b.j)};w=b.m.Kb;b.j[w]=b.m;b.j.fn={};b.j.fn[w]=b.j;b.b("dependentObservable",b.j);b.b("computed",b.j);b.b("isComputed",b.Bb);b.gb=function(a){0==arguments.length&&j(Error("When calling ko.toJS, pass the object you want to convert."));return ba(a,function(a){for(var c=0;b.$(a)&&10>c;c++)a=a();return a})};b.toJSON=function(a,d,c){a=b.gb(a);return b.a.xa(a,d,c)};b.b("toJS",b.gb);b.b("toJSON",b.toJSON);b.k={q:function(a){switch(b.a.u(a)){case "option":return a.__ko__hasDomDataOptionValue__===
3039 m?b.a.f.get(a,b.c.options.sa):7>=b.a.Z?a.getAttributeNode("value").specified?a.value:a.text:a.value;case "select":return 0<=a.selectedIndex?b.k.q(a.options[a.selectedIndex]):I;default:return a.value}},T:function(a,d){switch(b.a.u(a)){case "option":switch(typeof d){case "string":b.a.f.set(a,b.c.options.sa,I);"__ko__hasDomDataOptionValue__"in a&&delete a.__ko__hasDomDataOptionValue__;a.value=d;break;default:b.a.f.set(a,b.c.options.sa,d),a.__ko__hasDomDataOptionValue__=m,a.value="number"===typeof d?
3040 d:""}break;case "select":for(var c=a.options.length-1;0<=c;c--)if(b.k.q(a.options[c])==d){a.selectedIndex=c;break}break;default:if(d===p||d===I)d="";a.value=d}}};b.b("selectExtensions",b.k);b.b("selectExtensions.readValue",b.k.q);b.b("selectExtensions.writeValue",b.k.T);var ka=/\@ko_token_(\d+)\@/g,na=["true","false"],oa=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;b.g={Q:[],aa:function(a){var d=b.a.D(a);if(3>d.length)return[];"{"===d.charAt(0)&&(d=d.substring(1,d.length-1));a=[];for(var c=
3041 p,e,f=0;f<d.length;f++){var g=d.charAt(f);if(c===p)switch(g){case '"':case "'":case "/":c=f,e=g}else if(g==e&&"\\"!==d.charAt(f-1)){g=d.substring(c,f+1);a.push(g);var h="@ko_token_"+(a.length-1)+"@",d=d.substring(0,c)+h+d.substring(f+1),f=f-(g.length-h.length),c=p}}e=c=p;for(var k=0,l=p,f=0;f<d.length;f++){g=d.charAt(f);if(c===p)switch(g){case "{":c=f;l=g;e="}";break;case "(":c=f;l=g;e=")";break;case "[":c=f,l=g,e="]"}g===l?k++:g===e&&(k--,0===k&&(g=d.substring(c,f+1),a.push(g),h="@ko_token_"+(a.length-
3042 1)+"@",d=d.substring(0,c)+h+d.substring(f+1),f-=g.length-h.length,c=p))}e=[];d=d.split(",");c=0;for(f=d.length;c<f;c++)k=d[c],l=k.indexOf(":"),0<l&&l<k.length-1?(g=k.substring(l+1),e.push({key:P(k.substring(0,l),a),value:P(g,a)})):e.push({unknown:P(k,a)});return e},ba:function(a){var d="string"===typeof a?b.g.aa(a):a,c=[];a=[];for(var e,f=0;e=d[f];f++)if(0<c.length&&c.push(","),e.key){var g;a:{g=e.key;var h=b.a.D(g);switch(h.length&&h.charAt(0)){case "'":case '"':break a;default:g="'"+h+"'"}}e=e.value;
3043 c.push(g);c.push(":");c.push(e);e=b.a.D(e);0<=b.a.i(na,b.a.D(e).toLowerCase())?e=r:(h=e.match(oa),e=h===p?r:h[1]?"Object("+h[1]+")"+h[2]:e);e&&(0<a.length&&a.push(", "),a.push(g+" : function(__ko_value) { "+e+" = __ko_value; }"))}else e.unknown&&c.push(e.unknown);d=c.join("");0<a.length&&(d=d+", '_ko_property_writers' : { "+a.join("")+" } ");return d},Eb:function(a,d){for(var c=0;c<a.length;c++)if(b.a.D(a[c].key)==d)return m;return r},ea:function(a,d,c,e,f){if(!a||!b.Ra(a)){if((a=d()._ko_property_writers)&&
3044 a[c])a[c](e)}else(!f||a.t()!==e)&&a(e)}};b.b("expressionRewriting",b.g);b.b("expressionRewriting.bindingRewriteValidators",b.g.Q);b.b("expressionRewriting.parseObjectLiteral",b.g.aa);b.b("expressionRewriting.preProcessBindings",b.g.ba);b.b("jsonExpressionRewriting",b.g);b.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",b.g.ba);var K="\x3c!--test--\x3e"===y.createComment("test").text,ja=K?/^\x3c!--\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*--\x3e$/:/^\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*$/,ia=K?/^\x3c!--\s*\/ko\s*--\x3e$/:
3045 /^\s*\/ko\s*$/,pa={ul:m,ol:m};b.e={I:{},childNodes:function(a){return B(a)?aa(a):a.childNodes},Y:function(a){if(B(a)){a=b.e.childNodes(a);for(var d=0,c=a.length;d<c;d++)b.removeNode(a[d])}else b.a.ka(a)},N:function(a,d){if(B(a)){b.e.Y(a);for(var c=a.nextSibling,e=0,f=d.length;e<f;e++)c.parentNode.insertBefore(d[e],c)}else b.a.N(a,d)},Va:function(a,b){B(a)?a.parentNode.insertBefore(b,a.nextSibling):a.firstChild?a.insertBefore(b,a.firstChild):a.appendChild(b)},Pa:function(a,d,c){c?B(a)?a.parentNode.insertBefore(d,
3046 c.nextSibling):c.nextSibling?a.insertBefore(d,c.nextSibling):a.appendChild(d):b.e.Va(a,d)},firstChild:function(a){return!B(a)?a.firstChild:!a.nextSibling||H(a.nextSibling)?p:a.nextSibling},nextSibling:function(a){B(a)&&(a=$(a));return a.nextSibling&&H(a.nextSibling)?p:a.nextSibling},jb:function(a){return(a=B(a))?a[1]:p},Ta:function(a){if(pa[b.a.u(a)]){var d=a.firstChild;if(d){do if(1===d.nodeType){var c;c=d.firstChild;var e=p;if(c){do if(e)e.push(c);else if(B(c)){var f=$(c,m);f?c=f:e=[c]}else H(c)&&
3047 (e=[c]);while(c=c.nextSibling)}if(c=e){e=d.nextSibling;for(f=0;f<c.length;f++)e?a.insertBefore(c[f],e):a.appendChild(c[f])}}while(d=d.nextSibling)}}}};b.b("virtualElements",b.e);b.b("virtualElements.allowedBindings",b.e.I);b.b("virtualElements.emptyNode",b.e.Y);b.b("virtualElements.insertAfter",b.e.Pa);b.b("virtualElements.prepend",b.e.Va);b.b("virtualElements.setDomNodeChildren",b.e.N);b.J=function(){this.Ha={}};b.a.extend(b.J.prototype,{nodeHasBindings:function(a){switch(a.nodeType){case 1:return a.getAttribute("data-bind")!=
3048 p;case 8:return b.e.jb(a)!=p;default:return r}},getBindings:function(a,b){var c=this.getBindingsString(a,b);return c?this.parseBindingsString(c,b,a):p},getBindingsString:function(a){switch(a.nodeType){case 1:return a.getAttribute("data-bind");case 8:return b.e.jb(a);default:return p}},parseBindingsString:function(a,d,c){try{var e;if(!(e=this.Ha[a])){var f=this.Ha,g,h="with($context){with($data||{}){return{"+b.g.ba(a)+"}}}";g=new Function("$context","$element",h);e=f[a]=g}return e(d,c)}catch(k){j(Error("Unable to parse bindings.\nMessage: "+
3049 k+";\nBindings value: "+a))}}});b.J.instance=new b.J;b.b("bindingProvider",b.J);b.c={};b.z=function(a,d,c){d?(b.a.extend(this,d),this.$parentContext=d,this.$parent=d.$data,this.$parents=(d.$parents||[]).slice(0),this.$parents.unshift(this.$parent)):(this.$parents=[],this.$root=a,this.ko=b);this.$data=a;c&&(this[c]=a)};b.z.prototype.createChildContext=function(a,d){return new b.z(a,this,d)};b.z.prototype.extend=function(a){var d=b.a.extend(new b.z,this);return b.a.extend(d,a)};b.eb=function(a,d){if(2==
3050 arguments.length)b.a.f.set(a,"__ko_bindingContext__",d);else return b.a.f.get(a,"__ko_bindingContext__")};b.Fa=function(a,d,c){1===a.nodeType&&b.e.Ta(a);return X(a,d,c,m)};b.Ea=function(a,b){(1===b.nodeType||8===b.nodeType)&&Z(a,b,m)};b.Da=function(a,b){b&&(1!==b.nodeType&&8!==b.nodeType)&&j(Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"));b=b||x.document.body;Y(a,b,m)};b.ja=function(a){switch(a.nodeType){case 1:case 8:var d=b.eb(a);if(d)return d;
3051 if(a.parentNode)return b.ja(a.parentNode)}return I};b.pb=function(a){return(a=b.ja(a))?a.$data:I};b.b("bindingHandlers",b.c);b.b("applyBindings",b.Da);b.b("applyBindingsToDescendants",b.Ea);b.b("applyBindingsToNode",b.Fa);b.b("contextFor",b.ja);b.b("dataFor",b.pb);var fa={"class":"className","for":"htmlFor"};b.c.attr={update:function(a,d){var c=b.a.d(d())||{},e;for(e in c)if("string"==typeof e){var f=b.a.d(c[e]),g=f===r||f===p||f===I;g&&a.removeAttribute(e);8>=b.a.Z&&e in fa?(e=fa[e],g?a.removeAttribute(e):
3052 a[e]=f):g||a.setAttribute(e,f.toString());"name"===e&&b.a.ab(a,g?"":f.toString())}}};b.c.checked={init:function(a,d,c){b.a.n(a,"click",function(){var e;if("checkbox"==a.type)e=a.checked;else if("radio"==a.type&&a.checked)e=a.value;else return;var f=d(),g=b.a.d(f);"checkbox"==a.type&&g instanceof Array?(e=b.a.i(g,a.value),a.checked&&0>e?f.push(a.value):!a.checked&&0<=e&&f.splice(e,1)):b.g.ea(f,c,"checked",e,m)});"radio"==a.type&&!a.name&&b.c.uniqueName.init(a,u(m))},update:function(a,d){var c=b.a.d(d());
3053 "checkbox"==a.type?a.checked=c instanceof Array?0<=b.a.i(c,a.value):c:"radio"==a.type&&(a.checked=a.value==c)}};b.c.css={update:function(a,d){var c=b.a.d(d());if("object"==typeof c)for(var e in c){var f=b.a.d(c[e]);b.a.da(a,e,f)}else c=String(c||""),b.a.da(a,a.__ko__cssValue,r),a.__ko__cssValue=c,b.a.da(a,c,m)}};b.c.enable={update:function(a,d){var c=b.a.d(d());c&&a.disabled?a.removeAttribute("disabled"):!c&&!a.disabled&&(a.disabled=m)}};b.c.disable={update:function(a,d){b.c.enable.update(a,function(){return!b.a.d(d())})}};
3054 b.c.event={init:function(a,d,c,e){var f=d()||{},g;for(g in f)(function(){var f=g;"string"==typeof f&&b.a.n(a,f,function(a){var g,n=d()[f];if(n){var q=c();try{var s=b.a.L(arguments);s.unshift(e);g=n.apply(e,s)}finally{g!==m&&(a.preventDefault?a.preventDefault():a.returnValue=r)}q[f+"Bubble"]===r&&(a.cancelBubble=m,a.stopPropagation&&a.stopPropagation())}})})()}};b.c.foreach={Sa:function(a){return function(){var d=a(),c=b.a.ua(d);if(!c||"number"==typeof c.length)return{foreach:d,templateEngine:b.C.oa};
3055 b.a.d(d);return{foreach:c.data,as:c.as,includeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,beforeMove:c.beforeMove,afterMove:c.afterMove,templateEngine:b.C.oa}}},init:function(a,d){return b.c.template.init(a,b.c.foreach.Sa(d))},update:function(a,d,c,e,f){return b.c.template.update(a,b.c.foreach.Sa(d),c,e,f)}};b.g.Q.foreach=r;b.e.I.foreach=m;b.c.hasfocus={init:function(a,d,c){function e(e){a.__ko_hasfocusUpdating=m;var f=a.ownerDocument;"activeElement"in
3056 f&&(e=f.activeElement===a);f=d();b.g.ea(f,c,"hasfocus",e,m);a.__ko_hasfocusUpdating=r}var f=e.bind(p,m),g=e.bind(p,r);b.a.n(a,"focus",f);b.a.n(a,"focusin",f);b.a.n(a,"blur",g);b.a.n(a,"focusout",g)},update:function(a,d){var c=b.a.d(d());a.__ko_hasfocusUpdating||(c?a.focus():a.blur(),b.r.K(b.a.Ba,p,[a,c?"focusin":"focusout"]))}};b.c.html={init:function(){return{controlsDescendantBindings:m}},update:function(a,d){b.a.ca(a,d())}};var da="__ko_withIfBindingData";Q("if");Q("ifnot",r,m);Q("with",m,r,function(a,
3057 b){return a.createChildContext(b)});b.c.options={update:function(a,d,c){"select"!==b.a.u(a)&&j(Error("options binding applies only to SELECT elements"));for(var e=0==a.length,f=b.a.V(b.a.fa(a.childNodes,function(a){return a.tagName&&"option"===b.a.u(a)&&a.selected}),function(a){return b.k.q(a)||a.innerText||a.textContent}),g=a.scrollTop,h=b.a.d(d());0<a.length;)b.A(a.options[0]),a.remove(0);if(h){c=c();var k=c.optionsIncludeDestroyed;"number"!=typeof h.length&&(h=[h]);if(c.optionsCaption){var l=y.createElement("option");
3058 b.a.ca(l,c.optionsCaption);b.k.T(l,I);a.appendChild(l)}d=0;for(var n=h.length;d<n;d++){var q=h[d];if(!q||!q._destroy||k){var l=y.createElement("option"),s=function(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c},v=s(q,c.optionsValue,q);b.k.T(l,b.a.d(v));q=s(q,c.optionsText,v);b.a.cb(l,q);a.appendChild(l)}}h=a.getElementsByTagName("option");d=k=0;for(n=h.length;d<n;d++)0<=b.a.i(f,b.k.q(h[d]))&&(b.a.bb(h[d],m),k++);a.scrollTop=g;e&&"value"in c&&ea(a,b.a.ua(c.value),m);b.a.ub(a)}}};
3059 b.c.options.sa="__ko.optionValueDomData__";b.c.selectedOptions={init:function(a,d,c){b.a.n(a,"change",function(){var e=d(),f=[];b.a.o(a.getElementsByTagName("option"),function(a){a.selected&&f.push(b.k.q(a))});b.g.ea(e,c,"value",f)})},update:function(a,d){"select"!=b.a.u(a)&&j(Error("values binding applies only to SELECT elements"));var c=b.a.d(d());c&&"number"==typeof c.length&&b.a.o(a.getElementsByTagName("option"),function(a){var d=0<=b.a.i(c,b.k.q(a));b.a.bb(a,d)})}};b.c.style={update:function(a,
3060 d){var c=b.a.d(d()||{}),e;for(e in c)if("string"==typeof e){var f=b.a.d(c[e]);a.style[e]=f||""}}};b.c.submit={init:function(a,d,c,e){"function"!=typeof d()&&j(Error("The value for a submit binding must be a function"));b.a.n(a,"submit",function(b){var c,h=d();try{c=h.call(e,a)}finally{c!==m&&(b.preventDefault?b.preventDefault():b.returnValue=r)}})}};b.c.text={update:function(a,d){b.a.cb(a,d())}};b.e.I.text=m;b.c.uniqueName={init:function(a,d){if(d()){var c="ko_unique_"+ ++b.c.uniqueName.ob;b.a.ab(a,
3061 c)}}};b.c.uniqueName.ob=0;b.c.value={init:function(a,d,c){function e(){h=r;var e=d(),f=b.k.q(a);b.g.ea(e,c,"value",f)}var f=["change"],g=c().valueUpdate,h=r;g&&("string"==typeof g&&(g=[g]),b.a.P(f,g),f=b.a.Ga(f));if(b.a.Z&&("input"==a.tagName.toLowerCase()&&"text"==a.type&&"off"!=a.autocomplete&&(!a.form||"off"!=a.form.autocomplete))&&-1==b.a.i(f,"propertychange"))b.a.n(a,"propertychange",function(){h=m}),b.a.n(a,"blur",function(){h&&e()});b.a.o(f,function(c){var d=e;b.a.Ob(c,"after")&&(d=function(){setTimeout(e,
3062 0)},c=c.substring(5));b.a.n(a,c,d)})},update:function(a,d){var c="select"===b.a.u(a),e=b.a.d(d()),f=b.k.q(a),g=e!=f;0===e&&(0!==f&&"0"!==f)&&(g=m);g&&(f=function(){b.k.T(a,e)},f(),c&&setTimeout(f,0));c&&0<a.length&&ea(a,e,r)}};b.c.visible={update:function(a,d){var c=b.a.d(d()),e="none"!=a.style.display;c&&!e?a.style.display="":!c&&e&&(a.style.display="none")}};b.c.click={init:function(a,d,c,e){return b.c.event.init.call(this,a,function(){var a={};a.click=d();return a},c,e)}};b.v=function(){};b.v.prototype.renderTemplateSource=
3063 function(){j(Error("Override renderTemplateSource"))};b.v.prototype.createJavaScriptEvaluatorBlock=function(){j(Error("Override createJavaScriptEvaluatorBlock"))};b.v.prototype.makeTemplateSource=function(a,d){if("string"==typeof a){d=d||y;var c=d.getElementById(a);c||j(Error("Cannot find template with ID "+a));return new b.l.h(c)}if(1==a.nodeType||8==a.nodeType)return new b.l.O(a);j(Error("Unknown template type: "+a))};b.v.prototype.renderTemplate=function(a,b,c,e){a=this.makeTemplateSource(a,e);
3064 return this.renderTemplateSource(a,b,c)};b.v.prototype.isTemplateRewritten=function(a,b){return this.allowTemplateRewriting===r?m:this.makeTemplateSource(a,b).data("isRewritten")};b.v.prototype.rewriteTemplate=function(a,b,c){a=this.makeTemplateSource(a,c);b=b(a.text());a.text(b);a.data("isRewritten",m)};b.b("templateEngine",b.v);var qa=/(<[a-z]+\d*(\s+(?!data-bind=)[a-z0-9\-]+(=(\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind=(["'])([\s\S]*?)\5/gi,ra=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;b.za={vb:function(a,
3065 d,c){d.isTemplateRewritten(a,c)||d.rewriteTemplate(a,function(a){return b.za.Gb(a,d)},c)},Gb:function(a,b){return a.replace(qa,function(a,e,f,g,h,k,l){return W(l,e,b)}).replace(ra,function(a,e){return W(e,"\x3c!-- ko --\x3e",b)})},kb:function(a){return b.s.ra(function(d,c){d.nextSibling&&b.Fa(d.nextSibling,a,c)})}};b.b("__tr_ambtns",b.za.kb);b.l={};b.l.h=function(a){this.h=a};b.l.h.prototype.text=function(){var a=b.a.u(this.h),a="script"===a?"text":"textarea"===a?"value":"innerHTML";if(0==arguments.length)return this.h[a];
3066 var d=arguments[0];"innerHTML"===a?b.a.ca(this.h,d):this.h[a]=d};b.l.h.prototype.data=function(a){if(1===arguments.length)return b.a.f.get(this.h,"templateSourceData_"+a);b.a.f.set(this.h,"templateSourceData_"+a,arguments[1])};b.l.O=function(a){this.h=a};b.l.O.prototype=new b.l.h;b.l.O.prototype.text=function(){if(0==arguments.length){var a=b.a.f.get(this.h,"__ko_anon_template__")||{};a.Aa===I&&a.ia&&(a.Aa=a.ia.innerHTML);return a.Aa}b.a.f.set(this.h,"__ko_anon_template__",{Aa:arguments[0]})};b.l.h.prototype.nodes=
3067 function(){if(0==arguments.length)return(b.a.f.get(this.h,"__ko_anon_template__")||{}).ia;b.a.f.set(this.h,"__ko_anon_template__",{ia:arguments[0]})};b.b("templateSources",b.l);b.b("templateSources.domElement",b.l.h);b.b("templateSources.anonymousTemplate",b.l.O);var O;b.wa=function(a){a!=I&&!(a instanceof b.v)&&j(Error("templateEngine must inherit from ko.templateEngine"));O=a};b.va=function(a,d,c,e,f){c=c||{};(c.templateEngine||O)==I&&j(Error("Set a template engine before calling renderTemplate"));
3068 f=f||"replaceChildren";if(e){var g=N(e);return b.j(function(){var h=d&&d instanceof b.z?d:new b.z(b.a.d(d)),k="function"==typeof a?a(h.$data,h):a,h=T(e,f,k,h,c);"replaceNode"==f&&(e=h,g=N(e))},p,{Ka:function(){return!g||!b.a.X(g)},W:g&&"replaceNode"==f?g.parentNode:g})}return b.s.ra(function(e){b.va(a,d,c,e,"replaceNode")})};b.Mb=function(a,d,c,e,f){function g(a,b){U(b,k);c.afterRender&&c.afterRender(b,a)}function h(d,e){k=f.createChildContext(b.a.d(d),c.as);k.$index=e;var g="function"==typeof a?
3069 a(d,k):a;return T(p,"ignoreTargetNode",g,k,c)}var k;return b.j(function(){var a=b.a.d(d)||[];"undefined"==typeof a.length&&(a=[a]);a=b.a.fa(a,function(a){return c.includeDestroyed||a===I||a===p||!b.a.d(a._destroy)});b.r.K(b.a.$a,p,[e,a,h,c,g])},p,{W:e})};b.c.template={init:function(a,d){var c=b.a.d(d());if("string"!=typeof c&&!c.name&&(1==a.nodeType||8==a.nodeType))c=1==a.nodeType?a.childNodes:b.e.childNodes(a),c=b.a.Hb(c),(new b.l.O(a)).nodes(c);return{controlsDescendantBindings:m}},update:function(a,
3070 d,c,e,f){d=b.a.d(d());c={};e=m;var g,h=p;"string"!=typeof d&&(c=d,d=c.name,"if"in c&&(e=b.a.d(c["if"])),e&&"ifnot"in c&&(e=!b.a.d(c.ifnot)),g=b.a.d(c.data));"foreach"in c?h=b.Mb(d||a,e&&c.foreach||[],c,a,f):e?(f="data"in c?f.createChildContext(g,c.as):f,h=b.va(d||a,f,c,a)):b.e.Y(a);f=h;(g=b.a.f.get(a,"__ko__templateComputedDomDataKey__"))&&"function"==typeof g.B&&g.B();b.a.f.set(a,"__ko__templateComputedDomDataKey__",f&&f.pa()?f:I)}};b.g.Q.template=function(a){a=b.g.aa(a);return 1==a.length&&a[0].unknown||
3071 b.g.Eb(a,"name")?p:"This template engine does not support anonymous templates nested within its templates"};b.e.I.template=m;b.b("setTemplateEngine",b.wa);b.b("renderTemplate",b.va);b.a.Ja=function(a,b,c){a=a||[];b=b||[];return a.length<=b.length?S(a,b,"added","deleted",c):S(b,a,"deleted","added",c)};b.b("utils.compareArrays",b.a.Ja);b.a.$a=function(a,d,c,e,f){function g(a,b){t=l[b];w!==b&&(z[a]=t);t.na(w++);M(t.M);s.push(t);A.push(t)}function h(a,c){if(a)for(var d=0,e=c.length;d<e;d++)c[d]&&b.a.o(c[d].M,
3072 function(b){a(b,d,c[d].U)})}d=d||[];e=e||{};var k=b.a.f.get(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult")===I,l=b.a.f.get(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult")||[],n=b.a.V(l,function(a){return a.U}),q=b.a.Ja(n,d),s=[],v=0,w=0,B=[],A=[];d=[];for(var z=[],n=[],t,D=0,C,E;C=q[D];D++)switch(E=C.moved,C.status){case "deleted":E===I&&(t=l[v],t.j&&t.j.B(),B.push.apply(B,M(t.M)),e.beforeRemove&&(d[D]=t,A.push(t)));v++;break;case "retained":g(D,v++);break;case "added":E!==I?
3073 g(D,E):(t={U:C.value,na:b.m(w++)},s.push(t),A.push(t),k||(n[D]=t))}h(e.beforeMove,z);b.a.o(B,e.beforeRemove?b.A:b.removeNode);for(var D=0,k=b.e.firstChild(a),H;t=A[D];D++){t.M||b.a.extend(t,ha(a,c,t.U,f,t.na));for(v=0;q=t.M[v];k=q.nextSibling,H=q,v++)q!==k&&b.e.Pa(a,q,H);!t.Ab&&f&&(f(t.U,t.M,t.na),t.Ab=m)}h(e.beforeRemove,d);h(e.afterMove,z);h(e.afterAdd,n);b.a.f.set(a,"setDomNodeChildrenFromArrayMapping_lastMappingResult",s)};b.b("utils.setDomNodeChildrenFromArrayMapping",b.a.$a);b.C=function(){this.allowTemplateRewriting=
3074 r};b.C.prototype=new b.v;b.C.prototype.renderTemplateSource=function(a){var d=!(9>b.a.Z)&&a.nodes?a.nodes():p;if(d)return b.a.L(d.cloneNode(m).childNodes);a=a.text();return b.a.ta(a)};b.C.oa=new b.C;b.wa(b.C.oa);b.b("nativeTemplateEngine",b.C);b.qa=function(){var a=this.Db=function(){if("undefined"==typeof F||!F.tmpl)return 0;try{if(0<=F.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,c,e){e=e||{};2>a&&j(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));
3075 var f=b.data("precompiled");f||(f=b.text()||"",f=F.template(p,"{{ko_with $item.koBindingContext}}"+f+"{{/ko_with}}"),b.data("precompiled",f));b=[c.$data];c=F.extend({koBindingContext:c},e.templateOptions);c=F.tmpl(f,b,c);c.appendTo(y.createElement("div"));F.fragments={};return c};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){y.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(F.tmpl.tag.ko_code=
3076 {open:"__.push($1 || '');"},F.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};b.qa.prototype=new b.v;w=new b.qa;0<w.Db&&b.wa(w);b.b("jqueryTmplTemplateEngine",b.qa)}"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?L(module.exports||exports):"function"===typeof define&&define.amd?define(["exports"],L):L(x.ko={});m;
3077 })();
3078 </script>
3079<?php endif; ?>
3080
3081<script type="text/javascript">
3082/* json2.js
3083 * See www.JSON.org/js.html*/
3084if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n;}
3085Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+
3086f(this.getUTCMonth()+1)+'-'+
3087f(this.getUTCDate())+'T'+
3088f(this.getUTCHours())+':'+
3089f(this.getUTCMinutes())+':'+
3090f(this.getUTCSeconds())+'Z';};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case'string':return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c;}
3091c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+
3092(c%16).toString(16);})+'"':'"'+value+'"';case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
3093if(typeof value.toJSON==='function'){return stringify(value.toJSON());}
3094a=[];if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||'null');}
3095return'['+a.join(',')+']';}
3096if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}else{for(k in value){if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}
3097return'{'+a.join(',')+'}';}}
3098return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==='object'){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n;}}}}
3099return filter(k,v);}
3100if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof filter==='function'?walk('',j):j;}
3101throw new SyntaxError('parseJSON');}};}();}
3102</script>
3103
3104<script type="text/javascript">
3105/**
3106 * password_strength_plugin.js
3107 * Copyright (c) 20010 myPocket technologies (www.mypocket-technologies.com)
3108 * @author Darren Mason (djmason9@gmail.com)
3109 * @date 3/13/2009
3110 * @projectDescription Password Strength Meter is a jQuery plug-in provide you smart algorithm to detect a password strength.
3111 * Based on Firas Kassem orginal plugin - phiras.wordpress.com/2007/04/08/password-strength-meter-a-jquery-plugin/
3112 * @version 1.0.1 */
3113(function(a){a.fn.shortPass="Too short";a.fn.badPass="Weak";a.fn.goodPass="Good";a.fn.strongPass="Strong";a.fn.samePassword="Username and Password identical.";a.fn.resultStyle="";a.fn.passStrength=function(b){var d={shortPass:"shortPass",badPass:"badPass",goodPass:"goodPass",strongPass:"strongPass",baseStyle:"testresult",userid:"",messageloc:1};
3114var c=a.extend(d,b);return this.each(function(){var e=a(this);a(e).unbind().keyup(function(){var f=a.fn.teststrength(a(this).val(),a(c.userid).val(),c);if(c.messageloc===1){a(this).next("."+c.baseStyle).remove();a(this).after('<span class="'+c.baseStyle+'"><span></span></span>');a(this).next("."+c.baseStyle).addClass(a(this).resultStyle).find("span").text(f)
3115}else{a(this).prev("."+c.baseStyle).remove();a(this).before('<span class="'+c.baseStyle+'"><span></span></span>');a(this).prev("."+c.baseStyle).addClass(a(this).resultStyle).find("span").text(f)}});a.fn.teststrength=function(f,i,g){var h=0;if(f.length<4){this.resultStyle=g.shortPass;return a(this).shortPass
3116}if(f.toLowerCase()==i.toLowerCase()){this.resultStyle=g.badPass;return a(this).samePassword}h+=f.length*4;h+=(a.fn.checkRepetition(1,f).length-f.length)*1;h+=(a.fn.checkRepetition(2,f).length-f.length)*1;h+=(a.fn.checkRepetition(3,f).length-f.length)*1;h+=(a.fn.checkRepetition(4,f).length-f.length)*1;
3117if(f.match(/(.*[0-9].*[0-9].*[0-9])/)){h+=5}if(f.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){h+=5}if(f.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){h+=10}if(f.match(/([a-zA-Z])/)&&f.match(/([0-9])/)){h+=15}if(f.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&f.match(/([0-9])/)){h+=15}if(f.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&f.match(/([a-zA-Z])/)){h+=15
3118}if(f.match(/^\w+$/)||f.match(/^\d+$/)){h-=10}if(h<0){h=0}if(h>100){h=100}if(h<34){this.resultStyle=g.badPass;return a(this).badPass}if(h<68){this.resultStyle=g.goodPass;return a(this).goodPass}this.resultStyle=g.strongPass;return a(this).strongPass}})}})(jQuery);$.fn.checkRepetition=function(a,f){var d="";
3119for(var c=0;c<f.length;c++){var e=true;for(var b=0;b<a&&(b+c+a)<f.length;b++){e=e&&(f.charAt(b+c)==f.charAt(b+c+a))}if(b<a){e=false}if(e){c+=a-1;e=false}else{d+=f.charAt(c)}}return d};
3120</script>
3121
3122
3123<script type="text/javascript">
3124/*!
3125* Parsley.js
3126* Version 2.3.5 - built Sun, Feb 28th 2016, 6:25 am
3127* http://parsleyjs.org
3128* Guillaume Potier - <guillaume@wisembly.com>
3129* Marc-Andre Lafortune - <petroselinum@marc-andre.ca>
3130* MIT Licensed
3131*/
3132function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}var _slice=Array.prototype.slice;!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):e.parsley=t(e.jQuery)}(this,function(e){"use strict";function t(e,t){return e.parsleyAdaptedCallback||(e.parsleyAdaptedCallback=function(){var i=Array.prototype.slice.call(arguments,0);i.unshift(this),e.apply(t||A,i)}),e.parsleyAdaptedCallback}function i(e){return 0===e.lastIndexOf(D,0)?e.substr(D.length):e}var n=1,r={},s={attr:function(e,t,i){var n,r,s,a=new RegExp("^"+t,"i");if("undefined"==typeof i)i={};else for(n in i)i.hasOwnProperty(n)&&delete i[n];if("undefined"==typeof e||"undefined"==typeof e[0])return i;for(s=e[0].attributes,n=s.length;n--;)r=s[n],r&&r.specified&&a.test(r.name)&&(i[this.camelize(r.name.slice(t.length))]=this.deserializeValue(r.value));return i},checkAttr:function(e,t,i){return e.is("["+t+i+"]")},setAttr:function(e,t,i,n){e[0].setAttribute(this.dasherize(t+i),String(n))},generateID:function(){return""+n++},deserializeValue:function(t){var i;try{return t?"true"==t||("false"==t?!1:"null"==t?null:isNaN(i=Number(t))?/^[\[\{]/.test(t)?e.parseJSON(t):t:i):t}catch(n){return t}},camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},dasherize:function(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()},warn:function(){var e;window.console&&"function"==typeof window.console.warn&&(e=window.console).warn.apply(e,arguments)},warnOnce:function(e){r[e]||(r[e]=!0,this.warn.apply(this,arguments))},_resetWarnings:function(){r={}},trimString:function(e){return e.replace(/^\s+|\s+$/g,"")},namespaceEvents:function(t,i){return t=this.trimString(t||"").split(/\s+/),t[0]?e.map(t,function(e){return e+"."+i}).join(" "):""},objectCreate:Object.create||function(){var e=function(){};return function(t){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");e.prototype=t;var i=new e;return e.prototype=null,i}}()},a=s,o={namespace:"data-parsley-",inputs:"input, textarea, select",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden]",priorityEnabled:!0,multiple:null,group:null,uiEnabled:!0,validationThreshold:3,focus:"first",trigger:!1,triggerAfterFailure:"input",errorClass:"parsley-error",successClass:"parsley-success",classHandler:function(e){},errorsContainer:function(e){},errorsWrapper:'<ul class="parsley-errors-list"></ul>',errorTemplate:"<li></li>"},l=function(){};l.prototype={asyncSupport:!0,actualizeOptions:function(){return a.attr(this.$element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(e){this.domOptions=a.objectCreate(this.parent.options),this.options=a.objectCreate(this.domOptions);for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t]);this.actualizeOptions()},_listeners:null,on:function(e,t){this._listeners=this._listeners||{};var i=this._listeners[e]=this._listeners[e]||[];return i.push(t),this},subscribe:function(t,i){e.listenTo(this,t.toLowerCase(),i)},off:function(e,t){var i=this._listeners&&this._listeners[e];if(i)if(t)for(var n=i.length;n--;)i[n]===t&&i.splice(n,1);else delete this._listeners[e];return this},unsubscribe:function(t,i){e.unsubscribeTo(this,t.toLowerCase())},trigger:function(e,t,i){t=t||this;var n,r=this._listeners&&this._listeners[e];if(r)for(var s=r.length;s--;)if(n=r[s].call(t,t,i),n===!1)return n;return this.parent?this.parent.trigger(e,t,i):!0},reset:function(){if("ParsleyForm"!==this.__class__)return this._resetUI(),this._trigger("reset");for(var e=0;e<this.fields.length;e++)this.fields[e].reset();this._trigger("reset")},destroy:function(){if(this._destroyUI(),"ParsleyForm"!==this.__class__)return this.$element.removeData("Parsley"),this.$element.removeData("ParsleyFieldMultiple"),void this._trigger("destroy");for(var e=0;e<this.fields.length;e++)this.fields[e].destroy();this.$element.removeData("Parsley"),this._trigger("destroy")},asyncIsValid:function(e,t){return a.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:e,force:t})},_findRelated:function(){return this.options.multiple?this.parent.$element.find("["+this.options.namespace+'multiple="'+this.options.multiple+'"]'):this.$element}};var u={string:function(e){return e},integer:function(e){if(isNaN(e))throw'Requirement is not an integer: "'+e+'"';return parseInt(e,10)},number:function(e){if(isNaN(e))throw'Requirement is not a number: "'+e+'"';return parseFloat(e)},reference:function(t){var i=e(t);if(0===i.length)throw'No such reference: "'+t+'"';return i},"boolean":function(e){return"false"!==e},object:function(e){return a.deserializeValue(e)},regexp:function(e){var t="";return/^\/.*\/(?:[gimy]*)$/.test(e)?(t=e.replace(/.*\/([gimy]*)$/,"$1"),e=e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1")):e="^"+e+"$",new RegExp(e,t)}},d=function(e,t){var i=e.match(/^\s*\[(.*)\]\s*$/);if(!i)throw'Requirement is not an array: "'+e+'"';var n=i[1].split(",").map(a.trimString);if(n.length!==t)throw"Requirement has "+n.length+" values when "+t+" are needed";return n},h=function(e,t){var i=u[e||"string"];if(!i)throw'Unknown requirement specification: "'+e+'"';return i(t)},p=function(e,t,i){var n=null,r={};for(var s in e)if(s){var a=i(s);"string"==typeof a&&(a=h(e[s],a)),r[s]=a}else n=h(e[s],t);return[n,r]},f=function(t){e.extend(!0,this,t)};f.prototype={validate:function(t,i){if(this.fn)return arguments.length>3&&(i=[].slice.call(arguments,1,-1)),this.fn.call(this,t,i);if(e.isArray(t)){if(!this.validateMultiple)throw"Validator `"+this.name+"` does not handle multiple values";return this.validateMultiple.apply(this,arguments)}if(this.validateNumber)return isNaN(t)?!1:(arguments[0]=parseFloat(arguments[0]),this.validateNumber.apply(this,arguments));if(this.validateString)return this.validateString.apply(this,arguments);throw"Validator `"+this.name+"` only handles multiple values"},parseRequirements:function(t,i){if("string"!=typeof t)return e.isArray(t)?t:[t];var n=this.requirementType;if(e.isArray(n)){for(var r=d(t,n.length),s=0;s<r.length;s++)r[s]=h(n[s],r[s]);return r}return e.isPlainObject(n)?p(n,t,i):[h(n,t)]},requirementType:"string",priority:2};var c=function(e,t){this.__class__="ParsleyValidatorRegistry",this.locale="en",this.init(e||{},t||{})},m={email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,number:/^-?(\d*\.)?\d+(e[-+]?\d+)?$/i,integer:/^-?\d+$/,digits:/^\d+$/,alphanum:/^\w+$/i,url:new RegExp("^(?:(?:https?|ftp)://)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:/\\S*)?$","i")};m.range=m.number;var g=function(e){var t=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0};c.prototype={init:function(t,i){this.catalog=i,this.validators=e.extend({},this.validators);for(var n in t)this.addValidator(n,t[n].fn,t[n].priority);window.Parsley.trigger("parsley:validator:init")},setLocale:function(e){if("undefined"==typeof this.catalog[e])throw new Error(e+" is not available in the catalog");return this.locale=e,this},addCatalog:function(e,t,i){return"object"==typeof t&&(this.catalog[e]=t),!0===i?this.setLocale(e):this},addMessage:function(e,t,i){return"undefined"==typeof this.catalog[e]&&(this.catalog[e]={}),this.catalog[e][t]=i,this},addMessages:function(e,t){for(var i in t)this.addMessage(e,i,t[i]);return this},addValidator:function(e,t,i){if(this.validators[e])a.warn('Validator "'+e+'" is already defined.');else if(o.hasOwnProperty(e))return void a.warn('"'+e+'" is a restricted keyword and is not a valid validator name.');return this._setValidator.apply(this,arguments)},updateValidator:function(e,t,i){return this.validators[e]?this._setValidator(this,arguments):(a.warn('Validator "'+e+'" is not already defined.'),this.addValidator.apply(this,arguments))},removeValidator:function(e){return this.validators[e]||a.warn('Validator "'+e+'" is not defined.'),delete this.validators[e],this},_setValidator:function(e,t,i){"object"!=typeof t&&(t={fn:t,priority:i}),t.validate||(t=new f(t)),this.validators[e]=t;for(var n in t.messages||{})this.addMessage(n,e,t.messages[n]);return this},getErrorMessage:function(e){var t;if("type"===e.name){var i=this.catalog[this.locale][e.name]||{};t=i[e.requirements]}else t=this.formatMessage(this.catalog[this.locale][e.name],e.requirements);return t||this.catalog[this.locale].defaultMessage||this.catalog.en.defaultMessage},formatMessage:function(e,t){if("object"==typeof t){for(var i in t)e=this.formatMessage(e,t[i]);return e}return"string"==typeof e?e.replace(/%s/i,t):""},validators:{notblank:{validateString:function(e){return/\S/.test(e)},priority:2},required:{validateMultiple:function(e){return e.length>0},validateString:function(e){return/\S/.test(e)},priority:512},type:{validateString:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=i.step,r=void 0===n?"1":n,s=i.base,a=void 0===s?0:s,o=m[t];if(!o)throw new Error("validator type `"+t+"` is not supported");if(!o.test(e))return!1;if("number"===t&&!/^any$/i.test(r||"")){var l=Number(e),u=Math.max(g(r),g(a));if(g(l)>u)return!1;var d=function(e){return Math.round(e*Math.pow(10,u))};if((d(l)-d(a))%d(r)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(e,t){return t.test(e)},requirementType:"regexp",priority:64},minlength:{validateString:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxlength:{validateString:function(e,t){return e.length<=t},requirementType:"integer",priority:30},length:{validateString:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(e,t){return e.length<=t},requirementType:"integer",priority:30},check:{validateMultiple:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},min:{validateNumber:function(e,t){return e>=t},requirementType:"number",priority:30},max:{validateNumber:function(e,t){return t>=e},requirementType:"number",priority:30},range:{validateNumber:function(e,t,i){return e>=t&&i>=e},requirementType:["number","number"],priority:30},equalto:{validateString:function(t,i){var n=e(i);return n.length?t===n.val():t===i},priority:256}}};var y={},v=function T(e,t,i){for(var n=[],r=[],s=0;s<e.length;s++){for(var a=!1,o=0;o<t.length;o++)if(e[s].assert.name===t[o].assert.name){a=!0;break}a?r.push(e[s]):n.push(e[s])}return{kept:r,added:n,removed:i?[]:T(t,e,!0).added}};y.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",'input[type="submit"], button[type="submit"]',function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.$element.attr("novalidate","")},focus:function(){if(this._focusedField=null,!0===this.validationResult||"none"===this.options.focus)return null;for(var e=0;e<this.fields.length;e++){var t=this.fields[e];if(!0!==t.validationResult&&t.validationResult.length>0&&"undefined"==typeof t.options.noFocus&&(this._focusedField=t.$element,"first"===this.options.focus))break}return null===this._focusedField?null:this._focusedField.focus()},_destroyUI:function(){this.$element.off(".Parsley")}},y.Field={_reflowUI:function(){if(this._buildUI(),this._ui){var e=v(this.validationResult,this._ui.lastValidationResult);this._ui.lastValidationResult=this.validationResult,this._manageStatusClass(),this._manageErrorsMessages(e),this._actualizeTriggers(),!e.kept.length&&!e.added.length||this._failedOnce||(this._failedOnce=!0,this._actualizeTriggers())}},getErrorsMessages:function(){if(!0===this.validationResult)return[];for(var e=[],t=0;t<this.validationResult.length;t++)e.push(this.validationResult[t].errorMessage||this._getErrorMessage(this.validationResult[t].assert));return e},addError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r?!0:r;this._buildUI(),this._addError(e,{message:i,assert:n}),s&&this._errorClass()},updateError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r?!0:r;this._buildUI(),this._updateError(e,{message:i,assert:n}),s&&this._errorClass()},removeError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.updateClass,n=void 0===i?!0:i;this._buildUI(),this._removeError(e),n&&this._manageStatusClass()},_manageStatusClass:function(){this.hasConstraints()&&this.needsValidation()&&!0===this.validationResult?this._successClass():this.validationResult.length>0?this._errorClass():this._resetClass()},_manageErrorsMessages:function(t){if("undefined"==typeof this.options.errorsMessagesDisabled){if("undefined"!=typeof this.options.errorMessage)return t.added.length||t.kept.length?(this._insertErrorWrapper(),0===this._ui.$errorsWrapper.find(".parsley-custom-error-message").length&&this._ui.$errorsWrapper.append(e(this.options.errorTemplate).addClass("parsley-custom-error-message")),this._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(this.options.errorMessage)):this._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove();for(var i=0;i<t.removed.length;i++)this._removeError(t.removed[i].assert.name);for(i=0;i<t.added.length;i++)this._addError(t.added[i].assert.name,{message:t.added[i].errorMessage,assert:t.added[i].assert});for(i=0;i<t.kept.length;i++)this._updateError(t.kept[i].assert.name,{message:t.kept[i].errorMessage,assert:t.kept[i].assert})}},_addError:function(t,i){var n=i.message,r=i.assert;this._insertErrorWrapper(),this._ui.$errorsWrapper.addClass("filled").append(e(this.options.errorTemplate).addClass("parsley-"+t).html(n||this._getErrorMessage(r)))},_updateError:function(e,t){var i=t.message,n=t.assert;this._ui.$errorsWrapper.addClass("filled").find(".parsley-"+e).html(i||this._getErrorMessage(n))},_removeError:function(e){this._ui.$errorsWrapper.removeClass("filled").find(".parsley-"+e).remove()},_getErrorMessage:function(e){var t=e.name+"Message";return"undefined"!=typeof this.options[t]?window.Parsley.formatMessage(this.options[t],e.requirements):window.Parsley.getErrorMessage(e)},_buildUI:function(){if(!this._ui&&!1!==this.options.uiEnabled){var t={};this.$element.attr(this.options.namespace+"id",this.__id__),t.$errorClassHandler=this._manageClassHandler(),t.errorsWrapperId="parsley-id-"+(this.options.multiple?"multiple-"+this.options.multiple:this.__id__),t.$errorsWrapper=e(this.options.errorsWrapper).attr("id",t.errorsWrapperId),t.lastValidationResult=[],t.validationInformationVisible=!1,this._ui=t}},_manageClassHandler:function(){if("string"==typeof this.options.classHandler&&e(this.options.classHandler).length)return e(this.options.classHandler);var t=this.options.classHandler.call(this,this);return"undefined"!=typeof t&&t.length?t:!this.options.multiple||this.$element.is("select")?this.$element:this.$element.parent()},_insertErrorWrapper:function(){var t;if(0!==this._ui.$errorsWrapper.parent().length)return this._ui.$errorsWrapper.parent();if("string"==typeof this.options.errorsContainer){if(e(this.options.errorsContainer).length)return e(this.options.errorsContainer).append(this._ui.$errorsWrapper);a.warn("The errors container `"+this.options.errorsContainer+"` does not exist in DOM")}else"function"==typeof this.options.errorsContainer&&(t=this.options.errorsContainer.call(this,this));if("undefined"!=typeof t&&t.length)return t.append(this._ui.$errorsWrapper);var i=this.$element;return this.options.multiple&&(i=i.parent()),i.after(this._ui.$errorsWrapper)},_actualizeTriggers:function(){var e=this,t=this._findRelated();t.off(".Parsley"),this._failedOnce?t.on(a.namespaceEvents(this.options.triggerAfterFailure,"Parsley"),function(){e.validate()}):t.on(a.namespaceEvents(this.options.trigger,"Parsley"),function(t){e._eventValidate(t)})},_eventValidate:function(e){(!/key|input/.test(e.type)||this._ui&&this._ui.validationInformationVisible||!(this.getValue().length<=this.options.validationThreshold))&&this.validate()},_resetUI:function(){this._failedOnce=!1,this._actualizeTriggers(),"undefined"!=typeof this._ui&&(this._ui.$errorsWrapper.removeClass("filled").children().remove(),this._resetClass(),this._ui.lastValidationResult=[],this._ui.validationInformationVisible=!1)},_destroyUI:function(){this._resetUI(),"undefined"!=typeof this._ui&&this._ui.$errorsWrapper.remove(),delete this._ui},_successClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass)},_errorClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass)},_resetClass:function(){this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass)}};var _=function(t,i,n){this.__class__="ParsleyForm",this.__id__=a.generateID(),this.$element=e(t),this.domOptions=i,this.options=n,this.parent=window.Parsley,this.fields=[],this.validationResult=null},w={pending:null,resolved:!0,rejected:!1};_.prototype={onSubmitValidate:function(e){var t=this;if(!0!==e.parsley){var i=this._$submitSource||this.$element.find('input[type="submit"], button[type="submit"]').first();if(this._$submitSource=null,this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!0),!i.is("[formnovalidate]")){var n=this.whenValidate({event:e});"resolved"===n.state()&&!1!==this._trigger("submit")||(e.stopImmediatePropagation(),e.preventDefault(),"pending"===n.state()&&n.done(function(){t._submit(i)}))}}},onSubmitButton:function(t){this._$submitSource=e(t.target)},_submit:function(t){if(!1!==this._trigger("submit")){if(t){var i=this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!1);0===i.length&&(i=e('<input class="parsley-synthetic-submit-button" type="hidden">').appendTo(this.$element)),i.attr({name:t.attr("name"),value:t.attr("value")})}this.$element.trigger(e.extend(e.Event("submit"),{parsley:!0}))}},validate:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1],s=i[2];t={group:n,force:r,event:s}}return w[this.whenValidate(t).state()]},whenValidate:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.group,r=i.force,s=i.event;this.submitEvent=s,s&&(this.submitEvent=e.extend({},s,{preventDefault:function(){a.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`"),t.validationResult=!1}})),this.validationResult=!0,this._trigger("validate"),this._refreshFields();var o=this._withoutReactualizingFormOptions(function(){return e.map(t.fields,function(e){return e.whenValidate({force:r,group:n})})}),l=function(){var i=e.Deferred();return!1===t.validationResult&&i.reject(),i.resolve().promise()};return e.when.apply(e,_toConsumableArray(o)).done(function(){t._trigger("success")}).fail(function(){t.validationResult=!1,t.focus(),t._trigger("error")}).always(function(){t._trigger("validated")}).pipe(l,l)},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={group:n,force:r}}return w[this.whenValid(t).state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.group,r=i.force;this._refreshFields();var s=this._withoutReactualizingFormOptions(function(){return e.map(t.fields,function(e){return e.whenValid({group:n,force:r})})});return e.when.apply(e,_toConsumableArray(s))},_refreshFields:function(){return this.actualizeOptions()._bindFields()},_bindFields:function(){var t=this,i=this.fields;return this.fields=[],this.fieldsMappedById={},this._withoutReactualizingFormOptions(function(){t.$element.find(t.options.inputs).not(t.options.excluded).each(function(e,i){var n=new window.Parsley.Factory(i,{},t);"ParsleyField"!==n.__class__&&"ParsleyFieldMultiple"!==n.__class__||!0===n.options.excluded||"undefined"==typeof t.fieldsMappedById[n.__class__+"-"+n.__id__]&&(t.fieldsMappedById[n.__class__+"-"+n.__id__]=n,t.fields.push(n))}),e(i).not(t.fields).each(function(e,t){t._trigger("reset")})}),this},_withoutReactualizingFormOptions:function(e){var t=this.actualizeOptions;this.actualizeOptions=function(){return this};var i=e();return this.actualizeOptions=t,i},_trigger:function(e){return this.trigger("form:"+e)}};var b=function(t,i,n,r,s){if(!/ParsleyField/.test(t.__class__))throw new Error("ParsleyField or ParsleyFieldMultiple instance expected");var a=window.Parsley._validatorRegistry.validators[i],o=new f(a);e.extend(this,{validator:o,name:i,requirements:n,priority:r||t.options[i+"Priority"]||o.priority,isDomConstraint:!0===s}),this._parseRequirements(t.options)},F=function(e){var t=e[0].toUpperCase();return t+e.slice(1)};b.prototype={validate:function(e,t){var i=this.requirementList.slice(0);return i.unshift(e),i.push(t),this.validator.validate.apply(this.validator,i)},_parseRequirements:function(e){var t=this;this.requirementList=this.validator.parseRequirements(this.requirements,function(i){return e[t.name+F(i)]})}};var C=function(t,i,n,r){this.__class__="ParsleyField",this.__id__=a.generateID(),this.$element=e(t),"undefined"!=typeof r&&(this.parent=r),this.options=n,this.domOptions=i,this.constraints=[],this.constraintsByName={},this.validationResult=[],this._bindConstraints()},$={pending:null,resolved:!0,rejected:!1};C.prototype={validate:function(t){arguments.length>=1&&!e.isPlainObject(t)&&(a.warnOnce("Calling validate on a parsley field without passing arguments as an object is deprecated."),t={options:t});var i=this.whenValidate(t);if(!i)return!0;switch(i.state()){case"pending":return null;case"resolved":return!0;case"rejected":return this.validationResult}},whenValidate:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=t.force,n=t.group;return this.refreshConstraints(),!n||this._isInGroup(n)?(this.value=this.getValue(),this._trigger("validate"),this.whenValid({force:i,value:this.value,_refreshed:!0}).always(function(){e._reflowUI()}).done(function(){e._trigger("success")}).fail(function(){e._trigger("error")}).always(function(){e._trigger("validated")})):void 0},hasConstraints:function(){return 0!==this.constraints.length},needsValidation:function(e){return"undefined"==typeof e&&(e=this.getValue()),e.length||this._isRequired()||"undefined"!=typeof this.options.validateIfEmpty?!0:!1},_isInGroup:function(t){return e.isArray(this.options.group)?-1!==e.inArray(t,this.options.group):this.options.group===t},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley field without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={force:n,value:r}}var s=this.whenValid(t);return s?$[s.state()]:!0},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=void 0===n?!1:n,s=i.value,a=i.group,o=i._refreshed;if(o||this.refreshConstraints(),!a||this._isInGroup(a)){if(this.validationResult=!0,!this.hasConstraints())return e.when();if(("undefined"==typeof s||null===s)&&(s=this.getValue()),!this.needsValidation(s)&&!0!==r)return e.when();var l=this._getGroupedConstraints(),u=[];return e.each(l,function(i,n){var r=e.when.apply(e,_toConsumableArray(e.map(n,function(e){return t._validateConstraint(s,e)})));return u.push(r),"rejected"===r.state()?!1:void 0}),e.when.apply(e,u)}},_validateConstraint:function(t,i){var n=this,r=i.validate(t,this);return!1===r&&(r=e.Deferred().reject()),e.when(r).fail(function(e){!0===n.validationResult&&(n.validationResult=[]),n.validationResult.push({assert:i,errorMessage:"string"==typeof e&&e})})},getValue:function(){var e;return e="function"==typeof this.options.value?this.options.value(this):"undefined"!=typeof this.options.value?this.options.value:this.$element.val(),"undefined"==typeof e||null===e?"":this._handleWhitespace(e)},refreshConstraints:function(){return this.actualizeOptions()._bindConstraints()},addConstraint:function(e,t,i,n){if(window.Parsley._validatorRegistry.validators[e]){var r=new b(this,e,t,i,n);"undefined"!==this.constraintsByName[r.name]&&this.removeConstraint(r.name),this.constraints.push(r),this.constraintsByName[r.name]=r}return this},removeConstraint:function(e){for(var t=0;t<this.constraints.length;t++)if(e===this.constraints[t].name){this.constraints.splice(t,1);break}return delete this.constraintsByName[e],this},updateConstraint:function(e,t,i){return this.removeConstraint(e).addConstraint(e,t,i)},_bindConstraints:function(){for(var e=[],t={},i=0;i<this.constraints.length;i++)!1===this.constraints[i].isDomConstraint&&(e.push(this.constraints[i]),t[this.constraints[i].name]=this.constraints[i]);this.constraints=e,this.constraintsByName=t;for(var n in this.options)this.addConstraint(n,this.options[n],void 0,!0);return this._bindHtml5Constraints()},_bindHtml5Constraints:function(){(this.$element.hasClass("required")||this.$element.attr("required"))&&this.addConstraint("required",!0,void 0,!0),"string"==typeof this.$element.attr("pattern")&&this.addConstraint("pattern",this.$element.attr("pattern"),void 0,!0),"undefined"!=typeof this.$element.attr("min")&&"undefined"!=typeof this.$element.attr("max")?this.addConstraint("range",[this.$element.attr("min"),this.$element.attr("max")],void 0,!0):"undefined"!=typeof this.$element.attr("min")?this.addConstraint("min",this.$element.attr("min"),void 0,!0):"undefined"!=typeof this.$element.attr("max")&&this.addConstraint("max",this.$element.attr("max"),void 0,!0),"undefined"!=typeof this.$element.attr("minlength")&&"undefined"!=typeof this.$element.attr("maxlength")?this.addConstraint("length",[this.$element.attr("minlength"),this.$element.attr("maxlength")],void 0,!0):"undefined"!=typeof this.$element.attr("minlength")?this.addConstraint("minlength",this.$element.attr("minlength"),void 0,!0):"undefined"!=typeof this.$element.attr("maxlength")&&this.addConstraint("maxlength",this.$element.attr("maxlength"),void 0,!0);var e=this.$element.attr("type");return"undefined"==typeof e?this:"number"===e?this.addConstraint("type",["number",{step:this.$element.attr("step"),base:this.$element.attr("min")||this.$element.attr("value")}],void 0,!0):/^(email|url|range)$/i.test(e)?this.addConstraint("type",e,void 0,!0):this},_isRequired:function(){return"undefined"==typeof this.constraintsByName.required?!1:!1!==this.constraintsByName.required.requirements},_trigger:function(e){return this.trigger("field:"+e)},_handleWhitespace:function(e){return!0===this.options.trimValue&&a.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"'),"squish"===this.options.whitespace&&(e=e.replace(/\s{2,}/g," ")),("trim"===this.options.whitespace||"squish"===this.options.whitespace||!0===this.options.trimValue)&&(e=a.trimString(e)),e},_getGroupedConstraints:function(){if(!1===this.options.priorityEnabled)return[this.constraints];for(var e=[],t={},i=0;i<this.constraints.length;i++){var n=this.constraints[i].priority;t[n]||e.push(t[n]=[]),t[n].push(this.constraints[i])}return e.sort(function(e,t){return t[0].priority-e[0].priority}),e}};var x=C,P=function(){this.__class__="ParsleyFieldMultiple"};P.prototype={addElement:function(e){return this.$elements.push(e),this},refreshConstraints:function(){var t;if(this.constraints=[],this.$element.is("select"))return this.actualizeOptions()._bindConstraints(),this;for(var i=0;i<this.$elements.length;i++)if(e("html").has(this.$elements[i]).length){t=this.$elements[i].data("ParsleyFieldMultiple").refreshConstraints().constraints;for(var n=0;n<t.length;n++)this.addConstraint(t[n].name,t[n].requirements,t[n].priority,t[n].isDomConstraint)}else this.$elements.splice(i,1);return this},getValue:function(){if("function"==typeof this.options.value)value=this.options.value(this);else if("undefined"!=typeof this.options.value)return this.options.value;if(this.$element.is("input[type=radio]"))return this._findRelated().filter(":checked").val()||"";if(this.$element.is("input[type=checkbox]")){var t=[];return this._findRelated().filter(":checked").each(function(){t.push(e(this).val())}),t}return this.$element.is("select")&&null===this.$element.val()?[]:this.$element.val()},_init:function(){return this.$elements=[this.$element],this}};var E=function(t,i,n){this.$element=e(t);var r=this.$element.data("Parsley");if(r)return"undefined"!=typeof n&&r.parent===window.Parsley&&(r.parent=n,r._resetOptions(r.options)),r;if(!this.$element.length)throw new Error("You must bind Parsley on an existing element.");if("undefined"!=typeof n&&"ParsleyForm"!==n.__class__)throw new Error("Parent instance must be a ParsleyForm instance");return this.parent=n||window.Parsley,this.init(i)};E.prototype={init:function(e){return this.__class__="Parsley",this.__version__="2.3.5",this.__id__=a.generateID(),this._resetOptions(e),this.$element.is("form")||a.checkAttr(this.$element,this.options.namespace,"validate")&&!this.$element.is(this.options.inputs)?this.bind("parsleyForm"):this.isMultiple()?this.handleMultiple():this.bind("parsleyField")},isMultiple:function(){return this.$element.is("input[type=radio], input[type=checkbox]")||this.$element.is("select")&&"undefined"!=typeof this.$element.attr("multiple")},handleMultiple:function(){var t,i,n=this;if(this.options.multiple||("undefined"!=typeof this.$element.attr("name")&&this.$element.attr("name").length?this.options.multiple=t=this.$element.attr("name"):"undefined"!=typeof this.$element.attr("id")&&this.$element.attr("id").length&&(this.options.multiple=this.$element.attr("id"))),this.$element.is("select")&&"undefined"!=typeof this.$element.attr("multiple"))return this.options.multiple=this.options.multiple||this.__id__,this.bind("parsleyFieldMultiple");if(!this.options.multiple)return a.warn("To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.",this.$element),this;this.options.multiple=this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g,""),
3133"undefined"!=typeof t&&e('input[name="'+t+'"]').each(function(t,i){e(i).is("input[type=radio], input[type=checkbox]")&&e(i).attr(n.options.namespace+"multiple",n.options.multiple)});for(var r=this._findRelated(),s=0;s<r.length;s++)if(i=e(r.get(s)).data("Parsley"),"undefined"!=typeof i){this.$element.data("ParsleyFieldMultiple")||i.addElement(this.$element);break}return this.bind("parsleyField",!0),i||this.bind("parsleyFieldMultiple")},bind:function(t,i){var n;switch(t){case"parsleyForm":n=e.extend(new _(this.$element,this.domOptions,this.options),window.ParsleyExtend)._bindFields();break;case"parsleyField":n=e.extend(new x(this.$element,this.domOptions,this.options,this.parent),window.ParsleyExtend);break;case"parsleyFieldMultiple":n=e.extend(new x(this.$element,this.domOptions,this.options,this.parent),new P,window.ParsleyExtend)._init();break;default:throw new Error(t+"is not a supported Parsley type")}return this.options.multiple&&a.setAttr(this.$element,this.options.namespace,"multiple",this.options.multiple),"undefined"!=typeof i?(this.$element.data("ParsleyFieldMultiple",n),n):(this.$element.data("Parsley",n),n._actualizeTriggers(),n._trigger("init"),n)}};var V=e.fn.jquery.split(".");if(parseInt(V[0])<=1&&parseInt(V[1])<8)throw"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";V.forEach||a.warn("Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim");var M=e.extend(new l,{$element:e(document),actualizeOptions:null,_resetOptions:null,Factory:E,version:"2.3.5"});e.extend(x.prototype,y.Field,l.prototype),e.extend(_.prototype,y.Form,l.prototype),e.extend(E.prototype,l.prototype),e.fn.parsley=e.fn.psly=function(t){if(this.length>1){var i=[];return this.each(function(){i.push(e(this).parsley(t))}),i}return e(this).length?new E(this,t):void a.warn("You must bind Parsley on an existing element.")},"undefined"==typeof window.ParsleyExtend&&(window.ParsleyExtend={}),M.options=e.extend(a.objectCreate(o),window.ParsleyConfig),window.ParsleyConfig=M.options,window.Parsley=window.psly=M,window.ParsleyUtils=a;var O=window.Parsley._validatorRegistry=new c(window.ParsleyConfig.validators,window.ParsleyConfig.i18n);window.ParsleyValidator={},e.each("setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator".split(" "),function(t,i){window.Parsley[i]=e.proxy(O,i),window.ParsleyValidator[i]=function(){var e;return a.warnOnce("Accessing the method '"+i+"' through ParsleyValidator is deprecated. Simply call 'window.Parsley."+i+"(...)'"),(e=window.Parsley)[i].apply(e,arguments)}}),window.Parsley.UI=y,window.ParsleyUI={removeError:function(e,t,i){var n=!0!==i;return a.warnOnce("Accessing ParsleyUI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e.removeError(t,{updateClass:n})},getErrorsMessages:function(e){return a.warnOnce("Accessing ParsleyUI is deprecated. Call 'getErrorsMessages' on the instance directly."),e.getErrorsMessages()}},e.each("addError updateError".split(" "),function(e,t){window.ParsleyUI[t]=function(e,i,n,r,s){var o=!0!==s;return a.warnOnce("Accessing ParsleyUI is deprecated. Call '"+t+"' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e[t](i,{message:n,assert:r,updateClass:o})}}),/firefox/i.test(navigator.userAgent)&&e(document).on("change","select",function(t){e(t.target).trigger("input")}),!1!==window.ParsleyConfig.autoBind&&e(function(){e("[data-parsley-validate]").length&&e("[data-parsley-validate]").parsley()});var A=e({}),R=function(){a.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley")},D="parsley:";e.listen=function(e,n){var r;if(R(),"object"==typeof arguments[1]&&"function"==typeof arguments[2]&&(r=arguments[1],n=arguments[2]),"function"!=typeof n)throw new Error("Wrong parameters");window.Parsley.on(i(e),t(n,r))},e.listenTo=function(e,n,r){if(R(),!(e instanceof x||e instanceof _))throw new Error("Must give Parsley instance");if("string"!=typeof n||"function"!=typeof r)throw new Error("Wrong parameters");e.on(i(n),t(r))},e.unsubscribe=function(e,t){if(R(),"string"!=typeof e||"function"!=typeof t)throw new Error("Wrong arguments");window.Parsley.off(i(e),t.parsleyAdaptedCallback)},e.unsubscribeTo=function(e,t){if(R(),!(e instanceof x||e instanceof _))throw new Error("Must give Parsley instance");e.off(i(t))},e.unsubscribeAll=function(t){R(),window.Parsley.off(i(t)),e("form,input,textarea,select").each(function(){var n=e(this).data("Parsley");n&&n.off(i(t))})},e.emit=function(e,t){var n;R();var r=t instanceof x||t instanceof _,s=Array.prototype.slice.call(arguments,r?2:1);s.unshift(i(e)),r||(t=window.Parsley),(n=t).trigger.apply(n,_toConsumableArray(s))};e.extend(!0,M,{asyncValidators:{"default":{fn:function(e){return e.status>=200&&e.status<300},url:!1},reverse:{fn:function(e){return e.status<200||e.status>=300},url:!1}},addAsyncValidator:function(e,t,i,n){return M.asyncValidators[e]={fn:t,url:i||!1,options:n||{}},this}}),M.addValidator("remote",{requirementType:{"":"string",validator:"string",reverse:"boolean",options:"object"},validateString:function(t,i,n,r){var s,a,o={},l=n.validator||(!0===n.reverse?"reverse":"default");if("undefined"==typeof M.asyncValidators[l])throw new Error("Calling an undefined async validator: `"+l+"`");i=M.asyncValidators[l].url||i,i.indexOf("{value}")>-1?i=i.replace("{value}",encodeURIComponent(t)):o[r.$element.attr("name")||r.$element.attr("id")]=t;var u=e.extend(!0,n.options||{},M.asyncValidators[l].options);s=e.extend(!0,{},{url:i,data:o,type:"GET"},u),r.trigger("field:ajaxoptions",r,s),a=e.param(s),"undefined"==typeof M._remoteCache&&(M._remoteCache={});var d=M._remoteCache[a]=M._remoteCache[a]||e.ajax(s),h=function(){var t=M.asyncValidators[l].fn.call(r,d,i,n);return t||(t=e.Deferred().reject()),e.when(t)};return d.then(h,h)},priority:-1}),M.on("form:submit",function(){M._remoteCache={}}),window.ParsleyExtend.addAsyncValidator=function(){return ParsleyUtils.warnOnce("Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`"),M.addAsyncValidator.apply(M,arguments)},M.addMessages("en",{defaultMessage:"This value seems to be invalid.",type:{email:"This value should be a valid email.",url:"This value should be a valid url.",number:"This value should be a valid number.",integer:"This value should be a valid integer.",digits:"This value should be digits.",alphanum:"This value should be alphanumeric."},notblank:"This value should not be blank.",required:"This value is required.",pattern:"This value seems to be invalid.",min:"This value should be greater than or equal to %s.",max:"This value should be lower than or equal to %s.",range:"This value should be between %s and %s.",minlength:"This value is too short. It should have %s characters or more.",maxlength:"This value is too long. It should have %s characters or fewer.",length:"This value length is invalid. It should be between %s and %s characters long.",mincheck:"You must select at least %s choices.",maxcheck:"You must select %s choices or fewer.",check:"You must select between %s and %s choices.",equalto:"This value should be the same."}),M.setLocale("en");var q=M;return q});
3134</script>
3135
3136<script type="text/javascript">
3137/*!
3138 * jQuery Modal (minified)
3139 * Copyright (c) 2015 CreativeDream
3140 * https://github.com/CreativeDream/jquery.modal
3141 * Version: 1.2.3 (10-04-2015)
3142 * Requires: jQuery v1.7.1 or later
3143 * type: 'inverted', //Type of Modal Box (alert | confirm | prompt | success | warning | error | info | inverted | primary)
3144 */
3145function modal(t){return $.cModal(t)}!function(t){t.cModal=function(n){var e,o={type:"default",title:null,text:null,size:"normal",buttons:[{text:"OK",val:!0,onClick:function(){return!0}}],center:!0,autoclose:!1,callback:null,onShow:null,animate:!0,closeClick:!0,closable:!0,theme:"default",background:null,zIndex:1050,buttonText:{ok:"OK",yes:"Yes",cancel:"Cancel"},template:'<div class="modal-box"><div class="modal-inner"><div class="modal-title"><a class="modal-close-btn"></a></div><div class="modal-text"></div><div class="modal-buttons"></div></div></div>',_classes:{box:".modal-box",boxInner:".modal-inner",title:".modal-title",content:".modal-text",buttons:".modal-buttons",closebtn:".modal-close-btn"}},n=t.extend({},o,n),a=t("<div id='modal-window' />").hide(),l=n._classes.box,s=a.append(n.template),i={init:function(){t("#modal-window").remove(),i._setStyle(),i._modalShow(),i._modalConent(),a.on("click","a.modal-btn",function(){i._modalBtn(t(this))}).on("click",n._classes.closebtn,function(){e=!1,i._modalHide()}).click(function(t){n.closeClick&&"modal-window"==t.target.id&&(e=!1,i._modalHide())}),t(window).bind("keyup",i._keyUpF).resize(function(){var t=n.animate;n.animate=!1,i._position(),n.animate=t})},_setStyle:function(){a.css({position:"fixed",width:"100%",height:"100%",top:"0",left:"0","z-index":n.zIndex,overflow:"auto"}),a.find(n._classes.box).css({position:"absolute"})},_keyUpF:function(t){switch(t.keyCode){case 13:if(s.find("input:not(.modal-prompt-input),textarea").is(":focus"))return!1;i._modalBtn(a.find(n._classes.buttons+" a.modal-btn"+("undefined"!=typeof i.btnForEKey&&a.find(n._classes.buttons+" a.modal-btn:eq("+i.btnForEKey+")").size()>0?":eq("+i.btnForEKey+")":":last-child")));break;case 27:i._modalHide()}},_modalShow:function(){t("body").css({overflow:"hidden",width:t("body").innerWidth()}).append(s)},_modalHide:function(o){if(n.closable===!1)return!1;e="undefined"==typeof e?!1:e;var s=function(){if(null!=n.callback&&"function"==typeof n.callback&&0==n.callback(e,a,i.actions)?!1:!0){a.fadeOut(200,function(){t(this).remove(),t("body").css({overflow:"",width:""})});var o=100*parseFloat(t(l).css("top"))/parseFloat(t(l).parent().css("height"));t(l).stop(!0,!0).animate({top:o+(n.animate?3:0)+"%"},"fast")}};o?setTimeout(function(){s()},o):s(),t(window).unbind("keyup",i._keyUpF)},_modalConent:function(){var e=n._classes.title,o=n._classes.content,s=n._classes.buttons,d=n.buttonText,c=["alert","confirm","prompt"],u=["xenon","atlant","reseted"];if(-1==t.inArray(n.type,c)&&"default"!=n.type&&t(l).addClass("modal-type-"+n.type),t(l).addClass(n.size&&null!=n.size?"modal-size-"+n.size:"modal-size-normal"),n.theme&&null!=n.theme&&"default"!=n.theme&&t(l).addClass((-1==t.inArray(n.theme,u)?"":"modal-theme-")+n.theme),n.background&&null!=n.background&&a.css("background-color",n.background),n.title||null!=n.title?t(e).prepend("<h3>"+n.title+"</h3>"):t(e).remove(),"prompt"==n.type?n.text=(null!=n.text?n.text:"")+'<input type="text" name="modal-prompt-input" class="modal-prompt-input" autocomplete="off" autofocus="on" />':"",t(o).html(n.text),n.buttons||null!=n.buttons){var r="";switch(n.type){case"alert":r='<a class="modal-btn'+(n.buttons[0].addClass?" "+n.buttons[0].addClass:"")+'">'+d.ok+"</a>";break;case"confirm":r='<a class="modal-btn'+(n.buttons[0].addClass?" "+n.buttons[0].addClass:"")+'">'+d.cancel+'</a><a class="modal-btn '+(n.buttons[1]&&n.buttons[1].addClass?" "+n.buttons[1].addClass:"btn-light-blue")+'">'+d.yes+"</a>";break;case"prompt":r='<a class="modal-btn'+(n.buttons[0].addClass?" "+n.buttons[0].addClass:"")+'">'+d.cancel+'</a><a class="modal-btn '+(n.buttons[1]&&n.buttons[1].addClass?" "+n.buttons[1].addClass:"btn-light-blue")+'">'+d.ok+"</a>";break;default:n.buttons.length>0&&t.isArray(n.buttons)?t.each(n.buttons,function(t,n){var e=n.addClass&&"undefined"!=typeof n.addClass?" "+n.addClass:"";r+='<a class="modal-btn'+e+'">'+n.text+"</a>",n.eKey&&(i.btnForEKey=t)}):r+='<a class="modal-btn">'+d.ok+"</a>"}t(s).html(r)}else t(s).remove();if("prompt"==n.type&&$(".modal-prompt-input").focus(),n.autoclose){var m=n.buttons||null!=n.buttons?32*t(o).text().length:900;i._modalHide(900>m?900:m)}a.fadeIn(200,function(){null!=n.onShow?n.onShow(i.actions):null}),i._position()},_position:function(){var e,o,a;n.center?(e={top:t(window).height()<t(l).outerHeight()?1:50,left:50,marginTop:t(window).height()<t(l).outerHeight()?0:-t(l).outerHeight()/2,marginLeft:-t(l).outerWidth()/2},o={top:e.top-(n.animate?3:0)+"%",left:e.left+"%","margin-top":e.marginTop,"margin-left":e.marginLeft},a={top:e.top+"%"}):(e={top:t(window).height()<t(l).outerHeight()?1:10,left:50,marginTop:0,marginLeft:-t(l).outerWidth()/2},o={top:e.top-(n.animate?3:0)+"%",left:e.left+"%","margin-top":e.marginTop,"margin-left":e.marginLeft},a={top:e.top+"%"}),t(l).css(o).stop(!0,!0).animate(a,"fast")},_modalBtn:function(o){var l=!1,s=n.type,d=o.index(),c=n.buttons[d];if(t.inArray(s,["alert","confirm","prompt"])>-1)e=l=1==d?!0:!1,"prompt"==s&&(e=l=l&&a.find("input.modal-prompt-input").size()>0!=0?a.find("input.modal-prompt-input").val():!1),i._modalHide();else{if(o.hasClass("btn-disabled"))return!1;e=l=c&&c.val?c.val:!0,(!c.onClick||c.onClick(t.extend({val:l,bObj:o,bOpts:c},i.actions)))&&i._modalHide()}e=l},actions:{html:a,close:function(){i._modalHide()},getModal:function(){return a},getBox:function(){return a.find(n._classes.box)},getInner:function(){return a.find(n._classes.boxInner)},getTitle:function(){return a.find(n._classes.title)},getContet:function(){return a.find(n._classes.content)},getButtons:function(){return a.find(n._classes.buttons).find("a")},setTitle:function(t){return a.find(n._classes.title+" h3").html(t),a.find(n._classes.title+" h3").size()>0},setContent:function(t){return a.find(n._classes.content).html(t),a.find(n._classes.content).size()>0}}};return i.init(),i.actions}}(jQuery);
3146</script>
3147 <script>
3148 //Unique namespace
3149 DUPX = new Object();
3150
3151 DUPX.showProgressBar = function ()
3152 {
3153 DUPX.animateProgressBar('progress-bar');
3154 $('#ajaxerr-area').hide();
3155 $('#progress-area').show();
3156 }
3157
3158 DUPX.hideProgressBar = function ()
3159 {
3160 $('#progress-area').hide(100);
3161 $('#ajaxerr-area').fadeIn(400);
3162 }
3163
3164 DUPX.animateProgressBar = function(id)
3165 {
3166 //Create Progress Bar
3167 var $mainbar = $("#" + id);
3168 $mainbar.progressbar({ value: 100 });
3169 $mainbar.height(25);
3170 runAnimation($mainbar);
3171
3172 function runAnimation($pb) {
3173 $pb.css({ "padding-left": "0%", "padding-right": "90%" });
3174 $pb.progressbar("option", "value", 100);
3175 $pb.animate({ paddingLeft: "90%", paddingRight: "0%" }, 3500, "linear", function () { runAnimation($pb); });
3176 }
3177 }
3178
3179 DUPX.toggleAll = function(id)
3180 {
3181 $(id + " *[data-type='toggle']").each(function() {
3182 $(this).trigger('click');
3183 });
3184 }
3185
3186
3187 DUPX.toggleClick = function()
3188 {
3189 var id = $(this).attr('data-target');
3190 var text = $(this).text().replace(/\+|\-/, "");
3191 var icon = $(this).find('i.dupx-plus-square, i.dupx-minus-square');
3192 var target = $(id);
3193 $(icon).removeClass('dupx-plus-square dupx-minus-square');
3194
3195 if (target.is(':hidden') ) {
3196 (icon.length)
3197 ? $(icon).addClass('dupx-minus-square')
3198 : $(this).html("- " + text );
3199 target.show();
3200 } else {
3201 (icon.length)
3202 ? $(icon).addClass('dupx-plus-square')
3203 : $(this).html("+ " + text );
3204 target.hide();
3205 }
3206 }
3207
3208 $(document).ready(function()
3209 {
3210 <?php if ($GLOBALS['DUPX_DEBUG']) : ?>
3211 $("div.dupx-debug input[type=hidden], div.dupx-debug textarea").each(function() {
3212 var label = '<label>' + $(this).attr('name') + ':</label>';
3213 $(this).before(label);
3214 $(this).after('<br/>');
3215 });
3216 $("div.dupx-debug input[type=hidden]").each(function() {
3217 $(this).attr('type', 'text');
3218 });
3219
3220 $("div.dupx-debug").prepend('<h2>Debug View</h2>');
3221 <?php endif; ?>
3222 });
3223</script>
3224
3225</head>
3226<body>
3227
3228<div id="content">
3229<!-- =========================================
3230HEADER TEMPLATE: Common header on all steps -->
3231<table cellspacing="0" class="dupx-header">
3232 <tr>
3233 <td style="width:100%;">
3234 <div style="font-size:26px; padding:7px 0 7px 0">
3235 <!-- !!DO NOT CHANGE/EDIT OR REMOVE PRODUCT NAME!!
3236 If your interested in Private Label Rights please contact us at the URL below to discuss
3237 customizations to product labeling: http://snapcreek.com -->
3238 Duplicator
3239 </div>
3240 </td>
3241 <td class="dupx-header-version">
3242 version: <?php echo $GLOBALS['FW_DUPLICATOR_VERSION'] ?><br/>
3243 » <a href="javascript:void(0)" onclick="DUPX.showServerInfo()">info</a>
3244 » <a href="?help=1" target="_blank">help</a>
3245 </td>
3246 </tr>
3247</table>
3248
3249<?php if ($GLOBALS['FW_ARCHIVE_ONLYDB']) :?>
3250 <div style="position: relative">
3251 <div class="archive-onlydb">Database Only Mode</div>
3252 </div>
3253<?php endif; ?>
3254
3255<!-- =========================================
3256FORM DATA: Data Steps -->
3257<div id="content-inner">
3258<?php
3259
3260if (! isset($_GET['help'])) {
3261switch ($_POST['action_step']) {
3262 case "1" :
3263 ?> <?php
3264//VIEW: STEP 1- INPUT
3265
3266//ARCHIVE FILE
3267$arcStatus = (file_exists($GLOBALS['ARCHIVE_PATH'])) ? 'Pass' : 'Fail';
3268$arcFormat = ($arcStatus == 'Pass') ? 'Pass' : 'StatusFailed';
3269$arcSize = @filesize($GLOBALS['ARCHIVE_PATH']);
3270$arcSize = is_numeric($arcSize) ? $arcSize : 0;
3271$zip_archive_enabled = class_exists('ZipArchive') ? 'Enabled' : 'Not Enabled';
3272
3273$arcSizeRatio = (((1.0) * $arcSize) / $GLOBALS['FW_PACKAGE_EST_SIZE']) * 100;
3274$arcSizeStatus = ($arcSizeRatio > 90) ? 'Pass' : 'Fail';
3275
3276//ARCHIVE FORMAT
3277if ($arcStatus) {
3278 if (class_exists('ZipArchive')){
3279 $zip = new ZipArchive();
3280 if($zip->open($GLOBALS['ARCHIVE_PATH']) === TRUE ) {
3281
3282 $arcFilePath = basename($GLOBALS['ARCHIVE_PATH']);
3283 $arcFilePath = substr($arcFilePath, 0, strrpos($arcFilePath, "."));
3284 //Some systems the __MACOSX folder can cause issues on others it works fine removing
3285 //until further reports are discovered, removed on 04-06-2018
3286 //$badFiles = array('__MACOSX', $arcFilePath);
3287 $badFiles = array('', $arcFilePath);
3288 $goodFiles = array('database.sql', 'installer-backup.php');
3289 $goodFilesFound = true;
3290 $badFilesFound = false;
3291
3292 foreach ($badFiles as $val) {
3293 if (is_numeric($zip->locateName("{$val}/"))) {
3294 $badFilesFound = true;
3295 break;
3296 }
3297 }
3298
3299 foreach ($goodFiles as $val) {
3300 if ($zip->locateName($val) !== true) {
3301 $goodFilesFound = false;
3302 }
3303 }
3304
3305 $arcFormat = ($goodFilesFound == false && $badFilesFound == true) ? 'Fail' : 'Pass';
3306 }
3307 } else {
3308 $arcFormat = 'NoZipArchive';
3309 }
3310}
3311
3312$all_arc = ($arcStatus == 'Pass' && $arcFormat != 'Fail' && $arcSizeStatus == 'Pass') ? 'Pass' : 'Fail';
3313
3314//REQUIRMENTS
3315$req = array();
3316$req['01'] = DUPX_Server::isDirWritable($GLOBALS["CURRENT_ROOT_PATH"]) ? 'Pass' : 'Fail';
3317$req['02'] = 'Pass'; //Place-holder for future check
3318$req['03'] = 'Pass'; //Place-holder for future check;
3319$req['04'] = function_exists('mysqli_connect') ? 'Pass' : 'Fail';
3320$req['05'] = DUPX_Server::$php_version_safe ? 'Pass' : 'Fail';
3321$all_req = in_array('Fail', $req) ? 'Fail' : 'Pass';
3322
3323//NOTICES
3324$openbase = ini_get("open_basedir");
3325$scanfiles = @scandir($GLOBALS["CURRENT_ROOT_PATH"]);
3326$scancount = is_array($scanfiles) ? (count($scanfiles)) : -1;
3327$datetime1 = $GLOBALS['FW_CREATED'];
3328$datetime2 = date("Y-m-d H:i:s");
3329$fulldays = round(abs(strtotime($datetime1) - strtotime($datetime2))/86400);
3330$root_path = DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']);
3331$wpconf_path = "{$root_path}/wp-config.php";
3332$max_time_zero = @set_time_limit(0);
3333$max_time_size = 314572800; //300MB
3334$max_time_ini = ini_get('max_execution_time');
3335$max_time_warn = (is_numeric($max_time_ini) && $max_time_ini < 31 && $max_time_ini > 0) && $arcSize > $max_time_size;
3336
3337
3338$notice = array();
3339if (!$GLOBALS['FW_ARCHIVE_ONLYDB']) {
3340 $notice['01'] = ! file_exists($wpconf_path) ? 'Good' : 'Warn';
3341 $notice['02'] = $scancount <= 35 ? 'Good' : 'Warn';
3342}
3343$notice['03'] = $fulldays <= 120 ? 'Good' : 'Warn';
3344$notice['04'] = 'Good'; //Place-holder for future check
3345$notice['05'] = DUPX_Server::$php_version_53_plus ? 'Good' : 'Warn';
3346$notice['06'] = empty($openbase) ? 'Good' : 'Warn';
3347$notice['07'] = ! $max_time_warn ? 'Good' : 'Warn';
3348$all_notice = in_array('Warn', $notice) ? 'Warn' : 'Good';
3349
3350//SUMMATION
3351$req_success = ($all_req == 'Pass');
3352$req_notice = ($all_notice == 'Good');
3353$all_success = ($req_success && $req_notice);
3354$agree_msg = "To enable this button the checkbox above under the 'Terms & Notices' must be checked.";
3355?>
3356
3357
3358<form id='s1-input-form' method="post" class="content-form" >
3359<input type="hidden" name="action_ajax" value="1" />
3360<input type="hidden" name="action_step" value="1" />
3361<input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
3362
3363<div class="hdr-main">
3364 Step <span class="step">1</span> of 4: Deployment
3365</div>
3366<br/>
3367
3368
3369<!-- ====================================
3370ARCHIVE
3371==================================== -->
3372<div class="hdr-sub1" id="s1-area-archive-file-link" data-type="toggle" data-target="#s1-area-archive-file">
3373 <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Archive</a>
3374 <div class="<?php echo ($all_arc == 'Pass') ? 'status-badge-pass' : 'status-badge-fail'; ?>" style="float:right">
3375 <?php echo ($all_arc == 'Pass') ? 'Pass' : 'Fail'; ?>
3376 </div>
3377</div>
3378<div id="s1-area-archive-file" style="display:none">
3379
3380 <table class="s1-archive-local">
3381 <tr>
3382 <td colspan="2"><div class="hdr-sub3">Site Details</div></td>
3383 </tr>
3384 <tr>
3385 <td>Site:</td>
3386 <td><?php echo $GLOBALS['FW_BLOGNAME'];?> </td>
3387 </tr>
3388 <tr>
3389 <td>Notes:</td>
3390 <td><?php echo strlen($GLOBALS['FW_PACKAGE_NOTES']) ? "{$GLOBALS['FW_PACKAGE_NOTES']}" : " - no notes - ";?></td>
3391 </tr>
3392 <?php if ($GLOBALS['FW_ARCHIVE_ONLYDB']) :?>
3393 <tr>
3394 <td>Mode:</td>
3395 <td>Archive only database was enabled during package package creation.</td>
3396 </tr>
3397 <?php endif; ?>
3398 </table>
3399
3400 <table class="s1-archive-local">
3401 <tr>
3402 <td colspan="2"><div class="hdr-sub3">File Details</div></td>
3403 </tr>
3404 <tr style="vertical-align:top">
3405 <td>Size:</td>
3406 <td>
3407 <?php
3408 $projectedSize = DUPX_U::readableByteSize($GLOBALS['FW_PACKAGE_EST_SIZE']);
3409 $actualSize = DUPX_U::readableByteSize($arcSize);
3410 echo "{$actualSize}<br/>";
3411 if ($arcSizeStatus == 'Fail' ) {
3412 echo "<span class='dupx-fail'>The archive file size is currently <b>{$actualSize}</b> and its estimated file size should be around <b>{$projectedSize}</b>. "
3413 . "The archive file may not have been fully downloaded to the server. If so please wait for the file to completely download and then refresh this page.<br/><br/>";
3414
3415 echo "This warning is only shown when the file has more than a 10% size ratio difference from when it was originally built. Please review the file sizes "
3416 . "to make sure the archive was downloaded to this server correctly if the download is complete.</span>";
3417 }
3418 ?>
3419 </td>
3420 </tr>
3421 <tr>
3422 <td>Name:</td>
3423 <td><?php echo "{$GLOBALS['FW_PACKAGE_NAME']}";?> </td>
3424 </tr>
3425 <tr>
3426 <td>Path:</td>
3427 <td><?php echo "{$GLOBALS['CURRENT_ROOT_PATH']}";?> </td>
3428 </tr>
3429 <tr>
3430 <td>Status:</td>
3431 <td>
3432 <?php if ($arcStatus != 'Fail') : ?>
3433 <span class="dupx-pass">File Found</span>
3434 <?php else : ?>
3435 <div class="s1-archive-failed-msg">
3436 <b class="dupx-fail">Archive File Not Found!</b><br/>
3437 The archive file name below must be the <u>exact</u> name of the archive file placed in the deployment path (character for character).
3438 If the file does not have the same name then rename it to the name above.
3439 <br/><br/>
3440
3441 When downloading the package files make sure both files are from the same package line in the packages view. The archive file also
3442 must be completely downloaded to the server before starting the install. The following zip files were found at the deployment path:
3443 <?php
3444 //DETECT ARCHIVE FILES
3445 $zip_files = DUPX_Server::getZipFiles();
3446 $zip_count = count($zip_files);
3447
3448 if ($zip_count >= 1) {
3449 echo "<ol style='padding:10px 20px 0 20px; font-style:italic'>";
3450 foreach($zip_files as $file) {
3451 echo "<li> '{$file}'</li>";
3452 }
3453 echo "</ol>";
3454 } else {
3455 echo "<br/><br/> <i>- No zip files found -</i>";
3456 }
3457 ?>
3458 </div>
3459 <?php endif; ?>
3460 </td>
3461 </tr>
3462 <tr>
3463 <td>Format:</td>
3464 <td>
3465 <?php if ($arcFormat == 'Pass') : ?>
3466 <span class="dupx-pass">Good structure</span>
3467 <?php elseif ($arcFormat == 'StatusFailed') : ?>
3468 <span class="dupx-fail">Unable to validate format</span><br/>
3469 <?php elseif ($arcFormat == 'NoZipArchive') : ?>
3470 <div class="s1-archive-failed-msg">
3471 The PHP extraction library <a href="http://php.net/manual/en/book.zip.php" target="_help">ZipArchive</a> was not found on this server. There are a few options:
3472 <ol>
3473 <li>Contact your host to enable the this PHP library. <a href="http://php.net/manual/en/zip.installation.php" target="_help">[more info]</a></li>
3474 <li>Enable 'Manual package extraction' in the options menu and <a href="https://snapcreek.com/duplicator/docs/faqs-tech/#faq-installer-015-q" target="_help">Manually extract the archive</a></li>
3475 </ol>
3476 </div>
3477 <?php else : ?>
3478 <div class="s1-archive-failed-msg">
3479 <b class="dupx-fail">Invalid Archive Format Detected!</b><br/>
3480 The archive files contents must be laid out in a specific format. If the format has been changed the install process will error out.
3481 <br/><br/>
3482
3483 This scenario is rare but can happen on some systems during the download and upload process of the zip without a user being aware of
3484 the issue. Please check the contents of the zip archive and be sure its contents match the layout of your site.
3485 <br/><br/>
3486
3487 Files such as database.sql and wp-config.php should be at the root of the archive. For more details see the FAQ article
3488 <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=invalid_ar_fmt#faq-installer-020-q" target="_help">The archive format is changing on my Mac what might be the problem?</a>
3489 </div>
3490 <?php endif; ?>
3491 </td>
3492 </tr>
3493 </table>
3494
3495</div>
3496<br/><br/>
3497
3498
3499<!-- ====================================
3500VALIDATION
3501==================================== -->
3502<div class="hdr-sub1" id="s1-area-sys-setup-link" data-type="toggle" data-target="#s1-area-sys-setup">
3503 <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Validation</a>
3504 <div class="<?php echo ($req_success) ? 'status-badge-pass' : 'status-badge-fail'; ?>" style="float:right">
3505 <?php echo ($req_success) ? 'Pass' : 'Fail'; ?>
3506 </div>
3507</div>
3508<div id="s1-area-sys-setup" style="display:none">
3509 <div class='info-top'>The system validation checks help to make sure the system is ready for install.</div>
3510
3511 <!-- *** REQUIREMENTS *** -->
3512 <div class="s1-reqs" id="s1-reqs-all">
3513 <div class="header">
3514 <table class="s1-checks-area">
3515 <tr>
3516 <td class="title">Requirements <small>(must pass)</small></td>
3517 <td class="toggle"><a href="javascript:void(0)" onclick="DUPX.toggleAll('#s1-reqs-all')">[toggle]</a></td>
3518 </tr>
3519 </table>
3520 </div>
3521
3522 <!-- REQ 1 -->
3523 <div class="status <?php echo strtolower($req['01']); ?>"><?php echo $req['01']; ?></div>
3524 <div class="title" data-type="toggle" data-target="#s1-reqs01">+ Permissions</div>
3525 <div class="info" id="s1-reqs01">
3526 <table>
3527 <tr>
3528 <td><b>Deployment Path:</b> </td>
3529 <td><i><?php echo "{$GLOBALS['CURRENT_ROOT_PATH']}"; ?></i> </td>
3530 </tr>
3531 <tr>
3532 <td><b>Suhosin Extension:</b> </td>
3533 <td><?php echo extension_loaded('suhosin') ? "<i class='dupx-fail'>Enabled</i>" : "<i class='dupx-pass'>Disabled</i>"; ?> </td>
3534 </tr>
3535 <tr>
3536 <td><b>PHP Safe Mode:</b> </td>
3537 <td><?php echo (DUPX_Server::$php_safe_mode_on) ? "<i class='dupx-fail'>Enabled</i>" : "<i class='dupx-pass'>Disabled</i>"; ?> </td>
3538 </tr>
3539 </table><br/>
3540
3541 The deployment path above must be writable by PHP in order to extract the archive file. Incorrect permissions and extension such as
3542 <a href="https://suhosin.org/stories/index.html" target="_blank">suhosin</a> can sometimes interfere with PHP being able to write/extract files.
3543 Please see the <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_perms#faq-trouble-055-q" target="_blank">FAQ permission</a> help link for complete details.
3544 PHP with <a href='http://php.net/manual/en/features.safe-mode.php' target='_blank'>safe mode</a> should be disabled. If this test fails
3545 please contact your hosting provider or server administrator to disable PHP safe mode.
3546 </div>
3547
3548 <!-- REQ 2
3549 <div class="status <?php echo strtolower($req['02']); ?>"><?php echo $req['02']; ?></div>
3550 <div class="title" data-type="toggle" data-target="#s1-reqs02">+ Place Holder</div>
3551 <div class="info" id="s1-reqs02"></div>-->
3552
3553 <!-- REQ 3
3554 <div class="status <?php echo strtolower($req['03']); ?>"><?php echo $req['03']; ?></div>
3555 <div class="title" data-type="toggle" data-target="#s1-reqs03">+ Place Holder</div>
3556 <div class="info" id="s1-reqs03"></div> -->
3557
3558 <!-- REQ 4 -->
3559 <div class="status <?php echo strtolower($req['04']); ?>"><?php echo $req['04']; ?></div>
3560 <div class="title" data-type="toggle" data-target="#s1-reqs04">+ PHP Mysqli</div>
3561 <div class="info" id="s1-reqs04">
3562 Support for the PHP <a href='http://us2.php.net/manual/en/mysqli.installation.php' target='_blank'>mysqli extension</a> is required.
3563 Please contact your hosting provider or server administrator to enable the mysqli extension. <i>The detection for this call uses
3564 the function_exists('mysqli_connect') call.</i>
3565 </div>
3566
3567 <!-- REQ 5 -->
3568 <div class="status <?php echo strtolower($req['05']); ?>"><?php echo $req['05']; ?></div>
3569 <div class="title" data-type="toggle" data-target="#s1-reqs05">+ PHP Min Version</div>
3570 <div class="info" id="s1-reqs05">
3571 This server is running PHP: <b><?php echo DUPX_Server::$php_version ?></b>. <i>A minimum of PHP 5.2.17 is required</i>.
3572 Contact your hosting provider or server administrator and let them know you would like to upgrade your PHP version.
3573 </div>
3574 </div><br/>
3575
3576
3577 <!-- *** NOTICES *** -->
3578 <div class="s1-reqs" id="s1-notice-all">
3579 <div class="header">
3580 <table class="s1-checks-area">
3581 <tr>
3582 <td class="title">Notices <small>(optional)</small></td>
3583 <td class="toggle"><a href="javascript:void(0)" onclick="DUPX.toggleAll('#s1-notice-all')">[toggle]</a></td>
3584 </tr>
3585 </table>
3586 </div>
3587
3588 <?php if (!$GLOBALS['FW_ARCHIVE_ONLYDB']) :?>
3589
3590 <!-- NOTICE 1 -->
3591 <div class="status <?php echo ($notice['01'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['01']; ?></div>
3592 <div class="title" data-type="toggle" data-target="#s1-notice01">+ Configuration File</div>
3593 <div class="info" id="s1-notice01">
3594 Duplicator works best by placing the installer and archive files into an empty directory. If a wp-config.php file is found in the extraction
3595 directory it might indicate that a pre-existing WordPress site exists which can lead to a bad install.
3596 <br/><br/>
3597 <b>Options:</b>
3598 <ul style="margin-bottom: 0">
3599 <li>If the archive was already manually extracted then <a href="javascript:void(0)" onclick="DUPX.getManaualArchiveOpt()">[Enable Manual Archive Extraction]</a></li>
3600 <li>If the wp-config file is not needed then remove it.</li>
3601 </ul>
3602 </div>
3603
3604 <!-- NOTICE 2 -->
3605 <div class="status <?php echo ($notice['02'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['02']; ?></div>
3606 <div class="title" data-type="toggle" data-target="#s1-notice02">+ Directory Setup</div>
3607 <div class="info" id="s1-notice02">
3608 <b>Deployment Path:</b> <i><?php echo "{$GLOBALS['CURRENT_ROOT_PATH']}"; ?></i>
3609 <br/><br/>
3610 There are currently <?php echo "<b>[{$scancount}]</b>";?> items in the deployment path. These items will be overwritten if they also exist
3611 inside the archive file. The notice is to prevent overwriting an existing site or trying to install on-top of one which
3612 can have un-intended results. <i>This notice shows if it detects more than 40 items.</i>
3613
3614 <br/><br/>
3615 <b>Options:</b>
3616 <ul style="margin-bottom: 0">
3617 <li>If the archive was already manually extracted then <a href="javascript:void(0)" onclick="DUPX.getManaualArchiveOpt()">[Enable Manual Archive Extraction]</a></li>
3618 <li>If the files/directories are not the same as those in the archive then this notice can be ignored.</li>
3619 <li>Remove the files if they are not needed and refresh this page.</li>
3620 </ul>
3621 </div>
3622
3623 <?php endif; ?>
3624
3625 <!-- NOTICE 3 -->
3626 <div class="status <?php echo ($notice['03'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['03']; ?></div>
3627 <div class="title" data-type="toggle" data-target="#s1-notice03">+ Package Age</div>
3628 <div class="info" id="s1-notice03">
3629 <?php echo "The package is {$fulldays} day(s) old. Packages older than 120 days might be considered stale. If you are comfortable with a package that that was created over "
3630 . "four months ago please ignore this notice."; ?>
3631 </div>
3632
3633 <!-- NOTICE 4
3634 <div class="status <?php echo ($notice['04'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['04']; ?></div>
3635 <div class="title" data-type="toggle" data-target="#s1-notice04">+ Placeholder</div>
3636 <div class="info" id="s1-notice04">
3637 </div>-->
3638
3639 <!-- NOTICE 5 -->
3640 <div class="status <?php echo ($notice['05'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['05']; ?></div>
3641 <div class="title" data-type="toggle" data-target="#s1-notice05">+ PHP Version 5.2</div>
3642 <div class="info" id="s1-notice05">
3643 <?php
3644 $currentPHP = DUPX_Server::$php_version;
3645 $cssStyle = DUPX_Server::$php_version_53_plus ? 'color:green' : 'color:red';
3646 echo "<b style='{$cssStyle}'>This server is currently running PHP version [{$currentPHP}]</b>.<br/>"
3647 . "Duplicator allows PHP 5.2 to be used during install but does not officially support it. If your using PHP 5.2 we strongly recommend NOT using it and having your "
3648 . "host upgrade to a newer more stable, secure and widely supported version. The <a href='http://php.net/eol.php' target='_blank'>end of life for PHP 5.2</a> "
3649 . "was in January of 2011 and is not recommended for use.<br/><br/>";
3650
3651 echo "Many plugin and theme authors are no longer supporting PHP 5.2 and trying to use it can result in site wide problems and compatibility warnings and errors. "
3652 . "Please note if you continue with the install using PHP 5.2 the Duplicator support team will not be able to help with issues or troubleshooting your site. "
3653 . "If your server is running <b>PHP 5.3+</b> please feel free to reach out for help if you run into issues with your migration/install.";
3654 ?>
3655 </div>
3656
3657 <!-- NOTICE 6 -->
3658 <div class="status <?php echo ($notice['06'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['06']; ?></div>
3659 <div class="title" data-type="toggle" data-target="#s1-notice06">+ PHP Open Base</div>
3660 <div class="info" id="s1-notice06">
3661 <b>Open BaseDir:</b> <i><?php echo $notice['06'] == 'Good' ? "<i class='dupx-pass'>Disabled</i>" : "<i class='dupx-fail'>Enabled</i>"; ?></i>
3662 <br/><br/>
3663
3664 If <a href="http://www.php.net/manual/en/ini.core.php#ini.open-basedir" target="_blank">open_basedir</a> is enabled and you're
3665 having issues getting your site to install properly; please work with your host and follow these steps to prevent issues:
3666 <ol style="margin:7px; line-height:19px">
3667 <li>Disable the open_basedir setting in the php.ini file</li>
3668 <li>If the host will not disable, then add the path below to the open_basedir setting in the php.ini<br/>
3669 <i style="color:maroon">"<?php echo str_replace('\\', '/', dirname( __FILE__ )); ?>"</i>
3670 </li>
3671 <li>Save the settings and restart the web server</li>
3672 </ol>
3673 Note: This warning will still show if you choose option #2 and open_basedir is enabled, but should allow the installer to run properly. Please work with your
3674 hosting provider or server administrator to set this up correctly.
3675 </div>
3676
3677 <!-- NOTICE 7 -->
3678 <div class="status <?php echo ($notice['07'] == 'Good') ? 'pass' : 'fail' ?>"><?php echo $notice['07']; ?></div>
3679 <div class="title" data-type="toggle" data-target="#s1-notice07">+ PHP Timeout</div>
3680 <div class="info" id="s1-notice07">
3681 <b>Archive Size:</b> <?php echo DUPX_U::readableByteSize($arcSize) ?> <small>(detection limit is set at <?php echo DUPX_U::readableByteSize($max_time_size) ?>) </small><br/>
3682 <b>PHP max_execution_time:</b> <?php echo "{$max_time_ini}"; ?> <small>(zero means no limit)</small> <br/>
3683 <b>PHP set_time_limit:</b> <?php echo ($max_time_zero) ? '<i style="color:green">Success</i>' : '<i style="color:maroon">Failed</i>' ?>
3684 <br/><br/>
3685
3686 The PHP <a href="http://php.net/manual/en/info.configuration.php#ini.max-execution-time" target="_blank">max_execution_time</a> setting is used to
3687 determine how long a PHP process is allowed to run. If the setting is too small and the archive file size is too large then PHP may not have enough
3688 time to finish running before the process is killed causing a timeout.
3689 <br/><br/>
3690
3691 Duplicator attempts to turn off the timeout by using the
3692 <a href="http://php.net/manual/en/function.set-time-limit.php" target="_blank">set_time_limit</a> setting. If this notice shows as a warning then it is
3693 still safe to continue with the install. However, if a timeout occurs then you will need to consider working with the max_execution_time setting or extracting the
3694 archive file using the 'Manual package extraction' method.
3695 Please see the <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_timeout#faq-trouble-100-q" target="_blank">FAQ timeout</a> help link for more details.
3696
3697 </div>
3698 </div>
3699</div>
3700<br/><br/>
3701
3702
3703<!-- ====================================
3704OPTIONS
3705==================================== -->
3706<div class="hdr-sub1" data-type="toggle" data-target="#s1-area-adv-opts">
3707 <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Options</a>
3708</div>
3709<div id="s1-area-adv-opts" style="display:none">
3710 <div class="help-target"><a href="?help#help-s1" target="_blank">[help]</a></div>
3711 <br/>
3712 <div class="hdr-sub3">General</div>
3713 <table class="dupx-opts dupx-advopts">
3714 <tr>
3715 <td>Extraction:</td>
3716 <td>
3717
3718 <select id="archive_engine" name="archive_engine" size="2">
3719 <option value="manual">Manual Archive Extraction</option>
3720 <?php
3721 //ZIP-ARCHIVE
3722 echo (! $zip_archive_enabled)
3723 ? '<option disabled="true">PHP ZipArchive (not detected on server)</option>'
3724 : '<option value="ziparchive" selected="true">PHP ZipArchive</option>';
3725 ?>
3726 </select>
3727 </td>
3728 </tr>
3729 </table>
3730 <br>
3731 <br>
3732 <div class="hdr-sub3">Advanced</div>
3733 <table class="dupx-opts dupx-advopts">
3734 <tr>
3735 <td>Safe Mode:</td>
3736 <td>
3737 <select name="exe_safe_mode" id="exe_safe_mode" onchange="DUPX.onSafeModeSwitch();" style="width:200px;">
3738 <option value="0">Off</option>
3739 <option value="1">Basic</option>
3740 <option value="2">Advance</option>
3741 </select>
3742 </td>
3743 </tr>
3744 <tr>
3745 <td>Config Files:</td>
3746 <td>
3747 <input type="checkbox" name="retain_config" id="retain_config" value="1" />
3748 <label for="retain_config" style="font-weight: normal">Retain original .htaccess, .user.ini and web.config</label>
3749 </td>
3750 </tr>
3751 <tr>
3752 <td>File Times:</td>
3753 <td>
3754 <input type="radio" name="archive_filetime" id="archive_filetime_now" value="current" checked="checked" /> <label class="radio" for="archive_filetime_now" title='Set the files current date time to now'>Current</label>
3755 <input type="radio" name="archive_filetime" id="archive_filetime_orginal" value="original" /> <label class="radio" for="archive_filetime_orginal" title="Keep the files date time the same">Original</label>
3756 </td>
3757 </tr>
3758 <tr>
3759 <td>Logging:</td>
3760 <td>
3761 <input type="radio" name="logging" id="logging-light" value="1" checked="true"> <label for="logging-light">Light</label>
3762 <input type="radio" name="logging" id="logging-detailed" value="2"> <label for="logging-detailed">Detailed</label>
3763 <input type="radio" name="logging" id="logging-debug" value="3"> <label for="logging-debug">Debug</label>
3764 </td>
3765 </tr>
3766 </table>
3767 <br/><br/>
3768
3769 <!-- *** SETUP HELP *** -->
3770 <div class="hdr-sub3">Setup Help</div>
3771 <div id='s1-area-setup-help'>
3772 <div style="padding:10px 0px 0px 10px;line-height:22px">
3773 <table style='width:100%'>
3774 <tr>
3775 <td style="width:200px">
3776 » Watch the <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_vid_tutor#faq-resource-070-q" target="_blank">video tutorials</a> <br/>
3777 » Read helpful <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_help_art" target="_blank">articles</a> <br/>
3778 </td>
3779 <td>
3780 » Visit the <a href="https://snapcreek.com/duplicator/docs/quick-start/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_quickstart" target="_blank">quick start guides</a> <br/>
3781 » Browse the <a href="https://snapcreek.com/duplicator/docs/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=installer_online_docs" target="_blank">online docs</a> <br/>
3782 </td>
3783 </tr>
3784 </table>
3785 </div>
3786 </div><br/>
3787
3788</div>
3789<br/><br/>
3790
3791<!-- ====================================
3792NOTICES
3793==================================== -->
3794<div id="dialog-server-notice" style="display:none">
3795 <div id="s1-warning-msg">
3796 <b>TERMS & NOTICES</b> <br/><br/>
3797
3798 <b>Disclaimer:</b>
3799 The Duplicator software and installer should be used at your own risk. Users should always back up or have backups of your database and files before running this installer.
3800 If you're not sure about how to use this tool then please enlist the guidance of a technical professional. <u>Always</u> test this installer in a sandbox environment
3801 before trying to deploy into a production environment. Be sure that if anything happens during the install that you have a backup recovery plan in place. By accepting
3802 this agreement the users of this software do not hold liable Snapcreek LLC or any of its affiliates/members liable for any issues that might occur during use of this software.
3803 <br/><br/>
3804
3805
3806 <b>Database:</b>
3807 Do not connect to an existing database unless you are 100% sure you want to remove all of it's data. Connecting to a database that already exists will permanently
3808 DELETE all data in that database. This tool is designed to populate and fill a database with NEW data from a duplicated database using the SQL script in the
3809 package name above.
3810 <br/><br/>
3811
3812 <b>Setup:</b>
3813 Only the archive and installer file should be in the install directory, unless you have manually extracted the package and checked the
3814 'Manual Package Extraction' checkbox. All other files will be OVERWRITTEN during install. Make sure you have full backups of all your databases and files
3815 before continuing with an installation. Manual extraction requires that all contents in the package are extracted to the same directory as the installer file.
3816 Manual extraction is only needed when your server does not support the ZipArchive extension. Please see the online help for more details.
3817 <br/><br/>
3818
3819 <b>After Install:</b> When you are done with the installation you must remove the these files/directories:
3820 <ul>
3821 <li>installer.php</li>
3822 <li>installer-data.sql</li>
3823 <li>installer-backup.php</li>
3824 <li>installer-log.txt</li>
3825 <li>database.sql</li>
3826 </ul>
3827
3828 These files contain sensitive information and should not remain on a production system for system integrity and security protection.
3829 <br/><br/>
3830
3831 <b>License Overview</b><br/>
3832 Duplicator is licensed under the GPL v3 https://www.gnu.org/licenses/gpl-3.0.en.html including the following disclaimers and limitation of liability.
3833 <br/><br/>
3834
3835 <b>Disclaimer of Warranty</b><br/>
3836 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
3837 PROVIDE THE PROGRAM “AS IS†WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
3838 FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
3839 THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
3840 <br/><br/>
3841
3842 <b>Limitation of Liability</b><br/>
3843 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
3844 PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
3845 PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO
3846 OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
3847 <br/><br/>
3848 </div>
3849</div>
3850
3851<div id="s1-warning-check">
3852 <input id="accept-warnings" name="accpet-warnings" type="checkbox" onclick="DUPX.acceptWarning()" />
3853 <label for="accept-warnings">I have read and accept all <a href="javascript:void(0)" onclick="DUPX.showNotices()">terms & notices</a> <small style="font-style:italic">(required to continue)</small></label><br/>
3854</div>
3855
3856
3857<?php if (! $req_success || $all_arc == 'Fail') :?>
3858 <div class="s1-err-msg">
3859 <i>
3860 This installation will not be able to proceed until the 'Archive' and 'Validation' sections pass. Please adjust your servers settings or contact your
3861 server administrator, hosting provider or visit the resources below for additional help.
3862 </i>
3863 <div style="padding:10px">
3864 » <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_validfail_techfaq" target="_blank">Technical FAQs</a> <br/>
3865 » <a href="https://snapcreek.com/support/docs/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_validfail_onlinedocs" target="_blank">Online Documentation</a> <br/>
3866 </div>
3867 </div> <br/><br/>
3868<?php else : ?>
3869 <br/><br/><br/>
3870 <br/><br/><br/>
3871 <div class="dupx-footer-buttons">
3872 <button id="s1-deploy-btn" type="button" class="default-btn" onclick="DUPX.runExtraction()" title="<?php echo $agree_msg; ?>"> Next </button>
3873 </div>
3874<?php endif; ?>
3875
3876</form>
3877
3878
3879
3880<!-- =========================================
3881VIEW: STEP 1 - AJAX RESULT
3882Auto Posts to view.step2.php
3883========================================= -->
3884<form id='s1-result-form' method="post" class="content-form" style="display:none">
3885
3886 <div class="dupx-logfile-link"><a href="installer-log.txt" target="install_log">installer-log.txt</a></div>
3887 <div class="hdr-main">
3888 Step <span class="step">1</span> of 4: Deployment
3889 </div>
3890
3891 <!-- POST PARAMS -->
3892 <div class="dupx-debug">
3893 <input type="hidden" name="action_step" value="2" />
3894 <input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
3895 <input type="hidden" name="logging" id="ajax-logging" />
3896 <input type="hidden" name="exe_safe_mode" id="exe-safe-mode" value="0" />
3897 <input type="hidden" name="retain_config" id="ajax-retain-config" />
3898 <input type="hidden" name="json" id="ajax-json" />
3899 <textarea id='ajax-json-debug' name='json_debug_view'></textarea>
3900 <input type='submit' value='manual submit'>
3901 </div>
3902
3903 <!-- PROGRESS BAR -->
3904 <div id="progress-area">
3905 <div style="width:500px; margin:auto">
3906 <h3>Running Deployment Processes Please Wait...</h3>
3907 <div id="progress-bar"></div>
3908 <i>This may take several minutes</i>
3909 </div>
3910 </div>
3911
3912 <!-- AJAX SYSTEM ERROR -->
3913 <div id="ajaxerr-area" style="display:none">
3914 <p>Please try again an issue has occurred.</p>
3915 <div style="padding: 0px 10px 10px 0px;">
3916 <div id="ajaxerr-data">An unknown issue has occurred with the file and database set up process. Please see the installer-log.txt file for more details.</div>
3917 <div style="text-align:center; margin:10px auto 0px auto">
3918 <input type="button" class="default-btn" onclick="DUPX.hideErrorResult()" value="« Try Again" /><br/><br/>
3919 <i style='font-size:11px'>See online help for more details at <a href='https://snapcreek.com/ticket?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_ajaxerr_ticket' target='_blank'>snapcreek.com</a></i>
3920 </div>
3921 </div>
3922 </div>
3923</form>
3924
3925<script>
3926 DUPX.getManaualArchiveOpt = function ()
3927 {
3928 $("html, body").animate({scrollTop: $(document).height()}, 1500);
3929 $("a[data-target='#s1-area-adv-opts']").find('i').removeClass('dupx-plus-square').addClass('dupx-minus-square');
3930 $('#s1-area-adv-opts').show(1000);
3931 $('select#archive_engine').val('manual').focus();
3932 };
3933
3934 /** Performs Ajax post to extract files and create db
3935 * Timeout (10000000 = 166 minutes) */
3936 DUPX.runExtraction = function()
3937 {
3938 var $form = $('#s1-input-form');
3939
3940 //1800000 = 30 minutes
3941 //If the extraction takes longer than 30 minutes then user
3942 //will probably want to do a manual extraction or even FTP
3943 $.ajax({
3944 type: "POST",
3945 timeout:1800000,
3946 dataType: "json",
3947 url: window.location.href,
3948 data: $form.serialize(),
3949 beforeSend: function() {
3950 DUPX.showProgressBar();
3951 $form.hide();
3952 $('#s1-result-form').show();
3953 },
3954 success: function(data) {
3955 var dataJSON = JSON.stringify(data);
3956 $("#ajax-json-debug").val(dataJSON);
3957 if (typeof(data) != 'undefined' && data.pass == 1) {
3958 $("#ajax-logging").val($("input:radio[name=logging]:checked").val());
3959 $("#ajax-retain-config").val($("#retain_config").is(":checked") ? 1 : 0);
3960 $("#exe-safe-mode").val($("#exe_safe_mode").val());
3961 $("#ajax-json").val(escape(dataJSON));
3962 <?php if (! $GLOBALS['DUPX_DEBUG']) : ?>
3963 setTimeout(function() {$('#s1-result-form').submit();}, 500);
3964 <?php endif; ?>
3965 $('#progress-area').fadeOut(1000);
3966 } else {
3967 $('#ajaxerr-data').html('Error Processing Step 1');
3968 DUPX.hideProgressBar();
3969 }
3970 },
3971 error: function(xhr) {
3972 var status = "<b>Server Code:</b> " + xhr.status + "<br/>";
3973 status += "<b>Status:</b> " + xhr.statusText + "<br/>";
3974 status += "<b>Response:</b> " + xhr.responseText + "";
3975 status += "<hr/><b>Additional Troubleshooting Tips:</b><br/>";
3976 status += "- Check the <a href='installer-log.txt' target='install_log'>installer-log.txt</a> file for warnings or errors.<br/>";
3977 status += "- Check the web server and PHP error logs. <br/>";
3978 status += "- For timeout issues visit the <a href='https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_ajaxextract_tofaq#faq-trouble-100-q' target='_blank'>Timeout FAQ Section</a><br/>";
3979 $('#ajaxerr-data').html(status);
3980 DUPX.hideProgressBar();
3981 }
3982 });
3983
3984 };
3985
3986 /** Accetps Useage Warning */
3987 DUPX.acceptWarning = function()
3988 {
3989 if ($("#accept-warnings").is(':checked')) {
3990 $("#s1-deploy-btn").removeAttr("disabled");
3991 $("#s1-deploy-btn").removeAttr("title");
3992 } else {
3993 $("#s1-deploy-btn").attr("disabled", "true");
3994 $("#s1-deploy-btn").attr("title", "<?php echo $agree_msg; ?>");
3995 }
3996 }
3997
3998 /** Server Terms Dialog*/
3999 DUPX.showNotices = function()
4000 {
4001 modal({
4002 type: 'alert',
4003 title: 'Terms and Notices',
4004 text: $('#dialog-server-notice').html()
4005 });
4006 }
4007
4008
4009 /** Go back on AJAX result view */
4010 DUPX.hideErrorResult = function()
4011 {
4012 $('#s1-result-form').hide();
4013 $('#s1-input-form').show(200);
4014 }
4015
4016 DUPX.onSafeModeSwitch = function ()
4017 {
4018 var mode = $('#exe_safe_mode').val();
4019 if(mode == 0){
4020 $("#retain_config").removeAttr("disabled");
4021 }else if(mode == 1 || mode ==2){
4022 if($("#retain_config").is(':checked'))
4023 $("#retain_config").removeAttr("checked");
4024 $("#retain_config").attr("disabled", true);
4025 }
4026
4027 $('#exe-safe-mode').val(mode);
4028 console.log("mode set to"+mode);
4029 }
4030
4031 //DOCUMENT LOAD
4032 $(document).ready(function()
4033 {
4034 DUPX.acceptWarning();
4035 $("*[data-type='toggle']").click(DUPX.toggleClick);
4036 <?php echo ($all_arc == 'Fail') ? "$('#s1-area-archive-file-link').trigger('click');" : ""; ?>
4037 <?php echo (! $all_success) ? "$('#s1-area-sys-setup-link').trigger('click');" : ""; ?>
4038 })
4039</script>
4040 <?php
4041 break;
4042 case "2" :
4043 ?> <?php
4044 $_POST['logging'] = isset($_POST['logging']) ? trim(DUPX_U::sanitize($_POST['logging'])) : 1;
4045 $_POST['exe_safe_mode'] = (isset($_POST['exe_safe_mode'])) ? DUPX_U::sanitize($_POST['exe_safe_mode']) : 0;
4046?>
4047
4048
4049<!-- =========================================
4050VIEW: STEP 2- INPUT -->
4051<form id='s2-input-form' method="post" class="content-form" data-parsley-validate="true" data-parsley-excluded="input[type=hidden], [disabled], :hidden">
4052<input type="hidden" name="action_ajax" value="2" />
4053<input type="hidden" name="action_step" value="2" />
4054<input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
4055<input type="hidden" name="logging" id="logging" value="<?php echo $_POST['logging'] ?>" />
4056
4057 <div class="dupx-logfile-link"><a href="installer-log.txt?now=<?php echo $GLOBALS['NOW_DATE'] ?>" target="install_log">installer-log.txt</a></div>
4058 <div class="hdr-main">
4059 Step <span class="step">2</span> of 4: Install Database
4060 </div>
4061
4062 <div class="s2-btngrp">
4063 <input id="s2-basic-btn" type="button" value="Basic" class="active" onclick="DUPX.togglePanels('basic')" />
4064 <input id="s2-cpnl-btn" type="button" value="cPanel" class="in-active" onclick="DUPX.togglePanels('cpanel')" />
4065 </div>
4066
4067
4068 <!-- =========================================
4069 BASIC PANEL -->
4070 <div id="s2-basic-pane">
4071 <div class="hdr-sub1" data-type="toggle" data-target="#s2-area-setup">
4072 <a href="javascript:void(0)"><i class="dupx-minus-square"></i> Setup</a>
4073 </div>
4074 <div id="s2-area-setup">
4075 <table class="dupx-opts">
4076 <tr>
4077 <td>Action:</td>
4078 <td>
4079 <select name="dbaction" id="dbaction">
4080 <option value="create">Create New Database</option>
4081 <option value="empty" selected="true">Connect and Remove All Data</option>
4082 </select>
4083 </td>
4084 </tr>
4085 <tr>
4086 <td>Host:</td>
4087 <td>
4088 <table class="s2-opts-dbhost">
4089 <tr>
4090 <td><input type="text" name="dbhost" id="dbhost" required="true" value="<?php echo htmlspecialchars($GLOBALS['FW_DBHOST']); ?>" placeholder="localhost" style="width:450px" /></td>
4091 <td style="vertical-align:top">
4092 <input id="s2-dbport-btn" type="button" onclick="DUPX.togglePort()" class="s2-small-btn" value="Port: <?php echo htmlspecialchars($GLOBALS['FW_DBPORT']); ?>" />
4093 <input name="dbport" id="dbport" type="text" style="width:80px; display:none" value="<?php echo htmlspecialchars($GLOBALS['FW_DBPORT']); ?>" />
4094 </td>
4095 </tr>
4096 </table>
4097 </td>
4098 </tr>
4099 <tr>
4100 <td>Database:</td>
4101 <td>
4102 <input type="text" name="dbname" id="dbname" required="true" value="<?php echo htmlspecialchars($GLOBALS['FW_DBNAME']); ?>" placeholder="new or existing database name" />
4103 <div id="s2-warning-emptydb">
4104 <label for="accept-warnings">Warning: The selected 'Action' above will remove <u>all data</u> from this database!</label>
4105 </div>
4106 </td>
4107 </tr>
4108 <tr>
4109 <td>User:</td>
4110 <td><input type="text" name="dbuser" id="dbuser" required="true" value="<?php echo htmlspecialchars($GLOBALS['FW_DBUSER']); ?>" placeholder="valid database username" /></td>
4111 </tr>
4112 <tr>
4113 <td>Password:</td>
4114 <td><input type="text" name="dbpass" id="dbpass" value="<?php echo htmlspecialchars($GLOBALS['FW_DBPASS']); ?>" placeholder="valid database user password" /></td>
4115 </tr>
4116 </table>
4117 </div>
4118 </div>
4119
4120
4121 <!-- =========================================
4122 C-PANEL PANEL -->
4123 <div id="s2-cpnl-pane">
4124 <div class="s2-gopro">
4125 <h2>cPanel Connectivity</h2>
4126
4127 <?php if( DUPX_U::isURLActive($_SERVER['SERVER_NAME'], 2083) ): ?>
4128 <div class='s2-cpanel-login'>
4129 <b>Login to this server's cPanel</b><br/>
4130 <a href="https://<?php echo $_SERVER['SERVER_NAME'] ?>:2083" target="cpanel" style="color:#fff">[<?php echo $_SERVER['SERVER_NAME'] ?>:2083]</a>
4131 </div>
4132 <?php else : ?>
4133 <div class='s2-cpanel-off'>
4134 <b>This server does not appear to support cPanel!</b><br/>
4135 Consider <a href="https://snapcreek.com/wordpress-hosting/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=free_install_no_cpanel&utm_campaign=duplicator_pro" target="cpanel" style="color:#fff;font-weight:bold">upgrading</a> to a host that does.<br/>
4136 </div>
4137 <?php endif; ?>
4138
4139
4140 <div style="text-align: center; font-size: 14px">
4141 Want <span style="font-style: italic;">even easier</span> installs?
4142 <a target="_blank" href="https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=free_install_step2&utm_campaign=duplicator_pro"><b>Duplicator Pro</b></a>
4143 allows the following <b>right from the installer:</b>
4144 </div>
4145 <ul>
4146 <li>Directly login to cPanel</li>
4147 <li>Instantly create new databases & users</li>
4148 <li>Preview and select existing databases & users</li>
4149 </ul>
4150 <small>
4151 Note: Hosts that support cPanel provide remote access to server resources, allowing operations such as direct database and user creation.
4152 Since the <a target="_blank" href="https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=free_install_cpanel_note&utm_campaign=duplicator_pro">Duplicator Pro</a>
4153 installer can directly access cPanel, it dramatically speeds up your workflow.
4154 </small>
4155 </div>
4156 </div>
4157
4158 <!-- =========================================
4159 DIALOG: DB CONNECTION CHECK -->
4160 <div id="s2-dbconn">
4161 <div id="s2-dbconn-status" style="display:none">
4162 <div style="padding: 0px 10px 10px 10px;">
4163 <div id="s2-dbconn-test-msg" style="min-height:80px"></div>
4164 </div>
4165 <small><input type="button" onclick="$('#s2-dbconn-status').hide(500)" class="s2-small-btn" value="Hide Message" /></small>
4166 </div>
4167 </div>
4168
4169
4170 <br/>
4171
4172 <!-- ====================================
4173 OPTIONS
4174 ==================================== -->
4175 <div class="hdr-sub1" data-type="toggle" data-target="#s2-area-adv-opts">
4176 <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Options</a>
4177 </div>
4178 <div id='s2-area-adv-opts' style="display:none">
4179 <div class="help-target"><a href="?help#help-s2" target="_blank">[help]</a></div>
4180
4181 <table class="dupx-opts dupx-advopts">
4182 <tr>
4183 <td>Legacy:</td>
4184 <td><input type="checkbox" name="dbcollatefb" id="dbcollatefb" value="1" /> <label for="dbcollatefb">Apply legacy collation fallback support for unknown collations types</label></td>
4185 </tr>
4186 <tr>
4187 <td>Spacing:</td>
4188 <td colspan="2">
4189 <input type="checkbox" name="dbnbsp" id="dbnbsp" value="1" /> <label for="dbnbsp">Fix non-breaking space characters</label>
4190 </td>
4191 </tr>
4192 <tr>
4193 <td style="vertical-align:top">Mode:</td>
4194 <td colspan="2">
4195 <input type="radio" name="dbmysqlmode" id="dbmysqlmode_1" checked="true" value="DEFAULT"/> <label for="dbmysqlmode_1">Default</label>
4196 <input type="radio" name="dbmysqlmode" id="dbmysqlmode_2" value="DISABLE"/> <label for="dbmysqlmode_2">Disable</label>
4197 <input type="radio" name="dbmysqlmode" id="dbmysqlmode_3" value="CUSTOM"/> <label for="dbmysqlmode_3">Custom</label>
4198 <div id="dbmysqlmode_3_view" style="display:none; padding:5px">
4199 <input type="text" name="dbmysqlmode_opts" value="" /><br/>
4200 <small>Separate additional <a href="?help#help-mysql-mode" target="_blank">sql modes</a> with commas & no spaces.<br/>
4201 Example: <i>NO_ENGINE_SUBSTITUTION,NO_ZERO_IN_DATE,...</i>.</small>
4202 </div>
4203 </td>
4204 </tr>
4205 <tr><td style="width:130px">Charset:</td><td><input type="text" name="dbcharset" id="dbcharset" value="<?php echo $_POST['dbcharset'] ?>" /> </td></tr>
4206 <tr><td>Collation:</td><td><input type="text" name="dbcollate" id="dbcollate" value="<?php echo $_POST['dbcollate'] ?>" /> </tr>
4207 </table>
4208
4209 </div>
4210 <br/><br/><br/>
4211 <br/><br/><br/>
4212
4213 <div class="dupx-footer-buttons">
4214 <input type="button" onclick="DUPX.testDatabase()" class="default-btn" value="Test Database" />
4215 <input id="dup-step2-deploy-btn" type="button" class="default-btn" value=" Next " onclick="DUPX.confirmDeployment()" />
4216 </div>
4217
4218</form>
4219
4220
4221<!-- =========================================
4222VIEW: STEP 2 - AJAX RESULT
4223Auto Posts to view.step3.php
4224========================================= -->
4225<form id='s2-result-form' method="post" class="content-form" style="display:none">
4226
4227 <div class="dupx-logfile-link"><a href="installer-log.txt" target="install_log">installer-log.txt</a></div>
4228 <div class="hdr-main">
4229 Step <span class="step">2</span> of 4: Install Database
4230 </div>
4231
4232 <!-- POST PARAMS -->
4233 <div class="dupx-debug">
4234 <input type="hidden" name="action_step" value="3" />
4235 <input type="hidden" name="archive_name" value="<?php echo $GLOBALS['FW_PACKAGE_NAME'] ?>" />
4236 <input type="hidden" name="logging" id="ajax-logging" />
4237 <input type="hidden" name="retain_config" value="<?php echo $_POST['retain_config']; ?>" />
4238 <input type="hidden" name="exe_safe_mode" id="exe-safe-mode" value="<?php echo $_POST['exe_safe_mode']; ?>"/>
4239 <input type="hidden" name="dbhost" id="ajax-dbhost" />
4240 <input type="hidden" name="dbport" id="ajax-dbport" />
4241 <input type="hidden" name="dbuser" id="ajax-dbuser" />
4242 <input type="hidden" name="dbpass" id="ajax-dbpass" />
4243 <input type="hidden" name="dbname" id="ajax-dbname" />
4244 <input type="hidden" name="json" id="ajax-json" />
4245 <input type="hidden" name="dbcharset" id="ajax-dbcharset" />
4246 <input type="hidden" name="dbcollate" id="ajax-dbcollate" />
4247 <br/>
4248 <input type='submit' value='manual submit'>
4249 </div>
4250
4251 <!-- PROGRESS BAR -->
4252 <div id="progress-area">
4253 <div style="width:500px; margin:auto">
4254 <h3>Installing Database Please Wait...</h3>
4255 <div id="progress-bar"></div>
4256 <i>This may take several minutes</i>
4257 </div>
4258 </div>
4259
4260 <!-- AJAX SYSTEM ERROR -->
4261 <div id="ajaxerr-area" style="display:none">
4262 <p>Please try again an issue has occurred.</p>
4263 <div style="padding: 0px 10px 10px 0px;">
4264 <div id="ajaxerr-data">An unknown issue has occurred with the file and database set up process. Please see the installer-log.txt file for more details.</div>
4265 <div style="text-align:center; margin:10px auto 0px auto">
4266 <input type="button" class="default-btn" onclick='DUPX.hideErrorResult()' value="« Try Again" /><br/><br/>
4267 <i style='font-size:11px'>See online help for more details at <a href='https://snapcreek.com/ticket?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_ajaxstep2_ticket' target='_blank'>snapcreek.com</a></i>
4268 </div>
4269 </div>
4270 </div>
4271</form>
4272
4273
4274
4275<!-- CONFIRM DIALOG -->
4276<div id="dialog-confirm-content" style="display:none">
4277 <div style="padding:0 0 25px 0">
4278 <b>Run installer with these settings?</b>
4279 </div>
4280
4281 <b>Database Settings:</b><br/>
4282 <table style="margin-left:20px">
4283 <tr>
4284 <td><b>Server:</b></td>
4285 <td><i id="dlg-dbhost"></i></td>
4286 </tr>
4287 <tr>
4288 <td><b>Name:</b></td>
4289 <td><i id="dlg-dbname"></i></td>
4290 </tr>
4291 <tr>
4292 <td><b>User:</b></td>
4293 <td><i id="dlg-dbuser"></i></td>
4294 </tr>
4295 </table>
4296 <br/><br/>
4297
4298 <small> WARNING: Be sure these database parameters are correct! Entering the wrong information WILL overwrite an existing database.
4299 Make sure to have backups of all your data before proceeding.</small><br/>
4300</div>
4301
4302
4303<script>
4304/* Confirm Dialog to validate run */
4305DUPX.confirmDeployment = function()
4306{
4307 var $form = $('#s2-input-form');
4308 $form.parsley().validate();
4309 if (!$form.parsley().isValid()) {
4310 return;
4311 }
4312
4313 $('#dlg-dbhost').html($("#dbhost").val());
4314 $('#dlg-dbname').html($("#dbname").val());
4315 $('#dlg-dbuser').html($("#dbuser").val());
4316
4317 modal({
4318 type: 'confirm',
4319 title: 'Install Confirmation',
4320 text: $('#dialog-confirm-content').html(),
4321 callback: function(result)
4322 {
4323 if (result == true) {
4324 DUPX.runDeployment();
4325 }
4326 }
4327 });
4328}
4329
4330
4331/* Performs Ajax post to extract files and create db
4332 * Timeout (10000000 = 166 minutes) */
4333DUPX.runDeployment = function()
4334{
4335 var $form = $('#s2-input-form');
4336 var dbhost = $("#dbhost").val();
4337 var dbname = $("#dbname").val();
4338 var dbuser = $("#dbuser").val();
4339
4340 $.ajax({
4341 type: "POST",
4342 timeout: 1800000,
4343 dataType: "json",
4344 url: window.location.href,
4345 data: $form.serialize(),
4346 beforeSend: function() {
4347 DUPX.showProgressBar();
4348 $form.hide();
4349 $('#s2-result-form').show();
4350 },
4351 success: function(data, textStatus, xhr){
4352 if (typeof(data) != 'undefined' && data.pass == 1) {
4353 $("#ajax-dbhost").val($("#dbhost").val());
4354 $("#ajax-dbport").val($("#dbport").val());
4355 $("#ajax-dbuser").val($("#dbuser").val());
4356 $("#ajax-dbpass").val($("#dbpass").val());
4357 $("#ajax-dbname").val($("#dbname").val());
4358 $("#ajax-dbcharset").val($("#dbcharset").val());
4359 $("#ajax-dbcollate").val($("#dbcollate").val());
4360 $("#ajax-logging").val($("#logging").val());
4361 $("#ajax-json").val(escape(JSON.stringify(data)));
4362 <?php if (! $GLOBALS['DUPX_DEBUG']) : ?>
4363 setTimeout(function() {$('#s2-result-form').submit();}, 500);
4364 <?php endif; ?>
4365 $('#progress-area').fadeOut(1000);
4366 } else {
4367 DUPX.hideProgressBar();
4368 }
4369 },
4370 error: function(xhr) {
4371 var status = "<b>Server Code:</b> " + xhr.status + "<br/>";
4372 status += "<b>Status:</b> " + xhr.statusText + "<br/>";
4373 status += "<b>Response:</b> " + xhr.responseText + "";
4374 status += "<hr/><b>Additional Troubleshooting Tips:</b><br/>";
4375 status += "- Check the <a href='installer-log.txt' target='install_log'>installer-log.txt</a> file for warnings or errors.<br/>";
4376 status += "- Check the web server and PHP error logs. <br/>";
4377 status += "- For timeout issues visit the <a href='https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_step2deploy_timout#faq-trouble-100-q' target='_blank'>Timeout FAQ Section</a><br/>";
4378 $('#ajaxerr-data').html(status);
4379 DUPX.hideProgressBar();
4380 }
4381 });
4382
4383}
4384
4385/**
4386 * Toggles the cpanel Login area */
4387DUPX.togglePanels = function (pane)
4388{
4389 $('#s2-basic-pane, #s2-cpnl-pane').hide();
4390 $('#s2-basic-btn, #s2-cpnl-btn').removeClass('active in-active');
4391 if (pane == 'basic') {
4392 $('#s2-basic-pane').show();
4393 $('#s2-basic-btn').addClass('active');
4394 $('#s2-cpnl-btn').addClass('in-active');
4395 } else {
4396 $('#s2-cpnl-pane').show(200);
4397 $('#s2-cpnl-btn').addClass('active');
4398 $('#s2-basic-btn').addClass('in-active');
4399 }
4400}
4401
4402
4403/** Go back on AJAX result view */
4404DUPX.hideErrorResult = function()
4405{
4406 $('#s2-result-form').hide();
4407 $('#s2-input-form').show(200);
4408}
4409
4410
4411/** Shows results of database connection
4412* Timeout (45000 = 45 secs) */
4413DUPX.testDatabase = function ()
4414{
4415 $.ajax({
4416 type: "POST",
4417 timeout: 45000,
4418 url: window.location.href + '?' + 'dbtest=1',
4419 data: $('#s2-input-form').serialize(),
4420 success: function(data){ $('#s2-dbconn-test-msg').html(data); },
4421 error: function(data){ alert('An error occurred while testing the database connection! Contact your server admin to make sure the connection inputs are correct!'); }
4422 });
4423
4424 $('#s2-dbconn-test-msg').html("Attempting Connection. Please wait...");
4425 $("#s2-dbconn-status").show(100);
4426
4427}
4428
4429
4430DUPX.showDeleteWarning = function ()
4431{
4432 ($('#dbaction').val() == 'empty')
4433 ? $('#s2-warning-emptydb').show(200)
4434 : $('#s2-warning-emptydb').hide(200);
4435}
4436
4437
4438DUPX.togglePort = function ()
4439{
4440 $('#s2-dbport-btn').hide();
4441 $('#dbport').show();
4442}
4443
4444
4445//DOCUMENT LOAD
4446$(document).ready(function()
4447{
4448 $('#dup-s2-dialog-data').appendTo('#dup-s2-result-container');
4449 $("select#dbaction").click(DUPX.showDeleteWarning);
4450 DUPX.showDeleteWarning();
4451
4452 //MySQL Mode
4453 $("input[name=dbmysqlmode]").click(function() {
4454 if ($(this).val() == 'CUSTOM') {
4455 $('#dbmysqlmode_3_view').show();
4456 } else {
4457 $('#dbmysqlmode_3_view').hide();
4458 }
4459 });
4460
4461 if ($("input[name=dbmysqlmode]:checked").val() == 'CUSTOM') {
4462 $('#dbmysqlmode_3_view').show();
4463 }
4464 $("*[data-type='toggle']").click(DUPX.toggleClick);
4465});
4466</script>
4467 <?php
4468 break;
4469 case "3" :
4470 ?> <?php
4471 $dbh = DUPX_DB::connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname'], $_POST['dbport']);
4472
4473 $all_tables = DUPX_DB::getTables($dbh);
4474 $active_plugins = DUPX_U::getActivePlugins($dbh);
4475
4476 $old_path = $GLOBALS['FW_WPROOT'];
4477 $new_path = DUPX_U::setSafePath($GLOBALS['CURRENT_ROOT_PATH']);
4478 $new_path = ((strrpos($old_path, '/') + 1) == strlen($old_path)) ? DUPX_U::addSlash($new_path) : $new_path;
4479 $_POST['exe_safe_mode'] = isset($_POST['exe_safe_mode']) ? $_POST['exe_safe_mode'] : 0;
4480?>
4481
4482
4483<!-- =========================================
4484VIEW: STEP 3- INPUT -->
4485<form id='s3-input-form' method="post" class="content-form">
4486
4487 <!-- POST PARAMS -->
4488 <input type="hidden" name="action_ajax" value="3" />
4489 <input type="hidden" name="action_step" value="3" />
4490 <input type="hidden" name="logging" value="<?php echo $_POST['logging'] ?>" />
4491 <input type="hidden" name="retain_config" value="<?php echo $_POST['retain_config']; ?>" />
4492 <input type="hidden" name="archive_name" value="<?php echo $_POST['archive_name'] ?>" />
4493 <input type="hidden" name="json" value="<?php echo $_POST['json']; ?>" />
4494 <input type="hidden" name="dbhost" value="<?php echo $_POST['dbhost'] ?>" />
4495 <input type="hidden" name="dbport" value="<?php echo $_POST['dbport'] ?>" />
4496 <input type="hidden" name="dbuser" value="<?php echo $_POST['dbuser'] ?>" />
4497 <input type="hidden" name="dbpass" value="<?php echo htmlentities($_POST['dbpass']) ?>" />
4498 <input type="hidden" name="dbname" value="<?php echo $_POST['dbname'] ?>" />
4499 <input type="hidden" name="dbcharset" value="<?php echo $_POST['dbcharset'] ?>" />
4500 <input type="hidden" name="dbcollate" value="<?php echo $_POST['dbcollate'] ?>" />
4501 <input type="hidden" name="exe_safe_mode" id="exe-safe-mode" value="<?php echo $_POST['exe_safe_mode'] ?>" />
4502
4503 <div class="dupx-logfile-link"><a href="installer-log.txt?now=<?php echo $GLOBALS['NOW_DATE'] ?>" target="install_log">installer-log.txt</a></div>
4504 <div class="hdr-main">
4505 Step <span class="step">3</span> of 4: Update Data
4506 </div>
4507
4508 <!-- ====================================
4509 NEW SETTINGS
4510 ==================================== -->
4511 <div class="hdr-sub1" style="margin-top:8px" data-type="toggle" data-target="#s3-new-settings">
4512 <a href="javascript:void(0)"><i class="dupx-minus-square"></i> New Settings</a>
4513 </div>
4514 <div id='s3-new-settings'>
4515 <table class="s3-table-inputs">
4516 <tr>
4517 <td style="width:80px">URL:</td>
4518 <td>
4519 <input type="text" name="url_new" id="url_new" value="" />
4520 <a href="javascript:DUPX.getNewURL('url_new')" style="font-size:12px">get</a>
4521 </td>
4522 </tr>
4523 <tr>
4524 <td>Path:</td>
4525 <td><input type="text" name="path_new" id="path_new" value="<?php echo $new_path ?>" /></td>
4526 </tr>
4527 <tr>
4528 <td>Title:</td>
4529 <td><input type="text" name="blogname" id="blogname" value="<?php echo $GLOBALS['FW_BLOGNAME'] ?>" /></td>
4530 </tr>
4531 </table>
4532 </div>
4533 <br/><br/>
4534
4535 <!-- ====================================
4536 OPTIONS
4537 ==================================== -->
4538 <div class="hdr-sub1" data-type="toggle" data-target="#s3-adv-opts">
4539 <a href="javascript:void(0)"><i class="dupx-plus-square"></i> Options</a>
4540 </div>
4541 <div id='s3-adv-opts' style="display:none;">
4542 <div class="help-target"><a href="?help#help-s3" target="_blank">[help]</a></div>
4543 <br/>
4544
4545 <div class="hdr-sub3">New Admin Account</div>
4546 <div style="text-align: center; margin-top:7px">
4547 <i style="color:gray;font-size: 11px">This feature is optional. If the username already exists the account will NOT be created or updated.</i>
4548 </div>
4549 <table class="s3-table-inputs">
4550 <tr>
4551 <td>Username:</td>
4552 <td><input type="text" name="wp_username" id="wp_username" value="" title="4 characters minimum" placeholder="(4 or more characters)" /></td>
4553 </tr>
4554 <tr>
4555 <td valign="top">Password:</td>
4556 <td><input type="text" name="wp_password" id="wp_password" value="" title="6 characters minimum" placeholder="(6 or more characters)" /></td>
4557 </tr>
4558 </table>
4559 <br/><br/>
4560
4561 <div class="hdr-sub3">Scan Options</div>
4562 <table class="s3-table-inputs">
4563 <tr>
4564 <td>Site URL:</td>
4565 <td>
4566 <input type="text" name="siteurl" id="siteurl" value="" />
4567 <a href="javascript:DUPX.getNewURL('siteurl')" style="font-size:12px">get</a><br/>
4568 </td>
4569 </tr>
4570 <tr>
4571 <td>Old URL:</td>
4572 <td>
4573 <input type="text" name="url_old" id="url_old" value="<?php echo $GLOBALS['FW_URL_OLD'] ?>" readonly="readonly" class="readonly" />
4574 <a href="javascript:DUPX.editOldURL()" id="edit_url_old" style="font-size:12px">edit</a>
4575 </td>
4576 </tr>
4577 <tr>
4578 <td>Old Path:</td>
4579 <td>
4580 <input type="text" name="path_old" id="path_old" value="<?php echo $old_path ?>" readonly="readonly" class="readonly" />
4581 <a href="javascript:DUPX.editOldPath()" id="edit_path_old" style="font-size:12px">edit</a>
4582 </td>
4583 </tr>
4584 </table><br/>
4585
4586 <table>
4587 <tr>
4588 <td style="padding-right:10px">
4589 <b>Scan Tables:</b>
4590 <div class="s3-allnonelinks">
4591 <a href="javascript:void(0)" onclick="$('#tables option').prop('selected',true);">[All]</a>
4592 <a href="javascript:void(0)" onclick="$('#tables option').prop('selected',false);">[None]</a>
4593 </div><br style="clear:both" />
4594 <select id="tables" name="tables[]" multiple="multiple">
4595 <?php
4596 foreach( $all_tables as $table ) {
4597 echo '<option selected="selected" value="' . DUPX_U::escapeHTML( $table ) . '">' . $table . '</option>';
4598 }
4599 ?>
4600 </select>
4601 </td>
4602 <td valign="top">
4603 <b>Activate Plugins:</b>
4604 <?php echo ($_POST['exe_safe_mode'] > 0) ? '<small class="s3-warn">Safe Mode Enabled</small>' : '' ; ?>
4605 <div class="s3-allnonelinks" style="<?php echo ($_POST['exe_safe_mode']>0)? 'display:none':''; ?>">
4606 <a href="javascript:void(0)" onclick="$('#plugins option').prop('selected',true);">[All]</a>
4607 <a href="javascript:void(0)" onclick="$('#plugins option').prop('selected',false);">[None]</a>
4608 </div><br style="clear:both" />
4609 <select id="plugins" name="plugins[]" multiple="multiple" <?php echo ($_POST['exe_safe_mode'] > 0) ? 'disabled="disabled"' : ''; ?>>
4610 <?php
4611 $selected_string = ($_POST['exe_safe_mode'] > 0) ? '' : 'selected="selected"';
4612 foreach ($active_plugins as $plugin) {
4613 $plug_val = DUPX_U::escapeHTML($plugin);
4614 $plug_name = dirname($plugin);
4615 echo "<option {$selected_string} value='{$plug_val}'>{$plug_name}</option>";
4616 }
4617 ?>
4618 </select>
4619 </td>
4620 </tr>
4621 </table>
4622 <br/>
4623
4624 <input type="checkbox" name="fullsearch" id="fullsearch" value="1" /> <label for="fullsearch">Use Database Full Search Mode </label><br/>
4625 <input type="checkbox" name="postguid" id="postguid" value="1" /> <label for="postguid">Keep Post GUID Unchanged</label><br/>
4626 <br/><br/>
4627
4628 <!-- WP-CONFIG -->
4629 <div class="hdr-sub3">WP-Config File</div>
4630 <table class="dupx-opts dupx-advopts">
4631 <tr>
4632 <td>Cache:</td>
4633 <td style="width:125px"><input type="checkbox" name="cache_wp" id="cache_wp" /> <label for="cache_wp">Keep Enabled</label></td>
4634 <td><input type="checkbox" name="cache_path" id="cache_path" /> <label for="cache_path">Keep Home Path</label></td>
4635 </tr>
4636 <tr>
4637 <td>SSL:</td>
4638 <td><input type="checkbox" name="ssl_admin" id="ssl_admin" /> <label for="ssl_admin">Enforce on Admin</label></td>
4639 <td></td>
4640 </tr>
4641 </table>
4642 <br/><br/><br/>
4643 <br/><br/>
4644 </div>
4645
4646 <div class="dupx-footer-buttons">
4647 <input id="dup-step3-next" class="default-btn" type="button" value=" Next " onclick="DUPX.runUpdate()" />
4648 </div>
4649</form>
4650
4651
4652<!-- =========================================
4653VIEW: STEP 3 - AJAX RESULT
4654========================================= -->
4655<form id='s3-result-form' method="post" class="content-form" style="display:none">
4656
4657 <div class="dupx-logfile-link"><a href="installer-log.txt" target="install_log">installer-log.txt</a></div>
4658 <div class="hdr-main">
4659 Step <span class="step">3</span> of 4: Update Data
4660 </div>
4661
4662 <!-- POST PARAMS -->
4663 <div class="dupx-debug">
4664 <input type="hidden" name="action_step" value="4" />
4665 <input type="hidden" name="archive_name" value="<?php echo $_POST['archive_name'] ?>" />
4666 <input type="hidden" name="retain_config" value="<?php echo $_POST['retain_config']; ?>" />
4667 <input type="hidden" name="exe_safe_mode" id="exe-safe-mode" value="<?php echo $_POST['exe_safe_mode']; ?>"/>
4668 <input type="hidden" name="url_new" id="ajax-url_new" />
4669 <input type="hidden" name="json" id="ajax-json" />
4670 <br/>
4671 <input type='submit' value='manual submit'>
4672 </div>
4673
4674 <!-- PROGRESS BAR -->
4675 <div id="progress-area">
4676 <div style="width:500px; margin:auto">
4677 <h3>Updating Data Replacements Please Wait...</h3>
4678 <div id="progress-bar"></div>
4679 <i>This may take several minutes</i>
4680 </div>
4681 </div>
4682
4683 <!-- AJAX SYSTEM ERROR -->
4684 <div id="ajaxerr-area" style="display:none">
4685 <p>Please try again an issue has occurred.</p>
4686 <div style="padding: 0px 10px 10px 10px;">
4687 <div id="ajaxerr-data">An unknown issue has occurred with the update data set up process. Please see the installer-log.txt file for more details.</div>
4688 <div style="text-align:center; margin:10px auto 0px auto">
4689 <input type="button" class="default-btn" onclick='DUPX.hideErrorResult2()' value="« Try Again" /><br/><br/>
4690 <i style='font-size:11px'>See online help for more details at <a href='https://snapcreek.com/ticket?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_step3_ajax' target='_blank'>snapcreek.com</a></i>
4691 </div>
4692 </div>
4693 </div>
4694</form>
4695
4696<script>
4697/**
4698* Timeout (10000000 = 166 minutes) */
4699DUPX.runUpdate = function()
4700{
4701 //Validation
4702 var wp_username = $.trim($("#wp_username").val()).length || 0;
4703 var wp_password = $.trim($("#wp_password").val()).length || 0;
4704
4705 if ( $.trim($("#url_new").val()) == "" ) {alert("The 'New URL' field is required!"); return false;}
4706 if ( $.trim($("#siteurl").val()) == "" ) {alert("The 'Site URL' field is required!"); return false;}
4707 if (wp_username >= 1 && wp_username < 4) {alert("The New Admin Account 'Username' must be four or more characters"); return false;}
4708 if (wp_username >= 4 && wp_password < 6) {alert("The New Admin Account 'Password' must be six or more characters"); return false;}
4709
4710 $.ajax({
4711 type: "POST",
4712 timeout: 1800000,
4713 dataType: "json",
4714 url: window.location.href,
4715 data: $('#s3-input-form').serialize(),
4716 beforeSend: function() {
4717 DUPX.showProgressBar();
4718 $('#s3-input-form').hide();
4719 $('#s3-result-form').show();
4720 },
4721 success: function(data){
4722 if (typeof(data) != 'undefined' && data.step3.pass == 1) {
4723 $("#ajax-url_new").val($("#url_new").val());
4724 $("#ajax-json").val(escape(JSON.stringify(data)));
4725 <?php if (! $GLOBALS['DUPX_DEBUG']) : ?>
4726 setTimeout(function(){$('#s3-result-form').submit();}, 500);
4727 <?php endif; ?>
4728 $('#progress-area').fadeOut(1000);
4729 } else {
4730 DUPX.hideProgressBar();
4731 }
4732 },
4733 error: function(xhr) {
4734 var status = "<b>Server Code:</b> " + xhr.status + "<br/>";
4735 status += "<b>Status:</b> " + xhr.statusText + "<br/>";
4736 status += "<b>Response:</b> " + xhr.responseText + "";
4737 status += "<hr/><b>Additional Troubleshooting Tips:</b><br/>";
4738 status += "- Check the <a href='installer-log.txt' target='install_log'>installer-log.txt</a> file for warnings or errors.<br/>";
4739 status += "- Check the web server and PHP error logs. <br/>";
4740 status += "- For timeout issues visit the <a href='https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_step3_ajax_rundepl#faq-trouble-100-q' target='_blank'>Timeout FAQ Section</a><br/>";
4741 $('#ajaxerr-data').html(status);
4742 DUPX.hideProgressBar();
4743 }
4744 });
4745}
4746
4747/** Returns the windows active url */
4748DUPX.getNewURL = function(id)
4749{
4750 var filename= window.location.pathname.split('/').pop() || 'installer.php' ;
4751 var path = window.location.href.replace(filename, '').replace(/\/$/, '');
4752 $("#" + id).val(path);
4753}
4754
4755/** Allows user to edit the package url */
4756DUPX.editOldURL = function()
4757{
4758 var msg = 'This is the URL that was generated when the package was created.\n';
4759 msg += 'Changing this value may cause issues with the install process.\n\n';
4760 msg += 'Only modify this value if you know exactly what the value should be.\n';
4761 msg += 'See "General Settings" in the WordPress Administrator for more details.\n\n';
4762 msg += 'Are you sure you want to continue?';
4763
4764 if (confirm(msg)) {
4765 $("#url_old").removeAttr('readonly');
4766 $("#url_old").removeClass('readonly');
4767 $('#edit_url_old').hide('slow');
4768 }
4769}
4770
4771/** Allows user to edit the package path */
4772DUPX.editOldPath = function()
4773{
4774 var msg = 'This is the SERVER URL that was generated when the package was created.\n';
4775 msg += 'Changing this value may cause issues with the install process.\n\n';
4776 msg += 'Only modify this value if you know exactly what the value should be.\n';
4777 msg += 'Are you sure you want to continue?';
4778
4779 if (confirm(msg)) {
4780 $("#path_old").removeAttr('readonly');
4781 $("#path_old").removeClass('readonly');
4782 $('#edit_path_old').hide('slow');
4783 }
4784}
4785
4786/** Go back on AJAX result view */
4787DUPX.hideErrorResult2 = function()
4788{
4789 $('#s3-result-form').hide();
4790 $('#s3-input-form').show(200);
4791}
4792
4793//DOCUMENT LOAD
4794$(document).ready(function()
4795{
4796 DUPX.getNewURL('url_new');
4797 DUPX.getNewURL('siteurl');
4798 $("*[data-type='toggle']").click(DUPX.toggleClick);
4799 $("#wp_password").passStrength({
4800 shortPass: "top_shortPass",
4801 badPass: "top_badPass",
4802 goodPass: "top_goodPass",
4803 strongPass: "top_strongPass",
4804 baseStyle: "top_testresult",
4805 userid: "#wp_username",
4806 messageloc: 1 });
4807});
4808</script> <?php
4809 break;
4810 case "4" :
4811 ?> <?php
4812
4813 $_POST['url_new'] = isset($_POST['url_new']) ? DUPX_U::sanitize($_POST['url_new']) : '';
4814 $_POST['archive_name'] = isset($_POST['archive_name']) ? $_POST['archive_name'] : '';
4815 $_POST['retain_config'] = isset($_POST['retain_config']) && $_POST['retain_config'] == '1' ? true : false;
4816 $_POST['exe_safe_mode'] = isset($_POST['exe_safe_mode']) ? $_POST['exe_safe_mode'] : 0;
4817
4818 $admin_base = basename($GLOBALS['FW_WPLOGIN_URL']);
4819
4820 $safe_mode = $_POST['exe_safe_mode'];
4821 $admin_redirect = rtrim($_POST['url_new'], "/") . "/wp-admin/admin.php?page=duplicator-tools&tab=diagnostics§ion=info&package={$_POST['archive_name']}&safe_mode={$safe_mode}";
4822 $admin_redirect = urlencode($admin_redirect);
4823 $admin_url_qry = (strpos($admin_base, '?') === false) ? '?' : '&';
4824 $admin_login = rtrim($_POST['url_new'], '/') . "/{$admin_base}{$admin_url_qry}redirect_to={$admin_redirect}";
4825 $url_new_rtrim = rtrim($_POST['url_new'], '/');
4826
4827?>
4828
4829<script>
4830 /** Posts to page to remove install files */
4831 DUPX.getAdminLogin = function() {
4832 window.open('<?php echo $admin_login; ?>', 'wp-admin');
4833 };
4834</script>
4835
4836
4837<!-- =========================================
4838VIEW: STEP 4 - INPUT -->
4839<form id='s4-input-form' method="post" class="content-form" style="line-height:20px">
4840 <input type="hidden" name="url_new" id="url_new" value="<?php echo $url_new_rtrim; ?>" />
4841 <div class="dupx-logfile-link"><a href="installer-log.txt?now=<?php echo $GLOBALS['NOW_DATE'] ?>" target="install_log">installer-log.txt</a></div>
4842
4843 <div class="hdr-main">
4844 Step <span class="step">4</span> of 4: Test Site
4845 </div><br />
4846
4847 <table class="s4-final-step">
4848 <tr style="vertical-align:top">
4849 <td><a class="s4-final-btns" href="javascript:void(0)" onclick="DUPX.getAdminLogin()">Site Login</a></td>
4850 <td>
4851 <i>Login to finalize the setup</i>
4852 <?php if ($_POST['retain_config']) :?>
4853 <br/> <i>Update of Permalinks required see: Admin > Settings > Permalinks > Save</i>
4854 <?php endif;?>
4855 <br/><br/>
4856
4857 <!-- WARN: SAFE MODE MESSAGES -->
4858 <div class="s4-warn" style="display:<?php echo ($safe_mode > 0 ? 'block' : 'none')?>">
4859 <b>Safe Mode</b><br/>
4860 Safe mode has <u>deactivated</u> all plugins. Please be sure to enable your plugins after logging in. <i>If you notice that problems arise when activating
4861 the plugins then active them one-by-one to isolate the plugin that could be causing the issue.</i>
4862 </div>
4863 </td>
4864 </tr>
4865 <tr>
4866 <td><a class="s4-final-btns" href="javascript:void(0)" onclick="$('#dup-step3-install-report').toggle(400)">Show Report</a></td>
4867 <td>
4868 <i>Optionally review the migration report</i><br/>
4869 <i id="dup-step3-install-report-count">
4870 <span data-bind="with: status.step2">Install Notices: (<span data-bind="text: query_errs"></span>)</span>
4871 <span data-bind="with: status.step3">Update Notices: (<span data-bind="text: err_all"></span>)</span>
4872 <span data-bind="with: status.step3" style="color:#888"><b>General Notices:</b> (<span data-bind="text: warn_all"></span>)</span>
4873 </i>
4874 </td>
4875 </tr>
4876 </table>
4877 <br/><br/>
4878
4879 <div class="s4-go-back">
4880 Additional Notes:
4881 <ul style="margin-top: 1px">
4882 <li>
4883 Review the <a href="<?php echo $url_new_rtrim; ?>" target="_blank">front-end</a> or
4884 re-run installer at <a href="<?php echo "{$url_new_rtrim}/installer.php"; ?>">step 1</a>
4885 </li>
4886 <li>The .htaccess file was reset. Resave plugins that write to this file.</li>
4887 <li>
4888 Visit the <a href="installer.php?help=1#troubleshoot" target="_blank">troubleshoot</a> section or
4889 <a href='https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst4_step4_troubleshoot' target='_blank'>online FAQs</a> for additional help.
4890 </li>
4891 </ul>
4892 </div>
4893
4894 <!-- ========================
4895 INSTALL REPORT -->
4896 <div id="dup-step3-install-report" style='display:none'>
4897 <table class='s4-report-results' style="width:100%">
4898 <tr><th colspan="4">Database Report</th></tr>
4899 <tr style="font-weight:bold">
4900 <td style="width:150px"></td>
4901 <td>Tables</td>
4902 <td>Rows</td>
4903 <td>Cells</td>
4904 </tr>
4905 <tr data-bind="with: status.step2">
4906 <td>Created</td>
4907 <td><span data-bind="text: table_count"></span></td>
4908 <td><span data-bind="text: table_rows"></span></td>
4909 <td>n/a</td>
4910 </tr>
4911 <tr data-bind="with: status.step3">
4912 <td>Scanned</td>
4913 <td><span data-bind="text: scan_tables"></span></td>
4914 <td><span data-bind="text: scan_rows"></span></td>
4915 <td><span data-bind="text: scan_cells"></span></td>
4916 </tr>
4917 <tr data-bind="with: status.step3">
4918 <td>Updated</td>
4919 <td><span data-bind="text: updt_tables"></span></td>
4920 <td><span data-bind="text: updt_rows"></span></td>
4921 <td><span data-bind="text: updt_cells"></span></td>
4922 </tr>
4923 </table>
4924 <br/>
4925
4926 <table class='s4-report-errs' style="width:100%; border-top:none">
4927 <tr><th colspan="4">Report Notices</th></tr>
4928 <tr>
4929 <td data-bind="with: status.step2">
4930 <a href="javascript:void(0);" onclick="$('#dup-step3-errs-create').toggle(400)">Step 2: Install Notices (<span data-bind="text: query_errs"></span>)</a><br/>
4931 </td>
4932 <td data-bind="with: status.step3">
4933 <a href="javascript:void(0);" onclick="$('#dup-step3-errs-upd').toggle(400)">Step 3: Update Notices (<span data-bind="text: err_all"></span>)</a>
4934 </td>
4935 <td data-bind="with: status.step3">
4936 <a href="#dup-step3-errs-warn-anchor" onclick="$('#dup-step3-warnlist').toggle(400)">General Notices (<span data-bind="text: warn_all"></span>)</a>
4937 </td>
4938 </tr>
4939 <tr><td colspan="4"></td></tr>
4940 </table>
4941
4942 <div id="dup-step3-errs-create" class="s4-err-msg">
4943 <div class="s4-err-title">STEP 2 - INSTALL NOTICES:</div>
4944 <b data-bind="with: status.step2">ERRORS (<span data-bind="text: query_errs"></span>)</b><br/>
4945 <div class="info-error">
4946 Queries that error during the deploy step are logged to the <a href="installer-log.txt" target="dpro-installer">install-log.txt</a> file and
4947 and marked with an **ERROR** status. If you experience a few errors (under 5), in many cases they can be ignored as long as your site is working correctly.
4948 However if you see a large amount of errors or you experience an issue with your site then the error messages in the log file will need to be investigated.
4949 <br/><br/>
4950
4951 <b>COMMON FIXES:</b>
4952 <ul>
4953 <li>
4954 <b>Unknown collation:</b> See Online FAQ:
4955 <a href="https://snapcreek.com/duplicator/docs/faqs-tech/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=problem_resolution&utm_content=inst_step4_unknowncoll#faq-installer-110-q" target="_blank">What is Compatibility mode & 'Unknown collation' errors?</a>
4956 </li>
4957 <li>
4958 <b>Query Limits:</b> Update MySQL server with the <a href="https://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html" target="_blank">max_allowed_packet</a>
4959 setting for larger payloads.
4960 </li>
4961 </ul>
4962
4963 </div>
4964 </div>
4965
4966 <div id="dup-step3-errs-upd" class="s4-err-msg">
4967 <div class="s4-err-title">STEP 3 - UPDATE NOTICES:</div>
4968 <!-- MYSQL QUERY ERRORS -->
4969 <b data-bind="with: status.step3">ERRORS (<span data-bind="text: errsql_sum"></span>) </b><br/>
4970 <div class="info-error">
4971 Update errors that show here are queries that could not be performed because the database server being used has issues running it. Please validate the query, if
4972 it looks to be of concern please try to run the query manually. In many cases if your site performs well without any issues you can ignore the error.
4973 </div>
4974 <div class="content">
4975 <div data-bind="foreach: status.step3.errsql"><div data-bind="text: $data"></div></div>
4976 <div data-bind="visible: status.step3.errsql.length == 0">No MySQL query errors found</div>
4977 </div>
4978 <br/>
4979
4980 <!-- TABLE KEY ERRORS -->
4981 <b data-bind="with: status.step3">TABLE KEY NOTICES (<span data-bind="text: errkey_sum"></span>)</b><br/>
4982 <div class="info-notice">
4983 Notices should be ignored unless issues are found after you have tested an installed site. This notice indicates that a primary key is required to run the
4984 update engine. Below is a list of tables and the rows that were not updated. On some databases you can remove these notices by checking the box 'Enable Full Search'
4985 under advanced options in step3 of the installer.
4986 <br/><br/>
4987 <small>
4988 <b>Advanced Searching:</b><br/>
4989 Use the following query to locate the table that was not updated: <br/>
4990 <i>SELECT @row := @row + 1 as row, t.* FROM some_table t, (SELECT @row := 0) r</i>
4991 </small>
4992 </div>
4993 <div class="content">
4994 <div data-bind="foreach: status.step3.errkey"><div data-bind="text: $data"></div></div>
4995 <div data-bind="visible: status.step3.errkey.length == 0">No missing primary key errors</div>
4996 </div>
4997 <br/>
4998
4999 <!-- SERIALIZE ERRORS -->
5000 <b data-bind="with: status.step3">SERIALIZATION NOTICES (<span data-bind="text: errser_sum"></span>)</b><br/>
5001 <div class="info-notice">
5002 Notices should be ignored unless issues are found after you have tested an installed site. The SQL below will show data that may have not been
5003 updated during the serialization process. Best practices for serialization notices is to just re-save the plugin/post/page in question.
5004 </div>
5005 <div class="content">
5006 <div data-bind="foreach: status.step3.errser"><div data-bind="text: $data"></div></div>
5007 <div data-bind="visible: status.step3.errser.length == 0">No serialization errors found</div>
5008 </div>
5009 <br/>
5010
5011 </div>
5012
5013
5014 <!-- WARNINGS-->
5015 <div id="dup-step3-warnlist" class="s4-err-msg">
5016 <a href="#" id="dup-step3-errs-warn-anchor"></a>
5017 <b>GENERAL NOTICES</b><br/>
5018 <div class="info">
5019 The following is a list of notices that may need to be fixed in order to finalize your setup. These values should only be investigated if your running into
5020 issues with your site. For more details see the <a href="https://codex.wordpress.org/Editing_wp-config.php" target="_blank">WordPress Codex</a>.
5021 </div>
5022 <div class="content">
5023 <div data-bind="foreach: status.step3.warnlist">
5024 <div data-bind="text: $data"></div>
5025 </div>
5026 <div data-bind="visible: status.step3.warnlist.length == 0">
5027 No notices found
5028 </div>
5029 </div>
5030 </div><br/>
5031
5032 </div><br/>
5033
5034 <?php
5035 $num = rand(1,2);
5036 switch ($num) {
5037 case 1:
5038 $key = 'free_inst_s3btn1';
5039 $txt = 'Want More Power?';
5040 break;
5041 case 2:
5042 $key = 'free_inst_s3btn2';
5043 $txt = 'Go Pro Today!';
5044 break;
5045 default :
5046 $key = 'free_inst_s3btn2';
5047 $txt = 'Go Pro Today!';
5048 }
5049 ?>
5050
5051 <div class="s4-gopro-btn">
5052 <a href="https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_campaign=duplicator_pro&utm_content=<?php echo $key;?>" target="_blank">
5053 <?php echo $txt;?>
5054 </a>
5055 </div>
5056 <br/><br/><br/>
5057</form>
5058
5059<?php
5060 //Sanitize
5061 $json_result = true;
5062 $json_data = utf8_decode(urldecode($_POST['json']));
5063 $json_decode = json_decode($json_data);
5064 if ($json_decode == NULL || $json_decode == FALSE) {
5065 $json_data = "{'json reset invalid form value sent'}";
5066 $json_result = false;
5067 }
5068?>
5069
5070<script>
5071<?php if ($json_result) : ?>
5072 MyViewModel = function() {
5073 this.status = <?php echo $json_data; ?>;
5074 var errorCount = this.status.step2.query_errs || 0;
5075 (errorCount >= 1 )
5076 ? $('#dup-step3-install-report-count').css('color', '#BE2323')
5077 : $('#dup-step3-install-report-count').css('color', '#197713');
5078 };
5079 ko.applyBindings(new MyViewModel());
5080<?php else: ?>
5081 console.log("Cross site script attempt detected, unable to create final report!");
5082<?php endif; ?>
5083</script>
5084 <?php
5085 break;
5086}
5087} else {
5088 ?> <!-- =========================================
5089HELP FORM -->
5090<div id="main-help">
5091<div class="help-online">
5092 <i class="fa fa-file-text-o"></i> For additional help visit the<br/> <a href="https://snapcreek.com/support/docs/" target="_blank">Online Knowledge-Base</a><br/>
5093 <small>Features available only in Duplicator Pro are flagged with a <sup>pro</sup> tag.</small>
5094</div>
5095
5096<h2>Installer Security</h2>
5097<a name="help-s1-init"></a>
5098<div id="dup-help-installer" class="help-page">
5099 The installer security screen <sup>pro</sup> will allow for basic password protection on the installer. The password is set at package creation time. The password
5100 input on this screen must be entered before proceeding with an install. This setting is optional and can be turned on/off via the package creation screens.
5101 <br/><br/>
5102
5103 If you do not recall the password then login to the site where the package was created and click the details of the package to view the original password.
5104 To validate the password just typed you can toggle the view by clicking on the lock icon.
5105 <br/><br/>
5106</div>
5107
5108<!-- ============================================
5109STEP 1
5110============================================== -->
5111<a class="help-target" name="help-s1"></a>
5112<h2>Step <span class="step">1</span> of 4: Deployment</h2>
5113<div id="dup-help-scanner" class="help-page">
5114 The "Extract Archive" screen is separated into four sections:
5115 <br/><br/>
5116
5117 <h3>Archive</h3>
5118 This is the archive file the installer must use in order to extract the web site files and database. The 'Name' is a unique key that
5119 ties both the archive and installer together. The installer needs the archive file name to match the 'Name' value exactly character for character in order
5120 for this section to get a pass status.
5121 <br/><br/>
5122 If the archive name is ever changed then it should be renamed back to the 'Name' value in order for the installer to properly identify it as part of a
5123 complete package. Additional information such as the archive size and the package notes are mentioned in this section.
5124 <br/><br/>
5125
5126 <h3>Validation</h3>
5127 This section shows the installers system requirements and notices. All requirements must pass in order to proceed to Step 2. Each requirement will show
5128 a <b class="dupx-pass">Pass</b>/<b class="dupx-fail">Fail</b> status. Notices on the other hand are <u>not</u> required in order to continue with the install.
5129 <br/><br/>
5130
5131 Notices are simply checks that will help you identify any possible issues that might occur. If this section shows a
5132 <b class="dupx-pass">Good</b>/<b class="dupx-fail">Warn</b> for various checks. Click on the title link and read the overview for how to solve the test.
5133 <br/><br/>
5134
5135 <h3>MultiSite <sup>pro</sup></h3>
5136 The multisite option allows users with a pro Business or Gold license to perform additional multi-site tasks. All licenses can backup & migrate standalone sites
5137 and full multisite networks. Multisite Plus+ (business and above) adds the ability to install a subsite as a standalone site.
5138 <br/><br/>
5139
5140 <h3>Options</h3>
5141 The options for step 1 can help better prepare your site should your server need additional settings beyond most general configuration.
5142 <table class="help-opt">
5143 <tr>
5144 <th>Option</th>
5145 <th>Details</th>
5146 </tr>
5147 <tr>
5148 <td colspan="2" class="section">General Options</td>
5149 </tr>
5150 <tr>
5151 <td>Extraction</td>
5152 <td>
5153 <b>Manual Archive Extraction</b><br/>
5154 Set the Extraction value to "Manual Archive Extraction" when the archive file has already been manually extracted on the server. This can be done through your hosts
5155 control panel such as cPanel or by your host directly. This setting can be helpful if you have a large archive files or are having issues with the installer extracting
5156 the file due to timeout issues.
5157 <br/><br/>
5158
5159 <b>PHP ZipArchive</b><br/>
5160 This extraction method will use the PHP <a href="http://php.net/manual/en/book.zip.php" target="_blank">ZipArchive</a> code to extract the archive zip file.
5161 <br/><br/>
5162
5163 <b>Shell-Exec Unzip</b> <sup>pro</sup><br/>
5164 This extraction method will use the PHP <a href="http://php.net/manual/en/function.shell-exec.php" target="_blank">shell_exec</a> to call the system unzip
5165 command on the server. This is the default mode that is used if its avail on the server.
5166 <br/><br/>
5167
5168 </td>
5169 </tr>
5170 <tr>
5171 <td>Permissions <sup>pro</sup></td>
5172 <td>
5173 <b>All Files:</b> Check the 'All Files' check-box and enter in the desired <a href="http://php.net/manual/en/function.chmod.php" target="_blank">chmod command</a>
5174 to recursively set the octal value on all the files being extracted. Typically this value is 644 on most servers and hosts.
5175 <br/><br/>
5176
5177 <b>All Directories:</b> Check the 'All Directories' check-box and enter in the desired <a href="http://php.net/manual/en/function.chmod.php" target="_blank">chmod command</a>
5178 to recursively set octal value on all the directories being extracted. Typically this value is 755 on most servers and hosts.
5179 </td>
5180 </tr>
5181 <tr>
5182 <td colspan="2" class="section">Advanced Options</td>
5183 </tr>
5184 <tr>
5185 <td>Safe Mode</td>
5186 <td>
5187 Safe mode is designed to configure the site with specific options at install time to help over come issues that may happen during the install were the site
5188 is having issues. These options should only be used if you run into issues after you have tried to run an install.
5189 <br/><br/>
5190 <b>Basic:</b> This safe mode option will disable all the plugins at install time. When this option is set you will need to re-enable all plugins after the
5191 install has full ran.
5192 <br/><br/>
5193
5194 <b>Advanced:</b> This option applies all settings used in basic and will also de-activate and reactivate your theme when logging in for the first time. This
5195 options should be used only if the Basic option did not work.
5196 </td>
5197 </tr>
5198 <tr>
5199 <td>Config Files <sup>pro</sup></td>
5200 <td>
5201 Inside the archive.zip should be a copy of the original .htaccess (Apache) or the web.config (IIS) files that were setup with your packaged site.
5202 When the installer runs it will backup and then reset all <i>.htaccess, user.ini, and web.config</i> files. It will then create blank copies of
5203 both files. This is needed because the original files that were archived in most cases will not play well in the new environment.
5204 <br/><br/>
5205
5206 There are cases where users do not want these files over-written after the installer runs. If that is the case then check the checkbox for this setting
5207 to retain the original web server configuration files you had on the original site that was archived. This is an advanced feature and requires that you
5208 know how to properly configure either the .htaccess or web.config files on your server.
5209 </td>
5210 </tr>
5211
5212 <tr>
5213 <td>File Times</td>
5214 <td>When the archive is extracted should it show the current date-time or keep the original time it had when it was built. This setting will be applied to
5215 all files and directories.</td>
5216 </tr>
5217 <tr>
5218 <td>Logging</td>
5219 <td>
5220 The level of detail that will be sent to the log file (installer-log.txt). The recommend setting for most installs should be 'Light'.
5221 Note if you use Debug the amount of data written can be very large. Debug is only recommended for support.
5222 </td>
5223 </tr>
5224
5225 </table>
5226 <br/><br/>
5227
5228 <h3>Notices</h3>
5229 To proceed with the install users must check the checkbox labeled " I have read and accept all terms & notices". This means you accept the term of using the software
5230 and are aware of any notices.
5231 <br/><br/>
5232
5233</div>
5234<br/>
5235
5236
5237<!-- ============================================
5238STEP 2
5239============================================== -->
5240<a class="help-target" name="help-s2"></a>
5241<h2>Step <span class="step">2</span> of 4: Install Database</h2>
5242<div id="dup-help-step1" class="help-page">
5243
5244 <h3>Basic/cPanel:</h3>
5245 There are currently two options you can use to perform the database setup. The "Basic" option requires knowledge about the existing server and on most hosts
5246 will require that the database be setup ahead of time. The cPanel option is for hosts that support <a href="http://cpanel.com/" target="_blank">cPanel Software</a>.
5247 This option will automatically show you the existing databases and users on your cPanel server and allow you to create new databases directly
5248 from the installer.
5249 <br/><br/>
5250
5251 <h3>cPanel Login <sup>pro</sup></h3>
5252 <i>The cPanel connectivity option is only available for Duplicator Pro.</i>
5253 <table class="help-opt">
5254 <tr>
5255 <th>Option</th>
5256 <th>Details</th>
5257 </tr>
5258 <tr>
5259 <td>Host</td>
5260 <td>This should be the primary domain account URL that is associated with your host. Most hosts will require you to register a primary domain name.
5261 This should be the URL that you place in the host field. For example if your primary domain name is "mysite.com" then you would enter in
5262 "https://mysite.com:2083". The port 2038 is the common port number that cPanel works on. If you do not know your primary domain name please contact your
5263 hosting provider or server administrator.</td>
5264 </tr>
5265 <tr>
5266 <td>Username</td>
5267 <td>The cPanel username used to login to your cPanel account. <i>This is <b>not</b> the same thing as your WordPress administrator account</i>.
5268 If your unsure of this name please contact your hosting provider or server administrator.</td>
5269 </tr>
5270 <tr>
5271 <td>Password</td>
5272 <td>The password of the cPanel user</td>
5273 </tr>
5274 <tr>
5275 <td>Troubleshoot</td>
5276 <td>
5277 <b>Common cPanel Connection Issues:</b><br/>
5278 - Your host does not use <a href="http://cpanel.com/" target="_blank">cPanel Software</a> <br/>
5279 - Your host has disabled cPanel API access <br/>
5280 - Your host has configured cPanel to work differently (please contact your host) <br/>
5281 - View a list of valid cPanel <a href='https://snapcreek.com/wordpress-hosting/' target='_blank'>Supported Hosts</a>
5282 </td>
5283 </tr>
5284 </table>
5285 <br/><br/>
5286
5287 <!-- DATABASE SETUP-->
5288 <h3>Setup</h3>
5289 The database setup options allow you to connect to an existing database or in the case of cPanel connect or create a new database.
5290 <table class="help-opt">
5291 <tr>
5292 <th>Option</th>
5293 <th>Details</th>
5294 </tr>
5295 <tr>
5296 <td>Action</td>
5297 <td>
5298 <b>Create New Database:</b> Will attempt to create a new database if it does not exist. When using the 'Basic' option this option will not work on many
5299 hosting providers as the ability to create new databases is normally locked down. If the database does not exist then you will need to login to your
5300 control panel and create the database. If your host supports 'cPanel' then you can use this option to create a new database after logging in via your
5301 cPanel account.
5302 <br/><br/>
5303
5304 <b>Connect and Remove All Data:</b> This options will DELETE all tables in the database you are connecting to. Please make sure you have
5305 backups of all your data before using an portion of the installer, as this option WILL remove all data.
5306 <br/><br/>
5307
5308 <b>Connect and Backup Any Existing Data:</b><sup>pro</sup> This options will RENAME all tables in the database you are connecting to with a prefix of
5309 "<?php echo $GLOBALS['DB_RENAME_PREFIX'] ?>".
5310 <br/><br/>
5311
5312 <b>Manual SQL Execution:</b><sup>pro</sup> This options requires that you manually run your own SQL import to an existing database before running the installer.
5313 When this action is selected the database.sql file found inside the archive.zip file will NOT be ran. The database your connecting to should already
5314 be a valid WordPress installed database. This option is viable when you need to run advanced search and replace options on the database.
5315 <br/><br/>
5316
5317 </td>
5318 </tr>
5319 <tr>
5320 <td>Host</td>
5321 <td>The name of the host server that the database resides on. Many times this will be 'localhost', however each hosting provider will have it's own naming
5322 convention please check with your server administrator or host to valid for sure the name needed. To add a port number just append it to the host i.e.
5323 'localhost:3306'.</td>
5324 </tr>
5325 <tr>
5326 <td>Database</td>
5327 <td>The name of the database to which this installation will connect and install the new tables and data into. Some hosts will require a prefix while others
5328 do not. Be sure to know exactly how your host requires the database name to be entered.</td>
5329 </tr>
5330 <tr>
5331 <td>User</td>
5332 <td>The name of a MySQL database server user. This is special account that has privileges to access a database and can read from or write to that database.
5333 <i>This is <b>not</b> the same thing as your WordPress administrator account</i>.</td>
5334 </tr>
5335 <tr>
5336 <td>Password</td>
5337 <td>The password of the MySQL database server user.</td>
5338 </tr>
5339
5340 </table>
5341 <br/><br/>
5342
5343 <!-- OPTIONS-->
5344 <h3>Options</h3>
5345 <table class="help-opt">
5346 <tr>
5347 <th>Option</th>
5348 <th>Details</th>
5349 </tr>
5350 <tr>
5351 <td>Prefix<sup>pro*</sup></td>
5352 <td>By default, databases are prefixed with the cPanel account's username (for example, myusername_databasename). However you can ignore this option if
5353 your host does not use the default cPanel username prefix schema. Check the 'Ignore cPanel Prefix' and the username prefixes will be ignored.
5354 This will still require you to enter in the cPanels required setup prefix if they require one. The checkbox will be set to read-only if your host has
5355 disabled prefix settings. Please see your host full requirements when using the cPanel options.</td>
5356 </tr>
5357 <tr>
5358 <td>Legacy</td>
5359 <td>When creating a database table, the Mysql version being used may not support the collation type of the Mysql version where the table was created.
5360 In this scenario, the installer will fallback to a legacy collation type to try and create the table. This value should only be checked if you receive an error when
5361 testing the database.
5362 <br/><br/>
5363 For example, if the database was created on MySQL 5.7 and the tables collation type was 'utf8mb4_unicode_520_ci', however your trying to run the installer
5364 on an older MySQL 5.5 engine that does not support that type then an error will be thrown. If this option is checked then the legacy setting will try to
5365 use 'utf8mb4_unicode_520', then 'utf8mb4', then 'utf8' and so on until it runs out of options.
5366 <br/><br/>
5367 For more information about this feature see the online FAQ question titled
5368 <a href="https://snapcreek.com/duplicator/docs/faqs-tech/#faq-installer-110-q" target="_blank">"What is compatibility mode & 'unknown collation' errors"</a>
5369 </td>
5370 </tr>
5371 <tr>
5372 <td>Spacing</td>
5373 <td>The process will remove utf8 characters represented as 'xC2' 'xA0' and replace with a uniform space. Use this option if you find strange question
5374 marks in you posts</td>
5375 </tr>
5376 <tr>
5377 <td>Mode</td>
5378 <td>The MySQL mode option will allow you to set the mode for this session. It is very useful when running into conversion issues. For a full overview please
5379 see the <a href="https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html" target="_blank">MySQL mode documentation</a> specific to your version.</td>
5380 </tr>
5381 <tr>
5382 <td>Charset</td>
5383 <td>When the database is populated from the SQL script it will use this value as part of its connection. Only change this value if you know what your
5384 databases character set should be.</td>
5385 </tr>
5386 <tr>
5387 <td>Collation</td>
5388 <td>When the database is populated from the SQL script it will use this value as part of its connection. Only change this value if you know what your
5389 databases collation set should be.</td>
5390 </tr>
5391 </table>
5392 <sup>*cPanel Only Option</sup>
5393 <br/><br/>
5394
5395 <h3>Validation</h3>
5396 Testing the database connection is important and can help isolate possible issues that may arise with database version and compatibility issues.
5397
5398 <table class="help-opt">
5399 <tr>
5400 <th>Option</th>
5401 <th>Details</th>
5402 </tr>
5403 <tr>
5404 <td>Test<br/>Database</td>
5405 <td>
5406 The 'Test Database' button will help validate if the connection parameters are correct for this server and help with details about any issues
5407 that may arise.
5408 </td>
5409 </tr>
5410 <tr>
5411 <td>Troubleshoot</td>
5412 <td>
5413 <b>Common Database Connection Issues:</b><br/>
5414 - Double check case sensitive values 'User', 'Password' & the 'Database Name' <br/>
5415 - Validate the database and database user exist on this server <br/>
5416 - Check if the database user has the correct permission levels to this database <br/>
5417 - The host 'localhost' may not work on all hosting providers <br/>
5418 - Contact your hosting provider for the exact required parameters <br/>
5419 - Visit the online resources 'Common FAQ page' <br/>
5420
5421 </td>
5422 </tr>
5423 </table>
5424 <br/><br/>
5425</div><br/>
5426
5427
5428<!-- ============================================
5429STEP 3
5430============================================== -->
5431<a class="help-target" name="help-s3"></a>
5432<h2>Step <span class="step">3</span> of 4: Update Data</h2>
5433<div id="dup-help-step2" class="help-page">
5434
5435 <!-- SETTINGS-->
5436 <h3>New Settings</h3>
5437 These are the new values (URL, Path and Title) you can update for the new location at which your site will be installed at.
5438 <br/><br/>
5439
5440 <h3>Replace <sup>pro</sup></h3>
5441 This section will allow you to add as many custom search and replace items that you would like. For example you can search for other URLs to replace. Please use high
5442 caution when using this feature as it can have unintended consequences as it will search the entire database. It is recommended to only use highly unique items such as
5443 full URL or file paths with this option.
5444 <br/><br/>
5445
5446 <!-- ADVANCED OPTS -->
5447 <h3>Options</h3>
5448 <table class="help-opt">
5449 <tr>
5450 <th>Option</th>
5451 <th>Details</th>
5452 </tr>
5453 <tr>
5454 <td colspan="2" class="section">New Admin Account</td>
5455 </tr>
5456 <tr>
5457 <td>Username</td>
5458 <td>A new WordPress username to create. This will create a new WordPress administrator account. Please note that usernames are not changeable from the within the UI.</td>
5459 </tr>
5460 <tr>
5461 <td>Password</td>
5462 <td>The new password for the new user. Must be at least 6 characters long.</td>
5463 </tr>
5464 <tr>
5465 <td colspan="2" class="section">Scan Options</td>
5466 </tr>
5467 <tr>
5468 <td>Cleanup <sup>pro</sup></td>
5469 <td>The checkbox labeled Remove schedules & storage endpoints will empty the Duplicator schedule and storage settings. This is recommended to keep enabled so that you do not have unwanted schedules and storage options enabled.</td>
5470 </tr>
5471 <tr>
5472 <td>Old URL</td>
5473 <td>The old URL of the original values that the package was created with. These values should not be changed, unless you know the underlying reasons</td>
5474 </tr>
5475 <tr>
5476 <td>Old Path</td>
5477 <td>The old path of the original values that the package was created with. These values should not be changed, unless you know the underlying reasons</td>
5478 </tr>
5479 <tr>
5480 <td>Site URL</td>
5481 <td> For details see WordPress <a href="http://codex.wordpress.org/Changing_The_Site_URL" target="_blank">Site URL</a> & <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory" target="_blank">Alternate Directory</a>. If you're not sure about this value then leave it the same as the new settings URL.</td>
5482 </tr>
5483 <tr>
5484 <td>Scan Tables</td>
5485 <td>Select the tables to be updated. This process will update all of the 'Old Settings' with the 'New Settings'. Hold down the 'ctrl key' to select/deselect multiple.</td>
5486 </tr>
5487 <tr>
5488 <td>Activate Plugins</td>
5489 <td>These plug-ins are the plug-ins that were activated when the package was created and represent the plug-ins that will be activated after the install.</td>
5490 </tr>
5491 <tr>
5492 <td>Full Search</td>
5493 <td>Full search forces a scan of every single cell in the database. If it is not checked then only text based columns are searched which makes the update process much faster.
5494 Use this option if you have issues with data not updating correctly.</td>
5495 </tr>
5496 <tr>
5497 <td>Post GUID</td>
5498 <td>If your moving a site keep this value checked. For more details see the <a href="http://codex.wordpress.org/Changing_The_Site_URL#Important_GUID_Note" target="_blank">notes on GUIDS</a>. Changing values in the posts table GUID column can change RSS readers to evaluate that the posts are new and may show them in feeds again.</td>
5499 </tr>
5500 <tr>
5501 <td colspan="2" class="section">WP-Config File</td>
5502 </tr>
5503 <tr>
5504 <td>Config SSL</td>
5505 <td>Turn off SSL support for WordPress. This sets FORCE_SSL_ADMIN in your wp-config file to false if true, otherwise it will create the setting if not set. The "Enforce on Login"
5506 will turn off SSL support for WordPress Logins.</td>
5507 </tr>
5508 <tr>
5509 <td>Config Cache</td>
5510 <td>Turn off Cache support for WordPress. This sets WP_CACHE in your wp-config file to false if true, otherwise it will create the setting if not set. The "Keep Home Path"
5511 sets WPCACHEHOME in your wp-config file to nothing if true, otherwise nothing is changed.</td>
5512 </tr>
5513 </table>
5514 <br/><br/>
5515</div><br/>
5516
5517
5518<!-- ============================================
5519STEP 4
5520============================================== -->
5521<a class="help-target" name="help-s4"></a>
5522<h2>Step <span class="step">4</span> of 4: Test Site</h2>
5523<div id="dup-help-step3" class="help-page">
5524 <h3>Final Steps</h3>
5525
5526 <b>Review Install Report</b><br/>
5527 The install report is designed to give you a synopsis of the possible errors and warnings that may exist after the installation is completed.
5528 <br/><br/>
5529
5530 <b>Test Site</b><br/>
5531 After the install is complete run through your entire site and test all pages and posts.
5532 <br/><br/>
5533
5534 <b>Security Cleanup</b><br/>
5535 When you're completed with the installation please delete all installation files. Leaving these files on your server can impose a security risk!
5536 <br/><br/>
5537
5538</div>
5539
5540
5541<a class="help-target" name="help-s5"></a>
5542<h2>Troubleshooting Tips</h2>
5543<div id="troubleshoot" class="help-page">
5544
5545 <div style="padding: 0px 10px 10px 10px;">
5546 <b>Common Quick Fix Issues:</b>
5547 <ul>
5548 <li>Use an <a href='https://snapcreek.com/wordpress-hosting/' target='_blank'>approved hosting provider</a></li>
5549 <li>Validate directory and file permissions (see below)</li>
5550 <li>Validate web server configuration file (see below)</li>
5551 <li>Clear your browsers cache</li>
5552 <li>Deactivate and reactivate all plugins</li>
5553 <li>Resave a plugins settings if it reports errors</li>
5554 <li>Make sure your root directory is empty</li>
5555 </ul>
5556
5557 <b>Permissions:</b><br/>
5558 Not all operating systems are alike. Therefore, when you move a package (zip file) from one location to another the file and directory permissions may not always stick. If this is the case then check your WordPress directories and make sure it's permissions are set to 755. For files make sure the permissions are set to 644 (this does not apply to windows servers). Also pay attention to the owner/group attributes. For a full overview of the correct file changes see the <a href='http://codex.wordpress.org/Hardening_WordPress#File_permissions' target='_blank'>WordPress permissions codex</a>
5559 <br/><br/>
5560
5561 <b>Web server configuration files:</b><br/>
5562 For Apache web server the root .htaccess file was copied to .htaccess.orig. A new stripped down .htaccess file was created to help simplify access issues. For IIS web server the web.config file was copied to web.config.orig, however no new web.config file was created. If you have not altered this file manually then resaving your permalinks and resaving your plugins should resolve most all changes that were made to the root web configuration file. If your still experiencing issues then open the .orig file and do a compare to see what changes need to be made. <br/><br/><b>Plugin Notes:</b><br/> It's impossible to know how all 3rd party plugins function. The Duplicator attempts to fix the new install URL for settings stored in the WordPress options table. Please validate that all plugins retained there settings after installing. If you experience issues try to bulk deactivate all plugins then bulk reactivate them on your new duplicated site. If you run into issues were a plugin does not retain its data then try to resave the plugins settings.
5563 <br/><br/>
5564
5565 <b>Cache Systems:</b><br/>
5566 Any type of cache system such as Super Cache, W3 Cache, etc. should be emptied before you create a package. Another alternative is to include the cache directory in the directory exclusion path list found in the options dialog. Including a directory such as \pathtowordpress\wp-content\w3tc\ (the w3 Total Cache directory) will exclude this directory from being packaged. In is highly recommended to always perform a cache empty when you first fire up your new site even if you excluded your cache directory.
5567 <br/><br/>
5568
5569 <b>Trying Again:</b><br/>
5570 If you need to retry and reinstall this package you can easily run the process again by deleting all files except the installer and package file and then browse to the installer again.
5571 <br/><br/>
5572
5573 <b>Additional Notes:</b><br/>
5574 If you have made changes to your PHP files directly this might have an impact on your duplicated site. Be sure all changes made will correspond to the sites new location.
5575 Only the package (zip file) and the installer (php file) should be in the directory where you are installing the site. Please read through our knowledge base before submitting any issues.
5576 If you have a large log file that needs evaluated please email the file, or attach it to a help ticket.
5577 <br/><br/>
5578
5579 </div>
5580
5581</div>
5582
5583<div style="text-align:center">For additional help please visit the <a href="https://snapcreek.com/support/docs/" target="_blank">online resources</a></div>
5584
5585<br/><br/>
5586</div>
5587<!-- END OF VIEW HELP -->
5588 <?php
5589}
5590
5591?>
5592</div>
5593</div><br/>
5594
5595
5596<!-- CONFIRM DIALOG -->
5597<div id="dialog-server-info" style="display:none">
5598 <!-- DETAILS -->
5599 <div class="dlg-serv-info">
5600 <?php
5601 $ini_path = php_ini_loaded_file();
5602 $ini_max_time = ini_get('max_execution_time');
5603 $ini_memory = ini_get('memory_limit');
5604 ?>
5605 <div class="hdr">Current Server</div>
5606 <label>Web Server:</label> <?php echo $_SERVER['SERVER_SOFTWARE']; ?><br/>
5607 <label>Operating System:</label> <?php echo PHP_OS ?><br/>
5608 <label>PHP Version:</label> <?php echo DUPX_Server::$php_version; ?><br/>
5609 <label>PHP INI Path:</label> <?php echo empty($ini_path ) ? 'Unable to detect loaded php.ini file' : $ini_path; ?> <br/>
5610 <label>PHP SAPI:</label> <?php echo php_sapi_name(); ?><br/>
5611 <label>PHP ZIP Archive:</label> <?php echo class_exists('ZipArchive') ? 'Is Installed' : 'Not Installed'; ?> <br/>
5612 <label>PHP max_execution_time:</label> <?php echo $ini_max_time === false ? 'unable to find' : $ini_max_time; ?><br/>
5613 <label>PHP memory_limit:</label> <?php echo empty($ini_memory) ? 'unable to find' : $ini_memory; ?><br/>
5614
5615 <br/>
5616 <div class="hdr">Package Server</div>
5617 <div class="info-txt">The server where the package was created</div>
5618 <label>Plugin Version:</label> <?php echo $GLOBALS['FW_VERSION_DUP'] ?><br/>
5619 <label>WordPress Version:</label> <?php echo $GLOBALS['FW_VERSION_WP'] ?><br/>
5620 <label>PHP Version:</label> <?php echo $GLOBALS['FW_VERSION_PHP'] ?><br/>
5621 <label>Database Version:</label> <?php echo $GLOBALS['FW_VERSION_DB'] ?><br/>
5622 <label>Operating System:</label> <?php echo $GLOBALS['FW_VERSION_OS'] ?><br/>
5623 <br/><br/>
5624 </div>
5625</div>
5626
5627<script>
5628/* Server Info Dialog*/
5629DUPX.showServerInfo = function()
5630{
5631 modal({
5632 type: 'alert',
5633 title: 'Server Information',
5634 text: $('#dialog-server-info').html()
5635 });
5636}
5637</script>
5638
5639</body>
5640</html>